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

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 (589) 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/api/RetailApi/RetailApi.d.ts +1 -0
  5. package/bundle/blocks.schema.json +1 -1
  6. package/bundle/bundle.umd.js +243 -258
  7. package/bundle/bundle.umd.min.js +1 -1
  8. package/bundle/components/ApplicationLeadForm/consents.d.ts +7 -1
  9. package/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +11 -9
  10. package/bundle/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +6 -0
  11. package/bundle/hooks/useLocation.d.ts +1 -2
  12. package/bundle/model/LinkProps.d.ts +3 -1
  13. package/bundle/ui-kit/Checkbox/CheckboxWithDoc.d.ts +6 -0
  14. package/bundle/ui-kit/Checkbox/getDocument.d.ts +1 -0
  15. package/bundle/ui-kit/Foldable/Foldable.d.ts +1 -11
  16. package/bundle/ui-kit/FormField/Fields/ConsentField.d.ts +2 -0
  17. package/dist/EventBus/EventBus.d.ts +4 -17
  18. package/dist/EventBus/EventBus.js +10 -29
  19. package/dist/EventBus/EventBus.js.map +1 -1
  20. package/dist/EventBus/defaultEventBus.d.ts +13 -2
  21. package/dist/EventBus/defaultEventBus.js.map +1 -1
  22. package/dist/EventBus/useLatestEvent.d.ts +2 -0
  23. package/dist/EventBus/useLatestEvent.js +11 -0
  24. package/dist/EventBus/useLatestEvent.js.map +1 -0
  25. package/dist/api/RetailApi/RetailApi.d.ts +1 -0
  26. package/dist/api/RetailApi/RetailApi.js +1 -0
  27. package/dist/api/RetailApi/RetailApi.js.map +1 -1
  28. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -2
  29. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  30. package/dist/components/ApplicationLeadForm/GroupedConsents.js +1 -1
  31. package/dist/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
  32. package/dist/components/ApplicationLeadForm/consents.d.ts +7 -1
  33. package/dist/components/ApplicationLeadForm/consents.js +33 -10
  34. package/dist/components/ApplicationLeadForm/consents.js.map +1 -1
  35. package/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +11 -9
  36. package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  37. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -7
  38. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  39. package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +25 -11
  40. package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  41. package/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +6 -0
  42. package/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.js +2 -0
  43. package/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.js.map +1 -0
  44. package/dist/components/ExchangeRateTile/ExchangeRateTile.js +1 -1
  45. package/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  46. package/dist/components/Header/HeaderSecondaryMenu.js +1 -1
  47. package/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
  48. package/dist/components/OfficesAtmsMap/AtmsMap.js +1 -1
  49. package/dist/components/OfficesAtmsMap/AtmsMap.js.map +1 -1
  50. package/dist/components/OfficesAtmsMap/OfficesMap.js +1 -1
  51. package/dist/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
  52. package/dist/components/StickyBottomMenu/BurgerMenuDialog.js +1 -1
  53. package/dist/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  54. package/dist/hooks/useLocation.d.ts +1 -2
  55. package/dist/hooks/useLocation.js +33 -27
  56. package/dist/hooks/useLocation.js.map +1 -1
  57. package/dist/hooks/useRegions.js +1 -3
  58. package/dist/hooks/useRegions.js.map +1 -1
  59. package/dist/model/LinkProps.d.ts +3 -1
  60. package/dist/ui-kit/Checkbox/CheckboxWithDoc.d.ts +6 -0
  61. package/dist/ui-kit/Checkbox/CheckboxWithDoc.js +21 -0
  62. package/dist/ui-kit/Checkbox/CheckboxWithDoc.js.map +1 -0
  63. package/dist/ui-kit/Checkbox/getDocument.d.ts +1 -0
  64. package/dist/ui-kit/Checkbox/getDocument.js +9 -0
  65. package/dist/ui-kit/Checkbox/getDocument.js.map +1 -0
  66. package/dist/ui-kit/DialogManager/useDialogManager.js +3 -3
  67. package/dist/ui-kit/DialogManager/useDialogManager.js.map +1 -1
  68. package/dist/ui-kit/DialogManager/useDialogsList.js +1 -1
  69. package/dist/ui-kit/DialogManager/useDialogsList.js.map +1 -1
  70. package/dist/ui-kit/Foldable/Foldable.d.ts +1 -11
  71. package/dist/ui-kit/Foldable/Foldable.js +2 -10
  72. package/dist/ui-kit/Foldable/Foldable.js.map +1 -1
  73. package/dist/ui-kit/FormField/Fields/ConsentField.d.ts +2 -0
  74. package/dist/ui-kit/FormField/Fields/ConsentField.js +10 -0
  75. package/dist/ui-kit/FormField/Fields/ConsentField.js.map +1 -0
  76. package/dist/ui-kit/FormField/constants.js +0 -1
  77. package/dist/ui-kit/FormField/constants.js.map +1 -1
  78. package/dist/ui-kit/FormField/getField.js +10 -17
  79. package/dist/ui-kit/FormField/getField.js.map +1 -1
  80. package/dist/ui-kit/FormField/getValidation.js +0 -1
  81. package/dist/ui-kit/FormField/getValidation.js.map +1 -1
  82. package/dist/ui-kit/LocationDialog/LocationDialog.js +12 -9
  83. package/dist/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  84. package/dist/ui-kit/PopupManager/PopupManager.js +1 -1
  85. package/dist/ui-kit/PopupManager/PopupManager.js.map +1 -1
  86. package/dist/ui-kit/PopupManager/usePopupManager.js +3 -3
  87. package/dist/ui-kit/PopupManager/usePopupManager.js.map +1 -1
  88. package/lib/EventBus/EventBus.d.ts +4 -17
  89. package/lib/EventBus/EventBus.js +10 -29
  90. package/lib/EventBus/EventBus.js.map +1 -1
  91. package/lib/EventBus/defaultEventBus.d.ts +13 -2
  92. package/lib/EventBus/defaultEventBus.js.map +1 -1
  93. package/lib/EventBus/useLatestEvent.d.ts +2 -0
  94. package/lib/EventBus/useLatestEvent.js +8 -0
  95. package/lib/EventBus/useLatestEvent.js.map +1 -0
  96. package/lib/api/RetailApi/RetailApi.d.ts +1 -0
  97. package/lib/api/RetailApi/RetailApi.js +1 -0
  98. package/lib/api/RetailApi/RetailApi.js.map +1 -1
  99. package/lib/common.css +1 -1
  100. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -2
  101. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  102. package/lib/components/ApplicationLeadForm/GroupedConsents.js +1 -1
  103. package/lib/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
  104. package/lib/components/ApplicationLeadForm/consents.d.ts +7 -1
  105. package/lib/components/ApplicationLeadForm/consents.js +33 -10
  106. package/lib/components/ApplicationLeadForm/consents.js.map +1 -1
  107. package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +11 -9
  108. package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  109. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -7
  110. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  111. package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +26 -12
  112. package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  113. package/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +6 -0
  114. package/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.js +2 -0
  115. package/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.js.map +1 -0
  116. package/lib/components/ExchangeRateTile/ExchangeRateTile.js +2 -2
  117. package/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  118. package/lib/components/Header/HeaderSecondaryMenu.js +2 -2
  119. package/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
  120. package/lib/components/OfficesAtmsMap/AtmsMap.js +2 -2
  121. package/lib/components/OfficesAtmsMap/AtmsMap.js.map +1 -1
  122. package/lib/components/OfficesAtmsMap/OfficesMap.js +2 -2
  123. package/lib/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
  124. package/lib/components/StickyBottomMenu/BurgerMenuDialog.js +2 -2
  125. package/lib/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  126. package/lib/hooks/useLocation.d.ts +1 -2
  127. package/lib/hooks/useLocation.js +33 -26
  128. package/lib/hooks/useLocation.js.map +1 -1
  129. package/lib/hooks/useRegions.js +1 -3
  130. package/lib/hooks/useRegions.js.map +1 -1
  131. package/lib/model/LinkProps.d.ts +3 -1
  132. package/lib/ui-kit/Checkbox/CheckboxWithDoc.d.ts +6 -0
  133. package/lib/ui-kit/Checkbox/CheckboxWithDoc.js +19 -0
  134. package/lib/ui-kit/Checkbox/CheckboxWithDoc.js.map +1 -0
  135. package/lib/ui-kit/Checkbox/getDocument.d.ts +1 -0
  136. package/lib/ui-kit/Checkbox/getDocument.js +6 -0
  137. package/lib/ui-kit/Checkbox/getDocument.js.map +1 -0
  138. package/lib/ui-kit/DialogManager/useDialogManager.js +3 -3
  139. package/lib/ui-kit/DialogManager/useDialogManager.js.map +1 -1
  140. package/lib/ui-kit/DialogManager/useDialogsList.js +1 -1
  141. package/lib/ui-kit/DialogManager/useDialogsList.js.map +1 -1
  142. package/lib/ui-kit/Foldable/Foldable.d.ts +1 -11
  143. package/lib/ui-kit/Foldable/Foldable.js +2 -10
  144. package/lib/ui-kit/Foldable/Foldable.js.map +1 -1
  145. package/lib/ui-kit/FormField/Fields/ConsentField.d.ts +2 -0
  146. package/lib/ui-kit/FormField/Fields/ConsentField.js +8 -0
  147. package/lib/ui-kit/FormField/Fields/ConsentField.js.map +1 -0
  148. package/lib/ui-kit/FormField/constants.js +0 -1
  149. package/lib/ui-kit/FormField/constants.js.map +1 -1
  150. package/lib/ui-kit/FormField/getField.js +10 -17
  151. package/lib/ui-kit/FormField/getField.js.map +1 -1
  152. package/lib/ui-kit/FormField/getValidation.js +0 -1
  153. package/lib/ui-kit/FormField/getValidation.js.map +1 -1
  154. package/lib/ui-kit/LocationDialog/LocationDialog.js +13 -10
  155. package/lib/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  156. package/lib/ui-kit/PopupManager/PopupManager.js +1 -1
  157. package/lib/ui-kit/PopupManager/PopupManager.js.map +1 -1
  158. package/lib/ui-kit/PopupManager/usePopupManager.js +3 -3
  159. package/lib/ui-kit/PopupManager/usePopupManager.js.map +1 -1
  160. package/mobile/bundle/EventBus/EventBus.d.ts +4 -17
  161. package/mobile/bundle/EventBus/defaultEventBus.d.ts +13 -2
  162. package/mobile/bundle/EventBus/useLatestEvent.d.ts +2 -0
  163. package/mobile/bundle/api/RetailApi/RetailApi.d.ts +1 -0
  164. package/mobile/bundle/bundle.umd.js +243 -258
  165. package/mobile/bundle/bundle.umd.min.js +1 -1
  166. package/mobile/bundle/components/ApplicationLeadForm/consents.d.ts +7 -1
  167. package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +11 -9
  168. package/mobile/bundle/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +6 -0
  169. package/mobile/bundle/hooks/useLocation.d.ts +1 -2
  170. package/mobile/bundle/model/LinkProps.d.ts +3 -1
  171. package/mobile/bundle/ui-kit/Checkbox/CheckboxWithDoc.d.ts +6 -0
  172. package/mobile/bundle/ui-kit/Checkbox/getDocument.d.ts +1 -0
  173. package/mobile/bundle/ui-kit/Foldable/Foldable.d.ts +1 -11
  174. package/mobile/bundle/ui-kit/FormField/Fields/ConsentField.d.ts +2 -0
  175. package/mobile/dist/EventBus/EventBus.d.ts +4 -17
  176. package/mobile/dist/EventBus/EventBus.js +10 -29
  177. package/mobile/dist/EventBus/EventBus.js.map +1 -1
  178. package/mobile/dist/EventBus/defaultEventBus.d.ts +13 -2
  179. package/mobile/dist/EventBus/defaultEventBus.js.map +1 -1
  180. package/mobile/dist/EventBus/useLatestEvent.d.ts +2 -0
  181. package/mobile/dist/EventBus/useLatestEvent.js +11 -0
  182. package/mobile/dist/EventBus/useLatestEvent.js.map +1 -0
  183. package/mobile/dist/api/RetailApi/RetailApi.d.ts +1 -0
  184. package/mobile/dist/api/RetailApi/RetailApi.js +1 -0
  185. package/mobile/dist/api/RetailApi/RetailApi.js.map +1 -1
  186. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -2
  187. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  188. package/mobile/dist/components/ApplicationLeadForm/GroupedConsents.js +1 -1
  189. package/mobile/dist/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
  190. package/mobile/dist/components/ApplicationLeadForm/consents.d.ts +7 -1
  191. package/mobile/dist/components/ApplicationLeadForm/consents.js +33 -10
  192. package/mobile/dist/components/ApplicationLeadForm/consents.js.map +1 -1
  193. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +11 -9
  194. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  195. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -7
  196. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  197. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +25 -11
  198. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  199. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +6 -0
  200. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.js +2 -0
  201. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.js.map +1 -0
  202. package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js +1 -1
  203. package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  204. package/mobile/dist/components/Header/HeaderSecondaryMenu.js +1 -1
  205. package/mobile/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
  206. package/mobile/dist/components/OfficesAtmsMap/AtmsMap.js +1 -1
  207. package/mobile/dist/components/OfficesAtmsMap/AtmsMap.js.map +1 -1
  208. package/mobile/dist/components/OfficesAtmsMap/OfficesMap.js +1 -1
  209. package/mobile/dist/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
  210. package/mobile/dist/components/StickyBottomMenu/BurgerMenuDialog.js +1 -1
  211. package/mobile/dist/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  212. package/mobile/dist/hooks/useLocation.d.ts +1 -2
  213. package/mobile/dist/hooks/useLocation.js +33 -27
  214. package/mobile/dist/hooks/useLocation.js.map +1 -1
  215. package/mobile/dist/hooks/useRegions.js +1 -3
  216. package/mobile/dist/hooks/useRegions.js.map +1 -1
  217. package/mobile/dist/model/LinkProps.d.ts +3 -1
  218. package/mobile/dist/ui-kit/Checkbox/CheckboxWithDoc.d.ts +6 -0
  219. package/mobile/dist/ui-kit/Checkbox/CheckboxWithDoc.js +21 -0
  220. package/mobile/dist/ui-kit/Checkbox/CheckboxWithDoc.js.map +1 -0
  221. package/mobile/dist/ui-kit/Checkbox/getDocument.d.ts +1 -0
  222. package/mobile/dist/ui-kit/Checkbox/getDocument.js +9 -0
  223. package/mobile/dist/ui-kit/Checkbox/getDocument.js.map +1 -0
  224. package/mobile/dist/ui-kit/DialogManager/useDialogManager.js +3 -3
  225. package/mobile/dist/ui-kit/DialogManager/useDialogManager.js.map +1 -1
  226. package/mobile/dist/ui-kit/DialogManager/useDialogsList.js +1 -1
  227. package/mobile/dist/ui-kit/DialogManager/useDialogsList.js.map +1 -1
  228. package/mobile/dist/ui-kit/Foldable/Foldable.d.ts +1 -11
  229. package/mobile/dist/ui-kit/Foldable/Foldable.js +2 -10
  230. package/mobile/dist/ui-kit/Foldable/Foldable.js.map +1 -1
  231. package/mobile/dist/ui-kit/FormField/Fields/ConsentField.d.ts +2 -0
  232. package/mobile/dist/ui-kit/FormField/Fields/ConsentField.js +10 -0
  233. package/mobile/dist/ui-kit/FormField/Fields/ConsentField.js.map +1 -0
  234. package/mobile/dist/ui-kit/FormField/constants.js +0 -1
  235. package/mobile/dist/ui-kit/FormField/constants.js.map +1 -1
  236. package/mobile/dist/ui-kit/FormField/getField.js +10 -17
  237. package/mobile/dist/ui-kit/FormField/getField.js.map +1 -1
  238. package/mobile/dist/ui-kit/FormField/getValidation.js +0 -1
  239. package/mobile/dist/ui-kit/FormField/getValidation.js.map +1 -1
  240. package/mobile/dist/ui-kit/LocationDialog/LocationDialog.js +12 -9
  241. package/mobile/dist/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  242. package/mobile/dist/ui-kit/PopupManager/PopupManager.js +1 -1
  243. package/mobile/dist/ui-kit/PopupManager/PopupManager.js.map +1 -1
  244. package/mobile/dist/ui-kit/PopupManager/usePopupManager.js +3 -3
  245. package/mobile/dist/ui-kit/PopupManager/usePopupManager.js.map +1 -1
  246. package/mobile/lib/EventBus/EventBus.d.ts +4 -17
  247. package/mobile/lib/EventBus/EventBus.js +10 -29
  248. package/mobile/lib/EventBus/EventBus.js.map +1 -1
  249. package/mobile/lib/EventBus/defaultEventBus.d.ts +13 -2
  250. package/mobile/lib/EventBus/defaultEventBus.js.map +1 -1
  251. package/mobile/lib/EventBus/useLatestEvent.d.ts +2 -0
  252. package/mobile/lib/EventBus/useLatestEvent.js +8 -0
  253. package/mobile/lib/EventBus/useLatestEvent.js.map +1 -0
  254. package/mobile/lib/api/RetailApi/RetailApi.d.ts +1 -0
  255. package/mobile/lib/api/RetailApi/RetailApi.js +1 -0
  256. package/mobile/lib/api/RetailApi/RetailApi.js.map +1 -1
  257. package/mobile/lib/common.css +1 -1
  258. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -2
  259. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  260. package/mobile/lib/components/ApplicationLeadForm/GroupedConsents.js +1 -1
  261. package/mobile/lib/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
  262. package/mobile/lib/components/ApplicationLeadForm/consents.d.ts +7 -1
  263. package/mobile/lib/components/ApplicationLeadForm/consents.js +33 -10
  264. package/mobile/lib/components/ApplicationLeadForm/consents.js.map +1 -1
  265. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +11 -9
  266. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  267. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -7
  268. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  269. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +26 -12
  270. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  271. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +6 -0
  272. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.js +2 -0
  273. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.js.map +1 -0
  274. package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js +2 -2
  275. package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  276. package/mobile/lib/components/Header/HeaderSecondaryMenu.js +2 -2
  277. package/mobile/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
  278. package/mobile/lib/components/OfficesAtmsMap/AtmsMap.js +2 -2
  279. package/mobile/lib/components/OfficesAtmsMap/AtmsMap.js.map +1 -1
  280. package/mobile/lib/components/OfficesAtmsMap/OfficesMap.js +2 -2
  281. package/mobile/lib/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
  282. package/mobile/lib/components/StickyBottomMenu/BurgerMenuDialog.js +2 -2
  283. package/mobile/lib/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  284. package/mobile/lib/hooks/useLocation.d.ts +1 -2
  285. package/mobile/lib/hooks/useLocation.js +33 -26
  286. package/mobile/lib/hooks/useLocation.js.map +1 -1
  287. package/mobile/lib/hooks/useRegions.js +1 -3
  288. package/mobile/lib/hooks/useRegions.js.map +1 -1
  289. package/mobile/lib/model/LinkProps.d.ts +3 -1
  290. package/mobile/lib/ui-kit/Checkbox/CheckboxWithDoc.d.ts +6 -0
  291. package/mobile/lib/ui-kit/Checkbox/CheckboxWithDoc.js +19 -0
  292. package/mobile/lib/ui-kit/Checkbox/CheckboxWithDoc.js.map +1 -0
  293. package/mobile/lib/ui-kit/Checkbox/getDocument.d.ts +1 -0
  294. package/mobile/lib/ui-kit/Checkbox/getDocument.js +6 -0
  295. package/mobile/lib/ui-kit/Checkbox/getDocument.js.map +1 -0
  296. package/mobile/lib/ui-kit/DialogManager/useDialogManager.js +3 -3
  297. package/mobile/lib/ui-kit/DialogManager/useDialogManager.js.map +1 -1
  298. package/mobile/lib/ui-kit/DialogManager/useDialogsList.js +1 -1
  299. package/mobile/lib/ui-kit/DialogManager/useDialogsList.js.map +1 -1
  300. package/mobile/lib/ui-kit/Foldable/Foldable.d.ts +1 -11
  301. package/mobile/lib/ui-kit/Foldable/Foldable.js +2 -10
  302. package/mobile/lib/ui-kit/Foldable/Foldable.js.map +1 -1
  303. package/mobile/lib/ui-kit/FormField/Fields/ConsentField.d.ts +2 -0
  304. package/mobile/lib/ui-kit/FormField/Fields/ConsentField.js +8 -0
  305. package/mobile/lib/ui-kit/FormField/Fields/ConsentField.js.map +1 -0
  306. package/mobile/lib/ui-kit/FormField/constants.js +0 -1
  307. package/mobile/lib/ui-kit/FormField/constants.js.map +1 -1
  308. package/mobile/lib/ui-kit/FormField/getField.js +10 -17
  309. package/mobile/lib/ui-kit/FormField/getField.js.map +1 -1
  310. package/mobile/lib/ui-kit/FormField/getValidation.js +0 -1
  311. package/mobile/lib/ui-kit/FormField/getValidation.js.map +1 -1
  312. package/mobile/lib/ui-kit/LocationDialog/LocationDialog.js +13 -10
  313. package/mobile/lib/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  314. package/mobile/lib/ui-kit/PopupManager/PopupManager.js +1 -1
  315. package/mobile/lib/ui-kit/PopupManager/PopupManager.js.map +1 -1
  316. package/mobile/lib/ui-kit/PopupManager/usePopupManager.js +3 -3
  317. package/mobile/lib/ui-kit/PopupManager/usePopupManager.js.map +1 -1
  318. package/mobile/src/EventBus/EventBus.ts +15 -51
  319. package/mobile/src/EventBus/defaultEventBus.ts +14 -2
  320. package/mobile/src/EventBus/useLatestEvent.ts +16 -0
  321. package/mobile/src/api/RetailApi/RetailApi.ts +1 -0
  322. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +2 -2
  323. package/mobile/src/components/ApplicationLeadForm/GroupedConsents.tsx +1 -0
  324. package/mobile/src/components/ApplicationLeadForm/consents.ts +40 -10
  325. package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +12 -9
  326. package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.ts +14 -7
  327. package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +66 -23
  328. package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCardAction.ts +6 -0
  329. package/mobile/src/components/ExchangeRateTile/ExchangeRateTile.tsx +2 -2
  330. package/mobile/src/components/Header/HeaderSecondaryMenu.tsx +2 -2
  331. package/mobile/src/components/OfficesAtmsMap/AtmsMap.tsx +3 -2
  332. package/mobile/src/components/OfficesAtmsMap/OfficesMap.tsx +2 -2
  333. package/mobile/src/components/StickyBottomMenu/BurgerMenuDialog.tsx +2 -2
  334. package/mobile/src/hooks/useLocation.ts +44 -30
  335. package/mobile/src/hooks/useRegions.ts +1 -4
  336. package/mobile/src/model/LinkProps.ts +4 -1
  337. package/mobile/src/ui-kit/Checkbox/CheckboxWithDoc.tsx +48 -0
  338. package/mobile/src/ui-kit/Checkbox/getDocument.ts +7 -0
  339. package/mobile/src/ui-kit/DialogManager/useDialogManager.ts +3 -3
  340. package/mobile/src/ui-kit/DialogManager/useDialogsList.ts +1 -1
  341. package/mobile/src/ui-kit/Foldable/Foldable.tsx +5 -21
  342. package/mobile/src/ui-kit/FormField/Fields/ConsentField.tsx +16 -0
  343. package/mobile/src/ui-kit/FormField/constants.tsx +0 -1
  344. package/mobile/src/ui-kit/FormField/getField.tsx +11 -19
  345. package/mobile/src/ui-kit/FormField/getValidation.tsx +0 -1
  346. package/mobile/src/ui-kit/LocationDialog/LocationDialog.tsx +25 -13
  347. package/mobile/src/ui-kit/PopupManager/PopupManager.tsx +1 -1
  348. package/mobile/src/ui-kit/PopupManager/usePopupManager.tsx +3 -3
  349. package/package.json +1 -1
  350. package/src/EventBus/EventBus.ts +15 -51
  351. package/src/EventBus/defaultEventBus.ts +14 -2
  352. package/src/EventBus/useLatestEvent.ts +16 -0
  353. package/src/api/RetailApi/RetailApi.ts +1 -0
  354. package/src/components/ApplicationLeadForm/ApplicationLeadForm.fixture.tsx +1 -1
  355. package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +2 -2
  356. package/src/components/ApplicationLeadForm/GroupedConsents.tsx +1 -0
  357. package/src/components/ApplicationLeadForm/consents.ts +40 -10
  358. package/src/components/ApplicationLeadForm/getInitialFormState.tsx +12 -9
  359. package/src/components/ApplicationLeadForm/useApplicationLeadApi.ts +14 -7
  360. package/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +66 -23
  361. package/src/components/CarouselTariffsCard/CarouselTariffsCardAction.ts +6 -0
  362. package/src/components/ExchangeRateTile/ExchangeRateTile.tsx +2 -2
  363. package/src/components/Header/HeaderSecondaryMenu.tsx +2 -2
  364. package/src/components/OfficesAtmsMap/AtmsMap.tsx +3 -2
  365. package/src/components/OfficesAtmsMap/OfficesMap.tsx +2 -2
  366. package/src/components/StickyBottomMenu/BurgerMenuDialog.tsx +2 -2
  367. package/src/hooks/useLocation.ts +44 -30
  368. package/src/hooks/useRegions.ts +1 -4
  369. package/src/model/LinkProps.ts +4 -1
  370. package/src/ui-kit/Checkbox/CheckboxWithDoc.tsx +48 -0
  371. package/src/ui-kit/Checkbox/getDocument.ts +7 -0
  372. package/src/ui-kit/DialogManager/useDialogManager.ts +3 -3
  373. package/src/ui-kit/DialogManager/useDialogsList.ts +1 -1
  374. package/src/ui-kit/Foldable/Foldable.tsx +5 -21
  375. package/src/ui-kit/FormField/Fields/ConsentField.tsx +16 -0
  376. package/src/ui-kit/FormField/constants.tsx +0 -1
  377. package/src/ui-kit/FormField/getField.tsx +11 -19
  378. package/src/ui-kit/FormField/getValidation.tsx +0 -1
  379. package/src/ui-kit/LocationDialog/LocationDialog.tsx +25 -13
  380. package/src/ui-kit/PopupManager/PopupManager.tsx +1 -1
  381. package/src/ui-kit/PopupManager/usePopupManager.tsx +3 -3
  382. package/bundle/EventBus/useSubject.d.ts +0 -2
  383. package/bundle/EventBus/useSubjectState.d.ts +0 -2
  384. package/bundle/components/CarouselTariffsCard/CardCellsSection.d.ts +0 -9
  385. package/bundle/components/CarouselTariffsCard/carouselTariffsCardEventBus.d.ts +0 -9
  386. package/bundle/hooks/useReducer.d.ts +0 -4
  387. package/bundle/ui-kit/FormField/Fields/ConsentAssignmentField.d.ts +0 -2
  388. package/bundle/ui-kit/FormField/Fields/ConsentCollectionField.d.ts +0 -2
  389. package/bundle/ui-kit/FormField/Fields/ConsentInformField.d.ts +0 -2
  390. package/bundle/ui-kit/FormField/Fields/ConsentPhotoField.d.ts +0 -2
  391. package/bundle/ui-kit/FormField/Fields/ConsentProviderField.d.ts +0 -2
  392. package/bundle/ui-kit/FormField/Fields/ConsentToReceiveMaterialsField.d.ts +0 -2
  393. package/bundle/ui-kit/FormField/Fields/ProcessPersonalDataField.d.ts +0 -2
  394. package/bundle/ui-kit/LocationDialog/SelectedLocation.d.ts +0 -5
  395. package/dist/EventBus/useSubject.d.ts +0 -2
  396. package/dist/EventBus/useSubject.js +0 -17
  397. package/dist/EventBus/useSubject.js.map +0 -1
  398. package/dist/EventBus/useSubjectState.d.ts +0 -2
  399. package/dist/EventBus/useSubjectState.js +0 -10
  400. package/dist/EventBus/useSubjectState.js.map +0 -1
  401. package/dist/components/CarouselTariffsCard/CardCellsSection.d.ts +0 -9
  402. package/dist/components/CarouselTariffsCard/CardCellsSection.js +0 -18
  403. package/dist/components/CarouselTariffsCard/CardCellsSection.js.map +0 -1
  404. package/dist/components/CarouselTariffsCard/carouselTariffsCardEventBus.d.ts +0 -9
  405. package/dist/components/CarouselTariffsCard/carouselTariffsCardEventBus.js +0 -5
  406. package/dist/components/CarouselTariffsCard/carouselTariffsCardEventBus.js.map +0 -1
  407. package/dist/hooks/useReducer.d.ts +0 -4
  408. package/dist/hooks/useReducer.js +0 -12
  409. package/dist/hooks/useReducer.js.map +0 -1
  410. package/dist/ui-kit/FormField/Fields/ConsentAssignmentField.d.ts +0 -2
  411. package/dist/ui-kit/FormField/Fields/ConsentAssignmentField.js +0 -9
  412. package/dist/ui-kit/FormField/Fields/ConsentAssignmentField.js.map +0 -1
  413. package/dist/ui-kit/FormField/Fields/ConsentCollectionField.d.ts +0 -2
  414. package/dist/ui-kit/FormField/Fields/ConsentCollectionField.js +0 -9
  415. package/dist/ui-kit/FormField/Fields/ConsentCollectionField.js.map +0 -1
  416. package/dist/ui-kit/FormField/Fields/ConsentInformField.d.ts +0 -2
  417. package/dist/ui-kit/FormField/Fields/ConsentInformField.js +0 -9
  418. package/dist/ui-kit/FormField/Fields/ConsentInformField.js.map +0 -1
  419. package/dist/ui-kit/FormField/Fields/ConsentPhotoField.d.ts +0 -2
  420. package/dist/ui-kit/FormField/Fields/ConsentPhotoField.js +0 -9
  421. package/dist/ui-kit/FormField/Fields/ConsentPhotoField.js.map +0 -1
  422. package/dist/ui-kit/FormField/Fields/ConsentProviderField.d.ts +0 -2
  423. package/dist/ui-kit/FormField/Fields/ConsentProviderField.js +0 -9
  424. package/dist/ui-kit/FormField/Fields/ConsentProviderField.js.map +0 -1
  425. package/dist/ui-kit/FormField/Fields/ConsentToReceiveMaterialsField.d.ts +0 -2
  426. package/dist/ui-kit/FormField/Fields/ConsentToReceiveMaterialsField.js +0 -9
  427. package/dist/ui-kit/FormField/Fields/ConsentToReceiveMaterialsField.js.map +0 -1
  428. package/dist/ui-kit/FormField/Fields/ProcessPersonalDataField.d.ts +0 -2
  429. package/dist/ui-kit/FormField/Fields/ProcessPersonalDataField.js +0 -9
  430. package/dist/ui-kit/FormField/Fields/ProcessPersonalDataField.js.map +0 -1
  431. package/dist/ui-kit/LocationDialog/SelectedLocation.d.ts +0 -5
  432. package/dist/ui-kit/LocationDialog/SelectedLocation.js +0 -15
  433. package/dist/ui-kit/LocationDialog/SelectedLocation.js.map +0 -1
  434. package/lib/EventBus/useSubject.d.ts +0 -2
  435. package/lib/EventBus/useSubject.js +0 -14
  436. package/lib/EventBus/useSubject.js.map +0 -1
  437. package/lib/EventBus/useSubjectState.d.ts +0 -2
  438. package/lib/EventBus/useSubjectState.js +0 -7
  439. package/lib/EventBus/useSubjectState.js.map +0 -1
  440. package/lib/components/CarouselTariffsCard/CardCellsSection.d.ts +0 -9
  441. package/lib/components/CarouselTariffsCard/CardCellsSection.js +0 -16
  442. package/lib/components/CarouselTariffsCard/CardCellsSection.js.map +0 -1
  443. package/lib/components/CarouselTariffsCard/carouselTariffsCardEventBus.d.ts +0 -9
  444. package/lib/components/CarouselTariffsCard/carouselTariffsCardEventBus.js +0 -3
  445. package/lib/components/CarouselTariffsCard/carouselTariffsCardEventBus.js.map +0 -1
  446. package/lib/hooks/useReducer.d.ts +0 -4
  447. package/lib/hooks/useReducer.js +0 -9
  448. package/lib/hooks/useReducer.js.map +0 -1
  449. package/lib/ui-kit/FormField/Fields/ConsentAssignmentField.d.ts +0 -2
  450. package/lib/ui-kit/FormField/Fields/ConsentAssignmentField.js +0 -7
  451. package/lib/ui-kit/FormField/Fields/ConsentAssignmentField.js.map +0 -1
  452. package/lib/ui-kit/FormField/Fields/ConsentCollectionField.d.ts +0 -2
  453. package/lib/ui-kit/FormField/Fields/ConsentCollectionField.js +0 -7
  454. package/lib/ui-kit/FormField/Fields/ConsentCollectionField.js.map +0 -1
  455. package/lib/ui-kit/FormField/Fields/ConsentInformField.d.ts +0 -2
  456. package/lib/ui-kit/FormField/Fields/ConsentInformField.js +0 -7
  457. package/lib/ui-kit/FormField/Fields/ConsentInformField.js.map +0 -1
  458. package/lib/ui-kit/FormField/Fields/ConsentPhotoField.d.ts +0 -2
  459. package/lib/ui-kit/FormField/Fields/ConsentPhotoField.js +0 -7
  460. package/lib/ui-kit/FormField/Fields/ConsentPhotoField.js.map +0 -1
  461. package/lib/ui-kit/FormField/Fields/ConsentProviderField.d.ts +0 -2
  462. package/lib/ui-kit/FormField/Fields/ConsentProviderField.js +0 -7
  463. package/lib/ui-kit/FormField/Fields/ConsentProviderField.js.map +0 -1
  464. package/lib/ui-kit/FormField/Fields/ConsentToReceiveMaterialsField.d.ts +0 -2
  465. package/lib/ui-kit/FormField/Fields/ConsentToReceiveMaterialsField.js +0 -7
  466. package/lib/ui-kit/FormField/Fields/ConsentToReceiveMaterialsField.js.map +0 -1
  467. package/lib/ui-kit/FormField/Fields/ProcessPersonalDataField.d.ts +0 -2
  468. package/lib/ui-kit/FormField/Fields/ProcessPersonalDataField.js +0 -7
  469. package/lib/ui-kit/FormField/Fields/ProcessPersonalDataField.js.map +0 -1
  470. package/lib/ui-kit/LocationDialog/SelectedLocation.d.ts +0 -5
  471. package/lib/ui-kit/LocationDialog/SelectedLocation.js +0 -13
  472. package/lib/ui-kit/LocationDialog/SelectedLocation.js.map +0 -1
  473. package/mobile/bundle/EventBus/useSubject.d.ts +0 -2
  474. package/mobile/bundle/EventBus/useSubjectState.d.ts +0 -2
  475. package/mobile/bundle/components/CarouselTariffsCard/CardCellsSection.d.ts +0 -9
  476. package/mobile/bundle/components/CarouselTariffsCard/carouselTariffsCardEventBus.d.ts +0 -9
  477. package/mobile/bundle/hooks/useReducer.d.ts +0 -4
  478. package/mobile/bundle/ui-kit/FormField/Fields/ConsentAssignmentField.d.ts +0 -2
  479. package/mobile/bundle/ui-kit/FormField/Fields/ConsentCollectionField.d.ts +0 -2
  480. package/mobile/bundle/ui-kit/FormField/Fields/ConsentInformField.d.ts +0 -2
  481. package/mobile/bundle/ui-kit/FormField/Fields/ConsentPhotoField.d.ts +0 -2
  482. package/mobile/bundle/ui-kit/FormField/Fields/ConsentProviderField.d.ts +0 -2
  483. package/mobile/bundle/ui-kit/FormField/Fields/ConsentToReceiveMaterialsField.d.ts +0 -2
  484. package/mobile/bundle/ui-kit/FormField/Fields/ProcessPersonalDataField.d.ts +0 -2
  485. package/mobile/bundle/ui-kit/LocationDialog/SelectedLocation.d.ts +0 -5
  486. package/mobile/dist/EventBus/useSubject.d.ts +0 -2
  487. package/mobile/dist/EventBus/useSubject.js +0 -17
  488. package/mobile/dist/EventBus/useSubject.js.map +0 -1
  489. package/mobile/dist/EventBus/useSubjectState.d.ts +0 -2
  490. package/mobile/dist/EventBus/useSubjectState.js +0 -10
  491. package/mobile/dist/EventBus/useSubjectState.js.map +0 -1
  492. package/mobile/dist/components/CarouselTariffsCard/CardCellsSection.d.ts +0 -9
  493. package/mobile/dist/components/CarouselTariffsCard/CardCellsSection.js +0 -18
  494. package/mobile/dist/components/CarouselTariffsCard/CardCellsSection.js.map +0 -1
  495. package/mobile/dist/components/CarouselTariffsCard/carouselTariffsCardEventBus.d.ts +0 -9
  496. package/mobile/dist/components/CarouselTariffsCard/carouselTariffsCardEventBus.js +0 -5
  497. package/mobile/dist/components/CarouselTariffsCard/carouselTariffsCardEventBus.js.map +0 -1
  498. package/mobile/dist/hooks/useReducer.d.ts +0 -4
  499. package/mobile/dist/hooks/useReducer.js +0 -12
  500. package/mobile/dist/hooks/useReducer.js.map +0 -1
  501. package/mobile/dist/ui-kit/FormField/Fields/ConsentAssignmentField.d.ts +0 -2
  502. package/mobile/dist/ui-kit/FormField/Fields/ConsentAssignmentField.js +0 -9
  503. package/mobile/dist/ui-kit/FormField/Fields/ConsentAssignmentField.js.map +0 -1
  504. package/mobile/dist/ui-kit/FormField/Fields/ConsentCollectionField.d.ts +0 -2
  505. package/mobile/dist/ui-kit/FormField/Fields/ConsentCollectionField.js +0 -9
  506. package/mobile/dist/ui-kit/FormField/Fields/ConsentCollectionField.js.map +0 -1
  507. package/mobile/dist/ui-kit/FormField/Fields/ConsentInformField.d.ts +0 -2
  508. package/mobile/dist/ui-kit/FormField/Fields/ConsentInformField.js +0 -9
  509. package/mobile/dist/ui-kit/FormField/Fields/ConsentInformField.js.map +0 -1
  510. package/mobile/dist/ui-kit/FormField/Fields/ConsentPhotoField.d.ts +0 -2
  511. package/mobile/dist/ui-kit/FormField/Fields/ConsentPhotoField.js +0 -9
  512. package/mobile/dist/ui-kit/FormField/Fields/ConsentPhotoField.js.map +0 -1
  513. package/mobile/dist/ui-kit/FormField/Fields/ConsentProviderField.d.ts +0 -2
  514. package/mobile/dist/ui-kit/FormField/Fields/ConsentProviderField.js +0 -9
  515. package/mobile/dist/ui-kit/FormField/Fields/ConsentProviderField.js.map +0 -1
  516. package/mobile/dist/ui-kit/FormField/Fields/ConsentToReceiveMaterialsField.d.ts +0 -2
  517. package/mobile/dist/ui-kit/FormField/Fields/ConsentToReceiveMaterialsField.js +0 -9
  518. package/mobile/dist/ui-kit/FormField/Fields/ConsentToReceiveMaterialsField.js.map +0 -1
  519. package/mobile/dist/ui-kit/FormField/Fields/ProcessPersonalDataField.d.ts +0 -2
  520. package/mobile/dist/ui-kit/FormField/Fields/ProcessPersonalDataField.js +0 -9
  521. package/mobile/dist/ui-kit/FormField/Fields/ProcessPersonalDataField.js.map +0 -1
  522. package/mobile/dist/ui-kit/LocationDialog/SelectedLocation.d.ts +0 -5
  523. package/mobile/dist/ui-kit/LocationDialog/SelectedLocation.js +0 -15
  524. package/mobile/dist/ui-kit/LocationDialog/SelectedLocation.js.map +0 -1
  525. package/mobile/lib/EventBus/useSubject.d.ts +0 -2
  526. package/mobile/lib/EventBus/useSubject.js +0 -14
  527. package/mobile/lib/EventBus/useSubject.js.map +0 -1
  528. package/mobile/lib/EventBus/useSubjectState.d.ts +0 -2
  529. package/mobile/lib/EventBus/useSubjectState.js +0 -7
  530. package/mobile/lib/EventBus/useSubjectState.js.map +0 -1
  531. package/mobile/lib/components/CarouselTariffsCard/CardCellsSection.d.ts +0 -9
  532. package/mobile/lib/components/CarouselTariffsCard/CardCellsSection.js +0 -16
  533. package/mobile/lib/components/CarouselTariffsCard/CardCellsSection.js.map +0 -1
  534. package/mobile/lib/components/CarouselTariffsCard/carouselTariffsCardEventBus.d.ts +0 -9
  535. package/mobile/lib/components/CarouselTariffsCard/carouselTariffsCardEventBus.js +0 -3
  536. package/mobile/lib/components/CarouselTariffsCard/carouselTariffsCardEventBus.js.map +0 -1
  537. package/mobile/lib/hooks/useReducer.d.ts +0 -4
  538. package/mobile/lib/hooks/useReducer.js +0 -9
  539. package/mobile/lib/hooks/useReducer.js.map +0 -1
  540. package/mobile/lib/ui-kit/FormField/Fields/ConsentAssignmentField.d.ts +0 -2
  541. package/mobile/lib/ui-kit/FormField/Fields/ConsentAssignmentField.js +0 -7
  542. package/mobile/lib/ui-kit/FormField/Fields/ConsentAssignmentField.js.map +0 -1
  543. package/mobile/lib/ui-kit/FormField/Fields/ConsentCollectionField.d.ts +0 -2
  544. package/mobile/lib/ui-kit/FormField/Fields/ConsentCollectionField.js +0 -7
  545. package/mobile/lib/ui-kit/FormField/Fields/ConsentCollectionField.js.map +0 -1
  546. package/mobile/lib/ui-kit/FormField/Fields/ConsentInformField.d.ts +0 -2
  547. package/mobile/lib/ui-kit/FormField/Fields/ConsentInformField.js +0 -7
  548. package/mobile/lib/ui-kit/FormField/Fields/ConsentInformField.js.map +0 -1
  549. package/mobile/lib/ui-kit/FormField/Fields/ConsentPhotoField.d.ts +0 -2
  550. package/mobile/lib/ui-kit/FormField/Fields/ConsentPhotoField.js +0 -7
  551. package/mobile/lib/ui-kit/FormField/Fields/ConsentPhotoField.js.map +0 -1
  552. package/mobile/lib/ui-kit/FormField/Fields/ConsentProviderField.d.ts +0 -2
  553. package/mobile/lib/ui-kit/FormField/Fields/ConsentProviderField.js +0 -7
  554. package/mobile/lib/ui-kit/FormField/Fields/ConsentProviderField.js.map +0 -1
  555. package/mobile/lib/ui-kit/FormField/Fields/ConsentToReceiveMaterialsField.d.ts +0 -2
  556. package/mobile/lib/ui-kit/FormField/Fields/ConsentToReceiveMaterialsField.js +0 -7
  557. package/mobile/lib/ui-kit/FormField/Fields/ConsentToReceiveMaterialsField.js.map +0 -1
  558. package/mobile/lib/ui-kit/FormField/Fields/ProcessPersonalDataField.d.ts +0 -2
  559. package/mobile/lib/ui-kit/FormField/Fields/ProcessPersonalDataField.js +0 -7
  560. package/mobile/lib/ui-kit/FormField/Fields/ProcessPersonalDataField.js.map +0 -1
  561. package/mobile/lib/ui-kit/LocationDialog/SelectedLocation.d.ts +0 -5
  562. package/mobile/lib/ui-kit/LocationDialog/SelectedLocation.js +0 -13
  563. package/mobile/lib/ui-kit/LocationDialog/SelectedLocation.js.map +0 -1
  564. package/mobile/src/EventBus/useSubject.ts +0 -19
  565. package/mobile/src/EventBus/useSubjectState.ts +0 -13
  566. package/mobile/src/components/CarouselTariffsCard/CardCellsSection.tsx +0 -54
  567. package/mobile/src/components/CarouselTariffsCard/carouselTariffsCardEventBus.ts +0 -11
  568. package/mobile/src/hooks/useReducer.ts +0 -21
  569. package/mobile/src/ui-kit/FormField/Fields/ConsentAssignmentField.tsx +0 -16
  570. package/mobile/src/ui-kit/FormField/Fields/ConsentCollectionField.tsx +0 -16
  571. package/mobile/src/ui-kit/FormField/Fields/ConsentInformField.tsx +0 -12
  572. package/mobile/src/ui-kit/FormField/Fields/ConsentPhotoField.tsx +0 -12
  573. package/mobile/src/ui-kit/FormField/Fields/ConsentProviderField.tsx +0 -16
  574. package/mobile/src/ui-kit/FormField/Fields/ConsentToReceiveMaterialsField.tsx +0 -16
  575. package/mobile/src/ui-kit/FormField/Fields/ProcessPersonalDataField.tsx +0 -16
  576. package/mobile/src/ui-kit/LocationDialog/SelectedLocation.tsx +0 -27
  577. package/src/EventBus/useSubject.ts +0 -19
  578. package/src/EventBus/useSubjectState.ts +0 -13
  579. package/src/components/CarouselTariffsCard/CardCellsSection.tsx +0 -54
  580. package/src/components/CarouselTariffsCard/carouselTariffsCardEventBus.ts +0 -11
  581. package/src/hooks/useReducer.ts +0 -21
  582. package/src/ui-kit/FormField/Fields/ConsentAssignmentField.tsx +0 -16
  583. package/src/ui-kit/FormField/Fields/ConsentCollectionField.tsx +0 -16
  584. package/src/ui-kit/FormField/Fields/ConsentInformField.tsx +0 -12
  585. package/src/ui-kit/FormField/Fields/ConsentPhotoField.tsx +0 -12
  586. package/src/ui-kit/FormField/Fields/ConsentProviderField.tsx +0 -16
  587. package/src/ui-kit/FormField/Fields/ConsentToReceiveMaterialsField.tsx +0 -16
  588. package/src/ui-kit/FormField/Fields/ProcessPersonalDataField.tsx +0 -16
  589. package/src/ui-kit/LocationDialog/SelectedLocation.tsx +0 -27
