@salesgenterp/ui-components 0.4.354 → 0.4.356

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
@@ -5210,137 +5210,101 @@ var CartDrawerEmptyCart = styled__default.div(_templateObject7$3 || (_templateOb
5210
5210
  return props.color || 'red';
5211
5211
  });
5212
5212
 
5213
- var _templateObject$s, _templateObject2$i, _templateObject3$c;
5214
- var CartDrawerProduct = styled__default.div(_templateObject$s || (_templateObject$s = _taggedTemplateLiteralLoose(["\n width: 100%;\n display: flex;\n flex-direction: row;\n height: 100px;\n justify-content: space-around;\n align-items: center;\n overflow: hidden;\n margin-bottom: 2rem;\n user-select: none;\n\n img {\n width: 20%;\n max-height: 100%;\n /* aspect-ratio: 1; */\n object-fit: cover;\n }\n .middleSection {\n width: 60%;\n padding-left: 0.8rem;\n height: 100%;\n h6 {\n font-size: 1.1rem;\n font-weight: bold;\n margin: 0;\n\n span {\n font-size: 0.8rem;\n color: grey;\n text-decoration: line-through;\n margin-right: 0.5rem;\n }\n }\n .name {\n font-size: 0.9rem;\n line-height: 1.2rem;\n width: 100%;\n word-wrap: break-word;\n overflow: hidden;\n text-overflow: ellipsis;\n transition: 0.3s;\n cursor: pointer;\n &:hover {\n color: ", ";\n }\n }\n }\n .endSection {\n width: 20%;\n height: 95%;\n .icon {\n cursor: pointer;\n transition: 0.4s;\n &:hover {\n color: red;\n /* opacity: 0.7; */\n }\n }\n }\n @media only screen and (max-width: 768px) {\n .closeIcon {\n font-size: 1rem;\n }\n }\n @media only screen and (max-width: 340px) {\n .middleSection {\n h6 {\n font-size: 0.9rem;\n }\n }\n }\n"])), function (props) {
5215
- return props.color || 'grey';
5216
- });
5217
- var CartDrawerQtBox = styled__default.div(_templateObject2$i || (_templateObject2$i = _taggedTemplateLiteralLoose(["\n height: 34px;\n width: 82px;\n border: 1px solid rgb(211, 210, 210);\n display: flex;\n align-items: center;\n justify-content: space-between;\n font-size: 13.5px;\n color: #333;\n padding: 0 0.5rem;\n border-radius: 5px;\n max-width: 100%;\n\n span {\n cursor: pointer;\n height: 100%;\n display: grid;\n place-items: center;\n }\n .qt {\n font-size: 12px;\n color: black;\n font-weight: 500;\n cursor: auto;\n }\n @media only screen and (max-width: 600px) {\n min-width: 55px;\n aspect-ratio: 1/2;\n /* min-height: 28px; */\n font-size: 10px;\n }\n @media only screen and (max-width: 340px) {\n min-width: 50px;\n aspect-ratio: 1/2;\n height: 22px;\n font-size: 8px;\n }\n"])));
5218
- var CartDrawerLoader = styled__default.div(_templateObject3$c || (_templateObject3$c = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: 30%;\n width: 100px;\n height: 100px;\n display: grid;\n place-items: center;\n"])));
5219
-
5220
- var CartDrawerProductCard = function CartDrawerProductCard(_ref) {
5221
- var product = _ref.product,
5222
- color = _ref.color,
5223
- handleIncrementDecrement = _ref.handleIncrementDecrement,
5224
- handleRemoveProduct = _ref.handleRemoveProduct,
5225
- handleRedirect = _ref.handleRedirect,
5226
- imgnotfoundUrl = _ref.imgnotfoundUrl,
5227
- loading = _ref.loading;
5228
- var imgnotfoundUrlcommon = noImgAvailable$1;
5229
- if (imgnotfoundUrl && imgnotfoundUrl !== 'null') imgnotfoundUrlcommon = imgnotfoundUrl;
5230
- return /*#__PURE__*/React__default.createElement(CartDrawerProduct, {
5231
- color: color
5232
- }, /*#__PURE__*/React__default.createElement("img", {
5233
- src: product.imageUrl && product.imageUrl !== 'null' ? product.imageUrl : imgnotfoundUrlcommon,
5234
- alt: 'no product image available'
5235
- }), /*#__PURE__*/React__default.createElement(material.Stack, {
5236
- flexDirection: "column",
5237
- justifyContent: "space-between",
5238
- alignItems: "flex-start",
5239
- className: "middleSection"
5240
- }, /*#__PURE__*/React__default.createElement(material.Tooltip, {
5241
- title: product === null || product === void 0 ? void 0 : product.productName,
5242
- placement: "top",
5243
- arrow: true
5244
- }, /*#__PURE__*/React__default.createElement("h6", {
5245
- className: "name",
5246
- onClick: function onClick() {
5247
- return handleRedirect(product);
5248
- }
5249
- }, product === null || product === void 0 ? void 0 : product.productName)), /*#__PURE__*/React__default.createElement("h6", null, (product === null || product === void 0 ? void 0 : product.standardPrice) === (product === null || product === void 0 ? void 0 : product.cartStandardPrice) ? "$" + (product === null || product === void 0 ? void 0 : product.standardPrice) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, (product === null || product === void 0 ? void 0 : product.cartStandardPrice) && /*#__PURE__*/React__default.createElement("span", null, renderMoney(product === null || product === void 0 ? void 0 : product.cartStandardPrice)), renderMoney(product === null || product === void 0 ? void 0 : product.standardPrice)))), /*#__PURE__*/React__default.createElement(material.Stack, {
5250
- flexDirection: "column",
5251
- justifyContent: "space-between",
5252
- alignItems: "flex-end",
5253
- className: "endSection"
5254
- }, /*#__PURE__*/React__default.createElement(ri.RiDeleteBin5Line, {
5255
- className: "icon",
5256
- onClick: function onClick() {
5257
- if (loading) return;
5258
- var sure = confirm('Are you sure you want to remove this item from cart');
5259
- if (!sure) return;
5260
- handleRemoveProduct(product);
5261
- }
5262
- }), /*#__PURE__*/React__default.createElement(CartDrawerQtBox, null, /*#__PURE__*/React__default.createElement("span", {
5263
- onClick: function onClick() {
5264
- if (loading) return;
5265
- handleIncrementDecrement('decrement', _extends({}, product, {
5266
- quantity: (product === null || product === void 0 ? void 0 : product.quantity) > (product === null || product === void 0 ? void 0 : product.availableQuantity) ? product === null || product === void 0 ? void 0 : product.availableQuantity : product === null || product === void 0 ? void 0 : product.quantity
5267
- }));
5268
- }
5269
- }, ' ', /*#__PURE__*/React__default.createElement(ai.AiOutlineMinus, null)), ' ', /*#__PURE__*/React__default.createElement("span", {
5270
- className: 'qt'
5271
- }, product === null || product === void 0 ? void 0 : product.quantity), /*#__PURE__*/React__default.createElement("span", {
5272
- onClick: function onClick() {
5273
- if (loading) return;
5274
- handleIncrementDecrement('increment', _extends({}, product, product, {
5275
- quantity: (product === null || product === void 0 ? void 0 : product.quantity) > (product === null || product === void 0 ? void 0 : product.availableQuantity) ? product === null || product === void 0 ? void 0 : product.availableQuantity : product === null || product === void 0 ? void 0 : product.quantity
5276
- }));
5213
+ function debounce(func, wait, immediate) {
5214
+ var timeout;
5215
+ return function () {
5216
+ var _this = this;
5217
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
5218
+ args[_key] = arguments[_key];
5277
5219
  }
5278
- }, /*#__PURE__*/React__default.createElement(ai.AiOutlinePlus, null)))));
5279
- };
5220
+ clearTimeout(timeout);
5221
+ timeout = setTimeout(function () {
5222
+ timeout = null;
5223
+ if (!immediate) func.apply(_this, args);
5224
+ }, wait);
5225
+ if (immediate && !timeout) func.apply(this, [].concat(args));
5226
+ };
5227
+ }
5280
5228
 
5281
- var CartDrawer = function CartDrawer(_ref) {
5282
- var _cartData$cartLineIte, _cartData$totalCartPr;
5283
- var cartData = _ref.cartData,
5284
- maxWidth = _ref.maxWidth,
5285
- color = _ref.color,
5286
- handleRedirect = _ref.handleRedirect,
5287
- handleIncrementDecrement = _ref.handleIncrementDecrement,
5288
- handleRemoveProduct = _ref.handleRemoveProduct,
5289
- handleClose = _ref.handleClose,
5290
- loading = _ref.loading,
5291
- imgnotfoundUrl = _ref.imgnotfoundUrl;
5292
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(CartDrawerContainer, {
5293
- className: "cartDrawer-container",
5294
- maxWidth: maxWidth
5295
- }, /*#__PURE__*/React__default.createElement(CartDrawerBar, null, /*#__PURE__*/React__default.createElement("h2", null, "Your Cart"), /*#__PURE__*/React__default.createElement(gr.GrClose, {
5296
- className: "icon",
5297
- onClick: function onClick() {
5298
- handleClose();
5299
- }
5300
- })), /*#__PURE__*/React__default.createElement(material.Box, null, cartData && (cartData === null || cartData === void 0 ? void 0 : cartData.totalCartQuantity) > 0 ? /*#__PURE__*/React__default.createElement(CartDrawerProductContainer, {
5301
- opacity: loading ? '.4' : '1'
5302
- }, cartData === null || cartData === void 0 ? void 0 : (_cartData$cartLineIte = cartData.cartLineItemDtoList) === null || _cartData$cartLineIte === void 0 ? void 0 : _cartData$cartLineIte.map(function (product, i) {
5303
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, loading && /*#__PURE__*/React__default.createElement(CartDrawerLoader, null, /*#__PURE__*/React__default.createElement(reactSpinners.PuffLoader, {
5304
- color: "black"
5305
- })), /*#__PURE__*/React__default.createElement(CartDrawerProductCard, {
5306
- product: product,
5307
- handleRedirect: handleRedirect,
5308
- handleIncrementDecrement: handleIncrementDecrement,
5309
- handleRemoveProduct: handleRemoveProduct,
5310
- color: color,
5311
- key: i,
5312
- imgnotfoundUrl: imgnotfoundUrl,
5313
- loading: loading
5314
- }));
5315
- })) : /*#__PURE__*/React__default.createElement(CartDrawerEmptyCart, {
5316
- color: color
5317
- }, /*#__PURE__*/React__default.createElement(bs.BsCartX, {
5318
- className: "icon"
5319
- }), /*#__PURE__*/React__default.createElement("h6", null, "Oops!"), /*#__PURE__*/React__default.createElement("p", null, "your cart is empty"))), cartData && (cartData === null || cartData === void 0 ? void 0 : cartData.totalCartQuantity) > 0 && /*#__PURE__*/React__default.createElement(CartDrawerBottomSection, null, /*#__PURE__*/React__default.createElement(material.Stack, {
5320
- flexDirection: "row",
5321
- justifyContent: "space-between",
5322
- alignItems: "center",
5323
- className: "row"
5324
- }, /*#__PURE__*/React__default.createElement("h5", null, "Subtotal", /*#__PURE__*/React__default.createElement("span", null, "(", cartData === null || cartData === void 0 ? void 0 : cartData.totalCartQuantity, " items)")), /*#__PURE__*/React__default.createElement("h5", null, "$", cartData === null || cartData === void 0 ? void 0 : (_cartData$totalCartPr = cartData.totalCartPrice) === null || _cartData$totalCartPr === void 0 ? void 0 : _cartData$totalCartPr.toFixed(2))), /*#__PURE__*/React__default.createElement(CartDrawerOutlinedButton, {
5325
- color: color,
5326
- onClick: function onClick() {
5327
- return handleRedirect('cart');
5328
- }
5329
- }, "view cart"), /*#__PURE__*/React__default.createElement(CartDrawerFilledButton, {
5330
- color: color,
5331
- onClick: function onClick() {
5332
- return handleRedirect('checkout');
5333
- }
5334
- }, "continue to checkout"))));
5229
+ function useWindowSize() {
5230
+ var isWindow = typeof window !== 'undefined';
5231
+ var _useState = React.useState({
5232
+ width: isWindow ? window.innerWidth : 1200,
5233
+ height: isWindow ? window.innerHeight : 800
5234
+ }),
5235
+ windowSize = _useState[0],
5236
+ setWindowSize = _useState[1];
5237
+ React.useEffect(function () {
5238
+ var onWindowResize = function onWindowResize() {
5239
+ setWindowSize({
5240
+ width: window.innerWidth,
5241
+ height: window.innerHeight
5242
+ });
5243
+ };
5244
+ var onResize = debounce(onWindowResize, 100);
5245
+ window.addEventListener('resize', onResize);
5246
+ onWindowResize();
5247
+ return function () {
5248
+ window.removeEventListener('resize', onResize);
5249
+ };
5250
+ }, []);
5251
+ return windowSize;
5252
+ }
5253
+
5254
+ var Breakpoint = function Breakpoint() {};
5255
+ Breakpoint.xs = 'xs';
5256
+ Breakpoint.sm = 'sm';
5257
+ Breakpoint.md = 'md';
5258
+ Breakpoint.lg = 'lg';
5259
+ Breakpoint.xl = 'xl';
5260
+ Breakpoint.xxl = 'xxl';
5261
+
5262
+ var Variant = function Variant() {};
5263
+ Variant.ONE = 'one';
5264
+ Variant.TWO = 'two';
5265
+ Variant.THREE = 'three';
5266
+
5267
+ var getBreakpoint = function getBreakpoint(_ref) {
5268
+ var screen = _ref.width;
5269
+ var breakpoint = '';
5270
+ if (screen <= 320) {
5271
+ breakpoint = Breakpoint.xs;
5272
+ }
5273
+ if (screen >= 375) {
5274
+ breakpoint = Breakpoint.sm;
5275
+ }
5276
+ if (screen >= 768) {
5277
+ breakpoint = Breakpoint.md;
5278
+ }
5279
+ if (screen >= 992) {
5280
+ breakpoint = Breakpoint.lg;
5281
+ }
5282
+ if (screen >= 1200) {
5283
+ breakpoint = Breakpoint.xl;
5284
+ }
5285
+ if (screen >= 1600) {
5286
+ breakpoint = Breakpoint.xxl;
5287
+ }
5288
+ return breakpoint;
5335
5289
  };
