@ubnt/store.core 9.4.0 → 9.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/lib/assets/attention.svg +5 -5
  3. package/lib/assets/attention2.svg +5 -5
  4. package/lib/assets/icons/wizard/plus.svg.js +1 -1
  5. package/lib/assets/icons/wizard/plus.svg.mjs +2 -2
  6. package/lib/assets/minus4.svg +8 -8
  7. package/lib/assets/minus5.svg +8 -8
  8. package/lib/assets/plus.svg +22 -4
  9. package/lib/assets/plus2.svg +4 -22
  10. package/lib/assets/plus5.svg +9 -9
  11. package/lib/assets/plus6.svg +9 -9
  12. package/lib/assets/ucgMax.jpg +0 -0
  13. package/lib/assets/ucgMax2.jpg +0 -0
  14. package/lib/assets/ucgUltra.jpg +0 -0
  15. package/lib/assets/ucgUltra2.jpg +0 -0
  16. package/lib/components/FeaturesSection_deprecated/AllFeaturesButton/AllFeaturesButton.js +1 -1
  17. package/lib/components/FeaturesSection_deprecated/AllFeaturesButton/AllFeaturesButton.mjs +1 -1
  18. package/lib/components/FeaturesSection_deprecated/assets/plus.svg.js +1 -1
  19. package/lib/components/FeaturesSection_deprecated/assets/plus.svg.mjs +2 -2
  20. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgMax.jpg.js +5 -5
  21. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgMax.jpg.mjs +2 -2
  22. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgUltra.jpg.js +5 -5
  23. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgUltra.jpg.mjs +2 -2
  24. package/lib/components/ModelCompareV3/assets/Consoles/ucgMax.jpg.js +1 -1
  25. package/lib/components/ModelCompareV3/assets/Consoles/ucgMax.jpg.mjs +2 -2
  26. package/lib/components/ModelCompareV3/assets/Consoles/ucgUltra.jpg.js +1 -1
  27. package/lib/components/ModelCompareV3/assets/Consoles/ucgUltra.jpg.mjs +2 -2
  28. package/lib/components/ModelCompareV3/data/CloudGateways.js +6 -6
  29. package/lib/components/ModelCompareV3/data/CloudGateways.mjs +4 -4
  30. package/lib/components/ModelCompareV3/data/products/ucgMax.js +1 -1
  31. package/lib/components/ModelCompareV3/data/products/ucgMax.mjs +1 -1
  32. package/lib/components/ModelCompareV3/data/products/ucgUltra.js +1 -1
  33. package/lib/components/ModelCompareV3/data/products/ucgUltra.mjs +1 -1
  34. package/lib/components/ProductWizard/ProductWizard.js +1 -1
  35. package/lib/components/ProductWizard/ProductWizard.mjs +1 -1
  36. package/lib/components/QuantityInput/QuantityInput.js +1 -1
  37. package/lib/components/QuantityInput/QuantityInput.mjs +1 -1
  38. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.js +1 -1
  39. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.mjs +1 -1
  40. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CounterSection.js +2 -2
  41. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CounterSection.mjs +2 -2
  42. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.js +1 -1
  43. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.mjs +2 -2
  44. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/minus.svg.js +1 -1
  45. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/minus.svg.mjs +2 -2
  46. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/plus.svg.js +1 -1
  47. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/plus.svg.mjs +2 -2
  48. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.js +1 -1
  49. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.mjs +1 -1
  50. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.js +1 -1
  51. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.mjs +2 -2
  52. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.js +2 -2
  53. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.mjs +2 -2
  54. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/minus.svg.js +1 -1
  55. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/minus.svg.mjs +2 -2
  56. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/plus.svg.js +1 -1
  57. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/plus.svg.mjs +2 -2
  58. package/lib/utils/tax/index.d.ts +1 -1
  59. package/lib/utils/tax/index.js +8 -1
  60. package/lib/utils/tax/index.js.map +1 -1
  61. package/lib/utils/tax/index.mjs +8 -1
  62. package/lib/utils/tax/index.mjs.map +1 -1
  63. package/lib/utils/tax/types.d.ts +2 -1
  64. package/lib/utils/tax/types.js +1 -0
  65. package/lib/utils/tax/types.js.map +1 -1
  66. package/lib/utils/tax/types.mjs +1 -0
  67. package/lib/utils/tax/types.mjs.map +1 -1
  68. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@
6
6
 
7
7
  ## Releases
8
8
 