@@ -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,48 +1098,10 @@
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;
1124
1104
 
1125
- const renderErrorText = (error) => (jsx("div", { className: "h-6", children: error ? (jsx(Text, { size: "text-xs", font: "font-light", color: "text-error", children: error })) : null }));
1126
-
1127
- const SVG = JSX(({ className, viewBox, fill = 'none', width, height, paths, ...commonOptions }) => {
1128
- return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: className, viewBox: viewBox, fill: fill, width: width, height: height, children: paths.map(({ d, fill: pathFill, ...options }, i) => {
1129
- const resultOptions = { ...commonOptions, ...options };
1130
- return (jsx("path", { d: d, fill: pathFill || 'currentColor', stroke: resultOptions.stroke, strokeLinecap: resultOptions.strokeLinecap, strokeLinejoin: resultOptions.strokeLinejoin, strokeWidth: resultOptions.strokeWidth, strokeMiterlimit: resultOptions.strokeMiterlimit }, i));
1131
- }) }));
1132
- });
1133
-
1134
- const defaultCheckStyle = 'appearance-none w-5 h-5 border-solid flex-none';
1135
-
1136
- const CHECK_PATHS = [
1137
- {
1138
- d: 'M10.207.793a1 1 0 0 1 0 1.414l-6 6a1 1 0 0 1-1.414 0l-2.5-2.5a1 1 0 0 1 1.414-1.414L3.5 6.086 8.793.793a1 1 0 0 1 1.414 0Z',
1139
- fillRule: 'evenodd',
1140
- clipRule: 'evenodd',
1141
- fill: 'white',
1142
- },
1143
- ];
1144
- const Checkbox = JSX(({ className, value, text, disabled, isRadio, onChange }) => {
1145
- const handleChange = useCallback((e) => {
1146
- if (disabled) {
1147
- return;
1148
- }
1149
- e.preventDefault();
1150
- onChange && onChange(!value);
1151
- }, [onChange, disabled, value]);
1152
- const icon = isRadio ? (jsx("div", { className: "absolute left-1 w-3 h-3 rounded-full bg-primary-main" })) : (jsx(SVG, { paths: CHECK_PATHS, className: "absolute left-1 ml-px block", width: "11", height: "9", fill: "white", viewBox: "0 0 11 9" }));
1153
- return (jsx("div", { className: className, children: jsxs("label", { className: style('flex items-center relative group/box', getCursorStyle(disabled)), onClick: handleChange, children: [jsx("div", { className: style(defaultCheckStyle, 'm-0', isRadio ? 'rounded-full border-2' : checkboxStyle(value), !disabled && value ? 'border-primary-main' : 'border-gray', disabled ? 'bg-main-disabled' : 'group-hover/box:border-primary-hover'), role: role(isRadio), "aria-checked": Boolean(value), "aria-disabled": Boolean(disabled), "aria-label": text }), value ? icon : null, renderText$3(text)] }) }));
1154
- });
1155
- const renderText$3 = (text) => text ? (jsx("div", { className: "ml-s", children: jsx(Text, { size: "text-l", font: "font-light", children: text }) })) : null;
1156
- const getCursorStyle = (disabled = false) => (disabled ? 'cursor-not-allowed' : 'cursor-pointer');
1157
- const role = (isRadio = false) => (isRadio ? 'radio' : 'checkbox');
1158
- const checkboxStyle = (value = false) => style('rounded border', { 'bg-primary-main': value });
1159
-
1160
- const CheckboxWithError = JSX(({ className, text, value, key, disabled, error, onChange }) => (jsxs("div", { className: style('shrink-0', className), children: [jsx(Checkbox, { text: text, value: value, disabled: disabled, onChange: onChange }, key), renderErrorText(error)] })));
1161
-
1162
1105
  function useBool(defaultValue = false) {
1163
1106
  const [value, setValue] = useState(defaultValue);
1164
1107
  const setTrue = useCallback(() => setValue(true), []);
@@ -1220,6 +1163,8 @@
1220
1163
  const getValidStyle = (valid) => (valid ? inputValidStyle : 'border-error');
1221
1164
  const defaultStyle$1 = 'w-full border rounded-md text-primary-text outline-none p-m';
1222
1165
 
1166
+ const renderErrorText = (error) => (jsx("div", { className: "h-6", children: error ? (jsx(Text, { size: "text-xs", font: "font-light", color: "text-error", children: error })) : null }));
1167
+
1223
1168
  const DEFAULT_HINTS_COUNT = 10;
1224
1169
  const defaultResponseItemHandler = (item) => item?.value || '';
1225
1170
  const getResponseHandler = (itemHandler) => (response) => {
@@ -1324,9 +1269,9 @@
1324
1269
  };
1325
1270
 
1326
1271
  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' }),
1272
+ open: (popup, options) => defaultEventBus.fire('popup', { type: 'open', popup, ...options }),
1273
+ update: (popup, options) => defaultEventBus.fire('popup', { type: 'update', popup, ...options }),
1274
+ close: () => defaultEventBus.fire('popup', { type: 'close' }),
1330
1275
  });