5290
+ function useGridSize() {
5291
+ var windowSize = useWindowSize();
5292
+ var _useState = React.useState(Breakpoint.md),
5293
+ layout = _useState[0],
5294
+ setLayout = _useState[1];
5295
+ React.useEffect(function () {
5296
+ setLayout(getBreakpoint(windowSize));
5297
+ }, [windowSize]);
5298
+ return layout;
5299
+ }
5336
5300
 
5337
- var _templateObject$t, _templateObject2$j, _templateObject3$d, _templateObject4$9, _templateObject5$7, _templateObject6$5, _templateObject7$4, _templateObject8$3, _templateObject9$3;
5338
- var CartPageSection = styled__default.section(_templateObject$t || (_templateObject$t = _taggedTemplateLiteralLoose(["\n background: ", ";\n max-width: 100%;\n width: fit-content;\n background: ", ";\n overflow: hidden;\n border-radius: 28px;\n max-width: 1600px;\n width: min(1600px, 100%);\n margin: auto;\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) {
5301
+ var _templateObject$s, _templateObject2$i, _templateObject3$c, _templateObject4$9, _templateObject5$7, _templateObject6$5, _templateObject7$4, _templateObject8$3, _templateObject9$3;
5302
+ var CartPageSection = styled__default.section(_templateObject$s || (_templateObject$s = _taggedTemplateLiteralLoose(["\n background: ", ";\n max-width: 100%;\n width: fit-content;\n background: ", ";\n overflow: hidden;\n border-radius: 28px;\n max-width: 1600px;\n width: min(1600px, 100%);\n margin: auto;\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) {
5339
5303
  return props.bg;
5340
5304
  }, function (props) {
5341
5305
  return props.bg || '#FAE8E5';
5342
5306
  });
5343
- var CartPageContainer = styled__default.div(_templateObject2$j || (_templateObject2$j = _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: 1rem;\n padding-bottom: 2em;\n border-radius: 12px;\n opacity: ", ";\n .scrollDiv {\n width: 68%;\n height: 630px;\n max-height: 630px;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n margin-right: 0.3em;\n &::-webkit-scrollbar {\n width: 10px;\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 /* 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: 1rem 0;\n .scrollDiv {\n width: 100%;\n margin: 0;\n margin-bottom: 2em;\n // padding: 0 0.4em;\n }\n }\n"])), function (props) {
5307
+ var CartPageContainer = styled__default.div(_templateObject2$i || (_templateObject2$i = _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: 1rem;\n padding-bottom: 2em;\n border-radius: 12px;\n opacity: ", ";\n .scrollDiv {\n width: 68%;\n height: 630px;\n max-height: 630px;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n margin-right: 0.3em;\n &::-webkit-scrollbar {\n width: 10px;\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 /* 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: 1rem 0;\n .scrollDiv {\n width: 100%;\n margin: 0;\n margin-bottom: 2em;\n // padding: 0 0.4em;\n }\n }\n"])), function (props) {
5344
5308
  return props.maxWidth || '1600px';
5345
5309
  }, function (props) {
5346
5310
  return "min(" + (props.maxWidth || '1600px') + ",100%)";
@@ -5353,7 +5317,7 @@ var CartPageContainer = styled__default.div(_templateObject2$j || (_templateObje
5353
5317
  var _props$scroll2;
5354
5318
  return (props === null || props === void 0 ? void 0 : (_props$scroll2 = props.scroll) === null || _props$scroll2 === void 0 ? void 0 : _props$scroll2.color) || '#BFC3CA';
5355
5319
  });
5356
- var CardsBox = styled__default.div(_templateObject3$d || (_templateObject3$d = _taggedTemplateLiteralLoose(["\n width: 100%;\n /* min-height: 1000px; */\n position: relative;\n margin-right: auto;\n padding: 1em;\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: 12px;\n @media only screen and (max-width: 900px) {\n display: flex;\n }\n @media only screen and (max-width: 768px) {\n padding: 0;\n }\n"])), function (props) {
5320
+ var CardsBox = styled__default.div(_templateObject3$c || (_templateObject3$c = _taggedTemplateLiteralLoose(["\n width: 100%;\n /* min-height: 1000px; */\n position: relative;\n margin-right: auto;\n padding: 1em;\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: 12px;\n @media only screen and (max-width: 900px) {\n display: flex;\n }\n @media only screen and (max-width: 768px) {\n padding: 0;\n }\n"])), function (props) {
5357
5321
  return props.retail ? 'grid' : 'flex';
5358
5322
  });
5359
5323
  var CartHeading = styled__default.div(_templateObject4$9 || (_templateObject4$9 = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n /* margin-bottom: 2em; */\n margin-left: 1em;\n margin-top: 2em;\n @media only screen and (max-width: 768px) {\n margin-left: 1em;\n }\n\n color: ", ";\n h1 {\n font-weight: 600;\n font-size: 2em;\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) {
@@ -6480,12 +6444,12 @@ if (process.env.NODE_ENV !== 'production') {
6480
6444
  }
6481
6445
  });
6482
6446
 
6483
- var _templateObject$u, _templateObject2$k, _templateObject3$e, _templateObject4$a, _templateObject5$8, _templateObject6$6;
6484
- var ProductImage = styled__default.img(_templateObject$u || (_templateObject$u = _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"])));
6485
- var ProductName = styled__default.h6(_templateObject2$k || (_templateObject2$k = _taggedTemplateLiteralLoose(["\n font-size: ", ";\n padding: 0;\n line-height: 1.3em;\n overflow: hidden;\n text-overflow: ellipsis;\n height: fit-content;\n"])), function (props) {
6447
+ var _templateObject$t, _templateObject2$j, _templateObject3$d, _templateObject4$a, _templateObject5$8, _templateObject6$6;
6448
+ var ProductImage = styled__default.img(_templateObject$t || (_templateObject$t = _taggedTemplateLiteralLoose(["\n min-width: 60px;\n min-height: 60px;\n object-fit: contain;\n @media only screen and (max-width: 600px) {\n margin: 0.5em 0;\n padding-right: 0.5em;\n }\n"])));
6449
+ var ProductName = styled__default.h6(_templateObject2$j || (_templateObject2$j = _taggedTemplateLiteralLoose(["\n font-size: ", ";\n padding: 0;\n line-height: 1.3em;\n overflow: hidden;\n text-overflow: ellipsis;\n height: fit-content;\n"])), function (props) {
6486
6450
  return props.size || '1em';
6487
6451
  });
6488
- var CartTableRow = styled__default(material.TableRow)(_templateObject3$e || (_templateObject3$e = _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) {
6452
+ var CartTableRow = styled__default(material.TableRow)(_templateObject3$d || (_templateObject3$d = _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) {
6489
6453
  return props.size || '1.19em';
6490
6454
  }, function (prop) {
6491
6455
  return prop.bg;
@@ -6493,7 +6457,7 @@ var CartTableRow = styled__default(material.TableRow)(_templateObject3$e || (_te
6493
6457
  return prop.bg;
6494
6458
  });
6495
6459
  var CartTableCell$1 = styled__default(material.TableCell)(_templateObject4$a || (_templateObject4$a = _taggedTemplateLiteralLoose(["\n && {\n border: none !important;\n font-size: 1em;\n }\n"])));
6496
- var QuantityBox = styled__default.div(_templateObject5$8 || (_templateObject5$8 = _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"])));
6460
+ var QuantityBox = styled__default.div(_templateObject5$8 || (_templateObject5$8 = _taggedTemplateLiteralLoose(["\n height: 30px;\n width: 86px;\n border: 1px solid rgb(211, 210, 210);\n display: flex;\n align-items: center;\n justify-content: space-between;\n font-size: 13.5px;\n color: #323232;\n padding: 0 0.5rem;\n border-radius: 5px;\n max-width: 100%;\n .icon {\n cursor: pointer;\n height: 100%;\n display: grid;\n place-items: center;\n }\n .qt {\n font-size: 12px;\n color: black;\n font-weight: 500;\n cursor: auto;\n height: 100%;\n input {\n width: 40px;\n height: 100%;\n text-align: center;\n border: none;\n }\n }\n"])));
6497
6461
  var DeleteBtn = styled__default.div(_templateObject6$6 || (_templateObject6$6 = _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"])));
6498
6462
  var CardRow = function CardRow(_ref) {
6499
6463
  var _styles$price, _styles$Btn, _row$standardPrice, _row$subtotal;
@@ -6508,6 +6472,31 @@ var CardRow = function CardRow(_ref) {
6508
6472
  styles = _ref.styles;
6509
6473
  var imgnotfoundUrlcommon = noImgAvailable$1;
6510
6474
  if (imgnotfoundUrl && imgnotfoundUrl !== 'null') imgnotfoundUrlcommon = imgnotfoundUrl;
6475
+ var timer = React.useRef();
6476
+ var _useState = React.useState(row === null || row === void 0 ? void 0 : row.quantity),
6477
+ quantity = _useState[0],
6478
+ setQuantity = _useState[1];
6479
+ React.useEffect(function () {
6480
+ setQuantity(row === null || row === void 0 ? void 0 : row.quantity);
6481
+ }, [row]);
6482
+ var onChangeQuantity = function onChangeQuantity(product) {
6483
+ handleIncrementDecrement(product, product);
6484
+ };
6485
+ var onChangeInput = function onChangeInput(e) {
6486
+ var value = e.target.value;
6487
+ setQuantity(value || 1);
6488
+ if (timer.current) {
6489
+ clearTimeout(timer.current);
6490
+ }
6491
+ timer.current = setTimeout(function () {
6492
+ onChangeQuantity(_extends({}, row, {
6493
+ quantity: checkMinMaxQty({
6494
+ quantity: value,
6495
+ product: row
6496
+ })
6497
+ }));
6498
+ }, 500);
6499
+ };
6511
6500
  return /*#__PURE__*/React__default.createElement(CartTableRow, {
6512
6501
  onClick: function onClick(event) {
6513
6502
  return handleClick(event, row);
@@ -6557,33 +6546,44 @@ var CardRow = function CardRow(_ref) {
6557
6546
  className: "price"
6558
6547
  }, "$", 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$1, {
6559
6548
  align: "center"
6560
- }, /*#__PURE__*/React__default.createElement(QuantityBox, null, /*#__PURE__*/React__default.createElement("div", {
6549
+ }, /*#__PURE__*/React__default.createElement(QuantityBox, null, /*#__PURE__*/React__default.createElement("span", {
6550
+ className: "icon",
6561
6551
  onClick: function onClick(e) {
6562
6552
  e.stopPropagation();
6563
6553
  if (loading) return;
6564
6554
  if ((row === null || row === void 0 ? void 0 : row.availableQuantity) === 0 || (row === null || row === void 0 ? void 0 : row.quantity) === 1) {
6565
6555
  return handleRemoveProduct(row);
6566
6556
  }
6567
- handleIncrementDecrement('decrement', _extends({}, row, {
6568
- 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
6557
+ onChangeQuantity(_extends({}, row, {
6558
+ quantity: checkMinMaxQty({
6559
+ quantity: (row === null || row === void 0 ? void 0 : row.quantity) - 1,
6560
+ product: row
6561
+ })
6569
6562
  }));
6570
6563
  }
6571
6564
  }, /*#__PURE__*/React__default.createElement(ai.AiOutlineMinus, {
6572
6565
  style: {
6573
6566
  fontSize: 'inherit'
6574
6567
  }
6575
- })), /*#__PURE__*/React__default.createElement("div", {
6576
- className: "price"
6577
- }, /*#__PURE__*/React__default.createElement("p", null, row === null || row === void 0 ? void 0 : row.quantity)), /*#__PURE__*/React__default.createElement("div", {
6578
- className: "add",
6568
+ })), /*#__PURE__*/React__default.createElement("span", {
6569
+ className: "qt"
6570
+ }, /*#__PURE__*/React__default.createElement("input", {
6571
+ type: "number",
6572
+ value: quantity,
6573
+ onChange: onChangeInput
6574
+ })), /*#__PURE__*/React__default.createElement("span", {
6575
+ className: "icon",
6579
6576
  onClick: function onClick(e) {
6580
6577
  e.stopPropagation();
6581
6578
  if (loading) return;
6582
6579
  if ((row === null || row === void 0 ? void 0 : row.availableQuantity) === 0) {
6583
6580
  return handleRemoveProduct(row);
6584
6581
  }
6585
- handleIncrementDecrement('increment', _extends({}, row, {
6586
- 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
6582
+ onChangeQuantity(_extends({}, row, {
6583
+ quantity: checkMinMaxQty({
6584
+ quantity: (row === null || row === void 0 ? void 0 : row.quantity) + 1,
6585
+ product: row
6586
+ })
6587
6587
  }));
6588
6588
  }
6589
6589
  }, /*#__PURE__*/React__default.createElement(ai.AiOutlinePlus, {
@@ -6603,7 +6603,7 @@ var CardRow = function CardRow(_ref) {
6603
6603
  if (loading) return;
6604
6604
  handleRemoveProduct(row);
6605
6605
  }
6606
- }, /*#__PURE__*/React__default.createElement(ai.AiOutlineClose, {
6606
+ }, /*#__PURE__*/React__default.createElement(ri.RiDeleteBin5Line, {
6607
6607
  style: {
6608
6608
  fontSize: 'inherit'
6609
6609
  }
@@ -6847,21 +6847,20 @@ function EnhancedTable(_ref) {
6847
6847
  }, "remove selected")));
6848
6848
  }
6849
6849
 
6850
- var _templateObject$v, _templateObject2$l, _templateObject3$f, _templateObject4$b, _templateObject5$9, _templateObject6$7, _templateObject7$5;
6851
- var CartPageCard = styled__default.div(_templateObject$v || (_templateObject$v = _taggedTemplateLiteralLoose(["\n // width: min(97%, 485px);\n width: 98%;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n padding: 1em;\n background: #ffffff;\n box-shadow: 0px 20px 35px rgba(0, 0, 0, 0.05);\n border-radius: 12px;\n position: relative;\n"])));
6852
- var CartPageImg = styled__default.img(_templateObject2$l || (_templateObject2$l = _taggedTemplateLiteralLoose(["\n width: ", ";\n height: ", ";\n max-width: 50px;\n max-height: 50px;\n position: relative;\n margin-right: 1em;\n"])), function (props) {
6850
+ var _templateObject$u, _templateObject2$k, _templateObject3$e, _templateObject4$b, _templateObject5$9, _templateObject6$7, _templateObject7$5;
6851
+ var CartPageCard = styled__default.div(_templateObject$u || (_templateObject$u = _taggedTemplateLiteralLoose(["\n // width: min(97%, 485px);\n width: 98%;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n padding: 1em;\n background: #ffffff;\n box-shadow: 0px 20px 35px rgba(0, 0, 0, 0.05);\n border-radius: 12px;\n position: relative;\n"])));
6852
+ var CartPageImg = styled__default.img(_templateObject2$k || (_templateObject2$k = _taggedTemplateLiteralLoose(["\n width: ", ";\n height: ", ";\n max-width: 60px;\n max-height: 60px;\n position: relative;\n margin-right: 0.5em;\n"])), function (props) {
6853
6853
  return props.width || 'auto';
6854
6854
  }, function (props) {
6855
6855
  return props.height || 'auto';
6856
6856
  });
6857
- var NameAndQtBox = styled__default.div(_templateObject3$f || (_templateObject3$f = _taggedTemplateLiteralLoose(["\n width: 90%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: space-between;\n position: relative;\n"])));
6857
+ var NameAndQtBox = styled__default.div(_templateObject3$e || (_templateObject3$e = _taggedTemplateLiteralLoose(["\n width: 90%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: space-between;\n position: relative;\n"])));
6858
6858
  var CartPageCardName = styled__default.div(_templateObject4$b || (_templateObject4$b = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n width: 90%;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-bottom: 0.6em;\n h6 {\n color: #323232;\n font-size: 0.9em;\n margin-bottom: 0.6em;\n line-height: 1.3em;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n p {\n font-size: 1.1em;\n font-weight: 600;\n color: #323232;\n }\n"])));
6859
6859
  var QtAndPriceBox = styled__default.div(_templateObject5$9 || (_templateObject5$9 = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n width: 100%;\n .subtotal {\n color: #323232;\n text-transform: capitalize;\n font-weight: bold;\n font-size: 1em;\n }\n"])));
6860
- var CartPageQtBox = styled__default.div(_templateObject6$7 || (_templateObject6$7 = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n max-width: 80px;\n min-width: 80px;\n height: 22px;\n .icon {\n width: 20.5px;\n height: 20.5px;\n display: grid;\n place-items: center;\n font-size: 10px;\n background: #eef1f4;\n cursor: pointer;\n }\n .qt {\n font-size: 18px;\n font-weight: 500;\n display: grid;\n place-items: center;\n color: #323232;\n }\n"])));
6861
- var CloseBtn = styled__default.div(_templateObject7$5 || (_templateObject7$5 = _taggedTemplateLiteralLoose(["\n width: 25px;\n height: 25px;\n display: grid;\n place-items: center;\n position: absolute;\n top: 1em;\n right: 1em;\n cursor: pointer;\n border-radius: 50%;\n background: #eef1f4;\n font-size: 12px;\n"])));
6860
+ var CartPageQtBox = styled__default.div(_templateObject6$7 || (_templateObject6$7 = _taggedTemplateLiteralLoose(["\n height: 30px;\n width: 86px;\n border: 1px solid rgb(211, 210, 210);\n display: flex;\n align-items: center;\n justify-content: space-between;\n font-size: 13.5px;\n color: #323232;\n padding: 0 0.5rem;\n border-radius: 5px;\n max-width: 100%;\n .icon {\n cursor: pointer;\n height: 100%;\n display: grid;\n place-items: center;\n }\n .qt {\n font-size: 12px;\n color: black;\n font-weight: 500;\n cursor: auto;\n height: 100%;\n input {\n width: 40px;\n height: 100%;\n text-align: center;\n border: none;\n }\n }\n"])));
6861
+ var CloseBtn = styled__default.div(_templateObject7$5 || (_templateObject7$5 = _taggedTemplateLiteralLoose(["\n width: 25px;\n height: 25px;\n display: grid;\n place-items: center;\n position: absolute;\n top: 1em;\n right: 1em;\n cursor: pointer;\n border-radius: 50%;\n background: #eef1f4;\n font-size: 12px;\n &:hover {\n color: #ffffff;\n background: red;\n }\n"])));
6862
6862
 
6863
6863
  var CartPageProductCard = function CartPageProductCard(_ref) {
6864
- var _item$standardPrice;
6865
6864
  var item = _ref.item,
6866
6865
  imgnotfoundUrl = _ref.imgnotfoundUrl,
6867
6866
  handleIncrementDecrement = _ref.handleIncrementDecrement,
@@ -6870,6 +6869,31 @@ var CartPageProductCard = function CartPageProductCard(_ref) {
6870
6869
  imgSize = _ref.imgSize;
6871
6870
  var imgnotfoundUrlcommon = noImgAvailable$1;
6872
6871
  if (imgnotfoundUrl && imgnotfoundUrl !== 'null') imgnotfoundUrlcommon = imgnotfoundUrl;
6872
+ var timer = React.useRef();
6873
+ var _useState = React.useState(item === null || item === void 0 ? void 0 : item.quantity),
6874
+ quantity = _useState[0],
6875
+ setQuantity = _useState[1];
6876
+ React.useEffect(function () {
6877
+ setQuantity(item === null || item === void 0 ? void 0 : item.quantity);
6878
+ }, [item]);
6879
+ var onChangeQuantity = function onChangeQuantity(product) {
6880
+ handleIncrementDecrement(product, product);
6881
+ };
6882
+ var onChangeInput = function onChangeInput(e) {
6883
+ var value = e.target.value;
6884
+ setQuantity(value || 1);
6885
+ if (timer.current) {
6886
+ clearTimeout(timer.current);
6887
+ }
6888
+ timer.current = setTimeout(function () {
6889
+ onChangeQuantity(_extends({}, item, {
6890
+ quantity: checkMinMaxQty({
6891
+ quantity: value,
6892
+ product: item
6893
+ })
6894
+ }));
6895
+ }, 500);
6896
+ };
6873
6897
  return /*#__PURE__*/React__default.createElement(CartPageCard, null, /*#__PURE__*/React__default.createElement(CartPageImg, {
6874
6898
  src: item.imageUrl && item.imageUrl !== 'null' ? item.imageUrl : imgnotfoundUrlcommon,
6875
6899
  alt: 'no product image available',
@@ -6879,19 +6903,33 @@ var CartPageProductCard = function CartPageProductCard(_ref) {
6879
6903
  title: item.productName,
6880
6904
  placement: "top",
6881
6905
  arrow: true
6882
- }, /*#__PURE__*/React__default.createElement("h6", null, item.productName)), /*#__PURE__*/React__default.createElement("p", null, "$", (_item$standardPrice = item.standardPrice) === null || _item$standardPrice === void 0 ? void 0 : _item$standardPrice.toFixed(2))), /*#__PURE__*/React__default.createElement(QtAndPriceBox, null, /*#__PURE__*/React__default.createElement(CartPageQtBox, null, /*#__PURE__*/React__default.createElement("span", {
6906
+ }, /*#__PURE__*/React__default.createElement("h6", null, item.productName)), /*#__PURE__*/React__default.createElement("p", null, renderMoney(item.standardPrice))), /*#__PURE__*/React__default.createElement(QtAndPriceBox, null, /*#__PURE__*/React__default.createElement(CartPageQtBox, null, /*#__PURE__*/React__default.createElement("span", {
6883
6907
  className: "icon",
6884
6908
  onClick: function onClick() {
6885
6909
  if (loading) return;
6886
- handleIncrementDecrement('decrement', item);
6910
+ onChangeQuantity(_extends({}, item, {
6911
+ quantity: checkMinMaxQty({
6912
+ quantity: (item === null || item === void 0 ? void 0 : item.quantity) - 1,
6913
+ product: item
6914
+ })
6915
+ }));
6887
6916
  }
6888
6917
  }, /*#__PURE__*/React__default.createElement(ai.AiOutlineMinus, null)), /*#__PURE__*/React__default.createElement("span", {
6889
6918
  className: "qt"
6890
- }, item.quantity), /*#__PURE__*/React__default.createElement("span", {
6919
+ }, /*#__PURE__*/React__default.createElement("input", {
6920
+ type: "number",
6921
+ value: quantity,
6922
+ onChange: onChangeInput
6923
+ })), /*#__PURE__*/React__default.createElement("span", {
6891
6924
  className: "icon",
6892
6925
  onClick: function onClick() {
6893
6926
  if (loading) return;
6894
- handleIncrementDecrement('increment', item);
6927
+ onChangeQuantity(_extends({}, item, {
6928
+ quantity: checkMinMaxQty({
6929
+ quantity: (item === null || item === void 0 ? void 0 : item.quantity) + 1,
6930
+ product: item
6931
+ })
6932
+ }));
6895
6933
  }
6896
6934
  }, /*#__PURE__*/React__default.createElement(ai.AiOutlinePlus, null))), /*#__PURE__*/React__default.createElement("p", {
6897
6935
  className: "subtotal"
@@ -6900,7 +6938,7 @@ var CartPageProductCard = function CartPageProductCard(_ref) {
6900
6938
  if (loading) return;
6901
6939
  handleRemoveProduct(item);
6902
6940
  }
6903
- }, /*#__PURE__*/React__default.createElement(ai.AiOutlineClose, null)));
6941
+ }, /*#__PURE__*/React__default.createElement(ri.RiDeleteBin5Line, null)));
6904
6942
  };
6905
6943
 
6906
6944
  var CartPageMainRetail = function CartPageMainRetail(_ref) {
@@ -6932,20 +6970,20 @@ var CartPageMainRetail = function CartPageMainRetail(_ref) {
6932
6970
  })));
6933
6971
  };
6934
6972
 
6935
- var _templateObject$w, _templateObject2$m, _templateObject3$g, _templateObject4$c, _templateObject5$a, _templateObject6$8, _templateObject7$6, _templateObject8$4;
6936
- var CartSummaryContainer = styled__default.div(_templateObject$w || (_templateObject$w = _taggedTemplateLiteralLoose(["\n width: 25rem;\n max-width: 100%;\n display: flex;\n flex-direction: column;\n background: ", ";\n color: ", ";\n border-radius: 20px;\n padding: 2em 3em;\n align-items: center;\n /* margin-top: 3em; */\n p {\n font-size: 1.189em;\n font-weight: 600;\n align-self: flex-start;\n color: inherit;\n margin: 0;\n padding: 0;\n }\n .continueShopping {\n font-size: 0.75em;\n color: inherit;\n text-transform: capitalize;\n height: 20px;\n border-bottom: 1px solid;\n border-color: ", ";\n cursor: pointer;\n }\n"])), function (props) {
6973
+ var _templateObject$v, _templateObject2$l, _templateObject3$f, _templateObject4$c, _templateObject5$a, _templateObject6$8, _templateObject7$6, _templateObject8$4;
6974
+ var CartSummaryContainer = styled__default.div(_templateObject$v || (_templateObject$v = _taggedTemplateLiteralLoose(["\n width: 25rem;\n max-width: 100%;\n display: flex;\n flex-direction: column;\n background: ", ";\n color: ", ";\n border-radius: 20px;\n padding: 2em 3em;\n align-items: center;\n /* margin-top: 3em; */\n p {\n font-size: 1.189em;\n font-weight: 600;\n align-self: flex-start;\n color: inherit;\n margin: 0;\n padding: 0;\n }\n .continueShopping {\n font-size: 0.75em;\n color: inherit;\n text-transform: capitalize;\n height: 20px;\n border-bottom: 1px solid;\n border-color: ", ";\n cursor: pointer;\n }\n"])), function (props) {
6937
6975
  return props.background || '#667080';
6938
6976
  }, function (props) {
6939
6977
  return props.color || 'white';
6940
6978
  }, function (props) {
6941
6979
  return props.color || 'white';
6942
6980
  });
6943
- var CartSummaryRow = styled__default.div(_templateObject2$m || (_templateObject2$m = _taggedTemplateLiteralLoose(["\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: ", ";\n align-items: center;\n color: inherit;\n h6,\n h5 {\n margin: 0;\n font-size: 1em;\n font-weight: 700;\n color: inherit;\n text-transform: capitalize;\n }\n h5 {\n font-size: ", ";\n }\n"])), function (props) {
6981
+ var CartSummaryRow = styled__default.div(_templateObject2$l || (_templateObject2$l = _taggedTemplateLiteralLoose(["\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: ", ";\n align-items: center;\n color: inherit;\n h6,\n h5 {\n margin: 0;\n font-size: 1em;\n font-weight: 700;\n color: inherit;\n text-transform: capitalize;\n }\n h5 {\n font-size: ", ";\n }\n"])), function (props) {
6944
6982
  return props.justify || 'space-between';
6945
6983
  }, function (props) {
6946
6984
  return props.h5 || '1.31em';
6947
6985
  });
6948
- var CartSummaryHr = styled__default.span(_templateObject3$g || (_templateObject3$g = _taggedTemplateLiteralLoose(["\n border: none;\n width: 100%;\n height: 1px;\n background-color: ", ";\n margin: 1.2em 0;\n"])), function (props) {
6986
+ var CartSummaryHr = styled__default.span(_templateObject3$f || (_templateObject3$f = _taggedTemplateLiteralLoose(["\n border: none;\n width: 100%;\n height: 1px;\n background-color: ", ";\n margin: 1.2em 0;\n"])), function (props) {
6949
6987
  return props.color || 'rgba(255, 255, 255, 0.5)';
6950
6988
  });
6951
6989
  var CartSummaryInputBox = styled__default.form(_templateObject4$c || (_templateObject4$c = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n padding-bottom: ", ";\n background-color: transparent;\n width: 100%;\n input {\n width: 65%;\n height: 2.44rem;\n padding: 0.2rem 0.8rem;\n\n text-transform: capitalize;\n font-size: 0.89rem;\n margin-right: 0.1em;\n\n border: none;\n outline: none;\n background: ", ";\n color: ", ";\n &::placeholder {\n color: ", ";\n }\n }\n button {\n width: 35%;\n height: 2.44rem;\n line-height: 0.8rem;\n background: ", ";\n display: grid;\n color: ", ";\n place-items: center;\n border: none;\n outline: none;\n text-transform: uppercase;\n cursor: pointer;\n font-size: 0.75em;\n transition: 0.3s;\n &:hover {\n letter-spacing: 1px;\n background: ", ";\n }\n }\n"])), function (props) {
@@ -7127,94 +7165,6 @@ var CartSummary = function CartSummary(_ref) {
7127
7165
  }, "Continue to shopping")));
7128
7166
  };
7129
7167
 
7130
- function debounce(func, wait, immediate) {
7131
- var timeout;
7132
- return function () {
7133
- var _this = this;
7134
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
7135
- args[_key] = arguments[_key];
7136
- }
7137
- clearTimeout(timeout);
7138
- timeout = setTimeout(function () {
7139
- timeout = null;
7140
- if (!immediate) func.apply(_this, args);
7141
- }, wait);
7142
- if (immediate && !timeout) func.apply(this, [].concat(args));
7143
- };
7144
- }
7145
-
7146
- function useWindowSize() {
7147
- var isWindow = typeof window !== 'undefined';
7148
- var _useState = React.useState({
7149
- width: isWindow ? window.innerWidth : 1200,
7150
- height: isWindow ? window.innerHeight : 800
7151
- }),
7152
- windowSize = _useState[0],
7153
- setWindowSize = _useState[1];
7154
- React.useEffect(function () {
7155
- var onWindowResize = function onWindowResize() {
7156
- setWindowSize({
7157
- width: window.innerWidth,
7158
- height: window.innerHeight
7159
- });
7160
- };
7161
- var onResize = debounce(onWindowResize, 100);
7162
- window.addEventListener('resize', onResize);
7163
- onWindowResize();
7164
- return function () {
7165
- window.removeEventListener('resize', onResize);
7166
- };
7167
- }, []);
7168
- return windowSize;
7169
- }
7170
-
7171
- var Breakpoint = function Breakpoint() {};
7172
- Breakpoint.xs = 'xs';
7173
- Breakpoint.sm = 'sm';
7174
- Breakpoint.md = 'md';
7175
- Breakpoint.lg = 'lg';
7176
- Breakpoint.xl = 'xl';
7177
- Breakpoint.xxl = 'xxl';
7178
-
7179
- var Variant = function Variant() {};
7180
- Variant.ONE = 'one';
7181
- Variant.TWO = 'two';
7182
- Variant.THREE = 'three';
7183
-
7184
- var getBreakpoint = function getBreakpoint(_ref) {
7185
- var screen = _ref.width;
7186
- var breakpoint = '';
7187
- if (screen <= 320) {
7188
- breakpoint = Breakpoint.xs;
7189
- }
7190
- if (screen >= 375) {
7191
- breakpoint = Breakpoint.sm;
7192
- }
7193
- if (screen >= 768) {
7194
- breakpoint = Breakpoint.md;
7195
- }
7196
- if (screen >= 992) {
7197
- breakpoint = Breakpoint.lg;
7198
- }
7199
- if (screen >= 1200) {
7200
- breakpoint = Breakpoint.xl;
7201
- }
7202
- if (screen >= 1600) {
7203
- breakpoint = Breakpoint.xxl;
7204
- }
7205
- return breakpoint;
7206
- };
7207
- function useGridSize() {
7208
- var windowSize = useWindowSize();
7209
- var _useState = React.useState(Breakpoint.md),
7210
- layout = _useState[0],
7211
- setLayout = _useState[1];
7212
- React.useEffect(function () {
7213
- setLayout(getBreakpoint(windowSize));
7214
- }, [windowSize]);
7215
- return layout;
7216
- }
7217
-
7218
7168
  var CartPageComponent = function CartPageComponent(_ref) {
7219
7169
  var _styles$input;
7220
7170
  var apiEndPoint = _ref.apiEndPoint,
@@ -7262,6 +7212,9 @@ var CartPageComponent = function CartPageComponent(_ref) {
7262
7212
  }
7263
7213
  })();
7264
7214
  }, []);
7215
+ var onChangeQuantity = function onChangeQuantity(product) {
7216
+ handleIncrementDecrement(product, product);
7217
+ };
7265
7218
  return /*#__PURE__*/React__default.createElement(CartPageSection, {
7266
7219
  bg: styles === null || styles === void 0 ? void 0 : styles.bg,
7267
7220
  retail: retail
@@ -7279,7 +7232,7 @@ var CartPageComponent = function CartPageComponent(_ref) {
7279
7232
  loading: loading,
7280
7233
  imgnotfoundUrl: imgnotfoundUrl,
7281
7234
  styles: styles,
7282
- handleIncrementDecrement: handleIncrementDecrement,
7235
+ handleIncrementDecrement: onChangeQuantity,
7283
7236
  handleRemoveProduct: handleRemoveProduct
7284
7237
  }) : /*#__PURE__*/React__default.createElement(EnhancedTable, {
7285
7238
  retail: retail,
@@ -7287,7 +7240,7 @@ var CartPageComponent = function CartPageComponent(_ref) {
7287
7240
  loading: loading,
7288
7241
  imgnotfoundUrl: imgnotfoundUrl,
7289
7242
  styles: styles,
7290
- handleIncrementDecrement: handleIncrementDecrement,
7243
+ handleIncrementDecrement: onChangeQuantity,
7291
7244
  handleRemoveProduct: handleRemoveProduct,
7292
7245
  handleRemoveAll: handleRemoveAll,
7293
7246
  disabledSelectAllProductCheckbox: disabledSelectAllProductCheckbox
@@ -7309,6 +7262,183 @@ var CartPageComponent = function CartPageComponent(_ref) {
7309
7262
  discountCoupons: discountCoupons
7310
7263
  })));
7311
7264
  };
7265
+ var checkMinMaxQty = function checkMinMaxQty(_ref2) {
7266
+ var quantity = _ref2.quantity,
7267
+ product = _ref2.product;
7268
+ var quantityReturn = quantity;
7269
+ if (quantityReturn > (product === null || product === void 0 ? void 0 : product.availableQuantity)) {
7270
+ alert("Only " + (product === null || product === void 0 ? void 0 : product.availableQuantity) + " is available");
7271
+ quantityReturn = product === null || product === void 0 ? void 0 : product.availableQuantity;
7272
+ }
7273
+ if (product !== null && product !== void 0 && product.minQuantityToSale && (product === null || product === void 0 ? void 0 : product.minQuantityToSale) > 1 && quantityReturn < (product === null || product === void 0 ? void 0 : product.minQuantityToSale)) {
7274
+ alert("Quantity should be minimum " + (product === null || product === void 0 ? void 0 : product.minQuantityToSale));
7275
+ quantityReturn = product === null || product === void 0 ? void 0 : product.minQuantityToSale;
7276
+ }
7277
+ if (product !== null && product !== void 0 && product.maxQuantityToSale && (product === null || product === void 0 ? void 0 : product.maxQuantityToSale) >= 1 && quantityReturn > (product === null || product === void 0 ? void 0 : product.maxQuantityToSale)) {
7278
+ alert("Quantity should not be more than " + (product === null || product === void 0 ? void 0 : product.maxQuantityToSale));
7279
+ quantityReturn = product === null || product === void 0 ? void 0 : product.maxQuantityToSale;
7280
+ }
7281
+ return quantityReturn;
7282
+ };
7283
+
7284
+ var _templateObject$w, _templateObject2$m, _templateObject3$g;
7285
+ var CartDrawerProduct = styled__default.div(_templateObject$w || (_templateObject$w = _taggedTemplateLiteralLoose(["\n width: 100%;\n display: flex;\n flex-direction: row;\n height: 100px;\n justify-content: space-around;\n align-items: center;\n overflow: hidden;\n margin-bottom: 2rem;\n user-select: none;\n\n img {\n width: 20%;\n max-height: 100%;\n /* aspect-ratio: 1; */\n object-fit: contain;\n }\n .middleSection {\n width: 60%;\n padding-left: 0.8rem;\n height: 100%;\n h6 {\n font-size: 1.1rem;\n font-weight: bold;\n margin: 0;\n\n span {\n font-size: 0.8rem;\n color: grey;\n text-decoration: line-through;\n margin-right: 0.5rem;\n }\n }\n .name {\n font-size: 0.9rem;\n line-height: 1.2rem;\n width: 100%;\n word-wrap: break-word;\n overflow: hidden;\n text-overflow: ellipsis;\n transition: 0.3s;\n cursor: pointer;\n &:hover {\n color: ", ";\n }\n }\n }\n .endSection {\n // width: 20%;\n height: 95%;\n .icon {\n cursor: pointer;\n transition: 0.4s;\n &:hover {\n color: red;\n }\n }\n }\n @media only screen and (max-width: 768px) {\n .closeIcon {\n font-size: 1rem;\n }\n }\n @media only screen and (max-width: 340px) {\n .middleSection {\n h6 {\n font-size: 0.9rem;\n }\n }\n }\n"])), function (props) {
7286
+ return props.color || 'grey';
7287
+ });
7288
+ var CartDrawerQtBox = styled__default.div(_templateObject2$m || (_templateObject2$m = _taggedTemplateLiteralLoose(["\n height: 30px;\n width: 86px;\n border: 1px solid rgb(211, 210, 210);\n display: flex;\n align-items: center;\n justify-content: space-between;\n font-size: 13.5px;\n color: #323232;\n padding: 0 0.5rem;\n border-radius: 5px;\n max-width: 100%;\n span {\n cursor: pointer;\n height: 100%;\n display: grid;\n place-items: center;\n }\n .qt {\n font-size: 12px;\n color: black;\n font-weight: 500;\n cursor: auto;\n input {\n width: 40px;\n height: 100%;\n text-align: center;\n border: none;\n }\n }\n @media only screen and (max-width: 600px) {\n min-width: 55px;\n aspect-ratio: 1/2;\n font-size: 10px;\n }\n @media only screen and (max-width: 340px) {\n min-width: 50px;\n aspect-ratio: 1/2;\n height: 22px;\n font-size: 8px;\n }\n"])));
7289
+ var CartDrawerLoader = styled__default.div(_templateObject3$g || (_templateObject3$g = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: 30%;\n width: 100px;\n height: 100px;\n display: grid;\n place-items: center;\n"])));
7290
+
7291
+ var CartDrawerProductCard = function CartDrawerProductCard(_ref) {
7292
+ var product = _ref.product,
7293
+ color = _ref.color,
7294
+ handleIncrementDecrement = _ref.handleIncrementDecrement,
7295
+ handleRemoveProduct = _ref.handleRemoveProduct,
7296
+ handleRedirect = _ref.handleRedirect,
7297
+ imgnotfoundUrl = _ref.imgnotfoundUrl,
7298
+ loading = _ref.loading;
7299
+ var timer = React.useRef();
7300
+ var _useState = React.useState(product === null || product === void 0 ? void 0 : product.quantity),
7301
+ quantity = _useState[0],
7302
+ setQuantity = _useState[1];
7303
+ React.useEffect(function () {
7304
+ setQuantity(product === null || product === void 0 ? void 0 : product.quantity);
7305
+ }, [product]);
7306
+ var imgnotfoundUrlcommon = noImgAvailable$1;
7307
+ if (imgnotfoundUrl && imgnotfoundUrl !== 'null') imgnotfoundUrlcommon = imgnotfoundUrl;
7308
+ var onChangeQuantity = function onChangeQuantity(product) {
7309
+ handleIncrementDecrement(product, product);
7310
+ };
7311
+ var onChangeInput = function onChangeInput(e) {
7312
+ var value = e.target.value;
7313
+ setQuantity(value || 1);
7314
+ if (timer.current) {
7315
+ clearTimeout(timer.current);
7316
+ }
7317
+ timer.current = setTimeout(function () {
7318
+ onChangeQuantity(_extends({}, product, {
7319
+ quantity: checkMinMaxQty({
7320
+ quantity: value,
7321
+ product: product
7322
+ })
7323
+ }));
7324
+ }, 500);
7325
+ };
7326
+ return /*#__PURE__*/React__default.createElement(CartDrawerProduct, {
7327
+ color: color
7328
+ }, /*#__PURE__*/React__default.createElement("img", {
7329
+ src: product.imageUrl && product.imageUrl !== 'null' ? product.imageUrl : imgnotfoundUrlcommon,
7330
+ alt: 'no product image available'
7331
+ }), /*#__PURE__*/React__default.createElement(material.Stack, {
7332
+ flexDirection: "column",
7333
+ justifyContent: "space-between",
7334
+ alignItems: "flex-start",
7335
+ className: "middleSection"
7336
+ }, /*#__PURE__*/React__default.createElement(material.Tooltip, {
7337
+ title: product === null || product === void 0 ? void 0 : product.productName,
7338
+ placement: "top",
7339
+ arrow: true
7340
+ }, /*#__PURE__*/React__default.createElement("h6", {
7341
+ className: "name",
7342
+ onClick: function onClick() {
7343
+ return handleRedirect(product);
7344
+ }
7345
+ }, product === null || product === void 0 ? void 0 : product.productName)), /*#__PURE__*/React__default.createElement("h6", null, (product === null || product === void 0 ? void 0 : product.standardPrice) === (product === null || product === void 0 ? void 0 : product.cartStandardPrice) ? "$" + (product === null || product === void 0 ? void 0 : product.standardPrice) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, (product === null || product === void 0 ? void 0 : product.cartStandardPrice) && /*#__PURE__*/React__default.createElement("span", null, renderMoney(product === null || product === void 0 ? void 0 : product.cartStandardPrice)), renderMoney(product === null || product === void 0 ? void 0 : product.standardPrice)))), /*#__PURE__*/React__default.createElement(material.Stack, {
7346
+ flexDirection: "column",
7347
+ justifyContent: "space-between",
7348
+ alignItems: "flex-end",
7349
+ className: "endSection"
7350
+ }, /*#__PURE__*/React__default.createElement(ri.RiDeleteBin5Line, {
7351
+ className: "icon",
7352
+ onClick: function onClick() {
7353
+ if (loading) return;
7354
+ var sure = confirm('Are you sure you want to remove this item from cart');
7355
+ if (!sure) return;
7356
+ handleRemoveProduct(product);
7357
+ }
7358
+ }), /*#__PURE__*/React__default.createElement(CartDrawerQtBox, null, /*#__PURE__*/React__default.createElement("span", {
7359
+ onClick: function onClick() {
7360
+ if (loading) return;
7361
+ onChangeQuantity(_extends({}, product, {
7362
+ quantity: checkMinMaxQty({
7363
+ quantity: (product === null || product === void 0 ? void 0 : product.quantity) - 1,
7364
+ product: product
7365
+ })
7366
+ }));
7367
+ }
7368
+ }, /*#__PURE__*/React__default.createElement(ai.AiOutlineMinus, null)), /*#__PURE__*/React__default.createElement("span", {
7369
+ className: 'qt'
7370
+ }, /*#__PURE__*/React__default.createElement("input", {
7371
+ type: "number",
7372
+ value: quantity,
7373
+ onChange: onChangeInput
7374
+ })), /*#__PURE__*/React__default.createElement("span", {
7375
+ onClick: function onClick() {
7376
+ if (loading) return;
7377
+ onChangeQuantity(_extends({}, product, {
7378
+ quantity: checkMinMaxQty({
7379
+ quantity: (product === null || product === void 0 ? void 0 : product.quantity) + 1,
7380
+ product: product
7381
+ })
7382
+ }));
7383
+ }
7384
+ }, /*#__PURE__*/React__default.createElement(ai.AiOutlinePlus, null)))));
7385
+ };
7386
+
7387
+ var CartDrawer = function CartDrawer(_ref) {
7388
+ var _cartData$cartLineIte, _cartData$totalCartPr;
7389
+ var cartData = _ref.cartData,
7390
+ maxWidth = _ref.maxWidth,
7391
+ color = _ref.color,
7392
+ handleRedirect = _ref.handleRedirect,
7393
+ handleIncrementDecrement = _ref.handleIncrementDecrement,
7394
+ handleRemoveProduct = _ref.handleRemoveProduct,
7395
+ handleClose = _ref.handleClose,
7396
+ loading = _ref.loading,
7397
+ imgnotfoundUrl = _ref.imgnotfoundUrl;
7398
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(CartDrawerContainer, {
7399
+ className: "cartDrawer-container",
7400
+ maxWidth: maxWidth
7401
+ }, /*#__PURE__*/React__default.createElement(CartDrawerBar, null, /*#__PURE__*/React__default.createElement("h2", null, "Your Cart"), /*#__PURE__*/React__default.createElement(gr.GrClose, {
7402
+ className: "icon",
7403
+ onClick: function onClick() {
7404
+ handleClose();
7405
+ }
7406
+ })), /*#__PURE__*/React__default.createElement(material.Box, null, cartData && (cartData === null || cartData === void 0 ? void 0 : cartData.totalCartQuantity) > 0 ? /*#__PURE__*/React__default.createElement(CartDrawerProductContainer, {
7407
+ opacity: loading ? '.4' : '1'
7408
+ }, cartData === null || cartData === void 0 ? void 0 : (_cartData$cartLineIte = cartData.cartLineItemDtoList) === null || _cartData$cartLineIte === void 0 ? void 0 : _cartData$cartLineIte.map(function (product, i) {
7409
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, loading && /*#__PURE__*/React__default.createElement(CartDrawerLoader, null, /*#__PURE__*/React__default.createElement(reactSpinners.PuffLoader, {
7410
+ color: "black"
7411
+ })), /*#__PURE__*/React__default.createElement(CartDrawerProductCard, {
7412
+ product: product,
7413
+ handleRedirect: handleRedirect,
7414
+ handleIncrementDecrement: handleIncrementDecrement,
7415
+ handleRemoveProduct: handleRemoveProduct,
7416
+ color: color,
7417
+ key: i,
7418
+ imgnotfoundUrl: imgnotfoundUrl,
7419
+ loading: loading
7420
+ }));
7421
+ })) : /*#__PURE__*/React__default.createElement(CartDrawerEmptyCart, {
7422
+ color: color
7423
+ }, /*#__PURE__*/React__default.createElement(bs.BsCartX, {
7424
+ className: "icon"
7425
+ }), /*#__PURE__*/React__default.createElement("h6", null, "Oops!"), /*#__PURE__*/React__default.createElement("p", null, "your cart is empty"))), cartData && (cartData === null || cartData === void 0 ? void 0 : cartData.totalCartQuantity) > 0 && /*#__PURE__*/React__default.createElement(CartDrawerBottomSection, null, /*#__PURE__*/React__default.createElement(material.Stack, {
7426
+ flexDirection: "row",
7427
+ justifyContent: "space-between",
7428
+ alignItems: "center",
7429
+ className: "row"
7430
+ }, /*#__PURE__*/React__default.createElement("h5", null, "Subtotal", /*#__PURE__*/React__default.createElement("span", null, "(", cartData === null || cartData === void 0 ? void 0 : cartData.totalCartQuantity, " items)")), /*#__PURE__*/React__default.createElement("h5", null, "$", cartData === null || cartData === void 0 ? void 0 : (_cartData$totalCartPr = cartData.totalCartPrice) === null || _cartData$totalCartPr === void 0 ? void 0 : _cartData$totalCartPr.toFixed(2))), /*#__PURE__*/React__default.createElement(CartDrawerOutlinedButton, {
7431
+ color: color,
7432
+ onClick: function onClick() {
7433
+ return handleRedirect('cart');
7434
+ }
7435
+ }, "view cart"), /*#__PURE__*/React__default.createElement(CartDrawerFilledButton, {
7436
+ color: color,
7437
+ onClick: function onClick() {
7438
+ return handleRedirect('checkout');
7439
+ }
7440
+ }, "continue to checkout"))));
7441
+ };
7312
7442
 
7313
7443
  var GTagManager = function GTagManager(_ref) {
7314
7444
  var gTagId = _ref.gTagId;
@@ -8459,7 +8589,7 @@ var CardRow$1 = function CardRow(_ref) {
8459
8589
  if (loading) return;
8460
8590
  handleRemoveProduct(row, index);
8461
8591
  }
8462
- }, /*#__PURE__*/React__default.createElement(ai.AiOutlineClose, {
8592
+ }, /*#__PURE__*/React__default.createElement(ri.RiDeleteBin5Line, {
8463
8593
  style: {
8464
8594
  fontSize: 'inherit'
8465
8595
  }
@@ -10817,7 +10947,7 @@ var ConsentForm = function ConsentForm(_ref) {
10817
10947
  var _useState = React.useState(false),
10818
10948
  loadingData = _useState[0],
10819
10949
  setLoadingData = _useState[1];
10820
- var _useState2 = React.useState([]),
10950
+ var _useState2 = React.useState(),
10821
10951
  staticPageData = _useState2[0],
10822
10952
  setStaticPageData = _useState2[1];
10823
10953
  var _useState3 = React.useState([]),
@@ -10844,7 +10974,8 @@ var ConsentForm = function ConsentForm(_ref) {
10844
10974
  stateId: shippingInformation === null || shippingInformation === void 0 ? void 0 : shippingInformation.stateId
10845
10975
  }
10846
10976
  })).then(function (staticPageDataResponse) {
10847
- setStaticPageData(staticPageDataResponse === null || staticPageDataResponse === void 0 ? void 0 : staticPageDataResponse.content);
10977
+ var _staticPageDataRespon;
10978
+ setStaticPageData(staticPageDataResponse === null || staticPageDataResponse === void 0 ? void 0 : (_staticPageDataRespon = staticPageDataResponse.content) === null || _staticPageDataRespon === void 0 ? void 0 : _staticPageDataRespon[0]);
10848
10979
  return Promise.resolve(API$1({
10849
10980
  apiEndPoint: apiEndPoint,
10850
10981
  token: token,
@@ -10916,8 +11047,9 @@ var ConsentForm = function ConsentForm(_ref) {
10916
11047
  style: {
10917
11048
  margin: '1rem 0'
10918
11049
  }
10919
- }, "Terms and Condition"), (staticPageData === null || staticPageData === void 0 ? void 0 : staticPageData[0]) && /*#__PURE__*/React__default.createElement(APIStaticPage, {
10920
- pageData: staticPageData === null || staticPageData === void 0 ? void 0 : staticPageData[0],
11050
+ }, "Terms and Condition"), staticPageData && /*#__PURE__*/React__default.createElement(APIStaticPage, {
11051
+ id: staticPageData === null || staticPageData === void 0 ? void 0 : staticPageData.id,
11052
+ alias: staticPageData === null || staticPageData === void 0 ? void 0 : staticPageData.urlAlias,
10921
11053
  hideRouteBar: true
10922
11054
  }))));
10923
11055
  };