@salesgenterp/ui-components 0.4.302 → 0.4.304

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
@@ -5560,7 +5560,7 @@ if (process.env.NODE_ENV !== 'production') {
5560
5560
  });
5561
5561
 
5562
5562
  var _templateObject$s, _templateObject2$j, _templateObject3$d, _templateObject4$9, _templateObject5$7, _templateObject6$6;
5563
- var ProductImage = styled__default.img(_templateObject$s || (_templateObject$s = _taggedTemplateLiteralLoose(["\n min-width: 50px;\n min-height: 58px;\n @media only screen and (max-width: 640px) {\n margin: 0.5em 0;\n padding-right: 0.5em;\n }\n"])));
5563
+ var ProductImage = styled__default.img(_templateObject$s || (_templateObject$s = _taggedTemplateLiteralLoose(["\n min-width: 50px;\n min-height: 50px;\n @media only screen and (max-width: 640px) {\n margin: 0.5em 0;\n padding-right: 0.5em;\n }\n"])));
5564
5564
  var ProductName = styled__default.h6(_templateObject2$j || (_templateObject2$j = _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) {
5565
5565
  return props.size || '1em';
5566
5566
  }, function (props) {
@@ -5798,7 +5798,7 @@ EnhancedTableHead.propTypes = {
5798
5798
  rowCount: propTypes.number.isRequired
5799
5799
  };
5800
5800
  function EnhancedTable(_ref) {
5801
- var _cartData$cartLineIte, _styles$scroll, _styles$scroll2, _sortBy, _styles$Btn, _styles$Btn2;
5801
+ var _cartData$cartLineIte, _styles$Btn, _styles$scroll, _styles$scroll2, _sortBy, _styles$Btn2, _styles$Btn3;
5802
5802
  var cartData = _ref.cartData,
5803
5803
  loading = _ref.loading,
5804
5804
  imgnotfoundUrl = _ref.imgnotfoundUrl,
@@ -5876,7 +5876,7 @@ function EnhancedTable(_ref) {
5876
5876
  }, [cartData]);
5877
5877
  return /*#__PURE__*/React.createElement(CartPageBox, null, loading && /*#__PURE__*/React.createElement(Loader$1, null, /*#__PURE__*/React.createElement(reactSpinners.BounceLoader, {
5878
5878
  size: 40,
5879
- color: styles.Btn.background,
5879
+ color: styles === null || styles === void 0 ? void 0 : (_styles$Btn = styles.Btn) === null || _styles$Btn === void 0 ? void 0 : _styles$Btn.background,
5880
5880
  loading: true
5881
5881
  })), /*#__PURE__*/React.createElement(Box, {
5882
5882
  sx: {
@@ -5914,8 +5914,8 @@ function EnhancedTable(_ref) {
5914
5914
  handleRemoveProduct: handleRemoveProduct
5915
5915
  });
5916
5916
  }))))), /*#__PURE__*/React.createElement(CartButtonsRow, {
5917
- bg: styles === null || styles === void 0 ? void 0 : (_styles$Btn = styles.Btn) === null || _styles$Btn === void 0 ? void 0 : _styles$Btn.background,
5918
- color: styles === null || styles === void 0 ? void 0 : (_styles$Btn2 = styles.Btn) === null || _styles$Btn2 === void 0 ? void 0 : _styles$Btn2.color
5917
+ bg: styles === null || styles === void 0 ? void 0 : (_styles$Btn2 = styles.Btn) === null || _styles$Btn2 === void 0 ? void 0 : _styles$Btn2.background,
5918
+ color: styles === null || styles === void 0 ? void 0 : (_styles$Btn3 = styles.Btn) === null || _styles$Btn3 === void 0 ? void 0 : _styles$Btn3.color
5919
5919
  }, /*#__PURE__*/React.createElement("button", {
5920
5920
  onClick: function onClick() {
5921
5921
  new Promise(function (resolve, reject) {
@@ -5985,7 +5985,7 @@ var CartPageProductCard = function CartPageProductCard(_ref) {
5985
5985
  };
5986
5986
 
5987
5987
  var CartPageMainRetail = function CartPageMainRetail(_ref) {
5988
- var _cartData$cartLineIte;
5988
+ var _styles$Btn, _cartData$cartLineIte;
5989
5989
  var retail = _ref.retail,
5990
5990
  cartData = _ref.cartData,
5991
5991
  loading = _ref.loading,
@@ -5999,7 +5999,7 @@ var CartPageMainRetail = function CartPageMainRetail(_ref) {
5999
5999
  retail: retail
6000
6000
  }, loading && /*#__PURE__*/React__default.createElement(Loader$1, null, /*#__PURE__*/React__default.createElement(reactSpinners.BounceLoader, {
6001
6001
  size: 40,
6002
- color: styles.Btn.background,
6002
+ color: styles === null || styles === void 0 ? void 0 : (_styles$Btn = styles.Btn) === null || _styles$Btn === void 0 ? void 0 : _styles$Btn.background,
6003
6003
  loading: true
6004
6004
  })), cartData === null || cartData === void 0 ? void 0 : (_cartData$cartLineIte = cartData.cartLineItemDtoList) === null || _cartData$cartLineIte === void 0 ? void 0 : _cartData$cartLineIte.map(function (item) {
6005
6005
  return /*#__PURE__*/React__default.createElement(CartPageProductCard, {
@@ -6089,8 +6089,8 @@ var CartSummary = function CartSummary(_ref) {
6089
6089
  var storeIdList = (storeData === null || storeData === void 0 ? void 0 : (_storeData$map = storeData.map(function (data) {
6090
6090
  return data === null || data === void 0 ? void 0 : data.id;
6091
6091
  })) === null || _storeData$map === void 0 ? void 0 : _storeData$map.join(',')) || 2;
6092
- var cartSummary = styles.cartSummary,
6093
- Btn = styles.Btn;
6092
+ var cartSummary = styles === null || styles === void 0 ? void 0 : styles.cartSummary;
6093
+ var Btn = styles === null || styles === void 0 ? void 0 : styles.Btn;
6094
6094
  var _useState = React.useState(false),
6095
6095
  buttonLoading = _useState[0],
6096
6096
  setButtonLoading = _useState[1];
@@ -7354,7 +7354,7 @@ var _templateObject$A;
7354
7354
  var Container$1 = styled__default.div(_templateObject$A || (_templateObject$A = _taggedTemplateLiteralLoose([""])));
7355
7355
 
7356
7356
  var _templateObject$B, _templateObject2$q, _templateObject3$i, _templateObject4$d, _templateObject5$b, _templateObject6$a;
7357
- var ProductImage$1 = styled__default.img(_templateObject$B || (_templateObject$B = _taggedTemplateLiteralLoose(["\n min-width: 50px;\n min-height: 58px;\n @media only screen and (max-width: 640px) {\n margin: 0.5em 0;\n padding-right: 0.5em;\n }\n"])));
7357
+ var ProductImage$1 = styled__default.img(_templateObject$B || (_templateObject$B = _taggedTemplateLiteralLoose(["\n min-width: 50px;\n min-height: 50px;\n @media only screen and (max-width: 640px) {\n margin: 0.5em 0;\n padding-right: 0.5em;\n }\n"])));
7358
7358
  var ProductName$1 = styled__default.h6(_templateObject2$q || (_templateObject2$q = _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) {
7359
7359
  return props.size || '1em';
7360
7360
  }, function (props) {
@@ -8200,10 +8200,12 @@ var _templateObject$H, _templateObject2$u, _templateObject3$k, _templateObject4$
8200
8200
  var CheckoutRootContainer = styled__default.div(_templateObject$H || (_templateObject$H = _taggedTemplateLiteralLoose(["\n width: 100%;\n padding: 4rem;\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: 1620px) {\n padding: 3em 0.5em;\n }\n @media screen and (max-width: 840px) {\n div,\n button,\n span {\n font-size: 12px;\n }\n padding: 2rem 0.5rem;\n }\n"])), function (props) {
8201
8201
  return props.bg;
8202
8202
  });
8203
- var CheckoutPageContainer = styled__default.div(_templateObject2$u || (_templateObject2$u = _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: 2.375em 3.5em 2.5em 4.5em;\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: 1508px) {\n flex-direction: column;\n align-items: center;\n max-height: max-content;\n }\n @media only screen and (max-width: 788px) {\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 .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"])), function (props) {
8203
+ var CheckoutPageContainer = styled__default.div(_templateObject2$u || (_templateObject2$u = _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: 2.375em 3.5em 2.5em 4.5em;\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: 1508px) {\n flex-direction: column;\n align-items: center;\n max-height: max-content;\n }\n @media only screen and (max-width: 788px) {\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: 640px) {\n .MuiStepConnector-line,\n .MuiStepConnector-lineVertical {\n min-height: 40px !important;\n }\n }\n"])), function (props) {
8204
8204
  return props.maxWidth || '1605px';
8205
8205
  }, function (props) {
8206
8206
  return props.bg || '#fff8f6';
8207
+ }, function (props) {
8208
+ return props.primaryColor || 'rgba(50, 50, 50, 1)';
8207
8209
  });
8208
8210
  var Row = styled__default.div(_templateObject3$k || (_templateObject3$k = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n"])));
8209
8211
  var CheckoutMainWithHeader = styled__default(material.Stack)(_templateObject4$f || (_templateObject4$f = _taggedTemplateLiteralLoose([""])));
@@ -8224,7 +8226,7 @@ var CheckoutSummaryContainer = styled__default.div(_templateObject$I || (_templa
8224
8226
  }, function (props) {
8225
8227
  return props.color || ' rgba(50, 50, 50, 1)';
8226
8228
  });
8227
- var TextRow = styled__default.div(_templateObject2$v || (_templateObject2$v = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n max-width: 90%;\n margin-bottom: 1em;\n padding-bottom: 1em;\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"])));
8229
+ var TextRow = styled__default.div(_templateObject2$v || (_templateObject2$v = _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"])));
8228
8230
  var FilledInfo = styled__default.div(_templateObject3$l || (_templateObject3$l = _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"])));
8229
8231
 
8230
8232
  var CheckoutSummary = function CheckoutSummary(_ref) {
@@ -8247,7 +8249,14 @@ var CheckoutSummary = function CheckoutSummary(_ref) {
8247
8249
  className: "text"
8248
8250
  }, "Order Total:"), /*#__PURE__*/React__default.createElement("h6", {
8249
8251
  className: "total"
8250
- }, renderMoney(orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.totalAmount))), discountTotal && discountTotal > 0 ? /*#__PURE__*/React__default.createElement(TextRow, null, /*#__PURE__*/React__default.createElement("p", {
8252
+ }, renderMoney(orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.totalAmount))), (orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.taxAmount) > 0 ? /*#__PURE__*/React__default.createElement(TextRow, null, /*#__PURE__*/React__default.createElement("p", {
8253
+ className: "text"
8254
+ }, "Tax Amount:"), /*#__PURE__*/React__default.createElement("h6", {
8255
+ className: "total",
8256
+ style: {
8257
+ fontSize: '1rem'
8258
+ }
8259
+ }, renderMoney((orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.taxAmount) || 0))) : null, discountTotal && discountTotal > 0 ? /*#__PURE__*/React__default.createElement(TextRow, null, /*#__PURE__*/React__default.createElement("p", {
8251
8260
  className: "text"
8252
8261
  }, "Discount Total:"), /*#__PURE__*/React__default.createElement("h6", {
8253
8262
  className: "total",
@@ -8342,7 +8351,7 @@ var ButtonRowContainer = styled__default.div(_templateObject8$7 || (_templateObj
8342
8351
  }, function (props) {
8343
8352
  return props.disabledBack ? 'not-allowed' : 'pointer';
8344
8353
  });
8345
- var CheckBoxRow = styled__default.div(_templateObject9$5 || (_templateObject9$5 = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n cursor: pointer;\n padding: ", ";\n margin-left: ", ";\n p {\n font-size: 0.85em;\n }\n\n button {\n border: none;\n border-radius: 4px;\n padding: 0.8em 3em;\n background: ", ";\n color: white;\n text-transform: uppercase;\n font-weight: 600;\n margin: 1em;\n margin-top: 2em;\n transition: 0.4s;\n cursor: pointer;\n min-width: max-content;\n &:hover {\n padding: 0.7em 2.7em;\n }\n }\n .back {\n background-color: ", ";\n padding: 0.8em 2em;\n &:hover {\n padding: 0.8em 2.4em;\n }\n }\n .bold,\n .red {\n font-weight: 600;\n font-size: 1.125em;\n }\n .red {\n margin-left: 0.5em;\n color: ", ";\n }\n .medium {\n font-weight: 600;\n font-size: 1em;\n }\n @media only screen and (max-width: 640px) {\n button {\n &:hover {\n padding: 0.8em 3em;\n }\n }\n\n .back {\n &:hover {\n padding: 0.8em 2em;\n }\n margin-left: 0;\n }\n }\n"])), function (props) {
8354
+ var CheckBoxRow = styled__default.div(_templateObject9$5 || (_templateObject9$5 = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n cursor: pointer;\n padding: ", ";\n margin-left: ", ";\n p {\n font-size: 0.85em;\n }\n\n button {\n border: none;\n border-radius: 4px;\n padding: 0.8rem 3rem;\n background: ", ";\n color: white;\n text-transform: uppercase;\n font-weight: 600;\n margin: 1em;\n margin-top: 2em;\n transition: 0.4s;\n cursor: pointer;\n min-width: max-content;\n &:hover {\n padding: 0.7em 2.7em;\n }\n }\n .back {\n background-color: ", ";\n padding: 0.8em 2em;\n &:hover {\n padding: 0.8em 2.4em;\n }\n }\n .bold,\n .red {\n font-weight: 600;\n font-size: 1.125em;\n }\n .red {\n margin-left: 0.5em;\n color: ", ";\n }\n .medium {\n font-weight: 600;\n font-size: 1em;\n }\n @media only screen and (max-width: 640px) {\n button {\n &:hover {\n padding: 0.8em 3em;\n }\n }\n\n .back {\n &:hover {\n padding: 0.8em 2em;\n }\n margin-left: 0;\n }\n }\n"])), function (props) {
8346
8355
  return props.padding;
8347
8356
  }, function (props) {
8348
8357
  return props.marginLeft;
@@ -10060,7 +10069,7 @@ var Step4 = function Step4(_ref) {
10060
10069
  align: "right"
10061
10070
  }, /*#__PURE__*/React__default.createElement("p", {
10062
10071
  className: "max sm primaryColor"
10063
- }, "Calculated later"))), discountCoupons === null || discountCoupons === void 0 ? void 0 : discountCoupons.map(function (coupon) {
10072
+ }, renderMoney((orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.taxAmount) || 0)))), discountCoupons === null || discountCoupons === void 0 ? void 0 : discountCoupons.map(function (coupon) {
10064
10073
  return /*#__PURE__*/React__default.createElement(StyledTableRow, null, /*#__PURE__*/React__default.createElement(StyledTableCell, {
10065
10074
  colSpan: 1,
10066
10075
  noSmall: true
@@ -10194,7 +10203,7 @@ var Step4 = function Step4(_ref) {
10194
10203
  onClick: function onClick() {
10195
10204
  return clickRedirect('privacy-policy');
10196
10205
  }
10197
- }, "Privacy Policy?")))), /*#__PURE__*/React__default.createElement(material.Grid, {
10206
+ }, "Privacy Policy.")))), /*#__PURE__*/React__default.createElement(material.Grid, {
10198
10207
  item: true,
10199
10208
  xs: 12
10200
10209
  }, /*#__PURE__*/React__default.createElement(CheckBoxRow, null, /*#__PURE__*/React__default.createElement("p", {
@@ -10273,7 +10282,7 @@ var steps = [{
10273
10282
  })
10274
10283
  }];
10275
10284
  var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
10276
- var _styles$input, _customer$customerDto11, _customer$customerDto12, _customer$customerDto13, _customer$customerDto14, _styles$checkoutSumma, _styles$checkoutSumma2;
10285
+ var _styles$input, _customer$customerDto12, _customer$customerDto13, _customer$customerDto14, _customer$customerDto15, _styles$checkoutSumma, _styles$checkoutSumma2;
10277
10286
  var apiEndPoint = _ref.apiEndPoint,
10278
10287
  token = _ref.token,
10279
10288
  authoriseDotNet = _ref.authoriseDotNet,
@@ -10287,7 +10296,6 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
10287
10296
  clickRedirect = _ref.clickRedirect,
10288
10297
  shippingText = _ref.shippingText,
10289
10298
  showShippingPriceRangeLimit = _ref.showShippingPriceRangeLimit,
10290
- taxPercentage = _ref.taxPercentage,
10291
10299
  _ref$taxExempt = _ref.taxExempt,
10292
10300
  taxExempt = _ref$taxExempt === void 0 ? false : _ref$taxExempt;
10293
10301
  var _useState = React.useState(false),
@@ -10437,47 +10445,73 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
10437
10445
  }
10438
10446
  }, [customer, currStep]);
10439
10447
  React.useEffect(function () {
10440
- var _ref2, _ref3, _ref4, _cartData$totalCartPr, _ref5;
10441
- var totalData = {
10442
- taxAmount: parseFloat((_ref2 = taxPercentage ? taxPercentage / 100 * (cartData === null || cartData === void 0 ? void 0 : cartData.totalCartPrice) : 0) === null || _ref2 === void 0 ? void 0 : _ref2.toFixed(2)),
10443
- shippingAmount: parseFloat((_ref3 = (shippingMethod === null || shippingMethod === void 0 ? void 0 : shippingMethod.amount) || 0) === null || _ref3 === void 0 ? void 0 : _ref3.toFixed(2)),
10444
- adjustmentValue: parseFloat((_ref4 = ccProcessingFees ? (cartData === null || cartData === void 0 ? void 0 : cartData.totalCartPrice) * (ccProcessingFees / 100) : 0) === null || _ref4 === void 0 ? void 0 : _ref4.toFixed(2)),
10445
- subTotal: parseFloat(cartData === null || cartData === void 0 ? void 0 : (_cartData$totalCartPr = cartData.totalCartPrice) === null || _cartData$totalCartPr === void 0 ? void 0 : _cartData$totalCartPr.toFixed(2)),
10446
- totalAmount: parseFloat((_ref5 = (cartData === null || cartData === void 0 ? void 0 : cartData.totalCartPrice) + (taxPercentage ? taxPercentage / 100 * (cartData === null || cartData === void 0 ? void 0 : cartData.totalCartPrice) : 0) + ((shippingMethod === null || shippingMethod === void 0 ? void 0 : shippingMethod.amount) || 0) + (ccProcessingFees ? (cartData === null || cartData === void 0 ? void 0 : cartData.totalCartPrice) * (ccProcessingFees / 100) : 0)) === null || _ref5 === void 0 ? void 0 : _ref5.toFixed(2)),
10447
- totalQuantity: cartData === null || cartData === void 0 ? void 0 : cartData.totalCartQuantity
10448
- };
10449
- setOrderTotal(totalData);
10450
- }, [taxPercentage, cartData, shippingMethod, ccProcessingFees]);
10448
+ (function () {
10449
+ try {
10450
+ var _temp9 = function _temp9() {
10451
+ var _taxAmount, _ref2, _ref3, _cartData$totalCartPr, _ref4;
10452
+ var totalData = {
10453
+ taxAmount: parseFloat((_taxAmount = taxAmount) === null || _taxAmount === void 0 ? void 0 : _taxAmount.toFixed(2)),
10454
+ shippingAmount: parseFloat((_ref2 = (shippingMethod === null || shippingMethod === void 0 ? void 0 : shippingMethod.amount) || 0) === null || _ref2 === void 0 ? void 0 : _ref2.toFixed(2)),
10455
+ adjustmentValue: parseFloat((_ref3 = ccProcessingFees ? (cartData === null || cartData === void 0 ? void 0 : cartData.totalCartPrice) * (ccProcessingFees / 100) : 0) === null || _ref3 === void 0 ? void 0 : _ref3.toFixed(2)),
10456
+ subTotal: parseFloat(cartData === null || cartData === void 0 ? void 0 : (_cartData$totalCartPr = cartData.totalCartPrice) === null || _cartData$totalCartPr === void 0 ? void 0 : _cartData$totalCartPr.toFixed(2)),
10457
+ totalAmount: parseFloat((_ref4 = (cartData === null || cartData === void 0 ? void 0 : cartData.totalCartPrice) + taxAmount + ((shippingMethod === null || shippingMethod === void 0 ? void 0 : shippingMethod.amount) || 0) + (ccProcessingFees ? (cartData === null || cartData === void 0 ? void 0 : cartData.totalCartPrice) * (ccProcessingFees / 100) : 0)) === null || _ref4 === void 0 ? void 0 : _ref4.toFixed(2)),
10458
+ totalQuantity: cartData === null || cartData === void 0 ? void 0 : cartData.totalCartQuantity
10459
+ };
10460
+ setOrderTotal(totalData);
10461
+ };
10462
+ var taxAmount = 0;
10463
+ var _temp8 = function (_cartData$cartLineIte) {
10464
+ if (shippingAddressId && (cartData === null || cartData === void 0 ? void 0 : (_cartData$cartLineIte = cartData.cartLineItemDtoList) === null || _cartData$cartLineIte === void 0 ? void 0 : _cartData$cartLineIte.length) > 0) {
10465
+ return Promise.resolve(API$1({
10466
+ apiEndPoint: apiEndPoint,
10467
+ token: token,
10468
+ url: "/cartLineItem/totalTax",
10469
+ queryParams: {
10470
+ storeId: 2,
10471
+ customerShippingAddressId: shippingAddressId
10472
+ }
10473
+ })).then(function (taxData) {
10474
+ var _customer$customerDto;
10475
+ taxAmount = !(customer !== null && customer !== void 0 && (_customer$customerDto = customer.customerDto) !== null && _customer$customerDto !== void 0 && _customer$customerDto.taxable) ? 0 : lodash.sumBy(taxData, 'taxAmount') || 0;
10476
+ });
10477
+ }
10478
+ }();
10479
+ return _temp8 && _temp8.then ? _temp8.then(_temp9) : _temp9(_temp8);
10480
+ } catch (e) {
10481
+ Promise.reject(e);
10482
+ }
10483
+ })();
10484
+ }, [cartData, shippingMethod, ccProcessingFees, shippingAddressId]);
10451
10485
  var onLoginCustomer = function onLoginCustomer(data) {
10452
10486
  try {
10453
- var _temp9 = function _temp9() {
10487
+ var _temp11 = function _temp11() {
10454
10488
  setLoginLoading(false);
10455
10489
  };
10456
10490
  setLoginLoading(true);
10457
- var _temp8 = _catch(function () {
10491
+ var _temp10 = _catch(function () {
10458
10492
  return Promise.resolve(handleLogin(data)).then(function () {});
10459
10493
  }, function () {});
10460
- return Promise.resolve(_temp8 && _temp8.then ? _temp8.then(_temp9) : _temp9(_temp8));
10494
+ return Promise.resolve(_temp10 && _temp10.then ? _temp10.then(_temp11) : _temp11(_temp10));
10461
10495
  } catch (e) {
10462
10496
  return Promise.reject(e);
10463
10497
  }
10464
10498
  };
10465
10499
  var addStoreAddress = function addStoreAddress(data) {
10466
10500
  try {
10467
- var _temp11 = _catch(function () {
10468
- var _customer$customerDto, _customer$customerDto2;
10501
+ var _temp13 = _catch(function () {
10502
+ var _customer$customerDto2, _customer$customerDto3;
10469
10503
  return Promise.resolve(API$1({
10470
10504
  apiEndPoint: apiEndPoint,
10471
10505
  token: token,
10472
10506
  method: 'POST',
10473
- url: "/ecommerce/customer/" + (customer === null || customer === void 0 ? void 0 : (_customer$customerDto = customer.customerDto) === null || _customer$customerDto === void 0 ? void 0 : _customer$customerDto.id) + "/address",
10507
+ url: "/ecommerce/customer/" + (customer === null || customer === void 0 ? void 0 : (_customer$customerDto2 = customer.customerDto) === null || _customer$customerDto2 === void 0 ? void 0 : _customer$customerDto2.id) + "/address",
10474
10508
  body: _extends({}, data, {
10475
- customerId: customer === null || customer === void 0 ? void 0 : (_customer$customerDto2 = customer.customerDto) === null || _customer$customerDto2 === void 0 ? void 0 : _customer$customerDto2.id
10509
+ customerId: customer === null || customer === void 0 ? void 0 : (_customer$customerDto3 = customer.customerDto) === null || _customer$customerDto3 === void 0 ? void 0 : _customer$customerDto3.id
10476
10510
  }),
10477
10511
  successMessage: 'Address added successfully.',
10478
10512
  errorMessage: 'Error in added the address.'
10479
10513
  })).then(function (result) {
10480
- var _temp10 = function () {
10514
+ var _temp12 = function () {
10481
10515
  if (result) {
10482
10516
  return Promise.resolve(API$1({
10483
10517
  apiEndPoint: apiEndPoint,
@@ -10488,10 +10522,10 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
10488
10522
  });
10489
10523
  }
10490
10524
  }();
10491
- if (_temp10 && _temp10.then) return _temp10.then(function () {});
10525
+ if (_temp12 && _temp12.then) return _temp12.then(function () {});
10492
10526
  });
10493
10527
  }, function () {});
10494
- return Promise.resolve(_temp11 && _temp11.then ? _temp11.then(function () {}) : void 0);
10528
+ return Promise.resolve(_temp13 && _temp13.then ? _temp13.then(function () {}) : void 0);
10495
10529
  } catch (e) {
10496
10530
  return Promise.reject(e);
10497
10531
  }
@@ -10514,12 +10548,12 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
10514
10548
  setShippingMethod(shippingMethod);
10515
10549
  };
10516
10550
  var setPaymentDetails = function setPaymentDetails(storeCr, paymentMethod, cr) {
10517
- var _customer$customerDto3;
10518
- if (storeCr && (customer === null || customer === void 0 ? void 0 : (_customer$customerDto3 = customer.customerDto) === null || _customer$customerDto3 === void 0 ? void 0 : _customer$customerDto3.storeCredit) > 0) {
10519
- var _customer$customerDto4;
10551
+ var _customer$customerDto4;
10552
+ if (storeCr && (customer === null || customer === void 0 ? void 0 : (_customer$customerDto4 = customer.customerDto) === null || _customer$customerDto4 === void 0 ? void 0 : _customer$customerDto4.storeCredit) > 0) {
10553
+ var _customer$customerDto5;
10520
10554
  setStoreCredits({
10521
10555
  id: 5,
10522
- amount: customer === null || customer === void 0 ? void 0 : (_customer$customerDto4 = customer.customerDto) === null || _customer$customerDto4 === void 0 ? void 0 : _customer$customerDto4.storeCredit
10556
+ amount: customer === null || customer === void 0 ? void 0 : (_customer$customerDto5 = customer.customerDto) === null || _customer$customerDto5 === void 0 ? void 0 : _customer$customerDto5.storeCredit
10523
10557
  });
10524
10558
  } else {
10525
10559
  setStoreCredits(null);
@@ -10535,11 +10569,11 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
10535
10569
  };
10536
10570
  var onPlaceOrder = function onPlaceOrder(note) {
10537
10571
  try {
10538
- var _temp13 = function _temp13() {
10572
+ var _temp15 = function _temp15() {
10539
10573
  setOrdering(false);
10540
10574
  };
10541
10575
  setOrdering(true);
10542
- var _temp12 = _catch(function () {
10576
+ var _temp14 = _catch(function () {
10543
10577
  var authorizeCustomerCardData = {
10544
10578
  authorizeDotNetCustomerProfileId: selectedPaymentMethod === null || selectedPaymentMethod === void 0 ? void 0 : selectedPaymentMethod.authorizeDotNetCustomerProfileId,
10545
10579
  authorizeDotNetCustomerPaymentProfileId: selectedPaymentMethod === null || selectedPaymentMethod === void 0 ? void 0 : selectedPaymentMethod.authorizeDotNetCustomerPaymentProfileId
@@ -10590,24 +10624,24 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
10590
10624
  });
10591
10625
  }
10592
10626
  if (selectedStoreCredits && (selectedStoreCredits === null || selectedStoreCredits === void 0 ? void 0 : selectedStoreCredits.amount) > (orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.totalAmount) - discountTotal) {
10593
- var _ref6;
10627
+ var _ref5;
10594
10628
  orderPaymentList = [{
10595
- amount: (_ref6 = (orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.totalAmount) - discountTotal) === null || _ref6 === void 0 ? void 0 : _ref6.toFixed(2),
10629
+ amount: parseFloat((_ref5 = (orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.totalAmount) - discountTotal) === null || _ref5 === void 0 ? void 0 : _ref5.toFixed(2)),
10596
10630
  paymentModeId: selectedStoreCredits === null || selectedStoreCredits === void 0 ? void 0 : selectedStoreCredits.id
10597
10631
  }];
10598
10632
  } else if (selectedStoreCredits && (selectedStoreCredits === null || selectedStoreCredits === void 0 ? void 0 : selectedStoreCredits.amount) < (orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.totalAmount) - discountTotal) {
10599
- var _selectedStoreCredits, _ref7;
10633
+ var _selectedStoreCredits, _ref6;
10600
10634
  orderPaymentList = [{
10601
- amount: selectedStoreCredits === null || selectedStoreCredits === void 0 ? void 0 : (_selectedStoreCredits = selectedStoreCredits.amount) === null || _selectedStoreCredits === void 0 ? void 0 : _selectedStoreCredits.toFixed(2),
10635
+ amount: parseFloat(selectedStoreCredits === null || selectedStoreCredits === void 0 ? void 0 : (_selectedStoreCredits = selectedStoreCredits.amount) === null || _selectedStoreCredits === void 0 ? void 0 : _selectedStoreCredits.toFixed(2)),
10602
10636
  paymentModeId: selectedStoreCredits === null || selectedStoreCredits === void 0 ? void 0 : selectedStoreCredits.id
10603
10637
  }, _extends({
10604
- amount: (_ref7 = (orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.totalAmount) - (selectedStoreCredits === null || selectedStoreCredits === void 0 ? void 0 : selectedStoreCredits.amount) - discountTotal) === null || _ref7 === void 0 ? void 0 : _ref7.toFixed(2),
10638
+ amount: parseFloat((_ref6 = (orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.totalAmount) - (selectedStoreCredits === null || selectedStoreCredits === void 0 ? void 0 : selectedStoreCredits.amount) - discountTotal) === null || _ref6 === void 0 ? void 0 : _ref6.toFixed(2)),
10605
10639
  paymentModeId: selectedPaymentMethod === null || selectedPaymentMethod === void 0 ? void 0 : selectedPaymentMethod.id
10606
10640
  }, authorizeCustomerCardData)];
10607
10641
  } else {
10608
- var _ref8;
10642
+ var _ref7;
10609
10643
  orderPaymentList = [_extends({
10610
- amount: (_ref8 = (orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.totalAmount) - discountTotal) === null || _ref8 === void 0 ? void 0 : _ref8.toFixed(2),
10644
+ amount: parseFloat((_ref7 = (orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.totalAmount) - discountTotal) === null || _ref7 === void 0 ? void 0 : _ref7.toFixed(2)),
10611
10645
  paymentModeId: selectedPaymentMethod === null || selectedPaymentMethod === void 0 ? void 0 : selectedPaymentMethod.id,
10612
10646
  customerOrderCard: ecommerceCustomPaymentDto
10613
10647
  }, authorizeCustomerCardData)];
@@ -10623,7 +10657,7 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
10623
10657
  }
10624
10658
  return Promise.resolve(placeOrder(body)).then(function () {});
10625
10659
  }, function () {});
10626
- return Promise.resolve(_temp12 && _temp12.then ? _temp12.then(_temp13) : _temp13(_temp12));
10660
+ return Promise.resolve(_temp14 && _temp14.then ? _temp14.then(_temp15) : _temp15(_temp14));
10627
10661
  } catch (e) {
10628
10662
  return Promise.reject(e);
10629
10663
  }
@@ -10634,7 +10668,8 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
10634
10668
  bg: styles === null || styles === void 0 ? void 0 : styles.bg
10635
10669
  }, /*#__PURE__*/React__default.createElement(material.CssBaseline, null), /*#__PURE__*/React__default.createElement(CheckoutPageContainer, {
10636
10670
  className: "checkout",
10637
- bg: styles === null || styles === void 0 ? void 0 : styles.bg
10671
+ bg: styles === null || styles === void 0 ? void 0 : styles.bg,
10672
+ primaryColor: styles === null || styles === void 0 ? void 0 : styles.primaryColor
10638
10673
  }, /*#__PURE__*/React__default.createElement(material.Stack, {
10639
10674
  flexDirection: "column",
10640
10675
  alignItems: "flex-start"
@@ -10662,7 +10697,7 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
10662
10697
  width: '100%'
10663
10698
  }
10664
10699
  }, steps === null || steps === void 0 ? void 0 : steps.map(function (item, index) {
10665
- var _styles$stepperIcon, _styles$stepperIcon2, _customer$customerDto5, _customer$customerDto6, _customer$customerDto7, _customer$customerDto8, _customer$customerDto9, _customer$customerDto10;
10700
+ var _styles$stepperIcon, _styles$stepperIcon2, _customer$customerDto6, _customer$customerDto7, _customer$customerDto8, _customer$customerDto9, _customer$customerDto10, _customer$customerDto11;
10666
10701
  return /*#__PURE__*/React__default.createElement(material.Step, {
10667
10702
  key: index
10668
10703
  }, /*#__PURE__*/React__default.createElement(material.StepLabel, {
@@ -10695,7 +10730,7 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
10695
10730
  text: item.text,
10696
10731
  icon: item.icon,
10697
10732
  single: true,
10698
- username: index === 0 ? customer === null || customer === void 0 ? void 0 : (_customer$customerDto5 = customer.customerDto) === null || _customer$customerDto5 === void 0 ? void 0 : _customer$customerDto5.firstName : '',
10733
+ username: index === 0 ? customer === null || customer === void 0 ? void 0 : (_customer$customerDto6 = customer.customerDto) === null || _customer$customerDto6 === void 0 ? void 0 : _customer$customerDto6.firstName : '',
10699
10734
  primaryColor: styles === null || styles === void 0 ? void 0 : styles.primaryColor,
10700
10735
  closed: true,
10701
10736
  handleClick: function handleClick() {
@@ -10710,7 +10745,7 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
10710
10745
  }, /*#__PURE__*/React__default.createElement(Step0, {
10711
10746
  currStep: currStep,
10712
10747
  loading: loginLoading,
10713
- userName: customer === null || customer === void 0 ? void 0 : (_customer$customerDto6 = customer.customerDto) === null || _customer$customerDto6 === void 0 ? void 0 : _customer$customerDto6.firstName,
10748
+ userName: customer === null || customer === void 0 ? void 0 : (_customer$customerDto7 = customer.customerDto) === null || _customer$customerDto7 === void 0 ? void 0 : _customer$customerDto7.firstName,
10714
10749
  handleBack: handleBack,
10715
10750
  handleNext: handleNext,
10716
10751
  handleLogin: onLoginCustomer,
@@ -10752,7 +10787,7 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
10752
10787
  setShipping: setShipping,
10753
10788
  showShipping: showShipping,
10754
10789
  shippingMethod: shippingMethod,
10755
- storeCredits: customer === null || customer === void 0 ? void 0 : (_customer$customerDto7 = customer.customerDto) === null || _customer$customerDto7 === void 0 ? void 0 : _customer$customerDto7.storeCredit,
10790
+ storeCredits: customer === null || customer === void 0 ? void 0 : (_customer$customerDto8 = customer.customerDto) === null || _customer$customerDto8 === void 0 ? void 0 : _customer$customerDto8.storeCredit,
10756
10791
  discountCoupons: discountCoupons,
10757
10792
  addShipping: addStoreAddress,
10758
10793
  setSelectedCountry: setSelectedCountry,
@@ -10776,7 +10811,7 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
10776
10811
  payments: paymentMethods,
10777
10812
  states: states,
10778
10813
  countries: countries,
10779
- storeCredits: customer === null || customer === void 0 ? void 0 : (_customer$customerDto8 = customer.customerDto) === null || _customer$customerDto8 === void 0 ? void 0 : _customer$customerDto8.storeCredit,
10814
+ storeCredits: customer === null || customer === void 0 ? void 0 : (_customer$customerDto9 = customer.customerDto) === null || _customer$customerDto9 === void 0 ? void 0 : _customer$customerDto9.storeCredit,
10780
10815
  total: cartData === null || cartData === void 0 ? void 0 : cartData.totalCartPrice,
10781
10816
  styles: styles,
10782
10817
  setSelectedCountry: setSelectedCountry
@@ -10802,17 +10837,17 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
10802
10837
  discountCoupons: discountCoupons,
10803
10838
  shippingText: shippingText,
10804
10839
  ccProcessingFees: ccProcessingFees,
10805
- shippingInformation: customer === null || customer === void 0 ? void 0 : (_customer$customerDto9 = customer.customerDto) === null || _customer$customerDto9 === void 0 ? void 0 : (_customer$customerDto10 = _customer$customerDto9.customerStoreAddressList) === null || _customer$customerDto10 === void 0 ? void 0 : _customer$customerDto10.find(function (item) {
10840
+ shippingInformation: customer === null || customer === void 0 ? void 0 : (_customer$customerDto10 = customer.customerDto) === null || _customer$customerDto10 === void 0 ? void 0 : (_customer$customerDto11 = _customer$customerDto10.customerStoreAddressList) === null || _customer$customerDto11 === void 0 ? void 0 : _customer$customerDto11.find(function (item) {
10806
10841
  return (item === null || item === void 0 ? void 0 : item.id) === shippingAddressId;
10807
10842
  }),
10808
10843
  taxExempt: taxExempt,
10809
10844
  orderTotal: orderTotal
10810
10845
  })));
10811
10846
  }))))), /*#__PURE__*/React__default.createElement(CheckoutSummary, {
10812
- billingInformation: customer === null || customer === void 0 ? void 0 : (_customer$customerDto11 = customer.customerDto) === null || _customer$customerDto11 === void 0 ? void 0 : (_customer$customerDto12 = _customer$customerDto11.customerStoreAddressList) === null || _customer$customerDto12 === void 0 ? void 0 : _customer$customerDto12.find(function (item) {
10847
+ billingInformation: customer === null || customer === void 0 ? void 0 : (_customer$customerDto12 = customer.customerDto) === null || _customer$customerDto12 === void 0 ? void 0 : (_customer$customerDto13 = _customer$customerDto12.customerStoreAddressList) === null || _customer$customerDto13 === void 0 ? void 0 : _customer$customerDto13.find(function (item) {
10813
10848
  return (item === null || item === void 0 ? void 0 : item.id) === billingAddressId;
10814
10849
  }),
10815
- shippingInformation: customer === null || customer === void 0 ? void 0 : (_customer$customerDto13 = customer.customerDto) === null || _customer$customerDto13 === void 0 ? void 0 : (_customer$customerDto14 = _customer$customerDto13.customerStoreAddressList) === null || _customer$customerDto14 === void 0 ? void 0 : _customer$customerDto14.find(function (item) {
10850
+ shippingInformation: customer === null || customer === void 0 ? void 0 : (_customer$customerDto14 = customer.customerDto) === null || _customer$customerDto14 === void 0 ? void 0 : (_customer$customerDto15 = _customer$customerDto14.customerStoreAddressList) === null || _customer$customerDto15 === void 0 ? void 0 : _customer$customerDto15.find(function (item) {
10816
10851
  return (item === null || item === void 0 ? void 0 : item.id) === shippingAddressId;
10817
10852
  }),
10818
10853
  shippingMethod: shippingMethod,