@redneckz/wildless-cms-uni-blocks 0.14.600 → 0.14.601

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 (336) hide show
  1. package/bundle/EventBus/EventBus.d.ts +4 -17
  2. package/bundle/EventBus/defaultEventBus.d.ts +13 -2
  3. package/bundle/EventBus/useLatestEvent.d.ts +2 -0
  4. package/bundle/bundle.umd.js +89 -131
  5. package/bundle/bundle.umd.min.js +1 -1
  6. package/bundle/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +6 -0
  7. package/bundle/hooks/useLocation.d.ts +1 -2
  8. package/bundle/ui-kit/Foldable/Foldable.d.ts +1 -11
  9. package/dist/EventBus/EventBus.d.ts +4 -17
  10. package/dist/EventBus/EventBus.js +10 -29
  11. package/dist/EventBus/EventBus.js.map +1 -1
  12. package/dist/EventBus/defaultEventBus.d.ts +13 -2
  13. package/dist/EventBus/defaultEventBus.js.map +1 -1
  14. package/dist/EventBus/useLatestEvent.d.ts +2 -0
  15. package/dist/EventBus/useLatestEvent.js +11 -0
  16. package/dist/EventBus/useLatestEvent.js.map +1 -0
  17. package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +25 -11
  18. package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  19. package/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +6 -0
  20. package/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.js +2 -0
  21. package/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.js.map +1 -0
  22. package/dist/components/ExchangeRateTile/ExchangeRateTile.js +1 -1
  23. package/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  24. package/dist/components/Header/HeaderSecondaryMenu.js +1 -1
  25. package/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
  26. package/dist/components/OfficesAtmsMap/AtmsMap.js +1 -1
  27. package/dist/components/OfficesAtmsMap/AtmsMap.js.map +1 -1
  28. package/dist/components/OfficesAtmsMap/OfficesMap.js +1 -1
  29. package/dist/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
  30. package/dist/components/StickyBottomMenu/BurgerMenuDialog.js +1 -1
  31. package/dist/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  32. package/dist/hooks/useLocation.d.ts +1 -2
  33. package/dist/hooks/useLocation.js +33 -27
  34. package/dist/hooks/useLocation.js.map +1 -1
  35. package/dist/hooks/useRegions.js +1 -3
  36. package/dist/hooks/useRegions.js.map +1 -1
  37. package/dist/ui-kit/DialogManager/useDialogManager.js +3 -3
  38. package/dist/ui-kit/DialogManager/useDialogManager.js.map +1 -1
  39. package/dist/ui-kit/DialogManager/useDialogsList.js +1 -1
  40. package/dist/ui-kit/DialogManager/useDialogsList.js.map +1 -1
  41. package/dist/ui-kit/Foldable/Foldable.d.ts +1 -11
  42. package/dist/ui-kit/Foldable/Foldable.js +2 -10
  43. package/dist/ui-kit/Foldable/Foldable.js.map +1 -1
  44. package/dist/ui-kit/FormField/constants.js +0 -1
  45. package/dist/ui-kit/FormField/constants.js.map +1 -1
  46. package/dist/ui-kit/FormField/getValidation.js +0 -1
  47. package/dist/ui-kit/FormField/getValidation.js.map +1 -1
  48. package/dist/ui-kit/LocationDialog/LocationDialog.js +12 -9
  49. package/dist/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  50. package/dist/ui-kit/PopupManager/PopupManager.js +1 -1
  51. package/dist/ui-kit/PopupManager/PopupManager.js.map +1 -1
  52. package/dist/ui-kit/PopupManager/usePopupManager.js +3 -3
  53. package/dist/ui-kit/PopupManager/usePopupManager.js.map +1 -1
  54. package/lib/EventBus/EventBus.d.ts +4 -17
  55. package/lib/EventBus/EventBus.js +10 -29
  56. package/lib/EventBus/EventBus.js.map +1 -1
  57. package/lib/EventBus/defaultEventBus.d.ts +13 -2
  58. package/lib/EventBus/defaultEventBus.js.map +1 -1
  59. package/lib/EventBus/useLatestEvent.d.ts +2 -0
  60. package/lib/EventBus/useLatestEvent.js +8 -0
  61. package/lib/EventBus/useLatestEvent.js.map +1 -0
  62. package/lib/common.css +1 -1
  63. package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +26 -12
  64. package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  65. package/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +6 -0
  66. package/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.js +2 -0
  67. package/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.js.map +1 -0
  68. package/lib/components/ExchangeRateTile/ExchangeRateTile.js +2 -2
  69. package/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  70. package/lib/components/Header/HeaderSecondaryMenu.js +2 -2
  71. package/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
  72. package/lib/components/OfficesAtmsMap/AtmsMap.js +2 -2
  73. package/lib/components/OfficesAtmsMap/AtmsMap.js.map +1 -1
  74. package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +1 -1
  75. package/lib/components/OfficesAtmsMap/OfficesMap.js +2 -2
  76. package/lib/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
  77. package/lib/components/StickyBottomMenu/BurgerMenuDialog.js +2 -2
  78. package/lib/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  79. package/lib/hooks/useLocation.d.ts +1 -2
  80. package/lib/hooks/useLocation.js +33 -26
  81. package/lib/hooks/useLocation.js.map +1 -1
  82. package/lib/hooks/useRegions.js +1 -3
  83. package/lib/hooks/useRegions.js.map +1 -1
  84. package/lib/ui-kit/DialogManager/useDialogManager.js +3 -3
  85. package/lib/ui-kit/DialogManager/useDialogManager.js.map +1 -1
  86. package/lib/ui-kit/DialogManager/useDialogsList.js +1 -1
  87. package/lib/ui-kit/DialogManager/useDialogsList.js.map +1 -1
  88. package/lib/ui-kit/Foldable/Foldable.d.ts +1 -11
  89. package/lib/ui-kit/Foldable/Foldable.js +2 -10
  90. package/lib/ui-kit/Foldable/Foldable.js.map +1 -1
  91. package/lib/ui-kit/FormField/constants.js +0 -1
  92. package/lib/ui-kit/FormField/constants.js.map +1 -1
  93. package/lib/ui-kit/FormField/getValidation.js +0 -1
  94. package/lib/ui-kit/FormField/getValidation.js.map +1 -1
  95. package/lib/ui-kit/LocationDialog/LocationDialog.js +13 -10
  96. package/lib/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  97. package/lib/ui-kit/PopupManager/PopupManager.js +1 -1
  98. package/lib/ui-kit/PopupManager/PopupManager.js.map +1 -1
  99. package/lib/ui-kit/PopupManager/usePopupManager.js +3 -3
  100. package/lib/ui-kit/PopupManager/usePopupManager.js.map +1 -1
  101. package/mobile/bundle/EventBus/EventBus.d.ts +4 -17
  102. package/mobile/bundle/EventBus/defaultEventBus.d.ts +13 -2
  103. package/mobile/bundle/EventBus/useLatestEvent.d.ts +2 -0
  104. package/mobile/bundle/bundle.umd.js +89 -131
  105. package/mobile/bundle/bundle.umd.min.js +1 -1
  106. package/mobile/bundle/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +6 -0
  107. package/mobile/bundle/hooks/useLocation.d.ts +1 -2
  108. package/mobile/bundle/ui-kit/Foldable/Foldable.d.ts +1 -11
  109. package/mobile/dist/EventBus/EventBus.d.ts +4 -17
  110. package/mobile/dist/EventBus/EventBus.js +10 -29
  111. package/mobile/dist/EventBus/EventBus.js.map +1 -1
  112. package/mobile/dist/EventBus/defaultEventBus.d.ts +13 -2
  113. package/mobile/dist/EventBus/defaultEventBus.js.map +1 -1
  114. package/mobile/dist/EventBus/useLatestEvent.d.ts +2 -0
  115. package/mobile/dist/EventBus/useLatestEvent.js +11 -0
  116. package/mobile/dist/EventBus/useLatestEvent.js.map +1 -0
  117. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +25 -11
  118. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  119. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +6 -0
  120. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.js +2 -0
  121. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.js.map +1 -0
  122. package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js +1 -1
  123. package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  124. package/mobile/dist/components/Header/HeaderSecondaryMenu.js +1 -1
  125. package/mobile/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
  126. package/mobile/dist/components/OfficesAtmsMap/AtmsMap.js +1 -1
  127. package/mobile/dist/components/OfficesAtmsMap/AtmsMap.js.map +1 -1
  128. package/mobile/dist/components/OfficesAtmsMap/OfficesMap.js +1 -1
  129. package/mobile/dist/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
  130. package/mobile/dist/components/StickyBottomMenu/BurgerMenuDialog.js +1 -1
  131. package/mobile/dist/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  132. package/mobile/dist/hooks/useLocation.d.ts +1 -2
  133. package/mobile/dist/hooks/useLocation.js +33 -27
  134. package/mobile/dist/hooks/useLocation.js.map +1 -1
  135. package/mobile/dist/hooks/useRegions.js +1 -3
  136. package/mobile/dist/hooks/useRegions.js.map +1 -1
  137. package/mobile/dist/ui-kit/DialogManager/useDialogManager.js +3 -3
  138. package/mobile/dist/ui-kit/DialogManager/useDialogManager.js.map +1 -1
  139. package/mobile/dist/ui-kit/DialogManager/useDialogsList.js +1 -1
  140. package/mobile/dist/ui-kit/DialogManager/useDialogsList.js.map +1 -1
  141. package/mobile/dist/ui-kit/Foldable/Foldable.d.ts +1 -11
  142. package/mobile/dist/ui-kit/Foldable/Foldable.js +2 -10
  143. package/mobile/dist/ui-kit/Foldable/Foldable.js.map +1 -1
  144. package/mobile/dist/ui-kit/FormField/constants.js +0 -1
  145. package/mobile/dist/ui-kit/FormField/constants.js.map +1 -1
  146. package/mobile/dist/ui-kit/FormField/getValidation.js +0 -1
  147. package/mobile/dist/ui-kit/FormField/getValidation.js.map +1 -1
  148. package/mobile/dist/ui-kit/LocationDialog/LocationDialog.js +12 -9
  149. package/mobile/dist/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  150. package/mobile/dist/ui-kit/PopupManager/PopupManager.js +1 -1
  151. package/mobile/dist/ui-kit/PopupManager/PopupManager.js.map +1 -1
  152. package/mobile/dist/ui-kit/PopupManager/usePopupManager.js +3 -3
  153. package/mobile/dist/ui-kit/PopupManager/usePopupManager.js.map +1 -1
  154. package/mobile/lib/EventBus/EventBus.d.ts +4 -17
  155. package/mobile/lib/EventBus/EventBus.js +10 -29
  156. package/mobile/lib/EventBus/EventBus.js.map +1 -1
  157. package/mobile/lib/EventBus/defaultEventBus.d.ts +13 -2
  158. package/mobile/lib/EventBus/defaultEventBus.js.map +1 -1
  159. package/mobile/lib/EventBus/useLatestEvent.d.ts +2 -0
  160. package/mobile/lib/EventBus/useLatestEvent.js +8 -0
  161. package/mobile/lib/EventBus/useLatestEvent.js.map +1 -0
  162. package/mobile/lib/common.css +1 -1
  163. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +26 -12
  164. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  165. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +6 -0
  166. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.js +2 -0
  167. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.js.map +1 -0
  168. package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js +2 -2
  169. package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  170. package/mobile/lib/components/Header/HeaderSecondaryMenu.js +2 -2
  171. package/mobile/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
  172. package/mobile/lib/components/OfficesAtmsMap/AtmsMap.js +2 -2
  173. package/mobile/lib/components/OfficesAtmsMap/AtmsMap.js.map +1 -1
  174. package/mobile/lib/components/OfficesAtmsMap/OfficesMap.js +2 -2
  175. package/mobile/lib/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
  176. package/mobile/lib/components/StickyBottomMenu/BurgerMenuDialog.js +2 -2
  177. package/mobile/lib/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  178. package/mobile/lib/hooks/useLocation.d.ts +1 -2
  179. package/mobile/lib/hooks/useLocation.js +33 -26
  180. package/mobile/lib/hooks/useLocation.js.map +1 -1
  181. package/mobile/lib/hooks/useRegions.js +1 -3
  182. package/mobile/lib/hooks/useRegions.js.map +1 -1
  183. package/mobile/lib/ui-kit/DialogManager/useDialogManager.js +3 -3
  184. package/mobile/lib/ui-kit/DialogManager/useDialogManager.js.map +1 -1
  185. package/mobile/lib/ui-kit/DialogManager/useDialogsList.js +1 -1
  186. package/mobile/lib/ui-kit/DialogManager/useDialogsList.js.map +1 -1
  187. package/mobile/lib/ui-kit/Foldable/Foldable.d.ts +1 -11
  188. package/mobile/lib/ui-kit/Foldable/Foldable.js +2 -10
  189. package/mobile/lib/ui-kit/Foldable/Foldable.js.map +1 -1
  190. package/mobile/lib/ui-kit/FormField/constants.js +0 -1
  191. package/mobile/lib/ui-kit/FormField/constants.js.map +1 -1
  192. package/mobile/lib/ui-kit/FormField/getValidation.js +0 -1
  193. package/mobile/lib/ui-kit/FormField/getValidation.js.map +1 -1
  194. package/mobile/lib/ui-kit/LocationDialog/LocationDialog.js +13 -10
  195. package/mobile/lib/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  196. package/mobile/lib/ui-kit/PopupManager/PopupManager.js +1 -1
  197. package/mobile/lib/ui-kit/PopupManager/PopupManager.js.map +1 -1
  198. package/mobile/lib/ui-kit/PopupManager/usePopupManager.js +3 -3
  199. package/mobile/lib/ui-kit/PopupManager/usePopupManager.js.map +1 -1
  200. package/mobile/src/EventBus/EventBus.ts +15 -51
  201. package/mobile/src/EventBus/defaultEventBus.ts +14 -2
  202. package/mobile/src/EventBus/useLatestEvent.ts +16 -0
  203. package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +66 -23
  204. package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCardAction.ts +6 -0
  205. package/mobile/src/components/ExchangeRateTile/ExchangeRateTile.tsx +2 -2
  206. package/mobile/src/components/Header/HeaderSecondaryMenu.tsx +2 -2
  207. package/mobile/src/components/OfficesAtmsMap/AtmsMap.tsx +3 -2
  208. package/mobile/src/components/OfficesAtmsMap/OfficesMap.tsx +2 -2
  209. package/mobile/src/components/StickyBottomMenu/BurgerMenuDialog.tsx +2 -2
  210. package/mobile/src/hooks/useLocation.ts +44 -30
  211. package/mobile/src/hooks/useRegions.ts +1 -4
  212. package/mobile/src/ui-kit/DialogManager/useDialogManager.ts +3 -3
  213. package/mobile/src/ui-kit/DialogManager/useDialogsList.ts +1 -1
  214. package/mobile/src/ui-kit/Foldable/Foldable.tsx +5 -21
  215. package/mobile/src/ui-kit/FormField/constants.tsx +0 -1
  216. package/mobile/src/ui-kit/FormField/getValidation.tsx +0 -1
  217. package/mobile/src/ui-kit/LocationDialog/LocationDialog.tsx +25 -13
  218. package/mobile/src/ui-kit/PopupManager/PopupManager.tsx +1 -1
  219. package/mobile/src/ui-kit/PopupManager/usePopupManager.tsx +3 -3
  220. package/package.json +1 -1
  221. package/src/EventBus/EventBus.ts +15 -51
  222. package/src/EventBus/defaultEventBus.ts +14 -2
  223. package/src/EventBus/useLatestEvent.ts +16 -0
  224. package/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +66 -23
  225. package/src/components/CarouselTariffsCard/CarouselTariffsCardAction.ts +6 -0
  226. package/src/components/ExchangeRateTile/ExchangeRateTile.tsx +2 -2
  227. package/src/components/Header/HeaderSecondaryMenu.tsx +2 -2
  228. package/src/components/OfficesAtmsMap/AtmsMap.tsx +3 -2
  229. package/src/components/OfficesAtmsMap/OfficesMap.tsx +2 -2
  230. package/src/components/StickyBottomMenu/BurgerMenuDialog.tsx +2 -2
  231. package/src/hooks/useLocation.ts +44 -30
  232. package/src/hooks/useRegions.ts +1 -4
  233. package/src/ui-kit/DialogManager/useDialogManager.ts +3 -3
  234. package/src/ui-kit/DialogManager/useDialogsList.ts +1 -1
  235. package/src/ui-kit/Foldable/Foldable.tsx +5 -21
  236. package/src/ui-kit/FormField/constants.tsx +0 -1
  237. package/src/ui-kit/FormField/getValidation.tsx +0 -1
  238. package/src/ui-kit/LocationDialog/LocationDialog.tsx +25 -13
  239. package/src/ui-kit/PopupManager/PopupManager.tsx +1 -1
  240. package/src/ui-kit/PopupManager/usePopupManager.tsx +3 -3
  241. package/bundle/EventBus/useSubject.d.ts +0 -2
  242. package/bundle/EventBus/useSubjectState.d.ts +0 -2
  243. package/bundle/components/CarouselTariffsCard/CardCellsSection.d.ts +0 -9
  244. package/bundle/components/CarouselTariffsCard/carouselTariffsCardEventBus.d.ts +0 -9
  245. package/bundle/hooks/useReducer.d.ts +0 -4
  246. package/bundle/ui-kit/LocationDialog/SelectedLocation.d.ts +0 -5
  247. package/dist/EventBus/useSubject.d.ts +0 -2
  248. package/dist/EventBus/useSubject.js +0 -17
  249. package/dist/EventBus/useSubject.js.map +0 -1
  250. package/dist/EventBus/useSubjectState.d.ts +0 -2
  251. package/dist/EventBus/useSubjectState.js +0 -10
  252. package/dist/EventBus/useSubjectState.js.map +0 -1
  253. package/dist/components/CarouselTariffsCard/CardCellsSection.d.ts +0 -9
  254. package/dist/components/CarouselTariffsCard/CardCellsSection.js +0 -18
  255. package/dist/components/CarouselTariffsCard/CardCellsSection.js.map +0 -1
  256. package/dist/components/CarouselTariffsCard/carouselTariffsCardEventBus.d.ts +0 -9
  257. package/dist/components/CarouselTariffsCard/carouselTariffsCardEventBus.js +0 -5
  258. package/dist/components/CarouselTariffsCard/carouselTariffsCardEventBus.js.map +0 -1
  259. package/dist/hooks/useReducer.d.ts +0 -4
  260. package/dist/hooks/useReducer.js +0 -12
  261. package/dist/hooks/useReducer.js.map +0 -1
  262. package/dist/ui-kit/LocationDialog/SelectedLocation.d.ts +0 -5
  263. package/dist/ui-kit/LocationDialog/SelectedLocation.js +0 -15
  264. package/dist/ui-kit/LocationDialog/SelectedLocation.js.map +0 -1
  265. package/lib/EventBus/useSubject.d.ts +0 -2
  266. package/lib/EventBus/useSubject.js +0 -14
  267. package/lib/EventBus/useSubject.js.map +0 -1
  268. package/lib/EventBus/useSubjectState.d.ts +0 -2
  269. package/lib/EventBus/useSubjectState.js +0 -7
  270. package/lib/EventBus/useSubjectState.js.map +0 -1
  271. package/lib/components/CarouselTariffsCard/CardCellsSection.d.ts +0 -9
  272. package/lib/components/CarouselTariffsCard/CardCellsSection.js +0 -16
  273. package/lib/components/CarouselTariffsCard/CardCellsSection.js.map +0 -1
  274. package/lib/components/CarouselTariffsCard/carouselTariffsCardEventBus.d.ts +0 -9
  275. package/lib/components/CarouselTariffsCard/carouselTariffsCardEventBus.js +0 -3
  276. package/lib/components/CarouselTariffsCard/carouselTariffsCardEventBus.js.map +0 -1
  277. package/lib/hooks/useReducer.d.ts +0 -4
  278. package/lib/hooks/useReducer.js +0 -9
  279. package/lib/hooks/useReducer.js.map +0 -1
  280. package/lib/ui-kit/LocationDialog/SelectedLocation.d.ts +0 -5
  281. package/lib/ui-kit/LocationDialog/SelectedLocation.js +0 -13
  282. package/lib/ui-kit/LocationDialog/SelectedLocation.js.map +0 -1
  283. package/mobile/bundle/EventBus/useSubject.d.ts +0 -2
  284. package/mobile/bundle/EventBus/useSubjectState.d.ts +0 -2
  285. package/mobile/bundle/components/CarouselTariffsCard/CardCellsSection.d.ts +0 -9
  286. package/mobile/bundle/components/CarouselTariffsCard/carouselTariffsCardEventBus.d.ts +0 -9
  287. package/mobile/bundle/hooks/useReducer.d.ts +0 -4
  288. package/mobile/bundle/ui-kit/LocationDialog/SelectedLocation.d.ts +0 -5
  289. package/mobile/dist/EventBus/useSubject.d.ts +0 -2
  290. package/mobile/dist/EventBus/useSubject.js +0 -17
  291. package/mobile/dist/EventBus/useSubject.js.map +0 -1
  292. package/mobile/dist/EventBus/useSubjectState.d.ts +0 -2
  293. package/mobile/dist/EventBus/useSubjectState.js +0 -10
  294. package/mobile/dist/EventBus/useSubjectState.js.map +0 -1
  295. package/mobile/dist/components/CarouselTariffsCard/CardCellsSection.d.ts +0 -9
  296. package/mobile/dist/components/CarouselTariffsCard/CardCellsSection.js +0 -18
  297. package/mobile/dist/components/CarouselTariffsCard/CardCellsSection.js.map +0 -1
  298. package/mobile/dist/components/CarouselTariffsCard/carouselTariffsCardEventBus.d.ts +0 -9
  299. package/mobile/dist/components/CarouselTariffsCard/carouselTariffsCardEventBus.js +0 -5
  300. package/mobile/dist/components/CarouselTariffsCard/carouselTariffsCardEventBus.js.map +0 -1
  301. package/mobile/dist/hooks/useReducer.d.ts +0 -4
  302. package/mobile/dist/hooks/useReducer.js +0 -12
  303. package/mobile/dist/hooks/useReducer.js.map +0 -1
  304. package/mobile/dist/ui-kit/LocationDialog/SelectedLocation.d.ts +0 -5
  305. package/mobile/dist/ui-kit/LocationDialog/SelectedLocation.js +0 -15
  306. package/mobile/dist/ui-kit/LocationDialog/SelectedLocation.js.map +0 -1
  307. package/mobile/lib/EventBus/useSubject.d.ts +0 -2
  308. package/mobile/lib/EventBus/useSubject.js +0 -14
  309. package/mobile/lib/EventBus/useSubject.js.map +0 -1
  310. package/mobile/lib/EventBus/useSubjectState.d.ts +0 -2
  311. package/mobile/lib/EventBus/useSubjectState.js +0 -7
  312. package/mobile/lib/EventBus/useSubjectState.js.map +0 -1
  313. package/mobile/lib/components/CarouselTariffsCard/CardCellsSection.d.ts +0 -9
  314. package/mobile/lib/components/CarouselTariffsCard/CardCellsSection.js +0 -16
  315. package/mobile/lib/components/CarouselTariffsCard/CardCellsSection.js.map +0 -1
  316. package/mobile/lib/components/CarouselTariffsCard/carouselTariffsCardEventBus.d.ts +0 -9
  317. package/mobile/lib/components/CarouselTariffsCard/carouselTariffsCardEventBus.js +0 -3
  318. package/mobile/lib/components/CarouselTariffsCard/carouselTariffsCardEventBus.js.map +0 -1
  319. package/mobile/lib/hooks/useReducer.d.ts +0 -4
  320. package/mobile/lib/hooks/useReducer.js +0 -9
  321. package/mobile/lib/hooks/useReducer.js.map +0 -1
  322. package/mobile/lib/ui-kit/LocationDialog/SelectedLocation.d.ts +0 -5
  323. package/mobile/lib/ui-kit/LocationDialog/SelectedLocation.js +0 -13
  324. package/mobile/lib/ui-kit/LocationDialog/SelectedLocation.js.map +0 -1
  325. package/mobile/src/EventBus/useSubject.ts +0 -19
  326. package/mobile/src/EventBus/useSubjectState.ts +0 -13
  327. package/mobile/src/components/CarouselTariffsCard/CardCellsSection.tsx +0 -54
  328. package/mobile/src/components/CarouselTariffsCard/carouselTariffsCardEventBus.ts +0 -11
  329. package/mobile/src/hooks/useReducer.ts +0 -21
  330. package/mobile/src/ui-kit/LocationDialog/SelectedLocation.tsx +0 -27
  331. package/src/EventBus/useSubject.ts +0 -19
  332. package/src/EventBus/useSubjectState.ts +0 -13
  333. package/src/components/CarouselTariffsCard/CardCellsSection.tsx +0 -54
  334. package/src/components/CarouselTariffsCard/carouselTariffsCardEventBus.ts +0 -11
  335. package/src/hooks/useReducer.ts +0 -21
  336. package/src/ui-kit/LocationDialog/SelectedLocation.tsx +0 -27