9
+ ### 9.5.0
10
+
11
+ - [Feat] [NEP-3488](https://ubiquiti.atlassian.net/browse/NEP-3488) Change MX vat to rfc
12
+
9
13
  ### 9.4.0
10
14
 
11
15
  - [Feat] [MIC-345](https://ubiquiti.atlassian.net/browse/MIC-345) `UMR Industrial` release changes:
@@ -1,6 +1,6 @@
1
- <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <circle cx="9" cy="9" r="9" fill="#F7D55E"/>
3
- <path d="M9.73071 4.64062C9.40595 4.07813 8.59405 4.07812 8.26929 4.64062L4.37218 11.3906C4.04742 11.9531 4.45336 12.6562 5.10288 12.6562H12.8971C13.5466 12.6562 13.9526 11.9531 13.6278 11.3906L9.73071 4.64062Z" stroke="white" stroke-width="0.5625"/>
4
- <path d="M9.22274 9.12833L9.48295 7.30685C9.52494 7.01295 9.29688 6.75 9 6.75C8.70312 6.75 8.47506 7.01295 8.51705 7.30685L8.77726 9.12833C8.81406 9.3859 9.18594 9.3859 9.22274 9.12833Z" fill="white"/>
5
- <circle cx="9" cy="10.6875" r="0.5625" fill="#F7D55E"/>
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle cx="8" cy="8" r="8" fill="#A4A7B5"/>
3
+ <path d="M12.1136 10.125L8.64952 4.125C8.36084 3.625 7.63916 3.625 7.35048 4.125L3.88638 10.125C3.5977 10.625 3.95855 11.25 4.5359 11.25H11.4641C12.0415 11.25 12.4023 10.625 12.1136 10.125Z" stroke="white" stroke-width="0.5"/>
4
+ <path d="M8.19799 8.11407L8.42929 6.49497C8.46661 6.23373 8.2639 6 8 6C7.7361 6 7.53339 6.23373 7.57071 6.49497L7.80201 8.11407C7.83472 8.34302 8.16528 8.34303 8.19799 8.11407Z" fill="white"/>
5
+ <circle cx="8" cy="9.5" r="0.5" fill="white"/>
6
6
  </svg>
@@ -1,6 +1,6 @@
1
- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <circle cx="8" cy="8" r="8" fill="#A4A7B5"/>
3
- <path d="M12.1136 10.125L8.64952 4.125C8.36084 3.625 7.63916 3.625 7.35048 4.125L3.88638 10.125C3.5977 10.625 3.95855 11.25 4.5359 11.25H11.4641C12.0415 11.25 12.4023 10.625 12.1136 10.125Z" stroke="white" stroke-width="0.5"/>
4
- <path d="M8.19799 8.11407L8.42929 6.49497C8.46661 6.23373 8.2639 6 8 6C7.7361 6 7.53339 6.23373 7.57071 6.49497L7.80201 8.11407C7.83472 8.34302 8.16528 8.34303 8.19799 8.11407Z" fill="white"/>
5
- <circle cx="8" cy="9.5" r="0.5" fill="white"/>
1
+ <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle cx="9" cy="9" r="9" fill="#F7D55E"/>
3
+ <path d="M9.73071 4.64062C9.40595 4.07813 8.59405 4.07812 8.26929 4.64062L4.37218 11.3906C4.04742 11.9531 4.45336 12.6562 5.10288 12.6562H12.8971C13.5466 12.6562 13.9526 11.9531 13.6278 11.3906L9.73071 4.64062Z" stroke="white" stroke-width="0.5625"/>
4
+ <path d="M9.22274 9.12833L9.48295 7.30685C9.52494 7.01295 9.29688 6.75 9 6.75C8.70312 6.75 8.47506 7.01295 8.51705 7.30685L8.77726 9.12833C8.81406 9.3859 9.18594 9.3859 9.22274 9.12833Z" fill="white"/>
5
+ <circle cx="9" cy="10.6875" r="0.5625" fill="#F7D55E"/>
6
6
  </svg>
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var plus = require("../../plus2.svg");
6
+ var plus = require("../../plus.svg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
@@ -1,3 +1,3 @@
1
- export * from "../../plus2.svg";
2
- export { default } from "../../plus2.svg";
1
+ export * from "../../plus.svg";
2
+ export { default } from "../../plus.svg";
3
3
  //# sourceMappingURL=plus.svg.mjs.map
@@ -1,15 +1,15 @@
1
- <svg width="6" height="6" viewBox="0 0 6 6" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <mask id="mask0_426_15898" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="6" height="6">
3
- <g clip-path="url(#clip0_426_15898)">
4
- <path d="M5.16287 2.9397H0.697754V3.38621H5.16287V2.9397Z" fill="#838691"/>
1
+ <svg width="11" height="10" viewBox="0 0 11 10" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <mask id="mask0_658_406" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="11" height="10">
3
+ <g clip-path="url(#clip0_658_406)">
4
+ <path d="M10.2546 4.35H0.587891V5.31667H10.2546V4.35Z" fill="#838691"/>
5
5
  </g>
6
6
  </mask>
7
- <g mask="url(#mask0_426_15898)">
8
- <rect x="0.697754" y="0.930176" width="4.46512" height="4.46512" fill="#838691"/>
7
+ <g mask="url(#mask0_658_406)">
8
+ <rect x="0.587891" width="9.66667" height="9.66667" fill="#838691"/>
9
9
  </g>
10
10
  <defs>
11
- <clipPath id="clip0_426_15898">
12
- <rect width="4.46512" height="4.46512" fill="white" transform="translate(0.697754 0.930176)"/>
11
+ <clipPath id="clip0_658_406">
12
+ <rect width="9.66667" height="9.66667" fill="white" transform="translate(0.587891)"/>
13
13
  </clipPath>
14
14
  </defs>
15
15
  </svg>
@@ -1,15 +1,15 @@
1
- <svg width="11" height="10" viewBox="0 0 11 10" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <mask id="mask0_658_406" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="11" height="10">
3
- <g clip-path="url(#clip0_658_406)">
4
- <path d="M10.2546 4.35H0.587891V5.31667H10.2546V4.35Z" fill="#838691"/>
1
+ <svg width="6" height="6" viewBox="0 0 6 6" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <mask id="mask0_426_15898" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="6" height="6">
3
+ <g clip-path="url(#clip0_426_15898)">
4
+ <path d="M5.16287 2.9397H0.697754V3.38621H5.16287V2.9397Z" fill="#838691"/>
5
5
  </g>
6
6
  </mask>
7
- <g mask="url(#mask0_658_406)">
8
- <rect x="0.587891" width="9.66667" height="9.66667" fill="#838691"/>
7
+ <g mask="url(#mask0_426_15898)">
8
+ <rect x="0.697754" y="0.930176" width="4.46512" height="4.46512" fill="#838691"/>
9
9
  </g>
10
10
  <defs>
11
- <clipPath id="clip0_658_406">
12
- <rect width="9.66667" height="9.66667" fill="white" transform="translate(0.587891)"/>
11
+ <clipPath id="clip0_426_15898">
12
+ <rect width="4.46512" height="4.46512" fill="white" transform="translate(0.697754 0.930176)"/>
13
13
  </clipPath>
14
14
  </defs>
15
15
  </svg>
@@ -1,4 +1,22 @@
1
- <svg width="14" height="14" viewBox="0 0 14 14" fill="none"
2
- xmlns="http://www.w3.org/2000/svg">
3
- <path fill-rule="evenodd" clip-rule="evenodd" d="M8 1C8 0.453333 7.54667 0 7 0C6.45333 0 6 0.453333 6 1V6H1C0.453333 6 0 6.45333 0 7C0 7.54667 0.453333 8 1 8H6V13C6 13.5467 6.45333 14 7 14C7.54667 14 8 13.5467 8 13V8H13C13.5467 8 14 7.54667 14 7C14 6.45333 13.5467 6 13 6H8V1Z" fill="currentColor"/>
4
- </svg>
1
+ <svg
2
+ width="10"
3
+ height="10"
4
+ viewBox="0 0 10 10"
5
+ fill="none"
6
+ xmlns="http://www.w3.org/2000/svg"
7
+ >
8
+ <rect
9
+ y="4.5"
10
+ width="10"
11
+ height="1"
12
+ fill="#838691"
13
+ />
14
+ <rect
15
+ x="4.5"
16
+ y="10"
17
+ width="10"
18
+ height="1"
19
+ transform="rotate(-90 4.5 10)"
20
+ fill="#838691"
21
+ />
22
+ </svg>
@@ -1,22 +1,4 @@
1
- <svg
2
- width="10"
3
- height="10"
4
- viewBox="0 0 10 10"
5
- fill="none"
6
- xmlns="http://www.w3.org/2000/svg"
7
- >
8
- <rect
9
- y="4.5"
10
- width="10"
11
- height="1"
12
- fill="#838691"
13
- />
14
- <rect
15
- x="4.5"
16
- y="10"
17
- width="10"
18
- height="1"
19
- transform="rotate(-90 4.5 10)"
20
- fill="#838691"
21
- />
22
- </svg>
1
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none"
2
+ xmlns="http://www.w3.org/2000/svg">
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M8 1C8 0.453333 7.54667 0 7 0C6.45333 0 6 0.453333 6 1V6H1C0.453333 6 0 6.45333 0 7C0 7.54667 0.453333 8 1 8H6V13C6 13.5467 6.45333 14 7 14C7.54667 14 8 13.5467 8 13V8H13C13.5467 8 14 7.54667 14 7C14 6.45333 13.5467 6 13 6H8V1Z" fill="currentColor"/>
4
+ </svg>
@@ -1,16 +1,16 @@
1
- <svg width="6" height="6" viewBox="0 0 6 6" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <mask id="mask0_426_15903" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="6" height="6">
3
- <g clip-path="url(#clip0_426_15903)">
4
- <path d="M5.30227 2.9397H0.837158V3.38621H5.30227V2.9397Z" fill="#838691"/>
5
- <path d="M2.84668 0.930147L2.84668 5.39526H3.29319L3.29319 0.930147H2.84668Z" fill="#838691"/>
1
+ <svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <mask id="mask0_658_411" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="10" height="10">
3
+ <g clip-path="url(#clip0_658_411)">
4
+ <path d="M9.86637 4.35H0.199707V5.31667H9.86637V4.35Z" fill="#838691"/>
5
+ <path d="M4.5498 -2.86102e-06L4.5498 9.66666H5.51647L5.51647 -2.86102e-06H4.5498Z" fill="#838691"/>
6
6
  </g>
7
7
  </mask>
8
- <g mask="url(#mask0_426_15903)">
9
- <rect x="0.837158" y="0.930176" width="4.46512" height="4.46512" fill="#838691"/>
8
+ <g mask="url(#mask0_658_411)">
9
+ <rect x="0.199707" width="9.66667" height="9.66667" fill="#838691"/>
10
10
  </g>
11
11
  <defs>
12
- <clipPath id="clip0_426_15903">
13
- <rect width="4.46512" height="4.46512" fill="white" transform="translate(0.837158 0.930176)"/>
12
+ <clipPath id="clip0_658_411">
13
+ <rect width="9.66667" height="9.66667" fill="white" transform="translate(0.199707)"/>
14
14
  </clipPath>
15
15
  </defs>
16
16
  </svg>
@@ -1,16 +1,16 @@
1
- <svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <mask id="mask0_658_411" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="10" height="10">
3
- <g clip-path="url(#clip0_658_411)">
4
- <path d="M9.86637 4.35H0.199707V5.31667H9.86637V4.35Z" fill="#838691"/>
5
- <path d="M4.5498 -2.86102e-06L4.5498 9.66666H5.51647L5.51647 -2.86102e-06H4.5498Z" fill="#838691"/>
1
+ <svg width="6" height="6" viewBox="0 0 6 6" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <mask id="mask0_426_15903" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="6" height="6">
3
+ <g clip-path="url(#clip0_426_15903)">
4
+ <path d="M5.30227 2.9397H0.837158V3.38621H5.30227V2.9397Z" fill="#838691"/>
5
+ <path d="M2.84668 0.930147L2.84668 5.39526H3.29319L3.29319 0.930147H2.84668Z" fill="#838691"/>
6
6
  </g>
7
7
  </mask>
8
- <g mask="url(#mask0_658_411)">
9
- <rect x="0.199707" width="9.66667" height="9.66667" fill="#838691"/>
8
+ <g mask="url(#mask0_426_15903)">
9
+ <rect x="0.837158" y="0.930176" width="4.46512" height="4.46512" fill="#838691"/>
10
10
  </g>
11
11
  <defs>
12
- <clipPath id="clip0_658_411">
13
- <rect width="9.66667" height="9.66667" fill="white" transform="translate(0.199707)"/>
12
+ <clipPath id="clip0_426_15903">
13
+ <rect width="4.46512" height="4.46512" fill="white" transform="translate(0.837158 0.930176)"/>
14
14
  </clipPath>
15
15
  </defs>
16
16
  </svg>
Binary file
Binary file
Binary file
Binary file
@@ -5,7 +5,7 @@ require('../../StyleableSvgImage/index.js');
5
5
  require('../assets/plus.svg.js');
6
6
  var AllFeaturesButton_styles = require('./AllFeaturesButton.styles.js');
7
7
  var StyleableSvgImage = require('../../StyleableSvgImage/StyleableSvgImage.js');
8
- var PlusIcon = require("../../../assets/plus.svg");
8
+ var PlusIcon = require("../../../assets/plus2.svg");
9
9
  function _interopDefault(e) {
10
10
  return e && e.__esModule ? e : {
11
11
  default: e
@@ -3,7 +3,7 @@ import '../../StyleableSvgImage/index.mjs';
3
3
  import '../assets/plus.svg.mjs';
4
4
  import { StyledButton, InnerWrap } from './AllFeaturesButton.styles.mjs';
5
5
  import { StyleableSvgImage } from '../../StyleableSvgImage/StyleableSvgImage.mjs';
6
- import PlusIcon__default from "../../../assets/plus.svg";
6
+ import PlusIcon__default from "../../../assets/plus2.svg";
7
7
  "use strict";
8
8
  const AllFeaturesButton = ({
9
9
  className,
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var PlusIcon = require("../../../assets/plus.svg");
6
+ var PlusIcon = require("../../../assets/plus2.svg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
@@ -1,3 +1,3 @@
1
- export * from "../../../assets/plus.svg";
2
- export { default } from "../../../assets/plus.svg";
1
+ export * from "../../../assets/plus2.svg";
2
+ export { default } from "../../../assets/plus2.svg";
3
3
  //# sourceMappingURL=plus.svg.mjs.map
@@ -3,24 +3,24 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var _externalAssets_ReJhRoVe = require("../../../../../assets/ucgMax2.jpg");
6
+ var _externalAssets_DfjB$I0W = require("../../../../../assets/ucgMax.jpg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
10
10
  };
11
11
  }
12
- var _externalAssets_ReJhRoVe__default = /*#__PURE__*/_interopDefault(_externalAssets_ReJhRoVe);
12
+ var _externalAssets_DfjB$I0W__default = /*#__PURE__*/_interopDefault(_externalAssets_DfjB$I0W);
13
13
  Object.defineProperty(exports, "default", {
14
14
  enumerable: true,
15
15
  get: function () {
16
- return _externalAssets_ReJhRoVe__default["default"];
16
+ return _externalAssets_DfjB$I0W__default["default"];
17
17
  }
18
18
  });
19
- Object.keys(_externalAssets_ReJhRoVe).forEach(function (k) {
19
+ Object.keys(_externalAssets_DfjB$I0W).forEach(function (k) {
20
20
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
21
21
  enumerable: true,
22
22
  get: function () {
23
- return _externalAssets_ReJhRoVe[k];
23
+ return _externalAssets_DfjB$I0W[k];
24
24
  }
25
25
  });
26
26
  });
@@ -1,3 +1,3 @@
1
- export * from "../../../../../assets/ucgMax2.jpg";
2
- export { default } from "../../../../../assets/ucgMax2.jpg";
1
+ export * from "../../../../../assets/ucgMax.jpg";
2
+ export { default } from "../../../../../assets/ucgMax.jpg";
3
3
  //# sourceMappingURL=ucgMax.jpg.mjs.map
@@ -3,24 +3,24 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var _externalAssets_sWF40Ihh = require("../../../../../assets/ucgUltra2.jpg");
6
+ var _externalAssets_BGAVPUHK = require("../../../../../assets/ucgUltra.jpg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
10
10
  };
11
11
  }
12
- var _externalAssets_sWF40Ihh__default = /*#__PURE__*/_interopDefault(_externalAssets_sWF40Ihh);
12
+ var _externalAssets_BGAVPUHK__default = /*#__PURE__*/_interopDefault(_externalAssets_BGAVPUHK);
13
13
  Object.defineProperty(exports, "default", {
14
14
  enumerable: true,
15
15
  get: function () {
16
- return _externalAssets_sWF40Ihh__default["default"];
16
+ return _externalAssets_BGAVPUHK__default["default"];
17
17
  }
18
18
  });
19
- Object.keys(_externalAssets_sWF40Ihh).forEach(function (k) {
19
+ Object.keys(_externalAssets_BGAVPUHK).forEach(function (k) {
20
20
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
21
21
  enumerable: true,
22
22
  get: function () {
23
- return _externalAssets_sWF40Ihh[k];
23
+ return _externalAssets_BGAVPUHK[k];
24
24
  }
25
25
  });
26
26
  });
@@ -1,3 +1,3 @@
1
- export * from "../../../../../assets/ucgUltra2.jpg";
2
- export { default } from "../../../../../assets/ucgUltra2.jpg";
1
+ export * from "../../../../../assets/ucgUltra.jpg";
2
+ export { default } from "../../../../../assets/ucgUltra.jpg";
3
3
  //# sourceMappingURL=ucgUltra.jpg.mjs.map
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var image = require("../../../../assets/ucgMax.jpg");
6
+ var image = require("../../../../assets/ucgMax2.jpg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
@@ -1,3 +1,3 @@
1
- export * from "../../../../assets/ucgMax.jpg";
2
- export { default } from "../../../../assets/ucgMax.jpg";
1
+ export * from "../../../../assets/ucgMax2.jpg";
2
+ export { default } from "../../../../assets/ucgMax2.jpg";
3
3
  //# sourceMappingURL=ucgMax.jpg.mjs.map
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var image = require("../../../../assets/ucgUltra.jpg");
6
+ var image = require("../../../../assets/ucgUltra2.jpg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
@@ -1,3 +1,3 @@
1
- export * from "../../../../assets/ucgUltra.jpg";
2
- export { default } from "../../../../assets/ucgUltra.jpg";
1
+ export * from "../../../../assets/ucgUltra2.jpg";
2
+ export { default } from "../../../../assets/ucgUltra2.jpg";
3
3
  //# sourceMappingURL=ucgUltra.jpg.mjs.map
@@ -26,8 +26,8 @@ var _externalAssets_CMbJW0VT = require("../../../assets/udmProMax2.jpg");
26
26
  var _externalAssets_CCo8CEpV = require("../../../assets/udmPro2.jpg");
27
27
  var _externalAssets_CBGnWxM$ = require("../../../assets/udmProSpecial2.jpg");
28
28
  var image = require("../../../assets/udw.jpg");
29
- var _externalAssets_ReJhRoVe = require("../../../assets/ucgMax2.jpg");
30
- var _externalAssets_sWF40Ihh = require("../../../assets/ucgUltra2.jpg");
29
+ var _externalAssets_DfjB$I0W = require("../../../assets/ucgMax.jpg");
30
+ var _externalAssets_BGAVPUHK = require("../../../assets/ucgUltra.jpg");
31
31
  var image$1 = require("../../../assets/udr.jpg");
32
32
  var image$2 = require("../../../assets/express.jpg");
33
33
  var nextAiInspection = require('./properties/nextAiInspection.js');
@@ -40,8 +40,8 @@ var _externalAssets_CMbJW0VT__default = /*#__PURE__*/_interopDefault(_externalAs
40
40
  var _externalAssets_CCo8CEpV__default = /*#__PURE__*/_interopDefault(_externalAssets_CCo8CEpV);
41
41
  var _externalAssets_CBGnWxM$__default = /*#__PURE__*/_interopDefault(_externalAssets_CBGnWxM$);
42
42
  var image__default = /*#__PURE__*/_interopDefault(image);
43
- var _externalAssets_ReJhRoVe__default = /*#__PURE__*/_interopDefault(_externalAssets_ReJhRoVe);
44
- var _externalAssets_sWF40Ihh__default = /*#__PURE__*/_interopDefault(_externalAssets_sWF40Ihh);
43
+ var _externalAssets_DfjB$I0W__default = /*#__PURE__*/_interopDefault(_externalAssets_DfjB$I0W);
44
+ var _externalAssets_BGAVPUHK__default = /*#__PURE__*/_interopDefault(_externalAssets_BGAVPUHK);
45
45
  var image__default$1 = /*#__PURE__*/_interopDefault(image$1);
46
46
  var image__default$2 = /*#__PURE__*/_interopDefault(image$2);
47
47
  "use strict";
@@ -75,12 +75,12 @@ const udw = {
75
75
  };
76
76
  const ucgMax = {
77
77
  ...ucgMax$1.ucgMax,
78
- image: getImage(_externalAssets_ReJhRoVe__default["default"]),
78
+ image: getImage(_externalAssets_DfjB$I0W__default["default"]),
79
79
  notes: ["ucgMax.note.accessory"]
80
80
  };
81
81
  const ucgUltra = {
82
82
  ...ucgUltra$1.ucgUltra,
83
- image: getImage(_externalAssets_sWF40Ihh__default["default"])
83
+ image: getImage(_externalAssets_BGAVPUHK__default["default"])
84
84
  };
85
85
  const udr = {
86
86
  ...udr$1.udr,
@@ -24,8 +24,8 @@ import _externalAssets_CMbJW0VT__default from "../../../assets/udmProMax2.jpg";
24
24
  import _externalAssets_CCo8CEpV__default from "../../../assets/udmPro2.jpg";
25
25
  import _externalAssets_CBGnWxM$__default from "../../../assets/udmProSpecial2.jpg";
26
26
  import image__default from "../../../assets/udw.jpg";
27
- import _externalAssets_ReJhRoVe__default from "../../../assets/ucgMax2.jpg";
28
- import _externalAssets_sWF40Ihh__default from "../../../assets/ucgUltra2.jpg";
27
+ import _externalAssets_DfjB$I0W__default from "../../../assets/ucgMax.jpg";
28
+ import _externalAssets_BGAVPUHK__default from "../../../assets/ucgUltra.jpg";
29
29
  import image__default$1 from "../../../assets/udr.jpg";
30
30
  import image__default$2 from "../../../assets/express.jpg";
31
31
  import { nextAiInspection } from './properties/nextAiInspection.mjs';
@@ -60,12 +60,12 @@ const udw = {
60
60
  };
61
61
  const ucgMax = {
62
62
  ...ucgMax$1,
63
- image: getImage(_externalAssets_ReJhRoVe__default),
63
+ image: getImage(_externalAssets_DfjB$I0W__default),
64
64
  notes: ["ucgMax.note.accessory"]
65
65
  };
66
66
  const ucgUltra = {
67
67
  ...ucgUltra$1,
68
- image: getImage(_externalAssets_sWF40Ihh__default)
68
+ image: getImage(_externalAssets_BGAVPUHK__default)
69
69
  };
70
70
  const udr = {
71
71
  ...udr$1,
@@ -9,7 +9,7 @@ require('../../assets/applications.svg.js');
9
9
  require('../../assets/Consoles/ucgMax.jpg.js');
10
10
  require('../properties/index.js');
11
11
  var integratedWiFi6 = require('../properties/integratedWiFi6.js');
12
- var image = require("../../../../assets/ucgMax.jpg");
12
+ var image = require("../../../../assets/ucgMax2.jpg");
13
13
  var unifiAppSuite = require('../properties/unifiAppSuite.js');
14
14
  var StyleableSvgImage = require('../../../StyleableSvgImage/StyleableSvgImage.js');
15
15
  var applications = require("../../../../assets/applications.svg");
@@ -7,7 +7,7 @@ import '../../assets/applications.svg.mjs';
7
7
  import '../../assets/Consoles/ucgMax.jpg.mjs';
8
8
  import '../properties/index.mjs';
9
9
  import { integratedWiFi6 } from '../properties/integratedWiFi6.mjs';
10
- import image__default from "../../../../assets/ucgMax.jpg";
10
+ import image__default from "../../../../assets/ucgMax2.jpg";
11
11
  import { unifiAppSuite } from '../properties/unifiAppSuite.mjs';
12
12
  import { StyleableSvgImage } from '../../../StyleableSvgImage/StyleableSvgImage.mjs';
13
13
  import applications__default from "../../../../assets/applications.svg";
@@ -21,7 +21,7 @@ var unifiDevices = require('../properties/unifiDevices.js');
21
21
  var wanPorts = require('../properties/wanPorts.js');
22
22
  var StyleableSvgImage$1 = require('../../../StyleableSvgImage/StyleableSvgImage.js');
23
23
  var unifi = require('../../../../constants/proStoreCategories/mapping/unifi.js');
24
- var image = require("../../../../assets/ucgUltra.jpg");
24
+ var image = require("../../../../assets/ucgUltra2.jpg");
25
25
  var applications = require("../../../../assets/wifi-device.svg");
26
26
  var nextAiInspection = require('../properties/nextAiInspection.js');
27
27
  function _interopDefault(e) {
@@ -19,7 +19,7 @@ import { unifiDevices } from '../properties/unifiDevices.mjs';
19
19
  import { wanPorts } from '../properties/wanPorts.mjs';
20
20
  import { StyleableSvgImage as StyleableSvgImage$1 } from '../../../StyleableSvgImage/StyleableSvgImage.mjs';
21
21
  import { UniFiCategoryId } from '../../../../constants/proStoreCategories/mapping/unifi.mjs';
22
- import image__default from "../../../../assets/ucgUltra.jpg";
22
+ import image__default from "../../../../assets/ucgUltra2.jpg";
23
23
  import applications__default from "../../../../assets/wifi-device.svg";
24
24
  import { nextAiInspection } from '../properties/nextAiInspection.mjs';
25
25
  "use strict";
@@ -10,7 +10,7 @@ var ProductWizard_styles = require('./ProductWizard.styles.js');
10
10
  var Options = require('./Options/Options.js');
11
11
  var NormalisedImage = require('../NormalisedImage/NormalisedImage.js');
12
12
  var minus = require("../../assets/minus.svg");
13
- var plus = require("../../assets/plus2.svg");
13
+ var plus = require("../../assets/plus.svg");
14
14
  var ProductWizardFootnotes = require('../ProductWizardFootnotes/ProductWizardFootnotes.js');
15
15
  function _interopDefault(e) {
16
16
  return e && e.__esModule ? e : {
@@ -8,7 +8,7 @@ import { WizardContainer, AddToCartContainer, QuantityAdjustWrap, MinusAdjustBut
8
8
  import { ProductWizardOptions } from './Options/Options.mjs';
9
9
  import { NormalisedImage } from '../NormalisedImage/NormalisedImage.mjs';
10
10
  import minus__default from "../../assets/minus.svg";
11
- import plus__default from "../../assets/plus2.svg";
11
+ import plus__default from "../../assets/plus.svg";
12
12
  import { ProductWizardFootnotes } from '../ProductWizardFootnotes/ProductWizardFootnotes.mjs';
13
13
  "use strict";
14
14
  const ProductWizard = function ProductWizard2({
@@ -6,7 +6,7 @@ require('../StyleableSvgImage/index.js');
6
6
  var QuantityInput_styles = require('./QuantityInput.styles.js');
7
7
  var StyleableSvgImage = require('../StyleableSvgImage/StyleableSvgImage.js');
8
8
  var minus = require("../../assets/minus.svg");
9
- var plus = require("../../assets/plus2.svg");
9
+ var plus = require("../../assets/plus.svg");
10
10
  function _interopDefault(e) {
11
11
  return e && e.__esModule ? e : {
12
12
  default: e
@@ -4,7 +4,7 @@ import '../StyleableSvgImage/index.mjs';
4
4
  import { Container, Label, QuantityAdjustWrap, MinusAdjustButton, QuantityInput as QuantityInput$1, PlusAdjustButton } from './QuantityInput.styles.mjs';
5
5
  import { StyleableSvgImage } from '../StyleableSvgImage/StyleableSvgImage.mjs';
6
6
  import minus__default from "../../assets/minus.svg";
7
- import plus__default from "../../assets/plus2.svg";
7
+ import plus__default from "../../assets/plus.svg";
8
8
  "use strict";
9
9
  const QuantityInput = ({
10
10
  quantity,
@@ -12,7 +12,7 @@ require('./assets/attention.svg.js');
12
12
  var InputCard_styles = require('./InputCard.styles.js');
13
13
  require('./InputSections/index.js');
14
14
  var CustomImage = require('../../../../CustomImage/CustomImage.js');
15
- var attentionIcon = require("../../../../../assets/attention2.svg");
15
+ var attentionIcon = require("../../../../../assets/attention.svg");
16
16
  var OptionSelectSection = require('./InputSections/OptionSelectSection.js');
17
17
  var SliderSection = require('./InputSections/SliderSection.js');
18
18
  var CounterSection = require('./InputSections/CounterSection.js');
@@ -10,7 +10,7 @@ import './assets/attention.svg.mjs';
10
10
  import { Card, Header, HeaderHeadingSection, HeadingIcon, HeadingTitle, HeaderActionSection, SubduedInfo, OverlayFilter, NotAvailableNoteWrap, NotAvailableNoteIcon, InputBody, InputSectionSpacing, Footer, FooterContent, FooterNote } from './InputCard.styles.mjs';
11
11
  import './InputSections/index.mjs';
12
12
  import { CustomImage } from '../../../../CustomImage/CustomImage.mjs';
13
- import attentionIcon__default from "../../../../../assets/attention2.svg";
13
+ import attentionIcon__default from "../../../../../assets/attention.svg";
14
14
  import { OptionSelectSection } from './InputSections/OptionSelectSection.mjs';
15
15
  import { SliderSection } from './InputSections/SliderSection.mjs';
16
16
  import { CounterSection } from './InputSections/CounterSection.mjs';
@@ -11,8 +11,8 @@ require('../assets/plus.svg.js');
11
11
  var Layout_styles = require('./Layout.styles.js');
12
12
  var CustomImage = require('../../../../../CustomImage/CustomImage.js');
13
13
  var StyleableSvgImage = require('../../../../../StyleableSvgImage/StyleableSvgImage.js');
14
- var MinusIcon = require("../../../../../../assets/minus5.svg");
15
- var PlusIcon = require("../../../../../../assets/plus6.svg");
14
+ var MinusIcon = require("../../../../../../assets/minus4.svg");
15
+ var PlusIcon = require("../../../../../../assets/plus5.svg");
16
16
  function _interopDefault(e) {
17
17
  return e && e.__esModule ? e : {
18
18
  default: e
@@ -9,8 +9,8 @@ import '../assets/plus.svg.mjs';
9
9
  import { InputWrapper, Label, InputFlexWrapper } from './Layout.styles.mjs';
10
10
  import { CustomImage } from '../../../../../CustomImage/CustomImage.mjs';
11
11
  import { StyleableSvgImage } from '../../../../../StyleableSvgImage/StyleableSvgImage.mjs';
12
- import MinusIcon__default from "../../../../../../assets/minus5.svg";
13
- import PlusIcon__default from "../../../../../../assets/plus6.svg";
12
+ import MinusIcon__default from "../../../../../../assets/minus4.svg";
13
+ import PlusIcon__default from "../../../../../../assets/plus5.svg";
14
14
  "use strict";
15
15
  const CounterSection = ({
16
16
  value,
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var attentionIcon = require("../../../../../../assets/attention2.svg");
6
+ var attentionIcon = require("../../../../../../assets/attention.svg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
@@ -1,3 +1,3 @@
1
- export * from "../../../../../../assets/attention2.svg";
2
- export { default } from "../../../../../../assets/attention2.svg";
1
+ export * from "../../../../../../assets/attention.svg";
2
+ export { default } from "../../../../../../assets/attention.svg";
3
3
  //# sourceMappingURL=attention.svg.mjs.map
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var MinusIcon = require("../../../../../../assets/minus5.svg");
6
+ var MinusIcon = require("../../../../../../assets/minus4.svg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
@@ -1,3 +1,3 @@
1
- export * from "../../../../../../assets/minus5.svg";
2
- export { default } from "../../../../../../assets/minus5.svg";
1
+ export * from "../../../../../../assets/minus4.svg";
2
+ export { default } from "../../../../../../assets/minus4.svg";
3
3
  //# sourceMappingURL=minus.svg.mjs.map
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var PlusIcon = require("../../../../../../assets/plus6.svg");
6
+ var PlusIcon = require("../../../../../../assets/plus5.svg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
@@ -1,3 +1,3 @@
1
- export * from "../../../../../../assets/plus6.svg";
2
- export { default } from "../../../../../../assets/plus6.svg";
1
+ export * from "../../../../../../assets/plus5.svg";
2
+ export { default } from "../../../../../../assets/plus5.svg";
3
3
  //# sourceMappingURL=plus.svg.mjs.map
@@ -6,7 +6,7 @@ var asset = require('../../../../../utils/asset.js');
6
6
  require('./assets/attention.svg.js');
7
7
  var Part = require('./Part.js');
8
8
  var ProgressBarChart_styles = require('./ProgressBarChart.styles.js');
9
- var attentionIcon = require("../../../../../assets/attention.svg");
9
+ var attentionIcon = require("../../../../../assets/attention2.svg");
10
10
  function _interopDefault(e) {
11
11
  return e && e.__esModule ? e : {
12
12
  default: e
@@ -4,7 +4,7 @@ import { imageSrc } from '../../../../../utils/asset.mjs';
4
4
  import './assets/attention.svg.mjs';
5
5
  import { PART_GAP_PX, PART_WIDTH_PX, Part } from './Part.mjs';
6
6
  import { ProgressBarChartContainer, ProgressBarChartHeader, ProgressBarChartTitle, ProgressBarWrapper, ProgressBarPartsContainer, ProgressBarAttentionLabel, ProgressBarAttentionLabelIcon } from './ProgressBarChart.styles.mjs';
7
- import attentionIcon__default from "../../../../../assets/attention.svg";
7
+ import attentionIcon__default from "../../../../../assets/attention2.svg";
8
8
  "use strict";
9
9
  const ProgressBarChart = ({
10
10
  title,
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var attentionIcon = require("../../../../../../assets/attention.svg");
6
+ var attentionIcon = require("../../../../../../assets/attention2.svg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
@@ -1,3 +1,3 @@
1
- export * from "../../../../../../assets/attention.svg";
2
- export { default } from "../../../../../../assets/attention.svg";
1
+ export * from "../../../../../../assets/attention2.svg";
2
+ export { default } from "../../../../../../assets/attention2.svg";
3
3
  //# sourceMappingURL=attention.svg.mjs.map
@@ -19,8 +19,8 @@ var ComputeResourceCalculator_types = require('../../../../ComputeResourceCalcul
19
19
  var CustomImage = require('../../../../../CustomImage/CustomImage.js');
20
20
  var SearchIcon = require("../../../../../../assets/search2.svg");
21
21
  var StyleableSvgImage = require('../../../../../StyleableSvgImage/StyleableSvgImage.js');
22
- var MinusIcon = require("../../../../../../assets/minus4.svg");
23
- var PlusIcon = require("../../../../../../assets/plus5.svg");
22
+ var MinusIcon = require("../../../../../../assets/minus5.svg");
23
+ var PlusIcon = require("../../../../../../assets/plus6.svg");
24
24
  function _interopDefault(e) {
25
25
  return e && e.__esModule ? e : {
26
26
  default: e
@@ -17,8 +17,8 @@ import { isMessageFormatted } from '../../../../ComputeResourceCalculator/Comput
17
17
  import { CustomImage } from '../../../../../CustomImage/CustomImage.mjs';
18
18
  import SearchIcon__default from "../../../../../../assets/search2.svg";
19
19
  import { StyleableSvgImage } from '../../../../../StyleableSvgImage/StyleableSvgImage.mjs';
20
- import MinusIcon__default from "../../../../../../assets/minus4.svg";
21
- import PlusIcon__default from "../../../../../../assets/plus5.svg";
20
+ import MinusIcon__default from "../../../../../../assets/minus5.svg";
21
+ import PlusIcon__default from "../../../../../../assets/plus6.svg";
22
22
  "use strict";
23
23
  const PoeConsumerSelectModal = ({
24
24
  isOpen,
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var MinusIcon = require("../../../../../../assets/minus4.svg");
6
+ var MinusIcon = require("../../../../../../assets/minus5.svg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
@@ -1,3 +1,3 @@
1
- export * from "../../../../../../assets/minus4.svg";
2
- export { default } from "../../../../../../assets/minus4.svg";
1
+ export * from "../../../../../../assets/minus5.svg";
2
+ export { default } from "../../../../../../assets/minus5.svg";
3
3
  //# sourceMappingURL=minus.svg.mjs.map
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var PlusIcon = require("../../../../../../assets/plus5.svg");
6
+ var PlusIcon = require("../../../../../../assets/plus6.svg");
7
7
  function _interopDefault(e) {
8
8
  return e && e.__esModule ? e : {
9
9
  default: e
@@ -1,3 +1,3 @@
1
- export * from "../../../../../../assets/plus5.svg";
2
- export { default } from "../../../../../../assets/plus5.svg";
1
+ export * from "../../../../../../assets/plus6.svg";
2
+ export { default } from "../../../../../../assets/plus6.svg";
3
3
  //# sourceMappingURL=plus.svg.mjs.map
@@ -172,7 +172,7 @@ export declare const isValidTaxNumberPattern: (type: AddressType, taxCountryCode
172
172
  * Depending on store Tax is called different names, so this mapping determines which one to use
173
173
  * @see https://ui.slack.com/archives/D0191CBEB27/p1678723218358039?thread_ts=1678722532.763459&cid=D0191CBEB27
174
174
  */
175
- export declare const getTaxLabelType: (storeId: StoreId) => TaxLabelType.Tax | TaxLabelType.Vat | TaxLabelType.Gst;
175
+ export declare const getTaxLabelType: (storeId: StoreId) => TaxLabelType.Tax | TaxLabelType.Vat | TaxLabelType.Gst | TaxLabelType.Rfc;
176
176
  export declare const getTaxLabelTypeByCountry: (country: CountryCode, options: {
177
177
  type: "general";
178
178
  } | {
@@ -62,7 +62,6 @@ const getTaxLabelType = storeId => {
62
62
  case generated.StoreId.Uk:
63
63
  case generated.StoreId.Br:
64
64
  case generated.StoreId.Tw:
65
- case generated.StoreId.Mx:
66
65
  case generated.StoreId.Jp:
67
66
  {
68
67
  return types.TaxLabelType.Vat;
@@ -77,6 +76,10 @@ const getTaxLabelType = storeId => {
77
76
  {
78
77
  return types.TaxLabelType.Gst;
79
78
  }
79
+ case generated.StoreId.Mx:
80
+ {
81
+ return types.TaxLabelType.Rfc;
82
+ }
80
83
  default:
81
84
  {
82
85
  errors.checkUnreachable(storeId);
@@ -104,6 +107,10 @@ const getTaxLabelTypeByCountry = (country, options) => {
104
107
  {
105
108
  return types.TaxLabelType.Gst;
106
109
  }
110
+ case generated.CountryCode.Mx:
111
+ {
112
+ return types.TaxLabelType.Rfc;
113
+ }
107
114
  case generated.CountryCode.Br:
108
115
  {
109
116
  switch (options.type) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/utils/tax/index.ts"],"sourcesContent":["import isRegExp from \"lodash/isRegExp\";\n\nimport {\n BUSINESS_COUNTRY_CODE_MAPPING,\n RESIDENTIAL_COUNTRY_CODE_MAPPING,\n USER_ASSIGNED_COUNTRY_MAPPING_RULES,\n} from \"../../constants/address\";\nimport type { Nullish, UserAssignedCountryCode } from \"../../types\";\nimport { AddressType, CountryCode, StoreId } from \"../../types\";\nimport { assertUnreachable, checkUnreachable } from \"../errors\";\nimport { formatCnpj, formatCpf } from \"./brazil\";\nimport type { TaxCountryCode } from \"./types\";\nimport { TaxLabelType } from \"./types\";\n\n/**\n * Util to get the country code mapping based on address type in a type-safe way\n */\nexport const getValidationMappingByType = (type: AddressType) => {\n switch (type) {\n case AddressType.Business: {\n return BUSINESS_COUNTRY_CODE_MAPPING;\n }\n case AddressType.Residential: {\n return RESIDENTIAL_COUNTRY_CODE_MAPPING;\n }\n default: {\n assertUnreachable(type);\n }\n }\n};\n\n/**\n * Checks if given tax country has regex pattern for tax id's\n */\nexport const hasTaxNumberPatternValidation = (\n type: AddressType,\n taxCountryCode: TaxCountryCode,\n): taxCountryCode is keyof ReturnType<typeof getValidationMappingByType> =>\n taxCountryCode in getValidationMappingByType(type);\n\n/**\n * Checks if given tax id meets static pattern validation\n */\nexport const isValidTaxNumberPattern = (\n type: AddressType,\n taxCountryCode: TaxCountryCode,\n taxId: Nullish<string>,\n): boolean => {\n // If country doesn't have a tax number pattern then mark input as valid\n if (!hasTaxNumberPatternValidation(type, taxCountryCode)) {\n return true;\n }\n\n const mapping = getValidationMappingByType(type);\n const { validation, isOptional } = mapping[taxCountryCode];\n\n // Mark input as valid if the tax ID is missing but it's optional\n if (!taxId && isOptional) {\n return true;\n }\n\n // Check for empty tax id's in cases when they are required\n if (!taxId) {\n return false;\n }\n\n // Technically, this should already be covered by the \"hasTaxNumberPatternValidation\"\n // check above but just in case something goes really wrong, we are adding this\n // to avoid unexpected type errors during runtime\n if (!validation) {\n return true;\n }\n\n // Validate pattern\n return isRegExp(validation)\n ? validation.test(taxId)\n : validation({ taxId, taxCountryCode });\n};\n\n/**\n * Depending on store Tax is called different names, so this mapping determines which one to use\n * @see https://ui.slack.com/archives/D0191CBEB27/p1678723218358039?thread_ts=1678722532.763459&cid=D0191CBEB27\n */\nexport const getTaxLabelType = (storeId: StoreId) => {\n switch (storeId) {\n case StoreId.Me:\n case StoreId.Za:\n case StoreId.Eu:\n case StoreId.Uk:\n case StoreId.Br:\n case StoreId.Tw:\n case StoreId.Mx:\n case StoreId.Jp: {\n return TaxLabelType.Vat;\n }\n case StoreId.Ca:\n case StoreId.Us: {\n return TaxLabelType.Tax;\n }\n case StoreId.In:\n case StoreId.Sg: {\n return TaxLabelType.Gst;\n }\n default: {\n checkUnreachable(storeId);\n return TaxLabelType.Tax;\n }\n }\n};\n\nexport const getTaxLabelTypeByCountry = (\n country: CountryCode,\n options:\n | {\n type: \"general\";\n }\n | {\n type: \"specific\";\n addressType: AddressType;\n },\n) => {\n switch (country) {\n case CountryCode.Ca:\n case CountryCode.Us:\n case CountryCode.Pr:\n case CountryCode.Pw:\n case CountryCode.Gu:\n case CountryCode.As:\n case CountryCode.Vi:\n case CountryCode.Mp:\n case CountryCode.Mh:\n case CountryCode.Fm: {\n return TaxLabelType.Tax;\n }\n case CountryCode.In:\n case CountryCode.Sg: {\n return TaxLabelType.Gst;\n }\n case CountryCode.Br: {\n // eslint-disable-next-line sonarjs/no-nested-switch\n switch (options.type) {\n case \"general\":\n return TaxLabelType.Vat;\n case \"specific\": {\n const taxLabelTypesByAddressType = {\n [AddressType.Residential]: TaxLabelType.Cpf,\n [AddressType.Business]: TaxLabelType.Cnpj,\n } satisfies Record<AddressType, TaxLabelType>;\n\n return taxLabelTypesByAddressType[options.addressType];\n }\n default:\n checkUnreachable(options);\n return TaxLabelType.Vat;\n }\n }\n default: {\n return TaxLabelType.Vat;\n }\n }\n};\n\n// #############################################################################\n// Assigned country code\n// #############################################################################\n/**\n * We can't 100% trust the order of countries as compiles can possible rearrange the values, so we have to sort the\n * values with country+province first when looking for the match we can stop at first occurrence\n * @see https://stackoverflow.com/a/5525820\n */\nconst userAssignedCountryRulesSorted = Object.entries(\n USER_ASSIGNED_COUNTRY_MAPPING_RULES,\n)\n .flatMap(([userAssignedCountry, rules]) =>\n rules.map((rule) => {\n return [userAssignedCountry as UserAssignedCountryCode, rule] as const;\n }),\n )\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n .sort(([_, a], [__, b]) => {\n return b.length - a.length;\n });\n\n/**\n * Util to get TAX country code for a given country + province combination\n */\nexport const getTaxCountry = ({\n country,\n province,\n}: {\n country: CountryCode;\n province: Nullish<string>;\n}): TaxCountryCode => {\n const match = userAssignedCountryRulesSorted.find(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n ([_, [refCountry, refProvince]]) => {\n // Don't match - if countries don't match\n if (refCountry !== country) {\n return false;\n }\n\n // Match - if pattern doesn't include a province\n // TODO: this is debatable whether it should match as input province can be non-nullish\n if (refProvince == null) {\n return true;\n }\n\n return refProvince === province;\n },\n );\n\n const userAssignedCountry = match?.[0];\n\n // If there isn't a user assigned country that matches the result (most likely indicating that it doesnt require\n // unique lookup) then fallback to input country\n return userAssignedCountry ?? country;\n};\n\nexport const isTaxNumberOptional = (\n type: AddressType,\n taxCountryCode: TaxCountryCode,\n) => {\n if (!hasTaxNumberPatternValidation(type, taxCountryCode)) {\n return true;\n }\n\n const mapping = getValidationMappingByType(type);\n const { isOptional } = mapping[taxCountryCode];\n\n return isOptional;\n};\n\nexport const formatTaxNumber = (\n taxNumber: string,\n { country, addressType }: { country: CountryCode; addressType: AddressType },\n) => {\n // Tax number formatting only needed for Brazil in the foreseeable future.\n if (country !== CountryCode.Br) {\n return taxNumber;\n }\n\n switch (addressType) {\n case AddressType.Residential:\n return formatCpf(taxNumber);\n\n case AddressType.Business:\n return formatCnpj(taxNumber);\n\n default:\n checkUnreachable(addressType);\n return taxNumber;\n }\n};\n"],"names":["getValidationMappingByType","type","AddressType","Business","BUSINESS_COUNTRY_CODE_MAPPING","Residential","RESIDENTIAL_COUNTRY_CODE_MAPPING","assertUnreachable","hasTaxNumberPatternValidation","taxCountryCode","isValidTaxNumberPattern","taxId","mapping","validation","isOptional","isRegExp","test","getTaxLabelType","storeId","StoreId","Me","Za","Eu","Uk","Br","Tw","Mx","Jp","TaxLabelType","Vat","Ca","Us","Tax","In","Sg","Gst","checkUnreachable","getTaxLabelTypeByCountry","country","options","CountryCode","Pr","Pw","Gu","As","Vi","Mp","Mh","Fm","taxLabelTypesByAddressType","Cpf","Cnpj","addressType","userAssignedCountryRulesSorted","Object","entries","USER_ASSIGNED_COUNTRY_MAPPING_RULES","flatMap","userAssignedCountry","rules","map","rule","sort","_","a","__","b","length","getTaxCountry","province","match","find","refCountry","refProvince","isTaxNumberOptional","formatTaxNumber","taxNumber","formatCpf","formatCnpj"],"mappings":";;;;;;;;;;;;;;;;AAiBa,MAAAA,0BAAA,GAA8BC,IAAsB,IAAA;EAC/D,QAAQA,IAAM;IACZ,KAAKC,SAAAA,CAAAA,YAAYC,QAAU;MAAA;QAClB,OAAAC,qCAAA;MACT;IACA,KAAKF,SAAAA,CAAAA,YAAYG,WAAa;MAAA;QACrB,OAAAC,wCAAA;MACT;IACA;MAAS;QACPC,MAAA,CAAAA,iBAAA,CAAkBN,IAAI,CAAA;MACxB;EACF;AACF,CAAA;AAKO,MAAMO,gCAAgCA,CAC3CP,IAAA,EACAQ,cAEA,KAAAA,cAAA,IAAkBT,2BAA2BC,IAAI,CAAA;AAK5C,MAAMS,uBAA0B,GAAAA,CACrCT,IACA,EAAAQ,cAAA,EACAE,KACY,KAAA;EAEZ,IAAI,CAACH,6BAAA,CAA8BP,IAAM,EAAAQ,cAAc,CAAG,EAAA;IACjD,OAAA,IAAA;EACT;EAEM,MAAAG,OAAA,GAAUZ,2BAA2BC,IAAI,CAAA;EAC/C,MAAM;IAAEY,UAAA;IAAYC;EAAW,CAAA,GAAIF,QAAQH,cAAc,CAAA;EAGrD,IAAA,CAACE,SAASG,UAAY,EAAA;IACjB,OAAA,IAAA;EACT;EAGA,IAA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D,kBAAkBA,CAC7BC,SAAA,EACA;EAAEtC,OAAA;EAASc;CACR,KAAA;EAEC,IAAAd,OAAA,KAAYE,sBAAYhB,EAAI,EAAA;IACvB,OAAAoD,SAAA;EACT;EAEA,QAAQxB,WAAa;IACnB,KAAKlD,SAAY,CAAAA,WAAA,CAAAG,WAAA;MACf,OAAOwE,MAAAA,CAAAA,UAAUD,SAAS,CAAA;IAE5B,KAAK1E,SAAY,CAAAA,WAAA,CAAAC,QAAA;MACf,OAAO2E,MAAAA,CAAAA,WAAWF,SAAS,CAAA;IAE7B;MACExC,MAAA,CAAAA,gBAAA,CAAiBgB,WAAW,CAAA;MACrB,OAAAwB,SAAA;EACX;AACF,CAAA;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/utils/tax/index.ts"],"sourcesContent":["import isRegExp from \"lodash/isRegExp\";\n\nimport {\n BUSINESS_COUNTRY_CODE_MAPPING,\n RESIDENTIAL_COUNTRY_CODE_MAPPING,\n USER_ASSIGNED_COUNTRY_MAPPING_RULES,\n} from \"../../constants/address\";\nimport type { Nullish, UserAssignedCountryCode } from \"../../types\";\nimport { AddressType, CountryCode, StoreId } from \"../../types\";\nimport { assertUnreachable, checkUnreachable } from \"../errors\";\nimport { formatCnpj, formatCpf } from \"./brazil\";\nimport type { TaxCountryCode } from \"./types\";\nimport { TaxLabelType } from \"./types\";\n\n/**\n * Util to get the country code mapping based on address type in a type-safe way\n */\nexport const getValidationMappingByType = (type: AddressType) => {\n switch (type) {\n case AddressType.Business: {\n return BUSINESS_COUNTRY_CODE_MAPPING;\n }\n case AddressType.Residential: {\n return RESIDENTIAL_COUNTRY_CODE_MAPPING;\n }\n default: {\n assertUnreachable(type);\n }\n }\n};\n\n/**\n * Checks if given tax country has regex pattern for tax id's\n */\nexport const hasTaxNumberPatternValidation = (\n type: AddressType,\n taxCountryCode: TaxCountryCode,\n): taxCountryCode is keyof ReturnType<typeof getValidationMappingByType> =>\n taxCountryCode in getValidationMappingByType(type);\n\n/**\n * Checks if given tax id meets static pattern validation\n */\nexport const isValidTaxNumberPattern = (\n type: AddressType,\n taxCountryCode: TaxCountryCode,\n taxId: Nullish<string>,\n): boolean => {\n // If country doesn't have a tax number pattern then mark input as valid\n if (!hasTaxNumberPatternValidation(type, taxCountryCode)) {\n return true;\n }\n\n const mapping = getValidationMappingByType(type);\n const { validation, isOptional } = mapping[taxCountryCode];\n\n // Mark input as valid if the tax ID is missing but it's optional\n if (!taxId && isOptional) {\n return true;\n }\n\n // Check for empty tax id's in cases when they are required\n if (!taxId) {\n return false;\n }\n\n // Technically, this should already be covered by the \"hasTaxNumberPatternValidation\"\n // check above but just in case something goes really wrong, we are adding this\n // to avoid unexpected type errors during runtime\n if (!validation) {\n return true;\n }\n\n // Validate pattern\n return isRegExp(validation)\n ? validation.test(taxId)\n : validation({ taxId, taxCountryCode });\n};\n\n/**\n * Depending on store Tax is called different names, so this mapping determines which one to use\n * @see https://ui.slack.com/archives/D0191CBEB27/p1678723218358039?thread_ts=1678722532.763459&cid=D0191CBEB27\n */\nexport const getTaxLabelType = (storeId: StoreId) => {\n switch (storeId) {\n case StoreId.Me:\n case StoreId.Za:\n case StoreId.Eu:\n case StoreId.Uk:\n case StoreId.Br:\n case StoreId.Tw:\n case StoreId.Jp: {\n return TaxLabelType.Vat;\n }\n case StoreId.Ca:\n case StoreId.Us: {\n return TaxLabelType.Tax;\n }\n case StoreId.In:\n case StoreId.Sg: {\n return TaxLabelType.Gst;\n }\n case StoreId.Mx: {\n return TaxLabelType.Rfc;\n }\n default: {\n checkUnreachable(storeId);\n return TaxLabelType.Tax;\n }\n }\n};\n\nexport const getTaxLabelTypeByCountry = (\n country: CountryCode,\n options:\n | {\n type: \"general\";\n }\n | {\n type: \"specific\";\n addressType: AddressType;\n },\n) => {\n switch (country) {\n case CountryCode.Ca:\n case CountryCode.Us:\n case CountryCode.Pr:\n case CountryCode.Pw:\n case CountryCode.Gu:\n case CountryCode.As:\n case CountryCode.Vi:\n case CountryCode.Mp:\n case CountryCode.Mh:\n case CountryCode.Fm: {\n return TaxLabelType.Tax;\n }\n case CountryCode.In:\n case CountryCode.Sg: {\n return TaxLabelType.Gst;\n }\n case CountryCode.Mx: {\n return TaxLabelType.Rfc;\n }\n case CountryCode.Br: {\n // eslint-disable-next-line sonarjs/no-nested-switch\n switch (options.type) {\n case \"general\":\n return TaxLabelType.Vat;\n case \"specific\": {\n const taxLabelTypesByAddressType = {\n [AddressType.Residential]: TaxLabelType.Cpf,\n [AddressType.Business]: TaxLabelType.Cnpj,\n } satisfies Record<AddressType, TaxLabelType>;\n\n return taxLabelTypesByAddressType[options.addressType];\n }\n default:\n checkUnreachable(options);\n return TaxLabelType.Vat;\n }\n }\n default: {\n return TaxLabelType.Vat;\n }\n }\n};\n\n// #############################################################################\n// Assigned country code\n// #############################################################################\n/**\n * We can't 100% trust the order of countries as compiles can possible rearrange the values, so we have to sort the\n * values with country+province first when looking for the match we can stop at first occurrence\n * @see https://stackoverflow.com/a/5525820\n */\nconst userAssignedCountryRulesSorted = Object.entries(\n USER_ASSIGNED_COUNTRY_MAPPING_RULES,\n)\n .flatMap(([userAssignedCountry, rules]) =>\n rules.map((rule) => {\n return [userAssignedCountry as UserAssignedCountryCode, rule] as const;\n }),\n )\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n .sort(([_, a], [__, b]) => {\n return b.length - a.length;\n });\n\n/**\n * Util to get TAX country code for a given country + province combination\n */\nexport const getTaxCountry = ({\n country,\n province,\n}: {\n country: CountryCode;\n province: Nullish<string>;\n}): TaxCountryCode => {\n const match = userAssignedCountryRulesSorted.find(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n ([_, [refCountry, refProvince]]) => {\n // Don't match - if countries don't match\n if (refCountry !== country) {\n return false;\n }\n\n // Match - if pattern doesn't include a province\n // TODO: this is debatable whether it should match as input province can be non-nullish\n if (refProvince == null) {\n return true;\n }\n\n return refProvince === province;\n },\n );\n\n const userAssignedCountry = match?.[0];\n\n // If there isn't a user assigned country that matches the result (most likely indicating that it doesnt require\n // unique lookup) then fallback to input country\n return userAssignedCountry ?? country;\n};\n\nexport const isTaxNumberOptional = (\n type: AddressType,\n taxCountryCode: TaxCountryCode,\n) => {\n if (!hasTaxNumberPatternValidation(type, taxCountryCode)) {\n return true;\n }\n\n const mapping = getValidationMappingByType(type);\n const { isOptional } = mapping[taxCountryCode];\n\n return isOptional;\n};\n\nexport const formatTaxNumber = (\n taxNumber: string,\n { country, addressType }: { country: CountryCode; addressType: AddressType },\n) => {\n // Tax number formatting only needed for Brazil in the foreseeable future.\n if (country !== CountryCode.Br) {\n return taxNumber;\n }\n\n switch (addressType) {\n case AddressType.Residential:\n return formatCpf(taxNumber);\n\n case AddressType.Business:\n return formatCnpj(taxNumber);\n\n default:\n checkUnreachable(addressType);\n return taxNumber;\n }\n};\n"],"names":["getValidationMappingByType","type","AddressType","Business","BUSINESS_COUNTRY_CODE_MAPPING","Residential","RESIDENTIAL_COUNTRY_CODE_MAPPING","assertUnreachable","hasTaxNumberPatternValidation","taxCountryCode","isValidTaxNumberPattern","taxId","mapping","validation","isOptional","isRegExp","test","getTaxLabelType","storeId","StoreId","Me","Za","Eu","Uk","Br","Tw","Jp","TaxLabelType","Vat","Ca","Us","Tax","In","Sg","Gst","Mx","Rfc","checkUnreachable","getTaxLabelTypeByCountry","country","options","CountryCode","Pr","Pw","Gu","As","Vi","Mp","Mh","Fm","taxLabelTypesByAddressType","Cpf","Cnpj","addressType","userAssignedCountryRulesSorted","Object","entries","USER_ASSIGNED_COUNTRY_MAPPING_RULES","flatMap","userAssignedCountry","rules","map","rule","sort","_","a","__","b","length","getTaxCountry","province","match","find","refCountry","refProvince","isTaxNumberOptional","formatTaxNumber","taxNumber","formatCpf","formatCnpj"],"mappings":";;;;;;;;;;;;;;;;AAiBa,MAAAA,0BAAA,GAA8BC,IAAsB,IAAA;EAC/D,QAAQA,IAAM;IACZ,KAAKC,SAAAA,CAAAA,YAAYC,QAAU;MAAA;QAClB,OAAAC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getTaxLabelType = storeId => {
54
54
  case StoreId.Uk:
55
55
  case StoreId.Br:
56
56
  case StoreId.Tw:
57
- case StoreId.Mx:
58
57
  case StoreId.Jp:
59
58
  {
60
59
  return TaxLabelType.Vat;
@@ -69,6 +68,10 @@ const getTaxLabelType = storeId => {
69
68
  {
70
69
  return TaxLabelType.Gst;
71
70
  }
71
+ case StoreId.Mx:
72
+ {
73
+ return TaxLabelType.Rfc;
74
+ }
72
75
  default:
73
76
  {
74
77
  checkUnreachable(storeId);
@@ -96,6 +99,10 @@ const getTaxLabelTypeByCountry = (country, options) => {
96
99
  {
97
100
  return TaxLabelType.Gst;
98
101
  }
102
+ case CountryCode.Mx:
103
+ {
104
+ return TaxLabelType.Rfc;
105
+ }
99
106
  case CountryCode.Br:
100
107
  {
101
108
  switch (options.type) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../src/utils/tax/index.ts"],"sourcesContent":["import isRegExp from \"lodash/isRegExp\";\n\nimport {\n BUSINESS_COUNTRY_CODE_MAPPING,\n RESIDENTIAL_COUNTRY_CODE_MAPPING,\n USER_ASSIGNED_COUNTRY_MAPPING_RULES,\n} from \"../../constants/address\";\nimport type { Nullish, UserAssignedCountryCode } from \"../../types\";\nimport { AddressType, CountryCode, StoreId } from \"../../types\";\nimport { assertUnreachable, checkUnreachable } from \"../errors\";\nimport { formatCnpj, formatCpf } from \"./brazil\";\nimport type { TaxCountryCode } from \"./types\";\nimport { TaxLabelType } from \"./types\";\n\n/**\n * Util to get the country code mapping based on address type in a type-safe way\n */\nexport const getValidationMappingByType = (type: AddressType) => {\n switch (type) {\n case AddressType.Business: {\n return BUSINESS_COUNTRY_CODE_MAPPING;\n }\n case AddressType.Residential: {\n return RESIDENTIAL_COUNTRY_CODE_MAPPING;\n }\n default: {\n assertUnreachable(type);\n }\n }\n};\n\n/**\n * Checks if given tax country has regex pattern for tax id's\n */\nexport const hasTaxNumberPatternValidation = (\n type: AddressType,\n taxCountryCode: TaxCountryCode,\n): taxCountryCode is keyof ReturnType<typeof getValidationMappingByType> =>\n taxCountryCode in getValidationMappingByType(type);\n\n/**\n * Checks if given tax id meets static pattern validation\n */\nexport const isValidTaxNumberPattern = (\n type: AddressType,\n taxCountryCode: TaxCountryCode,\n taxId: Nullish<string>,\n): boolean => {\n // If country doesn't have a tax number pattern then mark input as valid\n if (!hasTaxNumberPatternValidation(type, taxCountryCode)) {\n return true;\n }\n\n const mapping = getValidationMappingByType(type);\n const { validation, isOptional } = mapping[taxCountryCode];\n\n // Mark input as valid if the tax ID is missing but it's optional\n if (!taxId && isOptional) {\n return true;\n }\n\n // Check for empty tax id's in cases when they are required\n if (!taxId) {\n return false;\n }\n\n // Technically, this should already be covered by the \"hasTaxNumberPatternValidation\"\n // check above but just in case something goes really wrong, we are adding this\n // to avoid unexpected type errors during runtime\n if (!validation) {\n return true;\n }\n\n // Validate pattern\n return isRegExp(validation)\n ? validation.test(taxId)\n : validation({ taxId, taxCountryCode });\n};\n\n/**\n * Depending on store Tax is called different names, so this mapping determines which one to use\n * @see https://ui.slack.com/archives/D0191CBEB27/p1678723218358039?thread_ts=1678722532.763459&cid=D0191CBEB27\n */\nexport const getTaxLabelType = (storeId: StoreId) => {\n switch (storeId) {\n case StoreId.Me:\n case StoreId.Za:\n case StoreId.Eu:\n case StoreId.Uk:\n case StoreId.Br:\n case StoreId.Tw:\n case StoreId.Mx:\n case StoreId.Jp: {\n return TaxLabelType.Vat;\n }\n case StoreId.Ca:\n case StoreId.Us: {\n return TaxLabelType.Tax;\n }\n case StoreId.In:\n case StoreId.Sg: {\n return TaxLabelType.Gst;\n }\n default: {\n checkUnreachable(storeId);\n return TaxLabelType.Tax;\n }\n }\n};\n\nexport const getTaxLabelTypeByCountry = (\n country: CountryCode,\n options:\n | {\n type: \"general\";\n }\n | {\n type: \"specific\";\n addressType: AddressType;\n },\n) => {\n switch (country) {\n case CountryCode.Ca:\n case CountryCode.Us:\n case CountryCode.Pr:\n case CountryCode.Pw:\n case CountryCode.Gu:\n case CountryCode.As:\n case CountryCode.Vi:\n case CountryCode.Mp:\n case CountryCode.Mh:\n case CountryCode.Fm: {\n return TaxLabelType.Tax;\n }\n case CountryCode.In:\n case CountryCode.Sg: {\n return TaxLabelType.Gst;\n }\n case CountryCode.Br: {\n // eslint-disable-next-line sonarjs/no-nested-switch\n switch (options.type) {\n case \"general\":\n return TaxLabelType.Vat;\n case \"specific\": {\n const taxLabelTypesByAddressType = {\n [AddressType.Residential]: TaxLabelType.Cpf,\n [AddressType.Business]: TaxLabelType.Cnpj,\n } satisfies Record<AddressType, TaxLabelType>;\n\n return taxLabelTypesByAddressType[options.addressType];\n }\n default:\n checkUnreachable(options);\n return TaxLabelType.Vat;\n }\n }\n default: {\n return TaxLabelType.Vat;\n }\n }\n};\n\n// #############################################################################\n// Assigned country code\n// #############################################################################\n/**\n * We can't 100% trust the order of countries as compiles can possible rearrange the values, so we have to sort the\n * values with country+province first when looking for the match we can stop at first occurrence\n * @see https://stackoverflow.com/a/5525820\n */\nconst userAssignedCountryRulesSorted = Object.entries(\n USER_ASSIGNED_COUNTRY_MAPPING_RULES,\n)\n .flatMap(([userAssignedCountry, rules]) =>\n rules.map((rule) => {\n return [userAssignedCountry as UserAssignedCountryCode, rule] as const;\n }),\n )\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n .sort(([_, a], [__, b]) => {\n return b.length - a.length;\n });\n\n/**\n * Util to get TAX country code for a given country + province combination\n */\nexport const getTaxCountry = ({\n country,\n province,\n}: {\n country: CountryCode;\n province: Nullish<string>;\n}): TaxCountryCode => {\n const match = userAssignedCountryRulesSorted.find(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n ([_, [refCountry, refProvince]]) => {\n // Don't match - if countries don't match\n if (refCountry !== country) {\n return false;\n }\n\n // Match - if pattern doesn't include a province\n // TODO: this is debatable whether it should match as input province can be non-nullish\n if (refProvince == null) {\n return true;\n }\n\n return refProvince === province;\n },\n );\n\n const userAssignedCountry = match?.[0];\n\n // If there isn't a user assigned country that matches the result (most likely indicating that it doesnt require\n // unique lookup) then fallback to input country\n return userAssignedCountry ?? country;\n};\n\nexport const isTaxNumberOptional = (\n type: AddressType,\n taxCountryCode: TaxCountryCode,\n) => {\n if (!hasTaxNumberPatternValidation(type, taxCountryCode)) {\n return true;\n }\n\n const mapping = getValidationMappingByType(type);\n const { isOptional } = mapping[taxCountryCode];\n\n return isOptional;\n};\n\nexport const formatTaxNumber = (\n taxNumber: string,\n { country, addressType }: { country: CountryCode; addressType: AddressType },\n) => {\n // Tax number formatting only needed for Brazil in the foreseeable future.\n if (country !== CountryCode.Br) {\n return taxNumber;\n }\n\n switch (addressType) {\n case AddressType.Residential:\n return formatCpf(taxNumber);\n\n case AddressType.Business:\n return formatCnpj(taxNumber);\n\n default:\n checkUnreachable(addressType);\n return taxNumber;\n }\n};\n"],"names":["getValidationMappingByType","type","AddressType","Business","BUSINESS_COUNTRY_CODE_MAPPING","Residential","RESIDENTIAL_COUNTRY_CODE_MAPPING","assertUnreachable","hasTaxNumberPatternValidation","taxCountryCode","isValidTaxNumberPattern","taxId","mapping","validation","isOptional","isRegExp","test","getTaxLabelType","storeId","StoreId","Me","Za","Eu","Uk","Br","Tw","Mx","Jp","TaxLabelType","Vat","Ca","Us","Tax","In","Sg","Gst","checkUnreachable","getTaxLabelTypeByCountry","country","options","CountryCode","Pr","Pw","Gu","As","Vi","Mp","Mh","Fm","taxLabelTypesByAddressType","Cpf","Cnpj","addressType","userAssignedCountryRulesSorted","Object","entries","USER_ASSIGNED_COUNTRY_MAPPING_RULES","flatMap","userAssignedCountry","rules","map","rule","sort","_","a","__","b","length","getTaxCountry","province","match","find","refCountry","refProvince","isTaxNumberOptional","formatTaxNumber","taxNumber","formatCpf","formatCnpj"],"mappings":";;;;;;;;AAiBa,MAAAA,0BAAA,GAA8BC,IAAsB,IAAA;EAC/D,QAAQA,IAAM;IACZ,KAAKC,YAAYC,QAAU;MAAA;QAClB,OAAAC,6BAAA;MACT;IACA,KAAK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,EACA;EAAEtC,OAAA;EAASc;CACR,KAAA;EAEC,IAAAd,OAAA,KAAYE,YAAYhB,EAAI,EAAA;IACvB,OAAAoD,SAAA;EACT;EAEA,QAAQxB,WAAa;IACnB,KAAKlD,WAAY,CAAAG,WAAA;MACf,OAAOwE,UAAUD,SAAS,CAAA;IAE5B,KAAK1E,WAAY,CAAAC,QAAA;MACf,OAAO2E,WAAWF,SAAS,CAAA;IAE7B;MACExC,gBAAA,CAAiBgB,WAAW,CAAA;MACrB,OAAAwB,SAAA;EACX;AACF,CAAA;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../src/utils/tax/index.ts"],"sourcesContent":["import isRegExp from \"lodash/isRegExp\";\n\nimport {\n BUSINESS_COUNTRY_CODE_MAPPING,\n RESIDENTIAL_COUNTRY_CODE_MAPPING,\n USER_ASSIGNED_COUNTRY_MAPPING_RULES,\n} from \"../../constants/address\";\nimport type { Nullish, UserAssignedCountryCode } from \"../../types\";\nimport { AddressType, CountryCode, StoreId } from \"../../types\";\nimport { assertUnreachable, checkUnreachable } from \"../errors\";\nimport { formatCnpj, formatCpf } from \"./brazil\";\nimport type { TaxCountryCode } from \"./types\";\nimport { TaxLabelType } from \"./types\";\n\n/**\n * Util to get the country code mapping based on address type in a type-safe way\n */\nexport const getValidationMappingByType = (type: AddressType) => {\n switch (type) {\n case AddressType.Business: {\n return BUSINESS_COUNTRY_CODE_MAPPING;\n }\n case AddressType.Residential: {\n return RESIDENTIAL_COUNTRY_CODE_MAPPING;\n }\n default: {\n assertUnreachable(type);\n }\n }\n};\n\n/**\n * Checks if given tax country has regex pattern for tax id's\n */\nexport const hasTaxNumberPatternValidation = (\n type: AddressType,\n taxCountryCode: TaxCountryCode,\n): taxCountryCode is keyof ReturnType<typeof getValidationMappingByType> =>\n taxCountryCode in getValidationMappingByType(type);\n\n/**\n * Checks if given tax id meets static pattern validation\n */\nexport const isValidTaxNumberPattern = (\n type: AddressType,\n taxCountryCode: TaxCountryCode,\n taxId: Nullish<string>,\n): boolean => {\n // If country doesn't have a tax number pattern then mark input as valid\n if (!hasTaxNumberPatternValidation(type, taxCountryCode)) {\n return true;\n }\n\n const mapping = getValidationMappingByType(type);\n const { validation, isOptional } = mapping[taxCountryCode];\n\n // Mark input as valid if the tax ID is missing but it's optional\n if (!taxId && isOptional) {\n return true;\n }\n\n // Check for empty tax id's in cases when they are required\n if (!taxId) {\n return false;\n }\n\n // Technically, this should already be covered by the \"hasTaxNumberPatternValidation\"\n // check above but just in case something goes really wrong, we are adding this\n // to avoid unexpected type errors during runtime\n if (!validation) {\n return true;\n }\n\n // Validate pattern\n return isRegExp(validation)\n ? validation.test(taxId)\n : validation({ taxId, taxCountryCode });\n};\n\n/**\n * Depending on store Tax is called different names, so this mapping determines which one to use\n * @see https://ui.slack.com/archives/D0191CBEB27/p1678723218358039?thread_ts=1678722532.763459&cid=D0191CBEB27\n */\nexport const getTaxLabelType = (storeId: StoreId) => {\n switch (storeId) {\n case StoreId.Me:\n case StoreId.Za:\n case StoreId.Eu:\n case StoreId.Uk:\n case StoreId.Br:\n case StoreId.Tw:\n case StoreId.Jp: {\n return TaxLabelType.Vat;\n }\n case StoreId.Ca:\n case StoreId.Us: {\n return TaxLabelType.Tax;\n }\n case StoreId.In:\n case StoreId.Sg: {\n return TaxLabelType.Gst;\n }\n case StoreId.Mx: {\n return TaxLabelType.Rfc;\n }\n default: {\n checkUnreachable(storeId);\n return TaxLabelType.Tax;\n }\n }\n};\n\nexport const getTaxLabelTypeByCountry = (\n country: CountryCode,\n options:\n | {\n type: \"general\";\n }\n | {\n type: \"specific\";\n addressType: AddressType;\n },\n) => {\n switch (country) {\n case CountryCode.Ca:\n case CountryCode.Us:\n case CountryCode.Pr:\n case CountryCode.Pw:\n case CountryCode.Gu:\n case CountryCode.As:\n case CountryCode.Vi:\n case CountryCode.Mp:\n case CountryCode.Mh:\n case CountryCode.Fm: {\n return TaxLabelType.Tax;\n }\n case CountryCode.In:\n case CountryCode.Sg: {\n return TaxLabelType.Gst;\n }\n case CountryCode.Mx: {\n return TaxLabelType.Rfc;\n }\n case CountryCode.Br: {\n // eslint-disable-next-line sonarjs/no-nested-switch\n switch (options.type) {\n case \"general\":\n return TaxLabelType.Vat;\n case \"specific\": {\n const taxLabelTypesByAddressType = {\n [AddressType.Residential]: TaxLabelType.Cpf,\n [AddressType.Business]: TaxLabelType.Cnpj,\n } satisfies Record<AddressType, TaxLabelType>;\n\n return taxLabelTypesByAddressType[options.addressType];\n }\n default:\n checkUnreachable(options);\n return TaxLabelType.Vat;\n }\n }\n default: {\n return TaxLabelType.Vat;\n }\n }\n};\n\n// #############################################################################\n// Assigned country code\n// #############################################################################\n/**\n * We can't 100% trust the order of countries as compiles can possible rearrange the values, so we have to sort the\n * values with country+province first when looking for the match we can stop at first occurrence\n * @see https://stackoverflow.com/a/5525820\n */\nconst userAssignedCountryRulesSorted = Object.entries(\n USER_ASSIGNED_COUNTRY_MAPPING_RULES,\n)\n .flatMap(([userAssignedCountry, rules]) =>\n rules.map((rule) => {\n return [userAssignedCountry as UserAssignedCountryCode, rule] as const;\n }),\n )\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n .sort(([_, a], [__, b]) => {\n return b.length - a.length;\n });\n\n/**\n * Util to get TAX country code for a given country + province combination\n */\nexport const getTaxCountry = ({\n country,\n province,\n}: {\n country: CountryCode;\n province: Nullish<string>;\n}): TaxCountryCode => {\n const match = userAssignedCountryRulesSorted.find(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n ([_, [refCountry, refProvince]]) => {\n // Don't match - if countries don't match\n if (refCountry !== country) {\n return false;\n }\n\n // Match - if pattern doesn't include a province\n // TODO: this is debatable whether it should match as input province can be non-nullish\n if (refProvince == null) {\n return true;\n }\n\n return refProvince === province;\n },\n );\n\n const userAssignedCountry = match?.[0];\n\n // If there isn't a user assigned country that matches the result (most likely indicating that it doesnt require\n // unique lookup) then fallback to input country\n return userAssignedCountry ?? country;\n};\n\nexport const isTaxNumberOptional = (\n type: AddressType,\n taxCountryCode: TaxCountryCode,\n) => {\n if (!hasTaxNumberPatternValidation(type, taxCountryCode)) {\n return true;\n }\n\n const mapping = getValidationMappingByType(type);\n const { isOptional } = mapping[taxCountryCode];\n\n return isOptional;\n};\n\nexport const formatTaxNumber = (\n taxNumber: string,\n { country, addressType }: { country: CountryCode; addressType: AddressType },\n) => {\n // Tax number formatting only needed for Brazil in the foreseeable future.\n if (country !== CountryCode.Br) {\n return taxNumber;\n }\n\n switch (addressType) {\n case AddressType.Residential:\n return formatCpf(taxNumber);\n\n case AddressType.Business:\n return formatCnpj(taxNumber);\n\n default:\n checkUnreachable(addressType);\n return taxNumber;\n }\n};\n"],"names":["getValidationMappingByType","type","AddressType","Business","BUSINESS_COUNTRY_CODE_MAPPING","Residential","RESIDENTIAL_COUNTRY_CODE_MAPPING","assertUnreachable","hasTaxNumberPatternValidation","taxCountryCode","isValidTaxNumberPattern","taxId","mapping","validation","isOptional","isRegExp","test","getTaxLabelType","storeId","StoreId","Me","Za","Eu","Uk","Br","Tw","Jp","TaxLabelType","Vat","Ca","Us","Tax","In","Sg","Gst","Mx","Rfc","checkUnreachable","getTaxLabelTypeByCountry","country","options","CountryCode","Pr","Pw","Gu","As","Vi","Mp","Mh","Fm","taxLabelTypesByAddressType","Cpf","Cnpj","addressType","userAssignedCountryRulesSorted","Object","entries","USER_ASSIGNED_COUNTRY_MAPPING_RULES","flatMap","userAssignedCountry","rules","map","rule","sort","_","a","__","b","length","getTaxCountry","province","match","find","refCountry","refProvince","isTaxNumberOptional","formatTaxNumber","taxNumber","formatCpf","formatCnpj"],"mappings":";;;;;;;;AAiBa,MAAAA,0BAAA,GAA8BC,IAAsB,IAAA;EAC/D,QAAQA,IAAM;IACZ,KAAKC,YAAYC,QAAU;MAAA;QAClB,OAAAC,6BAAA;MACT;IACA,KAAKF,YAAYG,WAAa;MAAA;QACrB,OAAAC,gCAAA;MACT;IACA;MAAS;QACPC,iBAAA,CAAkBN,IAAI,CAAA;MACxB;EACF;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SAAA,EACA;EAAEtC,OAAA;EAASc;CACR,KAAA;EAEC,IAAAd,OAAA,KAAYE,YAAYjB,EAAI,EAAA;IACvB,OAAAqD,SAAA;EACT;EAEA,QAAQxB,WAAa;IACnB,KAAKnD,WAAY,CAAAG,WAAA;MACf,OAAOyE,UAAUD,SAAS,CAAA;IAE5B,KAAK3E,WAAY,CAAAC,QAAA;MACf,OAAO4E,WAAWF,SAAS,CAAA;IAE7B;MACExC,gBAAA,CAAiBgB,WAAW,CAAA;MACrB,OAAAwB,SAAA;EACX;AACF,CAAA;"}
@@ -5,7 +5,8 @@ export declare enum TaxLabelType {
5
5
  Vat = "vat",
6
6
  Gst = "gst",
7
7
  Cpf = "cpf",
8
- Cnpj = "cnpj"
8
+ Cnpj = "cnpj",
9
+ Rfc = "rfc"
9
10
  }
10
11
  /**
11
12
  * Ability to create custom logic (not regex based for taxId) validation
@@ -7,6 +7,7 @@ var TaxLabelType = /* @__PURE__ */(TaxLabelType2 => {
7
7
  TaxLabelType2["Gst"] = "gst";
8
8
  TaxLabelType2["Cpf"] = "cpf";
9
9
  TaxLabelType2["Cnpj"] = "cnpj";
10
+ TaxLabelType2["Rfc"] = "rfc";
10
11
  return TaxLabelType2;
11
12
  })(TaxLabelType || {});
12
13
  exports.TaxLabelType = TaxLabelType;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../../../src/utils/tax/types.ts"],"sourcesContent":["import type { CountryCode, UserAssignedCountryCode } from \"../../types\";\n\nexport type TaxCountryCode = CountryCode | UserAssignedCountryCode;\n\nexport enum TaxLabelType {\n Tax = \"tax\",\n Vat = \"vat\",\n Gst = \"gst\",\n Cpf = \"cpf\",\n Cnpj = \"cnpj\",\n}\n\n/**\n * Ability to create custom logic (not regex based for taxId) validation\n */\nexport type CountryTaxIdValidationFn = (options: {\n taxCountryCode: TaxCountryCode;\n taxId: string;\n}) => boolean;\n\nexport type CountryTaxValidationMapping = Partial<\n Record<\n TaxCountryCode,\n { validation: CountryTaxIdValidationFn | RegExp; isOptional?: boolean }\n >\n>;\n"],"names":["TaxLabelType"],"mappings":";;;AAIY,IAAAA,YAAA,GAAA,gBAAAA,aAAL,IAAA;EACLA,cAAA,KAAM,CAAA,GAAA,KAAA;EACNA,cAAA,KAAM,CAAA,GAAA,KAAA;EACNA,cAAA,KAAM,CAAA,GAAA,KAAA;EACNA,cAAA,KAAM,CAAA,GAAA,KAAA;EACNA,cAAA,MAAO,CAAA,GAAA,MAAA;EALGA,OAAAA,aAAAA;AAAA,CAAA,EAAAA,YAAA,IAAA,CAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"types.js","sources":["../../../src/utils/tax/types.ts"],"sourcesContent":["import type { CountryCode, UserAssignedCountryCode } from \"../../types\";\n\nexport type TaxCountryCode = CountryCode | UserAssignedCountryCode;\n\nexport enum TaxLabelType {\n Tax = \"tax\",\n Vat = \"vat\",\n Gst = \"gst\",\n Cpf = \"cpf\",\n Cnpj = \"cnpj\",\n Rfc = \"rfc\",\n}\n\n/**\n * Ability to create custom logic (not regex based for taxId) validation\n */\nexport type CountryTaxIdValidationFn = (options: {\n taxCountryCode: TaxCountryCode;\n taxId: string;\n}) => boolean;\n\nexport type CountryTaxValidationMapping = Partial<\n Record<\n TaxCountryCode,\n { validation: CountryTaxIdValidationFn | RegExp; isOptional?: boolean }\n >\n>;\n"],"names":["TaxLabelType"],"mappings":";;;AAIY,IAAAA,YAAA,GAAA,gBAAAA,aAAL,IAAA;EACLA,cAAA,KAAM,CAAA,GAAA,KAAA;EACNA,cAAA,KAAM,CAAA,GAAA,KAAA;EACNA,cAAA,KAAM,CAAA,GAAA,KAAA;EACNA,cAAA,KAAM,CAAA,GAAA,KAAA;EACNA,cAAA,MAAO,CAAA,GAAA,MAAA;EACPA,cAAA,KAAM,CAAA,GAAA,KAAA;EANIA,OAAAA,aAAAA;AAAA,CAAA,EAAAA,YAAA,IAAA,CAAA,CAAA,CAAA;"}
@@ -6,6 +6,7 @@ var TaxLabelType = /* @__PURE__ */(TaxLabelType2 => {
6
6
  TaxLabelType2["Gst"] = "gst";
7
7
  TaxLabelType2["Cpf"] = "cpf";
8
8
  TaxLabelType2["Cnpj"] = "cnpj";
9
+ TaxLabelType2["Rfc"] = "rfc";
9
10
  return TaxLabelType2;
10
11
  })(TaxLabelType || {});
11
12
  export { TaxLabelType };
@@ -1 +1 @@
1
- {"version":3,"file":"types.mjs","sources":["../../../src/utils/tax/types.ts"],"sourcesContent":["import type { CountryCode, UserAssignedCountryCode } from \"../../types\";\n\nexport type TaxCountryCode = CountryCode | UserAssignedCountryCode;\n\nexport enum TaxLabelType {\n Tax = \"tax\",\n Vat = \"vat\",\n Gst = \"gst\",\n Cpf = \"cpf\",\n Cnpj = \"cnpj\",\n}\n\n/**\n * Ability to create custom logic (not regex based for taxId) validation\n */\nexport type CountryTaxIdValidationFn = (options: {\n taxCountryCode: TaxCountryCode;\n taxId: string;\n}) => boolean;\n\nexport type CountryTaxValidationMapping = Partial<\n Record<\n TaxCountryCode,\n { validation: CountryTaxIdValidationFn | RegExp; isOptional?: boolean }\n >\n>;\n"],"names":["TaxLabelType"],"mappings":";;AAIY,IAAAA,YAAA,GAAA,gBAAAA,aAAL,IAAA;EACLA,cAAA,KAAM,CAAA,GAAA,KAAA;EACNA,cAAA,KAAM,CAAA,GAAA,KAAA;EACNA,cAAA,KAAM,CAAA,GAAA,KAAA;EACNA,cAAA,KAAM,CAAA,GAAA,KAAA;EACNA,cAAA,MAAO,CAAA,GAAA,MAAA;EALGA,OAAAA,aAAAA;AAAA,CAAA,EAAAA,YAAA,IAAA,CAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"types.mjs","sources":["../../../src/utils/tax/types.ts"],"sourcesContent":["import type { CountryCode, UserAssignedCountryCode } from \"../../types\";\n\nexport type TaxCountryCode = CountryCode | UserAssignedCountryCode;\n\nexport enum TaxLabelType {\n Tax = \"tax\",\n Vat = \"vat\",\n Gst = \"gst\",\n Cpf = \"cpf\",\n Cnpj = \"cnpj\",\n Rfc = \"rfc\",\n}\n\n/**\n * Ability to create custom logic (not regex based for taxId) validation\n */\nexport type CountryTaxIdValidationFn = (options: {\n taxCountryCode: TaxCountryCode;\n taxId: string;\n}) => boolean;\n\nexport type CountryTaxValidationMapping = Partial<\n Record<\n TaxCountryCode,\n { validation: CountryTaxIdValidationFn | RegExp; isOptional?: boolean }\n >\n>;\n"],"names":["TaxLabelType"],"mappings":";;AAIY,IAAAA,YAAA,GAAA,gBAAAA,aAAL,IAAA;EACLA,cAAA,KAAM,CAAA,GAAA,KAAA;EACNA,cAAA,KAAM,CAAA,GAAA,KAAA;EACNA,cAAA,KAAM,CAAA,GAAA,KAAA;EACNA,cAAA,KAAM,CAAA,GAAA,KAAA;EACNA,cAAA,MAAO,CAAA,GAAA,MAAA;EACPA,cAAA,KAAM,CAAA,GAAA,KAAA;EANIA,OAAAA,aAAAA;AAAA,CAAA,EAAAA,YAAA,IAAA,CAAA,CAAA,CAAA;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ubnt/store.core",
3
- "version": "9.4.0",
3
+ "version": "9.5.0",
4
4
  "description": "",
5
5
  "sideEffects": false,
6
6
  "scripts": {