1331
1276
 
1332
1277
  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 +1540,6 @@
1595
1540
  };
1596
1541
  };
1597
1542
 
1598
- // TODO Зачем это?
1599
1543
  const getValidation = (field, validator, required = false) => required ? withValidator(field, validator) : field;
1600
1544
 
1601
1545
  const ACQUIRING_TYPES = [
@@ -1809,6 +1753,41 @@
1809
1753
 
1810
1754
  const AnnualRevenueField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u0413\u043E\u0434\u043E\u0432\u0430\u044F \u0432\u044B\u0440\u0443\u0447\u043A\u0430, \u20BD", ...getValidation(field('annualRevenue'), validatorObj.annualRevenue, input?.required) })));
1811
1755
 
1756
+ const SVG = JSX(({ className, viewBox, fill = 'none', width, height, paths, ...commonOptions }) => {
1757
+ return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: className, viewBox: viewBox, fill: fill, width: width, height: height, children: paths.map(({ d, fill: pathFill, ...options }, i) => {
1758
+ const resultOptions = { ...commonOptions, ...options };
1759
+ return (jsx("path", { d: d, fill: pathFill || 'currentColor', stroke: resultOptions.stroke, strokeLinecap: resultOptions.strokeLinecap, strokeLinejoin: resultOptions.strokeLinejoin, strokeWidth: resultOptions.strokeWidth, strokeMiterlimit: resultOptions.strokeMiterlimit }, i));
1760
+ }) }));
1761
+ });
1762
+
1763
+ const defaultCheckStyle = 'appearance-none w-5 h-5 border-solid flex-none';
1764
+
1765
+ const CHECK_PATHS = [
1766
+ {
1767
+ d: 'M10.207.793a1 1 0 0 1 0 1.414l-6 6a1 1 0 0 1-1.414 0l-2.5-2.5a1 1 0 0 1 1.414-1.414L3.5 6.086 8.793.793a1 1 0 0 1 1.414 0Z',
1768
+ fillRule: 'evenodd',
1769
+ clipRule: 'evenodd',
1770
+ fill: 'white',
1771
+ },
1772
+ ];
1773
+ const Checkbox = JSX(({ className, value, text, disabled, isRadio, onChange }) => {
1774
+ const handleChange = useCallback((e) => {
1775
+ if (disabled) {
1776
+ return;
1777
+ }
1778
+ e.preventDefault();
1779
+ onChange && onChange(!value);
1780
+ }, [onChange, disabled, value]);
1781
+ const icon = isRadio ? (jsx("div", { className: "absolute left-1 w-3 h-3 rounded-full bg-primary-main" })) : (jsx(SVG, { paths: CHECK_PATHS, className: "absolute left-1 ml-px block", width: "11", height: "9", fill: "white", viewBox: "0 0 11 9" }));
1782
+ return (jsx("div", { className: className, children: jsxs("label", { className: style('flex items-center relative group/box', getCursorStyle(disabled)), onClick: handleChange, children: [jsx("div", { className: style(defaultCheckStyle, 'm-0', isRadio ? 'rounded-full border-2' : checkboxStyle(value), !disabled && value ? 'border-primary-main' : 'border-gray', disabled ? 'bg-main-disabled' : 'group-hover/box:border-primary-hover'), role: role(isRadio), "aria-checked": Boolean(value), "aria-disabled": Boolean(disabled), "aria-label": text }), value ? icon : null, renderText$3(text)] }) }));
1783
+ });
1784
+ const renderText$3 = (text) => text ? (jsx("div", { className: "ml-s", children: jsx(Text, { size: "text-l", font: "font-light", children: text }) })) : null;
1785
+ const getCursorStyle = (disabled = false) => (disabled ? 'cursor-not-allowed' : 'cursor-pointer');
1786
+ const role = (isRadio = false) => (isRadio ? 'radio' : 'checkbox');
1787
+ const checkboxStyle = (value = false) => style('rounded border', { 'bg-primary-main': value });
1788
+
1789
+ const CheckboxWithError = JSX(({ className, text, value, key, disabled, error, onChange }) => (jsxs("div", { className: style('shrink-0', className), children: [jsx(Checkbox, { text: text, value: value, disabled: disabled, onChange: onChange }, key), renderErrorText(error)] })));
1790
+
1812
1791
  const ArmyIdFlgField = JSX(({ field }) => (jsx(CheckboxWithError, { text: "\u041D\u0430\u043B\u0438\u0447\u0438\u0435 \u0432\u043E\u0435\u043D\u043D\u043E\u0433\u043E \u0431\u0438\u043B\u0435\u0442\u0430", ...getValidation(field('armyIdFlg'), validatorObj.armyIdFlg) })));