@@ -1,9 +1,20 @@
1
+ import { type CarouselTariffsCardAction } from '../components/CarouselTariffsCard/CarouselTariffsCardAction';
2
+ import { type Tab } from '../components/TabsLayout/TabsLayoutContent';
1
3
  import { type Region } from '../hooks/useRegions';
2
4
  import { type DialogAction } from '../ui-kit/DialogManager/DialogAction';
3
5
  import { type PopupAction } from '../ui-kit/PopupManager/PopupAction';
4
6
  import { EventBus } from './EventBus';
5
- export declare const defaultEventBus: EventBus<{
7
+ interface TabActivationEvent {
8
+ type?: Tab['type'];
9
+ groupName?: string;
10
+ label?: string;
11
+ }
12
+ interface GlobalEventMap {
6
13
  location: Region;
7
14
  dialog: DialogAction;
8
15
  popup: PopupAction;
9
- }>;
16
+ tab: TabActivationEvent;
17
+ fold: CarouselTariffsCardAction;
18
+ }
19
+ export declare const defaultEventBus: EventBus<GlobalEventMap>;
20
+ export {};
@@ -0,0 +1,2 @@
1
+ import { type EventBus } from './EventBus';
2
+ export declare const useLatestEvent: <EM extends Record<string, any>, K extends keyof EM>(eventBus: EventBus<EM>, type: K, initialEvent?: EM[K] | undefined) => [EM[K] | null, (_: EM[K]) => void];
@@ -411,58 +411,39 @@
411
411
  ].join(' ');
