@ubnt/store.core 11.26.0-custom-tax.0 → 11.26.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 (299) hide show
  1. package/CHANGELOG.md +6 -1
  2. package/lib/_virtual/_virtual_multi-entry.js +0 -2
  3. package/lib/_virtual/_virtual_multi-entry.js.map +1 -1
  4. package/lib/_virtual/_virtual_multi-entry.mjs +0 -2
  5. package/lib/_virtual/_virtual_multi-entry.mjs.map +1 -1
  6. package/lib/assets/ai-360.jpg +0 -0
  7. package/lib/assets/ai-3602.jpg +0 -0
  8. package/lib/assets/ai-theta.jpg +0 -0
  9. package/lib/assets/ai-theta2.jpg +0 -0
  10. package/lib/assets/attention.svg +1 -1
  11. package/lib/assets/attention2.svg +1 -1
  12. package/lib/assets/bullet2.svg +1 -1
  13. package/lib/assets/bullet3.svg +1 -1
  14. package/lib/assets/door-hub.jpg +0 -0
  15. package/lib/assets/door-hub2.jpg +0 -0
  16. package/lib/assets/floodlight.svg +1 -1
  17. package/lib/assets/floodlight2.svg +1 -1
  18. package/lib/assets/g2-reader.jpg +0 -0
  19. package/lib/assets/g2-reader2.jpg +0 -0
  20. package/lib/assets/g3-reader-pro.jpg +0 -0
  21. package/lib/assets/g3-reader-pro2.jpg +0 -0
  22. package/lib/assets/g3-starter-kit-pro.jpg +0 -0
  23. package/lib/assets/g3-starter-kit-pro2.jpg +0 -0
  24. package/lib/assets/g3-starter-kit.jpg +0 -0
  25. package/lib/assets/g3-starter-kit2.jpg +0 -0
  26. package/lib/assets/g4-instant.jpg +0 -0
  27. package/lib/assets/g4-instant2.jpg +0 -0
  28. package/lib/assets/g4-ptz.jpg +0 -0
  29. package/lib/assets/g4-ptz2.jpg +0 -0
  30. package/lib/assets/g5-dome-ultra.jpg +0 -0
  31. package/lib/assets/g5-dome-ultra2.jpg +0 -0
  32. package/lib/assets/g5-ptz.jpg +0 -0
  33. package/lib/assets/g5-ptz2.jpg +0 -0
  34. package/lib/assets/globe.svg +1 -1
  35. package/lib/assets/globe2.svg +1 -1
  36. package/lib/assets/intercom.jpg +0 -0
  37. package/lib/assets/intercom2.jpg +0 -0
  38. package/lib/assets/interior-design.svg +1 -1
  39. package/lib/assets/interior-design2.svg +1 -1
  40. package/lib/assets/minus4.svg +1 -1
  41. package/lib/assets/minus5.svg +1 -1
  42. package/lib/assets/pause.svg +1 -1
  43. package/lib/assets/pause2.svg +1 -1
  44. package/lib/assets/plus4.svg +1 -1
  45. package/lib/assets/plus5.svg +1 -1
  46. package/lib/assets/power.svg +1 -1
  47. package/lib/assets/power2.svg +1 -1
  48. package/lib/assets/ptz2.svg +1 -1
  49. package/lib/assets/ptz3.svg +1 -1
  50. package/lib/assets/rack.svg +1 -1
  51. package/lib/assets/rack2.svg +1 -1
  52. package/lib/assets/udr.jpg +0 -0
  53. package/lib/assets/udr2.jpg +0 -0
  54. package/lib/assets/udr3.jpg +0 -0
  55. package/lib/assets/udw.jpg +0 -0
  56. package/lib/assets/udw2.jpg +0 -0
  57. package/lib/assets/umr.jpg +0 -0
  58. package/lib/assets/umr2.jpg +0 -0
  59. package/lib/components/Explore/ExploreData.js +3 -3
  60. package/lib/components/Explore/ExploreData.mjs +3 -3
  61. package/lib/components/Explore/assets/udr.jpg.js +1 -1
  62. package/lib/components/Explore/assets/udr.jpg.mjs +2 -2
  63. package/lib/components/Explore/assets/udw.jpg.js +1 -1
  64. package/lib/components/Explore/assets/udw.jpg.mjs +2 -2
  65. package/lib/components/Explore/assets/umr.jpg.js +1 -1
  66. package/lib/components/Explore/assets/umr.jpg.mjs +2 -2
  67. package/lib/components/Header/Header.js +1 -1
  68. package/lib/components/Header/Header.mjs +1 -1
  69. package/lib/components/Header/LanguageFrame/LanguageFrame.js +1 -1
  70. package/lib/components/Header/LanguageFrame/LanguageFrame.js.map +1 -1
  71. package/lib/components/Header/LanguageFrame/LanguageFrame.mjs +1 -1
  72. package/lib/components/Header/LanguageFrame/LanguageFrame.mjs.map +1 -1
  73. package/lib/components/Header/ProHeader/ProHeader.js +1 -1
  74. package/lib/components/Header/ProHeader/ProHeader.mjs +1 -1
  75. package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.js +1 -1
  76. package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.mjs +1 -1
  77. package/lib/components/MicrositeVideoSlideshow/MicrositeVideoSlideshow.js +1 -1
  78. package/lib/components/MicrositeVideoSlideshow/MicrositeVideoSlideshow.mjs +1 -1
  79. package/lib/components/MicrositeVideoSlideshow/assets/pause.svg.js +1 -1
  80. package/lib/components/MicrositeVideoSlideshow/assets/pause.svg.mjs +2 -2
  81. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.js +1 -1
  82. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.mjs +1 -1
  83. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CounterSection.js +2 -2
  84. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CounterSection.mjs +2 -2
  85. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.js +1 -1
  86. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.mjs +2 -2
  87. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/minus.svg.js +1 -1
  88. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/minus.svg.mjs +2 -2
  89. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/plus.svg.js +1 -1
  90. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/plus.svg.mjs +2 -2
  91. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.js +1 -1
  92. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.mjs +1 -1
  93. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.js +1 -1
  94. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.mjs +2 -2
  95. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.js +2 -2
  96. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.mjs +2 -2
  97. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/minus.svg.js +1 -1
  98. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/minus.svg.mjs +2 -2
  99. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/plus.svg.js +1 -1
  100. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/plus.svg.mjs +2 -2
  101. package/lib/components/VideoPlayerNew/VideoPlayer.js +1 -1
  102. package/lib/components/VideoPlayerNew/VideoPlayer.mjs +1 -1
  103. package/lib/components/VideoPlayerNew/assets/pause.svg.js +1 -1
  104. package/lib/components/VideoPlayerNew/assets/pause.svg.mjs +2 -2
  105. package/lib/constants/icons/header/globe.svg.js +1 -1
  106. package/lib/constants/icons/header/globe.svg.mjs +2 -2
  107. package/lib/constants/icons/header/index.js +1 -1
  108. package/lib/constants/icons/header/index.mjs +1 -1
  109. package/lib/constants/icons/menu/floodlight.svg.js +5 -5
  110. package/lib/constants/icons/menu/floodlight.svg.mjs +2 -2
  111. package/lib/constants/icons/menu/index.js +9 -9
  112. package/lib/constants/icons/menu/index.mjs +3 -3
  113. package/lib/constants/icons/menu/power.svg.js +5 -5
  114. package/lib/constants/icons/menu/power.svg.mjs +2 -2
  115. package/lib/constants/icons/menu/rack.svg.js +5 -5
  116. package/lib/constants/icons/menu/rack.svg.mjs +2 -2
  117. package/lib/constants/modelCompareData/assets/Bullet/bullet.svg.js +1 -1
  118. package/lib/constants/modelCompareData/assets/Bullet/bullet.svg.mjs +2 -2
  119. package/lib/constants/modelCompareData/assets/Compact/g4-instant.jpg.js +1 -1
  120. package/lib/constants/modelCompareData/assets/Compact/g4-instant.jpg.mjs +2 -2
  121. package/lib/constants/modelCompareData/assets/Consoles/bigCompare/udr.jpg.js +5 -5
  122. package/lib/constants/modelCompareData/assets/Consoles/bigCompare/udr.jpg.mjs +2 -2
  123. package/lib/constants/modelCompareData/assets/Consoles/bigCompare/udw.jpg.js +1 -1
  124. package/lib/constants/modelCompareData/assets/Consoles/bigCompare/udw.jpg.mjs +2 -2
  125. package/lib/constants/modelCompareData/assets/Consoles/udr.jpg.js +1 -1
  126. package/lib/constants/modelCompareData/assets/Consoles/udr.jpg.mjs +2 -2
  127. package/lib/constants/modelCompareData/assets/DomeTurret/ai-360.jpg.js +1 -1
  128. package/lib/constants/modelCompareData/assets/DomeTurret/ai-360.jpg.mjs +2 -2
  129. package/lib/constants/modelCompareData/assets/DomeTurret/g5-dome-ultra.jpg.js +1 -1
  130. package/lib/constants/modelCompareData/assets/DomeTurret/g5-dome-ultra.jpg.mjs +2 -2
  131. package/lib/constants/modelCompareData/assets/DoorAccess/door-hub.jpg.js +1 -1
  132. package/lib/constants/modelCompareData/assets/DoorAccess/door-hub.jpg.mjs +2 -2
  133. package/lib/constants/modelCompareData/assets/DoorAccess/g2-reader.jpg.js +1 -1
  134. package/lib/constants/modelCompareData/assets/DoorAccess/g2-reader.jpg.mjs +2 -2
  135. package/lib/constants/modelCompareData/assets/DoorAccess/g3-reader-pro.jpg.js +1 -1
  136. package/lib/constants/modelCompareData/assets/DoorAccess/g3-reader-pro.jpg.mjs +2 -2
  137. package/lib/constants/modelCompareData/assets/DoorAccess/g3-starter-kit-pro.jpg.js +1 -1
  138. package/lib/constants/modelCompareData/assets/DoorAccess/g3-starter-kit-pro.jpg.mjs +2 -2
  139. package/lib/constants/modelCompareData/assets/DoorAccess/g3-starter-kit.jpg.js +1 -1
  140. package/lib/constants/modelCompareData/assets/DoorAccess/g3-starter-kit.jpg.mjs +2 -2
  141. package/lib/constants/modelCompareData/assets/DoorAccess/intercom.jpg.js +1 -1
  142. package/lib/constants/modelCompareData/assets/DoorAccess/intercom.jpg.mjs +2 -2
  143. package/lib/constants/modelCompareData/assets/Interior/ai-theta.jpg.js +1 -1
  144. package/lib/constants/modelCompareData/assets/Interior/ai-theta.jpg.mjs +2 -2
  145. package/lib/constants/modelCompareData/assets/MobileRouters/umr.jpg.js +1 -1
  146. package/lib/constants/modelCompareData/assets/MobileRouters/umr.jpg.mjs +2 -2
  147. package/lib/constants/modelCompareData/assets/PTZ/g4-ptz.jpg.js +1 -1
  148. package/lib/constants/modelCompareData/assets/PTZ/g4-ptz.jpg.mjs +2 -2
  149. package/lib/constants/modelCompareData/assets/PTZ/g5-ptz.jpg.js +1 -1
  150. package/lib/constants/modelCompareData/assets/PTZ/g5-ptz.jpg.mjs +2 -2
  151. package/lib/constants/modelCompareData/assets/floodlight.svg.js +1 -1
  152. package/lib/constants/modelCompareData/assets/floodlight.svg.mjs +2 -2
  153. package/lib/constants/modelCompareData/assets/globe.svg.js +1 -1
  154. package/lib/constants/modelCompareData/assets/globe.svg.mjs +2 -2
  155. package/lib/constants/modelCompareData/assets/interior-design.svg.js +1 -1
  156. package/lib/constants/modelCompareData/assets/interior-design.svg.mjs +2 -2
  157. package/lib/constants/modelCompareData/assets/power.svg.js +1 -1
  158. package/lib/constants/modelCompareData/assets/power.svg.mjs +2 -2
  159. package/lib/constants/modelCompareData/assets/product-list-assets/bullet.svg.js +1 -1
  160. package/lib/constants/modelCompareData/assets/product-list-assets/bullet.svg.mjs +2 -2
  161. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/compact/g4-instant.jpg.js +1 -1
  162. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/compact/g4-instant.jpg.mjs +2 -2
  163. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/ai-360.jpg.js +1 -1
  164. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/ai-360.jpg.mjs +2 -2
  165. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/g5-dome-ultra.jpg.js +1 -1
  166. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/g5-dome-ultra.jpg.mjs +2 -2
  167. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/door-hub.jpg.js +1 -1
  168. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/door-hub.jpg.mjs +2 -2
  169. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g2-reader.jpg.js +1 -1
  170. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g2-reader.jpg.mjs +2 -2
  171. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-reader-pro.jpg.js +1 -1
  172. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-reader-pro.jpg.mjs +2 -2
  173. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-starter-kit-pro.jpg.js +1 -1
  174. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-starter-kit-pro.jpg.mjs +2 -2
  175. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-starter-kit.jpg.js +1 -1
  176. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-starter-kit.jpg.mjs +2 -2
  177. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/intercom.jpg.js +1 -1
  178. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/intercom.jpg.mjs +2 -2
  179. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/interior-design/ai-theta.jpg.js +1 -1
  180. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/interior-design/ai-theta.jpg.mjs +2 -2
  181. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/ptz/g4-ptz.jpg.js +1 -1
  182. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/ptz/g4-ptz.jpg.mjs +2 -2
  183. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/ptz/g5-ptz.jpg.js +1 -1
  184. package/lib/constants/modelCompareData/assets/product-list-assets/cameras/ptz/g5-ptz.jpg.mjs +2 -2
  185. package/lib/constants/modelCompareData/assets/product-list-assets/interior-design.svg.js +1 -1
  186. package/lib/constants/modelCompareData/assets/product-list-assets/interior-design.svg.mjs +2 -2
  187. package/lib/constants/modelCompareData/assets/product-list-assets/ptz.svg.js +1 -1
  188. package/lib/constants/modelCompareData/assets/product-list-assets/ptz.svg.mjs +2 -2
  189. package/lib/constants/modelCompareData/assets/ptz.svg.js +1 -1
  190. package/lib/constants/modelCompareData/assets/ptz.svg.mjs +2 -2
  191. package/lib/constants/modelCompareData/assets/rack.svg.js +1 -1
  192. package/lib/constants/modelCompareData/assets/rack.svg.mjs +2 -2
  193. package/lib/constants/modelCompareData/data/CloudGateways.js +1 -1
  194. package/lib/constants/modelCompareData/data/CloudGateways.mjs +1 -1
  195. package/lib/constants/modelCompareData/data/DreamMachineConsolev4.js +4 -4
  196. package/lib/constants/modelCompareData/data/DreamMachineConsolev4.mjs +3 -3
  197. package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Bullet.js +1 -1
  198. package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Bullet.mjs +1 -1
  199. package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/InteriorDesign.js +1 -1
  200. package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/InteriorDesign.mjs +1 -1
  201. package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Ptz.js +1 -1
  202. package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Ptz.mjs +1 -1
  203. package/lib/constants/modelCompareData/data/product-list-groups/bullet.js +1 -1
  204. package/lib/constants/modelCompareData/data/product-list-groups/bullet.mjs +1 -1
  205. package/lib/constants/modelCompareData/data/product-list-groups/interiorDesign.js +1 -1
  206. package/lib/constants/modelCompareData/data/product-list-groups/interiorDesign.mjs +1 -1
  207. package/lib/constants/modelCompareData/data/product-list-groups/ptz.js +1 -1
  208. package/lib/constants/modelCompareData/data/product-list-groups/ptz.mjs +1 -1
  209. package/lib/constants/modelCompareData/data/products/ai360.js +2 -2
  210. package/lib/constants/modelCompareData/data/products/ai360.mjs +2 -2
  211. package/lib/constants/modelCompareData/data/products/doorHub.js +2 -2
  212. package/lib/constants/modelCompareData/data/products/doorHub.mjs +2 -2
  213. package/lib/constants/modelCompareData/data/products/g2Reader.js +2 -2
  214. package/lib/constants/modelCompareData/data/products/g2Reader.mjs +2 -2
  215. package/lib/constants/modelCompareData/data/products/g3ReaderPro.js +2 -2
  216. package/lib/constants/modelCompareData/data/products/g3ReaderPro.mjs +2 -2
  217. package/lib/constants/modelCompareData/data/products/g3StarterKit.js +2 -2
  218. package/lib/constants/modelCompareData/data/products/g3StarterKit.mjs +2 -2
  219. package/lib/constants/modelCompareData/data/products/g3StarterKitPro.js +2 -2
  220. package/lib/constants/modelCompareData/data/products/g3StarterKitPro.mjs +2 -2
  221. package/lib/constants/modelCompareData/data/products/g4Instant.js +2 -2
  222. package/lib/constants/modelCompareData/data/products/g4Instant.mjs +2 -2
  223. package/lib/constants/modelCompareData/data/products/g4Ptz.js +2 -2
  224. package/lib/constants/modelCompareData/data/products/g4Ptz.mjs +2 -2
  225. package/lib/constants/modelCompareData/data/products/g5DomeUltra.js +2 -2
  226. package/lib/constants/modelCompareData/data/products/g5DomeUltra.mjs +2 -2
  227. package/lib/constants/modelCompareData/data/products/g5Ptz.js +2 -2
  228. package/lib/constants/modelCompareData/data/products/g5Ptz.mjs +2 -2
  229. package/lib/constants/modelCompareData/data/products/intercom.js +2 -2
  230. package/lib/constants/modelCompareData/data/products/intercom.mjs +2 -2
  231. package/lib/constants/modelCompareData/data/products/theta.js +2 -2
  232. package/lib/constants/modelCompareData/data/products/theta.mjs +2 -2
  233. package/lib/constants/modelCompareData/data/products/udr.js +1 -1
  234. package/lib/constants/modelCompareData/data/products/udr.mjs +1 -1
  235. package/lib/constants/modelCompareData/data/products/udw.js +1 -1
  236. package/lib/constants/modelCompareData/data/products/udw.mjs +1 -1
  237. package/lib/constants/modelCompareData/data/products/umr.js +1 -1
  238. package/lib/constants/modelCompareData/data/products/umr.mjs +1 -1
  239. package/lib/constants/modelCompareData/data/properties/accessPowerMethod.js +1 -1
  240. package/lib/constants/modelCompareData/data/properties/accessPowerMethod.mjs +1 -1
  241. package/lib/constants/modelCompareData/data/properties/availability.js +1 -1
  242. package/lib/constants/modelCompareData/data/properties/availability.mjs +1 -1
  243. package/lib/constants/modelCompareData/data/properties/builtInFloodlight.js +1 -1
  244. package/lib/constants/modelCompareData/data/properties/builtInFloodlight.mjs +1 -1
  245. package/lib/constants/modelCompareData/data/properties/dcPowerOutput.js +1 -1
  246. package/lib/constants/modelCompareData/data/properties/dcPowerOutput.mjs +1 -1
  247. package/lib/constants/modelCompareData/data/properties/mounting.js +1 -1
  248. package/lib/constants/modelCompareData/data/properties/mounting.mjs +1 -1
  249. package/lib/constants/modelCompareData/data/properties/unasPowerMethod.js +1 -1
  250. package/lib/constants/modelCompareData/data/properties/unasPowerMethod.mjs +1 -1
  251. package/lib/constants/modelCompareData/data/properties/webMode.js +1 -1
  252. package/lib/constants/modelCompareData/data/properties/webMode.mjs +1 -1
  253. package/lib/contexts/MenuContext/mapping.js +3 -3
  254. package/lib/contexts/MenuContext/mapping.mjs +2 -2
  255. package/lib/contexts/MicrositeMenuContext/mapping.js +3 -3
  256. package/lib/contexts/MicrositeMenuContext/mapping.mjs +2 -2
  257. package/lib/utils/address.d.ts +67 -1
  258. package/lib/utils/address.js +2 -1
  259. package/lib/utils/address.js.map +1 -1
  260. package/lib/utils/address.mjs +2 -1
  261. package/lib/utils/address.mjs.map +1 -1
  262. package/lib/utils/array.d.ts +0 -6
  263. package/lib/utils/array.js +0 -9
  264. package/lib/utils/array.js.map +1 -1
  265. package/lib/utils/array.mjs +1 -9
  266. package/lib/utils/array.mjs.map +1 -1
  267. package/lib/utils/index.d.ts +0 -1
  268. package/lib/utils/index.js +0 -2
  269. package/lib/utils/index.js.map +1 -1
  270. package/lib/utils/index.mjs +0 -2
  271. package/lib/utils/index.mjs.map +1 -1
  272. package/lib/utils/money/index.d.ts +0 -1
  273. package/lib/utils/money/index.js +0 -2
  274. package/lib/utils/money/index.js.map +1 -1
  275. package/lib/utils/money/index.mjs +0 -1
  276. package/lib/utils/money/index.mjs.map +1 -1
  277. package/lib/utils/money/tax.d.ts +3 -6
  278. package/lib/utils/money/tax.js +10 -3
  279. package/lib/utils/money/tax.js.map +1 -1
  280. package/lib/utils/money/tax.mjs +13 -6
  281. package/lib/utils/money/tax.mjs.map +1 -1
  282. package/lib/utils/money/tax.private.d.ts +2 -7
  283. package/lib/utils/money/tax.private.js +6 -21
  284. package/lib/utils/money/tax.private.js.map +1 -1
  285. package/lib/utils/money/tax.private.mjs +8 -22
  286. package/lib/utils/money/tax.private.mjs.map +1 -1
  287. package/package.json +1 -1
  288. package/lib/utils/map.d.ts +0 -51
  289. package/lib/utils/map.js +0 -97
  290. package/lib/utils/map.js.map +0 -1
  291. package/lib/utils/map.mjs +0 -95
  292. package/lib/utils/map.mjs.map +0 -1
  293. package/lib/utils/map.test.d.ts +0 -1
  294. package/lib/utils/money/allocators/totalAmount.d.ts +0 -14
  295. package/lib/utils/money/allocators/totalAmount.js +0 -35
  296. package/lib/utils/money/allocators/totalAmount.js.map +0 -1
  297. package/lib/utils/money/allocators/totalAmount.mjs +0 -33
  298. package/lib/utils/money/allocators/totalAmount.mjs.map +0 -1
  299. package/lib/utils/money/allocators/totalAmount.test.d.ts +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ubnt/store.core",
