@erpsquad/common 1.8.84 → 1.8.86

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 (1328) hide show
  1. package/dist/_virtual/index/index.esm10.js +3 -3
  2. package/dist/_virtual/index/index.esm11.js +2 -4
  3. package/dist/_virtual/index/index.esm11.js.map +1 -1
  4. package/dist/_virtual/index/index.esm3.js +4 -2
  5. package/dist/_virtual/index/index.esm3.js.map +1 -1
  6. package/dist/_virtual/index/index.esm4.js +3 -3
  7. package/dist/_virtual/index/index.esm5.js +3 -3
  8. package/dist/_virtual/index/index.esm6.js +3 -3
  9. package/dist/_virtual/index/index.esm7.js +3 -3
  10. package/dist/_virtual/index/index.esm8.js +3 -3
  11. package/dist/_virtual/index/index.esm9.js +3 -3
  12. package/dist/_virtual/index/index10.js +1 -1
  13. package/dist/_virtual/index/index11.js +1 -1
  14. package/dist/_virtual/index/index3.js +1 -1
  15. package/dist/_virtual/index/index4.js +1 -1
  16. package/dist/_virtual/index/index5.js +1 -1
  17. package/dist/_virtual/index/index6.js +1 -1
  18. package/dist/_virtual/index/index7.js +1 -1
  19. package/dist/_virtual/index/index8.js +1 -1
  20. package/dist/_virtual/index/index9.js +1 -1
  21. package/dist/components/accordion/accordion.d.ts +1 -1
  22. package/dist/components/action-bar/action-bar/index.esm.js +11 -9
  23. package/dist/components/action-bar/action-bar/index.esm.js.map +1 -1
  24. package/dist/components/action-bar/action-bar/index.js +24 -24
  25. package/dist/components/action-bar/action-bar/index.js.map +1 -1
  26. package/dist/components/action-bar/action-bar.d.ts +1 -1
  27. package/dist/components/checkbox/checkbox.d.ts +1 -1
  28. package/dist/components/date-picker/date-picker.d.ts +1 -1
  29. package/dist/components/editor/custom-editor/index.esm.js +3 -1
  30. package/dist/components/editor/custom-editor/index.esm.js.map +1 -1
  31. package/dist/components/editor/custom-editor/index.js +2 -2
  32. package/dist/components/editor/custom-editor/index.js.map +1 -1
  33. package/dist/components/filter/components/delete-group/index.esm.js +0 -1
  34. package/dist/components/filter/components/delete-group/index.esm.js.map +1 -1
  35. package/dist/components/filter/components/delete-group/index.js +1 -1
  36. package/dist/components/filter/components/delete-group/index.js.map +1 -1
  37. package/dist/components/filter/filter/index.esm.js +9 -7
  38. package/dist/components/filter/filter/index.esm.js.map +1 -1
  39. package/dist/components/filter/filter/index.js +21 -21
  40. package/dist/components/filter/filter/index.js.map +1 -1
  41. package/dist/components/footer/footer.d.ts +1 -1
  42. package/dist/components/form-control/form-builder/form-builder-element/dynamic-select/index.esm.js +0 -3
  43. package/dist/components/form-control/form-builder/form-builder-element/dynamic-select/index.esm.js.map +1 -1
  44. package/dist/components/form-control/form-builder/form-builder-element/dynamic-select/index.js +2 -2
  45. package/dist/components/form-control/form-builder/form-builder-element/dynamic-select/index.js.map +1 -1
  46. package/dist/components/form-control/form-builder/form-builder-element/media.d.ts +1 -1
  47. package/dist/components/form-control/form-builder/form-builder-element/phone.d.ts +1 -1
  48. package/dist/components/form-control/form-builder/form-builder-element/select.d.ts +1 -1
  49. package/dist/components/form-control/form-builder/form-builder-element/text.d.ts +1 -1
  50. package/dist/components/form-control/form-builder/form-builder-element/time.d.ts +1 -1
  51. package/dist/components/form-control/form-parser/form-switcher.d.ts +1 -1
  52. package/dist/components/header/header/index.esm.js +3 -1
  53. package/dist/components/header/header/index.esm.js.map +1 -1
  54. package/dist/components/header/header/index.js +21 -21
  55. package/dist/components/header/header/index.js.map +1 -1
  56. package/dist/components/header/redux/actionCreator/index.esm.js +2 -1
  57. package/dist/components/header/redux/actionCreator/index.esm.js.map +1 -1
  58. package/dist/components/header/redux/actionCreator/index.js +1 -1
  59. package/dist/components/header/redux/actionCreator/index.js.map +1 -1
  60. package/dist/components/icons/action-arrow.d.ts +3 -3
  61. package/dist/components/icons/add-circle.d.ts +3 -3
  62. package/dist/components/icons/arrow-bidirectional.d.ts +3 -3
  63. package/dist/components/icons/arrow-circle-down.d.ts +3 -3
  64. package/dist/components/icons/arrow-down-three.d.ts +3 -3
  65. package/dist/components/icons/arrow-down-two.d.ts +3 -3
  66. package/dist/components/icons/arrow-down.d.ts +3 -3
  67. package/dist/components/icons/arrow-up-down.d.ts +3 -3
  68. package/dist/components/icons/arrow-up-two.d.ts +3 -3
  69. package/dist/components/icons/assignments.d.ts +3 -3
  70. package/dist/components/icons/blank-circle.d.ts +3 -3
  71. package/dist/components/icons/block-filled.d.ts +3 -3
  72. package/dist/components/icons/calendar-add.d.ts +3 -3
  73. package/dist/components/icons/calendar.d.ts +3 -3
  74. package/dist/components/icons/checkbox-square.d.ts +3 -3
  75. package/dist/components/icons/circular-arrow-setting.d.ts +3 -3
  76. package/dist/components/icons/clock.d.ts +3 -3
  77. package/dist/components/icons/close.d.ts +3 -3
  78. package/dist/components/icons/coin-outline.d.ts +3 -3
  79. package/dist/components/icons/copy.d.ts +3 -3
  80. package/dist/components/icons/coupon.d.ts +3 -3
  81. package/dist/components/icons/cross-hire.d.ts +3 -3
  82. package/dist/components/icons/custom-styled-icon.d.ts +3 -3
  83. package/dist/components/icons/dashboard.d.ts +3 -3
  84. package/dist/components/icons/document-download.d.ts +3 -3
  85. package/dist/components/icons/document.d.ts +3 -3
  86. package/dist/components/icons/dollar-circle-filled.d.ts +3 -3
  87. package/dist/components/icons/dollar-circle.d.ts +3 -3
  88. package/dist/components/icons/edit.d.ts +3 -3
  89. package/dist/components/icons/email.d.ts +3 -3
  90. package/dist/components/icons/export.d.ts +3 -3
  91. package/dist/components/icons/eye-off.d.ts +3 -3
  92. package/dist/components/icons/eye-plus-circle.d.ts +3 -3
  93. package/dist/components/icons/eye.d.ts +3 -3
  94. package/dist/components/icons/filled-circle.d.ts +3 -3
  95. package/dist/components/icons/filter-remove.d.ts +3 -3
  96. package/dist/components/icons/filter.d.ts +3 -3
  97. package/dist/components/icons/folder-save.d.ts +3 -3
  98. package/dist/components/icons/grid.d.ts +3 -3
  99. package/dist/components/icons/hashtag.d.ts +3 -3
  100. package/dist/components/icons/image.d.ts +3 -3
  101. package/dist/components/icons/import.d.ts +3 -3
  102. package/dist/components/icons/info-circle.d.ts +3 -3
  103. package/dist/components/icons/info.d.ts +3 -3
  104. package/dist/components/icons/link-horizontal.d.ts +3 -3
  105. package/dist/components/icons/link.d.ts +3 -3
  106. package/dist/components/icons/location.d.ts +3 -3
  107. package/dist/components/icons/lowest-lead-time.d.ts +3 -3
  108. package/dist/components/icons/lowest-min-qty.d.ts +3 -3
  109. package/dist/components/icons/lowest-price.d.ts +3 -3
  110. package/dist/components/icons/more.d.ts +3 -3
  111. package/dist/components/icons/notification.d.ts +3 -3
  112. package/dist/components/icons/paper-clip.d.ts +3 -3
  113. package/dist/components/icons/paragraph.d.ts +3 -3
  114. package/dist/components/icons/payment-request.d.ts +3 -3
  115. package/dist/components/icons/phone.d.ts +3 -3
  116. package/dist/components/icons/printer.d.ts +3 -3
  117. package/dist/components/icons/process-calendar.d.ts +3 -3
  118. package/dist/components/icons/promotion.d.ts +3 -3
  119. package/dist/components/icons/radio-button.d.ts +3 -3
  120. package/dist/components/icons/receipt-filled.d.ts +3 -3
  121. package/dist/components/icons/receipt-outline.d.ts +3 -3
  122. package/dist/components/icons/receipt.d.ts +3 -3
  123. package/dist/components/icons/refresh-icon.d.ts +3 -3
  124. package/dist/components/icons/replace.d.ts +3 -3
  125. package/dist/components/icons/save.d.ts +3 -3
  126. package/dist/components/icons/search-status.d.ts +3 -3
  127. package/dist/components/icons/search.d.ts +3 -3
  128. package/dist/components/icons/settings-fallback.d.ts +3 -3
  129. package/dist/components/icons/sort-arrow-icon.d.ts +3 -3
  130. package/dist/components/icons/stacked-layer.d.ts +3 -3
  131. package/dist/components/icons/start-filled.d.ts +3 -3
  132. package/dist/components/icons/three-dot-icon.d.ts +3 -3
  133. package/dist/components/icons/tick-circle-filled.d.ts +3 -3
  134. package/dist/components/icons/tick-circle.d.ts +3 -3
  135. package/dist/components/icons/tick-octagon.d.ts +3 -3
  136. package/dist/components/icons/tick.d.ts +3 -3
  137. package/dist/components/icons/toggle-switch.d.ts +3 -3
  138. package/dist/components/icons/trash.d.ts +3 -3
  139. package/dist/components/icons/wave.d.ts +3 -3
  140. package/dist/components/icons/with-out-tick-octagon.d.ts +3 -3
  141. package/dist/components/icons/work-centre.d.ts +3 -3
  142. package/dist/components/index.esm.js +13 -13
  143. package/dist/components/index.js +1 -1
  144. package/dist/components/inventory-reports-title-bar/redux/actionCreator/index.esm.js +2 -1
  145. package/dist/components/inventory-reports-title-bar/redux/actionCreator/index.esm.js.map +1 -1
  146. package/dist/components/inventory-reports-title-bar/redux/actionCreator/index.js +1 -1
  147. package/dist/components/inventory-reports-title-bar/redux/actionCreator/index.js.map +1 -1
  148. package/dist/components/location-select.d.ts +1 -1
  149. package/dist/components/material-editable-table/material-editable-table.d.ts +1 -1
  150. package/dist/components/material-table/material-table.d.ts +1 -1
  151. package/dist/components/phone-input/phone-input.d.ts +1 -1
  152. package/dist/components/providers/ERPUIProvider/index.esm.js +15 -1
  153. package/dist/components/providers/ERPUIProvider/index.esm.js.map +1 -1
  154. package/dist/components/providers/ERPUIProvider/index.js +1 -1
  155. package/dist/components/providers/ERPUIProvider/index.js.map +1 -1
  156. package/dist/components/providers/ERPUIProvider.d.ts +2 -0
  157. package/dist/components/radio/radio.d.ts +1 -1
  158. package/dist/components/reports-title-bar/redux/actionCreator/index.esm.js +2 -1
  159. package/dist/components/reports-title-bar/redux/actionCreator/index.esm.js.map +1 -1
  160. package/dist/components/reports-title-bar/redux/actionCreator/index.js +1 -1
  161. package/dist/components/reports-title-bar/redux/actionCreator/index.js.map +1 -1
  162. package/dist/components/select/select.d.ts +1 -1
  163. package/dist/components/share-modal/redux/actionCreator/index.esm.js +2 -1
  164. package/dist/components/share-modal/redux/actionCreator/index.esm.js.map +1 -1
  165. package/dist/components/share-modal/redux/actionCreator/index.js +1 -1
  166. package/dist/components/share-modal/redux/actionCreator/index.js.map +1 -1
  167. package/dist/components/switches/android-12-switch.d.ts +3 -1
  168. package/dist/components/text-field/text-field.d.ts +1 -1
  169. package/dist/components/time-picker/time-picker.d.ts +1 -1
  170. package/dist/components/upload/upload/index.esm.js +3 -2
  171. package/dist/components/upload/upload/index.esm.js.map +1 -1
  172. package/dist/components/upload/upload/index.js +29 -29
  173. package/dist/components/upload/upload/index.js.map +1 -1
  174. package/dist/components/upload-media/upload-media.d.ts +1 -1
  175. package/dist/contexts/AuthContext/index.esm.js +4 -3
  176. package/dist/contexts/AuthContext/index.esm.js.map +1 -1
  177. package/dist/contexts/AuthContext/index.js +2 -2
  178. package/dist/contexts/AuthContext/index.js.map +1 -1
  179. package/dist/contexts/languageContext/index.esm.js +2 -1
  180. package/dist/contexts/languageContext/index.esm.js.map +1 -1
  181. package/dist/contexts/languageContext/index.js +2 -2
  182. package/dist/contexts/languageContext/index.js.map +1 -1
  183. package/dist/hooks/use-material-calculations/index.esm.js +1 -2
  184. package/dist/hooks/use-material-calculations/index.esm.js.map +1 -1
  185. package/dist/hooks/use-material-calculations/index.js +1 -1
  186. package/dist/hooks/use-material-calculations/index.js.map +1 -1
  187. package/dist/hooks/useLangauge/index.esm.js +1 -2
  188. package/dist/hooks/useLangauge/index.esm.js.map +1 -1
  189. package/dist/hooks/useLangauge/index.js +1 -1
  190. package/dist/hooks/useLangauge/index.js.map +1 -1
  191. package/dist/index.esm.js +20 -14
  192. package/dist/index.esm.js.map +1 -1
  193. package/dist/index.js +1 -1
  194. package/dist/node_modules/@asseinfo/react-kanban/dist/index/index.esm.js +1 -1
  195. package/dist/node_modules/@asseinfo/react-kanban/dist/index/index.js +1 -1
  196. package/dist/node_modules/@asseinfo/react-kanban/dist/index/index.js.map +1 -1
  197. package/dist/node_modules/@hookform/resolvers/yup/dist/yup/index.esm.js +14 -15
  198. package/dist/node_modules/@hookform/resolvers/yup/dist/yup/index.esm.js.map +1 -1
  199. package/dist/node_modules/@hookform/resolvers/yup/dist/yup/index.js +1 -1
  200. package/dist/node_modules/@hookform/resolvers/yup/dist/yup/index.js.map +1 -1
  201. package/dist/node_modules/@mui/base/TextareaAutosize/TextareaAutosize/index.esm.js +2 -3
  202. package/dist/node_modules/@mui/base/TextareaAutosize/TextareaAutosize/index.esm.js.map +1 -1
  203. package/dist/node_modules/@mui/base/TextareaAutosize/TextareaAutosize/index.js +1 -1
  204. package/dist/node_modules/@mui/base/TextareaAutosize/TextareaAutosize/index.js.map +1 -1
  205. package/dist/node_modules/@mui/lab/TabContext/TabContext/index.esm.js +2 -3
  206. package/dist/node_modules/@mui/lab/TabContext/TabContext/index.esm.js.map +1 -1
  207. package/dist/node_modules/@mui/lab/TabContext/TabContext/index.js +2 -2
  208. package/dist/node_modules/@mui/lab/TabContext/TabContext/index.js.map +1 -1
  209. package/dist/node_modules/@mui/lab/TabList/TabList/index.esm.js +1 -2
  210. package/dist/node_modules/@mui/lab/TabList/TabList/index.esm.js.map +1 -1
  211. package/dist/node_modules/@mui/lab/TabList/TabList/index.js +1 -1
  212. package/dist/node_modules/@mui/lab/TabList/TabList/index.js.map +1 -1
  213. package/dist/node_modules/@mui/lab/TabPanel/TabPanel/index.esm.js +1 -2
  214. package/dist/node_modules/@mui/lab/TabPanel/TabPanel/index.esm.js.map +1 -1
  215. package/dist/node_modules/@mui/lab/TabPanel/TabPanel/index.js +2 -2
  216. package/dist/node_modules/@mui/lab/TabPanel/TabPanel/index.js.map +1 -1
  217. package/dist/node_modules/@mui/lab/Timeline/Timeline/index.esm.js +1 -2
  218. package/dist/node_modules/@mui/lab/Timeline/Timeline/index.esm.js.map +1 -1
  219. package/dist/node_modules/@mui/lab/Timeline/Timeline/index.js +2 -2
  220. package/dist/node_modules/@mui/lab/Timeline/Timeline/index.js.map +1 -1
  221. package/dist/node_modules/@mui/lab/Timeline/TimelineContext/index.esm.js +1 -2
  222. package/dist/node_modules/@mui/lab/Timeline/TimelineContext/index.esm.js.map +1 -1
  223. package/dist/node_modules/@mui/lab/Timeline/TimelineContext/index.js +1 -1
  224. package/dist/node_modules/@mui/lab/Timeline/TimelineContext/index.js.map +1 -1
  225. package/dist/node_modules/@mui/lab/TimelineConnector/TimelineConnector/index.esm.js +1 -2
  226. package/dist/node_modules/@mui/lab/TimelineConnector/TimelineConnector/index.esm.js.map +1 -1
  227. package/dist/node_modules/@mui/lab/TimelineConnector/TimelineConnector/index.js +2 -2
  228. package/dist/node_modules/@mui/lab/TimelineConnector/TimelineConnector/index.js.map +1 -1
  229. package/dist/node_modules/@mui/lab/TimelineContent/TimelineContent/index.esm.js +1 -2
  230. package/dist/node_modules/@mui/lab/TimelineContent/TimelineContent/index.esm.js.map +1 -1
  231. package/dist/node_modules/@mui/lab/TimelineContent/TimelineContent/index.js +1 -1
  232. package/dist/node_modules/@mui/lab/TimelineContent/TimelineContent/index.js.map +1 -1
  233. package/dist/node_modules/@mui/lab/TimelineDot/TimelineDot/index.esm.js +1 -2
  234. package/dist/node_modules/@mui/lab/TimelineDot/TimelineDot/index.esm.js.map +1 -1
  235. package/dist/node_modules/@mui/lab/TimelineDot/TimelineDot/index.js +2 -2
  236. package/dist/node_modules/@mui/lab/TimelineDot/TimelineDot/index.js.map +1 -1
  237. package/dist/node_modules/@mui/lab/TimelineItem/TimelineItem/index.esm.js +1 -2
  238. package/dist/node_modules/@mui/lab/TimelineItem/TimelineItem/index.esm.js.map +1 -1
  239. package/dist/node_modules/@mui/lab/TimelineItem/TimelineItem/index.js +2 -2
  240. package/dist/node_modules/@mui/lab/TimelineItem/TimelineItem/index.js.map +1 -1
  241. package/dist/node_modules/@mui/lab/TimelineSeparator/TimelineSeparator/index.esm.js +1 -2
  242. package/dist/node_modules/@mui/lab/TimelineSeparator/TimelineSeparator/index.esm.js.map +1 -1
  243. package/dist/node_modules/@mui/lab/TimelineSeparator/TimelineSeparator/index.js +2 -2
  244. package/dist/node_modules/@mui/lab/TimelineSeparator/TimelineSeparator/index.js.map +1 -1
  245. package/dist/node_modules/@mui/material/Accordion/Accordion/index.esm.js +1 -2
  246. package/dist/node_modules/@mui/material/Accordion/Accordion/index.esm.js.map +1 -1
  247. package/dist/node_modules/@mui/material/Accordion/Accordion/index.js +2 -2
  248. package/dist/node_modules/@mui/material/Accordion/Accordion/index.js.map +1 -1
  249. package/dist/node_modules/@mui/material/Accordion/AccordionContext/index.esm.js +1 -2
  250. package/dist/node_modules/@mui/material/Accordion/AccordionContext/index.esm.js.map +1 -1
  251. package/dist/node_modules/@mui/material/Accordion/AccordionContext/index.js +1 -1
  252. package/dist/node_modules/@mui/material/Accordion/AccordionContext/index.js.map +1 -1
  253. package/dist/node_modules/@mui/material/AccordionActions/AccordionActions/index.esm.js +1 -2
  254. package/dist/node_modules/@mui/material/AccordionActions/AccordionActions/index.esm.js.map +1 -1
  255. package/dist/node_modules/@mui/material/AccordionActions/AccordionActions/index.js +1 -1
  256. package/dist/node_modules/@mui/material/AccordionActions/AccordionActions/index.js.map +1 -1
  257. package/dist/node_modules/@mui/material/AccordionDetails/AccordionDetails/index.esm.js +1 -2
  258. package/dist/node_modules/@mui/material/AccordionDetails/AccordionDetails/index.esm.js.map +1 -1
  259. package/dist/node_modules/@mui/material/AccordionDetails/AccordionDetails/index.js +2 -2
  260. package/dist/node_modules/@mui/material/AccordionDetails/AccordionDetails/index.js.map +1 -1
  261. package/dist/node_modules/@mui/material/AccordionSummary/AccordionSummary/index.esm.js +1 -2
  262. package/dist/node_modules/@mui/material/AccordionSummary/AccordionSummary/index.esm.js.map +1 -1
  263. package/dist/node_modules/@mui/material/AccordionSummary/AccordionSummary/index.js +2 -2
  264. package/dist/node_modules/@mui/material/AccordionSummary/AccordionSummary/index.js.map +1 -1
  265. package/dist/node_modules/@mui/material/Alert/Alert/index.esm.js +1 -2
  266. package/dist/node_modules/@mui/material/Alert/Alert/index.esm.js.map +1 -1
  267. package/dist/node_modules/@mui/material/Alert/Alert/index.js +1 -1
  268. package/dist/node_modules/@mui/material/Alert/Alert/index.js.map +1 -1
  269. package/dist/node_modules/@mui/material/AlertTitle/AlertTitle/index.esm.js +1 -2
  270. package/dist/node_modules/@mui/material/AlertTitle/AlertTitle/index.esm.js.map +1 -1
  271. package/dist/node_modules/@mui/material/AlertTitle/AlertTitle/index.js +1 -1
  272. package/dist/node_modules/@mui/material/AlertTitle/AlertTitle/index.js.map +1 -1
  273. package/dist/node_modules/@mui/material/AppBar/AppBar/index.esm.js +1 -2
  274. package/dist/node_modules/@mui/material/AppBar/AppBar/index.esm.js.map +1 -1
  275. package/dist/node_modules/@mui/material/AppBar/AppBar/index.js +1 -1
  276. package/dist/node_modules/@mui/material/AppBar/AppBar/index.js.map +1 -1
  277. package/dist/node_modules/@mui/material/Autocomplete/Autocomplete/index.esm.js +1 -2
  278. package/dist/node_modules/@mui/material/Autocomplete/Autocomplete/index.esm.js.map +1 -1
  279. package/dist/node_modules/@mui/material/Autocomplete/Autocomplete/index.js +1 -1
  280. package/dist/node_modules/@mui/material/Autocomplete/Autocomplete/index.js.map +1 -1
  281. package/dist/node_modules/@mui/material/Avatar/Avatar/index.esm.js +1 -2
  282. package/dist/node_modules/@mui/material/Avatar/Avatar/index.esm.js.map +1 -1
  283. package/dist/node_modules/@mui/material/Avatar/Avatar/index.js +1 -1
  284. package/dist/node_modules/@mui/material/Avatar/Avatar/index.js.map +1 -1
  285. package/dist/node_modules/@mui/material/AvatarGroup/AvatarGroup/index.esm.js +2 -3
  286. package/dist/node_modules/@mui/material/AvatarGroup/AvatarGroup/index.esm.js.map +1 -1
  287. package/dist/node_modules/@mui/material/AvatarGroup/AvatarGroup/index.js +2 -2
  288. package/dist/node_modules/@mui/material/AvatarGroup/AvatarGroup/index.js.map +1 -1
  289. package/dist/node_modules/@mui/material/Backdrop/Backdrop/index.esm.js +1 -2
  290. package/dist/node_modules/@mui/material/Backdrop/Backdrop/index.esm.js.map +1 -1
  291. package/dist/node_modules/@mui/material/Backdrop/Backdrop/index.js +1 -1
  292. package/dist/node_modules/@mui/material/Backdrop/Backdrop/index.js.map +1 -1
  293. package/dist/node_modules/@mui/material/Badge/Badge/index.esm.js +1 -2
  294. package/dist/node_modules/@mui/material/Badge/Badge/index.esm.js.map +1 -1
  295. package/dist/node_modules/@mui/material/Badge/Badge/index.js +1 -1
  296. package/dist/node_modules/@mui/material/Badge/Badge/index.js.map +1 -1
  297. package/dist/node_modules/@mui/material/BottomNavigation/BottomNavigation/index.esm.js +2 -3
  298. package/dist/node_modules/@mui/material/BottomNavigation/BottomNavigation/index.esm.js.map +1 -1
  299. package/dist/node_modules/@mui/material/BottomNavigation/BottomNavigation/index.js +3 -3
  300. package/dist/node_modules/@mui/material/BottomNavigation/BottomNavigation/index.js.map +1 -1
  301. package/dist/node_modules/@mui/material/BottomNavigationAction/BottomNavigationAction/index.esm.js +1 -2
  302. package/dist/node_modules/@mui/material/BottomNavigationAction/BottomNavigationAction/index.esm.js.map +1 -1
  303. package/dist/node_modules/@mui/material/BottomNavigationAction/BottomNavigationAction/index.js +2 -2
  304. package/dist/node_modules/@mui/material/BottomNavigationAction/BottomNavigationAction/index.js.map +1 -1
  305. package/dist/node_modules/@mui/material/Box/Box/index.esm.js +1 -2
  306. package/dist/node_modules/@mui/material/Box/Box/index.esm.js.map +1 -1
  307. package/dist/node_modules/@mui/material/Box/Box/index.js +1 -1
  308. package/dist/node_modules/@mui/material/Box/Box/index.js.map +1 -1
  309. package/dist/node_modules/@mui/material/Breadcrumbs/BreadcrumbCollapsed/index.esm.js +1 -2
  310. package/dist/node_modules/@mui/material/Breadcrumbs/BreadcrumbCollapsed/index.esm.js.map +1 -1
  311. package/dist/node_modules/@mui/material/Breadcrumbs/BreadcrumbCollapsed/index.js +2 -2
  312. package/dist/node_modules/@mui/material/Breadcrumbs/BreadcrumbCollapsed/index.js.map +1 -1
  313. package/dist/node_modules/@mui/material/Breadcrumbs/Breadcrumbs/index.esm.js +3 -4
  314. package/dist/node_modules/@mui/material/Breadcrumbs/Breadcrumbs/index.esm.js.map +1 -1
  315. package/dist/node_modules/@mui/material/Breadcrumbs/Breadcrumbs/index.js +2 -2
  316. package/dist/node_modules/@mui/material/Breadcrumbs/Breadcrumbs/index.js.map +1 -1
  317. package/dist/node_modules/@mui/material/Button/Button/index.esm.js +1 -2
  318. package/dist/node_modules/@mui/material/Button/Button/index.esm.js.map +1 -1
  319. package/dist/node_modules/@mui/material/Button/Button/index.js +1 -1
  320. package/dist/node_modules/@mui/material/Button/Button/index.js.map +1 -1
  321. package/dist/node_modules/@mui/material/ButtonBase/ButtonBase/index.esm.js +2 -3
  322. package/dist/node_modules/@mui/material/ButtonBase/ButtonBase/index.esm.js.map +1 -1
  323. package/dist/node_modules/@mui/material/ButtonBase/ButtonBase/index.js +3 -3
  324. package/dist/node_modules/@mui/material/ButtonBase/ButtonBase/index.js.map +1 -1
  325. package/dist/node_modules/@mui/material/ButtonBase/Ripple/index.esm.js +1 -2
  326. package/dist/node_modules/@mui/material/ButtonBase/Ripple/index.esm.js.map +1 -1
  327. package/dist/node_modules/@mui/material/ButtonBase/Ripple/index.js +1 -1
  328. package/dist/node_modules/@mui/material/ButtonBase/Ripple/index.js.map +1 -1
  329. package/dist/node_modules/@mui/material/ButtonBase/TouchRipple/index.esm.js +1 -2
  330. package/dist/node_modules/@mui/material/ButtonBase/TouchRipple/index.esm.js.map +1 -1
  331. package/dist/node_modules/@mui/material/ButtonBase/TouchRipple/index.js +1 -1
  332. package/dist/node_modules/@mui/material/ButtonBase/TouchRipple/index.js.map +1 -1
  333. package/dist/node_modules/@mui/material/ButtonGroup/ButtonGroup/index.esm.js +1 -2
  334. package/dist/node_modules/@mui/material/ButtonGroup/ButtonGroup/index.esm.js.map +1 -1
  335. package/dist/node_modules/@mui/material/ButtonGroup/ButtonGroup/index.js +1 -1
  336. package/dist/node_modules/@mui/material/ButtonGroup/ButtonGroup/index.js.map +1 -1
  337. package/dist/node_modules/@mui/material/ButtonGroup/ButtonGroupButtonContext/index.esm.js +1 -2
  338. package/dist/node_modules/@mui/material/ButtonGroup/ButtonGroupButtonContext/index.esm.js.map +1 -1
  339. package/dist/node_modules/@mui/material/ButtonGroup/ButtonGroupButtonContext/index.js +1 -1
  340. package/dist/node_modules/@mui/material/ButtonGroup/ButtonGroupButtonContext/index.js.map +1 -1
  341. package/dist/node_modules/@mui/material/ButtonGroup/ButtonGroupContext/index.esm.js +1 -2
  342. package/dist/node_modules/@mui/material/ButtonGroup/ButtonGroupContext/index.esm.js.map +1 -1
  343. package/dist/node_modules/@mui/material/ButtonGroup/ButtonGroupContext/index.js +1 -1
  344. package/dist/node_modules/@mui/material/ButtonGroup/ButtonGroupContext/index.js.map +1 -1
  345. package/dist/node_modules/@mui/material/Card/Card/index.esm.js +1 -2
  346. package/dist/node_modules/@mui/material/Card/Card/index.esm.js.map +1 -1
  347. package/dist/node_modules/@mui/material/Card/Card/index.js +1 -1
  348. package/dist/node_modules/@mui/material/Card/Card/index.js.map +1 -1
  349. package/dist/node_modules/@mui/material/CardActionArea/CardActionArea/index.esm.js +1 -2
  350. package/dist/node_modules/@mui/material/CardActionArea/CardActionArea/index.esm.js.map +1 -1
  351. package/dist/node_modules/@mui/material/CardActionArea/CardActionArea/index.js +2 -2
  352. package/dist/node_modules/@mui/material/CardActionArea/CardActionArea/index.js.map +1 -1
  353. package/dist/node_modules/@mui/material/CardActions/CardActions/index.esm.js +1 -2
  354. package/dist/node_modules/@mui/material/CardActions/CardActions/index.esm.js.map +1 -1
  355. package/dist/node_modules/@mui/material/CardActions/CardActions/index.js +2 -2
  356. package/dist/node_modules/@mui/material/CardActions/CardActions/index.js.map +1 -1
  357. package/dist/node_modules/@mui/material/CardContent/CardContent/index.esm.js +1 -2
  358. package/dist/node_modules/@mui/material/CardContent/CardContent/index.esm.js.map +1 -1
  359. package/dist/node_modules/@mui/material/CardContent/CardContent/index.js +1 -1
  360. package/dist/node_modules/@mui/material/CardContent/CardContent/index.js.map +1 -1
  361. package/dist/node_modules/@mui/material/CardHeader/CardHeader/index.esm.js +1 -2
  362. package/dist/node_modules/@mui/material/CardHeader/CardHeader/index.esm.js.map +1 -1
  363. package/dist/node_modules/@mui/material/CardHeader/CardHeader/index.js +1 -1
  364. package/dist/node_modules/@mui/material/CardHeader/CardHeader/index.js.map +1 -1
  365. package/dist/node_modules/@mui/material/CardMedia/CardMedia/index.esm.js +1 -2
  366. package/dist/node_modules/@mui/material/CardMedia/CardMedia/index.esm.js.map +1 -1
  367. package/dist/node_modules/@mui/material/CardMedia/CardMedia/index.js +2 -2
  368. package/dist/node_modules/@mui/material/CardMedia/CardMedia/index.js.map +1 -1
  369. package/dist/node_modules/@mui/material/Checkbox/Checkbox/index.esm.js +1 -2
  370. package/dist/node_modules/@mui/material/Checkbox/Checkbox/index.esm.js.map +1 -1
  371. package/dist/node_modules/@mui/material/Checkbox/Checkbox/index.js +1 -1
  372. package/dist/node_modules/@mui/material/Checkbox/Checkbox/index.js.map +1 -1
  373. package/dist/node_modules/@mui/material/Chip/Chip/index.esm.js +2 -3
  374. package/dist/node_modules/@mui/material/Chip/Chip/index.esm.js.map +1 -1
  375. package/dist/node_modules/@mui/material/Chip/Chip/index.js +1 -1
  376. package/dist/node_modules/@mui/material/Chip/Chip/index.js.map +1 -1
  377. package/dist/node_modules/@mui/material/CircularProgress/CircularProgress/index.esm.js +1 -2
  378. package/dist/node_modules/@mui/material/CircularProgress/CircularProgress/index.esm.js.map +1 -1
  379. package/dist/node_modules/@mui/material/CircularProgress/CircularProgress/index.js +6 -6
  380. package/dist/node_modules/@mui/material/CircularProgress/CircularProgress/index.js.map +1 -1
  381. package/dist/node_modules/@mui/material/ClickAwayListener/ClickAwayListener/index.esm.js +2 -3
  382. package/dist/node_modules/@mui/material/ClickAwayListener/ClickAwayListener/index.esm.js.map +1 -1
  383. package/dist/node_modules/@mui/material/ClickAwayListener/ClickAwayListener/index.js +1 -1
  384. package/dist/node_modules/@mui/material/ClickAwayListener/ClickAwayListener/index.js.map +1 -1
  385. package/dist/node_modules/@mui/material/Collapse/Collapse/index.esm.js +1 -2
  386. package/dist/node_modules/@mui/material/Collapse/Collapse/index.esm.js.map +1 -1
  387. package/dist/node_modules/@mui/material/Collapse/Collapse/index.js +1 -1
  388. package/dist/node_modules/@mui/material/Collapse/Collapse/index.js.map +1 -1
  389. package/dist/node_modules/@mui/material/Container/Container/index.esm.js +1 -2
  390. package/dist/node_modules/@mui/material/Container/Container/index.esm.js.map +1 -1
  391. package/dist/node_modules/@mui/material/Container/Container/index.js +1 -1
  392. package/dist/node_modules/@mui/material/Container/Container/index.js.map +1 -1
  393. package/dist/node_modules/@mui/material/CssBaseline/CssBaseline/index.esm.js +1 -2
  394. package/dist/node_modules/@mui/material/CssBaseline/CssBaseline/index.esm.js.map +1 -1
  395. package/dist/node_modules/@mui/material/CssBaseline/CssBaseline/index.js +2 -2
  396. package/dist/node_modules/@mui/material/CssBaseline/CssBaseline/index.js.map +1 -1
  397. package/dist/node_modules/@mui/material/Dialog/Dialog/index.esm.js +1 -2
  398. package/dist/node_modules/@mui/material/Dialog/Dialog/index.esm.js.map +1 -1
  399. package/dist/node_modules/@mui/material/Dialog/Dialog/index.js +1 -1
  400. package/dist/node_modules/@mui/material/Dialog/Dialog/index.js.map +1 -1
  401. package/dist/node_modules/@mui/material/Dialog/DialogContext/index.esm.js +1 -2
  402. package/dist/node_modules/@mui/material/Dialog/DialogContext/index.esm.js.map +1 -1
  403. package/dist/node_modules/@mui/material/Dialog/DialogContext/index.js +1 -1
  404. package/dist/node_modules/@mui/material/Dialog/DialogContext/index.js.map +1 -1
  405. package/dist/node_modules/@mui/material/DialogActions/DialogActions/index.esm.js +1 -2
  406. package/dist/node_modules/@mui/material/DialogActions/DialogActions/index.esm.js.map +1 -1
  407. package/dist/node_modules/@mui/material/DialogActions/DialogActions/index.js +1 -1
  408. package/dist/node_modules/@mui/material/DialogActions/DialogActions/index.js.map +1 -1
  409. package/dist/node_modules/@mui/material/DialogContent/DialogContent/index.esm.js +1 -2
  410. package/dist/node_modules/@mui/material/DialogContent/DialogContent/index.esm.js.map +1 -1
  411. package/dist/node_modules/@mui/material/DialogContent/DialogContent/index.js +2 -2
  412. package/dist/node_modules/@mui/material/DialogContent/DialogContent/index.js.map +1 -1
  413. package/dist/node_modules/@mui/material/DialogContentText/DialogContentText/index.esm.js +1 -2
  414. package/dist/node_modules/@mui/material/DialogContentText/DialogContentText/index.esm.js.map +1 -1
  415. package/dist/node_modules/@mui/material/DialogContentText/DialogContentText/index.js +1 -1
  416. package/dist/node_modules/@mui/material/DialogContentText/DialogContentText/index.js.map +1 -1
  417. package/dist/node_modules/@mui/material/DialogTitle/DialogTitle/index.esm.js +1 -2
  418. package/dist/node_modules/@mui/material/DialogTitle/DialogTitle/index.esm.js.map +1 -1
  419. package/dist/node_modules/@mui/material/DialogTitle/DialogTitle/index.js +1 -1
  420. package/dist/node_modules/@mui/material/DialogTitle/DialogTitle/index.js.map +1 -1
  421. package/dist/node_modules/@mui/material/Divider/Divider/index.esm.js +1 -2
  422. package/dist/node_modules/@mui/material/Divider/Divider/index.esm.js.map +1 -1
  423. package/dist/node_modules/@mui/material/Divider/Divider/index.js +1 -1
  424. package/dist/node_modules/@mui/material/Divider/Divider/index.js.map +1 -1
  425. package/dist/node_modules/@mui/material/Drawer/Drawer/index.esm.js +1 -2
  426. package/dist/node_modules/@mui/material/Drawer/Drawer/index.esm.js.map +1 -1
  427. package/dist/node_modules/@mui/material/Drawer/Drawer/index.js +1 -1
  428. package/dist/node_modules/@mui/material/Drawer/Drawer/index.js.map +1 -1
  429. package/dist/node_modules/@mui/material/Fab/Fab/index.esm.js +1 -2
  430. package/dist/node_modules/@mui/material/Fab/Fab/index.esm.js.map +1 -1
  431. package/dist/node_modules/@mui/material/Fab/Fab/index.js +2 -2
  432. package/dist/node_modules/@mui/material/Fab/Fab/index.js.map +1 -1
  433. package/dist/node_modules/@mui/material/Fade/Fade/index.esm.js +1 -2
  434. package/dist/node_modules/@mui/material/Fade/Fade/index.esm.js.map +1 -1
  435. package/dist/node_modules/@mui/material/Fade/Fade/index.js +1 -1
  436. package/dist/node_modules/@mui/material/Fade/Fade/index.js.map +1 -1
  437. package/dist/node_modules/@mui/material/FilledInput/FilledInput/index.esm.js +1 -2
  438. package/dist/node_modules/@mui/material/FilledInput/FilledInput/index.esm.js.map +1 -1
  439. package/dist/node_modules/@mui/material/FilledInput/FilledInput/index.js +1 -1
  440. package/dist/node_modules/@mui/material/FilledInput/FilledInput/index.js.map +1 -1
  441. package/dist/node_modules/@mui/material/FormControl/FormControl/index.esm.js +2 -3
  442. package/dist/node_modules/@mui/material/FormControl/FormControl/index.esm.js.map +1 -1
  443. package/dist/node_modules/@mui/material/FormControl/FormControl/index.js +2 -2
  444. package/dist/node_modules/@mui/material/FormControl/FormControl/index.js.map +1 -1
  445. package/dist/node_modules/@mui/material/FormControl/FormControlContext/index.esm.js +1 -2
  446. package/dist/node_modules/@mui/material/FormControl/FormControlContext/index.esm.js.map +1 -1
  447. package/dist/node_modules/@mui/material/FormControl/FormControlContext/index.js +1 -1
  448. package/dist/node_modules/@mui/material/FormControl/FormControlContext/index.js.map +1 -1
  449. package/dist/node_modules/@mui/material/FormControlLabel/FormControlLabel/index.esm.js +1 -2
  450. package/dist/node_modules/@mui/material/FormControlLabel/FormControlLabel/index.esm.js.map +1 -1
  451. package/dist/node_modules/@mui/material/FormControlLabel/FormControlLabel/index.js +1 -1
  452. package/dist/node_modules/@mui/material/FormControlLabel/FormControlLabel/index.js.map +1 -1
  453. package/dist/node_modules/@mui/material/FormGroup/FormGroup/index.esm.js +1 -2
  454. package/dist/node_modules/@mui/material/FormGroup/FormGroup/index.esm.js.map +1 -1
  455. package/dist/node_modules/@mui/material/FormGroup/FormGroup/index.js +1 -1
  456. package/dist/node_modules/@mui/material/FormGroup/FormGroup/index.js.map +1 -1
  457. package/dist/node_modules/@mui/material/FormHelperText/FormHelperText/index.esm.js +1 -2
  458. package/dist/node_modules/@mui/material/FormHelperText/FormHelperText/index.esm.js.map +1 -1
  459. package/dist/node_modules/@mui/material/FormHelperText/FormHelperText/index.js +2 -2
  460. package/dist/node_modules/@mui/material/FormHelperText/FormHelperText/index.js.map +1 -1
  461. package/dist/node_modules/@mui/material/FormLabel/FormLabel/index.esm.js +1 -2
  462. package/dist/node_modules/@mui/material/FormLabel/FormLabel/index.esm.js.map +1 -1
  463. package/dist/node_modules/@mui/material/FormLabel/FormLabel/index.js +1 -1
  464. package/dist/node_modules/@mui/material/FormLabel/FormLabel/index.js.map +1 -1
  465. package/dist/node_modules/@mui/material/GlobalStyles/GlobalStyles/index.esm.js +1 -2
  466. package/dist/node_modules/@mui/material/GlobalStyles/GlobalStyles/index.esm.js.map +1 -1
  467. package/dist/node_modules/@mui/material/GlobalStyles/GlobalStyles/index.js +2 -2
  468. package/dist/node_modules/@mui/material/GlobalStyles/GlobalStyles/index.js.map +1 -1
  469. package/dist/node_modules/@mui/material/Grid/Grid/index.esm.js +2 -3
  470. package/dist/node_modules/@mui/material/Grid/Grid/index.esm.js.map +1 -1
  471. package/dist/node_modules/@mui/material/Grid/Grid/index.js +2 -2
  472. package/dist/node_modules/@mui/material/Grid/Grid/index.js.map +1 -1
  473. package/dist/node_modules/@mui/material/Grid/GridContext/index.esm.js +1 -2
  474. package/dist/node_modules/@mui/material/Grid/GridContext/index.esm.js.map +1 -1
  475. package/dist/node_modules/@mui/material/Grid/GridContext/index.js +1 -1
  476. package/dist/node_modules/@mui/material/Grid/GridContext/index.js.map +1 -1
  477. package/dist/node_modules/@mui/material/Grow/Grow/index.esm.js +1 -2
  478. package/dist/node_modules/@mui/material/Grow/Grow/index.esm.js.map +1 -1
  479. package/dist/node_modules/@mui/material/Grow/Grow/index.js +2 -2
  480. package/dist/node_modules/@mui/material/Grow/Grow/index.js.map +1 -1
  481. package/dist/node_modules/@mui/material/Hidden/Hidden/index.esm.js +1 -2
  482. package/dist/node_modules/@mui/material/Hidden/Hidden/index.esm.js.map +1 -1
  483. package/dist/node_modules/@mui/material/Hidden/Hidden/index.js +1 -1
  484. package/dist/node_modules/@mui/material/Hidden/Hidden/index.js.map +1 -1
  485. package/dist/node_modules/@mui/material/Hidden/HiddenCss/index.esm.js +2 -3
  486. package/dist/node_modules/@mui/material/Hidden/HiddenCss/index.esm.js.map +1 -1
  487. package/dist/node_modules/@mui/material/Hidden/HiddenCss/index.js +2 -2
  488. package/dist/node_modules/@mui/material/Hidden/HiddenCss/index.js.map +1 -1
  489. package/dist/node_modules/@mui/material/Hidden/HiddenJs/index.esm.js +3 -4
  490. package/dist/node_modules/@mui/material/Hidden/HiddenJs/index.esm.js.map +1 -1
  491. package/dist/node_modules/@mui/material/Hidden/HiddenJs/index.js +1 -1
  492. package/dist/node_modules/@mui/material/Hidden/HiddenJs/index.js.map +1 -1
  493. package/dist/node_modules/@mui/material/Hidden/withWidth/index.esm.js +2 -3
  494. package/dist/node_modules/@mui/material/Hidden/withWidth/index.esm.js.map +1 -1
  495. package/dist/node_modules/@mui/material/Hidden/withWidth/index.js +1 -1
  496. package/dist/node_modules/@mui/material/Hidden/withWidth/index.js.map +1 -1
  497. package/dist/node_modules/@mui/material/Icon/Icon/index.esm.js +1 -2
  498. package/dist/node_modules/@mui/material/Icon/Icon/index.esm.js.map +1 -1
  499. package/dist/node_modules/@mui/material/Icon/Icon/index.js +2 -2
  500. package/dist/node_modules/@mui/material/Icon/Icon/index.js.map +1 -1
  501. package/dist/node_modules/@mui/material/IconButton/IconButton/index.esm.js +1 -2
  502. package/dist/node_modules/@mui/material/IconButton/IconButton/index.esm.js.map +1 -1
  503. package/dist/node_modules/@mui/material/IconButton/IconButton/index.js +1 -1
  504. package/dist/node_modules/@mui/material/IconButton/IconButton/index.js.map +1 -1
  505. package/dist/node_modules/@mui/material/ImageList/ImageList/index.esm.js +2 -3
  506. package/dist/node_modules/@mui/material/ImageList/ImageList/index.esm.js.map +1 -1
  507. package/dist/node_modules/@mui/material/ImageList/ImageList/index.js +2 -2
  508. package/dist/node_modules/@mui/material/ImageList/ImageList/index.js.map +1 -1
  509. package/dist/node_modules/@mui/material/ImageList/ImageListContext/index.esm.js +1 -2
  510. package/dist/node_modules/@mui/material/ImageList/ImageListContext/index.esm.js.map +1 -1
  511. package/dist/node_modules/@mui/material/ImageList/ImageListContext/index.js +1 -1
  512. package/dist/node_modules/@mui/material/ImageList/ImageListContext/index.js.map +1 -1
  513. package/dist/node_modules/@mui/material/ImageListItem/ImageListItem/index.esm.js +2 -3
  514. package/dist/node_modules/@mui/material/ImageListItem/ImageListItem/index.esm.js.map +1 -1
  515. package/dist/node_modules/@mui/material/ImageListItem/ImageListItem/index.js +2 -2
  516. package/dist/node_modules/@mui/material/ImageListItem/ImageListItem/index.js.map +1 -1
  517. package/dist/node_modules/@mui/material/ImageListItemBar/ImageListItemBar/index.esm.js +1 -2
  518. package/dist/node_modules/@mui/material/ImageListItemBar/ImageListItemBar/index.esm.js.map +1 -1
  519. package/dist/node_modules/@mui/material/ImageListItemBar/ImageListItemBar/index.js +1 -1
  520. package/dist/node_modules/@mui/material/ImageListItemBar/ImageListItemBar/index.js.map +1 -1
  521. package/dist/node_modules/@mui/material/Input/Input/index.esm.js +1 -2
  522. package/dist/node_modules/@mui/material/Input/Input/index.esm.js.map +1 -1
  523. package/dist/node_modules/@mui/material/Input/Input/index.js +2 -2
  524. package/dist/node_modules/@mui/material/Input/Input/index.js.map +1 -1
  525. package/dist/node_modules/@mui/material/InputAdornment/InputAdornment/index.esm.js +2 -3
  526. package/dist/node_modules/@mui/material/InputAdornment/InputAdornment/index.esm.js.map +1 -1
  527. package/dist/node_modules/@mui/material/InputAdornment/InputAdornment/index.js +2 -2
  528. package/dist/node_modules/@mui/material/InputAdornment/InputAdornment/index.js.map +1 -1
  529. package/dist/node_modules/@mui/material/InputBase/InputBase/index.esm.js +5 -6
  530. package/dist/node_modules/@mui/material/InputBase/InputBase/index.esm.js.map +1 -1
  531. package/dist/node_modules/@mui/material/InputBase/InputBase/index.js +1 -1
  532. package/dist/node_modules/@mui/material/InputBase/InputBase/index.js.map +1 -1
  533. package/dist/node_modules/@mui/material/InputLabel/InputLabel/index.esm.js +1 -2
  534. package/dist/node_modules/@mui/material/InputLabel/InputLabel/index.esm.js.map +1 -1
  535. package/dist/node_modules/@mui/material/InputLabel/InputLabel/index.js +1 -1
  536. package/dist/node_modules/@mui/material/InputLabel/InputLabel/index.js.map +1 -1
  537. package/dist/node_modules/@mui/material/LinearProgress/LinearProgress/index.esm.js +3 -4
  538. package/dist/node_modules/@mui/material/LinearProgress/LinearProgress/index.esm.js.map +1 -1
  539. package/dist/node_modules/@mui/material/LinearProgress/LinearProgress/index.js +5 -5
  540. package/dist/node_modules/@mui/material/LinearProgress/LinearProgress/index.js.map +1 -1
  541. package/dist/node_modules/@mui/material/Link/Link/index.esm.js +1 -2
  542. package/dist/node_modules/@mui/material/Link/Link/index.esm.js.map +1 -1
  543. package/dist/node_modules/@mui/material/Link/Link/index.js +1 -1
  544. package/dist/node_modules/@mui/material/Link/Link/index.js.map +1 -1
  545. package/dist/node_modules/@mui/material/List/List/index.esm.js +1 -2
  546. package/dist/node_modules/@mui/material/List/List/index.esm.js.map +1 -1
  547. package/dist/node_modules/@mui/material/List/List/index.js +2 -2
  548. package/dist/node_modules/@mui/material/List/List/index.js.map +1 -1
  549. package/dist/node_modules/@mui/material/List/ListContext/index.esm.js +1 -2
  550. package/dist/node_modules/@mui/material/List/ListContext/index.esm.js.map +1 -1
  551. package/dist/node_modules/@mui/material/List/ListContext/index.js +1 -1
  552. package/dist/node_modules/@mui/material/List/ListContext/index.js.map +1 -1
  553. package/dist/node_modules/@mui/material/ListItem/ListItem/index.esm.js +2 -3
  554. package/dist/node_modules/@mui/material/ListItem/ListItem/index.esm.js.map +1 -1
  555. package/dist/node_modules/@mui/material/ListItem/ListItem/index.js +1 -1
  556. package/dist/node_modules/@mui/material/ListItem/ListItem/index.js.map +1 -1
  557. package/dist/node_modules/@mui/material/ListItemAvatar/ListItemAvatar/index.esm.js +1 -2
  558. package/dist/node_modules/@mui/material/ListItemAvatar/ListItemAvatar/index.esm.js.map +1 -1
  559. package/dist/node_modules/@mui/material/ListItemAvatar/ListItemAvatar/index.js +1 -1
  560. package/dist/node_modules/@mui/material/ListItemAvatar/ListItemAvatar/index.js.map +1 -1
  561. package/dist/node_modules/@mui/material/ListItemButton/ListItemButton/index.esm.js +2 -3
  562. package/dist/node_modules/@mui/material/ListItemButton/ListItemButton/index.esm.js.map +1 -1
  563. package/dist/node_modules/@mui/material/ListItemButton/ListItemButton/index.js +2 -2
  564. package/dist/node_modules/@mui/material/ListItemButton/ListItemButton/index.js.map +1 -1
  565. package/dist/node_modules/@mui/material/ListItemIcon/ListItemIcon/index.esm.js +1 -2
  566. package/dist/node_modules/@mui/material/ListItemIcon/ListItemIcon/index.esm.js.map +1 -1
  567. package/dist/node_modules/@mui/material/ListItemIcon/ListItemIcon/index.js +2 -2
  568. package/dist/node_modules/@mui/material/ListItemIcon/ListItemIcon/index.js.map +1 -1
  569. package/dist/node_modules/@mui/material/ListItemSecondaryAction/ListItemSecondaryAction/index.esm.js +1 -2
  570. package/dist/node_modules/@mui/material/ListItemSecondaryAction/ListItemSecondaryAction/index.esm.js.map +1 -1
  571. package/dist/node_modules/@mui/material/ListItemSecondaryAction/ListItemSecondaryAction/index.js +2 -2
  572. package/dist/node_modules/@mui/material/ListItemSecondaryAction/ListItemSecondaryAction/index.js.map +1 -1
  573. package/dist/node_modules/@mui/material/ListItemText/ListItemText/index.esm.js +1 -2
  574. package/dist/node_modules/@mui/material/ListItemText/ListItemText/index.esm.js.map +1 -1
  575. package/dist/node_modules/@mui/material/ListItemText/ListItemText/index.js +1 -1
  576. package/dist/node_modules/@mui/material/ListItemText/ListItemText/index.js.map +1 -1
  577. package/dist/node_modules/@mui/material/ListSubheader/ListSubheader/index.esm.js +1 -2
  578. package/dist/node_modules/@mui/material/ListSubheader/ListSubheader/index.esm.js.map +1 -1
  579. package/dist/node_modules/@mui/material/ListSubheader/ListSubheader/index.js +2 -2
  580. package/dist/node_modules/@mui/material/ListSubheader/ListSubheader/index.js.map +1 -1
  581. package/dist/node_modules/@mui/material/Menu/Menu/index.esm.js +2 -3
  582. package/dist/node_modules/@mui/material/Menu/Menu/index.esm.js.map +1 -1
  583. package/dist/node_modules/@mui/material/Menu/Menu/index.js +2 -2
  584. package/dist/node_modules/@mui/material/Menu/Menu/index.js.map +1 -1
  585. package/dist/node_modules/@mui/material/MenuItem/MenuItem/index.esm.js +2 -3
  586. package/dist/node_modules/@mui/material/MenuItem/MenuItem/index.esm.js.map +1 -1
  587. package/dist/node_modules/@mui/material/MenuItem/MenuItem/index.js +1 -1
  588. package/dist/node_modules/@mui/material/MenuItem/MenuItem/index.js.map +1 -1
  589. package/dist/node_modules/@mui/material/MenuList/MenuList/index.esm.js +2 -3
  590. package/dist/node_modules/@mui/material/MenuList/MenuList/index.esm.js.map +1 -1
  591. package/dist/node_modules/@mui/material/MenuList/MenuList/index.js +2 -2
  592. package/dist/node_modules/@mui/material/MenuList/MenuList/index.js.map +1 -1
  593. package/dist/node_modules/@mui/material/MobileStepper/MobileStepper/index.esm.js +1 -2
  594. package/dist/node_modules/@mui/material/MobileStepper/MobileStepper/index.esm.js.map +1 -1
  595. package/dist/node_modules/@mui/material/MobileStepper/MobileStepper/index.js +1 -1
  596. package/dist/node_modules/@mui/material/MobileStepper/MobileStepper/index.js.map +1 -1
  597. package/dist/node_modules/@mui/material/Modal/Modal/index.esm.js +1 -2
  598. package/dist/node_modules/@mui/material/Modal/Modal/index.esm.js.map +1 -1
  599. package/dist/node_modules/@mui/material/Modal/Modal/index.js +1 -1
  600. package/dist/node_modules/@mui/material/Modal/Modal/index.js.map +1 -1
  601. package/dist/node_modules/@mui/material/NativeSelect/NativeSelect/index.esm.js +1 -2
  602. package/dist/node_modules/@mui/material/NativeSelect/NativeSelect/index.esm.js.map +1 -1
  603. package/dist/node_modules/@mui/material/NativeSelect/NativeSelect/index.js +2 -2
  604. package/dist/node_modules/@mui/material/NativeSelect/NativeSelect/index.js.map +1 -1
  605. package/dist/node_modules/@mui/material/NativeSelect/NativeSelectInput/index.esm.js +1 -2
  606. package/dist/node_modules/@mui/material/NativeSelect/NativeSelectInput/index.esm.js.map +1 -1
  607. package/dist/node_modules/@mui/material/NativeSelect/NativeSelectInput/index.js +1 -1
  608. package/dist/node_modules/@mui/material/NativeSelect/NativeSelectInput/index.js.map +1 -1
  609. package/dist/node_modules/@mui/material/NoSsr/NoSsr/index.esm.js +2 -3
  610. package/dist/node_modules/@mui/material/NoSsr/NoSsr/index.esm.js.map +1 -1
  611. package/dist/node_modules/@mui/material/NoSsr/NoSsr/index.js +1 -1
  612. package/dist/node_modules/@mui/material/NoSsr/NoSsr/index.js.map +1 -1
  613. package/dist/node_modules/@mui/material/OutlinedInput/NotchedOutline/index.esm.js +1 -2
  614. package/dist/node_modules/@mui/material/OutlinedInput/NotchedOutline/index.esm.js.map +1 -1
  615. package/dist/node_modules/@mui/material/OutlinedInput/NotchedOutline/index.js +1 -1
  616. package/dist/node_modules/@mui/material/OutlinedInput/NotchedOutline/index.js.map +1 -1
  617. package/dist/node_modules/@mui/material/OutlinedInput/OutlinedInput/index.esm.js +1 -2
  618. package/dist/node_modules/@mui/material/OutlinedInput/OutlinedInput/index.esm.js.map +1 -1
  619. package/dist/node_modules/@mui/material/OutlinedInput/OutlinedInput/index.js +2 -2
  620. package/dist/node_modules/@mui/material/OutlinedInput/OutlinedInput/index.js.map +1 -1
  621. package/dist/node_modules/@mui/material/Pagination/Pagination/index.esm.js +1 -2
  622. package/dist/node_modules/@mui/material/Pagination/Pagination/index.esm.js.map +1 -1
  623. package/dist/node_modules/@mui/material/Pagination/Pagination/index.js +1 -1
  624. package/dist/node_modules/@mui/material/Pagination/Pagination/index.js.map +1 -1
  625. package/dist/node_modules/@mui/material/PaginationItem/PaginationItem/index.esm.js +1 -2
  626. package/dist/node_modules/@mui/material/PaginationItem/PaginationItem/index.esm.js.map +1 -1
  627. package/dist/node_modules/@mui/material/PaginationItem/PaginationItem/index.js +1 -1
  628. package/dist/node_modules/@mui/material/PaginationItem/PaginationItem/index.js.map +1 -1
  629. package/dist/node_modules/@mui/material/Paper/Paper/index.esm.js +2 -3
  630. package/dist/node_modules/@mui/material/Paper/Paper/index.esm.js.map +1 -1
  631. package/dist/node_modules/@mui/material/Paper/Paper/index.js +1 -1
  632. package/dist/node_modules/@mui/material/Paper/Paper/index.js.map +1 -1
  633. package/dist/node_modules/@mui/material/Popover/Popover/index.esm.js +6 -7
  634. package/dist/node_modules/@mui/material/Popover/Popover/index.esm.js.map +1 -1
  635. package/dist/node_modules/@mui/material/Popover/Popover/index.js +2 -2
  636. package/dist/node_modules/@mui/material/Popover/Popover/index.js.map +1 -1
  637. package/dist/node_modules/@mui/material/Popper/BasePopper/index.esm.js +4 -5
  638. package/dist/node_modules/@mui/material/Popper/BasePopper/index.esm.js.map +1 -1
  639. package/dist/node_modules/@mui/material/Popper/BasePopper/index.js +3 -3
  640. package/dist/node_modules/@mui/material/Popper/BasePopper/index.js.map +1 -1
  641. package/dist/node_modules/@mui/material/Popper/Popper/index.esm.js +1 -2
  642. package/dist/node_modules/@mui/material/Popper/Popper/index.esm.js.map +1 -1
  643. package/dist/node_modules/@mui/material/Popper/Popper/index.js +1 -1
  644. package/dist/node_modules/@mui/material/Popper/Popper/index.js.map +1 -1
  645. package/dist/node_modules/@mui/material/Portal/Portal/index.esm.js +2 -3
  646. package/dist/node_modules/@mui/material/Portal/Portal/index.esm.js.map +1 -1
  647. package/dist/node_modules/@mui/material/Portal/Portal/index.js +4 -4
  648. package/dist/node_modules/@mui/material/Portal/Portal/index.js.map +1 -1
  649. package/dist/node_modules/@mui/material/Radio/Radio/index.esm.js +1 -2
  650. package/dist/node_modules/@mui/material/Radio/Radio/index.esm.js.map +1 -1
  651. package/dist/node_modules/@mui/material/Radio/Radio/index.js +1 -1
  652. package/dist/node_modules/@mui/material/Radio/Radio/index.js.map +1 -1
  653. package/dist/node_modules/@mui/material/Radio/RadioButtonIcon/index.esm.js +1 -2
  654. package/dist/node_modules/@mui/material/Radio/RadioButtonIcon/index.esm.js.map +1 -1
  655. package/dist/node_modules/@mui/material/Radio/RadioButtonIcon/index.js +2 -2
  656. package/dist/node_modules/@mui/material/Radio/RadioButtonIcon/index.js.map +1 -1
  657. package/dist/node_modules/@mui/material/RadioGroup/RadioGroup/index.esm.js +1 -2
  658. package/dist/node_modules/@mui/material/RadioGroup/RadioGroup/index.esm.js.map +1 -1
  659. package/dist/node_modules/@mui/material/RadioGroup/RadioGroup/index.js +2 -2
  660. package/dist/node_modules/@mui/material/RadioGroup/RadioGroup/index.js.map +1 -1
  661. package/dist/node_modules/@mui/material/RadioGroup/RadioGroupContext/index.esm.js +1 -2
  662. package/dist/node_modules/@mui/material/RadioGroup/RadioGroupContext/index.esm.js.map +1 -1
  663. package/dist/node_modules/@mui/material/RadioGroup/RadioGroupContext/index.js +1 -1
  664. package/dist/node_modules/@mui/material/RadioGroup/RadioGroupContext/index.js.map +1 -1
  665. package/dist/node_modules/@mui/material/Rating/Rating/index.esm.js +3 -4
  666. package/dist/node_modules/@mui/material/Rating/Rating/index.esm.js.map +1 -1
  667. package/dist/node_modules/@mui/material/Rating/Rating/index.js +6 -6
  668. package/dist/node_modules/@mui/material/Rating/Rating/index.js.map +1 -1
  669. package/dist/node_modules/@mui/material/ScopedCssBaseline/ScopedCssBaseline/index.esm.js +1 -2
  670. package/dist/node_modules/@mui/material/ScopedCssBaseline/ScopedCssBaseline/index.esm.js.map +1 -1
  671. package/dist/node_modules/@mui/material/ScopedCssBaseline/ScopedCssBaseline/index.js +2 -2
  672. package/dist/node_modules/@mui/material/ScopedCssBaseline/ScopedCssBaseline/index.js.map +1 -1
  673. package/dist/node_modules/@mui/material/Select/Select/index.esm.js +1 -2
  674. package/dist/node_modules/@mui/material/Select/Select/index.esm.js.map +1 -1
  675. package/dist/node_modules/@mui/material/Select/Select/index.js +1 -1
  676. package/dist/node_modules/@mui/material/Select/Select/index.js.map +1 -1
  677. package/dist/node_modules/@mui/material/Select/SelectInput/index.esm.js +4 -5
  678. package/dist/node_modules/@mui/material/Select/SelectInput/index.esm.js.map +1 -1
  679. package/dist/node_modules/@mui/material/Select/SelectInput/index.js +2 -2
  680. package/dist/node_modules/@mui/material/Select/SelectInput/index.js.map +1 -1
  681. package/dist/node_modules/@mui/material/Skeleton/Skeleton/index.esm.js +1 -2
  682. package/dist/node_modules/@mui/material/Skeleton/Skeleton/index.esm.js.map +1 -1
  683. package/dist/node_modules/@mui/material/Skeleton/Skeleton/index.js +1 -1
  684. package/dist/node_modules/@mui/material/Skeleton/Skeleton/index.js.map +1 -1
  685. package/dist/node_modules/@mui/material/Slide/Slide/index.esm.js +2 -3
  686. package/dist/node_modules/@mui/material/Slide/Slide/index.esm.js.map +1 -1
  687. package/dist/node_modules/@mui/material/Slide/Slide/index.js +1 -1
  688. package/dist/node_modules/@mui/material/Slide/Slide/index.js.map +1 -1
  689. package/dist/node_modules/@mui/material/Slider/Slider/index.esm.js +1 -2
  690. package/dist/node_modules/@mui/material/Slider/Slider/index.esm.js.map +1 -1
  691. package/dist/node_modules/@mui/material/Slider/Slider/index.js +1 -1
  692. package/dist/node_modules/@mui/material/Slider/Slider/index.js.map +1 -1
  693. package/dist/node_modules/@mui/material/Slider/SliderValueLabel/index.esm.js +1 -2
  694. package/dist/node_modules/@mui/material/Slider/SliderValueLabel/index.esm.js.map +1 -1
  695. package/dist/node_modules/@mui/material/Slider/SliderValueLabel/index.js +1 -1
  696. package/dist/node_modules/@mui/material/Slider/SliderValueLabel/index.js.map +1 -1
  697. package/dist/node_modules/@mui/material/Snackbar/Snackbar/index.esm.js +1 -2
  698. package/dist/node_modules/@mui/material/Snackbar/Snackbar/index.esm.js.map +1 -1
  699. package/dist/node_modules/@mui/material/Snackbar/Snackbar/index.js +1 -1
  700. package/dist/node_modules/@mui/material/Snackbar/Snackbar/index.js.map +1 -1
  701. package/dist/node_modules/@mui/material/SnackbarContent/SnackbarContent/index.esm.js +1 -2
  702. package/dist/node_modules/@mui/material/SnackbarContent/SnackbarContent/index.esm.js.map +1 -1
  703. package/dist/node_modules/@mui/material/SnackbarContent/SnackbarContent/index.js +1 -1
  704. package/dist/node_modules/@mui/material/SnackbarContent/SnackbarContent/index.js.map +1 -1
  705. package/dist/node_modules/@mui/material/SpeedDial/SpeedDial/index.esm.js +2 -3
  706. package/dist/node_modules/@mui/material/SpeedDial/SpeedDial/index.esm.js.map +1 -1
  707. package/dist/node_modules/@mui/material/SpeedDial/SpeedDial/index.js +3 -3
  708. package/dist/node_modules/@mui/material/SpeedDial/SpeedDial/index.js.map +1 -1
  709. package/dist/node_modules/@mui/material/SpeedDialAction/SpeedDialAction/index.esm.js +1 -2
  710. package/dist/node_modules/@mui/material/SpeedDialAction/SpeedDialAction/index.esm.js.map +1 -1
  711. package/dist/node_modules/@mui/material/SpeedDialAction/SpeedDialAction/index.js +1 -1
  712. package/dist/node_modules/@mui/material/SpeedDialAction/SpeedDialAction/index.js.map +1 -1
  713. package/dist/node_modules/@mui/material/SpeedDialIcon/SpeedDialIcon/index.esm.js +1 -2
  714. package/dist/node_modules/@mui/material/SpeedDialIcon/SpeedDialIcon/index.esm.js.map +1 -1
  715. package/dist/node_modules/@mui/material/SpeedDialIcon/SpeedDialIcon/index.js +2 -2
  716. package/dist/node_modules/@mui/material/SpeedDialIcon/SpeedDialIcon/index.js.map +1 -1
  717. package/dist/node_modules/@mui/material/Stack/Stack/index.esm.js +1 -2
  718. package/dist/node_modules/@mui/material/Stack/Stack/index.esm.js.map +1 -1
  719. package/dist/node_modules/@mui/material/Stack/Stack/index.js +1 -1
  720. package/dist/node_modules/@mui/material/Stack/Stack/index.js.map +1 -1
  721. package/dist/node_modules/@mui/material/Step/Step/index.esm.js +1 -2
  722. package/dist/node_modules/@mui/material/Step/Step/index.esm.js.map +1 -1
  723. package/dist/node_modules/@mui/material/Step/Step/index.js +1 -1
  724. package/dist/node_modules/@mui/material/Step/Step/index.js.map +1 -1
  725. package/dist/node_modules/@mui/material/Step/StepContext/index.esm.js +1 -2
  726. package/dist/node_modules/@mui/material/Step/StepContext/index.esm.js.map +1 -1
  727. package/dist/node_modules/@mui/material/Step/StepContext/index.js +1 -1
  728. package/dist/node_modules/@mui/material/Step/StepContext/index.js.map +1 -1
  729. package/dist/node_modules/@mui/material/StepButton/StepButton/index.esm.js +1 -2
  730. package/dist/node_modules/@mui/material/StepButton/StepButton/index.esm.js.map +1 -1
  731. package/dist/node_modules/@mui/material/StepButton/StepButton/index.js +1 -1
  732. package/dist/node_modules/@mui/material/StepButton/StepButton/index.js.map +1 -1
  733. package/dist/node_modules/@mui/material/StepConnector/StepConnector/index.esm.js +1 -2
  734. package/dist/node_modules/@mui/material/StepConnector/StepConnector/index.esm.js.map +1 -1
  735. package/dist/node_modules/@mui/material/StepConnector/StepConnector/index.js +1 -1
  736. package/dist/node_modules/@mui/material/StepConnector/StepConnector/index.js.map +1 -1
  737. package/dist/node_modules/@mui/material/StepContent/StepContent/index.esm.js +2 -3
  738. package/dist/node_modules/@mui/material/StepContent/StepContent/index.esm.js.map +1 -1
  739. package/dist/node_modules/@mui/material/StepContent/StepContent/index.js +1 -1
  740. package/dist/node_modules/@mui/material/StepContent/StepContent/index.js.map +1 -1
  741. package/dist/node_modules/@mui/material/StepIcon/StepIcon/index.esm.js +1 -2
  742. package/dist/node_modules/@mui/material/StepIcon/StepIcon/index.esm.js.map +1 -1
  743. package/dist/node_modules/@mui/material/StepIcon/StepIcon/index.js +1 -1
  744. package/dist/node_modules/@mui/material/StepIcon/StepIcon/index.js.map +1 -1
  745. package/dist/node_modules/@mui/material/StepLabel/StepLabel/index.esm.js +1 -2
  746. package/dist/node_modules/@mui/material/StepLabel/StepLabel/index.esm.js.map +1 -1
  747. package/dist/node_modules/@mui/material/StepLabel/StepLabel/index.js +2 -2
  748. package/dist/node_modules/@mui/material/StepLabel/StepLabel/index.js.map +1 -1
  749. package/dist/node_modules/@mui/material/Stepper/Stepper/index.esm.js +1 -2
  750. package/dist/node_modules/@mui/material/Stepper/Stepper/index.esm.js.map +1 -1
  751. package/dist/node_modules/@mui/material/Stepper/Stepper/index.js +2 -2
  752. package/dist/node_modules/@mui/material/Stepper/Stepper/index.js.map +1 -1
  753. package/dist/node_modules/@mui/material/Stepper/StepperContext/index.esm.js +1 -2
  754. package/dist/node_modules/@mui/material/Stepper/StepperContext/index.esm.js.map +1 -1
  755. package/dist/node_modules/@mui/material/Stepper/StepperContext/index.js +1 -1
  756. package/dist/node_modules/@mui/material/Stepper/StepperContext/index.js.map +1 -1
  757. package/dist/node_modules/@mui/material/SvgIcon/SvgIcon/index.esm.js +1 -2
  758. package/dist/node_modules/@mui/material/SvgIcon/SvgIcon/index.esm.js.map +1 -1
  759. package/dist/node_modules/@mui/material/SvgIcon/SvgIcon/index.js +2 -2
  760. package/dist/node_modules/@mui/material/SvgIcon/SvgIcon/index.js.map +1 -1
  761. package/dist/node_modules/@mui/material/SwipeableDrawer/SwipeArea/index.esm.js +1 -2
  762. package/dist/node_modules/@mui/material/SwipeableDrawer/SwipeArea/index.esm.js.map +1 -1
  763. package/dist/node_modules/@mui/material/SwipeableDrawer/SwipeArea/index.js +2 -2
  764. package/dist/node_modules/@mui/material/SwipeableDrawer/SwipeArea/index.js.map +1 -1
  765. package/dist/node_modules/@mui/material/SwipeableDrawer/SwipeableDrawer/index.esm.js +1 -2
  766. package/dist/node_modules/@mui/material/SwipeableDrawer/SwipeableDrawer/index.esm.js.map +1 -1
  767. package/dist/node_modules/@mui/material/SwipeableDrawer/SwipeableDrawer/index.js +1 -1
  768. package/dist/node_modules/@mui/material/SwipeableDrawer/SwipeableDrawer/index.js.map +1 -1
  769. package/dist/node_modules/@mui/material/Switch/Switch/index.esm.js +1 -2
  770. package/dist/node_modules/@mui/material/Switch/Switch/index.esm.js.map +1 -1
  771. package/dist/node_modules/@mui/material/Switch/Switch/index.js +2 -2
  772. package/dist/node_modules/@mui/material/Switch/Switch/index.js.map +1 -1
  773. package/dist/node_modules/@mui/material/Tab/Tab/index.esm.js +1 -2
  774. package/dist/node_modules/@mui/material/Tab/Tab/index.esm.js.map +1 -1
  775. package/dist/node_modules/@mui/material/Tab/Tab/index.js +1 -1
  776. package/dist/node_modules/@mui/material/Tab/Tab/index.js.map +1 -1
  777. package/dist/node_modules/@mui/material/TabScrollButton/TabScrollButton/index.esm.js +1 -2
  778. package/dist/node_modules/@mui/material/TabScrollButton/TabScrollButton/index.esm.js.map +1 -1
  779. package/dist/node_modules/@mui/material/TabScrollButton/TabScrollButton/index.js +2 -2
  780. package/dist/node_modules/@mui/material/TabScrollButton/TabScrollButton/index.js.map +1 -1
  781. package/dist/node_modules/@mui/material/Table/Table/index.esm.js +1 -2
  782. package/dist/node_modules/@mui/material/Table/Table/index.esm.js.map +1 -1
  783. package/dist/node_modules/@mui/material/Table/Table/index.js +2 -2
  784. package/dist/node_modules/@mui/material/Table/Table/index.js.map +1 -1
  785. package/dist/node_modules/@mui/material/Table/TableContext/index.esm.js +1 -2
  786. package/dist/node_modules/@mui/material/Table/TableContext/index.esm.js.map +1 -1
  787. package/dist/node_modules/@mui/material/Table/TableContext/index.js +1 -1
  788. package/dist/node_modules/@mui/material/Table/TableContext/index.js.map +1 -1
  789. package/dist/node_modules/@mui/material/Table/Tablelvl2Context/index.esm.js +1 -2
  790. package/dist/node_modules/@mui/material/Table/Tablelvl2Context/index.esm.js.map +1 -1
  791. package/dist/node_modules/@mui/material/Table/Tablelvl2Context/index.js +1 -1
  792. package/dist/node_modules/@mui/material/Table/Tablelvl2Context/index.js.map +1 -1
  793. package/dist/node_modules/@mui/material/TableBody/TableBody/index.esm.js +1 -2
  794. package/dist/node_modules/@mui/material/TableBody/TableBody/index.esm.js.map +1 -1
  795. package/dist/node_modules/@mui/material/TableBody/TableBody/index.js +1 -1
  796. package/dist/node_modules/@mui/material/TableBody/TableBody/index.js.map +1 -1
  797. package/dist/node_modules/@mui/material/TableCell/TableCell/index.esm.js +1 -2
  798. package/dist/node_modules/@mui/material/TableCell/TableCell/index.esm.js.map +1 -1
  799. package/dist/node_modules/@mui/material/TableCell/TableCell/index.js +1 -1
  800. package/dist/node_modules/@mui/material/TableCell/TableCell/index.js.map +1 -1
  801. package/dist/node_modules/@mui/material/TableContainer/TableContainer/index.esm.js +1 -2
  802. package/dist/node_modules/@mui/material/TableContainer/TableContainer/index.esm.js.map +1 -1
  803. package/dist/node_modules/@mui/material/TableContainer/TableContainer/index.js +2 -2
  804. package/dist/node_modules/@mui/material/TableContainer/TableContainer/index.js.map +1 -1
  805. package/dist/node_modules/@mui/material/TableFooter/TableFooter/index.esm.js +1 -2
  806. package/dist/node_modules/@mui/material/TableFooter/TableFooter/index.esm.js.map +1 -1
  807. package/dist/node_modules/@mui/material/TableFooter/TableFooter/index.js +1 -1
  808. package/dist/node_modules/@mui/material/TableFooter/TableFooter/index.js.map +1 -1
  809. package/dist/node_modules/@mui/material/TableHead/TableHead/index.esm.js +1 -2
  810. package/dist/node_modules/@mui/material/TableHead/TableHead/index.esm.js.map +1 -1
  811. package/dist/node_modules/@mui/material/TableHead/TableHead/index.js +1 -1
  812. package/dist/node_modules/@mui/material/TableHead/TableHead/index.js.map +1 -1
  813. package/dist/node_modules/@mui/material/TablePagination/TablePagination/index.esm.js +1 -2
  814. package/dist/node_modules/@mui/material/TablePagination/TablePagination/index.esm.js.map +1 -1
  815. package/dist/node_modules/@mui/material/TablePagination/TablePagination/index.js +2 -2
  816. package/dist/node_modules/@mui/material/TablePagination/TablePagination/index.js.map +1 -1
  817. package/dist/node_modules/@mui/material/TablePagination/TablePaginationActions/index.esm.js +1 -2
  818. package/dist/node_modules/@mui/material/TablePagination/TablePaginationActions/index.esm.js.map +1 -1
  819. package/dist/node_modules/@mui/material/TablePagination/TablePaginationActions/index.js +2 -2
  820. package/dist/node_modules/@mui/material/TablePagination/TablePaginationActions/index.js.map +1 -1
  821. package/dist/node_modules/@mui/material/TableRow/TableRow/index.esm.js +1 -2
  822. package/dist/node_modules/@mui/material/TableRow/TableRow/index.esm.js.map +1 -1
  823. package/dist/node_modules/@mui/material/TableRow/TableRow/index.js +1 -1
  824. package/dist/node_modules/@mui/material/TableRow/TableRow/index.js.map +1 -1
  825. package/dist/node_modules/@mui/material/TableSortLabel/TableSortLabel/index.esm.js +1 -2
  826. package/dist/node_modules/@mui/material/TableSortLabel/TableSortLabel/index.esm.js.map +1 -1
  827. package/dist/node_modules/@mui/material/TableSortLabel/TableSortLabel/index.js +1 -1
  828. package/dist/node_modules/@mui/material/TableSortLabel/TableSortLabel/index.js.map +1 -1
  829. package/dist/node_modules/@mui/material/Tabs/ScrollbarSize/index.esm.js +1 -2
  830. package/dist/node_modules/@mui/material/Tabs/ScrollbarSize/index.esm.js.map +1 -1
  831. package/dist/node_modules/@mui/material/Tabs/ScrollbarSize/index.js +1 -1
  832. package/dist/node_modules/@mui/material/Tabs/ScrollbarSize/index.js.map +1 -1
  833. package/dist/node_modules/@mui/material/Tabs/Tabs/index.esm.js +6 -7
  834. package/dist/node_modules/@mui/material/Tabs/Tabs/index.esm.js.map +1 -1
  835. package/dist/node_modules/@mui/material/Tabs/Tabs/index.js +2 -2
  836. package/dist/node_modules/@mui/material/Tabs/Tabs/index.js.map +1 -1
  837. package/dist/node_modules/@mui/material/TextField/TextField/index.esm.js +2 -3
  838. package/dist/node_modules/@mui/material/TextField/TextField/index.esm.js.map +1 -1
  839. package/dist/node_modules/@mui/material/TextField/TextField/index.js +2 -2
  840. package/dist/node_modules/@mui/material/TextField/TextField/index.js.map +1 -1
  841. package/dist/node_modules/@mui/material/TextareaAutosize/TextareaAutosize/index.esm.js +1 -2
  842. package/dist/node_modules/@mui/material/TextareaAutosize/TextareaAutosize/index.esm.js.map +1 -1
  843. package/dist/node_modules/@mui/material/TextareaAutosize/TextareaAutosize/index.js +1 -1
  844. package/dist/node_modules/@mui/material/TextareaAutosize/TextareaAutosize/index.js.map +1 -1
  845. package/dist/node_modules/@mui/material/ToggleButton/ToggleButton/index.esm.js +1 -2
  846. package/dist/node_modules/@mui/material/ToggleButton/ToggleButton/index.esm.js.map +1 -1
  847. package/dist/node_modules/@mui/material/ToggleButton/ToggleButton/index.js +1 -1
  848. package/dist/node_modules/@mui/material/ToggleButton/ToggleButton/index.js.map +1 -1
  849. package/dist/node_modules/@mui/material/ToggleButtonGroup/ToggleButtonGroup/index.esm.js +2 -3
  850. package/dist/node_modules/@mui/material/ToggleButtonGroup/ToggleButtonGroup/index.esm.js.map +1 -1
  851. package/dist/node_modules/@mui/material/ToggleButtonGroup/ToggleButtonGroup/index.js +2 -2
  852. package/dist/node_modules/@mui/material/ToggleButtonGroup/ToggleButtonGroup/index.js.map +1 -1
  853. package/dist/node_modules/@mui/material/ToggleButtonGroup/ToggleButtonGroupButtonContext/index.esm.js +1 -2
  854. package/dist/node_modules/@mui/material/ToggleButtonGroup/ToggleButtonGroupButtonContext/index.esm.js.map +1 -1
  855. package/dist/node_modules/@mui/material/ToggleButtonGroup/ToggleButtonGroupButtonContext/index.js +1 -1
  856. package/dist/node_modules/@mui/material/ToggleButtonGroup/ToggleButtonGroupButtonContext/index.js.map +1 -1
  857. package/dist/node_modules/@mui/material/ToggleButtonGroup/ToggleButtonGroupContext/index.esm.js +1 -2
  858. package/dist/node_modules/@mui/material/ToggleButtonGroup/ToggleButtonGroupContext/index.esm.js.map +1 -1
  859. package/dist/node_modules/@mui/material/ToggleButtonGroup/ToggleButtonGroupContext/index.js +1 -1
  860. package/dist/node_modules/@mui/material/ToggleButtonGroup/ToggleButtonGroupContext/index.js.map +1 -1
  861. package/dist/node_modules/@mui/material/Toolbar/Toolbar/index.esm.js +1 -2
  862. package/dist/node_modules/@mui/material/Toolbar/Toolbar/index.esm.js.map +1 -1
  863. package/dist/node_modules/@mui/material/Toolbar/Toolbar/index.js +2 -2
  864. package/dist/node_modules/@mui/material/Toolbar/Toolbar/index.js.map +1 -1
  865. package/dist/node_modules/@mui/material/Tooltip/Tooltip/index.esm.js +4 -5
  866. package/dist/node_modules/@mui/material/Tooltip/Tooltip/index.esm.js.map +1 -1
  867. package/dist/node_modules/@mui/material/Tooltip/Tooltip/index.js +2 -2
  868. package/dist/node_modules/@mui/material/Tooltip/Tooltip/index.js.map +1 -1
  869. package/dist/node_modules/@mui/material/Typography/Typography/index.esm.js +1 -2
  870. package/dist/node_modules/@mui/material/Typography/Typography/index.esm.js.map +1 -1
  871. package/dist/node_modules/@mui/material/Typography/Typography/index.js +2 -2
  872. package/dist/node_modules/@mui/material/Typography/Typography/index.js.map +1 -1
  873. package/dist/node_modules/@mui/material/Unstable_TrapFocus/FocusTrap/index.esm.js +3 -4
  874. package/dist/node_modules/@mui/material/Unstable_TrapFocus/FocusTrap/index.esm.js.map +1 -1
  875. package/dist/node_modules/@mui/material/Unstable_TrapFocus/FocusTrap/index.js +2 -2
  876. package/dist/node_modules/@mui/material/Unstable_TrapFocus/FocusTrap/index.js.map +1 -1
  877. package/dist/node_modules/@mui/material/Zoom/Zoom/index.esm.js +1 -2
  878. package/dist/node_modules/@mui/material/Zoom/Zoom/index.esm.js.map +1 -1
  879. package/dist/node_modules/@mui/material/Zoom/Zoom/index.js +1 -1
  880. package/dist/node_modules/@mui/material/Zoom/Zoom/index.js.map +1 -1
  881. package/dist/node_modules/@mui/material/internal/SwitchBase/index.esm.js +1 -2
  882. package/dist/node_modules/@mui/material/internal/SwitchBase/index.esm.js.map +1 -1
  883. package/dist/node_modules/@mui/material/internal/SwitchBase/index.js +2 -2
  884. package/dist/node_modules/@mui/material/internal/SwitchBase/index.js.map +1 -1
  885. package/dist/node_modules/@mui/material/styles/ThemeProvider/index.esm.js +1 -2
  886. package/dist/node_modules/@mui/material/styles/ThemeProvider/index.esm.js.map +1 -1
  887. package/dist/node_modules/@mui/material/styles/ThemeProvider/index.js +1 -1
  888. package/dist/node_modules/@mui/material/styles/ThemeProvider/index.js.map +1 -1
  889. package/dist/node_modules/@mui/material/styles/createPalette/index.esm.js +4 -5
  890. package/dist/node_modules/@mui/material/styles/createPalette/index.esm.js.map +1 -1
  891. package/dist/node_modules/@mui/material/styles/createPalette/index.js +1 -1
  892. package/dist/node_modules/@mui/material/styles/createPalette/index.js.map +1 -1
  893. package/dist/node_modules/@mui/material/styles/createTheme/index.esm.js +3 -4
  894. package/dist/node_modules/@mui/material/styles/createTheme/index.esm.js.map +1 -1
  895. package/dist/node_modules/@mui/material/styles/createTheme/index.js +1 -1
  896. package/dist/node_modules/@mui/material/styles/createTheme/index.js.map +1 -1
  897. package/dist/node_modules/@mui/material/styles/createTransitions/index.esm.js +1 -2
  898. package/dist/node_modules/@mui/material/styles/createTransitions/index.esm.js.map +1 -1
  899. package/dist/node_modules/@mui/material/styles/createTransitions/index.js +1 -1
  900. package/dist/node_modules/@mui/material/styles/createTransitions/index.js.map +1 -1
  901. package/dist/node_modules/@mui/material/styles/createTypography/index.esm.js +1 -2
  902. package/dist/node_modules/@mui/material/styles/createTypography/index.esm.js.map +1 -1
  903. package/dist/node_modules/@mui/material/styles/createTypography/index.js +1 -1
  904. package/dist/node_modules/@mui/material/styles/createTypography/index.js.map +1 -1
  905. package/dist/node_modules/@mui/material/styles/useTheme/index.esm.js +1 -2
  906. package/dist/node_modules/@mui/material/styles/useTheme/index.esm.js.map +1 -1
  907. package/dist/node_modules/@mui/material/styles/useTheme/index.js +1 -1
  908. package/dist/node_modules/@mui/material/styles/useTheme/index.js.map +1 -1
  909. package/dist/node_modules/@mui/material/useAutocomplete/useAutocomplete/index.esm.js +5 -6
  910. package/dist/node_modules/@mui/material/useAutocomplete/useAutocomplete/index.esm.js.map +1 -1
  911. package/dist/node_modules/@mui/material/useAutocomplete/useAutocomplete/index.js +1 -1
  912. package/dist/node_modules/@mui/material/useAutocomplete/useAutocomplete/index.js.map +1 -1
  913. package/dist/node_modules/@mui/material/utils/createSvgIcon/index.esm.js +1 -2
  914. package/dist/node_modules/@mui/material/utils/createSvgIcon/index.esm.js.map +1 -1
  915. package/dist/node_modules/@mui/material/utils/createSvgIcon/index.js +2 -2
  916. package/dist/node_modules/@mui/material/utils/createSvgIcon/index.js.map +1 -1
  917. package/dist/node_modules/@mui/material/utils/index/index.esm.js +1 -2
  918. package/dist/node_modules/@mui/material/utils/index/index.esm.js.map +1 -1
  919. package/dist/node_modules/@mui/material/utils/index/index.js +1 -1
  920. package/dist/node_modules/@mui/material/utils/index/index.js.map +1 -1
  921. package/dist/node_modules/@mui/private-theming/ThemeProvider/ThemeProvider/index.esm.js +5 -6
  922. package/dist/node_modules/@mui/private-theming/ThemeProvider/ThemeProvider/index.esm.js.map +1 -1
  923. package/dist/node_modules/@mui/private-theming/ThemeProvider/ThemeProvider/index.js +2 -2
  924. package/dist/node_modules/@mui/private-theming/ThemeProvider/ThemeProvider/index.js.map +1 -1
  925. package/dist/node_modules/@mui/private-theming/useTheme/ThemeContext/index.esm.js +1 -2
  926. package/dist/node_modules/@mui/private-theming/useTheme/ThemeContext/index.esm.js.map +1 -1
  927. package/dist/node_modules/@mui/private-theming/useTheme/ThemeContext/index.js +1 -1
  928. package/dist/node_modules/@mui/private-theming/useTheme/ThemeContext/index.js.map +1 -1
  929. package/dist/node_modules/@mui/private-theming/useTheme/useTheme/index.esm.js +1 -2
  930. package/dist/node_modules/@mui/private-theming/useTheme/useTheme/index.esm.js.map +1 -1
  931. package/dist/node_modules/@mui/private-theming/useTheme/useTheme/index.js +1 -1
  932. package/dist/node_modules/@mui/private-theming/useTheme/useTheme/index.js.map +1 -1
  933. package/dist/node_modules/@mui/styled-engine/GlobalStyles/GlobalStyles/index.esm.js +1 -2
  934. package/dist/node_modules/@mui/styled-engine/GlobalStyles/GlobalStyles/index.esm.js.map +1 -1
  935. package/dist/node_modules/@mui/styled-engine/GlobalStyles/GlobalStyles/index.js +1 -1
  936. package/dist/node_modules/@mui/styled-engine/GlobalStyles/GlobalStyles/index.js.map +1 -1
  937. package/dist/node_modules/@mui/styled-engine/StyledEngineProvider/StyledEngineProvider/index.esm.js +1 -2
  938. package/dist/node_modules/@mui/styled-engine/StyledEngineProvider/StyledEngineProvider/index.esm.js.map +1 -1
  939. package/dist/node_modules/@mui/styled-engine/StyledEngineProvider/StyledEngineProvider/index.js +1 -1
  940. package/dist/node_modules/@mui/styled-engine/StyledEngineProvider/StyledEngineProvider/index.js.map +1 -1
  941. package/dist/node_modules/@mui/styled-engine/index/index.esm.js +8 -2
  942. package/dist/node_modules/@mui/styled-engine/index/index.esm.js.map +1 -1
  943. package/dist/node_modules/@mui/styled-engine/index/index.js +1 -1
  944. package/dist/node_modules/@mui/styled-engine/index/index.js.map +1 -1
  945. package/dist/node_modules/@mui/system/colorManipulator/index.esm.js +10 -11
  946. package/dist/node_modules/@mui/system/colorManipulator/index.esm.js.map +1 -1
  947. package/dist/node_modules/@mui/system/colorManipulator/index.js +1 -1
  948. package/dist/node_modules/@mui/system/colorManipulator/index.js.map +1 -1
  949. package/dist/node_modules/@mui/system/createStyled/index.esm.js +8 -9
  950. package/dist/node_modules/@mui/system/createStyled/index.esm.js.map +1 -1
  951. package/dist/node_modules/@mui/system/createStyled/index.js +1 -1
  952. package/dist/node_modules/@mui/system/createStyled/index.js.map +1 -1
  953. package/dist/node_modules/@mui/system/esm/Container/createContainer/index.esm.js +1 -2
  954. package/dist/node_modules/@mui/system/esm/Container/createContainer/index.esm.js.map +1 -1
  955. package/dist/node_modules/@mui/system/esm/Container/createContainer/index.js +2 -2
  956. package/dist/node_modules/@mui/system/esm/Container/createContainer/index.js.map +1 -1
  957. package/dist/node_modules/@mui/system/esm/DefaultPropsProvider/DefaultPropsProvider/index.esm.js +1 -2
  958. package/dist/node_modules/@mui/system/esm/DefaultPropsProvider/DefaultPropsProvider/index.esm.js.map +1 -1
  959. package/dist/node_modules/@mui/system/esm/DefaultPropsProvider/DefaultPropsProvider/index.js +2 -2
  960. package/dist/node_modules/@mui/system/esm/DefaultPropsProvider/DefaultPropsProvider/index.js.map +1 -1
  961. package/dist/node_modules/@mui/system/esm/GlobalStyles/GlobalStyles/index.esm.js +1 -2
  962. package/dist/node_modules/@mui/system/esm/GlobalStyles/GlobalStyles/index.esm.js.map +1 -1
  963. package/dist/node_modules/@mui/system/esm/GlobalStyles/GlobalStyles/index.js +1 -1
  964. package/dist/node_modules/@mui/system/esm/GlobalStyles/GlobalStyles/index.js.map +1 -1
  965. package/dist/node_modules/@mui/system/esm/RtlProvider/index/index.esm.js +1 -2
  966. package/dist/node_modules/@mui/system/esm/RtlProvider/index/index.esm.js.map +1 -1
  967. package/dist/node_modules/@mui/system/esm/RtlProvider/index/index.js +1 -1
  968. package/dist/node_modules/@mui/system/esm/RtlProvider/index/index.js.map +1 -1
  969. package/dist/node_modules/@mui/system/esm/Stack/createStack/index.esm.js +1 -2
  970. package/dist/node_modules/@mui/system/esm/Stack/createStack/index.esm.js.map +1 -1
  971. package/dist/node_modules/@mui/system/esm/Stack/createStack/index.js +2 -2
  972. package/dist/node_modules/@mui/system/esm/Stack/createStack/index.js.map +1 -1
  973. package/dist/node_modules/@mui/system/esm/ThemeProvider/ThemeProvider/index.esm.js +4 -5
  974. package/dist/node_modules/@mui/system/esm/ThemeProvider/ThemeProvider/index.esm.js.map +1 -1
  975. package/dist/node_modules/@mui/system/esm/ThemeProvider/ThemeProvider/index.js +2 -2
  976. package/dist/node_modules/@mui/system/esm/ThemeProvider/ThemeProvider/index.js.map +1 -1
  977. package/dist/node_modules/@mui/system/esm/borders/index.esm.js +1 -2
  978. package/dist/node_modules/@mui/system/esm/borders/index.esm.js.map +1 -1
  979. package/dist/node_modules/@mui/system/esm/borders/index.js +1 -1
  980. package/dist/node_modules/@mui/system/esm/borders/index.js.map +1 -1
  981. package/dist/node_modules/@mui/system/esm/breakpoints/index.esm.js.map +1 -1
  982. package/dist/node_modules/@mui/system/esm/breakpoints/index.js.map +1 -1
  983. package/dist/node_modules/@mui/system/esm/colorManipulator/index.esm.js +3 -4
  984. package/dist/node_modules/@mui/system/esm/colorManipulator/index.esm.js.map +1 -1
  985. package/dist/node_modules/@mui/system/esm/colorManipulator/index.js +1 -1
  986. package/dist/node_modules/@mui/system/esm/colorManipulator/index.js.map +1 -1
  987. package/dist/node_modules/@mui/system/esm/compose/index.esm.js +1 -2
  988. package/dist/node_modules/@mui/system/esm/compose/index.esm.js.map +1 -1
  989. package/dist/node_modules/@mui/system/esm/compose/index.js +1 -1
  990. package/dist/node_modules/@mui/system/esm/compose/index.js.map +1 -1
  991. package/dist/node_modules/@mui/system/esm/createStyled/index.esm.js +2 -3
  992. package/dist/node_modules/@mui/system/esm/createStyled/index.esm.js.map +1 -1
  993. package/dist/node_modules/@mui/system/esm/createStyled/index.js +1 -1
  994. package/dist/node_modules/@mui/system/esm/createStyled/index.js.map +1 -1
  995. package/dist/node_modules/@mui/system/esm/createTheme/createSpacing/index.esm.js +1 -2
  996. package/dist/node_modules/@mui/system/esm/createTheme/createSpacing/index.esm.js.map +1 -1
  997. package/dist/node_modules/@mui/system/esm/createTheme/createSpacing/index.js +1 -1
  998. package/dist/node_modules/@mui/system/esm/createTheme/createSpacing/index.js.map +1 -1
  999. package/dist/node_modules/@mui/system/esm/cssGrid/index.esm.js +3 -4
  1000. package/dist/node_modules/@mui/system/esm/cssGrid/index.esm.js.map +1 -1
  1001. package/dist/node_modules/@mui/system/esm/cssGrid/index.js +1 -1
  1002. package/dist/node_modules/@mui/system/esm/cssGrid/index.js.map +1 -1
  1003. package/dist/node_modules/@mui/system/esm/responsivePropType/index.esm.js +1 -2
  1004. package/dist/node_modules/@mui/system/esm/responsivePropType/index.esm.js.map +1 -1
  1005. package/dist/node_modules/@mui/system/esm/responsivePropType/index.js +1 -1
  1006. package/dist/node_modules/@mui/system/esm/responsivePropType/index.js.map +1 -1
  1007. package/dist/node_modules/@mui/system/esm/spacing/index.esm.js +6 -7
  1008. package/dist/node_modules/@mui/system/esm/spacing/index.esm.js.map +1 -1
  1009. package/dist/node_modules/@mui/system/esm/spacing/index.js +1 -1
  1010. package/dist/node_modules/@mui/system/esm/spacing/index.js.map +1 -1
  1011. package/dist/node_modules/@mui/system/esm/style/index.esm.js +1 -2
  1012. package/dist/node_modules/@mui/system/esm/style/index.esm.js.map +1 -1
  1013. package/dist/node_modules/@mui/system/esm/style/index.js +1 -1
  1014. package/dist/node_modules/@mui/system/esm/style/index.js.map +1 -1
  1015. package/dist/node_modules/@mui/system/esm/useMediaQuery/useMediaQuery/index.esm.js +2 -3
  1016. package/dist/node_modules/@mui/system/esm/useMediaQuery/useMediaQuery/index.esm.js.map +1 -1
  1017. package/dist/node_modules/@mui/system/esm/useMediaQuery/useMediaQuery/index.js +1 -1
  1018. package/dist/node_modules/@mui/system/esm/useMediaQuery/useMediaQuery/index.js.map +1 -1
  1019. package/dist/node_modules/@mui/system/useThemeWithoutDefault/index.esm.js +1 -1
  1020. package/dist/node_modules/@mui/system/useThemeWithoutDefault/index.js +1 -1
  1021. package/dist/node_modules/@mui/utils/esm/HTMLElementType/HTMLElementType/index.esm.js +1 -2
  1022. package/dist/node_modules/@mui/utils/esm/HTMLElementType/HTMLElementType/index.esm.js.map +1 -1
  1023. package/dist/node_modules/@mui/utils/esm/HTMLElementType/HTMLElementType/index.js +1 -1
  1024. package/dist/node_modules/@mui/utils/esm/HTMLElementType/HTMLElementType/index.js.map +1 -1
  1025. package/dist/node_modules/@mui/utils/esm/capitalize/capitalize/index.esm.js +1 -2
  1026. package/dist/node_modules/@mui/utils/esm/capitalize/capitalize/index.esm.js.map +1 -1
  1027. package/dist/node_modules/@mui/utils/esm/capitalize/capitalize/index.js +1 -1
  1028. package/dist/node_modules/@mui/utils/esm/capitalize/capitalize/index.js.map +1 -1
  1029. package/dist/node_modules/@mui/utils/esm/chainPropTypes/chainPropTypes/index.esm.js +1 -2
  1030. package/dist/node_modules/@mui/utils/esm/chainPropTypes/chainPropTypes/index.esm.js.map +1 -1
  1031. package/dist/node_modules/@mui/utils/esm/chainPropTypes/chainPropTypes/index.js +1 -1
  1032. package/dist/node_modules/@mui/utils/esm/chainPropTypes/chainPropTypes/index.js.map +1 -1
  1033. package/dist/node_modules/@mui/utils/esm/deprecatedPropType/deprecatedPropType/index.esm.js +1 -2
  1034. package/dist/node_modules/@mui/utils/esm/deprecatedPropType/deprecatedPropType/index.esm.js.map +1 -1
  1035. package/dist/node_modules/@mui/utils/esm/deprecatedPropType/deprecatedPropType/index.js +1 -1
  1036. package/dist/node_modules/@mui/utils/esm/deprecatedPropType/deprecatedPropType/index.js.map +1 -1
  1037. package/dist/node_modules/@mui/utils/esm/exactProp/exactProp/index.esm.js +1 -2
  1038. package/dist/node_modules/@mui/utils/esm/exactProp/exactProp/index.esm.js.map +1 -1
  1039. package/dist/node_modules/@mui/utils/esm/exactProp/exactProp/index.js +1 -1
  1040. package/dist/node_modules/@mui/utils/esm/exactProp/exactProp/index.js.map +1 -1
  1041. package/dist/node_modules/@mui/utils/esm/integerPropType/integerPropType/index.esm.js +1 -2
  1042. package/dist/node_modules/@mui/utils/esm/integerPropType/integerPropType/index.esm.js.map +1 -1
  1043. package/dist/node_modules/@mui/utils/esm/integerPropType/integerPropType/index.js +1 -1
  1044. package/dist/node_modules/@mui/utils/esm/integerPropType/integerPropType/index.js.map +1 -1
  1045. package/dist/node_modules/@mui/utils/esm/requirePropFactory/requirePropFactory/index.esm.js +1 -2
  1046. package/dist/node_modules/@mui/utils/esm/requirePropFactory/requirePropFactory/index.esm.js.map +1 -1
  1047. package/dist/node_modules/@mui/utils/esm/requirePropFactory/requirePropFactory/index.js +1 -1
  1048. package/dist/node_modules/@mui/utils/esm/requirePropFactory/requirePropFactory/index.js.map +1 -1
  1049. package/dist/node_modules/@mui/utils/esm/unsupportedProp/unsupportedProp/index.esm.js +1 -2
  1050. package/dist/node_modules/@mui/utils/esm/unsupportedProp/unsupportedProp/index.esm.js.map +1 -1
  1051. package/dist/node_modules/@mui/utils/esm/unsupportedProp/unsupportedProp/index.js +1 -1
  1052. package/dist/node_modules/@mui/utils/esm/unsupportedProp/unsupportedProp/index.js.map +1 -1
  1053. package/dist/node_modules/@mui/utils/esm/useControlled/useControlled/index.esm.js +1 -2
  1054. package/dist/node_modules/@mui/utils/esm/useControlled/useControlled/index.esm.js.map +1 -1
  1055. package/dist/node_modules/@mui/utils/esm/useControlled/useControlled/index.js +1 -1
  1056. package/dist/node_modules/@mui/utils/esm/useControlled/useControlled/index.js.map +1 -1
  1057. package/dist/node_modules/@mui/x-date-pickers/DateCalendar/DateCalendar/index.esm.js +1 -2
  1058. package/dist/node_modules/@mui/x-date-pickers/DateCalendar/DateCalendar/index.esm.js.map +1 -1
  1059. package/dist/node_modules/@mui/x-date-pickers/DateCalendar/DateCalendar/index.js +1 -1
  1060. package/dist/node_modules/@mui/x-date-pickers/DateCalendar/DateCalendar/index.js.map +1 -1
  1061. package/dist/node_modules/@mui/x-date-pickers/DateField/DateField/index.esm.js +1 -2
  1062. package/dist/node_modules/@mui/x-date-pickers/DateField/DateField/index.esm.js.map +1 -1
  1063. package/dist/node_modules/@mui/x-date-pickers/DateField/DateField/index.js +2 -2
  1064. package/dist/node_modules/@mui/x-date-pickers/DateField/DateField/index.js.map +1 -1
  1065. package/dist/node_modules/@mui/x-date-pickers/DatePicker/DatePicker/index.esm.js +1 -2
  1066. package/dist/node_modules/@mui/x-date-pickers/DatePicker/DatePicker/index.esm.js.map +1 -1
  1067. package/dist/node_modules/@mui/x-date-pickers/DatePicker/DatePicker/index.js +1 -1
  1068. package/dist/node_modules/@mui/x-date-pickers/DatePicker/DatePicker/index.js.map +1 -1
  1069. package/dist/node_modules/@mui/x-date-pickers/DatePicker/DatePickerToolbar/index.esm.js +1 -2
  1070. package/dist/node_modules/@mui/x-date-pickers/DatePicker/DatePickerToolbar/index.esm.js.map +1 -1
  1071. package/dist/node_modules/@mui/x-date-pickers/DatePicker/DatePickerToolbar/index.js +1 -1
  1072. package/dist/node_modules/@mui/x-date-pickers/DatePicker/DatePickerToolbar/index.js.map +1 -1
  1073. package/dist/node_modules/@mui/x-date-pickers/DateTimeField/DateTimeField/index.esm.js +1 -2
  1074. package/dist/node_modules/@mui/x-date-pickers/DateTimeField/DateTimeField/index.esm.js.map +1 -1
  1075. package/dist/node_modules/@mui/x-date-pickers/DateTimeField/DateTimeField/index.js +2 -2
  1076. package/dist/node_modules/@mui/x-date-pickers/DateTimeField/DateTimeField/index.js.map +1 -1
  1077. package/dist/node_modules/@mui/x-date-pickers/DateTimePicker/DateTimePicker/index.esm.js +1 -2
  1078. package/dist/node_modules/@mui/x-date-pickers/DateTimePicker/DateTimePicker/index.esm.js.map +1 -1
  1079. package/dist/node_modules/@mui/x-date-pickers/DateTimePicker/DateTimePicker/index.js +1 -1
  1080. package/dist/node_modules/@mui/x-date-pickers/DateTimePicker/DateTimePicker/index.js.map +1 -1
  1081. package/dist/node_modules/@mui/x-date-pickers/DateTimePicker/DateTimePickerTabs/index.esm.js +1 -2
  1082. package/dist/node_modules/@mui/x-date-pickers/DateTimePicker/DateTimePickerTabs/index.esm.js.map +1 -1
  1083. package/dist/node_modules/@mui/x-date-pickers/DateTimePicker/DateTimePickerTabs/index.js +1 -1
  1084. package/dist/node_modules/@mui/x-date-pickers/DateTimePicker/DateTimePickerTabs/index.js.map +1 -1
  1085. package/dist/node_modules/@mui/x-date-pickers/DateTimePicker/DateTimePickerToolbar/index.esm.js +1 -2
  1086. package/dist/node_modules/@mui/x-date-pickers/DateTimePicker/DateTimePickerToolbar/index.esm.js.map +1 -1
  1087. package/dist/node_modules/@mui/x-date-pickers/DateTimePicker/DateTimePickerToolbar/index.js +1 -1
  1088. package/dist/node_modules/@mui/x-date-pickers/DateTimePicker/DateTimePickerToolbar/index.js.map +1 -1
  1089. package/dist/node_modules/@mui/x-date-pickers/DigitalClock/DigitalClock/index.esm.js +1 -2
  1090. package/dist/node_modules/@mui/x-date-pickers/DigitalClock/DigitalClock/index.esm.js.map +1 -1
  1091. package/dist/node_modules/@mui/x-date-pickers/DigitalClock/DigitalClock/index.js +1 -1
  1092. package/dist/node_modules/@mui/x-date-pickers/DigitalClock/DigitalClock/index.js.map +1 -1
  1093. package/dist/node_modules/@mui/x-date-pickers/LocalizationProvider/LocalizationProvider/index.esm.js +2 -3
  1094. package/dist/node_modules/@mui/x-date-pickers/LocalizationProvider/LocalizationProvider/index.esm.js.map +1 -1
  1095. package/dist/node_modules/@mui/x-date-pickers/LocalizationProvider/LocalizationProvider/index.js +2 -2
  1096. package/dist/node_modules/@mui/x-date-pickers/LocalizationProvider/LocalizationProvider/index.js.map +1 -1
  1097. package/dist/node_modules/@mui/x-date-pickers/MonthCalendar/MonthCalendar/index.esm.js +1 -2
  1098. package/dist/node_modules/@mui/x-date-pickers/MonthCalendar/MonthCalendar/index.esm.js.map +1 -1
  1099. package/dist/node_modules/@mui/x-date-pickers/MonthCalendar/MonthCalendar/index.js +1 -1
  1100. package/dist/node_modules/@mui/x-date-pickers/MonthCalendar/MonthCalendar/index.js.map +1 -1
  1101. package/dist/node_modules/@mui/x-date-pickers/MultiSectionDigitalClock/MultiSectionDigitalClock/index.esm.js +1 -2
  1102. package/dist/node_modules/@mui/x-date-pickers/MultiSectionDigitalClock/MultiSectionDigitalClock/index.esm.js.map +1 -1
  1103. package/dist/node_modules/@mui/x-date-pickers/MultiSectionDigitalClock/MultiSectionDigitalClock/index.js +1 -1
  1104. package/dist/node_modules/@mui/x-date-pickers/MultiSectionDigitalClock/MultiSectionDigitalClock/index.js.map +1 -1
  1105. package/dist/node_modules/@mui/x-date-pickers/PickersActionBar/PickersActionBar/index.esm.js +1 -2
  1106. package/dist/node_modules/@mui/x-date-pickers/PickersActionBar/PickersActionBar/index.esm.js.map +1 -1
  1107. package/dist/node_modules/@mui/x-date-pickers/PickersActionBar/PickersActionBar/index.js +4 -4
  1108. package/dist/node_modules/@mui/x-date-pickers/PickersActionBar/PickersActionBar/index.js.map +1 -1
  1109. package/dist/node_modules/@mui/x-date-pickers/PickersCalendarHeader/PickersCalendarHeader/index.esm.js +1 -2
  1110. package/dist/node_modules/@mui/x-date-pickers/PickersCalendarHeader/PickersCalendarHeader/index.esm.js.map +1 -1
  1111. package/dist/node_modules/@mui/x-date-pickers/PickersCalendarHeader/PickersCalendarHeader/index.js +1 -1
  1112. package/dist/node_modules/@mui/x-date-pickers/PickersCalendarHeader/PickersCalendarHeader/index.js.map +1 -1
  1113. package/dist/node_modules/@mui/x-date-pickers/PickersDay/PickersDay/index.esm.js +4 -5
  1114. package/dist/node_modules/@mui/x-date-pickers/PickersDay/PickersDay/index.esm.js.map +1 -1
  1115. package/dist/node_modules/@mui/x-date-pickers/PickersDay/PickersDay/index.js +1 -1
  1116. package/dist/node_modules/@mui/x-date-pickers/PickersDay/PickersDay/index.js.map +1 -1
  1117. package/dist/node_modules/@mui/x-date-pickers/PickersLayout/PickersLayout/index.esm.js +1 -2
  1118. package/dist/node_modules/@mui/x-date-pickers/PickersLayout/PickersLayout/index.esm.js.map +1 -1
  1119. package/dist/node_modules/@mui/x-date-pickers/PickersLayout/PickersLayout/index.js +1 -1
  1120. package/dist/node_modules/@mui/x-date-pickers/PickersLayout/PickersLayout/index.js.map +1 -1
  1121. package/dist/node_modules/@mui/x-date-pickers/PickersShortcuts/PickersShortcuts/index.esm.js +1 -2
  1122. package/dist/node_modules/@mui/x-date-pickers/PickersShortcuts/PickersShortcuts/index.esm.js.map +1 -1
  1123. package/dist/node_modules/@mui/x-date-pickers/PickersShortcuts/PickersShortcuts/index.js +2 -2
  1124. package/dist/node_modules/@mui/x-date-pickers/PickersShortcuts/PickersShortcuts/index.js.map +1 -1
  1125. package/dist/node_modules/@mui/x-date-pickers/TimeClock/TimeClock/index.esm.js +1 -2
  1126. package/dist/node_modules/@mui/x-date-pickers/TimeClock/TimeClock/index.esm.js.map +1 -1
  1127. package/dist/node_modules/@mui/x-date-pickers/TimeClock/TimeClock/index.js +2 -2
  1128. package/dist/node_modules/@mui/x-date-pickers/TimeClock/TimeClock/index.js.map +1 -1
  1129. package/dist/node_modules/@mui/x-date-pickers/TimeField/TimeField/index.esm.js +1 -2
  1130. package/dist/node_modules/@mui/x-date-pickers/TimeField/TimeField/index.esm.js.map +1 -1
  1131. package/dist/node_modules/@mui/x-date-pickers/TimeField/TimeField/index.js +1 -1
  1132. package/dist/node_modules/@mui/x-date-pickers/TimeField/TimeField/index.js.map +1 -1
  1133. package/dist/node_modules/@mui/x-date-pickers/TimePicker/TimePicker/index.esm.js +1 -2
  1134. package/dist/node_modules/@mui/x-date-pickers/TimePicker/TimePicker/index.esm.js.map +1 -1
  1135. package/dist/node_modules/@mui/x-date-pickers/TimePicker/TimePicker/index.js +1 -1
  1136. package/dist/node_modules/@mui/x-date-pickers/TimePicker/TimePicker/index.js.map +1 -1
  1137. package/dist/node_modules/@mui/x-date-pickers/TimePicker/TimePickerToolbar/index.esm.js +1 -2
  1138. package/dist/node_modules/@mui/x-date-pickers/TimePicker/TimePickerToolbar/index.esm.js.map +1 -1
  1139. package/dist/node_modules/@mui/x-date-pickers/TimePicker/TimePickerToolbar/index.js +2 -2
  1140. package/dist/node_modules/@mui/x-date-pickers/TimePicker/TimePickerToolbar/index.js.map +1 -1
  1141. package/dist/node_modules/@mui/x-date-pickers/YearCalendar/YearCalendar/index.esm.js +1 -2
  1142. package/dist/node_modules/@mui/x-date-pickers/YearCalendar/YearCalendar/index.esm.js.map +1 -1
  1143. package/dist/node_modules/@mui/x-date-pickers/YearCalendar/YearCalendar/index.js +2 -2
  1144. package/dist/node_modules/@mui/x-date-pickers/YearCalendar/YearCalendar/index.js.map +1 -1
  1145. package/dist/node_modules/@mui/x-date-pickers/internals/hooks/useField/useField.utils/index.esm.js +3 -4
  1146. package/dist/node_modules/@mui/x-date-pickers/internals/hooks/useField/useField.utils/index.esm.js.map +1 -1
  1147. package/dist/node_modules/@mui/x-date-pickers/internals/hooks/useField/useField.utils/index.js +1 -1
  1148. package/dist/node_modules/@mui/x-date-pickers/internals/hooks/useField/useField.utils/index.js.map +1 -1
  1149. package/dist/node_modules/@mui/x-date-pickers/internals/hooks/usePicker/usePicker/index.esm.js +1 -2
  1150. package/dist/node_modules/@mui/x-date-pickers/internals/hooks/usePicker/usePicker/index.esm.js.map +1 -1
  1151. package/dist/node_modules/@mui/x-date-pickers/internals/hooks/usePicker/usePicker/index.js +1 -1
  1152. package/dist/node_modules/@mui/x-date-pickers/internals/hooks/usePicker/usePicker/index.js.map +1 -1
  1153. package/dist/node_modules/@mui/x-date-pickers/internals/hooks/usePicker/usePickerValue/index.esm.js +1 -2
  1154. package/dist/node_modules/@mui/x-date-pickers/internals/hooks/usePicker/usePickerValue/index.esm.js.map +1 -1
  1155. package/dist/node_modules/@mui/x-date-pickers/internals/hooks/usePicker/usePickerValue/index.js +1 -1
  1156. package/dist/node_modules/@mui/x-date-pickers/internals/hooks/usePicker/usePickerValue/index.js.map +1 -1
  1157. package/dist/node_modules/@mui/x-date-pickers/internals/hooks/useViews/index.esm.js +1 -2
  1158. package/dist/node_modules/@mui/x-date-pickers/internals/hooks/useViews/index.esm.js.map +1 -1
  1159. package/dist/node_modules/@mui/x-date-pickers/internals/hooks/useViews/index.js +1 -1
  1160. package/dist/node_modules/@mui/x-date-pickers/internals/hooks/useViews/index.js.map +1 -1
  1161. package/dist/node_modules/@mui/x-date-pickers/internals/utils/warning/index.esm.js.map +1 -1
  1162. package/dist/node_modules/@react-querybuilder/material/dist/react-querybuilder_material/index.esm.js.map +1 -1
  1163. package/dist/node_modules/@react-querybuilder/material/dist/react-querybuilder_material/index.js.map +1 -1
  1164. package/dist/node_modules/@tanstack/table-core/build/lib/index/index.esm.js +20 -11
  1165. package/dist/node_modules/@tanstack/table-core/build/lib/index/index.esm.js.map +1 -1
  1166. package/dist/node_modules/@tanstack/table-core/build/lib/index/index.js +1 -1
  1167. package/dist/node_modules/@tanstack/table-core/build/lib/index/index.js.map +1 -1
  1168. package/dist/node_modules/@tanstack/virtual-core/dist/esm/index/index.esm.js +6 -7
  1169. package/dist/node_modules/@tanstack/virtual-core/dist/esm/index/index.esm.js.map +1 -1
  1170. package/dist/node_modules/@tanstack/virtual-core/dist/esm/index/index.js +1 -1
  1171. package/dist/node_modules/@tanstack/virtual-core/dist/esm/index/index.js.map +1 -1
  1172. package/dist/node_modules/notistack/notistack.esm/index.esm.js +2 -3
  1173. package/dist/node_modules/notistack/notistack.esm/index.esm.js.map +1 -1
  1174. package/dist/node_modules/notistack/notistack.esm/index.js +1 -1
  1175. package/dist/node_modules/notistack/notistack.esm/index.js.map +1 -1
  1176. package/dist/node_modules/prop-types/checkPropTypes/index.esm.js +3 -4
  1177. package/dist/node_modules/prop-types/checkPropTypes/index.esm.js.map +1 -1
  1178. package/dist/node_modules/prop-types/checkPropTypes/index.js +1 -1
  1179. package/dist/node_modules/prop-types/checkPropTypes/index.js.map +1 -1
  1180. package/dist/node_modules/prop-types/factoryWithTypeCheckers/index.esm.js +5 -6
  1181. package/dist/node_modules/prop-types/factoryWithTypeCheckers/index.esm.js.map +1 -1
  1182. package/dist/node_modules/prop-types/factoryWithTypeCheckers/index.js +1 -1
  1183. package/dist/node_modules/prop-types/factoryWithTypeCheckers/index.js.map +1 -1
  1184. package/dist/node_modules/prop-types/index/index.esm.js +1 -2
  1185. package/dist/node_modules/prop-types/index/index.esm.js.map +1 -1
  1186. package/dist/node_modules/prop-types/index/index.js +1 -1
  1187. package/dist/node_modules/prop-types/index/index.js.map +1 -1
  1188. package/dist/src/components/accordion/accordion.d.ts +1 -1
  1189. package/dist/src/components/action-bar/action-bar.d.ts +1 -1
  1190. package/dist/src/components/checkbox/checkbox.d.ts +1 -1
  1191. package/dist/src/components/date-picker/date-picker.d.ts +1 -1
  1192. package/dist/src/components/footer/footer.d.ts +1 -1
  1193. package/dist/src/components/form-control/form-builder/form-builder-element/media.d.ts +1 -1
  1194. package/dist/src/components/form-control/form-builder/form-builder-element/phone.d.ts +1 -1
  1195. package/dist/src/components/form-control/form-builder/form-builder-element/select.d.ts +1 -1
  1196. package/dist/src/components/form-control/form-builder/form-builder-element/text.d.ts +1 -1
  1197. package/dist/src/components/form-control/form-builder/form-builder-element/time.d.ts +1 -1
  1198. package/dist/src/components/form-control/form-parser/form-switcher.d.ts +1 -1
  1199. package/dist/src/components/icons/action-arrow.d.ts +3 -3
  1200. package/dist/src/components/icons/add-circle.d.ts +3 -3
  1201. package/dist/src/components/icons/arrow-bidirectional.d.ts +3 -3
  1202. package/dist/src/components/icons/arrow-circle-down.d.ts +3 -3
  1203. package/dist/src/components/icons/arrow-down-three.d.ts +3 -3
  1204. package/dist/src/components/icons/arrow-down-two.d.ts +3 -3
  1205. package/dist/src/components/icons/arrow-down.d.ts +3 -3
  1206. package/dist/src/components/icons/arrow-up-down.d.ts +3 -3
  1207. package/dist/src/components/icons/arrow-up-two.d.ts +3 -3
  1208. package/dist/src/components/icons/assignments.d.ts +3 -3
  1209. package/dist/src/components/icons/blank-circle.d.ts +3 -3
  1210. package/dist/src/components/icons/block-filled.d.ts +3 -3
  1211. package/dist/src/components/icons/calendar-add.d.ts +3 -3
  1212. package/dist/src/components/icons/calendar.d.ts +3 -3
  1213. package/dist/src/components/icons/checkbox-square.d.ts +3 -3
  1214. package/dist/src/components/icons/circular-arrow-setting.d.ts +3 -3
  1215. package/dist/src/components/icons/clock.d.ts +3 -3
  1216. package/dist/src/components/icons/close.d.ts +3 -3
  1217. package/dist/src/components/icons/coin-outline.d.ts +3 -3
  1218. package/dist/src/components/icons/copy.d.ts +3 -3
  1219. package/dist/src/components/icons/coupon.d.ts +3 -3
  1220. package/dist/src/components/icons/cross-hire.d.ts +3 -3
  1221. package/dist/src/components/icons/custom-styled-icon.d.ts +3 -3
  1222. package/dist/src/components/icons/dashboard.d.ts +3 -3
  1223. package/dist/src/components/icons/document-download.d.ts +3 -3
  1224. package/dist/src/components/icons/document.d.ts +3 -3
  1225. package/dist/src/components/icons/dollar-circle-filled.d.ts +3 -3
  1226. package/dist/src/components/icons/dollar-circle.d.ts +3 -3
  1227. package/dist/src/components/icons/edit.d.ts +3 -3
  1228. package/dist/src/components/icons/email.d.ts +3 -3
  1229. package/dist/src/components/icons/export.d.ts +3 -3
  1230. package/dist/src/components/icons/eye-off.d.ts +3 -3
  1231. package/dist/src/components/icons/eye-plus-circle.d.ts +3 -3
  1232. package/dist/src/components/icons/eye.d.ts +3 -3
  1233. package/dist/src/components/icons/filled-circle.d.ts +3 -3
  1234. package/dist/src/components/icons/filter-remove.d.ts +3 -3
  1235. package/dist/src/components/icons/filter.d.ts +3 -3
  1236. package/dist/src/components/icons/folder-save.d.ts +3 -3
  1237. package/dist/src/components/icons/grid.d.ts +3 -3
  1238. package/dist/src/components/icons/hashtag.d.ts +3 -3
  1239. package/dist/src/components/icons/image.d.ts +3 -3
  1240. package/dist/src/components/icons/import.d.ts +3 -3
  1241. package/dist/src/components/icons/info-circle.d.ts +3 -3
  1242. package/dist/src/components/icons/info.d.ts +3 -3
  1243. package/dist/src/components/icons/link-horizontal.d.ts +3 -3
  1244. package/dist/src/components/icons/link.d.ts +3 -3
  1245. package/dist/src/components/icons/location.d.ts +3 -3
  1246. package/dist/src/components/icons/lowest-lead-time.d.ts +3 -3
  1247. package/dist/src/components/icons/lowest-min-qty.d.ts +3 -3
  1248. package/dist/src/components/icons/lowest-price.d.ts +3 -3
  1249. package/dist/src/components/icons/more.d.ts +3 -3
  1250. package/dist/src/components/icons/notification.d.ts +3 -3
  1251. package/dist/src/components/icons/paper-clip.d.ts +3 -3
  1252. package/dist/src/components/icons/paragraph.d.ts +3 -3
  1253. package/dist/src/components/icons/payment-request.d.ts +3 -3
  1254. package/dist/src/components/icons/phone.d.ts +3 -3
  1255. package/dist/src/components/icons/printer.d.ts +3 -3
  1256. package/dist/src/components/icons/process-calendar.d.ts +3 -3
  1257. package/dist/src/components/icons/promotion.d.ts +3 -3
  1258. package/dist/src/components/icons/radio-button.d.ts +3 -3
  1259. package/dist/src/components/icons/receipt-filled.d.ts +3 -3
  1260. package/dist/src/components/icons/receipt-outline.d.ts +3 -3
  1261. package/dist/src/components/icons/receipt.d.ts +3 -3
  1262. package/dist/src/components/icons/refresh-icon.d.ts +3 -3
  1263. package/dist/src/components/icons/replace.d.ts +3 -3
  1264. package/dist/src/components/icons/save.d.ts +3 -3
  1265. package/dist/src/components/icons/search-status.d.ts +3 -3
  1266. package/dist/src/components/icons/search.d.ts +3 -3
  1267. package/dist/src/components/icons/settings-fallback.d.ts +3 -3
  1268. package/dist/src/components/icons/sort-arrow-icon.d.ts +3 -3
  1269. package/dist/src/components/icons/stacked-layer.d.ts +3 -3
  1270. package/dist/src/components/icons/start-filled.d.ts +3 -3
  1271. package/dist/src/components/icons/three-dot-icon.d.ts +3 -3
  1272. package/dist/src/components/icons/tick-circle-filled.d.ts +3 -3
  1273. package/dist/src/components/icons/tick-circle.d.ts +3 -3
  1274. package/dist/src/components/icons/tick-octagon.d.ts +3 -3
  1275. package/dist/src/components/icons/tick.d.ts +3 -3
  1276. package/dist/src/components/icons/toggle-switch.d.ts +3 -3
  1277. package/dist/src/components/icons/trash.d.ts +3 -3
  1278. package/dist/src/components/icons/wave.d.ts +3 -3
  1279. package/dist/src/components/icons/with-out-tick-octagon.d.ts +3 -3
  1280. package/dist/src/components/icons/work-centre.d.ts +3 -3
  1281. package/dist/src/components/index.d.ts +2 -2
  1282. package/dist/src/components/location-select.d.ts +1 -1
  1283. package/dist/src/components/material-editable-table/material-editable-table.d.ts +1 -1
  1284. package/dist/src/components/material-table/material-table.d.ts +1 -1
  1285. package/dist/src/components/phone-input/phone-input.d.ts +1 -1
  1286. package/dist/src/components/providers/ERPUIProvider.d.ts +2 -0
  1287. package/dist/src/components/radio/radio.d.ts +1 -1
  1288. package/dist/src/components/select/select.d.ts +1 -1
  1289. package/dist/src/components/switches/android-12-switch.d.ts +3 -1
  1290. package/dist/src/components/text-field/text-field.d.ts +1 -1
  1291. package/dist/src/components/time-picker/time-picker.d.ts +1 -1
  1292. package/dist/src/components/upload-media/upload-media.d.ts +1 -1
  1293. package/dist/src/utils/api-config.d.ts +9 -0
  1294. package/dist/src/utils/api.d.ts +1 -0
  1295. package/dist/src/utils/common-utility.d.ts +1 -1
  1296. package/dist/src/utils/index.d.ts +1 -0
  1297. package/dist/style.css +69 -69
  1298. package/dist/utils/api/index.esm.js +20 -7
  1299. package/dist/utils/api/index.esm.js.map +1 -1
  1300. package/dist/utils/api/index.js +1 -1
  1301. package/dist/utils/api/index.js.map +1 -1
  1302. package/dist/utils/api-config/index.esm.js +33 -0
  1303. package/dist/utils/api-config/index.esm.js.map +1 -0
  1304. package/dist/utils/api-config/index.js +2 -0
  1305. package/dist/utils/api-config/index.js.map +1 -0
  1306. package/dist/utils/api-config.d.ts +9 -0
  1307. package/dist/utils/api.d.ts +1 -0
  1308. package/dist/utils/common/index.esm.js +12 -8
  1309. package/dist/utils/common/index.esm.js.map +1 -1
  1310. package/dist/utils/common/index.js +1 -1
  1311. package/dist/utils/common/index.js.map +1 -1
  1312. package/dist/utils/common-utility.d.ts +1 -1
  1313. package/dist/utils/index.esm.js +7 -1
  1314. package/dist/utils/index.esm.js.map +1 -1
  1315. package/dist/utils/index.js +1 -1
  1316. package/dist/views/form-builder/redux/actionCreator/index.esm.js +2 -1
  1317. package/dist/views/form-builder/redux/actionCreator/index.esm.js.map +1 -1
  1318. package/dist/views/form-builder/redux/actionCreator/index.js +1 -1
  1319. package/dist/views/form-builder/redux/actionCreator/index.js.map +1 -1
  1320. package/dist/views/template-editor/components/EditorSidebar/index.esm.js +4 -3
  1321. package/dist/views/template-editor/components/EditorSidebar/index.esm.js.map +1 -1
  1322. package/dist/views/template-editor/components/EditorSidebar/index.js +14 -14
  1323. package/dist/views/template-editor/components/EditorSidebar/index.js.map +1 -1
  1324. package/dist/views/template-editor/templates/index.esm.js +2 -1
  1325. package/dist/views/template-editor/templates/index.esm.js.map +1 -1
  1326. package/dist/views/template-editor/templates/index.js +5 -5
  1327. package/dist/views/template-editor/templates/index.js.map +1 -1
  1328. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/contexts/AuthContext.tsx"],"sourcesContent":["import React, { createContext, useEffect, useRef, useState } from 'react';\nimport {\n\tpostV1AuthChangePassword,\n\tpostV1AuthForgotPassword,\n\tpostV1AuthChangeUserPassword,\n\t// getV1UserId,\n\tpostV1AuthLogin,\n\tpostV1AuthResetPassword,\n\tsetBaseUrl,\n\tpostV1AuthChangeUserPasswordByAdmin\n} from '../api-client/api.rbac/api';\nimport { auth } from '../constants/auth';\nimport { /* useLocation, */ useNavigate } from 'react-router-dom';\nimport { Pathname } from '../constants/pathnames/pathname'; // Removed - should be passed as props or configured by consuming app\nimport { getToken } from '../utils/common';\nimport { enqueueSnackbar } from 'notistack';\nimport { Socket, io } from 'socket.io-client';\nimport { generateRouteWithId } from '../utils/route-utils';\nimport {\n\tPathnameAccounting,\n\tPathnameGenerator\n} from '../constants/pathnames/pathname.accounting';\n\nimport {\n\tPathnameInventory,\n\tPathnameGenerator as PathnameGeneratorInventory\n} from '../constants/pathnames/pathname.inventory';\n\nimport {\n\tPathnameManufacturing,\n\tPathnameGenerator as PathnameGeneratorManufacuring\n} from '../constants/pathnames/pathname.manufacturing';\n\nimport {\n\tPathnamePurchase,\n\tPathnameGenerator as PathnameGeneratorPurchase\n} from '../constants/pathnames/pathname.procurement';\n\nimport {\n\tPathnameCrm,\n\tPathnameGenerator as PathnameGeneratorCrm\n} from '../constants/pathnames/pathname.crm';\n\nimport {\n\tPathnameRental,\n\tPathnameGenerator as PathnameGeneratorRental\n} from '../constants/pathnames/pathname.rental';\n\nimport { ROUTES as RENTALROUTES } from '../constants/pathnames/pathname.rental';\n\nimport CustomSnackbar from '../components/custom-snackbar/custom-snackbar.tsx';\nexport interface LoginFormValues {\n\temail: string;\n\tpassword: string;\n}\n\nexport interface resetFormValues {\n\temail: string;\n}\n\nexport interface resetPasswordValues {\n\ttoken: string;\n}\n\nexport interface changePasswordValues {\n\tpassword: string;\n}\n\nexport interface changeUserPasswordValues {\n\tpassword: string;\n}\n\ninterface ERPApiUser {\n\tid: string | number;\n\tfirst_name: string;\n\tlast_name: string;\n\tmiddle_name: string;\n\tcountry_code: string;\n\temail: string;\n\tcreated_by: any;\n\tupdated_by: any;\n\tcreated_at: string;\n\tupdated_at: string;\n\trole_id: string;\n\tdepartment_id: number;\n\tis_deleted: number;\n\tdeleted_at: string | null;\n\tdeleted_by: any;\n\ttoken: string;\n\tprofile_image: string;\n\tcurrency_data?: {\n\t\tid: number;\n\t\tsymbol: string;\n\t\tcurrency_name: string;\n\t\tnumber_format:string;\n\t\tposition: string | null;\n\t\tfraction_unit: string | null\n\t};\n\taccessCompanies?: any[]\n}\ninterface ERPUser extends Omit<ERPApiUser, 'token'> {\n\tfull_name: string;\n\tcompany_id: string;\n}\n\ninterface DefaultProviderProps {\n\tuser: ERPUser | null;\n\tloading: boolean;\n\tauthToken: string;\n\tsetUser: React.Dispatch<React.SetStateAction<ERPUser | null>>;\n\tsetLoading: React.Dispatch<React.SetStateAction<boolean>>;\n\tlogin: (\n\t\tparams: LoginFormValues,\n\t\tcallback: (err: string) => void\n\t) => Promise<void>;\n\tlogout: () => Promise<void>;\n\tforgotPassword: (\n\t\tparams: resetFormValues,\n\t\tcallback: (err: string) => void\n\t) => Promise<void>;\n\tresetPassword: (\n\t\tparams: resetPasswordValues,\n\t\tcallback: (err: string) => void\n\t) => Promise<void>;\n\tchangePassword: (\n\t\tparams: changePasswordValues,\n\t\tcallback: (err: string) => void\n\t) => Promise<void>;\n\tchangeUserPassword: (\n\t\tparams: changeUserPasswordValues,\n\t\tcallback: (err: string) => void\n\t) => Promise<void>;\n}\n\nconst defaultProvider: DefaultProviderProps = {\n\tuser: null,\n\tloading: true,\n\tauthToken: '',\n\tsetUser: () => null,\n\tsetLoading: () => Boolean,\n\tlogin: () => Promise.resolve(),\n\tlogout: () => Promise.resolve(),\n\tforgotPassword: () => Promise.resolve(),\n\tresetPassword: () => Promise.resolve(),\n\tchangePassword: () => Promise.resolve(),\n\tchangeUserPassword: () => Promise.resolve()\n};\n\nconst AuthContext = createContext(defaultProvider);\n\ninterface AuthProviderProps {\n\tchildren: React.ReactNode;\n}\n\nsetBaseUrl(`${import.meta.env.VITE_BACKEND_BASE_URL}/rbac`);\n\nconst AuthProvider: React.FC<AuthProviderProps> = ({ children }) => {\n\t// ** States\n\tconst [user, setUser] = useState(defaultProvider.user);\n\tconst [authToken, setAuthToken] = useState<string>('');\n\tconst [loading, setLoading] = useState(defaultProvider.loading);\n\tconst socketRef = useRef<Socket | null>(null);\n\n\t// ** Hooks\n\tconst navigate = useNavigate();\n\t// const location = useLocation();\n\tconst isJsonParse = (string?: string | null) => {\n\t\tif (!string) return false;\n\n\t\ttry {\n\t\t\treturn JSON.parse(string);\n\t\t} catch (error) {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tconst getNotificationUrl = (data: any) => {\n\t\tconst { moduleName = '', moduleId = '', notificationData = {} } = data;\n\t\tconst key = moduleName.toLowerCase();\n\n\t\tconst routeMap: Record<string, () => string> = {\n\t\t\t'sales invoice': () =>\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_SALES_INVOICES), moduleId.toString()),\n\n\t\t\t'asset transfers': () =>\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_ASSET_TRANSFER), moduleId.toString()),\n\n\t\t\t'budgets': () =>\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_BUDGET), moduleId.toString()),\n\n\t\t\t'cash expense': () =>\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_CASH_EXPENSE), moduleId.toString()),\n\n\t\t\t'credit notes': () =>\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_CREDIT_NOTE), moduleId.toString()),\n\n\t\t\t'debit notes': () =>\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_DEBIT_NOTE), moduleId.toString()),\n\n\t\t\t'expense reimbursement': () =>\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_EXPENSE_REIMBURSEMENT), moduleId.toString()),\n\n\t\t\t'journal entries': () =>\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_JOURNAL_ENTRY), moduleId.toString()),\n\n\t\t\t'payment entries': () =>\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_PAYMENT_ENTRY), moduleId.toString()),\n\n\t\t\t'purchase invoice': () =>\n\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_PURCHASE_INVOICE), moduleId.toString()),\n\n\t\t\t'stock transfer': () =>\n\t\t\tgenerateRouteWithId(PathnameGeneratorInventory(PathnameInventory.VIEW_STOCK_TRANSFER), moduleId.toString()),\n\n\t\t\t'bills of materials': () =>\n\t\t\tgenerateRouteWithId(PathnameGeneratorManufacuring(PathnameManufacturing.VIEW_BILL_OF_MATERIAL), moduleId.toString()),\n\n\t\t\t'purchase agreement': () =>\n\t\t\tgenerateRouteWithId(PathnameGeneratorPurchase(PathnamePurchase.VIEW_PURCHASE_AGREEMENT), moduleId.toString()),\n\n\t\t\t'purchase orders': () =>\n\t\t\tgenerateRouteWithId(notificationData?.data?.is_rental == 1 ? RENTALROUTES.VIEW : PathnameGeneratorPurchase(PathnamePurchase.VIEW_PURCHASE_ORDER) , moduleId.toString()),\n\n\t\t\t'purchase request': () =>\n\t\t\tgenerateRouteWithId(PathnameGeneratorPurchase(PathnamePurchase.VIEW_PURCHASE_ORDER), moduleId.toString()),\n\n\t\t\t'vra': () =>\n\t\t\tgenerateRouteWithId(PathnameGeneratorPurchase(PathnamePurchase.VIEW_VENDOR_RETURNS), moduleId.toString()),\n\n\t\t\t'sl customer returns': () =>\n\t\t\tgenerateRouteWithId(PathnameGeneratorCrm(PathnameCrm.VIEW_CUSTOMER_RETURNS), moduleId.toString()),\n\n\t\t\t'sales order': () =>\n\t\t\tgenerateRouteWithId(PathnameGeneratorCrm(PathnameCrm.VIEW_SALES_ORDER), moduleId.toString()),\n\n\t\t\t'rental order': () =>\n\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_RENTAL_ORDER), moduleId.toString()),\n\n\t\t\t'replacement order': () =>\n\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_RENTAL_ORDER), moduleId.toString()),\n\n\t\t\t'rental agreement': () =>\n\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_AGREEMENT), moduleId.toString()),\n\n\t\t\t'cross hire order': () =>\n\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_CROSS_HIRE_ORDER), moduleId.toString()),\n\n\t\t\t'cross hire request': () =>\n\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_CROSS_HIRE_REQUEST), moduleId.toString()),\n\t\t};\n\n\t\treturn routeMap[key]?.() || '/dashboard';\n\t};\n\n\n\t// const initAuth = async () => {\n\t// \tconst storedToken = window.localStorage.getItem(auth.storageTokenKeyName);\n\t// \tconst storedUser: ERPUser =\n\t// \t\tisJsonParse(window.localStorage.getItem(auth.storageUserKeyName)) || null;\n\t// \tif (storedToken && storedUser) {\n\t// \t\ttry {\n\t// \t\t\tconst userData = await getV1UserId({\n\t// \t\t\t\t'x-token': storedToken,\n\t// \t\t\t\tid: String(storedUser.id)\n\t// \t\t\t});\n\t// \t\t} catch (error) {\n\t// \t\t}\n\t// \t} else {\n\t// \t\tsetLoading(false);\n\t// \t}\n\t// \tif (storedToken && storedUser) {\n\t// \t\tsetUser(storedUser);\n\t// setLoading(false);\n\t// \t} else {\n\t// \t\thandleLogout();\n\t// setLoading(false);\n\t// \t}\n\t// };\n\n\t// useEffect(() => {\n\t// setLoading(true)\n\t// \tinitAuth();\n\t// \tconst storedToken = window.localStorage.getItem(auth.storageTokenKeyName);\n\t// \tif (!storedToken) {\n\t// \t\tsetUser(null);\n\t// \t} else {\n\t// \t\tsetLoading(false);\n\t// \t}\n\t// \teslint-disable-next-line react-hooks/exhaustive-deps\n\t// }, [location.pathname]);\n\n\t// useEffect(() => {\n\t// \tsetLoading(true);\n\t// \tinitAuth();\n\t// \tconst storedToken = window.localStorage.getItem(auth.storageTokenKeyName);\n\t// \tif (!storedToken) {\n\t// \t\tsetLoading(false);\n\t// \t\tnavigate(Pathname.LOGIN);\n\t// \t}\n\t// \t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t// }, []);\n\n\tuseEffect(() => {\n\t\tsetLoading(true);\n\t\t// initAuth()\n\t\tconst storedToken = window.localStorage.getItem(auth.storageTokenKeyName);\n\t\tconst storedUser =\n\t\t\tisJsonParse(window.localStorage.getItem(auth.storageUserKeyName)) ?? null;\n\t\tconst publicRoutes = [Pathname.LOGIN, Pathname.FORGOT_PASSWORD, Pathname.RESET_PASSWORD, Pathname.CHANGE_PASSWORD];\n\t\tconst currentPath = window.location.pathname;\n\t\tif (!storedToken && !storedUser) {\n\t\t\tif (!publicRoutes.includes(currentPath)) {\n\t\t\t\tnavigate(Pathname.LOGIN);\n\t\t\t}\n\t\t\tsetLoading(false);\n\t\t} else {\n\t\t\tsetUser(storedUser);\n\t\t\tsetAuthToken(storedToken || '');\n\t\t\tsetLoading(false);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (!authToken) {\n\t\t\tif (socketRef.current) {\n\t\t\t\tsocketRef.current?.disconnect();\n\t\t\t\tsocketRef.current = null\n\t\t\t}\n\t\t\tconsole.warn(\"No auth token found, not connecting to socket.\");\n\t\t\treturn;\n\t\t}\n\n\t\tconst socket = io(import.meta.env.VITE_SOCKET_BASE_URL, {\n\t\t\ttransports: [\"websocket\"],\n\t\t\tauth: { token: authToken },\n\t\t\tpath: \"/socket.io/\",\n\t\t\t\n\t\t});\n\t\tsocketRef.current = socket;\n\n\t\tsocket.on(\"connect\", () => {\n\t\t\tconsole.log(\"Socket connected:\", socket.id);\n\t\t\tsocket.onAny((event, ...args) => {\n\t\t\t\tconsole.log(`Received event: ${event}`, args);\n\t\t\t});\n\t\t});\n\t\t\n\t\t// socket event handler\n\t\tsocket.on('notification', (data) => {\n\t\tconst { message, notificationData } = data || {};\n\t\tlet notificationContent: React.ReactNode = message;\n\t\tconst url = getNotificationUrl(data);\n\n\t\tif (notificationData) {\n\t\t\tconst { notification_type } = notificationData;\n\n\t\t\tswitch (notification_type) {\n\t\t\t\tcase 'addApprovers': {\n\t\t\t\t\t\n\t\t\t\t\tnotificationContent = message;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase 'change_approval_status': {\n\t\t\t\t\tnotificationContent = message;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tdefault: {\n\t\t\t\t\tnotificationContent = message;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tenqueueSnackbar(String(message), {\n\t\t\tvariant: 'default',\n\t\t\tanchorOrigin: { vertical: 'top', horizontal: 'center' },\n\t\t\tautoHideDuration: 5000,\n\t\t\tcontent: (key) => (\n\t\t\t<CustomSnackbar snackbarKey={key} message={notificationContent} data={notificationData} variant=\"default\" linkUrl={url}/>\n\t\t\t),\n\t\t});\n\t\t});\n\n\n\t\tsocket.on(\"sales_invoice_viewed\", (data) => {\n\t\t\tconsole.log(\"Invoice viewed:\", data.invoiceId, \"by user:\", data.userId);\n\t\t});\n\n\t\tsocket.on(\"error\", (errMsg) => {\n\t\t\tenqueueSnackbar(`Socket error: ${errMsg}`, { variant: \"error\" });\n\t\t\tconsole.error(\"Socket error:\", errMsg);\n\t\t});\n\n\t\t// Clean up on unmount\n\t\treturn () => {\n\t\t\tif (socketRef.current) {\n\t\t\t\tsocketRef.current.disconnect();\n\t\t\t\tsocketRef.current = null\n\t\t\t}\n\t\t};\n\t}, [authToken]);\n\n\tconst handleLogin = async (\n\t\tparams: LoginFormValues,\n\t\tcallback: (err: string) => void\n\t) => {\n\t\tsetLoading(true);\n\t\tconst storedToken = window.localStorage.getItem(auth.storageTokenKeyName);\n\t\tif (storedToken && user) {\n\t\t\treturn navigate(Pathname.DASHBOARD);\n\t\t}\n\n\t\ttry {\n\t\t\tconst loginUser = await postV1AuthLogin({ ...params, ...getToken() });\n\t\t\tif (loginUser.success) {\n\t\t\t\tconst data: ERPApiUser | null = loginUser?.data?.login || null;\n\t\t\t\tif (data) {\n\t\t\t\t\twindow.localStorage.setItem(auth.storageTokenKeyName, data.token);\n\t\t\t\t\tconst userData: ERPUser = {\n\t\t\t\t\t\t...data,\n\t\t\t\t\t\tfull_name: `${data.first_name} ${data.last_name}`\n\t\t\t\t\t};\n\t\t\t\t\twindow.localStorage.setItem(\n\t\t\t\t\t\tauth.storageUserKeyName,\n\t\t\t\t\t\tJSON.stringify(userData)\n\t\t\t\t\t);\n\t\t\t\t\tsetUser(userData);\n\t\t\t\t\tsetAuthToken(data.token);\n\t\t\t\t\tnavigate(Pathname.DASHBOARD);\n\t\t\t\t\tsetLoading(false);\n\t\t\t\t\tdelete data.token;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t}\n\n\t\t\tcallback(message);\n\t\t}\n\t};\n\n\tconst handleLogout = async () => {\n\t\twindow.localStorage.removeItem(auth.storageTokenKeyName);\n\t\twindow.localStorage.removeItem(auth.storageUserKeyName);\n\t\twindow.localStorage.removeItem(auth.storageAccessKeyName);\n\t\tsetUser(null);\n\t\tsetAuthToken('');\n\t\tnavigate(Pathname.LOGIN);\n\t};\n\n\tconst handleForgotPassword = async (params: resetFormValues,\n\t\tcallback: (type: boolean, err: string) => void) => {\n\t\ttry {\n\t\t\tawait postV1AuthForgotPassword({ ...params, ...getToken() });\n\t\t\tcallback(true, \"Reset Link sent to your email\");\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t}\n\n\t\t\tcallback(false, message);\n\t\t}\n\t};\n\n\tconst handleResetPassword = async (params: resetPasswordValues,\n\t\tcallback: (err: string) => void) => {\n\t\ttry {\n\t\t\tconst response = await postV1AuthResetPassword({ ...params, ...getToken() });\n\t\t\tcallback(response);\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tconsole.log(\"Error \", error)\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t\tcallback(message);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst handleChangePassword = async (params: resetPasswordValues,\n\t\tcallback: (err: string) => void) => {\n\t\ttry {\n\t\t\tawait postV1AuthChangePassword({ ...params, ...getToken() });\n\t\t\tcallback(null);\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tconsole.log(\"Error \", error)\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t\tcallback(message);\n\t\t\t}\n\t\t}\n\t\tcallback(\"reset\");\n\t}\n\n\tconst handleChangeUserPassword = async (params: resetPasswordValues,\n\t\tcallback: (err: string, resType: boolean) => void) => {\n\t\ttry {\n\t\t\tawait postV1AuthChangeUserPassword({ ...params, ...getToken() });\n\t\t\tcallback('Password Changed Successfully', true);\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t\tcallback(message, false);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst handleChangeUserPasswordByAdmin = async (params: changePasswordValues,\n\t\tcallback: (err: string, resType: boolean) => void) => {\n\t\ttry {\n\t\t\tawait postV1AuthChangeUserPasswordByAdmin({ ...params, ...getToken() });\n\t\t\tcallback('Password Changed Successfully', true);\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t\tcallback(message, false);\n\t\t\t}\n\t\t}\n\t}\n\n\n\tconst values = {\n\t\tuser,\n\t\tauthToken,\n\t\tloading,\n\t\tsetUser,\n\t\tsetLoading,\n\t\tlogin: handleLogin,\n\t\tlogout: handleLogout,\n\t\tforgotPassword: handleForgotPassword,\n\t\tresetPassword: handleResetPassword,\n\t\tchangePassword: handleChangePassword,\n\t\tchangeUserPassword: handleChangeUserPassword,\n\t\tchangeUserPasswordByAdmin: handleChangeUserPasswordByAdmin\n\t};\n\n\treturn <AuthContext.Provider value={values}>{children}</AuthContext.Provider>;\n};\n\nexport { AuthContext, AuthProvider };\n"],"names":["defaultProvider","user","loading","authToken","setUser","setLoading","Boolean","login","Promise","resolve","logout","forgotPassword","resetPassword","changePassword","changeUserPassword","AuthContext","createContext","setBaseUrl","children","useState","setAuthToken","socketRef","useRef","navigate","useNavigate","isJsonParse","string","JSON","parse","error","useEffect","storedToken","window","localStorage","getItem","auth","storageTokenKeyName","storedUser","storageUserKeyName","publicRoutes","Pathname","LOGIN","FORGOT_PASSWORD","RESET_PASSWORD","CHANGE_PASSWORD","currentPath","location","pathname","includes","current","_a","disconnect","socket","io","transports","token","path","on","onAny","event","args","data","message","notificationData","notificationContent","url","moduleName","moduleId","routeMap","generateRouteWithId","PathnameGenerator","PathnameAccounting","VIEW_SALES_INVOICES","toString","VIEW_ASSET_TRANSFER","budgets","VIEW_BUDGET","VIEW_CASH_EXPENSE","VIEW_CREDIT_NOTE","VIEW_DEBIT_NOTE","VIEW_EXPENSE_REIMBURSEMENT","VIEW_JOURNAL_ENTRY","VIEW_PAYMENT_ENTRY","VIEW_PURCHASE_INVOICE","PathnameGeneratorInventory","PathnameInventory","VIEW_STOCK_TRANSFER","PathnameGeneratorManufacuring","PathnameManufacturing","VIEW_BILL_OF_MATERIAL","PathnameGeneratorPurchase","PathnamePurchase","VIEW_PURCHASE_AGREEMENT","is_rental","RENTALROUTES","VIEW","VIEW_PURCHASE_ORDER","vra","VIEW_VENDOR_RETURNS","PathnameGeneratorCrm","PathnameCrm","VIEW_CUSTOMER_RETURNS","VIEW_SALES_ORDER","PathnameGeneratorRental","PathnameRental","VIEW_RENTAL_ORDER","VIEW_AGREEMENT","VIEW_CROSS_HIRE_ORDER","VIEW_CROSS_HIRE_REQUEST","toLowerCase","call","getNotificationUrl","notification_type","enqueueSnackbar","String","variant","anchorOrigin","vertical","horizontal","autoHideDuration","content","key","jsx","CustomSnackbar","snackbarKey","linkUrl","errMsg","values","async","params","callback","DASHBOARD","loginUser","postV1AuthLogin","getToken","success","setItem","userData","full_name","first_name","last_name","stringify","Error","removeItem","storageAccessKeyName","postV1AuthForgotPassword","postV1AuthResetPassword","postV1AuthChangePassword","postV1AuthChangeUserPassword","changeUserPasswordByAdmin","postV1AuthChangeUserPasswordByAdmin","Provider","value"],"mappings":"67BAsIA,MAAMA,EAAwC,CAC7CC,KAAM,KACNC,SAAS,EACTC,UAAW,GACXC,QAAS,IAAM,KACfC,WAAY,IAAMC,QAClBC,MAAO,IAAMC,QAAQC,UACrBC,OAAQ,IAAMF,QAAQC,UACtBE,eAAgB,IAAMH,QAAQC,UAC9BG,cAAe,IAAMJ,QAAQC,UAC7BI,eAAgB,IAAML,QAAQC,UAC9BK,mBAAoB,IAAMN,QAAQC,WAG7BM,EAAcC,EAAAA,cAAchB,GAMlCiB,EAAAA,WAAW,8EAEuC,EAAGC,eAEpD,MAAOjB,EAAMG,GAAWe,EAAAA,SAASnB,EAAgBC,OAC1CE,EAAWiB,GAAgBD,EAAAA,SAAiB,KAC5CjB,EAASG,GAAcc,EAAAA,SAASnB,EAAgBE,SACjDmB,EAAYC,EAAAA,OAAsB,MAGlCC,EAAWC,EAAAA,cAEXC,EAAeC,IACpB,IAAKA,EAAQ,OAAO,EAEpB,IACC,OAAOC,KAAKC,MAAMF,EACnB,OAASG,GACR,OAAO,CACR,GAiIDC,EAAAA,UAAU,KACTzB,GAAW,GAEX,MAAM0B,EAAcC,OAAOC,aAAaC,QAAQC,EAAAA,KAAKC,qBAC/CC,EACLZ,EAAYO,OAAOC,aAAaC,QAAQC,EAAAA,KAAKG,sBAAwB,KAChEC,EAAe,CAACC,EAAAA,SAASC,MAAOD,EAAAA,SAASE,gBAAiBF,WAASG,eAAgBH,EAAAA,SAASI,iBAC5FC,EAAcb,OAAOc,SAASC,SAC/BhB,GAAgBM,GAMpBjC,EAAQiC,GACRjB,EAAaW,GAAe,IAC5B1B,GAAW,KAPNkC,EAAaS,SAASH,IAC1B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EAAMiC,SAASA,SAAWjC,EAAMiC,QACtDoE,EAASpE,GAEX,CACAoE,EAAS,UA2CTpH,mBAxCgCkH,MAAOC,EACvCC,KACA,UACOkB,EAAAA,6BAA6B,IAAKnB,KAAWK,EAAAA,aACnDJ,EAAS,iCAAiC,EAC3C,OAASrG,GACR,IAAIiC,EAAkB,uBAClBjC,aAAiBiH,QACpBhF,EAAUrC,EAAYI,EAAMiC,SAASA,SAAWjC,EAAMiC,QACtDoE,EAASpE,GAAS,GAEpB,GA8BAuF,0BA3BuCrB,MAAOC,EAC9CC,KACA,UACOoB,EAAAA,oCAAoC,IAAKrB,KAAWK,EAAAA,aAC1DJ,EAAS,iCAAiC,EAC3C,OAASrG,GACR,IAAIiC,EAAkB,uBAClBjC,aAAiBiH,QACpBhF,EAAUrC,EAAYI,EAAMiC,SAASA,SAAWjC,EAAMiC,QACtDoE,EAASpE,GAAS,GAEpB;AAmBD,aAAQ/C,EAAYwI,SAAZ,CAAqBC,MAAOzB,EAAS7G"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/contexts/AuthContext.tsx"],"sourcesContent":["import React, { createContext, useEffect, useRef, useState } from 'react';\nimport {\n\tpostV1AuthChangePassword,\n\tpostV1AuthForgotPassword,\n\tpostV1AuthChangeUserPassword,\n\t// getV1UserId,\n\tpostV1AuthLogin,\n\tpostV1AuthResetPassword,\n\tsetBaseUrl,\n\tpostV1AuthChangeUserPasswordByAdmin\n} from '../api-client/api.rbac/api';\nimport { auth } from '../constants/auth';\nimport { /* useLocation, */ useNavigate } from 'react-router-dom';\nimport { Pathname } from '../constants/pathnames/pathname'; // Removed - should be passed as props or configured by consuming app\nimport { getToken } from '../utils/common';\nimport { enqueueSnackbar } from 'notistack';\nimport { Socket, io } from 'socket.io-client';\nimport { generateRouteWithId } from '../utils/route-utils';\nimport { getApiConfig } from '../utils/api-config';\nimport {\n\tPathnameAccounting,\n\tPathnameGenerator\n} from '../constants/pathnames/pathname.accounting';\n\nimport {\n\tPathnameInventory,\n\tPathnameGenerator as PathnameGeneratorInventory\n} from '../constants/pathnames/pathname.inventory';\n\nimport {\n\tPathnameManufacturing,\n\tPathnameGenerator as PathnameGeneratorManufacuring\n} from '../constants/pathnames/pathname.manufacturing';\n\nimport {\n\tPathnamePurchase,\n\tPathnameGenerator as PathnameGeneratorPurchase\n} from '../constants/pathnames/pathname.procurement';\n\nimport {\n\tPathnameCrm,\n\tPathnameGenerator as PathnameGeneratorCrm\n} from '../constants/pathnames/pathname.crm';\n\nimport {\n\tPathnameRental,\n\tPathnameGenerator as PathnameGeneratorRental\n} from '../constants/pathnames/pathname.rental';\n\nimport { ROUTES as RENTALROUTES } from '../constants/pathnames/pathname.rental';\n\nimport CustomSnackbar from '../components/custom-snackbar/custom-snackbar.tsx';\nexport interface LoginFormValues {\n\temail: string;\n\tpassword: string;\n}\n\nexport interface resetFormValues {\n\temail: string;\n}\n\nexport interface resetPasswordValues {\n\ttoken: string;\n}\n\nexport interface changePasswordValues {\n\tpassword: string;\n}\n\nexport interface changeUserPasswordValues {\n\tpassword: string;\n}\n\ninterface ERPApiUser {\n\tid: string | number;\n\tfirst_name: string;\n\tlast_name: string;\n\tmiddle_name: string;\n\tcountry_code: string;\n\temail: string;\n\tcreated_by: any;\n\tupdated_by: any;\n\tcreated_at: string;\n\tupdated_at: string;\n\trole_id: string;\n\tdepartment_id: number;\n\tis_deleted: number;\n\tdeleted_at: string | null;\n\tdeleted_by: any;\n\ttoken: string;\n\tprofile_image: string;\n\tcurrency_data?: {\n\t\tid: number;\n\t\tsymbol: string;\n\t\tcurrency_name: string;\n\t\tnumber_format: string;\n\t\tposition: string | null;\n\t\tfraction_unit: string | null\n\t};\n\taccessCompanies?: any[]\n}\ninterface ERPUser extends Omit<ERPApiUser, 'token'> {\n\tfull_name: string;\n\tcompany_id: string;\n}\n\ninterface DefaultProviderProps {\n\tuser: ERPUser | null;\n\tloading: boolean;\n\tauthToken: string;\n\tsetUser: React.Dispatch<React.SetStateAction<ERPUser | null>>;\n\tsetLoading: React.Dispatch<React.SetStateAction<boolean>>;\n\tlogin: (\n\t\tparams: LoginFormValues,\n\t\tcallback: (err: string) => void\n\t) => Promise<void>;\n\tlogout: () => Promise<void>;\n\tforgotPassword: (\n\t\tparams: resetFormValues,\n\t\tcallback: (err: string) => void\n\t) => Promise<void>;\n\tresetPassword: (\n\t\tparams: resetPasswordValues,\n\t\tcallback: (err: string) => void\n\t) => Promise<void>;\n\tchangePassword: (\n\t\tparams: changePasswordValues,\n\t\tcallback: (err: string) => void\n\t) => Promise<void>;\n\tchangeUserPassword: (\n\t\tparams: changeUserPasswordValues,\n\t\tcallback: (err: string) => void\n\t) => Promise<void>;\n}\n\nconst defaultProvider: DefaultProviderProps = {\n\tuser: null,\n\tloading: true,\n\tauthToken: '',\n\tsetUser: () => null,\n\tsetLoading: () => Boolean,\n\tlogin: () => Promise.resolve(),\n\tlogout: () => Promise.resolve(),\n\tforgotPassword: () => Promise.resolve(),\n\tresetPassword: () => Promise.resolve(),\n\tchangePassword: () => Promise.resolve(),\n\tchangeUserPassword: () => Promise.resolve()\n};\n\nconst AuthContext = createContext(defaultProvider);\n\ninterface AuthProviderProps {\n\tchildren: React.ReactNode;\n}\n\n// Base URL will be set at runtime via ERPUIProvider\n\nconst AuthProvider: React.FC<AuthProviderProps> = ({ children }) => {\n\t// ** States\n\tconst [user, setUser] = useState(defaultProvider.user);\n\tconst [authToken, setAuthToken] = useState<string>('');\n\tconst [loading, setLoading] = useState(defaultProvider.loading);\n\tconst socketRef = useRef<Socket | null>(null);\n\n\t// ** Hooks\n\tconst navigate = useNavigate();\n\t// const location = useLocation();\n\tconst isJsonParse = (string?: string | null) => {\n\t\tif (!string) return false;\n\n\t\ttry {\n\t\t\treturn JSON.parse(string);\n\t\t} catch (error) {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tconst getNotificationUrl = (data: any) => {\n\t\tconst { moduleName = '', moduleId = '', notificationData = {} } = data;\n\t\tconst key = moduleName.toLowerCase();\n\n\t\tconst routeMap: Record<string, () => string> = {\n\t\t\t'sales invoice': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_SALES_INVOICES), moduleId.toString()),\n\n\t\t\t'asset transfers': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_ASSET_TRANSFER), moduleId.toString()),\n\n\t\t\t'budgets': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_BUDGET), moduleId.toString()),\n\n\t\t\t'cash expense': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_CASH_EXPENSE), moduleId.toString()),\n\n\t\t\t'credit notes': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_CREDIT_NOTE), moduleId.toString()),\n\n\t\t\t'debit notes': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_DEBIT_NOTE), moduleId.toString()),\n\n\t\t\t'expense reimbursement': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_EXPENSE_REIMBURSEMENT), moduleId.toString()),\n\n\t\t\t'journal entries': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_JOURNAL_ENTRY), moduleId.toString()),\n\n\t\t\t'payment entries': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_PAYMENT_ENTRY), moduleId.toString()),\n\n\t\t\t'purchase invoice': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGenerator(PathnameAccounting.VIEW_PURCHASE_INVOICE), moduleId.toString()),\n\n\t\t\t'stock transfer': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorInventory(PathnameInventory.VIEW_STOCK_TRANSFER), moduleId.toString()),\n\n\t\t\t'bills of materials': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorManufacuring(PathnameManufacturing.VIEW_BILL_OF_MATERIAL), moduleId.toString()),\n\n\t\t\t'purchase agreement': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorPurchase(PathnamePurchase.VIEW_PURCHASE_AGREEMENT), moduleId.toString()),\n\n\t\t\t'purchase orders': () =>\n\t\t\t\tgenerateRouteWithId(notificationData?.data?.is_rental == 1 ? RENTALROUTES.VIEW : PathnameGeneratorPurchase(PathnamePurchase.VIEW_PURCHASE_ORDER), moduleId.toString()),\n\n\t\t\t'purchase request': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorPurchase(PathnamePurchase.VIEW_PURCHASE_ORDER), moduleId.toString()),\n\n\t\t\t'vra': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorPurchase(PathnamePurchase.VIEW_VENDOR_RETURNS), moduleId.toString()),\n\n\t\t\t'sl customer returns': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorCrm(PathnameCrm.VIEW_CUSTOMER_RETURNS), moduleId.toString()),\n\n\t\t\t'sales order': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorCrm(PathnameCrm.VIEW_SALES_ORDER), moduleId.toString()),\n\n\t\t\t'rental order': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_RENTAL_ORDER), moduleId.toString()),\n\n\t\t\t'replacement order': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_RENTAL_ORDER), moduleId.toString()),\n\n\t\t\t'rental agreement': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_AGREEMENT), moduleId.toString()),\n\n\t\t\t'cross hire order': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_CROSS_HIRE_ORDER), moduleId.toString()),\n\n\t\t\t'cross hire request': () =>\n\t\t\t\tgenerateRouteWithId(PathnameGeneratorRental(PathnameRental.VIEW_CROSS_HIRE_REQUEST), moduleId.toString()),\n\t\t};\n\n\t\treturn routeMap[key]?.() || '/dashboard';\n\t};\n\n\n\t// const initAuth = async () => {\n\t// \tconst storedToken = window.localStorage.getItem(auth.storageTokenKeyName);\n\t// \tconst storedUser: ERPUser =\n\t// \t\tisJsonParse(window.localStorage.getItem(auth.storageUserKeyName)) || null;\n\t// \tif (storedToken && storedUser) {\n\t// \t\ttry {\n\t// \t\t\tconst userData = await getV1UserId({\n\t// \t\t\t\t'x-token': storedToken,\n\t// \t\t\t\tid: String(storedUser.id)\n\t// \t\t\t});\n\t// \t\t} catch (error) {\n\t// \t\t}\n\t// \t} else {\n\t// \t\tsetLoading(false);\n\t// \t}\n\t// \tif (storedToken && storedUser) {\n\t// \t\tsetUser(storedUser);\n\t// setLoading(false);\n\t// \t} else {\n\t// \t\thandleLogout();\n\t// setLoading(false);\n\t// \t}\n\t// };\n\n\t// useEffect(() => {\n\t// setLoading(true)\n\t// \tinitAuth();\n\t// \tconst storedToken = window.localStorage.getItem(auth.storageTokenKeyName);\n\t// \tif (!storedToken) {\n\t// \t\tsetUser(null);\n\t// \t} else {\n\t// \t\tsetLoading(false);\n\t// \t}\n\t// \teslint-disable-next-line react-hooks/exhaustive-deps\n\t// }, [location.pathname]);\n\n\t// useEffect(() => {\n\t// \tsetLoading(true);\n\t// \tinitAuth();\n\t// \tconst storedToken = window.localStorage.getItem(auth.storageTokenKeyName);\n\t// \tif (!storedToken) {\n\t// \t\tsetLoading(false);\n\t// \t\tnavigate(Pathname.LOGIN);\n\t// \t}\n\t// \t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t// }, []);\n\n\tuseEffect(() => {\n\t\tsetLoading(true);\n\t\t// initAuth()\n\t\tconst storedToken = window.localStorage.getItem(auth.storageTokenKeyName);\n\t\tconst storedUser =\n\t\t\tisJsonParse(window.localStorage.getItem(auth.storageUserKeyName)) ?? null;\n\t\tconst publicRoutes = [Pathname.LOGIN, Pathname.FORGOT_PASSWORD, Pathname.RESET_PASSWORD, Pathname.CHANGE_PASSWORD];\n\t\tconst currentPath = window.location.pathname;\n\t\tif (!storedToken && !storedUser) {\n\t\t\tif (!publicRoutes.includes(currentPath)) {\n\t\t\t\tnavigate(Pathname.LOGIN);\n\t\t\t}\n\t\t\tsetLoading(false);\n\t\t} else {\n\t\t\tsetUser(storedUser);\n\t\t\tsetAuthToken(storedToken || '');\n\t\t\tsetLoading(false);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (!authToken) {\n\t\t\tif (socketRef.current) {\n\t\t\t\tsocketRef.current?.disconnect();\n\t\t\t\tsocketRef.current = null\n\t\t\t}\n\t\t\tconsole.warn(\"No auth token found, not connecting to socket.\");\n\t\t\treturn;\n\t\t}\n\n\t\tconst config = getApiConfig();\n\t\tconst socket = io(config.socketBaseUrl, {\n\t\t\ttransports: [\"websocket\"],\n\t\t\tauth: { token: authToken },\n\t\t\tpath: \"/socket.io/\",\n\n\t\t});\n\t\tsocketRef.current = socket;\n\n\t\tsocket.on(\"connect\", () => {\n\t\t\tconsole.log(\"Socket connected:\", socket.id);\n\t\t\tsocket.onAny((event, ...args) => {\n\t\t\t\tconsole.log(`Received event: ${event}`, args);\n\t\t\t});\n\t\t});\n\n\t\t// socket event handler\n\t\tsocket.on('notification', (data) => {\n\t\t\tconst { message, notificationData } = data || {};\n\t\t\tlet notificationContent: React.ReactNode = message;\n\t\t\tconst url = getNotificationUrl(data);\n\n\t\t\tif (notificationData) {\n\t\t\t\tconst { notification_type } = notificationData;\n\n\t\t\t\tswitch (notification_type) {\n\t\t\t\t\tcase 'addApprovers': {\n\n\t\t\t\t\t\tnotificationContent = message;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase 'change_approval_status': {\n\t\t\t\t\t\tnotificationContent = message;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\tnotificationContent = message;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tenqueueSnackbar(String(message), {\n\t\t\t\tvariant: 'default',\n\t\t\t\tanchorOrigin: { vertical: 'top', horizontal: 'center' },\n\t\t\t\tautoHideDuration: 5000,\n\t\t\t\tcontent: (key) => (\n\t\t\t\t\t<CustomSnackbar snackbarKey={key} message={notificationContent} data={notificationData} variant=\"default\" linkUrl={url} />\n\t\t\t\t),\n\t\t\t});\n\t\t});\n\n\n\t\tsocket.on(\"sales_invoice_viewed\", (data) => {\n\t\t\tconsole.log(\"Invoice viewed:\", data.invoiceId, \"by user:\", data.userId);\n\t\t});\n\n\t\tsocket.on(\"error\", (errMsg) => {\n\t\t\tenqueueSnackbar(`Socket error: ${errMsg}`, { variant: \"error\" });\n\t\t\tconsole.error(\"Socket error:\", errMsg);\n\t\t});\n\n\t\t// Clean up on unmount\n\t\treturn () => {\n\t\t\tif (socketRef.current) {\n\t\t\t\tsocketRef.current.disconnect();\n\t\t\t\tsocketRef.current = null\n\t\t\t}\n\t\t};\n\t}, [authToken]);\n\n\tconst handleLogin = async (\n\t\tparams: LoginFormValues,\n\t\tcallback: (err: string) => void\n\t) => {\n\t\tsetLoading(true);\n\t\tconst storedToken = window.localStorage.getItem(auth.storageTokenKeyName);\n\t\tif (storedToken && user) {\n\t\t\treturn navigate(Pathname.DASHBOARD);\n\t\t}\n\n\t\ttry {\n\t\t\tconst loginUser = await postV1AuthLogin({ ...params, ...getToken() });\n\t\t\tif (loginUser.success) {\n\t\t\t\tconst data: ERPApiUser | null = loginUser?.data?.login || null;\n\t\t\t\tif (data) {\n\t\t\t\t\twindow.localStorage.setItem(auth.storageTokenKeyName, data.token);\n\t\t\t\t\tconst userData: ERPUser = {\n\t\t\t\t\t\t...data,\n\t\t\t\t\t\tfull_name: `${data.first_name} ${data.last_name}`\n\t\t\t\t\t};\n\t\t\t\t\twindow.localStorage.setItem(\n\t\t\t\t\t\tauth.storageUserKeyName,\n\t\t\t\t\t\tJSON.stringify(userData)\n\t\t\t\t\t);\n\t\t\t\t\tsetUser(userData);\n\t\t\t\t\tsetAuthToken(data.token);\n\t\t\t\t\tnavigate(Pathname.DASHBOARD);\n\t\t\t\t\tsetLoading(false);\n\t\t\t\t\tdelete data.token;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t}\n\n\t\t\tcallback(message);\n\t\t}\n\t};\n\n\tconst handleLogout = async () => {\n\t\twindow.localStorage.removeItem(auth.storageTokenKeyName);\n\t\twindow.localStorage.removeItem(auth.storageUserKeyName);\n\t\twindow.localStorage.removeItem(auth.storageAccessKeyName);\n\t\tsetUser(null);\n\t\tsetAuthToken('');\n\t\tnavigate(Pathname.LOGIN);\n\t};\n\n\tconst handleForgotPassword = async (params: resetFormValues,\n\t\tcallback: (type: boolean, err: string) => void) => {\n\t\ttry {\n\t\t\tawait postV1AuthForgotPassword({ ...params, ...getToken() });\n\t\t\tcallback(true, \"Reset Link sent to your email\");\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t}\n\n\t\t\tcallback(false, message);\n\t\t}\n\t};\n\n\tconst handleResetPassword = async (params: resetPasswordValues,\n\t\tcallback: (err: string) => void) => {\n\t\ttry {\n\t\t\tconst response = await postV1AuthResetPassword({ ...params, ...getToken() });\n\t\t\tcallback(response);\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tconsole.log(\"Error \", error)\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t\tcallback(message);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst handleChangePassword = async (params: resetPasswordValues,\n\t\tcallback: (err: string) => void) => {\n\t\ttry {\n\t\t\tawait postV1AuthChangePassword({ ...params, ...getToken() });\n\t\t\tcallback(null);\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tconsole.log(\"Error \", error)\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t\tcallback(message);\n\t\t\t}\n\t\t}\n\t\tcallback(\"reset\");\n\t}\n\n\tconst handleChangeUserPassword = async (params: resetPasswordValues,\n\t\tcallback: (err: string, resType: boolean) => void) => {\n\t\ttry {\n\t\t\tawait postV1AuthChangeUserPassword({ ...params, ...getToken() });\n\t\t\tcallback('Password Changed Successfully', true);\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t\tcallback(message, false);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst handleChangeUserPasswordByAdmin = async (params: changePasswordValues,\n\t\tcallback: (err: string, resType: boolean) => void) => {\n\t\ttry {\n\t\t\tawait postV1AuthChangeUserPasswordByAdmin({ ...params, ...getToken() });\n\t\t\tcallback('Password Changed Successfully', true);\n\t\t} catch (error) {\n\t\t\tlet message: string = 'Something went wrong';\n\t\t\tif (error instanceof Error) {\n\t\t\t\tmessage = isJsonParse(error.message).message || error.message;\n\t\t\t\tcallback(message, false);\n\t\t\t}\n\t\t}\n\t}\n\n\n\tconst values = {\n\t\tuser,\n\t\tauthToken,\n\t\tloading,\n\t\tsetUser,\n\t\tsetLoading,\n\t\tlogin: handleLogin,\n\t\tlogout: handleLogout,\n\t\tforgotPassword: handleForgotPassword,\n\t\tresetPassword: handleResetPassword,\n\t\tchangePassword: handleChangePassword,\n\t\tchangeUserPassword: handleChangeUserPassword,\n\t\tchangeUserPasswordByAdmin: handleChangeUserPasswordByAdmin\n\t};\n\n\treturn <AuthContext.Provider value={values}>{children}</AuthContext.Provider>;\n};\n\nexport { AuthContext, AuthProvider };\n"],"names":["defaultProvider","user","loading","authToken","setUser","setLoading","Boolean","login","Promise","resolve","logout","forgotPassword","resetPassword","changePassword","changeUserPassword","AuthContext","createContext","children","useState","setAuthToken","socketRef","useRef","navigate","useNavigate","isJsonParse","string","JSON","parse","error","useEffect","storedToken","window","localStorage","getItem","auth","storageTokenKeyName","storedUser","storageUserKeyName","publicRoutes","Pathname","LOGIN","FORGOT_PASSWORD","RESET_PASSWORD","CHANGE_PASSWORD","currentPath","location","pathname","includes","current","_a","disconnect","config","getApiConfig","socket","io","socketBaseUrl","transports","token","path","on","onAny","event","args","data","message","notificationData","notificationContent","url","moduleName","moduleId","routeMap","generateRouteWithId","PathnameGenerator","PathnameAccounting","VIEW_SALES_INVOICES","toString","VIEW_ASSET_TRANSFER","budgets","VIEW_BUDGET","VIEW_CASH_EXPENSE","VIEW_CREDIT_NOTE","VIEW_DEBIT_NOTE","VIEW_EXPENSE_REIMBURSEMENT","VIEW_JOURNAL_ENTRY","VIEW_PAYMENT_ENTRY","VIEW_PURCHASE_INVOICE","PathnameGeneratorInventory","PathnameInventory","VIEW_STOCK_TRANSFER","PathnameGeneratorManufacuring","PathnameManufacturing","VIEW_BILL_OF_MATERIAL","PathnameGeneratorPurchase","PathnamePurchase","VIEW_PURCHASE_AGREEMENT","is_rental","RENTALROUTES","VIEW","VIEW_PURCHASE_ORDER","vra","VIEW_VENDOR_RETURNS","PathnameGeneratorCrm","PathnameCrm","VIEW_CUSTOMER_RETURNS","VIEW_SALES_ORDER","PathnameGeneratorRental","PathnameRental","VIEW_RENTAL_ORDER","VIEW_AGREEMENT","VIEW_CROSS_HIRE_ORDER","VIEW_CROSS_HIRE_REQUEST","toLowerCase","call","getNotificationUrl","notification_type","enqueueSnackbar","String","variant","anchorOrigin","vertical","horizontal","autoHideDuration","content","key","jsx","CustomSnackbar","snackbarKey","linkUrl","errMsg","values","async","params","callback","DASHBOARD","loginUser","postV1AuthLogin","getToken","success","setItem","userData","full_name","first_name","last_name","stringify","Error","removeItem","storageAccessKeyName","postV1AuthForgotPassword","postV1AuthResetPassword","postV1AuthChangePassword","postV1AuthChangeUserPassword","changeUserPasswordByAdmin","postV1AuthChangeUserPasswordByAdmin","Provider","value"],"mappings":"0+BAuIA,MAAMA,EAAwC,CAC7CC,KAAM,KACNC,SAAS,EACTC,UAAW,GACXC,QAAS,IAAM,KACfC,WAAY,IAAMC,QAClBC,MAAO,IAAMC,QAAQC,UACrBC,OAAQ,IAAMF,QAAQC,UACtBE,eAAgB,IAAMH,QAAQC,UAC9BG,cAAe,IAAMJ,QAAQC,UAC7BI,eAAgB,IAAML,QAAQC,UAC9BK,mBAAoB,IAAMN,QAAQC,WAG7BM,EAAcC,EAAAA,cAAchB,8CAQgB,EAAGiB,eAEpD,MAAOhB,EAAMG,GAAWc,EAAAA,SAASlB,EAAgBC,OAC1CE,EAAWgB,GAAgBD,EAAAA,SAAiB,KAC5ChB,EAASG,GAAca,EAAAA,SAASlB,EAAgBE,SACjDkB,EAAYC,EAAAA,OAAsB,MAGlCC,EAAWC,EAAAA,cAEXC,EAAeC,IACpB,IAAKA,EAAQ,OAAO,EAEpB,IACC,OAAOC,KAAKC,MAAMF,EACnB,OAASG,GACR,OAAO,CACR,GAiIDC,EAAAA,UAAU,KACTxB,GAAW,GAEX,MAAMyB,EAAcC,OAAOC,aAAaC,QAAQC,EAAAA,KAAKC,qBAC/CC,EACLZ,EAAYO,OAAOC,aAAaC,QAAQC,EAAAA,KAAKG,sBAAwB,KAChEC,EAAe,CAACC,EAAAA,SAASC,MAAOD,EAAAA,SAASE,gBAAiBF,WAASG,eAAgBH,EAAAA,SAASI,iBAC5FC,EAAcb,OAAOc,SAASC,SAC/BhB,GAAgBM,GAMpBhC,EAAQgC,GACRjB,EAAaW,GAAe,IAC5BzB,GAAW,KAPNiC,EAAaS,SAASH,IAC1BtB,EAASiB,EAAAA,SAASC,OAEnBnC,GAAW,KAOV,IAEHwB,EAAAA,UAAU,WACT,IAAK1B,EAMJ,YALIiB,EAAU4B,UACb,OAAAC,EAAA7B,EAAU4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C,KACA,UACOkB,EAAAA,6BAA6B,IAAKnB,KAAWK,EAAAA,aACnDJ,EAAS,iCAAiC,EAC3C,OAASxG,GACR,IAAIoC,EAAkB,uBAClBpC,aAAiBoH,QACpBhF,EAAUxC,EAAYI,EAAMoC,SAASA,SAAWpC,EAAMoC,QACtDoE,EAASpE,GAAS,GAEpB,GA8BAuF,0BA3BuCrB,MAAOC,EAC9CC,KACA,UACOoB,EAAAA,oCAAoC,IAAKrB,KAAWK,EAAAA,aAC1DJ,EAAS,iCAAiC,EAC3C,OAASxG,GACR,IAAIoC,EAAkB,uBAClBpC,aAAiBoH,QACpBhF,EAAUxC,EAAYI,EAAMoC,SAASA,SAAWpC,EAAMoC,QACtDoE,EAASpE,GAAS,GAEpB;AAmBD,aAAQjD,EAAY0I,SAAZ,CAAqBC,MAAOzB,EAAShH"}
@@ -5,6 +5,7 @@ import { DEFAULT_LANG } from "../../constants/all-language/index.esm.js";
5
5
  import { getToken } from "../../utils/common/index.esm.js";
6
6
  import { setBaseUrl } from "../../api-client/api.rbac/api/index.esm.js";
7
7
  import { getV1Languages } from "../../api-client/api.system-feature/api/index.esm.js";
8
+ import { getApiConfig } from "../../utils/api-config/index.esm.js";
8
9
  const FALLBACK_LANGUAGES = [
9
10
  "en",
10
11
  // English as primary fallback
@@ -80,7 +81,7 @@ const LanguageProvider = ({ children }) => {
80
81
  const [state, dispatch] = useReducer(languageReducer, initialState);
81
82
  const { i18n } = useTranslation();
82
83
  useEffect(() => {
83
- setBaseUrl(`${"https://apidev.erpforce.co"}/rbac`);
84
+ setBaseUrl(`${getApiConfig().backendBaseUrl}/rbac`);
84
85
  }, []);
85
86
  const safeChangeLanguage = async (langCode) => {
86
87
  if (i18n && typeof i18n.changeLanguage === "function") {
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../../../src/contexts/languageContext.tsx"],"sourcesContent":["// contexts/LanguageContext.tsx\nimport React, { createContext, useEffect, useReducer, ReactNode } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { DEFAULT_LANG } from '../constants/all-language';\nimport { getToken } from '../utils/common';\nimport { setRoleURL } from '../utils/server';\nimport { getV1Languages } from '../api-client/api.system-feature/api';\n// import ErpLoader from '../components/loader/erp-loader';\n\n// Types\ninterface ILanguage {\n label: string;\n code: string;\n direction: string;\n}\n\ninterface LanguageState {\n languages: ILanguage[];\n currentLanguage: ILanguage | null;\n isLoading: boolean;\n error: string | null;\n isFallbackActive: boolean; // Track if we're using fallback\n}\n\ninterface LanguageContextType extends LanguageState {\n changeLanguage: (langCode: string) => void;\n fetchLanguages: () => Promise<void>;\n}\n\n// Define fallback languages in order of preference - English first\nconst FALLBACK_LANGUAGES = [\n 'en', // English as primary fallback\n 'en-US', // US English as secondary\n DEFAULT_LANG, // Then default language\n];\n\n// Create English fallback language object\nconst createEnglishFallback = (): ILanguage => ({\n code: 'en',\n label: 'English',\n direction: 'ltr'\n});\n\n// Action types\ntype LanguageAction =\n | { type: 'FETCH_LANGUAGES_START' }\n | { type: 'FETCH_LANGUAGES_SUCCESS'; payload: ILanguage[] }\n | { type: 'FETCH_LANGUAGES_ERROR'; payload: string }\n | { type: 'SET_CURRENT_LANGUAGE'; payload: ILanguage; isFallback?: boolean }\n | { type: 'SET_FALLBACK_ACTIVE'; payload: boolean };\n\n// Initial state\nconst initialState: LanguageState = {\n languages: [],\n currentLanguage: null,\n isLoading: false,\n error: null,\n isFallbackActive: false,\n};\n\n// Helper function to find the best available language\nconst findBestAvailableLanguage = (\n languages: ILanguage[], \n preferredCode?: string\n): ILanguage | null => {\n if (!languages || languages.length === 0) return null;\n\n // First try the preferred language if provided\n if (preferredCode) {\n const preferred = languages.find(lang => lang.code === preferredCode);\n if (preferred) return preferred;\n }\n\n // Try fallback languages in order (English first)\n for (const fallbackCode of FALLBACK_LANGUAGES) {\n const fallback = languages.find(lang => lang.code === fallbackCode);\n if (fallback) return fallback;\n }\n\n // If no fallbacks found, return the first available language\n return languages[0] || null;\n};\n\n// Reducer\nconst languageReducer = (state: LanguageState, action: LanguageAction): LanguageState => {\n switch (action.type) {\n case 'FETCH_LANGUAGES_START':\n return {\n ...state,\n isLoading: true,\n error: null,\n };\n case 'FETCH_LANGUAGES_SUCCESS':\n return {\n ...state,\n languages: action.payload,\n isLoading: false,\n error: null,\n isFallbackActive: false,\n };\n case 'FETCH_LANGUAGES_ERROR':\n return {\n ...state,\n isLoading: false,\n error: action.payload,\n isFallbackActive: true, \n };\n case 'SET_CURRENT_LANGUAGE':\n return {\n ...state,\n currentLanguage: action.payload,\n isFallbackActive: action.isFallback || false,\n };\n case 'SET_FALLBACK_ACTIVE':\n return {\n ...state,\n isFallbackActive: action.payload,\n };\n default:\n return state;\n }\n};\n\n// Create context\nconst LanguageContext = createContext<LanguageContextType | undefined>(undefined);\n\n// Provider component\ninterface LanguageProviderProps {\n children: ReactNode;\n}\n\nexport const LanguageProvider: React.FC<LanguageProviderProps> = ({ children }) => {\n const [state, dispatch] = useReducer(languageReducer, initialState);\n const { i18n } = useTranslation();\n\n // Initialize role URL\n useEffect(() => {\n setRoleURL(`${import.meta.env.VITE_BACKEND_BASE_URL}/rbac`);\n }, []);\n\n // Guarded i18n changeLanguage call\n const safeChangeLanguage = async (langCode: string) => {\n if (i18n && typeof i18n.changeLanguage === 'function') {\n try {\n await i18n.changeLanguage(langCode);\n } catch (error) {\n console.warn(`Failed to change language to \"${langCode}\"`, error);\n }\n } else {\n console.warn(\n 'i18n.changeLanguage is unavailable. Ensure I18nextProvider is configured in the host application.'\n );\n }\n };\n\n // Apply language settings\n const applyLanguageSettings = (language: ILanguage) => {\n document.body.dir = language.direction || 'ltr';\n safeChangeLanguage(language.code);\n localStorage.setItem('_language', language.code);\n };\n\n // Fetch languages from API\n const fetchLanguages = async (): Promise<void> => {\n try {\n dispatch({ type: 'FETCH_LANGUAGES_START' });\n \n const response = await getV1Languages({\n order: `id:1`,\n filters: `(is_active.in=[1])`,\n ...getToken(),\n });\n \n const data = response?.data?.languages || [];\n const languages = data\n ?.filter((d: any) => d?.is_active)\n ?.map((d: any) => ({\n label: d?.name,\n code: d?.code,\n direction: d?.direction,\n }));\n\n // Always ensure English is available in the languages list\n const hasEnglish = languages.some((lang: ILanguage) => lang.code === 'en');\n if (!hasEnglish) {\n languages.unshift(createEnglishFallback());\n }\n\n dispatch({ type: 'FETCH_LANGUAGES_SUCCESS', payload: languages });\n \n // Get saved language or use fallback\n const savedLangCode = localStorage.getItem('_language');\n const bestLanguage = findBestAvailableLanguage(languages, savedLangCode || undefined);\n \n if (bestLanguage) {\n const isFallback = savedLangCode && savedLangCode !== bestLanguage.code;\n dispatch({ \n type: 'SET_CURRENT_LANGUAGE', \n payload: bestLanguage,\n isFallback \n });\n applyLanguageSettings(bestLanguage);\n \n // Log if we're using a fallback\n if (isFallback) {\n console.warn(`Saved language \"${savedLangCode}\" not available. Using fallback: \"${bestLanguage.code}\"`);\n }\n } else {\n console.error('No languages available');\n }\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Failed to fetch languages';\n dispatch({ type: 'FETCH_LANGUAGES_ERROR', payload: errorMessage });\n \n // On error, always fall back to English\n const englishFallback = createEnglishFallback();\n \n // Create languages array with English fallback for dropdown\n const fallbackLanguages = [englishFallback];\n \n dispatch({ type: 'FETCH_LANGUAGES_SUCCESS', payload: fallbackLanguages });\n dispatch({ \n type: 'SET_CURRENT_LANGUAGE', \n payload: englishFallback,\n isFallback: true \n });\n \n document.body.dir = 'ltr';\n safeChangeLanguage('en');\n localStorage.setItem('_language', 'en');\n \n console.warn('Language fetch failed, using English fallback');\n }\n };\n\n // Change language function\n const changeLanguage = (langCode: string): void => {\n const selectedLanguage = state.languages.find((lang) => lang.code === langCode);\n \n if (selectedLanguage) {\n dispatch({ type: 'SET_CURRENT_LANGUAGE', payload: selectedLanguage });\n dispatch({ type: 'SET_FALLBACK_ACTIVE', payload: false });\n applyLanguageSettings(selectedLanguage);\n } else {\n console.error(`Language \"${langCode}\" not found in available languages`);\n \n // If language not found, fall back to English\n const englishFallback = createEnglishFallback();\n dispatch({ \n type: 'SET_CURRENT_LANGUAGE', \n payload: englishFallback,\n isFallback: true \n });\n applyLanguageSettings(englishFallback);\n }\n };\n\n // Initialize on mount\n useEffect(() => {\n fetchLanguages();\n //eslint-disable-next-line \n }, []);\n\n const contextValue: LanguageContextType = {\n ...state,\n changeLanguage,\n fetchLanguages,\n };\n\n return (\n <LanguageContext.Provider value={contextValue}>\n {/* {state.isLoading } */}\n {children}\n </LanguageContext.Provider>\n );\n};\n\nexport { LanguageContext };\nexport default LanguageContext;"],"names":["setRoleURL"],"mappings":";;;;;;;AA8BA,MAAM,qBAAqB;AAAA,EACzB;AAAA;AAAA,EACA;AAAA;AAAA,EACA;AAAA;AACF;AAGA,MAAM,wBAAwB,OAAkB;AAAA,EAC9C,MAAM;AAAA,EACN,OAAO;AAAA,EACP,WAAW;AACb;AAWA,MAAM,eAA8B;AAAA,EAClC,WAAW,CAAA;AAAA,EACX,iBAAiB;AAAA,EACjB,WAAW;AAAA,EACX,OAAO;AAAA,EACP,kBAAkB;AACpB;AAGA,MAAM,4BAA4B,CAChC,WACA,kBACqB;AACrB,MAAI,CAAC,aAAa,UAAU,WAAW,EAAG,QAAO;AAGjD,MAAI,eAAe;AACjB,UAAM,YAAY,UAAU,KAAK,CAAA,SAAQ,KAAK,SAAS,aAAa;AACpE,QAAI,UAAW,QAAO;AAAA,EACxB;AAGA,aAAW,gBAAgB,oBAAoB;AAC7C,UAAM,WAAW,UAAU,KAAK,CAAA,SAAQ,KAAK,SAAS,YAAY;AAClE,QAAI,SAAU,QAAO;AAAA,EACvB;AAGA,SAAO,UAAU,CAAC,KAAK;AACzB;AAGA,MAAM,kBAAkB,CAAC,OAAsB,WAA0C;AACvF,UAAQ,OAAO,MAAA;AAAA,IACb,KAAK;AACH,aAAO;AAAA,QACL,GAAG;AAAA,QACH,WAAW;AAAA,QACX,OAAO;AAAA,MAAA;AAAA,IAEX,KAAK;AACH,aAAO;AAAA,QACL,GAAG;AAAA,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,cAAQ,KAAK,+CAA+C;AAAA,IAC9D;AAAA,EACF;AAGA,QAAM,iBAAiB,CAAC,aAA2B;AACjD,UAAM,mBAAmB,MAAM,UAAU,KAAK,CAAC,SAAS,KAAK,SAAS,QAAQ;AAE9E,QAAI,kBAAkB;AACpB,eAAS,EAAE,MAAM,wBAAwB,SAAS,kBAAkB;AACpE,eAAS,EAAE,MAAM,uBAAuB,SAAS,OAAO;AACxD,4BAAsB,gBAAgB;AAAA,IACxC,OAAO;AACL,cAAQ,MAAM,aAAa,QAAQ,oCAAoC;AAGvE,YAAM,kBAAkB,sBAAA;AACxB,eAAS;AAAA,QACP,MAAM;AAAA,QACN,SAAS;AAAA,QACT,YAAY;AAAA,MAAA,CACb;AACD,4BAAsB,eAAe;AAAA,IACvC;AAAA,EACF;AAGA,YAAU,MAAM;AACd,mBAAA;AAAA,EAEF,GAAG,CAAA,CAAE;AAEL,QAAM,eAAoC;AAAA,IACxC,GAAG;AAAA,IACH;AAAA,IACA;AAAA,EAAA;AAGF,6BACG,gBAAgB,UAAhB,EAAyB,OAAO,cAE9B,UACH;AAEJ;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../../../src/contexts/languageContext.tsx"],"sourcesContent":["// contexts/LanguageContext.tsx\nimport React, { createContext, useEffect, useReducer, ReactNode } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { DEFAULT_LANG } from '../constants/all-language';\nimport { getToken } from '../utils/common';\nimport { setRoleURL } from '../utils/server';\nimport { getV1Languages } from '../api-client/api.system-feature/api';\nimport { getApiConfig } from '@/utils';\n// import ErpLoader from '../components/loader/erp-loader';\n\n// Types\ninterface ILanguage {\n label: string;\n code: string;\n direction: string;\n}\n\ninterface LanguageState {\n languages: ILanguage[];\n currentLanguage: ILanguage | null;\n isLoading: boolean;\n error: string | null;\n isFallbackActive: boolean; // Track if we're using fallback\n}\n\ninterface LanguageContextType extends LanguageState {\n changeLanguage: (langCode: string) => void;\n fetchLanguages: () => Promise<void>;\n}\n\n// Define fallback languages in order of preference - English first\nconst FALLBACK_LANGUAGES = [\n 'en', // English as primary fallback\n 'en-US', // US English as secondary\n DEFAULT_LANG, // Then default language\n];\n\n// Create English fallback language object\nconst createEnglishFallback = (): ILanguage => ({\n code: 'en',\n label: 'English',\n direction: 'ltr'\n});\n\n// Action types\ntype LanguageAction =\n | { type: 'FETCH_LANGUAGES_START' }\n | { type: 'FETCH_LANGUAGES_SUCCESS'; payload: ILanguage[] }\n | { type: 'FETCH_LANGUAGES_ERROR'; payload: string }\n | { type: 'SET_CURRENT_LANGUAGE'; payload: ILanguage; isFallback?: boolean }\n | { type: 'SET_FALLBACK_ACTIVE'; payload: boolean };\n\n// Initial state\nconst initialState: LanguageState = {\n languages: [],\n currentLanguage: null,\n isLoading: false,\n error: null,\n isFallbackActive: false,\n};\n\n// Helper function to find the best available language\nconst findBestAvailableLanguage = (\n languages: ILanguage[],\n preferredCode?: string\n): ILanguage | null => {\n if (!languages || languages.length === 0) return null;\n\n // First try the preferred language if provided\n if (preferredCode) {\n const preferred = languages.find(lang => lang.code === preferredCode);\n if (preferred) return preferred;\n }\n\n // Try fallback languages in order (English first)\n for (const fallbackCode of FALLBACK_LANGUAGES) {\n const fallback = languages.find(lang => lang.code === fallbackCode);\n if (fallback) return fallback;\n }\n\n // If no fallbacks found, return the first available language\n return languages[0] || null;\n};\n\n// Reducer\nconst languageReducer = (state: LanguageState, action: LanguageAction): LanguageState => {\n switch (action.type) {\n case 'FETCH_LANGUAGES_START':\n return {\n ...state,\n isLoading: true,\n error: null,\n };\n case 'FETCH_LANGUAGES_SUCCESS':\n return {\n ...state,\n languages: action.payload,\n isLoading: false,\n error: null,\n isFallbackActive: false,\n };\n case 'FETCH_LANGUAGES_ERROR':\n return {\n ...state,\n isLoading: false,\n error: action.payload,\n isFallbackActive: true,\n };\n case 'SET_CURRENT_LANGUAGE':\n return {\n ...state,\n currentLanguage: action.payload,\n isFallbackActive: action.isFallback || false,\n };\n case 'SET_FALLBACK_ACTIVE':\n return {\n ...state,\n isFallbackActive: action.payload,\n };\n default:\n return state;\n }\n};\n\n// Create context\nconst LanguageContext = createContext<LanguageContextType | undefined>(undefined);\n\n// Provider component\ninterface LanguageProviderProps {\n children: ReactNode;\n}\n\nexport const LanguageProvider: React.FC<LanguageProviderProps> = ({ children }) => {\n const [state, dispatch] = useReducer(languageReducer, initialState);\n const { i18n } = useTranslation();\n\n // Initialize role URL\n useEffect(() => {\n setRoleURL(`${getApiConfig().backendBaseUrl}/rbac`);\n }, []);\n\n // Guarded i18n changeLanguage call\n const safeChangeLanguage = async (langCode: string) => {\n if (i18n && typeof i18n.changeLanguage === 'function') {\n try {\n await i18n.changeLanguage(langCode);\n } catch (error) {\n console.warn(`Failed to change language to \"${langCode}\"`, error);\n }\n } else {\n console.warn(\n 'i18n.changeLanguage is unavailable. Ensure I18nextProvider is configured in the host application.'\n );\n }\n };\n\n // Apply language settings\n const applyLanguageSettings = (language: ILanguage) => {\n document.body.dir = language.direction || 'ltr';\n safeChangeLanguage(language.code);\n localStorage.setItem('_language', language.code);\n };\n\n // Fetch languages from API\n const fetchLanguages = async (): Promise<void> => {\n try {\n dispatch({ type: 'FETCH_LANGUAGES_START' });\n\n const response = await getV1Languages({\n order: `id:1`,\n filters: `(is_active.in=[1])`,\n ...getToken(),\n });\n\n const data = response?.data?.languages || [];\n const languages = data\n ?.filter((d: any) => d?.is_active)\n ?.map((d: any) => ({\n label: d?.name,\n code: d?.code,\n direction: d?.direction,\n }));\n\n // Always ensure English is available in the languages list\n const hasEnglish = languages.some((lang: ILanguage) => lang.code === 'en');\n if (!hasEnglish) {\n languages.unshift(createEnglishFallback());\n }\n\n dispatch({ type: 'FETCH_LANGUAGES_SUCCESS', payload: languages });\n\n // Get saved language or use fallback\n const savedLangCode = localStorage.getItem('_language');\n const bestLanguage = findBestAvailableLanguage(languages, savedLangCode || undefined);\n\n if (bestLanguage) {\n const isFallback = savedLangCode && savedLangCode !== bestLanguage.code;\n dispatch({\n type: 'SET_CURRENT_LANGUAGE',\n payload: bestLanguage,\n isFallback\n });\n applyLanguageSettings(bestLanguage);\n\n // Log if we're using a fallback\n if (isFallback) {\n console.warn(`Saved language \"${savedLangCode}\" not available. Using fallback: \"${bestLanguage.code}\"`);\n }\n } else {\n console.error('No languages available');\n }\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Failed to fetch languages';\n dispatch({ type: 'FETCH_LANGUAGES_ERROR', payload: errorMessage });\n\n // On error, always fall back to English\n const englishFallback = createEnglishFallback();\n\n // Create languages array with English fallback for dropdown\n const fallbackLanguages = [englishFallback];\n\n dispatch({ type: 'FETCH_LANGUAGES_SUCCESS', payload: fallbackLanguages });\n dispatch({\n type: 'SET_CURRENT_LANGUAGE',\n payload: englishFallback,\n isFallback: true\n });\n\n document.body.dir = 'ltr';\n safeChangeLanguage('en');\n localStorage.setItem('_language', 'en');\n\n console.warn('Language fetch failed, using English fallback');\n }\n };\n\n // Change language function\n const changeLanguage = (langCode: string): void => {\n const selectedLanguage = state.languages.find((lang) => lang.code === langCode);\n\n if (selectedLanguage) {\n dispatch({ type: 'SET_CURRENT_LANGUAGE', payload: selectedLanguage });\n dispatch({ type: 'SET_FALLBACK_ACTIVE', payload: false });\n applyLanguageSettings(selectedLanguage);\n } else {\n console.error(`Language \"${langCode}\" not found in available languages`);\n\n // If language not found, fall back to English\n const englishFallback = createEnglishFallback();\n dispatch({\n type: 'SET_CURRENT_LANGUAGE',\n payload: englishFallback,\n isFallback: true\n });\n applyLanguageSettings(englishFallback);\n }\n };\n\n // Initialize on mount\n useEffect(() => {\n fetchLanguages();\n //eslint-disable-next-line \n }, []);\n\n const contextValue: LanguageContextType = {\n ...state,\n changeLanguage,\n fetchLanguages,\n };\n\n return (\n <LanguageContext.Provider value={contextValue}>\n {/* {state.isLoading } */}\n {children}\n </LanguageContext.Provider>\n );\n};\n\nexport { LanguageContext };\nexport default LanguageContext;"],"names":["setRoleURL"],"mappings":";;;;;;;;AA+BA,MAAM,qBAAqB;AAAA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A,QACP,MAAM;AAAA,QACN,SAAS;AAAA,QACT,YAAY;AAAA,MAAA,CACb;AACD,4BAAsB,eAAe;AAAA,IACvC;AAAA,EACF;AAGA,YAAU,MAAM;AACd,mBAAA;AAAA,EAEF,GAAG,CAAA,CAAE;AAEL,QAAM,eAAoC;AAAA,IACxC,GAAG;AAAA,IACH;AAAA,IACA;AAAA,EAAA;AAGF,6BACG,gBAAgB,UAAhB,EAAyB,OAAO,cAE9B,UACH;AAEJ;"}
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),a=require("react"),t=require("react-i18next"),n=require("../../constants/all-language/index.js"),l=require("../../utils/common/index.js"),r=require("../../api-client/api.rbac/api/index.js"),i=require("../../api-client/api.system-feature/api/index.js");const o=["en","en-US",n.DEFAULT_LANG],c={languages:[],currentLanguage:null,isLoading:!1,error:null,isFallbackActive:!1},s=(e,a)=>{switch(a.type){case"FETCH_LANGUAGES_START":return{...e,isLoading:!0,error:null};case"FETCH_LANGUAGES_SUCCESS":return{...e,languages:a.payload,isLoading:!1,error:null,isFallbackActive:!1};case"FETCH_LANGUAGES_ERROR":return{...e,isLoading:!1,error:a.payload,isFallbackActive:!0};case"SET_CURRENT_LANGUAGE":return{...e,currentLanguage:a.payload,isFallbackActive:a.isFallback||!1};case"SET_FALLBACK_ACTIVE":return{...e,isFallbackActive:a.payload};default:return e}},d=a.createContext(void 0);exports.LanguageContext=d,exports.LanguageProvider=({children:n})=>{const[u,g]=a.useReducer(s,c),{i18n:E}=t.useTranslation();a.useEffect(()=>{r.setBaseUrl("https://apidev.erpforce.co/rbac")},[]);const A=async e=>{if(E&&"function"==typeof E.changeLanguage)try{await E.changeLanguage(e)}catch(a){}},p=e=>{document.body.dir=e.direction||"ltr",A(e.code),localStorage.setItem("_language",e.code)},_=async()=>{var e,a;try{g({type:"FETCH_LANGUAGES_START"});const t=await i.getV1Languages({order:"id:1",filters:"(is_active.in=[1])",...l.getToken()}),n=(null==(e=null==t?void 0:t.data)?void 0:e.languages)||[],r=null==(a=null==n?void 0:n.filter(e=>null==e?void 0:e.is_active))?void 0:a.map(e=>({label:null==e?void 0:e.name,code:null==e?void 0:e.code,direction:null==e?void 0:e.direction}));r.some(e=>"en"===e.code)||r.unshift({code:"en",label:"English",direction:"ltr"}),g({type:"FETCH_LANGUAGES_SUCCESS",payload:r});const c=localStorage.getItem("_language"),s=((e,a)=>{if(!e||0===e.length)return null;if(a){const t=e.find(e=>e.code===a);if(t)return t}for(const t of o){const a=e.find(e=>e.code===t);if(a)return a}return e[0]||null})(r,c||void 0);if(s){const e=c&&c!==s.code;g({type:"SET_CURRENT_LANGUAGE",payload:s,isFallback:e}),p(s)}}catch(t){const e=t instanceof Error?t.message:"Failed to fetch languages";g({type:"FETCH_LANGUAGES_ERROR",payload:e});const a={code:"en",label:"English",direction:"ltr"};g({type:"FETCH_LANGUAGES_SUCCESS",payload:[a]}),g({type:"SET_CURRENT_LANGUAGE",payload:a,isFallback:!0}),document.body.dir="ltr",A("en"),localStorage.setItem("_language","en")}};a.useEffect(()=>{_()},[]);const y={...u,changeLanguage:e=>{const a=u.languages.find(a=>a.code===e);if(a)g({type:"SET_CURRENT_LANGUAGE",payload:a}),g({type:"SET_FALLBACK_ACTIVE",payload:!1}),p(a);else{const e={code:"en",label:"English",direction:"ltr"};g({type:"SET_CURRENT_LANGUAGE",payload:e,isFallback:!0}),p(e)}},fetchLanguages:_};/* @__PURE__ */
2
- return e.jsx(d.Provider,{value:y,children:n})},exports.default=d;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),a=require("react"),n=require("react-i18next"),t=require("../../constants/all-language/index.js"),i=require("../../utils/common/index.js"),l=require("../../api-client/api.rbac/api/index.js"),r=require("../../api-client/api.system-feature/api/index.js"),o=require("../../utils/api-config/index.js");const c=["en","en-US",t.DEFAULT_LANG],s={languages:[],currentLanguage:null,isLoading:!1,error:null,isFallbackActive:!1},d=(e,a)=>{switch(a.type){case"FETCH_LANGUAGES_START":return{...e,isLoading:!0,error:null};case"FETCH_LANGUAGES_SUCCESS":return{...e,languages:a.payload,isLoading:!1,error:null,isFallbackActive:!1};case"FETCH_LANGUAGES_ERROR":return{...e,isLoading:!1,error:a.payload,isFallbackActive:!0};case"SET_CURRENT_LANGUAGE":return{...e,currentLanguage:a.payload,isFallbackActive:a.isFallback||!1};case"SET_FALLBACK_ACTIVE":return{...e,isFallbackActive:a.payload};default:return e}},u=a.createContext(void 0);exports.LanguageContext=u,exports.LanguageProvider=({children:t})=>{const[g,E]=a.useReducer(d,s),{i18n:A}=n.useTranslation();a.useEffect(()=>{l.setBaseUrl(`${o.getApiConfig().backendBaseUrl}/rbac`)},[]);const p=async e=>{if(A&&"function"==typeof A.changeLanguage)try{await A.changeLanguage(e)}catch(a){}},_=e=>{document.body.dir=e.direction||"ltr",p(e.code),localStorage.setItem("_language",e.code)},y=async()=>{var e,a;try{E({type:"FETCH_LANGUAGES_START"});const n=await r.getV1Languages({order:"id:1",filters:"(is_active.in=[1])",...i.getToken()}),t=(null==(e=null==n?void 0:n.data)?void 0:e.languages)||[],l=null==(a=null==t?void 0:t.filter(e=>null==e?void 0:e.is_active))?void 0:a.map(e=>({label:null==e?void 0:e.name,code:null==e?void 0:e.code,direction:null==e?void 0:e.direction}));l.some(e=>"en"===e.code)||l.unshift({code:"en",label:"English",direction:"ltr"}),E({type:"FETCH_LANGUAGES_SUCCESS",payload:l});const o=localStorage.getItem("_language"),s=((e,a)=>{if(!e||0===e.length)return null;if(a){const n=e.find(e=>e.code===a);if(n)return n}for(const n of c){const a=e.find(e=>e.code===n);if(a)return a}return e[0]||null})(l,o||void 0);if(s){const e=o&&o!==s.code;E({type:"SET_CURRENT_LANGUAGE",payload:s,isFallback:e}),_(s)}}catch(n){const e=n instanceof Error?n.message:"Failed to fetch languages";E({type:"FETCH_LANGUAGES_ERROR",payload:e});const a={code:"en",label:"English",direction:"ltr"};E({type:"FETCH_LANGUAGES_SUCCESS",payload:[a]}),E({type:"SET_CURRENT_LANGUAGE",payload:a,isFallback:!0}),document.body.dir="ltr",p("en"),localStorage.setItem("_language","en")}};a.useEffect(()=>{y()},[]);const L={...g,changeLanguage:e=>{const a=g.languages.find(a=>a.code===e);if(a)E({type:"SET_CURRENT_LANGUAGE",payload:a}),E({type:"SET_FALLBACK_ACTIVE",payload:!1}),_(a);else{const e={code:"en",label:"English",direction:"ltr"};E({type:"SET_CURRENT_LANGUAGE",payload:e,isFallback:!0}),_(e)}},fetchLanguages:y};/* @__PURE__ */
2
+ return e.jsx(u.Provider,{value:L,children:t})},exports.default=u;
3
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/contexts/languageContext.tsx"],"sourcesContent":["// contexts/LanguageContext.tsx\nimport React, { createContext, useEffect, useReducer, ReactNode } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { DEFAULT_LANG } from '../constants/all-language';\nimport { getToken } from '../utils/common';\nimport { setRoleURL } from '../utils/server';\nimport { getV1Languages } from '../api-client/api.system-feature/api';\n// import ErpLoader from '../components/loader/erp-loader';\n\n// Types\ninterface ILanguage {\n label: string;\n code: string;\n direction: string;\n}\n\ninterface LanguageState {\n languages: ILanguage[];\n currentLanguage: ILanguage | null;\n isLoading: boolean;\n error: string | null;\n isFallbackActive: boolean; // Track if we're using fallback\n}\n\ninterface LanguageContextType extends LanguageState {\n changeLanguage: (langCode: string) => void;\n fetchLanguages: () => Promise<void>;\n}\n\n// Define fallback languages in order of preference - English first\nconst FALLBACK_LANGUAGES = [\n 'en', // English as primary fallback\n 'en-US', // US English as secondary\n DEFAULT_LANG, // Then default language\n];\n\n// Create English fallback language object\nconst createEnglishFallback = (): ILanguage => ({\n code: 'en',\n label: 'English',\n direction: 'ltr'\n});\n\n// Action types\ntype LanguageAction =\n | { type: 'FETCH_LANGUAGES_START' }\n | { type: 'FETCH_LANGUAGES_SUCCESS'; payload: ILanguage[] }\n | { type: 'FETCH_LANGUAGES_ERROR'; payload: string }\n | { type: 'SET_CURRENT_LANGUAGE'; payload: ILanguage; isFallback?: boolean }\n | { type: 'SET_FALLBACK_ACTIVE'; payload: boolean };\n\n// Initial state\nconst initialState: LanguageState = {\n languages: [],\n currentLanguage: null,\n isLoading: false,\n error: null,\n isFallbackActive: false,\n};\n\n// Helper function to find the best available language\nconst findBestAvailableLanguage = (\n languages: ILanguage[], \n preferredCode?: string\n): ILanguage | null => {\n if (!languages || languages.length === 0) return null;\n\n // First try the preferred language if provided\n if (preferredCode) {\n const preferred = languages.find(lang => lang.code === preferredCode);\n if (preferred) return preferred;\n }\n\n // Try fallback languages in order (English first)\n for (const fallbackCode of FALLBACK_LANGUAGES) {\n const fallback = languages.find(lang => lang.code === fallbackCode);\n if (fallback) return fallback;\n }\n\n // If no fallbacks found, return the first available language\n return languages[0] || null;\n};\n\n// Reducer\nconst languageReducer = (state: LanguageState, action: LanguageAction): LanguageState => {\n switch (action.type) {\n case 'FETCH_LANGUAGES_START':\n return {\n ...state,\n isLoading: true,\n error: null,\n };\n case 'FETCH_LANGUAGES_SUCCESS':\n return {\n ...state,\n languages: action.payload,\n isLoading: false,\n error: null,\n isFallbackActive: false,\n };\n case 'FETCH_LANGUAGES_ERROR':\n return {\n ...state,\n isLoading: false,\n error: action.payload,\n isFallbackActive: true, \n };\n case 'SET_CURRENT_LANGUAGE':\n return {\n ...state,\n currentLanguage: action.payload,\n isFallbackActive: action.isFallback || false,\n };\n case 'SET_FALLBACK_ACTIVE':\n return {\n ...state,\n isFallbackActive: action.payload,\n };\n default:\n return state;\n }\n};\n\n// Create context\nconst LanguageContext = createContext<LanguageContextType | undefined>(undefined);\n\n// Provider component\ninterface LanguageProviderProps {\n children: ReactNode;\n}\n\nexport const LanguageProvider: React.FC<LanguageProviderProps> = ({ children }) => {\n const [state, dispatch] = useReducer(languageReducer, initialState);\n const { i18n } = useTranslation();\n\n // Initialize role URL\n useEffect(() => {\n setRoleURL(`${import.meta.env.VITE_BACKEND_BASE_URL}/rbac`);\n }, []);\n\n // Guarded i18n changeLanguage call\n const safeChangeLanguage = async (langCode: string) => {\n if (i18n && typeof i18n.changeLanguage === 'function') {\n try {\n await i18n.changeLanguage(langCode);\n } catch (error) {\n console.warn(`Failed to change language to \"${langCode}\"`, error);\n }\n } else {\n console.warn(\n 'i18n.changeLanguage is unavailable. Ensure I18nextProvider is configured in the host application.'\n );\n }\n };\n\n // Apply language settings\n const applyLanguageSettings = (language: ILanguage) => {\n document.body.dir = language.direction || 'ltr';\n safeChangeLanguage(language.code);\n localStorage.setItem('_language', language.code);\n };\n\n // Fetch languages from API\n const fetchLanguages = async (): Promise<void> => {\n try {\n dispatch({ type: 'FETCH_LANGUAGES_START' });\n \n const response = await getV1Languages({\n order: `id:1`,\n filters: `(is_active.in=[1])`,\n ...getToken(),\n });\n \n const data = response?.data?.languages || [];\n const languages = data\n ?.filter((d: any) => d?.is_active)\n ?.map((d: any) => ({\n label: d?.name,\n code: d?.code,\n direction: d?.direction,\n }));\n\n // Always ensure English is available in the languages list\n const hasEnglish = languages.some((lang: ILanguage) => lang.code === 'en');\n if (!hasEnglish) {\n languages.unshift(createEnglishFallback());\n }\n\n dispatch({ type: 'FETCH_LANGUAGES_SUCCESS', payload: languages });\n \n // Get saved language or use fallback\n const savedLangCode = localStorage.getItem('_language');\n const bestLanguage = findBestAvailableLanguage(languages, savedLangCode || undefined);\n \n if (bestLanguage) {\n const isFallback = savedLangCode && savedLangCode !== bestLanguage.code;\n dispatch({ \n type: 'SET_CURRENT_LANGUAGE', \n payload: bestLanguage,\n isFallback \n });\n applyLanguageSettings(bestLanguage);\n \n // Log if we're using a fallback\n if (isFallback) {\n console.warn(`Saved language \"${savedLangCode}\" not available. Using fallback: \"${bestLanguage.code}\"`);\n }\n } else {\n console.error('No languages available');\n }\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Failed to fetch languages';\n dispatch({ type: 'FETCH_LANGUAGES_ERROR', payload: errorMessage });\n \n // On error, always fall back to English\n const englishFallback = createEnglishFallback();\n \n // Create languages array with English fallback for dropdown\n const fallbackLanguages = [englishFallback];\n \n dispatch({ type: 'FETCH_LANGUAGES_SUCCESS', payload: fallbackLanguages });\n dispatch({ \n type: 'SET_CURRENT_LANGUAGE', \n payload: englishFallback,\n isFallback: true \n });\n \n document.body.dir = 'ltr';\n safeChangeLanguage('en');\n localStorage.setItem('_language', 'en');\n \n console.warn('Language fetch failed, using English fallback');\n }\n };\n\n // Change language function\n const changeLanguage = (langCode: string): void => {\n const selectedLanguage = state.languages.find((lang) => lang.code === langCode);\n \n if (selectedLanguage) {\n dispatch({ type: 'SET_CURRENT_LANGUAGE', payload: selectedLanguage });\n dispatch({ type: 'SET_FALLBACK_ACTIVE', payload: false });\n applyLanguageSettings(selectedLanguage);\n } else {\n console.error(`Language \"${langCode}\" not found in available languages`);\n \n // If language not found, fall back to English\n const englishFallback = createEnglishFallback();\n dispatch({ \n type: 'SET_CURRENT_LANGUAGE', \n payload: englishFallback,\n isFallback: true \n });\n applyLanguageSettings(englishFallback);\n }\n };\n\n // Initialize on mount\n useEffect(() => {\n fetchLanguages();\n //eslint-disable-next-line \n }, []);\n\n const contextValue: LanguageContextType = {\n ...state,\n changeLanguage,\n fetchLanguages,\n };\n\n return (\n <LanguageContext.Provider value={contextValue}>\n {/* {state.isLoading } */}\n {children}\n </LanguageContext.Provider>\n );\n};\n\nexport { LanguageContext };\nexport default LanguageContext;"],"names":["FALLBACK_LANGUAGES","DEFAULT_LANG","initialState","languages","currentLanguage","isLoading","error","isFallbackActive","languageReducer","state","action","type","payload","isFallback","LanguageContext","createContext","children","dispatch","useReducer","i18n","useTranslation","useEffect","setRoleURL","safeChangeLanguage","async","langCode","changeLanguage","applyLanguageSettings","language","document","body","dir","direction","code","localStorage","setItem","fetchLanguages","response","getV1Languages","order","filters","getToken","data","_a","_b","filter","d","is_active","map","label","name","some","lang","unshift","savedLangCode","getItem","bestLanguage","preferredCode","length","preferred","find","fallbackCode","fallback","findBestAvailableLanguage","errorMessage","Error","message","englishFallback","contextValue","selectedLanguage","Provider","value"],"mappings":"mWA8BA,MAAMA,EAAqB,CACzB,KACA,QACAC,EAAAA,cAmBIC,EAA8B,CAClCC,UAAW,GACXC,gBAAiB,KACjBC,WAAW,EACXC,MAAO,KACPC,kBAAkB,GA2BdC,EAAkB,CAACC,EAAsBC,KAC7C,OAAQA,EAAOC,MACb,IAAK,wBACH,MAAO,IACFF,EACHJ,WAAW,EACXC,MAAO,MAEX,IAAK,0BACH,MAAO,IACFG,EACHN,UAAWO,EAAOE,QAClBP,WAAW,EACXC,MAAO,KACPC,kBAAkB,GAEtB,IAAK,wBACH,MAAO,IACFE,EACHJ,WAAW,EACXC,MAAOI,EAAOE,QACdL,kBAAkB,GAEtB,IAAK,uBACH,MAAO,IACFE,EACHL,gBAAiBM,EAAOE,QACxBL,iBAAkBG,EAAOG,aAAc,GAE3C,IAAK,sBACH,MAAO,IACFJ,EACHF,iBAAkBG,EAAOE,SAE7B,QACE,OAAOH,IAKPK,EAAkBC,EAAAA,mBAA+C,sDAON,EAAGC,eAClE,MAAOP,EAAOQ,GAAYC,EAAAA,WAAWV,EAAiBN,IAChDiB,KAAEA,GAASC,mBAGjBC,EAAAA,UAAU,KACRC,EAAAA,WAAW,oCACV,IAGH,MAAMC,EAAqBC,MAAOC,IAChC,GAAIN,GAAuC,mBAAxBA,EAAKO,eACtB,UACQP,EAAKO,eAAeD,EAC5B,OAASnB,GAET,GASEqB,EAAyBC,IAC7BC,SAASC,KAAKC,IAAMH,EAASI,WAAa,MAC1CT,EAAmBK,EAASK,MAC5BC,aAAaC,QAAQ,YAAaP,EAASK,OAIvCG,EAAiBZ,kBACrB,IACEP,EAAS,CAAEN,KAAM,0BAEjB,MAAM0B,QAAiBC,iBAAe,CACpCC,MAAO,OACPC,QAAS,wBACNC,EAAAA,aAGCC,GAAO,OAAAC,EAAA,MAAAN,OAAA,EAAAA,EAAUK,WAAV,EAAAC,EAA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AASuD,EACTtD,YAAY,IAGdgB,SAASC,KAAKC,IAAM,MACpBR,EAAmB,MACnBW,aAAaC,QAAQ,YAAa,KAGpC,GA0BFd,EAAAA,UAAU,KACRe,KAEC,IAEH,MAAMgC,EAAoC,IACrC3D,EACHiB,eA7BsBD,IACtB,MAAM4C,EAAmB5D,EAAMN,UAAUyD,KAAMR,GAASA,EAAKnB,OAASR,GAEtE,GAAI4C,EACFpD,EAAS,CAAEN,KAAM,uBAAwBC,QAASyD,IAClDpD,EAAS,CAAEN,KAAM,sBAAuBC,SAAS,IACjDe,EAAsB0C,OACjB,CAIL,MAAMF,EAlNkB,CAC5BlC,KAAM,KACNgB,MAAO,UACPjB,UAAW,OAgNPf,EAAS,CACPN,KAAM,uBACNC,QAASuD,EACTtD,YAAY,IAEdc,EAAsBwC,EACxB,GAYA/B;AAGF,aACGtB,EAAgBwD,SAAhB,CAAyBC,MAAOH,EAE9BpD"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/contexts/languageContext.tsx"],"sourcesContent":["// contexts/LanguageContext.tsx\nimport React, { createContext, useEffect, useReducer, ReactNode } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { DEFAULT_LANG } from '../constants/all-language';\nimport { getToken } from '../utils/common';\nimport { setRoleURL } from '../utils/server';\nimport { getV1Languages } from '../api-client/api.system-feature/api';\nimport { getApiConfig } from '@/utils';\n// import ErpLoader from '../components/loader/erp-loader';\n\n// Types\ninterface ILanguage {\n label: string;\n code: string;\n direction: string;\n}\n\ninterface LanguageState {\n languages: ILanguage[];\n currentLanguage: ILanguage | null;\n isLoading: boolean;\n error: string | null;\n isFallbackActive: boolean; // Track if we're using fallback\n}\n\ninterface LanguageContextType extends LanguageState {\n changeLanguage: (langCode: string) => void;\n fetchLanguages: () => Promise<void>;\n}\n\n// Define fallback languages in order of preference - English first\nconst FALLBACK_LANGUAGES = [\n 'en', // English as primary fallback\n 'en-US', // US English as secondary\n DEFAULT_LANG, // Then default language\n];\n\n// Create English fallback language object\nconst createEnglishFallback = (): ILanguage => ({\n code: 'en',\n label: 'English',\n direction: 'ltr'\n});\n\n// Action types\ntype LanguageAction =\n | { type: 'FETCH_LANGUAGES_START' }\n | { type: 'FETCH_LANGUAGES_SUCCESS'; payload: ILanguage[] }\n | { type: 'FETCH_LANGUAGES_ERROR'; payload: string }\n | { type: 'SET_CURRENT_LANGUAGE'; payload: ILanguage; isFallback?: boolean }\n | { type: 'SET_FALLBACK_ACTIVE'; payload: boolean };\n\n// Initial state\nconst initialState: LanguageState = {\n languages: [],\n currentLanguage: null,\n isLoading: false,\n error: null,\n isFallbackActive: false,\n};\n\n// Helper function to find the best available language\nconst findBestAvailableLanguage = (\n languages: ILanguage[],\n preferredCode?: string\n): ILanguage | null => {\n if (!languages || languages.length === 0) return null;\n\n // First try the preferred language if provided\n if (preferredCode) {\n const preferred = languages.find(lang => lang.code === preferredCode);\n if (preferred) return preferred;\n }\n\n // Try fallback languages in order (English first)\n for (const fallbackCode of FALLBACK_LANGUAGES) {\n const fallback = languages.find(lang => lang.code === fallbackCode);\n if (fallback) return fallback;\n }\n\n // If no fallbacks found, return the first available language\n return languages[0] || null;\n};\n\n// Reducer\nconst languageReducer = (state: LanguageState, action: LanguageAction): LanguageState => {\n switch (action.type) {\n case 'FETCH_LANGUAGES_START':\n return {\n ...state,\n isLoading: true,\n error: null,\n };\n case 'FETCH_LANGUAGES_SUCCESS':\n return {\n ...state,\n languages: action.payload,\n isLoading: false,\n error: null,\n isFallbackActive: false,\n };\n case 'FETCH_LANGUAGES_ERROR':\n return {\n ...state,\n isLoading: false,\n error: action.payload,\n isFallbackActive: true,\n };\n case 'SET_CURRENT_LANGUAGE':\n return {\n ...state,\n currentLanguage: action.payload,\n isFallbackActive: action.isFallback || false,\n };\n case 'SET_FALLBACK_ACTIVE':\n return {\n ...state,\n isFallbackActive: action.payload,\n };\n default:\n return state;\n }\n};\n\n// Create context\nconst LanguageContext = createContext<LanguageContextType | undefined>(undefined);\n\n// Provider component\ninterface LanguageProviderProps {\n children: ReactNode;\n}\n\nexport const LanguageProvider: React.FC<LanguageProviderProps> = ({ children }) => {\n const [state, dispatch] = useReducer(languageReducer, initialState);\n const { i18n } = useTranslation();\n\n // Initialize role URL\n useEffect(() => {\n setRoleURL(`${getApiConfig().backendBaseUrl}/rbac`);\n }, []);\n\n // Guarded i18n changeLanguage call\n const safeChangeLanguage = async (langCode: string) => {\n if (i18n && typeof i18n.changeLanguage === 'function') {\n try {\n await i18n.changeLanguage(langCode);\n } catch (error) {\n console.warn(`Failed to change language to \"${langCode}\"`, error);\n }\n } else {\n console.warn(\n 'i18n.changeLanguage is unavailable. Ensure I18nextProvider is configured in the host application.'\n );\n }\n };\n\n // Apply language settings\n const applyLanguageSettings = (language: ILanguage) => {\n document.body.dir = language.direction || 'ltr';\n safeChangeLanguage(language.code);\n localStorage.setItem('_language', language.code);\n };\n\n // Fetch languages from API\n const fetchLanguages = async (): Promise<void> => {\n try {\n dispatch({ type: 'FETCH_LANGUAGES_START' });\n\n const response = await getV1Languages({\n order: `id:1`,\n filters: `(is_active.in=[1])`,\n ...getToken(),\n });\n\n const data = response?.data?.languages || [];\n const languages = data\n ?.filter((d: any) => d?.is_active)\n ?.map((d: any) => ({\n label: d?.name,\n code: d?.code,\n direction: d?.direction,\n }));\n\n // Always ensure English is available in the languages list\n const hasEnglish = languages.some((lang: ILanguage) => lang.code === 'en');\n if (!hasEnglish) {\n languages.unshift(createEnglishFallback());\n }\n\n dispatch({ type: 'FETCH_LANGUAGES_SUCCESS', payload: languages });\n\n // Get saved language or use fallback\n const savedLangCode = localStorage.getItem('_language');\n const bestLanguage = findBestAvailableLanguage(languages, savedLangCode || undefined);\n\n if (bestLanguage) {\n const isFallback = savedLangCode && savedLangCode !== bestLanguage.code;\n dispatch({\n type: 'SET_CURRENT_LANGUAGE',\n payload: bestLanguage,\n isFallback\n });\n applyLanguageSettings(bestLanguage);\n\n // Log if we're using a fallback\n if (isFallback) {\n console.warn(`Saved language \"${savedLangCode}\" not available. Using fallback: \"${bestLanguage.code}\"`);\n }\n } else {\n console.error('No languages available');\n }\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Failed to fetch languages';\n dispatch({ type: 'FETCH_LANGUAGES_ERROR', payload: errorMessage });\n\n // On error, always fall back to English\n const englishFallback = createEnglishFallback();\n\n // Create languages array with English fallback for dropdown\n const fallbackLanguages = [englishFallback];\n\n dispatch({ type: 'FETCH_LANGUAGES_SUCCESS', payload: fallbackLanguages });\n dispatch({\n type: 'SET_CURRENT_LANGUAGE',\n payload: englishFallback,\n isFallback: true\n });\n\n document.body.dir = 'ltr';\n safeChangeLanguage('en');\n localStorage.setItem('_language', 'en');\n\n console.warn('Language fetch failed, using English fallback');\n }\n };\n\n // Change language function\n const changeLanguage = (langCode: string): void => {\n const selectedLanguage = state.languages.find((lang) => lang.code === langCode);\n\n if (selectedLanguage) {\n dispatch({ type: 'SET_CURRENT_LANGUAGE', payload: selectedLanguage });\n dispatch({ type: 'SET_FALLBACK_ACTIVE', payload: false });\n applyLanguageSettings(selectedLanguage);\n } else {\n console.error(`Language \"${langCode}\" not found in available languages`);\n\n // If language not found, fall back to English\n const englishFallback = createEnglishFallback();\n dispatch({\n type: 'SET_CURRENT_LANGUAGE',\n payload: englishFallback,\n isFallback: true\n });\n applyLanguageSettings(englishFallback);\n }\n };\n\n // Initialize on mount\n useEffect(() => {\n fetchLanguages();\n //eslint-disable-next-line \n }, []);\n\n const contextValue: LanguageContextType = {\n ...state,\n changeLanguage,\n fetchLanguages,\n };\n\n return (\n <LanguageContext.Provider value={contextValue}>\n {/* {state.isLoading } */}\n {children}\n </LanguageContext.Provider>\n );\n};\n\nexport { LanguageContext };\nexport default LanguageContext;"],"names":["FALLBACK_LANGUAGES","DEFAULT_LANG","initialState","languages","currentLanguage","isLoading","error","isFallbackActive","languageReducer","state","action","type","payload","isFallback","LanguageContext","createContext","children","dispatch","useReducer","i18n","useTranslation","useEffect","setRoleURL","getApiConfig","backendBaseUrl","safeChangeLanguage","async","langCode","changeLanguage","applyLanguageSettings","language","document","body","dir","direction","code","localStorage","setItem","fetchLanguages","response","getV1Languages","order","filters","getToken","data","_a","_b","filter","d","is_active","map","label","name","some","lang","unshift","savedLangCode","getItem","bestLanguage","preferredCode","length","preferred","find","fallbackCode","fallback","findBestAvailableLanguage","errorMessage","Error","message","englishFallback","contextValue","selectedLanguage","Provider","value"],"mappings":"gZA+BA,MAAMA,EAAqB,CACzB,KACA,QACAC,EAAAA,cAmBIC,EAA8B,CAClCC,UAAW,GACXC,gBAAiB,KACjBC,WAAW,EACXC,MAAO,KACPC,kBAAkB,GA2BdC,EAAkB,CAACC,EAAsBC,KAC7C,OAAQA,EAAOC,MACb,IAAK,wBACH,MAAO,IACFF,EACHJ,WAAW,EACXC,MAAO,MAEX,IAAK,0BACH,MAAO,IACFG,EACHN,UAAWO,EAAOE,QAClBP,WAAW,EACXC,MAAO,KACPC,kBAAkB,GAEtB,IAAK,wBACH,MAAO,IACFE,EACHJ,WAAW,EACXC,MAAOI,EAAOE,QACdL,kBAAkB,GAEtB,IAAK,uBACH,MAAO,IACFE,EACHL,gBAAiBM,EAAOE,QACxBL,iBAAkBG,EAAOG,aAAc,GAE3C,IAAK,sBACH,MAAO,IACFJ,EACHF,iBAAkBG,EAAOE,SAE7B,QACE,OAAOH,IAKPK,EAAkBC,EAAAA,mBAA+C,sDAON,EAAGC,eAClE,MAAOP,EAAOQ,GAAYC,EAAAA,WAAWV,EAAiBN,IAChDiB,KAAEA,GAASC,mBAGjBC,EAAAA,UAAU,KACRC,EAAAA,WAAW,GAAGC,EAAAA,eAAeC,wBAC5B,IAGH,MAAMC,EAAqBC,MAAOC,IAChC,GAAIR,GAAuC,mBAAxBA,EAAKS,eACtB,UACQT,EAAKS,eAAeD,EAC5B,OAASrB,GAET,GASEuB,EAAyBC,IAC7BC,SAASC,KAAKC,IAAMH,EAASI,WAAa,MAC1CT,EAAmBK,EAASK,MAC5BC,aAAaC,QAAQ,YAAaP,EAASK,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9DnD,EAAS,CAAEN,KAAM,wBAAyBC,QAASsD,IAGnD,MAAMG,EAlLkB,CAC5BlC,KAAM,KACNgB,MAAO,UACPjB,UAAW,OAoLPjB,EAAS,CAAEN,KAAM,0BAA2BC,QAFlB,CAACyD,KAG3BpD,EAAS,CACPN,KAAM,uBACNC,QAASyD,EACTxD,YAAY,IAGdkB,SAASC,KAAKC,IAAM,MACpBR,EAAmB,MACnBW,aAAaC,QAAQ,YAAa,KAGpC,GA0BFhB,EAAAA,UAAU,KACRiB,KAEC,IAEH,MAAMgC,EAAoC,IACrC7D,EACHmB,eA7BsBD,IACtB,MAAM4C,EAAmB9D,EAAMN,UAAU2D,KAAMR,GAASA,EAAKnB,OAASR,GAEtE,GAAI4C,EACFtD,EAAS,CAAEN,KAAM,uBAAwBC,QAAS2D,IAClDtD,EAAS,CAAEN,KAAM,sBAAuBC,SAAS,IACjDiB,EAAsB0C,OACjB,CAIL,MAAMF,EAlNkB,CAC5BlC,KAAM,KACNgB,MAAO,UACPjB,UAAW,OAgNPjB,EAAS,CACPN,KAAM,uBACNC,QAASyD,EACTxD,YAAY,IAEdgB,EAAsBwC,EACxB,GAYA/B;AAGF,aACGxB,EAAgB0D,SAAhB,CAAyBC,MAAOH,EAE9BtD"}
@@ -1,5 +1,4 @@
1
1
  import { useMemo } from "react";
2
- var define_process_env_default = {};
3
2
  const MATERIAL_CONSTANTS = {
4
3
  STEEL_DENSITY: 7.85,
5
4
  LENGTH_CONVERSION_FACTOR: 1e3,
@@ -155,7 +154,7 @@ const useMaterialCalculations = (formValues) => {
155
154
  const boardsWeightResult = calculateBoardsWeight(formValues);
156
155
  const steelWeightResult = calculateSteelWeight(formValues);
157
156
  const materialWeightResult = calculateTubeMaterialWeight(formValues);
158
- if (define_process_env_default.NODE_ENV === "development") {
157
+ if (process.env.NODE_ENV === "development") {
159
158
  [totalWidthResult, materialUnitResult, boardsWeightResult, steelWeightResult, materialWeightResult].filter((result) => !result.isValid && result.error).forEach((result) => console.warn("Calculation warning:", result.error));
160
159
  }
161
160
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../../../src/hooks/use-material-calculations.ts"],"sourcesContent":["/* eslint-disable react-hooks/exhaustive-deps */\nimport { useMemo } from 'react';\n\n// ==================== CONSTANTS ====================\nconst MATERIAL_CONSTANTS = {\n STEEL_DENSITY: 7.85,\n LENGTH_CONVERSION_FACTOR: 1000,\n TUBE_CALCULATION_FACTOR: 0.024662,\n COIL_WEIGHTS: {\n GI: 2879.95,\n HR: 2356.59,\n },\n} as const;\n\n// ==================== TYPES ====================\ntype SteelType = keyof typeof MATERIAL_CONSTANTS.COIL_WEIGHTS;\ntype TubeType = 'Round' | 'Square' | 'Rectangle';\n\ninterface BaseFormValues {\n // Board calculation fields\n face_width?: string | number;\n bending?: string | number;\n height?: string | number;\n total_width?: string | number;\n boards_thickness?: string | number;\n boards_length?: string | number;\n \n // Steel calculation fields\n steel_length?: string | number;\n steel_width?: string | number;\n steel_thickness?: string | number;\n steel_type?: SteelType;\n \n // Tube calculation fields\n tube_type?: TubeType;\n tube_od?: string | number;\n shape_width?: string | number;\n shape_height?: string | number;\n material_thickness?: string | number;\n material_length?: string | number;\n}\n\ninterface MaterialCalculations {\n totalWidth: number;\n materialUnit: number;\n boardsWeight: number;\n steelWeight: number;\n materialWeight: number;\n}\n\ninterface CalculationResult<T = number> {\n value: T;\n isValid: boolean;\n error?: string;\n}\n\n// ==================== UTILITY FUNCTIONS ====================\n/**\n * Safely parses a value to number with comprehensive validation\n */\nconst safeParseNumber = (value: string | number | undefined | null): CalculationResult<number> => {\n if (value === undefined || value === null || value === '') {\n return { value: 0, isValid: false, error: 'Empty value' };\n }\n \n const parsed = typeof value === 'string' ? parseFloat(value.trim()) : Number(value);\n \n if (isNaN(parsed)) {\n return { value: 0, isValid: false, error: 'Invalid number format' };\n }\n \n if (!isFinite(parsed)) {\n return { value: 0, isValid: false, error: 'Number is not finite' };\n }\n \n return { value: parsed, isValid: true };\n};\n\n/**\n * Validates that all provided values are positive numbers\n */\nconst validatePositiveNumbers = (...values: (string | number | undefined)[]): boolean => {\n return values.every(value => {\n const result = safeParseNumber(value);\n return result.isValid && result.value > 0;\n });\n};\n\n/**\n * Creates a memoization key from form values to optimize re-calculations\n */\nconst createMemoKey = (formValues: BaseFormValues | undefined): string => {\n if (!formValues) return 'empty';\n \n // Only include relevant fields to avoid unnecessary recalculations\n const relevantFields = [\n 'face_width', 'bending', 'height', 'total_width', 'boards_thickness', 'boards_length',\n 'steel_length', 'steel_width', 'steel_thickness', 'steel_type',\n 'tube_type', 'tube_od', 'shape_width', 'shape_height', 'material_thickness', 'material_length'\n ];\n \n return relevantFields\n .map(field => `${field}:${formValues[field as keyof BaseFormValues] ?? ''}`)\n .join('|');\n};\n\n// ==================== CALCULATION FUNCTIONS ====================\n/**\n * Calculates the total width for boards costing\n * Formula: ((height + bending) * 2) + face_width\n */\nconst calculateBoardsTotalWidth = (formValues: BaseFormValues): CalculationResult<number> => {\n const { face_width, bending, height } = formValues;\n \n if (!validatePositiveNumbers(face_width, bending, height)) {\n return { value: 0, isValid: false, error: 'Invalid input values for boards total width calculation' };\n }\n \n const faceWidthResult = safeParseNumber(face_width);\n const bendingResult = safeParseNumber(bending);\n const heightResult = safeParseNumber(height);\n \n if (![faceWidthResult, bendingResult, heightResult].every(r => r.isValid)) {\n return { value: 0, isValid: false, error: 'Failed to parse input values' };\n }\n \n const totalWidth = ((heightResult.value + bendingResult.value) * 2) + faceWidthResult.value;\n \n return { value: totalWidth, isValid: true };\n};\n\n/**\n * Calculates the weight of boards\n * Formula: (total_width * thickness * (length / 1000)) * 7.85\n */\nconst calculateBoardsWeight = (formValues: BaseFormValues): CalculationResult<number> => {\n const { total_width, boards_thickness, boards_length } = formValues;\n \n if (!validatePositiveNumbers(total_width, boards_thickness, boards_length)) {\n return { value: 0, isValid: false, error: 'Invalid input values for boards weight calculation' };\n }\n \n const totalWidthResult = safeParseNumber(total_width);\n const thicknessResult = safeParseNumber(boards_thickness);\n const lengthResult = safeParseNumber(boards_length);\n \n if (![totalWidthResult, thicknessResult, lengthResult].every(r => r.isValid)) {\n return { value: 0, isValid: false, error: 'Failed to parse input values' };\n }\n \n const weight = (totalWidthResult.value * thicknessResult.value * \n (lengthResult.value / MATERIAL_CONSTANTS.LENGTH_CONVERSION_FACTOR)) * \n MATERIAL_CONSTANTS.STEEL_DENSITY;\n \n return { value: weight, isValid: true };\n};\n\n/**\n * Calculates the weight of steel\n * Formula: (length * width * thickness * 7.85) / 1000\n */\nconst calculateSteelWeight = (formValues: BaseFormValues): CalculationResult<number> => {\n const { steel_length, steel_width, steel_thickness } = formValues;\n \n if (!validatePositiveNumbers(steel_length, steel_width, steel_thickness)) {\n return { value: 0, isValid: false, error: 'Invalid input values for steel weight calculation' };\n }\n \n const lengthResult = safeParseNumber(steel_length);\n const widthResult = safeParseNumber(steel_width);\n const thicknessResult = safeParseNumber(steel_thickness);\n \n if (![lengthResult, widthResult, thicknessResult].every(r => r.isValid)) {\n return { value: 0, isValid: false, error: 'Failed to parse input values' };\n }\n \n const weight = (lengthResult.value * widthResult.value * thicknessResult.value * \n MATERIAL_CONSTANTS.STEEL_DENSITY) / MATERIAL_CONSTANTS.LENGTH_CONVERSION_FACTOR;\n \n return { value: weight, isValid: true };\n};\n\n/**\n * Gets the material unit weight based on steel type\n */\nconst calculateMaterialUnit = (formValues: BaseFormValues): CalculationResult<number> => {\n const { steel_type } = formValues;\n \n if (!steel_type) {\n return { value: 0, isValid: false, error: 'Steel type not specified' };\n }\n \n if (!(steel_type in MATERIAL_CONSTANTS.COIL_WEIGHTS)) {\n return { value: 0, isValid: false, error: `Unsupported steel type: ${steel_type}` };\n }\n \n const weight = MATERIAL_CONSTANTS.COIL_WEIGHTS[steel_type];\n return { value: weight, isValid: true };\n};\n\n/**\n * Calculates material weight based on tube type and dimensions\n * Supports Round, Square, and Rectangle tube types\n */\nconst calculateTubeMaterialWeight = (formValues: BaseFormValues): CalculationResult<number> => {\n const { tube_type, tube_od, shape_width, shape_height, material_thickness, material_length } = formValues;\n \n if (!tube_type) {\n return { value: 0, isValid: false, error: 'Tube type not specified' };\n }\n \n const thicknessResult = safeParseNumber(material_thickness);\n const lengthResult = safeParseNumber(material_length);\n \n if (!thicknessResult.isValid || !lengthResult.isValid) {\n return { value: 0, isValid: false, error: 'Invalid thickness or length values' };\n }\n \n let weight = 0;\n \n switch (tube_type) {\n case 'Round': {\n const odResult = safeParseNumber(tube_od);\n if (!odResult.isValid || odResult.value <= thicknessResult.value) {\n return { value: 0, isValid: false, error: 'Invalid outer diameter for round tube' };\n }\n \n weight = (odResult.value - thicknessResult.value) * thicknessResult.value * \n MATERIAL_CONSTANTS.TUBE_CALCULATION_FACTOR * lengthResult.value;\n break;\n }\n \n case 'Square':\n case 'Rectangle': {\n const widthResult = safeParseNumber(shape_width);\n const heightResult = safeParseNumber(shape_height);\n \n if (!widthResult.isValid || !heightResult.isValid) {\n return { value: 0, isValid: false, error: 'Invalid width or height for rectangular tube' };\n }\n \n const perimeter = 2 * (widthResult.value + heightResult.value);\n weight = (((perimeter / Math.PI) - thicknessResult.value) * thicknessResult.value * \n MATERIAL_CONSTANTS.TUBE_CALCULATION_FACTOR) * lengthResult.value;\n break;\n }\n \n default:\n return { value: 0, isValid: false, error: `Unsupported tube type: ${tube_type}` };\n }\n \n return { value: Math.max(0, weight), isValid: true };\n};\n\n// ==================== MAIN HOOK ====================\n/**\n * Custom hook for optimized material calculations with comprehensive error handling\n * and performance optimization through memoization\n */\nexport const useMaterialCalculations = (formValues?: BaseFormValues): MaterialCalculations => {\n const calculations = useMemo(() => {\n if (!formValues) {\n return {\n totalWidth: 0,\n materialUnit: 0,\n boardsWeight: 0,\n steelWeight: 0,\n materialWeight: 0,\n };\n }\n \n // Calculate all values with error handling\n const totalWidthResult = calculateBoardsTotalWidth(formValues);\n const materialUnitResult = calculateMaterialUnit(formValues);\n const boardsWeightResult = calculateBoardsWeight(formValues);\n const steelWeightResult = calculateSteelWeight(formValues);\n const materialWeightResult = calculateTubeMaterialWeight(formValues);\n \n // Optional: Log errors in development\n if (process.env.NODE_ENV === 'development') {\n [totalWidthResult, materialUnitResult, boardsWeightResult, steelWeightResult, materialWeightResult]\n .filter(result => !result.isValid && result.error)\n .forEach(result => console.warn('Calculation warning:', result.error));\n }\n \n return {\n totalWidth: totalWidthResult.value,\n materialUnit: materialUnitResult.value,\n boardsWeight: boardsWeightResult.value,\n steelWeight: steelWeightResult.value,\n materialWeight: materialWeightResult.value,\n };\n }, [createMemoKey(formValues)]); // Optimized dependency to prevent unnecessary recalculations\n \n return calculations;\n};\n\n// ==================== ADDITIONAL UTILITIES ====================\n/**\n * Utility function to validate form values before calculations\n */\nexport const validateFormValues = (formValues: BaseFormValues): { isValid: boolean; errors: string[] } => {\n const errors: string[] = [];\n const { tube_type, steel_type } = formValues;\n \n // Validate steel type if provided\n if (steel_type && !(steel_type in MATERIAL_CONSTANTS.COIL_WEIGHTS)) {\n errors.push(`Invalid steel type: ${steel_type}`);\n }\n \n // Validate tube type if provided\n if (tube_type && !['Round', 'Square', 'Rectangle'].includes(tube_type)) {\n errors.push(`Invalid tube type: ${tube_type}`);\n }\n \n return { isValid: errors.length === 0, errors };\n};\n\n/**\n * Get available steel types for form validation\n */\nexport const getAvailableSteelTypes = (): SteelType[] => {\n return Object.keys(MATERIAL_CONSTANTS.COIL_WEIGHTS) as SteelType[];\n};\n\n/**\n * Get available tube types for form validation\n */\nexport const getAvailableTubeTypes = (): TubeType[] => {\n return ['Round', 'Square', 'Rectangle'];\n};\n\nexport default {\n useMaterialCalculations,\n validateFormValues,\n getAvailableSteelTypes,\n getAvailableTubeTypes,\n MATERIAL_CONSTANTS,\n};\nexport type {\n BaseFormValues,\n MaterialCalculations,\n SteelType,\n TubeType,\n CalculationResult,\n};"],"names":[],"mappings":";;AAIA,MAAM,qBAAqB;AAAA,EACzB,eAAe;AAAA,EACf,0BAA0B;AAAA,EAC1B,yBAAyB;AAAA,EACzB,cAAc;A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F,OAAO,YAAU,CAAC,OAAO,WAAW,OAAO,KAAK,EAChD,QAAQ,CAAA,WAAU,QAAQ,KAAK,wBAAwB,OAAO,KAAK,CAAC;AAAA,IACzE;AAEA,WAAO;AAAA,MACL,YAAY,iBAAiB;AAAA,MAC7B,cAAc,mBAAmB;AAAA,MACjC,cAAc,mBAAmB;AAAA,MACjC,aAAa,kBAAkB;AAAA,MAC/B,gBAAgB,qBAAqB;AAAA,IAAA;AAAA,EAEzC,GAAG,CAAC,cAAc,UAAU,CAAC,CAAC;AAE9B,SAAO;AACT;AAMO,MAAM,qBAAqB,CAAC,eAAuE;AACxG,QAAM,SAAmB,CAAA;AACzB,QAAM,EAAE,WAAW,WAAA,IAAe;AAGlC,MAAI,cAAc,EAAE,cAAc,mBAAmB,eAAe;AAClE,WAAO,KAAK,uBAAuB,UAAU,EAAE;AAAA,EACjD;AAGA,MAAI,aAAa,CAAC,CAAC,SAAS,UAAU,WAAW,EAAE,SAAS,SAAS,GAAG;AACtE,WAAO,KAAK,sBAAsB,SAAS,EAAE;AAAA,EAC/C;AAEA,SAAO,EAAE,SAAS,OAAO,WAAW,GAAG,OAAA;AACzC;AAKO,MAAM,yBAAyB,MAAmB;AACvD,SAAO,OAAO,KAAK,mBAAmB,YAAY;AACpD;AAKO,MAAM,wBAAwB,MAAkB;AACrD,SAAO,CAAC,SAAS,UAAU,WAAW;AACxC;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../../../src/hooks/use-material-calculations.ts"],"sourcesContent":["/* eslint-disable react-hooks/exhaustive-deps */\nimport { useMemo } from 'react';\n\n// ==================== CONSTANTS ====================\nconst MATERIAL_CONSTANTS = {\n STEEL_DENSITY: 7.85,\n LENGTH_CONVERSION_FACTOR: 1000,\n TUBE_CALCULATION_FACTOR: 0.024662,\n COIL_WEIGHTS: {\n GI: 2879.95,\n HR: 2356.59,\n },\n} as const;\n\n// ==================== TYPES ====================\ntype SteelType = keyof typeof MATERIAL_CONSTANTS.COIL_WEIGHTS;\ntype TubeType = 'Round' | 'Square' | 'Rectangle';\n\ninterface BaseFormValues {\n // Board calculation fields\n face_width?: string | number;\n bending?: string | number;\n height?: string | number;\n total_width?: string | number;\n boards_thickness?: string | number;\n boards_length?: string | number;\n \n // Steel calculation fields\n steel_length?: string | number;\n steel_width?: string | number;\n steel_thickness?: string | number;\n steel_type?: SteelType;\n \n // Tube calculation fields\n tube_type?: TubeType;\n tube_od?: string | number;\n shape_width?: string | number;\n shape_height?: string | number;\n material_thickness?: string | number;\n material_length?: string | number;\n}\n\ninterface MaterialCalculations {\n totalWidth: number;\n materialUnit: number;\n boardsWeight: number;\n steelWeight: number;\n materialWeight: number;\n}\n\ninterface CalculationResult<T = number> {\n value: T;\n isValid: boolean;\n error?: string;\n}\n\n// ==================== UTILITY FUNCTIONS ====================\n/**\n * Safely parses a value to number with comprehensive validation\n */\nconst safeParseNumber = (value: string | number | undefined | null): CalculationResult<number> => {\n if (value === undefined || value === null || value === '') {\n return { value: 0, isValid: false, error: 'Empty value' };\n }\n \n const parsed = typeof value === 'string' ? parseFloat(value.trim()) : Number(value);\n \n if (isNaN(parsed)) {\n return { value: 0, isValid: false, error: 'Invalid number format' };\n }\n \n if (!isFinite(parsed)) {\n return { value: 0, isValid: false, error: 'Number is not finite' };\n }\n \n return { value: parsed, isValid: true };\n};\n\n/**\n * Validates that all provided values are positive numbers\n */\nconst validatePositiveNumbers = (...values: (string | number | undefined)[]): boolean => {\n return values.every(value => {\n const result = safeParseNumber(value);\n return result.isValid && result.value > 0;\n });\n};\n\n/**\n * Creates a memoization key from form values to optimize re-calculations\n */\nconst createMemoKey = (formValues: BaseFormValues | undefined): string => {\n if (!formValues) return 'empty';\n \n // Only include relevant fields to avoid unnecessary recalculations\n const relevantFields = [\n 'face_width', 'bending', 'height', 'total_width', 'boards_thickness', 'boards_length',\n 'steel_length', 'steel_width', 'steel_thickness', 'steel_type',\n 'tube_type', 'tube_od', 'shape_width', 'shape_height', 'material_thickness', 'material_length'\n ];\n \n return relevantFields\n .map(field => `${field}:${formValues[field as keyof BaseFormValues] ?? ''}`)\n .join('|');\n};\n\n// ==================== CALCULATION FUNCTIONS ====================\n/**\n * Calculates the total width for boards costing\n * Formula: ((height + bending) * 2) + face_width\n */\nconst calculateBoardsTotalWidth = (formValues: BaseFormValues): CalculationResult<number> => {\n const { face_width, bending, height } = formValues;\n \n if (!validatePositiveNumbers(face_width, bending, height)) {\n return { value: 0, isValid: false, error: 'Invalid input values for boards total width calculation' };\n }\n \n const faceWidthResult = safeParseNumber(face_width);\n const bendingResult = safeParseNumber(bending);\n const heightResult = safeParseNumber(height);\n \n if (![faceWidthResult, bendingResult, heightResult].every(r => r.isValid)) {\n return { value: 0, isValid: false, error: 'Failed to parse input values' };\n }\n \n const totalWidth = ((heightResult.value + bendingResult.value) * 2) + faceWidthResult.value;\n \n return { value: totalWidth, isValid: true };\n};\n\n/**\n * Calculates the weight of boards\n * Formula: (total_width * thickness * (length / 1000)) * 7.85\n */\nconst calculateBoardsWeight = (formValues: BaseFormValues): CalculationResult<number> => {\n const { total_width, boards_thickness, boards_length } = formValues;\n \n if (!validatePositiveNumbers(total_width, boards_thickness, boards_length)) {\n return { value: 0, isValid: false, error: 'Invalid input values for boards weight calculation' };\n }\n \n const totalWidthResult = safeParseNumber(total_width);\n const thicknessResult = safeParseNumber(boards_thickness);\n const lengthResult = safeParseNumber(boards_length);\n \n if (![totalWidthResult, thicknessResult, lengthResult].every(r => r.isValid)) {\n return { value: 0, isValid: false, error: 'Failed to parse input values' };\n }\n \n const weight = (totalWidthResult.value * thicknessResult.value * \n (lengthResult.value / MATERIAL_CONSTANTS.LENGTH_CONVERSION_FACTOR)) * \n MATERIAL_CONSTANTS.STEEL_DENSITY;\n \n return { value: weight, isValid: true };\n};\n\n/**\n * Calculates the weight of steel\n * Formula: (length * width * thickness * 7.85) / 1000\n */\nconst calculateSteelWeight = (formValues: BaseFormValues): CalculationResult<number> => {\n const { steel_length, steel_width, steel_thickness } = formValues;\n \n if (!validatePositiveNumbers(steel_length, steel_width, steel_thickness)) {\n return { value: 0, isValid: false, error: 'Invalid input values for steel weight calculation' };\n }\n \n const lengthResult = safeParseNumber(steel_length);\n const widthResult = safeParseNumber(steel_width);\n const thicknessResult = safeParseNumber(steel_thickness);\n \n if (![lengthResult, widthResult, thicknessResult].every(r => r.isValid)) {\n return { value: 0, isValid: false, error: 'Failed to parse input values' };\n }\n \n const weight = (lengthResult.value * widthResult.value * thicknessResult.value * \n MATERIAL_CONSTANTS.STEEL_DENSITY) / MATERIAL_CONSTANTS.LENGTH_CONVERSION_FACTOR;\n \n return { value: weight, isValid: true };\n};\n\n/**\n * Gets the material unit weight based on steel type\n */\nconst calculateMaterialUnit = (formValues: BaseFormValues): CalculationResult<number> => {\n const { steel_type } = formValues;\n \n if (!steel_type) {\n return { value: 0, isValid: false, error: 'Steel type not specified' };\n }\n \n if (!(steel_type in MATERIAL_CONSTANTS.COIL_WEIGHTS)) {\n return { value: 0, isValid: false, error: `Unsupported steel type: ${steel_type}` };\n }\n \n const weight = MATERIAL_CONSTANTS.COIL_WEIGHTS[steel_type];\n return { value: weight, isValid: true };\n};\n\n/**\n * Calculates material weight based on tube type and dimensions\n * Supports Round, Square, and Rectangle tube types\n */\nconst calculateTubeMaterialWeight = (formValues: BaseFormValues): CalculationResult<number> => {\n const { tube_type, tube_od, shape_width, shape_height, material_thickness, material_length } = formValues;\n \n if (!tube_type) {\n return { value: 0, isValid: false, error: 'Tube type not specified' };\n }\n \n const thicknessResult = safeParseNumber(material_thickness);\n const lengthResult = safeParseNumber(material_length);\n \n if (!thicknessResult.isValid || !lengthResult.isValid) {\n return { value: 0, isValid: false, error: 'Invalid thickness or length values' };\n }\n \n let weight = 0;\n \n switch (tube_type) {\n case 'Round': {\n const odResult = safeParseNumber(tube_od);\n if (!odResult.isValid || odResult.value <= thicknessResult.value) {\n return { value: 0, isValid: false, error: 'Invalid outer diameter for round tube' };\n }\n \n weight = (odResult.value - thicknessResult.value) * thicknessResult.value * \n MATERIAL_CONSTANTS.TUBE_CALCULATION_FACTOR * lengthResult.value;\n break;\n }\n \n case 'Square':\n case 'Rectangle': {\n const widthResult = safeParseNumber(shape_width);\n const heightResult = safeParseNumber(shape_height);\n \n if (!widthResult.isValid || !heightResult.isValid) {\n return { value: 0, isValid: false, error: 'Invalid width or height for rectangular tube' };\n }\n \n const perimeter = 2 * (widthResult.value + heightResult.value);\n weight = (((perimeter / Math.PI) - thicknessResult.value) * thicknessResult.value * \n MATERIAL_CONSTANTS.TUBE_CALCULATION_FACTOR) * lengthResult.value;\n break;\n }\n \n default:\n return { value: 0, isValid: false, error: `Unsupported tube type: ${tube_type}` };\n }\n \n return { value: Math.max(0, weight), isValid: true };\n};\n\n// ==================== MAIN HOOK ====================\n/**\n * Custom hook for optimized material calculations with comprehensive error handling\n * and performance optimization through memoization\n */\nexport const useMaterialCalculations = (formValues?: BaseFormValues): MaterialCalculations => {\n const calculations = useMemo(() => {\n if (!formValues) {\n return {\n totalWidth: 0,\n materialUnit: 0,\n boardsWeight: 0,\n steelWeight: 0,\n materialWeight: 0,\n };\n }\n \n // Calculate all values with error handling\n const totalWidthResult = calculateBoardsTotalWidth(formValues);\n const materialUnitResult = calculateMaterialUnit(formValues);\n const boardsWeightResult = calculateBoardsWeight(formValues);\n const steelWeightResult = calculateSteelWeight(formValues);\n const materialWeightResult = calculateTubeMaterialWeight(formValues);\n \n // Optional: Log errors in development\n if (process.env.NODE_ENV === 'development') {\n [totalWidthResult, materialUnitResult, boardsWeightResult, steelWeightResult, materialWeightResult]\n .filter(result => !result.isValid && result.error)\n .forEach(result => console.warn('Calculation warning:', result.error));\n }\n \n return {\n totalWidth: totalWidthResult.value,\n materialUnit: materialUnitResult.value,\n boardsWeight: boardsWeightResult.value,\n steelWeight: steelWeightResult.value,\n materialWeight: materialWeightResult.value,\n };\n }, [createMemoKey(formValues)]); // Optimized dependency to prevent unnecessary recalculations\n \n return calculations;\n};\n\n// ==================== ADDITIONAL UTILITIES ====================\n/**\n * Utility function to validate form values before calculations\n */\nexport const validateFormValues = (formValues: BaseFormValues): { isValid: boolean; errors: string[] } => {\n const errors: string[] = [];\n const { tube_type, steel_type } = formValues;\n \n // Validate steel type if provided\n if (steel_type && !(steel_type in MATERIAL_CONSTANTS.COIL_WEIGHTS)) {\n errors.push(`Invalid steel type: ${steel_type}`);\n }\n \n // Validate tube type if provided\n if (tube_type && !['Round', 'Square', 'Rectangle'].includes(tube_type)) {\n errors.push(`Invalid tube type: ${tube_type}`);\n }\n \n return { isValid: errors.length === 0, errors };\n};\n\n/**\n * Get available steel types for form validation\n */\nexport const getAvailableSteelTypes = (): SteelType[] => {\n return Object.keys(MATERIAL_CONSTANTS.COIL_WEIGHTS) as SteelType[];\n};\n\n/**\n * Get available tube types for form validation\n */\nexport const getAvailableTubeTypes = (): TubeType[] => {\n return ['Round', 'Square', 'Rectangle'];\n};\n\nexport default {\n useMaterialCalculations,\n validateFormValues,\n getAvailableSteelTypes,\n getAvailableTubeTypes,\n MATERIAL_CONSTANTS,\n};\nexport type {\n BaseFormValues,\n MaterialCalculations,\n SteelType,\n TubeType,\n CalculationResult,\n};"],"names":[],"mappings":";AAIA,MAAM,qBAAqB;AAAA,EACzB,eAAe;AAAA,EACf,0BAA0B;AAAA,EAC1B,yBAAyB;AAAA,EACzB,cAAc;AAAA,IACZ,IAAI;AAAA,IACJ,IAAI;AAAA,EAAA;AAER;AAgDA,MAAM,kBAAkB,CAAC,UAAyE;AAChG,MAAI,UAAU,UAAa,UAAU,QAAQ,UAAU,IAAI;AACzD,WAAO,EAAE,OAAO,GAAG,SAAS,OAAO,OAAO,cAAA;AAAA,EAC5C;AAEA,QAAM,SAAS,OAAO,UAAU,WAAW,WAAW,MAAM,KAAA,CAAM,IAAI,OAAO,KAAK;AAElF,MAAI,MAAM,MAAM,GAAG;AACjB,WAAO,EAAE,OAAO,GAAG,SAAS,OAAO,OAAO,wBAAA;AAAA,EAC5C;AAEA,MAAI,CAAC,SAAS,MAAM,GAAG;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zB,QAAM,EAAE,WAAW,WAAA,IAAe;AAGlC,MAAI,cAAc,EAAE,cAAc,mBAAmB,eAAe;AAClE,WAAO,KAAK,uBAAuB,UAAU,EAAE;AAAA,EACjD;AAGA,MAAI,aAAa,CAAC,CAAC,SAAS,UAAU,WAAW,EAAE,SAAS,SAAS,GAAG;AACtE,WAAO,KAAK,sBAAsB,SAAS,EAAE;AAAA,EAC/C;AAEA,SAAO,EAAE,SAAS,OAAO,WAAW,GAAG,OAAA;AACzC;AAKO,MAAM,yBAAyB,MAAmB;AACvD,SAAO,OAAO,KAAK,mBAAmB,YAAY;AACpD;AAKO,MAAM,wBAAwB,MAAkB;AACrD,SAAO,CAAC,SAAS,UAAU,WAAW;AACxC;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t={};const a={STEEL_DENSITY:7.85,LENGTH_CONVERSION_FACTOR:1e3,TUBE_CALCULATION_FACTOR:.024662,COIL_WEIGHTS:{GI:2879.95,HR:2356.59}},i=e=>{if(null==e||""===e)return{value:0,isValid:!1,error:"Empty value"};const t="string"==typeof e?parseFloat(e.trim()):Number(e);return isNaN(t)?{value:0,isValid:!1,error:"Invalid number format"}:isFinite(t)?{value:t,isValid:!0}:{value:0,isValid:!1,error:"Number is not finite"}},l=(...e)=>e.every(e=>{const t=i(e);return t.isValid&&t.value>0}),r=e=>e?["face_width","bending","height","total_width","boards_thickness","boards_length","steel_length","steel_width","steel_thickness","steel_type","tube_type","tube_od","shape_width","shape_height","material_thickness","material_length"].map(t=>`${t}:${e[t]??""}`).join("|"):"empty";exports.getAvailableSteelTypes=()=>Object.keys(a.COIL_WEIGHTS),exports.getAvailableTubeTypes=()=>["Round","Square","Rectangle"],exports.useMaterialCalculations=s=>e.useMemo(()=>{if(!s)return{totalWidth:0,materialUnit:0,boardsWeight:0,steelWeight:0,materialWeight:0};const e=(e=>{const{face_width:t,bending:a,height:r}=e;if(!l(t,a,r))return{value:0,isValid:!1,error:"Invalid input values for boards total width calculation"};const s=i(t),u=i(a),n=i(r);return[s,u,n].every(e=>e.isValid)?{value:2*(n.value+u.value)+s.value,isValid:!0}:{value:0,isValid:!1,error:"Failed to parse input values"}})(s),r=(e=>{const{steel_type:t}=e;return t?t in a.COIL_WEIGHTS?{value:a.COIL_WEIGHTS[t],isValid:!0}:{value:0,isValid:!1,error:`Unsupported steel type: ${t}`}:{value:0,isValid:!1,error:"Steel type not specified"}})(s),u=(e=>{const{total_width:t,boards_thickness:r,boards_length:s}=e;if(!l(t,r,s))return{value:0,isValid:!1,error:"Invalid input values for boards weight calculation"};const u=i(t),n=i(r),o=i(s);return[u,n,o].every(e=>e.isValid)?{value:u.value*n.value*(o.value/a.LENGTH_CONVERSION_FACTOR)*a.STEEL_DENSITY,isValid:!0}:{value:0,isValid:!1,error:"Failed to parse input values"}})(s),n=(e=>{const{steel_length:t,steel_width:r,steel_thickness:s}=e;if(!l(t,r,s))return{value:0,isValid:!1,error:"Invalid input values for steel weight calculation"};const u=i(t),n=i(r),o=i(s);return[u,n,o].every(e=>e.isValid)?{value:u.value*n.value*o.value*a.STEEL_DENSITY/a.LENGTH_CONVERSION_FACTOR,isValid:!0}:{value:0,isValid:!1,error:"Failed to parse input values"}})(s),o=(e=>{const{tube_type:t,tube_od:l,shape_width:r,shape_height:s,material_thickness:u,material_length:n}=e;if(!t)return{value:0,isValid:!1,error:"Tube type not specified"};const o=i(u),d=i(n);if(!o.isValid||!d.isValid)return{value:0,isValid:!1,error:"Invalid thickness or length values"};let v=0;switch(t){case"Round":{const e=i(l);if(!e.isValid||e.value<=o.value)return{value:0,isValid:!1,error:"Invalid outer diameter for round tube"};v=(e.value-o.value)*o.value*a.TUBE_CALCULATION_FACTOR*d.value;break}case"Square":case"Rectangle":{const e=i(r),t=i(s);if(!e.isValid||!t.isValid)return{value:0,isValid:!1,error:"Invalid width or height for rectangular tube"};v=(2*(e.value+t.value)/Math.PI-o.value)*o.value*a.TUBE_CALCULATION_FACTOR*d.value;break}default:return{value:0,isValid:!1,error:`Unsupported tube type: ${t}`}}return{value:Math.max(0,v),isValid:!0}})(s);return"development"===t.NODE_ENV&&[e,r,u,n,o].filter(e=>!e.isValid&&e.error).forEach(e=>{}),{totalWidth:e.value,materialUnit:r.value,boardsWeight:u.value,steelWeight:n.value,materialWeight:o.value}},[r(s)]),exports.validateFormValues=e=>{const t=[],{tube_type:i,steel_type:l}=e;return l&&!(l in a.COIL_WEIGHTS)&&t.push(`Invalid steel type: ${l}`),i&&!["Round","Square","Rectangle"].includes(i)&&t.push(`Invalid tube type: ${i}`),{isValid:0===t.length,errors:t}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");const t={STEEL_DENSITY:7.85,LENGTH_CONVERSION_FACTOR:1e3,TUBE_CALCULATION_FACTOR:.024662,COIL_WEIGHTS:{GI:2879.95,HR:2356.59}},a=e=>{if(null==e||""===e)return{value:0,isValid:!1,error:"Empty value"};const t="string"==typeof e?parseFloat(e.trim()):Number(e);return isNaN(t)?{value:0,isValid:!1,error:"Invalid number format"}:isFinite(t)?{value:t,isValid:!0}:{value:0,isValid:!1,error:"Number is not finite"}},i=(...e)=>e.every(e=>{const t=a(e);return t.isValid&&t.value>0}),l=e=>e?["face_width","bending","height","total_width","boards_thickness","boards_length","steel_length","steel_width","steel_thickness","steel_type","tube_type","tube_od","shape_width","shape_height","material_thickness","material_length"].map(t=>`${t}:${e[t]??""}`).join("|"):"empty";exports.getAvailableSteelTypes=()=>Object.keys(t.COIL_WEIGHTS),exports.getAvailableTubeTypes=()=>["Round","Square","Rectangle"],exports.useMaterialCalculations=r=>e.useMemo(()=>{if(!r)return{totalWidth:0,materialUnit:0,boardsWeight:0,steelWeight:0,materialWeight:0};const e=(e=>{const{face_width:t,bending:l,height:r}=e;if(!i(t,l,r))return{value:0,isValid:!1,error:"Invalid input values for boards total width calculation"};const s=a(t),u=a(l),n=a(r);return[s,u,n].every(e=>e.isValid)?{value:2*(n.value+u.value)+s.value,isValid:!0}:{value:0,isValid:!1,error:"Failed to parse input values"}})(r),l=(e=>{const{steel_type:a}=e;return a?a in t.COIL_WEIGHTS?{value:t.COIL_WEIGHTS[a],isValid:!0}:{value:0,isValid:!1,error:`Unsupported steel type: ${a}`}:{value:0,isValid:!1,error:"Steel type not specified"}})(r),s=(e=>{const{total_width:l,boards_thickness:r,boards_length:s}=e;if(!i(l,r,s))return{value:0,isValid:!1,error:"Invalid input values for boards weight calculation"};const u=a(l),n=a(r),o=a(s);return[u,n,o].every(e=>e.isValid)?{value:u.value*n.value*(o.value/t.LENGTH_CONVERSION_FACTOR)*t.STEEL_DENSITY,isValid:!0}:{value:0,isValid:!1,error:"Failed to parse input values"}})(r),u=(e=>{const{steel_length:l,steel_width:r,steel_thickness:s}=e;if(!i(l,r,s))return{value:0,isValid:!1,error:"Invalid input values for steel weight calculation"};const u=a(l),n=a(r),o=a(s);return[u,n,o].every(e=>e.isValid)?{value:u.value*n.value*o.value*t.STEEL_DENSITY/t.LENGTH_CONVERSION_FACTOR,isValid:!0}:{value:0,isValid:!1,error:"Failed to parse input values"}})(r),n=(e=>{const{tube_type:i,tube_od:l,shape_width:r,shape_height:s,material_thickness:u,material_length:n}=e;if(!i)return{value:0,isValid:!1,error:"Tube type not specified"};const o=a(u),d=a(n);if(!o.isValid||!d.isValid)return{value:0,isValid:!1,error:"Invalid thickness or length values"};let v=0;switch(i){case"Round":{const e=a(l);if(!e.isValid||e.value<=o.value)return{value:0,isValid:!1,error:"Invalid outer diameter for round tube"};v=(e.value-o.value)*o.value*t.TUBE_CALCULATION_FACTOR*d.value;break}case"Square":case"Rectangle":{const e=a(r),i=a(s);if(!e.isValid||!i.isValid)return{value:0,isValid:!1,error:"Invalid width or height for rectangular tube"};v=(2*(e.value+i.value)/Math.PI-o.value)*o.value*t.TUBE_CALCULATION_FACTOR*d.value;break}default:return{value:0,isValid:!1,error:`Unsupported tube type: ${i}`}}return{value:Math.max(0,v),isValid:!0}})(r);return"development"===process.env.NODE_ENV&&[e,l,s,u,n].filter(e=>!e.isValid&&e.error).forEach(e=>{}),{totalWidth:e.value,materialUnit:l.value,boardsWeight:s.value,steelWeight:u.value,materialWeight:n.value}},[l(r)]),exports.validateFormValues=e=>{const a=[],{tube_type:i,steel_type:l}=e;return l&&!(l in t.COIL_WEIGHTS)&&a.push(`Invalid steel type: ${l}`),i&&!["Round","Square","Rectangle"].includes(i)&&a.push(`Invalid tube type: ${i}`),{isValid:0===a.length,errors:a}};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/hooks/use-material-calculations.ts"],"sourcesContent":["/* eslint-disable react-hooks/exhaustive-deps */\nimport { useMemo } from 'react';\n\n// ==================== CONSTANTS ====================\nconst MATERIAL_CONSTANTS = {\n STEEL_DENSITY: 7.85,\n LENGTH_CONVERSION_FACTOR: 1000,\n TUBE_CALCULATION_FACTOR: 0.024662,\n COIL_WEIGHTS: {\n GI: 2879.95,\n HR: 2356.59,\n },\n} as const;\n\n// ==================== TYPES ====================\ntype SteelType = keyof typeof MATERIAL_CONSTANTS.COIL_WEIGHTS;\ntype TubeType = 'Round' | 'Square' | 'Rectangle';\n\ninterface BaseFormValues {\n // Board calculation fields\n face_width?: string | number;\n bending?: string | number;\n height?: string | number;\n total_width?: string | number;\n boards_thickness?: string | number;\n boards_length?: string | number;\n \n // Steel calculation fields\n steel_length?: string | number;\n steel_width?: string | number;\n steel_thickness?: string | number;\n steel_type?: SteelType;\n \n // Tube calculation fields\n tube_type?: TubeType;\n tube_od?: string | number;\n shape_width?: string | number;\n shape_height?: string | number;\n material_thickness?: string | number;\n material_length?: string | number;\n}\n\ninterface MaterialCalculations {\n totalWidth: number;\n materialUnit: number;\n boardsWeight: number;\n steelWeight: number;\n materialWeight: number;\n}\n\ninterface CalculationResult<T = number> {\n value: T;\n isValid: boolean;\n error?: string;\n}\n\n// ==================== UTILITY FUNCTIONS ====================\n/**\n * Safely parses a value to number with comprehensive validation\n */\nconst safeParseNumber = (value: string | number | undefined | null): CalculationResult<number> => {\n if (value === undefined || value === null || value === '') {\n return { value: 0, isValid: false, error: 'Empty value' };\n }\n \n const parsed = typeof value === 'string' ? parseFloat(value.trim()) : Number(value);\n \n if (isNaN(parsed)) {\n return { value: 0, isValid: false, error: 'Invalid number format' };\n }\n \n if (!isFinite(parsed)) {\n return { value: 0, isValid: false, error: 'Number is not finite' };\n }\n \n return { value: parsed, isValid: true };\n};\n\n/**\n * Validates that all provided values are positive numbers\n */\nconst validatePositiveNumbers = (...values: (string | number | undefined)[]): boolean => {\n return values.every(value => {\n const result = safeParseNumber(value);\n return result.isValid && result.value > 0;\n });\n};\n\n/**\n * Creates a memoization key from form values to optimize re-calculations\n */\nconst createMemoKey = (formValues: BaseFormValues | undefined): string => {\n if (!formValues) return 'empty';\n \n // Only include relevant fields to avoid unnecessary recalculations\n const relevantFields = [\n 'face_width', 'bending', 'height', 'total_width', 'boards_thickness', 'boards_length',\n 'steel_length', 'steel_width', 'steel_thickness', 'steel_type',\n 'tube_type', 'tube_od', 'shape_width', 'shape_height', 'material_thickness', 'material_length'\n ];\n \n return relevantFields\n .map(field => `${field}:${formValues[field as keyof BaseFormValues] ?? ''}`)\n .join('|');\n};\n\n// ==================== CALCULATION FUNCTIONS ====================\n/**\n * Calculates the total width for boards costing\n * Formula: ((height + bending) * 2) + face_width\n */\nconst calculateBoardsTotalWidth = (formValues: BaseFormValues): CalculationResult<number> => {\n const { face_width, bending, height } = formValues;\n \n if (!validatePositiveNumbers(face_width, bending, height)) {\n return { value: 0, isValid: false, error: 'Invalid input values for boards total width calculation' };\n }\n \n const faceWidthResult = safeParseNumber(face_width);\n const bendingResult = safeParseNumber(bending);\n const heightResult = safeParseNumber(height);\n \n if (![faceWidthResult, bendingResult, heightResult].every(r => r.isValid)) {\n return { value: 0, isValid: false, error: 'Failed to parse input values' };\n }\n \n const totalWidth = ((heightResult.value + bendingResult.value) * 2) + faceWidthResult.value;\n \n return { value: totalWidth, isValid: true };\n};\n\n/**\n * Calculates the weight of boards\n * Formula: (total_width * thickness * (length / 1000)) * 7.85\n */\nconst calculateBoardsWeight = (formValues: BaseFormValues): CalculationResult<number> => {\n const { total_width, boards_thickness, boards_length } = formValues;\n \n if (!validatePositiveNumbers(total_width, boards_thickness, boards_length)) {\n return { value: 0, isValid: false, error: 'Invalid input values for boards weight calculation' };\n }\n \n const totalWidthResult = safeParseNumber(total_width);\n const thicknessResult = safeParseNumber(boards_thickness);\n const lengthResult = safeParseNumber(boards_length);\n \n if (![totalWidthResult, thicknessResult, lengthResult].every(r => r.isValid)) {\n return { value: 0, isValid: false, error: 'Failed to parse input values' };\n }\n \n const weight = (totalWidthResult.value * thicknessResult.value * \n (lengthResult.value / MATERIAL_CONSTANTS.LENGTH_CONVERSION_FACTOR)) * \n MATERIAL_CONSTANTS.STEEL_DENSITY;\n \n return { value: weight, isValid: true };\n};\n\n/**\n * Calculates the weight of steel\n * Formula: (length * width * thickness * 7.85) / 1000\n */\nconst calculateSteelWeight = (formValues: BaseFormValues): CalculationResult<number> => {\n const { steel_length, steel_width, steel_thickness } = formValues;\n \n if (!validatePositiveNumbers(steel_length, steel_width, steel_thickness)) {\n return { value: 0, isValid: false, error: 'Invalid input values for steel weight calculation' };\n }\n \n const lengthResult = safeParseNumber(steel_length);\n const widthResult = safeParseNumber(steel_width);\n const thicknessResult = safeParseNumber(steel_thickness);\n \n if (![lengthResult, widthResult, thicknessResult].every(r => r.isValid)) {\n return { value: 0, isValid: false, error: 'Failed to parse input values' };\n }\n \n const weight = (lengthResult.value * widthResult.value * thicknessResult.value * \n MATERIAL_CONSTANTS.STEEL_DENSITY) / MATERIAL_CONSTANTS.LENGTH_CONVERSION_FACTOR;\n \n return { value: weight, isValid: true };\n};\n\n/**\n * Gets the material unit weight based on steel type\n */\nconst calculateMaterialUnit = (formValues: BaseFormValues): CalculationResult<number> => {\n const { steel_type } = formValues;\n \n if (!steel_type) {\n return { value: 0, isValid: false, error: 'Steel type not specified' };\n }\n \n if (!(steel_type in MATERIAL_CONSTANTS.COIL_WEIGHTS)) {\n return { value: 0, isValid: false, error: `Unsupported steel type: ${steel_type}` };\n }\n \n const weight = MATERIAL_CONSTANTS.COIL_WEIGHTS[steel_type];\n return { value: weight, isValid: true };\n};\n\n/**\n * Calculates material weight based on tube type and dimensions\n * Supports Round, Square, and Rectangle tube types\n */\nconst calculateTubeMaterialWeight = (formValues: BaseFormValues): CalculationResult<number> => {\n const { tube_type, tube_od, shape_width, shape_height, material_thickness, material_length } = formValues;\n \n if (!tube_type) {\n return { value: 0, isValid: false, error: 'Tube type not specified' };\n }\n \n const thicknessResult = safeParseNumber(material_thickness);\n const lengthResult = safeParseNumber(material_length);\n \n if (!thicknessResult.isValid || !lengthResult.isValid) {\n return { value: 0, isValid: false, error: 'Invalid thickness or length values' };\n }\n \n let weight = 0;\n \n switch (tube_type) {\n case 'Round': {\n const odResult = safeParseNumber(tube_od);\n if (!odResult.isValid || odResult.value <= thicknessResult.value) {\n return { value: 0, isValid: false, error: 'Invalid outer diameter for round tube' };\n }\n \n weight = (odResult.value - thicknessResult.value) * thicknessResult.value * \n MATERIAL_CONSTANTS.TUBE_CALCULATION_FACTOR * lengthResult.value;\n break;\n }\n \n case 'Square':\n case 'Rectangle': {\n const widthResult = safeParseNumber(shape_width);\n const heightResult = safeParseNumber(shape_height);\n \n if (!widthResult.isValid || !heightResult.isValid) {\n return { value: 0, isValid: false, error: 'Invalid width or height for rectangular tube' };\n }\n \n const perimeter = 2 * (widthResult.value + heightResult.value);\n weight = (((perimeter / Math.PI) - thicknessResult.value) * thicknessResult.value * \n MATERIAL_CONSTANTS.TUBE_CALCULATION_FACTOR) * lengthResult.value;\n break;\n }\n \n default:\n return { value: 0, isValid: false, error: `Unsupported tube type: ${tube_type}` };\n }\n \n return { value: Math.max(0, weight), isValid: true };\n};\n\n// ==================== MAIN HOOK ====================\n/**\n * Custom hook for optimized material calculations with comprehensive error handling\n * and performance optimization through memoization\n */\nexport const useMaterialCalculations = (formValues?: BaseFormValues): MaterialCalculations => {\n const calculations = useMemo(() => {\n if (!formValues) {\n return {\n totalWidth: 0,\n materialUnit: 0,\n boardsWeight: 0,\n steelWeight: 0,\n materialWeight: 0,\n };\n }\n \n // Calculate all values with error handling\n const totalWidthResult = calculateBoardsTotalWidth(formValues);\n const materialUnitResult = calculateMaterialUnit(formValues);\n const boardsWeightResult = calculateBoardsWeight(formValues);\n const steelWeightResult = calculateSteelWeight(formValues);\n const materialWeightResult = calculateTubeMaterialWeight(formValues);\n \n // Optional: Log errors in development\n if (process.env.NODE_ENV === 'development') {\n [totalWidthResult, materialUnitResult, boardsWeightResult, steelWeightResult, materialWeightResult]\n .filter(result => !result.isValid && result.error)\n .forEach(result => console.warn('Calculation warning:', result.error));\n }\n \n return {\n totalWidth: totalWidthResult.value,\n materialUnit: materialUnitResult.value,\n boardsWeight: boardsWeightResult.value,\n steelWeight: steelWeightResult.value,\n materialWeight: materialWeightResult.value,\n };\n }, [createMemoKey(formValues)]); // Optimized dependency to prevent unnecessary recalculations\n \n return calculations;\n};\n\n// ==================== ADDITIONAL UTILITIES ====================\n/**\n * Utility function to validate form values before calculations\n */\nexport const validateFormValues = (formValues: BaseFormValues): { isValid: boolean; errors: string[] } => {\n const errors: string[] = [];\n const { tube_type, steel_type } = formValues;\n \n // Validate steel type if provided\n if (steel_type && !(steel_type in MATERIAL_CONSTANTS.COIL_WEIGHTS)) {\n errors.push(`Invalid steel type: ${steel_type}`);\n }\n \n // Validate tube type if provided\n if (tube_type && !['Round', 'Square', 'Rectangle'].includes(tube_type)) {\n errors.push(`Invalid tube type: ${tube_type}`);\n }\n \n return { isValid: errors.length === 0, errors };\n};\n\n/**\n * Get available steel types for form validation\n */\nexport const getAvailableSteelTypes = (): SteelType[] => {\n return Object.keys(MATERIAL_CONSTANTS.COIL_WEIGHTS) as SteelType[];\n};\n\n/**\n * Get available tube types for form validation\n */\nexport const getAvailableTubeTypes = (): TubeType[] => {\n return ['Round', 'Square', 'Rectangle'];\n};\n\nexport default {\n useMaterialCalculations,\n validateFormValues,\n getAvailableSteelTypes,\n getAvailableTubeTypes,\n MATERIAL_CONSTANTS,\n};\nexport type {\n BaseFormValues,\n MaterialCalculations,\n SteelType,\n TubeType,\n CalculationResult,\n};"],"names":["MATERIAL_CONSTANTS","STEEL_DENSITY","LENGTH_CONVERSION_FACTOR","TUBE_CALCULATION_FACTOR","COIL_WEIGHTS","GI","HR","safeParseNumber","value","isValid","error","parsed","parseFloat","trim","Number","isNaN","isFinite","validatePositiveNumbers","values","every","result","createMemoKey","formValues","map","field","join","Object","keys","useMemo","totalWidth","materialUnit","boardsWeight","steelWeight","materialWeight","totalWidthResult","face_width","bending","height","faceWidthResult","bendingResult","heightResult","r","calculateBoardsTotalWidth","materialUnitResult","steel_type","calculateMaterialUnit","boardsWeightResult","total_width","boards_thickness","boards_length","thicknessResult","lengthResult","calculateBoardsWeight","steelWeightResult","steel_length","steel_width","steel_thickness","widthResult","calculateSteelWeight","materialWeightResult","tube_type","tube_od","shape_width","shape_height","material_thickness","material_length","weight","odResult","Math","PI","max","calculateTubeMaterialWeight","define_process_env_default","NODE_ENV","filter","forEach","errors","push","includes","length"],"mappings":"gGAIA,MAAMA,EAAqB,CACzBC,cAAe,KACfC,yBAA0B,IAC1BC,wBAAyB,QACzBC,aAAc,CACZC,GAAI,QACJC,GAAI,UAkDFC,EAAmBC,IACvB,GAAIA,SAAmD,KAAVA,EAC3C,MAAO,CAAEA,MAAO,EAAGC,SAAS,EAAOC,MAAO,eAG5C,MAAMC,EAA0B,iBAAVH,EAAqBI,WAAWJ,EAAMK,QAAUC,OAAON,GAE7E,OAAIO,MAAMJ,GACD,CAAEH,MAAO,EAAGC,SAAS,EAAOC,MAAO,yBAGvCM,SAASL,GAIP,CAAEH,MAAOG,EAAQF,SAAS,GAHxB,CAAED,MAAO,EAAGC,SAAS,EAAOC,MAAO,yBASxCO,EAA0B,IAAIC,IAC3BA,EAAOC,MAAMX,IAClB,MAA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,UAAEA,EAAAhB,WAAWA,GAAetB,EAYlC,OATIsB,KAAgBA,KAAc5C,EAAmBI,eACnDwE,EAAOC,KAAK,uBAAuBjC,KAIjCgB,IAAc,CAAC,QAAS,SAAU,aAAakB,SAASlB,IAC1DgB,EAAOC,KAAK,sBAAsBjB,KAG7B,CAAEnD,QAA2B,IAAlBmE,EAAOG,OAAcH"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/hooks/use-material-calculations.ts"],"sourcesContent":["/* eslint-disable react-hooks/exhaustive-deps */\nimport { useMemo } from 'react';\n\n// ==================== CONSTANTS ====================\nconst MATERIAL_CONSTANTS = {\n STEEL_DENSITY: 7.85,\n LENGTH_CONVERSION_FACTOR: 1000,\n TUBE_CALCULATION_FACTOR: 0.024662,\n COIL_WEIGHTS: {\n GI: 2879.95,\n HR: 2356.59,\n },\n} as const;\n\n// ==================== TYPES ====================\ntype SteelType = keyof typeof MATERIAL_CONSTANTS.COIL_WEIGHTS;\ntype TubeType = 'Round' | 'Square' | 'Rectangle';\n\ninterface BaseFormValues {\n // Board calculation fields\n face_width?: string | number;\n bending?: string | number;\n height?: string | number;\n total_width?: string | number;\n boards_thickness?: string | number;\n boards_length?: string | number;\n \n // Steel calculation fields\n steel_length?: string | number;\n steel_width?: string | number;\n steel_thickness?: string | number;\n steel_type?: SteelType;\n \n // Tube calculation fields\n tube_type?: TubeType;\n tube_od?: string | number;\n shape_width?: string | number;\n shape_height?: string | number;\n material_thickness?: string | number;\n material_length?: string | number;\n}\n\ninterface MaterialCalculations {\n totalWidth: number;\n materialUnit: number;\n boardsWeight: number;\n steelWeight: number;\n materialWeight: number;\n}\n\ninterface CalculationResult<T = number> {\n value: T;\n isValid: boolean;\n error?: string;\n}\n\n// ==================== UTILITY FUNCTIONS ====================\n/**\n * Safely parses a value to number with comprehensive validation\n */\nconst safeParseNumber = (value: string | number | undefined | null): CalculationResult<number> => {\n if (value === undefined || value === null || value === '') {\n return { value: 0, isValid: false, error: 'Empty value' };\n }\n \n const parsed = typeof value === 'string' ? parseFloat(value.trim()) : Number(value);\n \n if (isNaN(parsed)) {\n return { value: 0, isValid: false, error: 'Invalid number format' };\n }\n \n if (!isFinite(parsed)) {\n return { value: 0, isValid: false, error: 'Number is not finite' };\n }\n \n return { value: parsed, isValid: true };\n};\n\n/**\n * Validates that all provided values are positive numbers\n */\nconst validatePositiveNumbers = (...values: (string | number | undefined)[]): boolean => {\n return values.every(value => {\n const result = safeParseNumber(value);\n return result.isValid && result.value > 0;\n });\n};\n\n/**\n * Creates a memoization key from form values to optimize re-calculations\n */\nconst createMemoKey = (formValues: BaseFormValues | undefined): string => {\n if (!formValues) return 'empty';\n \n // Only include relevant fields to avoid unnecessary recalculations\n const relevantFields = [\n 'face_width', 'bending', 'height', 'total_width', 'boards_thickness', 'boards_length',\n 'steel_length', 'steel_width', 'steel_thickness', 'steel_type',\n 'tube_type', 'tube_od', 'shape_width', 'shape_height', 'material_thickness', 'material_length'\n ];\n \n return relevantFields\n .map(field => `${field}:${formValues[field as keyof BaseFormValues] ?? ''}`)\n .join('|');\n};\n\n// ==================== CALCULATION FUNCTIONS ====================\n/**\n * Calculates the total width for boards costing\n * Formula: ((height + bending) * 2) + face_width\n */\nconst calculateBoardsTotalWidth = (formValues: BaseFormValues): CalculationResult<number> => {\n const { face_width, bending, height } = formValues;\n \n if (!validatePositiveNumbers(face_width, bending, height)) {\n return { value: 0, isValid: false, error: 'Invalid input values for boards total width calculation' };\n }\n \n const faceWidthResult = safeParseNumber(face_width);\n const bendingResult = safeParseNumber(bending);\n const heightResult = safeParseNumber(height);\n \n if (![faceWidthResult, bendingResult, heightResult].every(r => r.isValid)) {\n return { value: 0, isValid: false, error: 'Failed to parse input values' };\n }\n \n const totalWidth = ((heightResult.value + bendingResult.value) * 2) + faceWidthResult.value;\n \n return { value: totalWidth, isValid: true };\n};\n\n/**\n * Calculates the weight of boards\n * Formula: (total_width * thickness * (length / 1000)) * 7.85\n */\nconst calculateBoardsWeight = (formValues: BaseFormValues): CalculationResult<number> => {\n const { total_width, boards_thickness, boards_length } = formValues;\n \n if (!validatePositiveNumbers(total_width, boards_thickness, boards_length)) {\n return { value: 0, isValid: false, error: 'Invalid input values for boards weight calculation' };\n }\n \n const totalWidthResult = safeParseNumber(total_width);\n const thicknessResult = safeParseNumber(boards_thickness);\n const lengthResult = safeParseNumber(boards_length);\n \n if (![totalWidthResult, thicknessResult, lengthResult].every(r => r.isValid)) {\n return { value: 0, isValid: false, error: 'Failed to parse input values' };\n }\n \n const weight = (totalWidthResult.value * thicknessResult.value * \n (lengthResult.value / MATERIAL_CONSTANTS.LENGTH_CONVERSION_FACTOR)) * \n MATERIAL_CONSTANTS.STEEL_DENSITY;\n \n return { value: weight, isValid: true };\n};\n\n/**\n * Calculates the weight of steel\n * Formula: (length * width * thickness * 7.85) / 1000\n */\nconst calculateSteelWeight = (formValues: BaseFormValues): CalculationResult<number> => {\n const { steel_length, steel_width, steel_thickness } = formValues;\n \n if (!validatePositiveNumbers(steel_length, steel_width, steel_thickness)) {\n return { value: 0, isValid: false, error: 'Invalid input values for steel weight calculation' };\n }\n \n const lengthResult = safeParseNumber(steel_length);\n const widthResult = safeParseNumber(steel_width);\n const thicknessResult = safeParseNumber(steel_thickness);\n \n if (![lengthResult, widthResult, thicknessResult].every(r => r.isValid)) {\n return { value: 0, isValid: false, error: 'Failed to parse input values' };\n }\n \n const weight = (lengthResult.value * widthResult.value * thicknessResult.value * \n MATERIAL_CONSTANTS.STEEL_DENSITY) / MATERIAL_CONSTANTS.LENGTH_CONVERSION_FACTOR;\n \n return { value: weight, isValid: true };\n};\n\n/**\n * Gets the material unit weight based on steel type\n */\nconst calculateMaterialUnit = (formValues: BaseFormValues): CalculationResult<number> => {\n const { steel_type } = formValues;\n \n if (!steel_type) {\n return { value: 0, isValid: false, error: 'Steel type not specified' };\n }\n \n if (!(steel_type in MATERIAL_CONSTANTS.COIL_WEIGHTS)) {\n return { value: 0, isValid: false, error: `Unsupported steel type: ${steel_type}` };\n }\n \n const weight = MATERIAL_CONSTANTS.COIL_WEIGHTS[steel_type];\n return { value: weight, isValid: true };\n};\n\n/**\n * Calculates material weight based on tube type and dimensions\n * Supports Round, Square, and Rectangle tube types\n */\nconst calculateTubeMaterialWeight = (formValues: BaseFormValues): CalculationResult<number> => {\n const { tube_type, tube_od, shape_width, shape_height, material_thickness, material_length } = formValues;\n \n if (!tube_type) {\n return { value: 0, isValid: false, error: 'Tube type not specified' };\n }\n \n const thicknessResult = safeParseNumber(material_thickness);\n const lengthResult = safeParseNumber(material_length);\n \n if (!thicknessResult.isValid || !lengthResult.isValid) {\n return { value: 0, isValid: false, error: 'Invalid thickness or length values' };\n }\n \n let weight = 0;\n \n switch (tube_type) {\n case 'Round': {\n const odResult = safeParseNumber(tube_od);\n if (!odResult.isValid || odResult.value <= thicknessResult.value) {\n return { value: 0, isValid: false, error: 'Invalid outer diameter for round tube' };\n }\n \n weight = (odResult.value - thicknessResult.value) * thicknessResult.value * \n MATERIAL_CONSTANTS.TUBE_CALCULATION_FACTOR * lengthResult.value;\n break;\n }\n \n case 'Square':\n case 'Rectangle': {\n const widthResult = safeParseNumber(shape_width);\n const heightResult = safeParseNumber(shape_height);\n \n if (!widthResult.isValid || !heightResult.isValid) {\n return { value: 0, isValid: false, error: 'Invalid width or height for rectangular tube' };\n }\n \n const perimeter = 2 * (widthResult.value + heightResult.value);\n weight = (((perimeter / Math.PI) - thicknessResult.value) * thicknessResult.value * \n MATERIAL_CONSTANTS.TUBE_CALCULATION_FACTOR) * lengthResult.value;\n break;\n }\n \n default:\n return { value: 0, isValid: false, error: `Unsupported tube type: ${tube_type}` };\n }\n \n return { value: Math.max(0, weight), isValid: true };\n};\n\n// ==================== MAIN HOOK ====================\n/**\n * Custom hook for optimized material calculations with comprehensive error handling\n * and performance optimization through memoization\n */\nexport const useMaterialCalculations = (formValues?: BaseFormValues): MaterialCalculations => {\n const calculations = useMemo(() => {\n if (!formValues) {\n return {\n totalWidth: 0,\n materialUnit: 0,\n boardsWeight: 0,\n steelWeight: 0,\n materialWeight: 0,\n };\n }\n \n // Calculate all values with error handling\n const totalWidthResult = calculateBoardsTotalWidth(formValues);\n const materialUnitResult = calculateMaterialUnit(formValues);\n const boardsWeightResult = calculateBoardsWeight(formValues);\n const steelWeightResult = calculateSteelWeight(formValues);\n const materialWeightResult = calculateTubeMaterialWeight(formValues);\n \n // Optional: Log errors in development\n if (process.env.NODE_ENV === 'development') {\n [totalWidthResult, materialUnitResult, boardsWeightResult, steelWeightResult, materialWeightResult]\n .filter(result => !result.isValid && result.error)\n .forEach(result => console.warn('Calculation warning:', result.error));\n }\n \n return {\n totalWidth: totalWidthResult.value,\n materialUnit: materialUnitResult.value,\n boardsWeight: boardsWeightResult.value,\n steelWeight: steelWeightResult.value,\n materialWeight: materialWeightResult.value,\n };\n }, [createMemoKey(formValues)]); // Optimized dependency to prevent unnecessary recalculations\n \n return calculations;\n};\n\n// ==================== ADDITIONAL UTILITIES ====================\n/**\n * Utility function to validate form values before calculations\n */\nexport const validateFormValues = (formValues: BaseFormValues): { isValid: boolean; errors: string[] } => {\n const errors: string[] = [];\n const { tube_type, steel_type } = formValues;\n \n // Validate steel type if provided\n if (steel_type && !(steel_type in MATERIAL_CONSTANTS.COIL_WEIGHTS)) {\n errors.push(`Invalid steel type: ${steel_type}`);\n }\n \n // Validate tube type if provided\n if (tube_type && !['Round', 'Square', 'Rectangle'].includes(tube_type)) {\n errors.push(`Invalid tube type: ${tube_type}`);\n }\n \n return { isValid: errors.length === 0, errors };\n};\n\n/**\n * Get available steel types for form validation\n */\nexport const getAvailableSteelTypes = (): SteelType[] => {\n return Object.keys(MATERIAL_CONSTANTS.COIL_WEIGHTS) as SteelType[];\n};\n\n/**\n * Get available tube types for form validation\n */\nexport const getAvailableTubeTypes = (): TubeType[] => {\n return ['Round', 'Square', 'Rectangle'];\n};\n\nexport default {\n useMaterialCalculations,\n validateFormValues,\n getAvailableSteelTypes,\n getAvailableTubeTypes,\n MATERIAL_CONSTANTS,\n};\nexport type {\n BaseFormValues,\n MaterialCalculations,\n SteelType,\n TubeType,\n CalculationResult,\n};"],"names":["MATERIAL_CONSTANTS","STEEL_DENSITY","LENGTH_CONVERSION_FACTOR","TUBE_CALCULATION_FACTOR","COIL_WEIGHTS","GI","HR","safeParseNumber","value","isValid","error","parsed","parseFloat","trim","Number","isNaN","isFinite","validatePositiveNumbers","values","every","result","createMemoKey","formValues","map","field","join","Object","keys","useMemo","totalWidth","materialUnit","boardsWeight","steelWeight","materialWeight","totalWidthResult","face_width","bending","height","faceWidthResult","bendingResult","heightResult","r","calculateBoardsTotalWidth","materialUnitResult","steel_type","calculateMaterialUnit","boardsWeightResult","total_width","boards_thickness","boards_length","thicknessResult","lengthResult","calculateBoardsWeight","steelWeightResult","steel_length","steel_width","steel_thickness","widthResult","calculateSteelWeight","materialWeightResult","tube_type","tube_od","shape_width","shape_height","material_thickness","material_length","weight","odResult","Math","PI","max","calculateTubeMaterialWeight","process","env","NODE_ENV","filter","forEach","errors","push","includes","length"],"mappings":"2FAIA,MAAMA,EAAqB,CACzBC,cAAe,KACfC,yBAA0B,IAC1BC,wBAAyB,QACzBC,aAAc,CACZC,GAAI,QACJC,GAAI,UAkDFC,EAAmBC,IACvB,GAAIA,SAAmD,KAAVA,EAC3C,MAAO,CAAEA,MAAO,EAAGC,SAAS,EAAOC,MAAO,eAG5C,MAAMC,EAA0B,iBAAVH,EAAqBI,WAAWJ,EAAMK,QAAUC,OAAON,GAE7E,OAAIO,MAAMJ,GACD,CAAEH,MAAO,EAAGC,SAAS,EAAOC,MAAO,yBAGvCM,SAASL,GAIP,CAAEH,MAAOG,EAAQF,SAAS,GAHxB,CAAED,MAAO,EAAGC,SAAS,EAAOC,MAAO,yBASxCO,EAA0B,IAAIC,IAC3BA,EAAOC,MAAMX,IAClB,MAAMY,EAASb,EAAgBC,GAC/B,OAAOY,EAAOX,SAAWW,EAAOZ,MAAQ,IAOtCa,EAAiBC,GAChBA,EAGkB,CACrB,aAAc,UA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C,KAIjCgB,IAAc,CAAC,QAAS,SAAU,aAAamB,SAASnB,IAC1DiB,EAAOC,KAAK,sBAAsBlB,KAG7B,CAAEnD,QAA2B,IAAlBoE,EAAOG,OAAcH"}
@@ -1,6 +1,5 @@
1
1
  import { useContext, useMemo } from "react";
2
2
  import { LanguageContext } from "../../contexts/languageContext/index.esm.js";
3
- var define_process_env_default = {};
4
3
  const createFallbackLanguage = () => ({
5
4
  code: "en",
6
5
  label: "English",
@@ -25,7 +24,7 @@ const fallbackContextValue = {
25
24
  const useLanguage = () => {
26
25
  const context = useContext(LanguageContext);
27
26
  if (context === void 0) {
28
- if (define_process_env_default.NODE_ENV !== "production") {
27
+ if (process.env.NODE_ENV !== "production") {
29
28
  console.warn(
30
29
  "useLanguage: LanguageProvider is not available. Using fallback values. To enable full language functionality, wrap your app with <ERPUIProvider> or <LanguageProvider>."
31
30
  );
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../../../src/hooks/useLangauge.ts"],"sourcesContent":["// hooks/useLanguage.ts\nimport { useContext, useMemo } from \"react\";\nimport LanguageContext from \"../contexts/languageContext\";\n\n// Fallback language object\nconst createFallbackLanguage = () => ({\n code: 'en',\n label: 'English',\n direction: 'ltr' as const,\n});\n\n// Fallback context value when provider is not available\nconst fallbackContextValue = {\n languages: [createFallbackLanguage()],\n currentLanguage: createFallbackLanguage(),\n isLoading: false,\n error: null,\n isFallbackActive: true,\n changeLanguage: (langCode: string) => {\n console.warn(`useLanguage: changeLanguage called but LanguageProvider is not available. Language code: ${langCode}`);\n },\n fetchLanguages: async () => {\n console.warn('useLanguage: fetchLanguages called but LanguageProvider is not available.');\n },\n direction: 'ltr' as const,\n isRtl: false,\n isLtr: true,\n};\n\nexport const useLanguage = () => {\n const context = useContext(LanguageContext);\n \n // If context is undefined, provider is not available - use fallback\n if (context === undefined) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n 'useLanguage: LanguageProvider is not available. Using fallback values. ' +\n 'To enable full language functionality, wrap your app with <ERPUIProvider> or <LanguageProvider>.'\n );\n }\n \n return fallbackContextValue;\n }\n \n const computedValues = useMemo(() => {\n const direction = context.currentLanguage?.direction || 'ltr';\n const isRtl = direction === 'rtl';\n const isLtr = direction === 'ltr';\n \n return { direction, isRtl, isLtr };\n }, [context.currentLanguage]);\n \n return {\n ...context,\n ...computedValues,\n };\n};\n// const withLanguage = <P extends object>(\n// Component: React.ComponentType<P>\n// ) => {\n// return (props: P) => {\n// const languageContext = useLanguage();\n// return <Component {...props} languageContext={languageContext} />;\n// };\n// };\n\n"],"names":[],"mappings":";;;AAKA,MAAM,yBAAyB,OAAO;AAAA,EACpC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,WAAW;AACb;AAGA,MAAM,uBAAuB;AAAA,EAC3B,WAAW,CAAC,wBAAwB;AAAA,EACpC,iBAAiB,uBAAA;AAAA,EACjB,WAAW;AAAA,EACX,OAAO;AAAA,EACP,kBAAkB;AAAA,EAClB,gBAAgB,CAAC,aAAqB;AACpC,YAAQ,KAAK,4FAA4F,QAAQ,EAAE;AAAA,EACrH;AAAA,EACA,gBAAgB,YAAY;AAC1B,YAAQ,KAAK,2EAA2E;AAAA,EAC1F;AAAA,EACA,WAAW;AAAA,EACX,OAAO;AAAA,EACP,OAAO;AACT;AAEO,MAAM,cAAc,MAAM;AAC/B,QAAM,UAAU,WAAW,eAAe;AAG1C,MAAI,YAAY,QAAW;AACzB,QAAI,2BAAY,aAAa,cAAc;AACzC,cAAQ;AAAA,QACN;AAAA,MAAA;AAAA,IAGJ;AAEA,WAAO;AAAA,EACT;AAEA,QAAM,iBAAiB,QAAQ,MAAM;;AACnC,UAAM,cAAY,aAAQ,oBAAR,mBAAyB,cAAa;AACxD,UAAM,QAAQ,cAAc;AAC5B,UAAM,QAAQ,cAAc;AAE5B,WAAO,EAAE,WAAW,OAAO,MAAA;AAAA,EAC7B,GAAG,CAAC,QAAQ,eAAe,CAAC;AAE5B,SAAO;AAAA,IACL,GAAG;AAAA,IACH,GAAG;AAAA,EAAA;AAEP;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../../../src/hooks/useLangauge.ts"],"sourcesContent":["// hooks/useLanguage.ts\nimport { useContext, useMemo } from \"react\";\nimport LanguageContext from \"../contexts/languageContext\";\n\n// Fallback language object\nconst createFallbackLanguage = () => ({\n code: 'en',\n label: 'English',\n direction: 'ltr' as const,\n});\n\n// Fallback context value when provider is not available\nconst fallbackContextValue = {\n languages: [createFallbackLanguage()],\n currentLanguage: createFallbackLanguage(),\n isLoading: false,\n error: null,\n isFallbackActive: true,\n changeLanguage: (langCode: string) => {\n console.warn(`useLanguage: changeLanguage called but LanguageProvider is not available. Language code: ${langCode}`);\n },\n fetchLanguages: async () => {\n console.warn('useLanguage: fetchLanguages called but LanguageProvider is not available.');\n },\n direction: 'ltr' as const,\n isRtl: false,\n isLtr: true,\n};\n\nexport const useLanguage = () => {\n const context = useContext(LanguageContext);\n \n // If context is undefined, provider is not available - use fallback\n if (context === undefined) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n 'useLanguage: LanguageProvider is not available. Using fallback values. ' +\n 'To enable full language functionality, wrap your app with <ERPUIProvider> or <LanguageProvider>.'\n );\n }\n \n return fallbackContextValue;\n }\n \n const computedValues = useMemo(() => {\n const direction = context.currentLanguage?.direction || 'ltr';\n const isRtl = direction === 'rtl';\n const isLtr = direction === 'ltr';\n \n return { direction, isRtl, isLtr };\n }, [context.currentLanguage]);\n \n return {\n ...context,\n ...computedValues,\n };\n};\n// const withLanguage = <P extends object>(\n// Component: React.ComponentType<P>\n// ) => {\n// return (props: P) => {\n// const languageContext = useLanguage();\n// return <Component {...props} languageContext={languageContext} />;\n// };\n// };\n\n"],"names":[],"mappings":";;AAKA,MAAM,yBAAyB,OAAO;AAAA,EACpC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,WAAW;AACb;AAGA,MAAM,uBAAuB;AAAA,EAC3B,WAAW,CAAC,wBAAwB;AAAA,EACpC,iBAAiB,uBAAA;AAAA,EACjB,WAAW;AAAA,EACX,OAAO;AAAA,EACP,kBAAkB;AAAA,EAClB,gBAAgB,CAAC,aAAqB;AACpC,YAAQ,KAAK,4FAA4F,QAAQ,EAAE;AAAA,EACrH;AAAA,EACA,gBAAgB,YAAY;AAC1B,YAAQ,KAAK,2EAA2E;AAAA,EAC1F;AAAA,EACA,WAAW;AAAA,EACX,OAAO;AAAA,EACP,OAAO;AACT;AAEO,MAAM,cAAc,MAAM;AAC/B,QAAM,UAAU,WAAW,eAAe;AAG1C,MAAI,YAAY,QAAW;AACzB,QAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,cAAQ;AAAA,QACN;AAAA,MAAA;AAAA,IAGJ;AAEA,WAAO;AAAA,EACT;AAEA,QAAM,iBAAiB,QAAQ,MAAM;;AACnC,UAAM,cAAY,aAAQ,oBAAR,mBAAyB,cAAa;AACxD,UAAM,QAAQ,cAAc;AAC5B,UAAM,QAAQ,cAAc;AAE5B,WAAO,EAAE,WAAW,OAAO,MAAA;AAAA,EAC7B,GAAG,CAAC,QAAQ,eAAe,CAAC;AAE5B,SAAO;AAAA,IACL,GAAG;AAAA,IACH,GAAG;AAAA,EAAA;AAEP;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../../contexts/languageContext/index.js");const r={languages:[{code:"en",label:"English",direction:"ltr"}],currentLanguage:{code:"en",label:"English",direction:"ltr"},isLoading:!1,error:null,isFallbackActive:!0,changeLanguage:e=>{},fetchLanguages:async()=>{},direction:"ltr",isRtl:!1,isLtr:!0};exports.useLanguage=()=>{const n=e.useContext(t.LanguageContext);if(void 0===n)return r;const a=e.useMemo(()=>{var e;const t=(null==(e=n.currentLanguage)?void 0:e.direction)||"ltr";return{direction:t,isRtl:"rtl"===t,isLtr:"ltr"===t}},[n.currentLanguage]);return{...n,...a}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../../contexts/languageContext/index.js");const r={languages:[{code:"en",label:"English",direction:"ltr"}],currentLanguage:{code:"en",label:"English",direction:"ltr"},isLoading:!1,error:null,isFallbackActive:!0,changeLanguage:e=>{},fetchLanguages:async()=>{},direction:"ltr",isRtl:!1,isLtr:!0};exports.useLanguage=()=>{const n=e.useContext(t.LanguageContext);if(void 0===n)return process.env.NODE_ENV,r;const a=e.useMemo(()=>{var e;const t=(null==(e=n.currentLanguage)?void 0:e.direction)||"ltr";return{direction:t,isRtl:"rtl"===t,isLtr:"ltr"===t}},[n.currentLanguage]);return{...n,...a}};
2
2
  //# sourceMappingURL=index.js.map