412
412
 
413
413
  class EventBus {
414
- subscribersMap = {};
414
+ subscribers = {};
415
415
  subjectsStateMap = {};
416
- emitter = this;
417
- observable = this;
418
416
  subscribe(type, listener) {
419
- this.subscribersMap[type] ||= [];
420
- this.subscribersMap[type]?.push(listener);
421
- this.fireSubscribers([listener], this.subjectsStateMap[type]);
417
+ this.subscribers[type] = (this.subscribers[type] || []).concat(listener);
418
+ const latestEvent = this.subjectsStateMap[type];
419
+ if (latestEvent) {
420
+ listener(latestEvent);
421
+ }
422
422
  return () => {
423
423
  this.unsubscribe(type, listener);
424
424
  };
425
425
  }
426
426
  unsubscribe(type, listener) {
427
- const index = this.subscribersMap[type]?.indexOf(listener);
428
- if (index && index !== -1) {
429
- this.subscribersMap[type]?.splice(index, 1);
430
- }
427
+ this.subscribers[type] = this.subscribers[type]?.filter((s) => s !== listener);
431
428
  }
432
429
  fire(type, event) {
433
430
  const isSubjectDeclared = type in this.subjectsStateMap;
434
431
  if (isSubjectDeclared) {
435
- this.subject(type, event);
436
- }
437
- else {
438
- this.fireSubscribers(this.subscribersMap[type], event);
439
- }
440
- }
441
- subject(type, event) {
442
- if (this.subjectsStateMap[type] !== event) {
443
432
  this.subjectsStateMap[type] = event;
444
- this.fireSubscribers(this.subscribersMap[type], event);
445
433
  }
446
- return () => {
447
- delete this.subjectsStateMap[type];
448
- };
434
+ this.subscribers[type]?.forEach((s) => s(event));
449
435
  }
450
- fireSubscribers(subscribers, event) {
451
- if (!subscribers || !event) {
452
- return;
453
- }
454
- for (const _ of subscribers) {
455
- _(event);
456
- }
436
+ subject(type, event) {
437
+ this.subjectsStateMap[type] = event;
457
438
  }
458
439
  }
459
440
 
460
441
  const defaultEventBus = new EventBus();
461
442
 
462
443
  const useDialogManager = () => ({
463
- open: (dialog, options = {}) => defaultEventBus.emitter.fire('dialog', { type: 'open', dialog, ...options }),
464
- close: () => defaultEventBus.emitter.fire('dialog', { type: 'close' }),
465
- closeAll: () => defaultEventBus.emitter.fire('dialog', { type: 'close', all: true }),
444
+ open: (dialog, options = {}) => defaultEventBus.fire('dialog', { type: 'open', dialog, ...options }),
445
+ close: () => defaultEventBus.fire('dialog', { type: 'close' }),
446
+ closeAll: () => defaultEventBus.fire('dialog', { type: 'close', all: true }),
466
447
  });
467
448
 
468
449
  const adjustBase = (href, basePath = '') => href.replace(basePath, '') || '/';
@@ -1117,7 +1098,6 @@
1117
1098
  { key: 'phone', text: 'Телефонный звонок' },
1118
1099
  { key: 'email', text: 'Электронное сообщение' },
1119
1100
  ];