1813
1792
 
1814
1793
  const BankEmpoleeField = JSX(({ field }) => (jsx(InputControl, { label: "\u0424\u0418\u041E \u0438\u043B\u0438 \u0434\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u0432\u0448\u0435\u0433\u043E \u0412\u0430\u0441 \u0441\u043E\u0442\u0440\u0443\u0434\u043D\u0438\u043A\u0430 \u0411\u0430\u043D\u043A\u0430", ...field('bankEmpolee') })));
@@ -1994,17 +1973,109 @@
1994
1973
  return (jsx(SelectField, { field: field, source: conscription, label: "\u0421\u0442\u0430\u0442\u0443\u0441 \u0432\u043E\u0435\u043D\u043D\u043E\u043E\u0431\u044F\u0437\u0430\u043D\u043D\u043E\u0433\u043E", fieldName: "conscription", input: input }));
1995
1974
  });
1996
1975
 
1997
- const ConsentAssignmentField = JSX(({ field, input }) => (jsx(CheckboxWithError, { text: "\u041F\u0440\u043E\u0447\u0438\u0435 \u0441\u043E\u0433\u043B\u0430\u0441\u0438\u044F (\u0441\u043E\u0433\u043B\u0430\u0441\u0438\u0435 \u043D\u0430 \u0443\u0441\u0442\u0443\u043F\u043A\u0443 \u043F\u0440\u0430\u0432 \u0442\u0440\u0435\u0431\u043E\u0432\u0430\u043D\u0438\u0439)", ...getValidation(field('consentAssignmentClaimsFlg'), validatorObj.consentAssignmentClaimsFlg, input?.required) })));
1976
+ const CONSENTS = {
1977
+ processPersonalDataLeadFlg: {
1978
+ text: 'Согласие на обработку персональных данных',
1979
+ docId: 4,
1980
+ },
1981
+ consentProviderFlg: {
1982
+ text: 'Согласие об использовании простой электронной подписи',
1983
+ docId: 5,
1984
+ },
1985
+ consentPfrFlg: {
1986
+ text: 'Согласие на запрос в ПФР',
1987
+ docId: 3,
1988
+ },
1989
+ consentPhotoFlg: {
1990
+ text: 'Прочие согласия (согласие на фотографирование)',
1991
+ docId: 1,
1992
+ },
1993
+ consentAssignmentClaimsFlg: {
1994
+ text: 'Прочие согласия (согласие на уступку прав требований)',
1995
+ docId: 1,
1996
+ },
1997
+ consentCollectionFlg: {
1998
+ text: 'Прочие согласия (согласие на взыскание по исполнительной надписи нотариуса)',
1999
+ docId: 1,
2000
+ },
2001
+ consentInformFlg: {
2002
+ text: 'Согласие на информирование о продуктах и услугах Банка',
2003
+ docId: 14,
2004
+ },
2005
+ consentToReceiveMaterials: {
2006
+ text: 'Согласен на получение информационных и аналитических материалов по электронной почте',
2007
+ },
2008
+ };
2009
+
2010
+ const CloseButton = JSX(({ className, onClose }) => (jsx("button", { className: style('flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none', className), onClick: onClose, title: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C", type: "button", children: jsx(Icon, { name: "CloseIcon", width: "20", height: "20", iconVersion: "gray" }) })));
1998
2011
 
1999
- const ConsentCollectionField = JSX(({ field, input }) => (jsx(CheckboxWithError, { text: "\u041F\u0440\u043E\u0447\u0438\u0435 \u0441\u043E\u0433\u043B\u0430\u0441\u0438\u044F (\u0441\u043E\u0433\u043B\u0430\u0441\u0438\u0435 \u043D\u0430 \u0432\u0437\u044B\u0441\u043A\u0430\u043D\u0438\u0435 \u043F\u043E \u0438\u0441\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0439 \u043D\u0430\u0434\u043F\u0438\u0441\u0438 \u043D\u043E\u0442\u0430\u0440\u0438\u0443\u0441\u0430)", ...getValidation(field('consentCollectionFlg'), validatorObj.consentCollectionFlg, input?.required) })));
2012
+ const Dialog = JSX(({ className, head, children, onClose, onClick }) => {
2013
+ const { close } = useDialogManager();
2014
+ const handleClose = useCallback(() => {
2015
+ close();
2016
+ onClose && onClose();
2017
+ }, [onClose]);
2018
+ return (jsxs("div", { onClick: onClick, className: style('relative min-h-full bg-white pt-0 p-lg', className), role: "dialog", children: [jsxs("div", { className: "sticky py-xl top-0 bg-white z-10", children: [jsx(CloseButton, { className: "absolute top-0 right-0", onClose: handleClose }), jsx("div", { className: "container", children: head })] }), jsx("div", { className: "container pb-6xl", children: children })] }));
2019
+ });
2000
2020
 
2001
- const ConsentInformField = JSX(({ field, input }) => (jsx(CheckboxWithError, { text: "\u0421\u043E\u0433\u043B\u0430\u0441\u0438\u0435 \u043D\u0430 \u0438\u043D\u0444\u043E\u0440\u043C\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435 \u043E \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0430\u0445 \u0438 \u0443\u0441\u043B\u0443\u0433\u0430\u0445 \u0411\u0430\u043D\u043A\u0430", ...getValidation(field('consentInformFlg'), validatorObj.consentInformFlg, input?.required) })));
2021
+ const getResponse = (response) => (isJSON(response) ? response.json() : response);
2022
+ const getAthorizationHeaders = () => {
2023
+ const token = sessionStorage.getItem('accessToken');
2024
+ return token ? { Authorization: `Bearer ${token}` } : null;
2025
+ };
2026
+ const isJSON = (response) => response.headers.get('Content-Type') === 'application/json';
2027
+ const request = async (url, method, body) => await fetch('https://retail-light-api.cprb.dev.rshbdev.ru/api/v1' + url, {
2028
+ method,
2029
+ headers: {
2030
+ 'Content-Type': 'application/json',
2031
+ ...getAthorizationHeaders(),
2032
+ },
2033
+ credentials: 'include',
2034
+ body: body ? JSON.stringify(body) : null,
2035
+ })
2036
+ .then((response) => {
2037
+ if (response.ok) {
2038
+ return getResponse(response);
2039
+ }
2040
+ else {
2041
+ throw response;
2042
+ }
2043
+ })
2044
+ .catch((error) => {
2045
+ throw error;
2046
+ });
2047
+ const saveToken = (data) => {
2048
+ sessionStorage.setItem('accessToken', data.access_token);
2049
+ sessionStorage.setItem('refreshToken', data.refresh_token);
2050
+ };
2051
+ const RETAIL_API = {
2052
+ CreateUserProfile: async (body) => await request('/public-data/createUserProfile', 'POST', body),
2053
+ UpdateUserProfile: async (body) => await request('/user-data/updateUserProfile', 'PUT', body),
2054
+ CreateDraftTask: async (body) => await request('/user-data/createDraftTask', 'POST', body),
2055
+ UpdateUserTask: async (body) => await request('/user-data/updateUserTask', 'PUT', body),
2056
+ SendCode: async (body) => await request('/sms/sendCode', 'POST', body),
2057
+ CheckCode: async (body) => await request('/sms/checkCode', 'POST', body).then(saveToken),
2058
+ CreateCaptcha: async (phoneNumber) => await request(`/sms/createCaptcha?phoneNumber=${phoneNumber}`, 'GET'),
2059
+ CheckCaptcha: async (body) => await request('/sms/checkCaptcha', 'POST', body),
2060
+ GetFileByID: async (id) => await request(`/feedback/file?id=${id}`, 'GET'),
2061
+ };
2002
2062
 
2003
- const ConsentPhotoFlg = JSX(({ field, input }) => (jsx(CheckboxWithError, { text: "\u041F\u0440\u043E\u0447\u0438\u0435 \u0441\u043E\u0433\u043B\u0430\u0441\u0438\u044F (\u0441\u043E\u0433\u043B\u0430\u0441\u0438\u0435 \u043D\u0430 \u0444\u043E\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435)", ...getValidation(field('consentPhotoFlg'), validatorObj.consentPhotoFlg, input?.required) })));
2063
+ const getDocument = async (id) => {
2064
+ const response = await RETAIL_API.GetFileByID(id);
2065
+ return URL.createObjectURL(await response.blob());
2066
+ };
2004
2067
 
2005
- const ConsentProviderField = JSX(({ field, input }) => (jsx(CheckboxWithError, { text: "\u0421\u043E\u0433\u043B\u0430\u0441\u0438\u0435 \u043E\u0431 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0438 \u043F\u0440\u043E\u0441\u0442\u043E\u0439 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0434\u043F\u0438\u0441\u0438", ...getValidation(field('consentProviderFlg'), validatorObj.consentProviderFlg, input?.required) })));
2068
+ const OPEN_DOC_BUTTON_TEXT = 'Ознакомиться';
2069
+ const CheckboxWithDoc = JSX(({ className, error, docId, ...props }) => {
2070
+ const { open } = useDialogManager();
2071
+ return (jsxs("div", { className: className, children: [jsxs("div", { className: "flex flex-wrap gap-x-m", children: [jsx(Checkbox, { ...props }), docId ? (jsx(LinkButton, { className: "text-primary-main", onClick: () => handleOpenDocument(docId, open), children: jsx(Text, { children: OPEN_DOC_BUTTON_TEXT }) })) : null] }), renderErrorText(error)] }));
2072
+ });
2073
+ const handleOpenDocument = async (id, open) => {
2074
+ const document = await getDocument(id);
2075
+ open(jsx(Dialog, { className: "my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0", children: jsx("iframe", { src: `${document}#toolbar=0`, className: "w-full h-[80vh]", id: "iframe-dialog" }) }));
2076
+ };
2006
2077
 
2007
- const ConsentToReceiveMaterialsField = JSX(({ field, input }) => (jsx(CheckboxWithError, { text: "\u0421\u043E\u0433\u043B\u0430\u0441\u0435\u043D \u043D\u0430 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u0435 \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0445 \u0438 \u0430\u043D\u0430\u043B\u0438\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u043E\u0432 \u043F\u043E \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u0435", ...getValidation(field('consentToReceiveMaterials'), validatorObj.consentToReceiveMaterials, input?.required) })));
2078
+ const ConsentField = JSX(({ field, input }) => input && input.name ? (jsx(CheckboxWithDoc, { text: CONSENTS[input.name]?.text, docId: CONSENTS[input.name]?.docId, ...getValidation(field(input.name), validatorObj[input.name], input?.required) })) : null);
2008
2079
 
2009
2080
  const DependentsField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0438\u0436\u0434\u0438\u0432\u0435\u043D\u0446\u0435\u0432", placeholder: "\u0417\u0430 \u0438\u0441\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435 \u0434\u0435\u0442\u0435\u0439 \u0434\u043E 18 \u043B\u0435\u0442", type: "number", ...getValidation(field('dependents'), validatorObj.dependents, input?.required), ...input })));
2010
2081
 
@@ -2097,11 +2168,9 @@
2097
2168
  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
2169
 
2099
2170
  const REGIONS_URL = '/api/v1/regions';
2100
- const EMPTY_REGIONS = [];
2101
- // TODO Почему url можно менять? Разве смысл не в инкапсуляции api url. Тоже под рефакторинг попадает
2102
2171
  function useRegions(url = REGIONS_URL) {
2103
2172
  const { data } = useAsyncData(url, fetchJSONUnsafe);
2104
- return Array.isArray(data) ? data : EMPTY_REGIONS;
2173
+ return Array.isArray(data) ? data : [];
2105
2174
  }
2106
2175
 
2107
2176
  const LocalitiesField = JSX(({ field, input }) => {
@@ -2183,8 +2252,6 @@
2183
2252
 
2184
2253
  const PosTerminalField = JSX(({ field }) => isAcquiringTrade(field('acquiringType')?.value?.key) ? (jsx(SlideCheckbox, { type: "radio", text: "\u0425\u043E\u0447\u0443 POS-\u0442\u0435\u0440\u043C\u0438\u043D\u0430\u043B", ...field('posTerminal') })) : null);
2185
2254
 
2186
- const ProcessPersonalDataField = JSX(({ field, input }) => (jsx(CheckboxWithError, { text: "\u0421\u043E\u0433\u043B\u0430\u0441\u0438\u0435 \u043D\u0430 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0443 \u043F\u0435\u0440\u0441\u043E\u043D\u0430\u043B\u044C\u043D\u044B\u0445 \u0434\u0430\u043D\u043D\u044B\u0445", ...getValidation(field('processPersonalDataLeadFlg'), validatorObj.processPersonalDataLeadFlg, input?.required) })));
2187
-
2188
2255
  const ProductField = UniBlock(({ field, source }) => (jsx(SelectControl, { placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043F\u0440\u043E\u0434\u0443\u043A\u0442", label: "\u041F\u0440\u043E\u0434\u0443\u043A\u0442", options: arrayToOptions(source?.productList), ...withValidator(field('product'), validatorObj.product) })));
2189
2256
  const arrayToOptions = (array) => (array ?? []).map((_) => ({ key: _, value: _ }));
2190
2257
 
@@ -2339,15 +2406,15 @@
2339
2406
  serviceDirection: jsx(ServiceDirectionField, { field: field, input: input }),
2340
2407
  bankEmpolee: jsx(BankEmpoleeField, { field: field }),
2341
2408
  secondaryPhone: jsx(SecondaryPhoneField, { field: field }),
2342
- consentToReceiveMaterials: jsx(ConsentToReceiveMaterialsField, { field: field, input: input }),
2343
- processPersonalDataLeadFlg: jsx(ProcessPersonalDataField, { field: field, input: input }),
2344
- consentProviderFlg: jsx(ConsentProviderField, { field: field, input: input }),
2345
- consentPhotoFlg: jsx(ConsentPhotoFlg, { field: field, input: input }),
2346
- consentAssignmentClaimsFlg: jsx(ConsentAssignmentField, { field: field, input: input }),
2347
- consentCollectionFlg: jsx(ConsentCollectionField, { field: field, input: input }),
2348
- consentInformFlg: jsx(ConsentInformField, { field: field, input: input }),
2409
+ consentToReceiveMaterials: jsx(ConsentField, { field: field, input: input }),
2410
+ processPersonalDataLeadFlg: jsx(ConsentField, { field: field, input: input }),
2411
+ consentProviderFlg: jsx(ConsentField, { field: field, input: input }),
2412
+ consentPhotoFlg: jsx(ConsentField, { field: field, input: input }),
2413
+ consentAssignmentClaimsFlg: jsx(ConsentField, { field: field, input: input }),
2414
+ consentCollectionFlg: jsx(ConsentField, { field: field, input: input }),
2415
+ consentInformFlg: jsx(ConsentField, { field: field, input: input }),
2416
+ consentPfrFlg: jsx(ConsentField, { field: field, input: input }),
2349
2417
  applicationDate: (jsx(InputControl, { label: "\u0414\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u044F \u0432 \u0411\u0430\u043D\u043A", ...field('applicationDate') })),
2350
- consentPfrFlg: (jsx(CheckboxWithError, { text: "\u0421\u043E\u0433\u043B\u0430\u0441\u0438\u0435 \u043D\u0430 \u0437\u0430\u043F\u0440\u043E\u0441 \u0432 \u041F\u0424\u0420", ...field('consentPfrFlg') })),
2351
2418
  region: isPremium ? (jsx(RegionPremiumField, { field: field })) : (jsx(RegionField, { field: field, input: input, url: getRegionUrl(typeForm) })),
2352
2419
  education: jsx(EducationField, { field: field, input: input }),
2353
2420
  housing: jsx(HousingField, { field: field, input: input }),
@@ -2359,7 +2426,6 @@
2359
2426
  positionOrganization: jsx(PositionOrganizationField, { field: field, input: input }),
2360
2427
  familyStatus: jsx(FamilyStatusField, { field: field, input: input }),
2361
2428
  children: jsx(ChildrenField, { field: field, input: input }),
2362
- // eslint-disable-next-line max-lines
2363
2429
  familyMembers: jsx(FamilyMembersField, { field: field, input: input }),
2364
2430
  dependents: jsx(DependentsField, { field: field, input: input }),
2365
2431
  totalIncome: jsx(TotalIncomeField, { field: field, input: input }),
@@ -2369,6 +2435,7 @@
2369
2435
  armyIdFlg: jsx(ArmyIdFlgField, { field: field, input: input }),
2370
2436
  dulSerie: jsx(DulSerieField, { field: field, input: input }),
2371
2437
  dulNumber: jsx(DulNumberField, { field: field, input: input }),
2438
+ // eslint-disable-next-line max-lines
2372
2439
  dulIssueDateField: jsx(DulIssueDateField, { field: field, input: input }),
2373
2440
  dulSubdivisionCode: jsx(DulSubdivisionCodeField, { field: field, input: input }),
2374
2441
  dulIssuedBy: jsx(DulIssuedByField, { field: field, input: input }),
@@ -2414,17 +2481,6 @@
2414
2481
  : '', className), type: type, role: role, onClick: onClick, children: children }));
2415
2482
  });
2416
2483
 
2417
- const CloseButton = JSX(({ className, onClose }) => (jsx("button", { className: style('flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none', className), onClick: onClose, title: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C", type: "button", children: jsx(Icon, { name: "CloseIcon", width: "20", height: "20", iconVersion: "gray" }) })));
2418
-
2419
- const Dialog = JSX(({ className, head, children, onClose, onClick }) => {
2420
- const { close } = useDialogManager();
2421
- const handleClose = useCallback(() => {
2422
- close();
2423
- onClose && onClose();
2424
- }, [onClose]);
2425
- return (jsxs("div", { onClick: onClick, className: style('relative min-h-full bg-white pt-0 p-lg', className), role: "dialog", children: [jsxs("div", { className: "sticky py-xl top-0 bg-white z-10", children: [jsx(CloseButton, { className: "absolute top-0 right-0", onClose: handleClose }), jsx("div", { className: "container", children: head })] }), jsx("div", { className: "container pb-6xl", children: children })] }));
2426
- });
2427
-
2428
2484
  const ResponseTypeDialog = JSX(function ({ responseType, typeForm, }) {
2429
2485
  const responseOK = responseType === 'OK';
2430
2486
  const statusIcon = responseOK ? 'ResponseOKIcon' : 'ResponseFailIcon';
@@ -2585,17 +2641,6 @@
2585
2641
  return [storedValue, setValue];
2586
2642
  }
2587
2643
 
2588
- const CONSENTS = [
2589
- 'processPersonalDataLeadFlg',
2590
- 'consentProviderFlg',
2591
- 'consentPfrFlg',
2592
- 'consentPhotoFlg',
2593
- 'consentAssignmentClaimsFlg',
2594
- 'consentCollectionFlg',
2595
- 'consentInformFlg',
2596
- 'consentToReceiveMaterials',
2597
- ];
2598
-
2599
2644
  const initialFormState = {
2600
2645
  typeForm: '',
2601
2646
  region: { key: '', text: '' },
@@ -2643,14 +2688,6 @@
2643
2688
  return { ...formState, typeForm: { key: typeForm, text: '' } };
2644
2689
  };
2645
2690
 
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
2691
  const Foldable = JSX(({ className = '', isFoldButtonOnTop = false, unfoldedByDefault = false, renderFoldableSection, renderFoldButton, }) => {
2655
2692
  const [isUnfolded, setIsUnfolded] = useState(unfoldedByDefault);
2656
2693
  const onToggle = useCallback(() => {
@@ -2658,7 +2695,7 @@
2658
2695
  }, []);
2659
2696
  const sectionNode = renderFoldableSection({ isUnfolded, onToggle });
2660
2697
  const buttonNode = renderFoldButton ? renderFoldButton({ isUnfolded, onToggle }) : null;
2661
- return isFoldButtonOnTop ? (jsxs(FoldableWrapper, { className: className, children: [buttonNode, sectionNode] })) : (jsxs(FoldableWrapper, { className: className, children: [sectionNode, buttonNode] }));
2698
+ return isFoldButtonOnTop ? (jsxs("div", { className: className, role: "group", children: [buttonNode, sectionNode] })) : (jsxs("div", { className: className, role: "group", children: [sectionNode, buttonNode] }));
2662
2699
  });
2663
2700
 
2664
2701
  function useResizeObserver(callback, deps) {
@@ -2704,53 +2741,12 @@
2704
2741
  const hasValidationErrors = useMemo(() => inputs
2705
2742
  ?.filter((_) => _.required)
2706
2743
  ?.some((_) => Boolean(withValidator(field(_?.name), validatorObj[_?.name]).error)), [inputs]);
2707
- return (jsx("div", { className: "w-fit", children: jsx(Foldable, { isFoldButtonOnTop: true, renderFoldableSection: ({ isUnfolded }) => (jsx(FoldableSection, { isUnfolded: isUnfolded, className: "flex flex-col pl-2xl", children: inputs.map(getField(field, typeForm)) })), renderFoldButton: renderGeneralCheckbox(jsxs("div", { children: [jsx(Checkbox, { value: isChecked, onChange: handleGeneralToggle, text: CONSENT_ALL_DOCS_TEXT }, key), renderErrorText(hasValidationErrors ? CONSENT_REQUIRED : '')] })) }) }));
2744
+ return (jsx("div", { className: "w-fit", children: jsx(Foldable, { isFoldButtonOnTop: true, unfoldedByDefault: true, renderFoldableSection: ({ isUnfolded }) => (jsx(FoldableSection, { isUnfolded: isUnfolded, className: "flex flex-col pl-2xl", children: inputs.map(getField(field, typeForm)) })), renderFoldButton: renderGeneralCheckbox(jsxs("div", { children: [jsx(Checkbox, { value: isChecked, onChange: handleGeneralToggle, text: CONSENT_ALL_DOCS_TEXT }, key), renderErrorText(hasValidationErrors ? CONSENT_REQUIRED : '')] })) }) }));
2708
2745
  });
2709
2746
  const renderGeneralCheckbox = (generalCheckBox) => (foldableData) => (jsxs("div", { className: "flex items-start", children: [generalCheckBox, jsx("button", { onClick: foldableData.onToggle, className: "px-m py-2xs", children: jsx(Icon, { className: "text-primary-text", name: foldableData.isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16" }) })] }));
2710
2747
 
2711
2748
  const renderSubmitButton = (button, className) => (jsx(Button, { className: style('w-full @xl:w-auto', className), type: "submit", children: button?.text ? button.text : 'Отправить заявку' }));
2712
2749
 
2713
- const getResponse = (response) => (isJSON(response) ? response.json() : response);
2714
- const getAthorizationHeaders = () => {
2715
- const token = sessionStorage.getItem('accessToken');
2716
- return token ? { Authorization: `Bearer ${token}` } : null;
2717
- };
2718
- const isJSON = (response) => response.headers.get('Content-Type') === 'application/json';
2719
- const request = async (url, method, body) => await fetch('https://retail-light-api.cprb.dev.rshbdev.ru/api/v1' + url, {
2720
- method,
2721
- headers: {
2722
- 'Content-Type': 'application/json',
2723
- ...getAthorizationHeaders(),
2724
- },
2725
- credentials: 'include',
2726
- body: body ? JSON.stringify(body) : null,
2727
- })
2728
- .then((response) => {
2729
- if (response.ok) {
2730
- return getResponse(response);
2731
- }
2732
- else {
2733
- throw response;
2734
- }
2735
- })
2736
- .catch((error) => {
2737
- throw error;
2738
- });
2739
- const saveToken = (data) => {
2740
- sessionStorage.setItem('accessToken', data.access_token);
2741
- sessionStorage.setItem('refreshToken', data.refresh_token);
2742
- };
2743
- const RETAIL_API = {
2744
- CreateUserProfile: async (body) => await request('/public-data/createUserProfile', 'POST', body),
2745
- UpdateUserProfile: async (body) => await request('/user-data/updateUserProfile', 'PUT', body),
2746
- CreateDraftTask: async (body) => await request('/user-data/createDraftTask', 'POST', body),
2747
- UpdateUserTask: async (body) => await request('/user-data/updateUserTask', 'PUT', body),
2748
- SendCode: async (body) => await request('/sms/sendCode', 'POST', body),
2749
- CheckCode: async (body) => await request('/sms/checkCode', 'POST', body).then(saveToken),
2750
- CreateCaptcha: async (phoneNumber) => await request(`/sms/createCaptcha?phoneNumber=${phoneNumber}`, 'GET'),
2751
- CheckCaptcha: async (body) => await request('/sms/checkCaptcha', 'POST', body),
2752
- };
2753
-
2754
2750
  const getUpdateUserProfileData = (profileId, formData) => {
2755
2751
  const { name = '', surname = '', middleName = '', birthday = '', phone = '', email = '', processPersonalDataLeadFlg, consentProviderFlg, consentPfrFlg, consentPhotoFlg, consentAssignmentClaimsFlg, consentCollectionFlg, consentInformFlg, } = formData;
2756
2752
  return {
@@ -3084,10 +3080,13 @@
3084
3080
  setResponseStatus('Fail');
3085
3081
  }
3086
3082
  };
3083
+ const acceptedConsents = Object.keys(CONSENTS)
3084
+ .filter((_) => formData[_])
3085
+ .map((_) => CONSENTS[_]);
3087
3086
  // eslint-disable-next-line react-hooks/rules-of-hooks
3088
3087
  const verifyPhoneDialog = useVerifyPhoneDialog({
3089
3088
  close: handleSuccessVerify,
3090
- ...verifyPhoneContent(formData?.phone),
3089
+ ...verifyPhoneContent(formData?.phone, acceptedConsents),
3091
3090
  });
3092
3091
  verifyPhoneDialog.open();
3093
3092
  }
@@ -3101,17 +3100,14 @@
3101
3100
  responseStatus,
3102
3101
  };
3103
3102
  };
3104
- const verifyPhoneContent = (phone) => ({
3103
+ const verifyPhoneContent = (phone, consents) => ({
3105
3104
  title: 'Подтвердите номер телефона',
3106
3105
  description: `Мы отправили код на ${phone}`,
3107
3106
  phoneNumber: formatPhone(phone),
3108
3107
  textButton: 'Оформить',
3109
- __html: `<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>
3110
- <ul><li>соглашение о порядке использования простой электронной подписи,
3111
- </li><li>согласие на обработку персональных данных,
3112
- </li><li>предоставление и подписание прочих согласий Банка,
3113
- </li><li>согласие на запрос в ПФР</li></ul>`,
3108
+ __html: `<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>${consentsToList(consents)}`,
3114
3109
  });
3110
+ const consentsToList = (consents) => `<ul>${consents?.map((_) => '<li>' + _ + '</li>').join('')}</ul>`;
3115
3111
 
3116
3112
  const useInitApplicationLead = () => {
3117
3113
  useEffect(() => {
@@ -3149,8 +3145,8 @@
3149
3145
  return consentInputs.length > 2 ? (jsxs("div", { children: [restInputs.map(getField(field, typeForm)), jsx(GroupedConsents, { inputs: consentInputs, field: field })] })) : ((inputs || [])?.map(getField(field, typeForm)));
3150
3146
  };
3151
3147
  const splitInputs = (inputs) => ({
3152
- consentInputs: inputs?.filter((_) => CONSENTS.includes(_.name)) || [],
3153
- restInputs: inputs?.filter((_) => !CONSENTS.includes(_.name)) || [],
3148
+ consentInputs: inputs?.filter((_) => Object.keys(CONSENTS).includes(_.name)) || [],
3149
+ restInputs: inputs?.filter((_) => !Object.keys(CONSENTS).includes(_.name)) || [],
3154
3150
  });
3155
3151
 
3156
3152
  const NotFound = JSX(({ title, description }) => {
@@ -4747,37 +4743,31 @@
4747
4743
  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
4744
  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
4745
 
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
4746
  const renderCardInfo = (cell, i) => {
4757
4747
  const { title, description, buttons } = cell;
4758
4748
  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
4749
  };
4760
4750
 
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
- });
4751
+ const CarouselTariffsCard = JSX(({ className = '', title, align = 'text-center', icon, button, visibleCellsCount = 1, cardCells = [], options, data, ...rest }) => {
4752
+ const cellsNode = cardCells.map(renderCardInfo);
4753
+ const [visibleCells, hiddenCells] = visibleCellsCount > 0
4754
+ ? [cellsNode.slice(0, visibleCellsCount), cellsNode.slice(visibleCellsCount)]
4755
+ : [cellsNode, []];
4756
+ const [isVisible, setIsVisible] = useState(false);
4757
+ useEffect(() => defaultEventBus.subscribe('fold', (event) => {
4758
+ if (options?.parent !== undefined && event.parent === options?.parent) {
4759
+ setIsVisible(event.isUnfolded);
4760
+ }
4761
+ }), [options?.parent]);
4762
+ 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
4763
+ ? renderFoldButton$3(options?.parent, data, isVisible)
4764
+ : null })) : (jsx("div", { children: visibleCells }))] }));
4765
+ });
4766
+ 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: () => {
4767
+ if (parent !== undefined) {
4768
+ defaultEventBus.fire('fold', { type: 'fold', isUnfolded: !isUnfolded, parent });
4769
+ }
4770
+ }, 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
4771
 
4782
4772
  const isRateRow = (rateRow) => typeof rateRow?.minMonths === 'number' && typeof rateRow?.maxMonths === 'number';
4783
4773
 
@@ -4944,46 +4934,47 @@
4944
4934
  };
4945
4935
  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
4936
 
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
- }
4937
+ const useLatestEvent = (eventBus, type, initialEvent) => {
4938
+ const [latestEvent, setLatestEvent] = useState(initialEvent || null);
4939
+ useEffect(() => eventBus.subscribe(type, (_) => setLatestEvent(_)), [eventBus, type]);
4940
+ const fireEvent = useCallback((_) => eventBus.fire(type, _), [eventBus, type]);
4941
+ return [latestEvent, fireEvent];
4942
+ };
4959
4943
 
4960
4944
  const REGION_URL = '/api/v1/region';
4961
4945
  const LOCATION_STORAGE_KEY = 'location';
4962
4946
  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
4947
+ const [currentLocation, fireCurrentLocation] = useLatestEvent(defaultEventBus, 'location', restoreLocation() ?? { name: defaultLocation });
4948
+ const selectCurrentLocation = useCallback((_) => {
4949
+ storeLocation(_);
4950
+ fireCurrentLocation(_);
4951
+ }, []);
4952
+ const { data } = useAsyncData(hasStoredLocation() ? null : REGION_URL, fetchJSONUnsafe);
4953
+ useEffect(() => {
4954
+ if (data && !hasStoredLocation()) {
4955
+ fireCurrentLocation(data);
4980
4956
  }
4981
- return { name: defaultLocation };
4982
- };
4983
- }
4984
- function storeLocation(_) {
4985
- _ && globalThis.localStorage?.setItem(LOCATION_STORAGE_KEY, JSON.stringify(_));
4957
+ }, [data]);
4958
+ return [currentLocation ?? { name: defaultLocation }, selectCurrentLocation];
4986
4959
  }
4960
+ const hasStoredLocation = () => Boolean(globalThis.localStorage?.getItem(LOCATION_STORAGE_KEY));
4961
+ const restoreLocation = () => {
4962
+ try {
4963
+ const data = globalThis.localStorage?.getItem(LOCATION_STORAGE_KEY);
4964
+ return data && JSON.parse(data);
4965
+ }
4966
+ catch (ex) {
4967
+ return null;
4968
+ }
4969
+ };
4970
+ const storeLocation = (_) => {
4971
+ try {
4972
+ globalThis.localStorage?.setItem(LOCATION_STORAGE_KEY, JSON.stringify(_));
4973
+ }
4974
+ catch (ex) {
4975
+ // Do nothing
4976
+ }
4977
+ };
4987
4978
 
4988
4979
  var Currency;
4989
4980
  (function (Currency) {
@@ -5125,7 +5116,7 @@
5125
5116
  }
5126
5117
 
5127
5118
  const ExchangeRateTile = JSX(({ className = '', title = 'Курсы обмена валют', button, ...rest }) => {
5128
- const currentLocation = useLocationState();
5119
+ const [currentLocation] = useLocation();
5129
5120
  const exchangeRates = useFetchExchangeRateData(currentLocation);
5130
5121
  const currencyRates = getCurrencyRates(exchangeRates?.exchangeRate?.currencies);
5131
5122
  const currencyRatesBuy = currencyRates.filter((_) => _.buyExchangeRate);
@@ -5978,7 +5969,7 @@
5978
5969
  designDisabledPeople: (item) => Boolean(item.designDisabledPeople),
5979
5970
  };
5980
5971
  const AtmsMap = JSX(({ descriptionData, className }) => {
5981
- const currentLocation = useLocationState();
5972
+ const [currentLocation] = useLocation();
5982
5973
  const regionCode = currentLocation?.code ?? '000';
5983
5974
  const { data: officesData, isLoad } = useAtms(regionCode);
5984
5975
  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 +6188,7 @@
6197
6188
  };
6198
6189
 
6199
6190
  const OfficesMap = JSX(({ className }) => {
6200
- const currentLocation = useLocationState();
6191
+ const [currentLocation] = useLocation();
6201
6192
  const regionCode = currentLocation?.code ?? '000';
6202
6193
  const { data, isLoad } = useOffices(regionCode);
6203
6194
  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 +6436,7 @@
6445
6436
  onClose && onClose(dialogs[dialogs.length - 1]);
6446
6437
  pop();
6447
6438
  }, [dialogs, onClose]);
6448
- useEffect(() => defaultEventBus.observable.subscribe('dialog', (action) => {
6439
+ useEffect(() => defaultEventBus.subscribe('dialog', (action) => {
6449
6440
  switch (action.type) {
6450
6441
  case 'open':
6451
6442
  push(action);
@@ -6554,33 +6545,27 @@
6554
6545
  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
6546
  });
6556
6547
 
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
6548
  const SEARCH_TERM_MIN_LENGTH = 3;
6565
6549
  const LocationDialog = JSX(({ foreignOffices, branches }) => {
6566
- const selectLocation = useLocation(branches?.default);
6550
+ const [currentLocation, selectCurrentLocation] = useLocation(branches?.default);
6551
+ const link = useLink();
6552
+ const { href } = link({ href: `/branches/${currentLocation.slug}` });
6567
6553
  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]);
6554
+ const regions = cleanUpRegions(useRegions()).sort((a, b) => a.name.localeCompare(b.name));
6555
+ const regionsGroupByLetter = groupBy(regions, regionFirstLetter);
6571
6556
  const { close } = useDialogManager();
6572
6557
  const handleChangeLocation = useCallback((region) => {
6573
- selectLocation(region);
6558
+ selectCurrentLocation(region);
6574
6559
  close();
6575
6560
  }, []);
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
6561
+ 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
6562
  .filter(({ name }) => name && jaroWinklerDistance(name.toLowerCase())(query.toLowerCase()) >= 0.8)
6578
6563
  .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
6564
  });
6580
- const regionFirstLetter = (region) => region.name?.charAt(0) ?? '';
6565
+ const regionFirstLetter = (region) => region.name?.charAt(0) || '';
6581
6566
  const cleanUpRegions = (regions) => regions.map((region) => ({
6582
6567
  ...region,
6583
- name: region.name?.replace(/республика|область|край'/gi, '').trim() ?? '',
6568
+ name: region.name?.replace(/республика|область|край'/gi, '').trim() || '',
6584
6569
  }));
6585
6570
 
6586
6571
  const useLocationDialog = (props) => {
@@ -6593,7 +6578,7 @@
6593
6578
 
6594
6579
  const BurgerMenuDialog = JSX(({ menuRef, menuItem, locationDialogProps, closeAll }) => {
6595
6580
  const locationDialog = useLocationDialog(locationDialogProps || {});
6596
- const { name: location } = useLocationState();
6581
+ const [{ name: location }] = useLocation();
6597
6582
  const menuDimensions = menuRef?.current?.getBoundingClientRect();
6598
6583
  const basePath = getBasePath(env.SITE_URL);
6599
6584
  const handleIframeLoad = () => {
@@ -7153,7 +7138,7 @@
7153
7138
  const close = useCallback(() => {
7154
7139
  setPopup(null);
7155
7140
  }, []);
7156
- useEffect(() => defaultEventBus.observable.subscribe('popup', (action) => {
7141
+ useEffect(() => defaultEventBus.subscribe('popup', (action) => {
7157
7142
  switch (action.type) {
7158
7143
  case 'open':
7159
7144
  case 'update':
@@ -7208,7 +7193,7 @@
7208
7193
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
7209
7194
  });
7210
7195
 
7211
- const packageVersion = "0.14.599";
7196
+ const packageVersion = "0.14.601";
7212
7197
 
7213
7198
  exports.Blocks = Blocks;
7214
7199
  exports.ContentPage = ContentPage;