3
- "version": "11.26.0-custom-tax.0",
3
+ "version": "11.26.0",
4
4
  "description": "",
5
5
  "sideEffects": false,
6
6
  "scripts": {
@@ -1,51 +0,0 @@
1
- /**
2
- * Type-safe key parser that ensures all properties of the key are used
3
- */
4
- export type KeyParser<Key> = (key: Key) => string;
5
- /**
6
- * Type-safe KeyMap implementation with compile-time validation
7
- */
8
- export declare class KeyMap<Key, Value> {
9
- #private;
10
- constructor(parser: KeyParser<Key>, entries?: readonly (readonly [Key, Value])[] | null | undefined, validator?: (key: Key) => void);
11
- /**
12
- * Get a value by key with runtime validation
13
- */
14
- get(key: Key): Value | undefined;
15
- /**
16
- * Set a value by key with runtime validation
17
- */
18
- set(key: Key, value: Value): void;
19
- /**
20
- * Check if a key exists with runtime validation
21
- */
22
- has(key: Key): boolean;
23
- /**
24
- * Get all values
25
- */
26
- values(): IterableIterator<Value>;
27
- /**
28
- * Get all keys (returns stringified keys)
29
- */
30
- keys(): IterableIterator<string>;
31
- /**
32
- * Get all entries (returns stringified keys)
33
- */
34
- entries(): IterableIterator<[string, Value]>;
35
- /**
36
- * Get the size of the map
37
- */
38
- get size(): number;
39
- /**
40
- * Clear all entries
41
- */
42
- clear(): void;
43
- /**
44
- * Delete an entry by key
45
- */
46
- delete(key: Key): boolean;
47
- /**
48
- * Create a KeyMap for database composite keys with automatic validation
49
- */
50
- static createForCompositeKey<Key extends Record<string, string | number>, Value>(keyFieldObject: Record<keyof Key, true>, entries?: readonly (readonly [Key, Value])[] | null | undefined): KeyMap<Key, Value>;
51
- }
package/lib/utils/map.js DELETED
@@ -1,97 +0,0 @@
1
- 'use strict';
2
-
3
- var array = require('./array.js');
4
- "use strict";
5
- class KeyMap {
6
- #map;
7
- #keyParser;
8
- #keyValidator;
9
- constructor(parser, entries, validator) {
10
- this.#keyParser = parser;
11
- this.#keyValidator = validator || (() => {});
12
- this.#map = Array.isArray(entries) ? new Map(entries.map(([key, value]) => {
13
- this.#keyValidator(key);
14
- return [this.#keyParser(key), value];
15
- })) : /* @__PURE__ */new Map();
16
- }
17
- /**
18
- * Get a value by key with runtime validation
19
- */
20
- get(key) {
21
- this.#keyValidator(key);
22
- return this.#map.get(this.#keyParser(key));
23
- }
24
- /**
25
- * Set a value by key with runtime validation
26
- */
27
- set(key, value) {
28
- this.#keyValidator(key);
29
- this.#map.set(this.#keyParser(key), value);
30
- }
31
- /**
32
- * Check if a key exists with runtime validation
33
- */
34
- has(key) {
35
- this.#keyValidator(key);
36
- return this.#map.has(this.#keyParser(key));
37
- }
38
- /**
39
- * Get all values
40
- */
41
- values() {
42
- return this.#map.values();
43
- }
44
- /**
45
- * Get all keys (returns stringified keys)
46
- */
47
- keys() {
48
- return this.#map.keys();
49
- }
50
- /**
51
- * Get all entries (returns stringified keys)
52
- */
53
- entries() {
54
- return this.#map.entries();
55
- }
56
- /**
57
- * Get the size of the map
58
- */
59
- get size() {
60
- return this.#map.size;
61
- }
62
- /**
63
- * Clear all entries
64
- */
65
- clear() {
66
- this.#map.clear();
67
- }
68
- /**
69
- * Delete an entry by key
70
- */
71
- delete(key) {
72
- this.#keyValidator(key);
73
- return this.#map.delete(this.#keyParser(key));
74
- }
75
- /**
76
- * Create a KeyMap for database composite keys with automatic validation
77
- */
78
- static createForCompositeKey(keyFieldObject, entries) {
79
- const keyFields = array.createArrayFromInterfaceKeys(keyFieldObject);
80
- const parser = key => {
81
- return keyFields.map(field => String(key[field])).join("_");
82
- };
83
- const validator = key => {
84
- for (const field of keyFields) {
85
- if (!(field in key)) {
86
- throw new Error(`Missing required key field: ${String(field)}`);
87
- }
88
- if (key[field] == null) {
89
- throw new Error(`Key field ${String(field)} cannot be null or undefined`);
90
- }
91
- }
92
- };
93
- return new KeyMap(parser, entries, validator);
94
- }
95
- }
96
- exports.KeyMap = KeyMap;
97
- //# sourceMappingURL=map.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"map.js","sources":["../../src/utils/map.ts"],"sourcesContent":["import { createArrayFromInterfaceKeys } from \"./array\";\n\n/**\n * Type-safe key parser that ensures all properties of the key are used\n */\nexport type KeyParser<Key> = (key: Key) => string;\n\n/**\n * Type-safe KeyMap implementation with compile-time validation\n */\nexport class KeyMap<Key, Value> {\n #map: Map<string, Value>;\n #keyParser: KeyParser<Key>;\n #keyValidator: (key: Key) => void;\n\n constructor(\n parser: KeyParser<Key>,\n entries?: readonly (readonly [Key, Value])[] | null | undefined,\n validator?: (key: Key) => void,\n ) {\n this.#keyParser = parser;\n this.#keyValidator = validator || (() => {});\n this.#map = Array.isArray(entries)\n ? new Map(\n entries.map(([key, value]) => {\n this.#keyValidator(key);\n return [this.#keyParser(key), value];\n }),\n )\n : new Map();\n }\n\n /**\n * Get a value by key with runtime validation\n */\n get(key: Key): Value | undefined {\n this.#keyValidator(key);\n return this.#map.get(this.#keyParser(key));\n }\n\n /**\n * Set a value by key with runtime validation\n */\n set(key: Key, value: Value): void {\n this.#keyValidator(key);\n this.#map.set(this.#keyParser(key), value);\n }\n\n /**\n * Check if a key exists with runtime validation\n */\n has(key: Key): boolean {\n this.#keyValidator(key);\n return this.#map.has(this.#keyParser(key));\n }\n\n /**\n * Get all values\n */\n values(): IterableIterator<Value> {\n return this.#map.values();\n }\n\n /**\n * Get all keys (returns stringified keys)\n */\n keys(): IterableIterator<string> {\n return this.#map.keys();\n }\n\n /**\n * Get all entries (returns stringified keys)\n */\n entries(): IterableIterator<[string, Value]> {\n return this.#map.entries();\n }\n\n /**\n * Get the size of the map\n */\n get size(): number {\n return this.#map.size;\n }\n\n /**\n * Clear all entries\n */\n clear(): void {\n this.#map.clear();\n }\n\n /**\n * Delete an entry by key\n */\n delete(key: Key): boolean {\n this.#keyValidator(key);\n return this.#map.delete(this.#keyParser(key));\n }\n\n /**\n * Create a KeyMap for database composite keys with automatic validation\n */\n static createForCompositeKey<\n Key extends Record<string, string | number>,\n Value,\n >(\n keyFieldObject: Record<keyof Key, true>,\n entries?: readonly (readonly [Key, Value])[] | null | undefined,\n ): KeyMap<Key, Value> {\n const keyFields = createArrayFromInterfaceKeys(keyFieldObject);\n\n const parser: KeyParser<Key> = (key) => {\n return keyFields.map((field) => String(key[field])).join(\"_\");\n };\n\n const validator = (key: Key) => {\n for (const field of keyFields) {\n if (!(field in key)) {\n throw new Error(`Missing required key field: ${String(field)}`);\n }\n if (key[field] == null) {\n throw new Error(\n `Key field ${String(field)} cannot be null or undefined`,\n );\n }\n }\n };\n\n return new KeyMap(parser, entries, validator);\n }\n}\n"],"names":["KeyMap","map","keyParser","keyValidator","constructor","parser","entries","validator","Array","isArray","Map","key","value","get","set","has","values","keys","size","clear","delete","createForCompositeKey","keyFieldObject","keyFields","createArrayFromInterfaceKeys","field","String","join","Error"],"mappings":"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"}
package/lib/utils/map.mjs DELETED
@@ -1,95 +0,0 @@
1
- import { createArrayFromInterfaceKeys } from './array.mjs';
2
- "use strict";
3
- class KeyMap {
4
- #map;
5
- #keyParser;
6
- #keyValidator;
7
- constructor(parser, entries, validator) {
8
- this.#keyParser = parser;
9
- this.#keyValidator = validator || (() => {});
10
- this.#map = Array.isArray(entries) ? new Map(entries.map(([key, value]) => {
11
- this.#keyValidator(key);
12
- return [this.#keyParser(key), value];
13
- })) : /* @__PURE__ */new Map();
14
- }
15
- /**
16
- * Get a value by key with runtime validation
17
- */
18
- get(key) {
19
- this.#keyValidator(key);
20
- return this.#map.get(this.#keyParser(key));
21
- }
22
- /**
23
- * Set a value by key with runtime validation
24
- */
25
- set(key, value) {
26
- this.#keyValidator(key);
27
- this.#map.set(this.#keyParser(key), value);
28
- }
29
- /**
30
- * Check if a key exists with runtime validation
31
- */
32
- has(key) {
33
- this.#keyValidator(key);
34
- return this.#map.has(this.#keyParser(key));
35
- }
36
- /**
37
- * Get all values
38
- */
39
- values() {
40
- return this.#map.values();
41
- }
42
- /**
43
- * Get all keys (returns stringified keys)
44
- */
45
- keys() {
46
- return this.#map.keys();
47
- }
48
- /**
49
- * Get all entries (returns stringified keys)
50
- */
51
- entries() {
52
- return this.#map.entries();
53
- }
54
- /**
55
- * Get the size of the map
56
- */
57
- get size() {
58
- return this.#map.size;
59
- }
60
- /**
61
- * Clear all entries
62
- */
63
- clear() {
64
- this.#map.clear();
65
- }
66
- /**
67
- * Delete an entry by key
68
- */
69
- delete(key) {
70
- this.#keyValidator(key);
71
- return this.#map.delete(this.#keyParser(key));
72
- }
73
- /**
74
- * Create a KeyMap for database composite keys with automatic validation
75
- */
76
- static createForCompositeKey(keyFieldObject, entries) {
77
- const keyFields = createArrayFromInterfaceKeys(keyFieldObject);
78
- const parser = key => {
79
- return keyFields.map(field => String(key[field])).join("_");
80
- };
81
- const validator = key => {
82
- for (const field of keyFields) {
83
- if (!(field in key)) {
84
- throw new Error(`Missing required key field: ${String(field)}`);
85
- }
86
- if (key[field] == null) {
87
- throw new Error(`Key field ${String(field)} cannot be null or undefined`);
88
- }
89
- }
90
- };
91
- return new KeyMap(parser, entries, validator);
92
- }
93
- }
94
- export { KeyMap };
95
- //# sourceMappingURL=map.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"map.mjs","sources":["../../src/utils/map.ts"],"sourcesContent":["import { createArrayFromInterfaceKeys } from \"./array\";\n\n/**\n * Type-safe key parser that ensures all properties of the key are used\n */\nexport type KeyParser<Key> = (key: Key) => string;\n\n/**\n * Type-safe KeyMap implementation with compile-time validation\n */\nexport class KeyMap<Key, Value> {\n #map: Map<string, Value>;\n #keyParser: KeyParser<Key>;\n #keyValidator: (key: Key) => void;\n\n constructor(\n parser: KeyParser<Key>,\n entries?: readonly (readonly [Key, Value])[] | null | undefined,\n validator?: (key: Key) => void,\n ) {\n this.#keyParser = parser;\n this.#keyValidator = validator || (() => {});\n this.#map = Array.isArray(entries)\n ? new Map(\n entries.map(([key, value]) => {\n this.#keyValidator(key);\n return [this.#keyParser(key), value];\n }),\n )\n : new Map();\n }\n\n /**\n * Get a value by key with runtime validation\n */\n get(key: Key): Value | undefined {\n this.#keyValidator(key);\n return this.#map.get(this.#keyParser(key));\n }\n\n /**\n * Set a value by key with runtime validation\n */\n set(key: Key, value: Value): void {\n this.#keyValidator(key);\n this.#map.set(this.#keyParser(key), value);\n }\n\n /**\n * Check if a key exists with runtime validation\n */\n has(key: Key): boolean {\n this.#keyValidator(key);\n return this.#map.has(this.#keyParser(key));\n }\n\n /**\n * Get all values\n */\n values(): IterableIterator<Value> {\n return this.#map.values();\n }\n\n /**\n * Get all keys (returns stringified keys)\n */\n keys(): IterableIterator<string> {\n return this.#map.keys();\n }\n\n /**\n * Get all entries (returns stringified keys)\n */\n entries(): IterableIterator<[string, Value]> {\n return this.#map.entries();\n }\n\n /**\n * Get the size of the map\n */\n get size(): number {\n return this.#map.size;\n }\n\n /**\n * Clear all entries\n */\n clear(): void {\n this.#map.clear();\n }\n\n /**\n * Delete an entry by key\n */\n delete(key: Key): boolean {\n this.#keyValidator(key);\n return this.#map.delete(this.#keyParser(key));\n }\n\n /**\n * Create a KeyMap for database composite keys with automatic validation\n */\n static createForCompositeKey<\n Key extends Record<string, string | number>,\n Value,\n >(\n keyFieldObject: Record<keyof Key, true>,\n entries?: readonly (readonly [Key, Value])[] | null | undefined,\n ): KeyMap<Key, Value> {\n const keyFields = createArrayFromInterfaceKeys(keyFieldObject);\n\n const parser: KeyParser<Key> = (key) => {\n return keyFields.map((field) => String(key[field])).join(\"_\");\n };\n\n const validator = (key: Key) => {\n for (const field of keyFields) {\n if (!(field in key)) {\n throw new Error(`Missing required key field: ${String(field)}`);\n }\n if (key[field] == null) {\n throw new Error(\n `Key field ${String(field)} cannot be null or undefined`,\n );\n }\n }\n };\n\n return new KeyMap(parser, entries, validator);\n }\n}\n"],"names":["KeyMap","map","keyParser","keyValidator","constructor","parser","entries","validator","Array","isArray","Map","key","value","get","set","has","values","keys","size","clear","delete","createForCompositeKey","keyFieldObject","keyFields","createArrayFromInterfaceKeys","field","String","join","Error"],"mappings":"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"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,14 +0,0 @@
1
- import type { Currency } from "../../../types";
2
- import type { Cents, Dino } from "../types";
3
- /**
4
- * Helper class to distribute a total amount across a quantity of items.
5
- */
6
- export declare class TotalAmountAllocator {
7
- #private;
8
- constructor({ amount, quantity, currency, }: {
9
- quantity: number;
10
- amount: Cents;
11
- currency: Currency;
12
- });
13
- allocate(quantity: number): Dino;
14
- }
@@ -1,35 +0,0 @@
1
- 'use strict';
2
-
3
- var dinero_js = require('dinero.js');
4
- var errors = require('../../errors.js');
5
- var misc = require('../misc.js');
6
- "use strict";
7
- class TotalAmountAllocator {
8
- #remainingAmount;
9
- #remainingQuantity;
10
- #currency;
11
- constructor({
12
- amount,
13
- quantity,
14
- currency
15
- }) {
16
- this.#remainingAmount = misc.getDinero(amount, currency);
17
- this.#remainingQuantity = quantity;
18
- this.#currency = currency;
19
- }
20
- allocate(quantity) {
21
- errors.assert(quantity <= this.#remainingQuantity, "Trying to allocate more quantity than available");
22
- const quantityToAllocate = Math.min(quantity, this.#remainingQuantity);
23
- if (quantityToAllocate === 0) {
24
- return misc.getDinero(0, this.#currency);
25
- }
26
- const [allocated, newRemainingAmount] = dinero_js.allocate(this.#remainingAmount, [quantityToAllocate, this.#remainingQuantity - quantityToAllocate]);
27
- errors.assert(!!allocated, "Couldn't allocate amount");
28
- errors.assert(!!newRemainingAmount, "Couldn't retrieve remaining amount");
29
- this.#remainingAmount = newRemainingAmount;
30
- this.#remainingQuantity -= quantityToAllocate;
31
- return allocated;
32
- }
33
- }
34
- exports.TotalAmountAllocator = TotalAmountAllocator;
35
- //# sourceMappingURL=totalAmount.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"totalAmount.js","sources":["../../../../src/utils/money/allocators/totalAmount.ts"],"sourcesContent":["import { allocate } from \"dinero.js\";\n\nimport type { Currency } from \"../../../types\";\nimport { assert } from \"../../errors\";\nimport { getDinero } from \"../misc\";\nimport type { Cents, Dino } from \"../types\";\n\n/**\n * Helper class to distribute a total amount across a quantity of items.\n */\nexport class TotalAmountAllocator {\n #remainingAmount: Dino;\n #remainingQuantity: number;\n #currency: Currency;\n\n constructor({\n amount,\n quantity,\n currency,\n }: {\n quantity: number;\n amount: Cents;\n currency: Currency;\n }) {\n this.#remainingAmount = getDinero(amount, currency);\n this.#remainingQuantity = quantity;\n this.#currency = currency;\n }\n\n allocate(quantity: number): Dino {\n assert(\n quantity <= this.#remainingQuantity,\n \"Trying to allocate more quantity than available\",\n );\n\n // Normalize quantity to not exceed remaining\n const quantityToAllocate = Math.min(quantity, this.#remainingQuantity);\n\n if (quantityToAllocate === 0) {\n return getDinero(0, this.#currency);\n }\n\n const [allocated, newRemainingAmount] = allocate(this.#remainingAmount, [\n quantityToAllocate,\n this.#remainingQuantity - quantityToAllocate,\n ]);\n\n assert(!!allocated, \"Couldn't allocate amount\");\n assert(!!newRemainingAmount, \"Couldn't retrieve remaining amount\");\n\n // Update remaining amounts\n this.#remainingAmount = newRemainingAmount;\n this.#remainingQuantity -= quantityToAllocate;\n\n return allocated;\n }\n}\n"],"names":["TotalAmountAllocator","remainingAmount","remainingQuantity","currency","constructor","amount","quantity","getDinero","allocate","assert","quantityToAllocate","Math","min","allocated","newRemainingAmount"],"mappings":";;;;;;AAUO,MAAMA,oBAAA,CAAqB;EAChC,CAAAC,eAAA;EACA,CAAAC,iBAAA;EACA,CAAAC,QAAA;EAEAC,WAAAA,CAAY;IACVC,MAAA;IACAC,QAAA;IACAH;EAAA,CACF,EAIG;IACD,IAAA,CAAK,CAAAF,eAAA,GAAmBM,cAAA,CAAUF,MAAA,EAAQF,QAAQ,CAAA;IAClD,IAAA,CAAK,CAAAD,iBAAA,GAAqBI,QAAA;IAC1B,IAAA,CAAK,CAAAH,QAAA,GAAYA,QAAA;EACnB;EAEAK,SAASF,QAAA,EAAwB;IAC/BG,MAAAA,CAAAA,MAAA,CACEH,YAAY,IAAA,CAAK,CAAAJ,iBAAA,EACjB,iDAAA,CACF;IAGA,MAAMQ,kBAAA,GAAqBC,IAAA,CAAKC,GAAA,CAAIN,QAAA,EAAU,KAAK,CAAAJ,iBAAkB,CAAA;IAErE,IAAIQ,uBAAuB,CAAA,EAAG;MAC5B,OAAOH,cAAA,CAAU,CAAA,EAAG,IAAA,CAAK,SAAS,CAAA;IACpC;IAEA,MAAM,CAACM,SAAA,EAAWC,kBAAkB,CAAA,GAAIN,SAAAA,CAAAA,QAAA,CAAS,KAAK,CAAAP,eAAA,EAAkB,CACtES,kBAAA,EACA,KAAK,CAAAR,iBAAA,GAAqBQ,kBAAA,CAC3B,CAAA;IAEDD,aAAA,CAAO,CAAC,CAACI,SAAA,EAAW,0BAA0B,CAAA;IAC9CJ,aAAA,CAAO,CAAC,CAACK,kBAAA,EAAoB,oCAAoC,CAAA;IAGjE,IAAA,CAAK,CAAAb,eAAA,GAAmBa,kBAAA;IACxB,IAAA,CAAK,CAAAZ,iBAAA,IAAsBQ,kBAAA;IAE3B,OAAOG,SAAA;EACT;AACF;"}
@@ -1,33 +0,0 @@
1
- import { allocate } from 'dinero.js';
2
- import { assert } from '../../errors.mjs';
3
- import { getDinero } from '../misc.mjs';
4
- "use strict";
5
- class TotalAmountAllocator {
6
- #remainingAmount;
7
- #remainingQuantity;
8
- #currency;
9
- constructor({
10
- amount,
11
- quantity,
12
- currency
13
- }) {
14
- this.#remainingAmount = getDinero(amount, currency);
15
- this.#remainingQuantity = quantity;
16
- this.#currency = currency;
17
- }
18
- allocate(quantity) {
19
- assert(quantity <= this.#remainingQuantity, "Trying to allocate more quantity than available");
20
- const quantityToAllocate = Math.min(quantity, this.#remainingQuantity);
21
- if (quantityToAllocate === 0) {
22
- return getDinero(0, this.#currency);
23
- }
24
- const [allocated, newRemainingAmount] = allocate(this.#remainingAmount, [quantityToAllocate, this.#remainingQuantity - quantityToAllocate]);
25
- assert(!!allocated, "Couldn't allocate amount");
26
- assert(!!newRemainingAmount, "Couldn't retrieve remaining amount");
27
- this.#remainingAmount = newRemainingAmount;
28
- this.#remainingQuantity -= quantityToAllocate;
29
- return allocated;
30
- }
31
- }
32
- export { TotalAmountAllocator };
33
- //# sourceMappingURL=totalAmount.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"totalAmount.mjs","sources":["../../../../src/utils/money/allocators/totalAmount.ts"],"sourcesContent":["import { allocate } from \"dinero.js\";\n\nimport type { Currency } from \"../../../types\";\nimport { assert } from \"../../errors\";\nimport { getDinero } from \"../misc\";\nimport type { Cents, Dino } from \"../types\";\n\n/**\n * Helper class to distribute a total amount across a quantity of items.\n */\nexport class TotalAmountAllocator {\n #remainingAmount: Dino;\n #remainingQuantity: number;\n #currency: Currency;\n\n constructor({\n amount,\n quantity,\n currency,\n }: {\n quantity: number;\n amount: Cents;\n currency: Currency;\n }) {\n this.#remainingAmount = getDinero(amount, currency);\n this.#remainingQuantity = quantity;\n this.#currency = currency;\n }\n\n allocate(quantity: number): Dino {\n assert(\n quantity <= this.#remainingQuantity,\n \"Trying to allocate more quantity than available\",\n );\n\n // Normalize quantity to not exceed remaining\n const quantityToAllocate = Math.min(quantity, this.#remainingQuantity);\n\n if (quantityToAllocate === 0) {\n return getDinero(0, this.#currency);\n }\n\n const [allocated, newRemainingAmount] = allocate(this.#remainingAmount, [\n quantityToAllocate,\n this.#remainingQuantity - quantityToAllocate,\n ]);\n\n assert(!!allocated, \"Couldn't allocate amount\");\n assert(!!newRemainingAmount, \"Couldn't retrieve remaining amount\");\n\n // Update remaining amounts\n this.#remainingAmount = newRemainingAmount;\n this.#remainingQuantity -= quantityToAllocate;\n\n return allocated;\n }\n}\n"],"names":["TotalAmountAllocator","remainingAmount","remainingQuantity","currency","constructor","amount","quantity","getDinero","allocate","assert","quantityToAllocate","Math","min","allocated","newRemainingAmount"],"mappings":";;;;AAUO,MAAMA,oBAAA,CAAqB;EAChC,CAAAC,eAAA;EACA,CAAAC,iBAAA;EACA,CAAAC,QAAA;EAEAC,WAAAA,CAAY;IACVC,MAAA;IACAC,QAAA;IACAH;EAAA,CACF,EAIG;IACD,IAAA,CAAK,CAAAF,eAAA,GAAmBM,SAAA,CAAUF,MAAA,EAAQF,QAAQ,CAAA;IAClD,IAAA,CAAK,CAAAD,iBAAA,GAAqBI,QAAA;IAC1B,IAAA,CAAK,CAAAH,QAAA,GAAYA,QAAA;EACnB;EAEAK,SAASF,QAAA,EAAwB;IAC/BG,MAAA,CACEH,YAAY,IAAA,CAAK,CAAAJ,iBAAA,EACjB,iDAAA,CACF;IAGA,MAAMQ,kBAAA,GAAqBC,IAAA,CAAKC,GAAA,CAAIN,QAAA,EAAU,KAAK,CAAAJ,iBAAkB,CAAA;IAErE,IAAIQ,uBAAuB,CAAA,EAAG;MAC5B,OAAOH,SAAA,CAAU,CAAA,EAAG,IAAA,CAAK,SAAS,CAAA;IACpC;IAEA,MAAM,CAACM,SAAA,EAAWC,kBAAkB,CAAA,GAAIN,QAAA,CAAS,KAAK,CAAAP,eAAA,EAAkB,CACtES,kBAAA,EACA,KAAK,CAAAR,iBAAA,GAAqBQ,kBAAA,CAC3B,CAAA;IAEDD,MAAA,CAAO,CAAC,CAACI,SAAA,EAAW,0BAA0B,CAAA;IAC9CJ,MAAA,CAAO,CAAC,CAACK,kBAAA,EAAoB,oCAAoC,CAAA;IAGjE,IAAA,CAAK,CAAAb,eAAA,GAAmBa,kBAAA;IACxB,IAAA,CAAK,CAAAZ,iBAAA,IAAsBQ,kBAAA;IAE3B,OAAOG,SAAA;EACT;AACF;"}
@@ -1 +0,0 @@
1
- export {};