1120
- // TODO Тоже надо рефакторить - файлик constants
1121
1101
  const OUT_SERVICE_URL = '/api/v1/outservice/outserviceregions';
1122
1102
 
1123
1103
  const getRegionUrl = (typeForm) => typeForm === 'OUTSERVICE' ? OUT_SERVICE_URL : undefined;
@@ -1324,9 +1304,9 @@
1324
1304
  };
1325
1305
 
1326
1306
  const usePopupManager = () => ({
1327
- open: (popup, options) => defaultEventBus.emitter.fire('popup', { type: 'open', popup, ...options }),
1328
- update: (popup, options) => defaultEventBus.emitter.fire('popup', { type: 'update', popup, ...options }),
1329
- close: () => defaultEventBus.emitter.fire('popup', { type: 'close' }),
1307
+ open: (popup, options) => defaultEventBus.fire('popup', { type: 'open', popup, ...options }),
1308
+ update: (popup, options) => defaultEventBus.fire('popup', { type: 'update', popup, ...options }),
1309
+ close: () => defaultEventBus.fire('popup', { type: 'close' }),
1330
1310
  });
1331
1311
 
1332
1312
  const InputPopup = JSX(({ options, onChange }) => (jsx("div", { className: "bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl", role: "list", children: options?.map((item, key) => (jsx("div", { className: "flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative", role: "listitem", onMouseDown: () => onChange(item), children: jsx("span", { className: "min-h-6", children: item.processedValue }) }, key.toString()))) })));
@@ -1595,7 +1575,6 @@
1595
1575
  };
1596
1576
  };
1597
1577
 
1598
- // TODO Зачем это?
1599
1578
  const getValidation = (field, validator, required = false) => required ? withValidator(field, validator) : field;
1600
1579
 
1601
1580
  const ACQUIRING_TYPES = [
@@ -2097,11 +2076,9 @@
2097
2076
  const LegalFormField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u041E\u041F\u0424", placeholder: "\u041E\u041E\u041E, \u041F\u0410\u041E \u0438 \u0434\u0440.", ...getValidation(field('legalForm'), validatorObj.legalForm, input?.required), ...input })));
2098
2077
 
2099
2078
  const REGIONS_URL = '/api/v1/regions';
2100
- const EMPTY_REGIONS = [];
2101
- // TODO Почему url можно менять? Разве смысл не в инкапсуляции api url. Тоже под рефакторинг попадает
2102
2079
  function useRegions(url = REGIONS_URL) {
2103
2080
  const { data } = useAsyncData(url, fetchJSONUnsafe);
2104
- return Array.isArray(data) ? data : EMPTY_REGIONS;
2081
+ return Array.isArray(data) ? data : [];
2105
2082
  }
2106
2083
 
2107
2084
  const LocalitiesField = JSX(({ field, input }) => {
@@ -2643,14 +2620,6 @@
2643
2620
  return { ...formState, typeForm: { key: typeForm, text: '' } };
2644
2621
  };
2645
2622
 
2646
- const FoldableWrapper = JSX(({ className, children }) => (jsx("div", { className: className, role: "group", children: children })));
2647
- /**
2648
- * Какой то бесполезный компонент. Его можно заменить на useBool
2649
- * Лучше оставить только обёрточный div с необходимой атрибутикой
2650
- * и сделать пассивный компонент
2651
- *
2652
- * @deprecated
2653
- */
2654
2623
  const Foldable = JSX(({ className = '', isFoldButtonOnTop = false, unfoldedByDefault = false, renderFoldableSection, renderFoldButton, }) => {
2655
2624
  const [isUnfolded, setIsUnfolded] = useState(unfoldedByDefault);
2656
2625
  const onToggle = useCallback(() => {
@@ -2658,7 +2627,7 @@
2658
2627
  }, []);
2659
2628
  const sectionNode = renderFoldableSection({ isUnfolded, onToggle });
2660
2629
  const buttonNode = renderFoldButton ? renderFoldButton({ isUnfolded, onToggle }) : null;
2661
- return isFoldButtonOnTop ? (jsxs(FoldableWrapper, { className: className, children: [buttonNode, sectionNode] })) : (jsxs(FoldableWrapper, { className: className, children: [sectionNode, buttonNode] }));
2630
+ return isFoldButtonOnTop ? (jsxs("div", { className: className, role: "group", children: [buttonNode, sectionNode] })) : (jsxs("div", { className: className, role: "group", children: [sectionNode, buttonNode] }));
2662
2631
  });
2663
2632
 
2664
2633
  function useResizeObserver(callback, deps) {
@@ -4747,37 +4716,31 @@
4747
4716
  const CarouselRecommendationCard = JSX(({ className, padding, description, additionalDescription, href, icon, isDotted, __html, socialMedia = [], target, title, align = 'text-left', benefits, imageOptions: { directionRight = true, isImageAlwaysOnRight = ImageAlwaysOnRight, isImageSecondary = false, } = {}, data, ...rest }) => (jsx(BlockWrapper, { className: style('relative min-h-28 group-data-gray:bg-main-divider/50', className), defaultPadding: "p-0", ...rest, children: jsx(LinkWrapper, { href: href, target: target, className: "h-full", data: getAspectsWithInclude(data), children: jsxs(BaseTile, { className: "h-full", defaultPadding: "p-2xl", padding: padding, insetTitle: jsx(Headline, { title: title, description: description, headlineVersion: "XS", isEmbedded: true, align: align }), ...leftOrRightImage(isIcon(icon) ? jsx(Img, { image: icon }) : null, directionRight), buttons: socialMedia.length ? (jsx(SocialMedia, { media: socialMedia, stretched: true, showButtonText: true, version: rest?.version })) : null, isImageAlwaysOnRight: isImageAlwaysOnRight, isImageSecondary: isImageSecondary, imageAlign: "center", children: [jsx(BenefitsList, { benefits: benefits }), __html ? jsx(RichText, { __html: __html, isDotted: isDotted, itemSize: "list-s" }) : null, renderAdditionalDescription(additionalDescription, align)] }) }) })));
4748
4717
  const renderAdditionalDescription = (additionalDescription, align) => additionalDescription ? (jsx(Paragraph, { size: "text-m", font: "font-light", color: "text-secondary-text group-data-secondary:text-white/80", align: align, children: additionalDescription })) : null;
4749
4718
 
4750
- const useSubjectState = (eventBus, type, initialState) => {
4751
- const [state, setState] = useState(initialState);
4752
- useEffect(() => eventBus.subscribe(type, setState), [eventBus, type]);
4753
- return state;
4754
- };
4755
-
4756
4719
  const renderCardInfo = (cell, i) => {
4757
4720
  const { title, description, buttons } = cell;
4758
4721
  return (jsxs("div", { className: "py-lg border-b border-main-divider", children: [title ? (jsx("div", { className: "opacity-80", children: jsx(Text, { size: "text-m", color: "text-secondary-text", children: title }) })) : null, description ? (jsx("div", { className: "mt-2xs", children: jsx(Text, { size: "text-xl", color: "text-primary-text", children: description }) })) : null, buttons?.length ? (jsx("div", { className: "text-primary-main", children: renderButtonsSection(buttons) })) : null] }, String(i)));
4759
4722
  };
4760
4723
 
4761
- const CardCellsSection = JSX((props) => {
4762
- const { cardCells = [], visibleCellsCount = 1, isUnfolded } = props;
4763
- const [visibleCells, hiddenCells] = visibleCellsCount > 0 && cardCells.length >= visibleCellsCount
4764
- ? [cardCells.slice(0, visibleCellsCount), cardCells.slice(visibleCellsCount)]
4765
- : [cardCells, []];
4766
- return hiddenCells.length ? (jsxs(FoldableWrapper, { children: [jsxs("div", { children: [visibleCells.map(renderCardInfo), jsx(FoldableSection, { isUnfolded: isUnfolded, children: hiddenCells.map(renderCardInfo) })] }), jsx(FoldButton, { ...props })] })) : (jsx("div", { children: visibleCells.map(renderCardInfo) }));
4767
- });
4768
- const FoldButton = JSX(({ isUnfolded, data, onToggle }) => (jsxs("button", { type: "button", className: "w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center", ...(isUnfolded ? getAspectsAttributes(data) : {}), onClick: onToggle, children: [jsx("div", { children: isUnfolded ? 'Скрыть' : 'Подробнее о тарифе' }), jsx(Icon, { className: "text-primary-text", name: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16" })] })));
4769
-
4770
- const carouselTariffsCardEventBus = new EventBus();
4771
-
4772
- const CarouselTariffsCard = JSX(({ className, title, align = 'text-center', icon, button, visibleCellsCount = 1, cardCells = [], options, data, ...rest }) => {
4773
- const { isUnfolded, parent: firedParent } = useSubjectState(carouselTariffsCardEventBus.observable, 'fold', {});
4774
- const isVisible = isUnfolded && firedParent === options?.parent;
4775
- const toggle = useCallback(() => carouselTariffsCardEventBus.emitter.fire('fold', {
4776
- isUnfolded: !isVisible,
4777
- parent: options?.parent,
4778
- }), [isVisible, options?.parent]);
4779
- return (jsxs(BlockWrapper, { className: style('flex flex-col', className), defaultPadding: "p-2xl", ...rest, children: [isIcon(icon) ? (jsx("div", { className: "self-center", children: jsx(Img, { image: icon }) })) : null, title ? (jsx(Heading, { className: style('pt-xs', align), headingType: "h5", title: title })) : null, button?.text ? jsx(LinkButton, { className: "w-full mt-m mb-lg", ...button }) : null, jsx(CardCellsSection, { cardCells: cardCells, visibleCellsCount: visibleCellsCount, isUnfolded: isVisible, data: data, onToggle: toggle })] }));
4780
- });
4724
+ const CarouselTariffsCard = JSX(({ className = '', title, align = 'text-center', icon, button, visibleCellsCount = 1, cardCells = [], options, data, ...rest }) => {
4725
+ const cellsNode = cardCells.map(renderCardInfo);
4726
+ const [visibleCells, hiddenCells] = visibleCellsCount > 0
4727
+ ? [cellsNode.slice(0, visibleCellsCount), cellsNode.slice(visibleCellsCount)]
4728
+ : [cellsNode, []];
4729
+ const [isVisible, setIsVisible] = useState(false);
4730
+ useEffect(() => defaultEventBus.subscribe('fold', (event) => {
4731
+ if (options?.parent !== undefined && event.parent === options?.parent) {
4732
+ setIsVisible(event.isUnfolded);
4733
+ }
4734
+ }), [options?.parent]);
4735
+ return (jsxs(BlockWrapper, { className: style('flex flex-col', className), defaultPadding: "p-2xl", ...rest, children: [isIcon(icon) ? (jsx("div", { className: "self-center", children: jsx(Img, { image: icon }) })) : null, title ? (jsx(Heading, { className: style('pt-xs', align), headingType: "h5", title: title })) : null, button?.text ? jsx(LinkButton, { className: "w-full mt-m mb-lg", ...button }) : null, hiddenCells.length ? (jsx(Foldable, { renderFoldableSection: () => (jsxs("div", { children: [visibleCells, jsx(FoldableSection, { isUnfolded: isVisible, children: hiddenCells })] })), renderFoldButton: cardCells.length >= visibleCellsCount
4736
+ ? renderFoldButton$3(options?.parent, data, isVisible)
4737
+ : null })) : (jsx("div", { children: visibleCells }))] }));
4738
+ });
4739
+ const renderFoldButton$3 = (parent, data, isUnfolded = false) => () => (jsxs("button", { className: "w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center", onClick: () => {
4740
+ if (parent !== undefined) {
4741
+ defaultEventBus.fire('fold', { type: 'fold', isUnfolded: !isUnfolded, parent });
4742
+ }
4743
+ }, type: "button", ...(isUnfolded ? getAspectsAttributes(data) : {}), children: [jsx("div", { children: isUnfolded ? 'Скрыть' : 'Подробнее о тарифе' }), jsx(Icon, { className: "text-primary-text", name: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16" })] }));
4781
4744
 
4782
4745
  const isRateRow = (rateRow) => typeof rateRow?.minMonths === 'number' && typeof rateRow?.maxMonths === 'number';
4783
4746
 
@@ -4944,46 +4907,47 @@
4944
4907
  };
4945
4908
  const ErrorBlock = JSX(({ className = '', title, description, error, button, ...rest }) => (jsxs(BlockWrapper, { className: style('flex flex-col justify-center items-center', className), defaultPadding: style('p-6xl'), version: "transparent", ...rest, children: [jsx("div", { className: "flex justify-center", children: renderErrorContent(error) }), jsx(Headline, { title: title, description: description, headlineVersion: "XL", isEmbedded: true, className: "mb-2xl last:mb-0" }), button?.text ? (jsx(LinkButton, { version: button?.version, text: button?.text, ...button })) : null] })));
4946
4909
 
4947
- function useSubject(eventBus, type, initialState) {
4948
- useEffect(() => {
4949
- const state = initialState instanceof Function ? initialState() : initialState;
4950
- if (state instanceof Promise) {
4951
- state.then((_) => eventBus.subject(type, _), console.warn);
4952
- }
4953
- else {
4954
- eventBus.subject(type, state);
4955
- }
4956
- }, [eventBus, type]);
4957
- return useCallback((_) => eventBus.fire(type, _), [eventBus, type]);
4958
- }
4910
+ const useLatestEvent = (eventBus, type, initialEvent) => {
4911
+ const [latestEvent, setLatestEvent] = useState(initialEvent || null);
4912
+ useEffect(() => eventBus.subscribe(type, (_) => setLatestEvent(_)), [eventBus, type]);
4913
+ const fireEvent = useCallback((_) => eventBus.fire(type, _), [eventBus, type]);
4914
+ return [latestEvent, fireEvent];
4915
+ };
4959
4916
 
4960
4917
  const REGION_URL = '/api/v1/region';
4961
4918
  const LOCATION_STORAGE_KEY = 'location';
4962
4919
  function useLocation(defaultLocation = 'Москва') {
4963
- useEffect(() => defaultEventBus.subscribe('location', storeLocation), []);
4964
- return useSubject(defaultEventBus.emitter, 'location', restoreLocation(defaultLocation));
4965
- }
4966
- function useLocationState(defaultLocation = 'Москва') {
4967
- return useSubjectState(defaultEventBus.observable, 'location', { name: defaultLocation });
4968
- }
4969
- function restoreLocation(defaultLocation) {
4970
- return async () => {
4971
- if (!globalThis.localStorage?.hasItem(LOCATION_STORAGE_KEY)) {
4972
- storeLocation(await fetchJSON(REGION_URL));
4973
- }
4974
- const storedLocation = globalThis.localStorage?.getItem(LOCATION_STORAGE_KEY);
4975
- try {
4976
- return storedLocation && JSON.parse(storedLocation);
4977
- }
4978
- catch (ex) {
4979
- // Do nothing
4920
+ const [currentLocation, fireCurrentLocation] = useLatestEvent(defaultEventBus, 'location', restoreLocation() ?? { name: defaultLocation });
4921
+ const selectCurrentLocation = useCallback((_) => {
4922
+ storeLocation(_);
4923
+ fireCurrentLocation(_);
4924
+ }, []);
4925
+ const { data } = useAsyncData(hasStoredLocation() ? null : REGION_URL, fetchJSONUnsafe);
4926
+ useEffect(() => {
4927
+ if (data && !hasStoredLocation()) {
4928
+ fireCurrentLocation(data);
4980
4929
  }
4981
- return { name: defaultLocation };
4982
- };
4983
- }
4984
- function storeLocation(_) {
4985
- _ && globalThis.localStorage?.setItem(LOCATION_STORAGE_KEY, JSON.stringify(_));
4930
+ }, [data]);
4931
+ return [currentLocation ?? { name: defaultLocation }, selectCurrentLocation];
4986
4932
  }
4933
+ const hasStoredLocation = () => Boolean(globalThis.localStorage?.getItem(LOCATION_STORAGE_KEY));
4934
+ const restoreLocation = () => {
4935
+ try {
4936
+ const data = globalThis.localStorage?.getItem(LOCATION_STORAGE_KEY);
4937
+ return data && JSON.parse(data);
4938
+ }
4939
+ catch (ex) {
4940
+ return null;
4941
+ }
4942
+ };
4943
+ const storeLocation = (_) => {
4944
+ try {
4945
+ globalThis.localStorage?.setItem(LOCATION_STORAGE_KEY, JSON.stringify(_));
4946
+ }
4947
+ catch (ex) {
4948
+ // Do nothing
4949
+ }
4950
+ };
4987
4951
 
4988
4952
  var Currency;
4989
4953
  (function (Currency) {
@@ -5125,7 +5089,7 @@
5125
5089
  }
5126
5090
 
5127
5091
  const ExchangeRateTile = JSX(({ className = '', title = 'Курсы обмена валют', button, ...rest }) => {
5128
- const currentLocation = useLocationState();
5092
+ const [currentLocation] = useLocation();
5129
5093
  const exchangeRates = useFetchExchangeRateData(currentLocation);
5130
5094
  const currencyRates = getCurrencyRates(exchangeRates?.exchangeRate?.currencies);
5131
5095
  const currencyRatesBuy = currencyRates.filter((_) => _.buyExchangeRate);
@@ -5978,7 +5942,7 @@
5978
5942
  designDisabledPeople: (item) => Boolean(item.designDisabledPeople),
5979
5943
  };
5980
5944
  const AtmsMap = JSX(({ descriptionData, className }) => {
5981
- const currentLocation = useLocationState();
5945
+ const [currentLocation] = useLocation();
5982
5946
  const regionCode = currentLocation?.code ?? '000';
5983
5947
  const { data: officesData, isLoad } = useAtms(regionCode);
5984
5948
  return (jsx(OfficesAtmsMapLayout, { className: className, filterItems: filterItems, data: officesData, isLoad: isLoad, initFilterState: INITIAL_FILTRATION_STATE, renderCard: renderAtmCard, getBalloon: getAtmPoint, title: `Банкоматы филиала ${currentLocation?.name}`, descriptionData: descriptionData }));
@@ -6197,7 +6161,7 @@
6197
6161
  };
6198
6162
 
6199
6163
  const OfficesMap = JSX(({ className }) => {
6200
- const currentLocation = useLocationState();
6164
+ const [currentLocation] = useLocation();
6201
6165
  const regionCode = currentLocation?.code ?? '000';
6202
6166
  const { data, isLoad } = useOffices(regionCode);
6203
6167
  return (jsx(OfficesAtmsMapLayout, { className: className, data: data?.branches, isLoad: isLoad, remoteWorkplaces: data?.remoteWorkplaces, renderCard: renderOfficeCard, renderRemoteWorkplaceCard: renderRemoteWorkplaceCard, getBalloon: getOfficePoint, getBalloonRemoteWorkplaces: getRemoteWorkplacePoint, title: `Офисы филиала ${currentLocation?.name}` }));
@@ -6445,7 +6409,7 @@
6445
6409
  onClose && onClose(dialogs[dialogs.length - 1]);
6446
6410
  pop();
6447
6411
  }, [dialogs, onClose]);
6448
- useEffect(() => defaultEventBus.observable.subscribe('dialog', (action) => {
6412
+ useEffect(() => defaultEventBus.subscribe('dialog', (action) => {
6449
6413
  switch (action.type) {
6450
6414
  case 'open':
6451
6415
  push(action);
@@ -6554,33 +6518,27 @@
6554
6518
  return (jsxs("form", { className: `font-sans relative ${className}`, children: [jsx("div", { className: "absolute rounded h-full flex items-center justify-center pl-m max-w-44 gap-s pointer-events-none", children: searchTerm ? null : (jsx("label", { htmlFor: "search-bar-input", className: `text-secondary-text `, children: "\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0444\u0438\u043B\u0438\u0430\u043B\u0430\u043C" })) }), jsx("input", { id: "search-bar-input", className: style(inputValidStyle, `h-12 pl-m w-full peer text-l text-black rounded-md box-border`), value: searchTerm, onChange: (e) => onSearch(e.target.value.toLowerCase()), type: "text", name: "location-search-bar-input" })] }));
6555
6519
  });
6556
6520
 
6557
- const SelectedLocation = JSX(({ defaultLocation }) => {
6558
- const currentLocation = useLocationState(defaultLocation);
6559
- const link = useLink();
6560
- const { href } = link({ href: `/branches/${currentLocation.slug}` });
6561
- return currentLocation ? (jsx("div", { className: "mb-s", children: jsxs(Paragraph, { size: "text-l", color: "text-primary-text", children: ["\u0421\u0435\u0439\u0447\u0430\u0441 \u0432\u044B\u0431\u0440\u0430\u043D:", jsx(LinkWrapper, { href: href, className: "inline mx-2xs text-primary-main", children: currentLocation.name })] }) })) : null;
6562
- });
6563
-
6564
6521
  const SEARCH_TERM_MIN_LENGTH = 3;
6565
6522
  const LocationDialog = JSX(({ foreignOffices, branches }) => {
6566
- const selectLocation = useLocation(branches?.default);
6523
+ const [currentLocation, selectCurrentLocation] = useLocation(branches?.default);
6524
+ const link = useLink();
6525
+ const { href } = link({ href: `/branches/${currentLocation.slug}` });
6567
6526
  const [query, setQuery] = useState('');
6568
- const rawRegions = useRegions();
6569
- const regions = useMemo(() => cleanUpRegions(rawRegions).sort((a, b) => (a.name ?? '').localeCompare(b.name ?? '')), [rawRegions]);
6570
- const regionsGroupByLetter = useMemo(() => groupBy(regions, regionFirstLetter), [regions]);
6527
+ const regions = cleanUpRegions(useRegions()).sort((a, b) => a.name.localeCompare(b.name));
6528
+ const regionsGroupByLetter = groupBy(regions, regionFirstLetter);
6571
6529
  const { close } = useDialogManager();
6572
6530
  const handleChangeLocation = useCallback((region) => {
6573
- selectLocation(region);
6531
+ selectCurrentLocation(region);
6574
6532
  close();
6575
6533
  }, []);
6576
- return (jsxs(Dialog, { className: "pb-20", head: jsxs("div", { children: [jsx(Text, { size: "text-h4", color: "text-primary-text", children: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0438\u043B\u0438\u0430\u043B" }), jsx(SelectedLocation, { defaultLocation: branches?.default }), jsx(SearchBar, { onSearch: setQuery, searchTerm: query })] }), children: [query && query.length >= SEARCH_TERM_MIN_LENGTH ? (jsx("div", { children: regions
6534
+ return (jsxs(Dialog, { className: "pb-20", head: jsxs("div", { children: [jsx(Text, { size: "text-h4", color: "text-primary-text", children: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0438\u043B\u0438\u0430\u043B" }), currentLocation ? (jsx("div", { className: "mb-s", children: jsxs(Paragraph, { size: "text-l", color: "text-primary-text", children: ["\u0421\u0435\u0439\u0447\u0430\u0441 \u0432\u044B\u0431\u0440\u0430\u043D:", jsx(LinkWrapper, { href: href, className: "inline mx-2xs text-primary-main", children: currentLocation.name })] }) })) : null, jsx(SearchBar, { onSearch: setQuery, searchTerm: query })] }), children: [query && query.length >= SEARCH_TERM_MIN_LENGTH ? (jsx("div", { children: regions
6577
6535
  .filter(({ name }) => name && jaroWinklerDistance(name.toLowerCase())(query.toLowerCase()) >= 0.8)
6578
6536
  .map(renderRegion(branches?.dataSelect, handleChangeLocation)) })) : (jsx("div", { className: "columns-1 sm:columns-3 md:columns-4 lg:columns-5", children: Array.from(regionsGroupByLetter.entries()).map(renderRegionGroup(handleChangeLocation, branches?.dataSelect)) })), renderForeignOffices(foreignOffices)] }));
6579
6537
  });
6580
- const regionFirstLetter = (region) => region.name?.charAt(0) ?? '';
6538
+ const regionFirstLetter = (region) => region.name?.charAt(0) || '';
6581
6539
  const cleanUpRegions = (regions) => regions.map((region) => ({
6582
6540
  ...region,
6583
- name: region.name?.replace(/республика|область|край'/gi, '').trim() ?? '',
6541
+ name: region.name?.replace(/республика|область|край'/gi, '').trim() || '',
6584
6542
  }));
6585
6543
 
6586
6544
  const useLocationDialog = (props) => {
@@ -6593,7 +6551,7 @@
6593
6551
 
6594
6552
  const BurgerMenuDialog = JSX(({ menuRef, menuItem, locationDialogProps, closeAll }) => {
6595
6553
  const locationDialog = useLocationDialog(locationDialogProps || {});
6596
- const { name: location } = useLocationState();
6554
+ const [{ name: location }] = useLocation();
6597
6555
  const menuDimensions = menuRef?.current?.getBoundingClientRect();
6598
6556
  const basePath = getBasePath(env.SITE_URL);
6599
6557
  const handleIframeLoad = () => {
@@ -7153,7 +7111,7 @@
7153
7111
  const close = useCallback(() => {
7154
7112
  setPopup(null);
7155
7113
  }, []);
7156
- useEffect(() => defaultEventBus.observable.subscribe('popup', (action) => {
7114
+ useEffect(() => defaultEventBus.subscribe('popup', (action) => {
7157
7115
  switch (action.type) {
7158
7116
  case 'open':
7159
7117
  case 'update':
@@ -7208,7 +7166,7 @@
7208
7166
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
7209
7167
  });
7210
7168
 
7211
- const packageVersion = "0.14.599";
7169
+ const packageVersion = "0.14.600";
7212
7170
 
7213
7171
  exports.Blocks = Blocks;
7214
7172
  exports.ContentPage = ContentPage;