@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
@@ -403,58 +403,39 @@
403
403
  ].join(' ');
404
404
 
405
405
  class EventBus {
406
- subscribersMap = {};
406
+ subscribers = {};
407
407
  subjectsStateMap = {};
408
- emitter = this;
409
- observable = this;
410
408
  subscribe(type, listener) {
411
- this.subscribersMap[type] ||= [];
412
- this.subscribersMap[type]?.push(listener);
413
- this.fireSubscribers([listener], this.subjectsStateMap[type]);
409
+ this.subscribers[type] = (this.subscribers[type] || []).concat(listener);
410
+ const latestEvent = this.subjectsStateMap[type];
411
+ if (latestEvent) {
412
+ listener(latestEvent);
413
+ }
414
414
  return () => {
415
415
  this.unsubscribe(type, listener);
416
416
  };
417
417
  }
418
418
  unsubscribe(type, listener) {
419
- const index = this.subscribersMap[type]?.indexOf(listener);
420
- if (index && index !== -1) {
421
- this.subscribersMap[type]?.splice(index, 1);
422
- }
419
+ this.subscribers[type] = this.subscribers[type]?.filter((s) => s !== listener);
423
420
  }
424
421
  fire(type, event) {
425
422
  const isSubjectDeclared = type in this.subjectsStateMap;
426
423
  if (isSubjectDeclared) {
427
- this.subject(type, event);
428
- }
429
- else {
430
- this.fireSubscribers(this.subscribersMap[type], event);
431
- }
432
- }
433
- subject(type, event) {
434
- if (this.subjectsStateMap[type] !== event) {
435
424
  this.subjectsStateMap[type] = event;
436
- this.fireSubscribers(this.subscribersMap[type], event);
437
425
  }
438
- return () => {
439
- delete this.subjectsStateMap[type];
440
- };
426
+ this.subscribers[type]?.forEach((s) => s(event));
441
427
  }
442
- fireSubscribers(subscribers, event) {
443
- if (!subscribers || !event) {
444
- return;
445
- }
446
- for (const _ of subscribers) {
447
- _(event);
448
- }
428
+ subject(type, event) {
429
+ this.subjectsStateMap[type] = event;
449
430
  }
450
431
  }
451
432
 
452
433
  const defaultEventBus = new EventBus();
453
434
 
454
435
  const useDialogManager = () => ({
455
- open: (dialog, options = {}) => defaultEventBus.emitter.fire('dialog', { type: 'open', dialog, ...options }),
456
- close: () => defaultEventBus.emitter.fire('dialog', { type: 'close' }),
457
- closeAll: () => defaultEventBus.emitter.fire('dialog', { type: 'close', all: true }),
436
+ open: (dialog, options = {}) => defaultEventBus.fire('dialog', { type: 'open', dialog, ...options }),
437
+ close: () => defaultEventBus.fire('dialog', { type: 'close' }),
438
+ closeAll: () => defaultEventBus.fire('dialog', { type: 'close', all: true }),
458
439
  });
459
440
 
460
441
  const adjustBase = (href, basePath = '') => href.replace(basePath, '') || '/';
@@ -1109,48 +1090,10 @@
1109
1090
  { key: 'phone', text: 'Телефонный звонок' },
1110
1091
  { key: 'email', text: 'Электронное сообщение' },
1111
1092
  ];
1112
- // TODO Тоже надо рефакторить - файлик constants
1113
1093
  const OUT_SERVICE_URL = '/api/v1/outservice/outserviceregions';
1114
1094
 
1115
1095
  const getRegionUrl = (typeForm) => typeForm === 'OUTSERVICE' ? OUT_SERVICE_URL : undefined;
1116
1096
 
1117
- const renderErrorText = (error) => (jsx("div", { className: "h-6", children: error ? (jsx(Text, { size: "text-xs", font: "font-light", color: "text-error", children: error })) : null }));
1118
-
1119
- const SVG = JSX(({ className, viewBox, fill = 'none', width, height, paths, ...commonOptions }) => {
1120
- 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) => {
1121
- const resultOptions = { ...commonOptions, ...options };
1122
- return (jsx("path", { d: d, fill: pathFill || 'currentColor', stroke: resultOptions.stroke, strokeLinecap: resultOptions.strokeLinecap, strokeLinejoin: resultOptions.strokeLinejoin, strokeWidth: resultOptions.strokeWidth, strokeMiterlimit: resultOptions.strokeMiterlimit }, i));
1123
- }) }));
1124
- });
1125
-
1126
- const defaultCheckStyle = 'appearance-none w-5 h-5 border-solid flex-none';
1127
-
1128
- const CHECK_PATHS = [
1129
- {
1130
- 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',
1131
- fillRule: 'evenodd',
1132
- clipRule: 'evenodd',
1133
- fill: 'white',
1134
- },
1135
- ];
1136
- const Checkbox = JSX(({ className, value, text, disabled, isRadio, onChange }) => {
1137
- const handleChange = useCallback((e) => {
1138
- if (disabled) {
1139
- return;
1140
- }
1141
- e.preventDefault();
1142
- onChange && onChange(!value);
1143
- }, [onChange, disabled, value]);
1144
- 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" }));
1145
- 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$2(text)] }) }));
1146
- });
1147
- const renderText$2 = (text) => text ? (jsx("div", { className: "ml-s", children: jsx(Text, { size: "text-l", font: "font-light", children: text }) })) : null;
1148
- const getCursorStyle = (disabled = false) => (disabled ? 'cursor-not-allowed' : 'cursor-pointer');
1149
- const role = (isRadio = false) => (isRadio ? 'radio' : 'checkbox');
1150
- const checkboxStyle = (value = false) => style('rounded border', { 'bg-primary-main': value });
1151
-
1152
- 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)] })));
1153
-
1154
1097
  function useBool(defaultValue = false) {
1155
1098
  const [value, setValue] = useState(defaultValue);
1156
1099
  const setTrue = useCallback(() => setValue(true), []);
@@ -1212,6 +1155,8 @@
1212
1155
  const getValidStyle = (valid) => (valid ? inputValidStyle : 'border-error');
1213
1156
  const defaultStyle$1 = 'w-full border rounded-md text-primary-text outline-none p-m';
1214
1157
 
1158
+ const renderErrorText = (error) => (jsx("div", { className: "h-6", children: error ? (jsx(Text, { size: "text-xs", font: "font-light", color: "text-error", children: error })) : null }));
1159
+
1215
1160
  const DEFAULT_HINTS_COUNT = 10;
1216
1161
  const defaultResponseItemHandler = (item) => item?.value || '';
1217
1162
  const getResponseHandler = (itemHandler) => (response) => {
@@ -1316,9 +1261,9 @@
1316
1261
  };
1317
1262
 
1318
1263
  const usePopupManager = () => ({
1319
- open: (popup, options) => defaultEventBus.emitter.fire('popup', { type: 'open', popup, ...options }),
1320
- update: (popup, options) => defaultEventBus.emitter.fire('popup', { type: 'update', popup, ...options }),
1321
- close: () => defaultEventBus.emitter.fire('popup', { type: 'close' }),
1264
+ open: (popup, options) => defaultEventBus.fire('popup', { type: 'open', popup, ...options }),
1265
+ update: (popup, options) => defaultEventBus.fire('popup', { type: 'update', popup, ...options }),
1266
+ close: () => defaultEventBus.fire('popup', { type: 'close' }),
1322
1267
  });
1323
1268
 
1324
1269
  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()))) })));
@@ -1587,7 +1532,6 @@
1587
1532
  };
1588
1533
  };
1589
1534
 
1590
- // TODO Зачем это?
1591
1535
  const getValidation = (field, validator, required = false) => required ? withValidator(field, validator) : field;
1592
1536
 
1593
1537
  const ACQUIRING_TYPES = [
@@ -1801,6 +1745,41 @@
1801
1745
 
1802
1746
  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) })));
1803
1747
 
1748
+ const SVG = JSX(({ className, viewBox, fill = 'none', width, height, paths, ...commonOptions }) => {
1749
+ 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) => {
1750
+ const resultOptions = { ...commonOptions, ...options };
1751
+ return (jsx("path", { d: d, fill: pathFill || 'currentColor', stroke: resultOptions.stroke, strokeLinecap: resultOptions.strokeLinecap, strokeLinejoin: resultOptions.strokeLinejoin, strokeWidth: resultOptions.strokeWidth, strokeMiterlimit: resultOptions.strokeMiterlimit }, i));
1752
+ }) }));
1753
+ });
1754
+
1755
+ const defaultCheckStyle = 'appearance-none w-5 h-5 border-solid flex-none';
1756
+
1757
+ const CHECK_PATHS = [
1758
+ {
1759
+ 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',
1760
+ fillRule: 'evenodd',
1761
+ clipRule: 'evenodd',
1762
+ fill: 'white',
1763
+ },
1764
+ ];
1765
+ const Checkbox = JSX(({ className, value, text, disabled, isRadio, onChange }) => {
1766
+ const handleChange = useCallback((e) => {
1767
+ if (disabled) {
1768
+ return;
1769
+ }
1770
+ e.preventDefault();
1771
+ onChange && onChange(!value);
1772
+ }, [onChange, disabled, value]);
1773
+ 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" }));
1774
+ 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$2(text)] }) }));
1775
+ });
1776
+ const renderText$2 = (text) => text ? (jsx("div", { className: "ml-s", children: jsx(Text, { size: "text-l", font: "font-light", children: text }) })) : null;
1777
+ const getCursorStyle = (disabled = false) => (disabled ? 'cursor-not-allowed' : 'cursor-pointer');
1778
+ const role = (isRadio = false) => (isRadio ? 'radio' : 'checkbox');
1779
+ const checkboxStyle = (value = false) => style('rounded border', { 'bg-primary-main': value });
1780
+
1781
+ 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)] })));
1782
+
1804
1783
  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) })));
1805
1784
 
1806
1785
  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') })));
@@ -1986,17 +1965,109 @@
1986
1965
  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 }));
1987
1966
  });
1988
1967
 
1989
- 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) })));
1968
+ const CONSENTS = {
1969
+ processPersonalDataLeadFlg: {
1970
+ text: 'Согласие на обработку персональных данных',
1971
+ docId: 4,
1972
+ },
1973
+ consentProviderFlg: {
1974
+ text: 'Согласие об использовании простой электронной подписи',
1975
+ docId: 5,
1976
+ },
1977
+ consentPfrFlg: {
1978
+ text: 'Согласие на запрос в ПФР',
1979
+ docId: 3,
1980
+ },
1981
+ consentPhotoFlg: {
1982
+ text: 'Прочие согласия (согласие на фотографирование)',
1983
+ docId: 1,
1984
+ },
1985
+ consentAssignmentClaimsFlg: {
1986
+ text: 'Прочие согласия (согласие на уступку прав требований)',
1987
+ docId: 1,
1988
+ },
1989
+ consentCollectionFlg: {
1990
+ text: 'Прочие согласия (согласие на взыскание по исполнительной надписи нотариуса)',
1991
+ docId: 1,
1992
+ },
1993
+ consentInformFlg: {
1994
+ text: 'Согласие на информирование о продуктах и услугах Банка',
1995
+ docId: 14,
1996
+ },
1997
+ consentToReceiveMaterials: {
1998
+ text: 'Согласен на получение информационных и аналитических материалов по электронной почте',
1999
+ },
2000
+ };
2001
+
2002
+ 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" }) })));
1990
2003
 
1991
- 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) })));
2004
+ const Dialog = JSX(({ className, head, children, onClose, onClick }) => {
2005
+ const { close } = useDialogManager();
2006
+ const handleClose = useCallback(() => {
2007
+ close();
2008
+ onClose && onClose();
2009
+ }, [onClose]);
2010
+ 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 })] }));
2011
+ });
1992
2012
 
1993
- 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) })));
2013
+ const getResponse = (response) => (isJSON(response) ? response.json() : response);
2014
+ const getAthorizationHeaders = () => {
2015
+ const token = sessionStorage.getItem('accessToken');
2016
+ return token ? { Authorization: `Bearer ${token}` } : null;
2017
+ };
2018
+ const isJSON = (response) => response.headers.get('Content-Type') === 'application/json';
2019
+ const request = async (url, method, body) => await fetch('https://retail-light-api.cprb.dev.rshbdev.ru/api/v1' + url, {
2020
+ method,
2021
+ headers: {
2022
+ 'Content-Type': 'application/json',
2023
+ ...getAthorizationHeaders(),
2024
+ },
2025
+ credentials: 'include',
2026
+ body: body ? JSON.stringify(body) : null,
2027
+ })
2028
+ .then((response) => {
2029
+ if (response.ok) {
2030
+ return getResponse(response);
2031
+ }
2032
+ else {
2033
+ throw response;
2034
+ }
2035
+ })
2036
+ .catch((error) => {
2037
+ throw error;
2038
+ });
2039
+ const saveToken = (data) => {
2040
+ sessionStorage.setItem('accessToken', data.access_token);
2041
+ sessionStorage.setItem('refreshToken', data.refresh_token);
2042
+ };
2043
+ const RETAIL_API = {
2044
+ CreateUserProfile: async (body) => await request('/public-data/createUserProfile', 'POST', body),
2045
+ UpdateUserProfile: async (body) => await request('/user-data/updateUserProfile', 'PUT', body),
2046
+ CreateDraftTask: async (body) => await request('/user-data/createDraftTask', 'POST', body),
2047
+ UpdateUserTask: async (body) => await request('/user-data/updateUserTask', 'PUT', body),
2048
+ SendCode: async (body) => await request('/sms/sendCode', 'POST', body),
2049
+ CheckCode: async (body) => await request('/sms/checkCode', 'POST', body).then(saveToken),
2050
+ CreateCaptcha: async (phoneNumber) => await request(`/sms/createCaptcha?phoneNumber=${phoneNumber}`, 'GET'),
2051
+ CheckCaptcha: async (body) => await request('/sms/checkCaptcha', 'POST', body),
2052
+ GetFileByID: async (id) => await request(`/feedback/file?id=${id}`, 'GET'),
2053
+ };
1994
2054
 
1995
- 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) })));
2055
+ const getDocument = async (id) => {
2056
+ const response = await RETAIL_API.GetFileByID(id);
2057
+ return URL.createObjectURL(await response.blob());
2058
+ };
1996
2059
 
1997
- 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) })));
2060
+ const OPEN_DOC_BUTTON_TEXT = 'Ознакомиться';
2061
+ const CheckboxWithDoc = JSX(({ className, error, docId, ...props }) => {
2062
+ const { open } = useDialogManager();
2063
+ 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)] }));
2064
+ });
2065
+ const handleOpenDocument = async (id, open) => {
2066
+ const document = await getDocument(id);
2067
+ 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" }) }));
2068
+ };
1998
2069
 
1999
- 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) })));
2070
+ 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);
2000
2071
 
2001
2072
  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 })));
2002
2073
 
@@ -2089,11 +2160,9 @@
2089
2160
  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 })));
2090
2161
 
2091
2162
  const REGIONS_URL = '/api/v1/regions';
2092
- const EMPTY_REGIONS = [];
2093
- // TODO Почему url можно менять? Разве смысл не в инкапсуляции api url. Тоже под рефакторинг попадает
2094
2163
  function useRegions(url = REGIONS_URL) {
2095
2164
  const { data } = useAsyncData(url, fetchJSONUnsafe);
2096
- return Array.isArray(data) ? data : EMPTY_REGIONS;
2165
+ return Array.isArray(data) ? data : [];
2097
2166
  }
2098
2167
 
2099
2168
  const LocalitiesField = JSX(({ field, input }) => {
@@ -2175,8 +2244,6 @@
2175
2244
 
2176
2245
  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);
2177
2246
 
2178
- 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) })));
2179
-
2180
2247
  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) })));
2181
2248
  const arrayToOptions = (array) => (array ?? []).map((_) => ({ key: _, value: _ }));
2182
2249
 
@@ -2331,15 +2398,15 @@
2331
2398
  serviceDirection: jsx(ServiceDirectionField, { field: field, input: input }),
2332
2399
  bankEmpolee: jsx(BankEmpoleeField, { field: field }),
2333
2400
  secondaryPhone: jsx(SecondaryPhoneField, { field: field }),
2334
- consentToReceiveMaterials: jsx(ConsentToReceiveMaterialsField, { field: field, input: input }),
2335
- processPersonalDataLeadFlg: jsx(ProcessPersonalDataField, { field: field, input: input }),
2336
- consentProviderFlg: jsx(ConsentProviderField, { field: field, input: input }),
2337
- consentPhotoFlg: jsx(ConsentPhotoFlg, { field: field, input: input }),
2338
- consentAssignmentClaimsFlg: jsx(ConsentAssignmentField, { field: field, input: input }),
2339
- consentCollectionFlg: jsx(ConsentCollectionField, { field: field, input: input }),
2340
- consentInformFlg: jsx(ConsentInformField, { field: field, input: input }),
2401
+ consentToReceiveMaterials: jsx(ConsentField, { field: field, input: input }),
2402
+ processPersonalDataLeadFlg: jsx(ConsentField, { field: field, input: input }),
2403
+ consentProviderFlg: jsx(ConsentField, { field: field, input: input }),
2404
+ consentPhotoFlg: jsx(ConsentField, { field: field, input: input }),
2405
+ consentAssignmentClaimsFlg: jsx(ConsentField, { field: field, input: input }),
2406
+ consentCollectionFlg: jsx(ConsentField, { field: field, input: input }),
2407
+ consentInformFlg: jsx(ConsentField, { field: field, input: input }),
2408
+ consentPfrFlg: jsx(ConsentField, { field: field, input: input }),
2341
2409
  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') })),
2342
- 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') })),
2343
2410
  region: isPremium ? (jsx(RegionPremiumField, { field: field })) : (jsx(RegionField, { field: field, input: input, url: getRegionUrl(typeForm) })),
2344
2411
  education: jsx(EducationField, { field: field, input: input }),
2345
2412
  housing: jsx(HousingField, { field: field, input: input }),
@@ -2351,7 +2418,6 @@
2351
2418
  positionOrganization: jsx(PositionOrganizationField, { field: field, input: input }),
2352
2419
  familyStatus: jsx(FamilyStatusField, { field: field, input: input }),
2353
2420
  children: jsx(ChildrenField, { field: field, input: input }),
2354
- // eslint-disable-next-line max-lines
2355
2421
  familyMembers: jsx(FamilyMembersField, { field: field, input: input }),
2356
2422
  dependents: jsx(DependentsField, { field: field, input: input }),
2357
2423
  totalIncome: jsx(TotalIncomeField, { field: field, input: input }),
@@ -2361,6 +2427,7 @@
2361
2427
  armyIdFlg: jsx(ArmyIdFlgField, { field: field, input: input }),
2362
2428
  dulSerie: jsx(DulSerieField, { field: field, input: input }),
2363
2429
  dulNumber: jsx(DulNumberField, { field: field, input: input }),
2430
+ // eslint-disable-next-line max-lines
2364
2431
  dulIssueDateField: jsx(DulIssueDateField, { field: field, input: input }),
2365
2432
  dulSubdivisionCode: jsx(DulSubdivisionCodeField, { field: field, input: input }),
2366
2433
  dulIssuedBy: jsx(DulIssuedByField, { field: field, input: input }),
@@ -2406,17 +2473,6 @@
2406
2473
  : '', className), type: type, role: role, onClick: onClick, children: children }));
2407
2474
  });
2408
2475
 
2409
- 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" }) })));
2410
-
2411
- const Dialog = JSX(({ className, head, children, onClose, onClick }) => {
2412
- const { close } = useDialogManager();
2413
- const handleClose = useCallback(() => {
2414
- close();
2415
- onClose && onClose();
2416
- }, [onClose]);
2417
- 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 })] }));
2418
- });
2419
-
2420
2476
  const ResponseTypeDialog = JSX(function ({ responseType, typeForm, }) {
2421
2477
  const responseOK = responseType === 'OK';
2422
2478
  const statusIcon = responseOK ? 'ResponseOKIcon' : 'ResponseFailIcon';
@@ -2577,17 +2633,6 @@
2577
2633
  return [storedValue, setValue];
2578
2634
  }
2579
2635
 
2580
- const CONSENTS = [
2581
- 'processPersonalDataLeadFlg',
2582
- 'consentProviderFlg',
2583
- 'consentPfrFlg',
2584
- 'consentPhotoFlg',
2585
- 'consentAssignmentClaimsFlg',
2586
- 'consentCollectionFlg',
2587
- 'consentInformFlg',
2588
- 'consentToReceiveMaterials',
2589
- ];
2590
-
2591
2636
  const initialFormState = {
2592
2637
  typeForm: '',
2593
2638
  region: { key: '', text: '' },
@@ -2635,14 +2680,6 @@
2635
2680
  return { ...formState, typeForm: { key: typeForm, text: '' } };
2636
2681
  };
2637
2682
 
2638
- const FoldableWrapper = JSX(({ className, children }) => (jsx("div", { className: className, role: "group", children: children })));
2639
- /**
2640
- * Какой то бесполезный компонент. Его можно заменить на useBool
2641
- * Лучше оставить только обёрточный div с необходимой атрибутикой
2642
- * и сделать пассивный компонент
2643
- *
2644
- * @deprecated
2645
- */
2646
2683
  const Foldable = JSX(({ className = '', isFoldButtonOnTop = false, unfoldedByDefault = false, renderFoldableSection, renderFoldButton, }) => {
2647
2684
  const [isUnfolded, setIsUnfolded] = useState(unfoldedByDefault);
2648
2685
  const onToggle = useCallback(() => {
@@ -2650,7 +2687,7 @@
2650
2687
  }, []);
2651
2688
  const sectionNode = renderFoldableSection({ isUnfolded, onToggle });
2652
2689
  const buttonNode = renderFoldButton ? renderFoldButton({ isUnfolded, onToggle }) : null;
2653
- return isFoldButtonOnTop ? (jsxs(FoldableWrapper, { className: className, children: [buttonNode, sectionNode] })) : (jsxs(FoldableWrapper, { className: className, children: [sectionNode, buttonNode] }));
2690
+ return isFoldButtonOnTop ? (jsxs("div", { className: className, role: "group", children: [buttonNode, sectionNode] })) : (jsxs("div", { className: className, role: "group", children: [sectionNode, buttonNode] }));
2654
2691
  });
2655
2692
 
2656
2693
  function useResizeObserver(callback, deps) {
@@ -2696,53 +2733,12 @@
2696
2733
  const hasValidationErrors = useMemo(() => inputs
2697
2734
  ?.filter((_) => _.required)
2698
2735
  ?.some((_) => Boolean(withValidator(field(_?.name), validatorObj[_?.name]).error)), [inputs]);
2699
- 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 : '')] })) }) }));
2736
+ 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 : '')] })) }) }));
2700
2737
  });
2701
2738
  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" }) })] }));
2702
2739
 
2703
2740
  const renderSubmitButton = (button, className) => (jsx(Button, { className: style('w-full @xl:w-auto', className), type: "submit", children: button?.text ? button.text : 'Отправить заявку' }));
2704
2741
 
2705
- const getResponse = (response) => (isJSON(response) ? response.json() : response);
2706
- const getAthorizationHeaders = () => {
2707
- const token = sessionStorage.getItem('accessToken');
2708
- return token ? { Authorization: `Bearer ${token}` } : null;
2709
- };
2710
- const isJSON = (response) => response.headers.get('Content-Type') === 'application/json';
2711
- const request = async (url, method, body) => await fetch('https://retail-light-api.cprb.dev.rshbdev.ru/api/v1' + url, {
2712
- method,
2713
- headers: {
2714
- 'Content-Type': 'application/json',
2715
- ...getAthorizationHeaders(),
2716
- },
2717
- credentials: 'include',
2718
- body: body ? JSON.stringify(body) : null,
2719
- })
2720
- .then((response) => {
2721
- if (response.ok) {
2722
- return getResponse(response);
2723
- }
2724
- else {
2725
- throw response;
2726
- }
2727
- })
2728
- .catch((error) => {
2729
- throw error;
2730
- });
2731
- const saveToken = (data) => {
2732
- sessionStorage.setItem('accessToken', data.access_token);
2733
- sessionStorage.setItem('refreshToken', data.refresh_token);
2734
- };
2735
- const RETAIL_API = {
2736
- CreateUserProfile: async (body) => await request('/public-data/createUserProfile', 'POST', body),
2737
- UpdateUserProfile: async (body) => await request('/user-data/updateUserProfile', 'PUT', body),
2738
- CreateDraftTask: async (body) => await request('/user-data/createDraftTask', 'POST', body),
2739
- UpdateUserTask: async (body) => await request('/user-data/updateUserTask', 'PUT', body),
2740
- SendCode: async (body) => await request('/sms/sendCode', 'POST', body),
2741
- CheckCode: async (body) => await request('/sms/checkCode', 'POST', body).then(saveToken),
2742
- CreateCaptcha: async (phoneNumber) => await request(`/sms/createCaptcha?phoneNumber=${phoneNumber}`, 'GET'),
2743
- CheckCaptcha: async (body) => await request('/sms/checkCaptcha', 'POST', body),
2744
- };
2745
-
2746
2742
  const getUpdateUserProfileData = (profileId, formData) => {
2747
2743
  const { name = '', surname = '', middleName = '', birthday = '', phone = '', email = '', processPersonalDataLeadFlg, consentProviderFlg, consentPfrFlg, consentPhotoFlg, consentAssignmentClaimsFlg, consentCollectionFlg, consentInformFlg, } = formData;
2748
2744
  return {
@@ -3076,10 +3072,13 @@
3076
3072
  setResponseStatus('Fail');
3077
3073
  }
3078
3074
  };
3075
+ const acceptedConsents = Object.keys(CONSENTS)
3076
+ .filter((_) => formData[_])
3077
+ .map((_) => CONSENTS[_]);
3079
3078
  // eslint-disable-next-line react-hooks/rules-of-hooks
3080
3079
  const verifyPhoneDialog = useVerifyPhoneDialog({
3081
3080
  close: handleSuccessVerify,
3082
- ...verifyPhoneContent(formData?.phone),
3081
+ ...verifyPhoneContent(formData?.phone, acceptedConsents),
3083
3082
  });
3084
3083
  verifyPhoneDialog.open();
3085
3084
  }
@@ -3093,17 +3092,14 @@
3093
3092
  responseStatus,
3094
3093
  };
3095
3094
  };
3096
- const verifyPhoneContent = (phone) => ({
3095
+ const verifyPhoneContent = (phone, consents) => ({
3097
3096
  title: 'Подтвердите номер телефона',
3098
3097
  description: `Мы отправили код на ${phone}`,
3099
3098
  phoneNumber: formatPhone(phone),
3100
3099
  textButton: 'Оформить',
3101
- __html: `<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>
3102
- <ul><li>соглашение о порядке использования простой электронной подписи,
3103
- </li><li>согласие на обработку персональных данных,
3104
- </li><li>предоставление и подписание прочих согласий Банка,
3105
- </li><li>согласие на запрос в ПФР</li></ul>`,
3100
+ __html: `<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>${consentsToList(consents)}`,
3106
3101
  });
3102
+ const consentsToList = (consents) => `<ul>${consents?.map((_) => '<li>' + _ + '</li>').join('')}</ul>`;
3107
3103
 
3108
3104
  const useInitApplicationLead = () => {
3109
3105
  useEffect(() => {
@@ -3141,8 +3137,8 @@
3141
3137
  return consentInputs.length > 2 ? (jsxs("div", { children: [restInputs.map(getField(field, typeForm)), jsx(GroupedConsents, { inputs: consentInputs, field: field })] })) : ((inputs || [])?.map(getField(field, typeForm)));
3142
3138
  };
3143
3139
  const splitInputs = (inputs) => ({
3144
- consentInputs: inputs?.filter((_) => CONSENTS.includes(_.name)) || [],
3145
- restInputs: inputs?.filter((_) => !CONSENTS.includes(_.name)) || [],
3140
+ consentInputs: inputs?.filter((_) => Object.keys(CONSENTS).includes(_.name)) || [],
3141
+ restInputs: inputs?.filter((_) => !Object.keys(CONSENTS).includes(_.name)) || [],
3146
3142
  });
3147
3143
 
3148
3144
  const NotFound = JSX(({ title, description }) => {
@@ -4751,37 +4747,31 @@
4751
4747
  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)] }) }) })));
4752
4748
  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;
4753
4749
 
4754
- const useSubjectState = (eventBus, type, initialState) => {
4755
- const [state, setState] = useState(initialState);
4756
- useEffect(() => eventBus.subscribe(type, setState), [eventBus, type]);
4757
- return state;
4758
- };
4759
-
4760
4750
  const renderCardInfo = (cell, i) => {
4761
4751
  const { title, description, buttons } = cell;
4762
4752
  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)));
4763
4753
  };
4764
4754
 
4765
- const CardCellsSection = JSX((props) => {
4766
- const { cardCells = [], visibleCellsCount = 1, isUnfolded } = props;
4767
- const [visibleCells, hiddenCells] = visibleCellsCount > 0 && cardCells.length >= visibleCellsCount
4768
- ? [cardCells.slice(0, visibleCellsCount), cardCells.slice(visibleCellsCount)]
4769
- : [cardCells, []];
4770
- 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) }));
4771
- });
4772
- 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" })] })));
4773
-
4774
- const carouselTariffsCardEventBus = new EventBus();
4775
-
4776
- const CarouselTariffsCard = JSX(({ className, title, align = 'text-center', icon, button, visibleCellsCount = 1, cardCells = [], options, data, ...rest }) => {
4777
- const { isUnfolded, parent: firedParent } = useSubjectState(carouselTariffsCardEventBus.observable, 'fold', {});
4778
- const isVisible = isUnfolded && firedParent === options?.parent;
4779
- const toggle = useCallback(() => carouselTariffsCardEventBus.emitter.fire('fold', {
4780
- isUnfolded: !isVisible,
4781
- parent: options?.parent,
4782
- }), [isVisible, options?.parent]);
4783
- 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 })] }));
4784
- });
4755
+ const CarouselTariffsCard = JSX(({ className = '', title, align = 'text-center', icon, button, visibleCellsCount = 1, cardCells = [], options, data, ...rest }) => {
4756
+ const cellsNode = cardCells.map(renderCardInfo);
4757
+ const [visibleCells, hiddenCells] = visibleCellsCount > 0
4758
+ ? [cellsNode.slice(0, visibleCellsCount), cellsNode.slice(visibleCellsCount)]
4759
+ : [cellsNode, []];
4760
+ const [isVisible, setIsVisible] = useState(false);
4761
+ useEffect(() => defaultEventBus.subscribe('fold', (event) => {
4762
+ if (options?.parent !== undefined && event.parent === options?.parent) {
4763
+ setIsVisible(event.isUnfolded);
4764
+ }
4765
+ }), [options?.parent]);
4766
+ 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
4767
+ ? renderFoldButton$3(options?.parent, data, isVisible)
4768
+ : null })) : (jsx("div", { children: visibleCells }))] }));
4769
+ });
4770
+ 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: () => {
4771
+ if (parent !== undefined) {
4772
+ defaultEventBus.fire('fold', { type: 'fold', isUnfolded: !isUnfolded, parent });
4773
+ }
4774
+ }, type: "button", ...(isUnfolded ? getAspectsAttributes(data) : {}), children: [jsx("div", { children: isUnfolded ? 'Скрыть' : 'Подробнее о тарифе' }), jsx(Icon, { className: "text-primary-text", name: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16" })] }));
4785
4775
 
4786
4776
  const ContactsBlock = JSX(({ className, contacts, info, version = 'secondary', ...rest }) => (jsxs(BlockWrapper, { className: style('flex', className), defaultPadding: "p-6xl", version: version, ...rest, children: [info?.length ? renderBlocks(info) : null, contacts?.length ? renderBlocks(contacts) : null] })));
4787
4777
  const renderBlocks = (info) => (jsx("div", { className: "flex gap-5xl grow basis-0", children: info.map((column, i) => renderBlocksColumn({ column, i })) }));
@@ -4953,46 +4943,47 @@
4953
4943
  };
4954
4944
  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] })));
4955
4945
 
4956
- function useSubject(eventBus, type, initialState) {
4957
- useEffect(() => {
4958
- const state = initialState instanceof Function ? initialState() : initialState;
4959
- if (state instanceof Promise) {
4960
- state.then((_) => eventBus.subject(type, _), console.warn);
4961
- }
4962
- else {
4963
- eventBus.subject(type, state);
4964
- }
4965
- }, [eventBus, type]);
4966
- return useCallback((_) => eventBus.fire(type, _), [eventBus, type]);
4967
- }
4946
+ const useLatestEvent = (eventBus, type, initialEvent) => {
4947
+ const [latestEvent, setLatestEvent] = useState(initialEvent || null);
4948
+ useEffect(() => eventBus.subscribe(type, (_) => setLatestEvent(_)), [eventBus, type]);
4949
+ const fireEvent = useCallback((_) => eventBus.fire(type, _), [eventBus, type]);
4950
+ return [latestEvent, fireEvent];
4951
+ };
4968
4952
 
4969
4953
  const REGION_URL = '/api/v1/region';
4970
4954
  const LOCATION_STORAGE_KEY = 'location';
4971
4955
  function useLocation(defaultLocation = 'Москва') {
4972
- useEffect(() => defaultEventBus.subscribe('location', storeLocation), []);
4973
- return useSubject(defaultEventBus.emitter, 'location', restoreLocation(defaultLocation));
4974
- }
4975
- function useLocationState(defaultLocation = 'Москва') {
4976
- return useSubjectState(defaultEventBus.observable, 'location', { name: defaultLocation });
4977
- }
4978
- function restoreLocation(defaultLocation) {
4979
- return async () => {
4980
- if (!globalThis.localStorage?.hasItem(LOCATION_STORAGE_KEY)) {
4981
- storeLocation(await fetchJSON(REGION_URL));
4982
- }
4983
- const storedLocation = globalThis.localStorage?.getItem(LOCATION_STORAGE_KEY);
4984
- try {
4985
- return storedLocation && JSON.parse(storedLocation);
4986
- }
4987
- catch (ex) {
4988
- // Do nothing
4956
+ const [currentLocation, fireCurrentLocation] = useLatestEvent(defaultEventBus, 'location', restoreLocation() ?? { name: defaultLocation });
4957
+ const selectCurrentLocation = useCallback((_) => {
4958
+ storeLocation(_);
4959
+ fireCurrentLocation(_);
4960
+ }, []);
4961
+ const { data } = useAsyncData(hasStoredLocation() ? null : REGION_URL, fetchJSONUnsafe);
4962
+ useEffect(() => {
4963
+ if (data && !hasStoredLocation()) {
4964
+ fireCurrentLocation(data);
4989
4965
  }
4990
- return { name: defaultLocation };
4991
- };
4992
- }
4993
- function storeLocation(_) {
4994
- _ && globalThis.localStorage?.setItem(LOCATION_STORAGE_KEY, JSON.stringify(_));
4966
+ }, [data]);
4967
+ return [currentLocation ?? { name: defaultLocation }, selectCurrentLocation];
4995
4968
  }
4969
+ const hasStoredLocation = () => Boolean(globalThis.localStorage?.getItem(LOCATION_STORAGE_KEY));
4970
+ const restoreLocation = () => {
4971
+ try {
4972
+ const data = globalThis.localStorage?.getItem(LOCATION_STORAGE_KEY);
4973
+ return data && JSON.parse(data);
4974
+ }
4975
+ catch (ex) {
4976
+ return null;
4977
+ }
4978
+ };
4979
+ const storeLocation = (_) => {
4980
+ try {
4981
+ globalThis.localStorage?.setItem(LOCATION_STORAGE_KEY, JSON.stringify(_));
4982
+ }
4983
+ catch (ex) {
4984
+ // Do nothing
4985
+ }
4986
+ };
4996
4987
 
4997
4988
  var Currency;
4998
4989
  (function (Currency) {
@@ -5134,7 +5125,7 @@
5134
5125
  }
5135
5126
 
5136
5127
  const ExchangeRateTile = JSX(({ className = '', title = 'Курсы обмена валют', button, ...rest }) => {
5137
- const currentLocation = useLocationState();
5128
+ const [currentLocation] = useLocation();
5138
5129
  const exchangeRates = useFetchExchangeRateData(currentLocation);
5139
5130
  const currencyRates = getCurrencyRates(exchangeRates?.exchangeRate?.currencies);
5140
5131
  const currencyRatesBuy = currencyRates.filter((_) => _.buyExchangeRate);
@@ -5673,33 +5664,27 @@
5673
5664
  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" })] }));
5674
5665
  });
5675
5666
 
5676
- const SelectedLocation = JSX(({ defaultLocation }) => {
5677
- const currentLocation = useLocationState(defaultLocation);
5678
- const link = useLink();
5679
- const { href } = link({ href: `/branches/${currentLocation.slug}` });
5680
- 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;
5681
- });
5682
-
5683
5667
  const SEARCH_TERM_MIN_LENGTH = 3;
5684
5668
  const LocationDialog = JSX(({ foreignOffices, branches }) => {
5685
- const selectLocation = useLocation(branches?.default);
5669
+ const [currentLocation, selectCurrentLocation] = useLocation(branches?.default);
5670
+ const link = useLink();
5671
+ const { href } = link({ href: `/branches/${currentLocation.slug}` });
5686
5672
  const [query, setQuery] = useState('');
5687
- const rawRegions = useRegions();
5688
- const regions = useMemo(() => cleanUpRegions(rawRegions).sort((a, b) => (a.name ?? '').localeCompare(b.name ?? '')), [rawRegions]);
5689
- const regionsGroupByLetter = useMemo(() => groupBy(regions, regionFirstLetter), [regions]);
5673
+ const regions = cleanUpRegions(useRegions()).sort((a, b) => a.name.localeCompare(b.name));
5674
+ const regionsGroupByLetter = groupBy(regions, regionFirstLetter);
5690
5675
  const { close } = useDialogManager();
5691
5676
  const handleChangeLocation = useCallback((region) => {
5692
- selectLocation(region);
5677
+ selectCurrentLocation(region);
5693
5678
  close();
5694
5679
  }, []);
5695
- 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
5680
+ 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
5696
5681
  .filter(({ name }) => name && jaroWinklerDistance(name.toLowerCase())(query.toLowerCase()) >= 0.8)
5697
5682
  .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)] }));
5698
5683
  });
5699
- const regionFirstLetter = (region) => region.name?.charAt(0) ?? '';
5684
+ const regionFirstLetter = (region) => region.name?.charAt(0) || '';
5700
5685
  const cleanUpRegions = (regions) => regions.map((region) => ({
5701
5686
  ...region,
5702
- name: region.name?.replace(/республика|область|край'/gi, '').trim() ?? '',
5687
+ name: region.name?.replace(/республика|область|край'/gi, '').trim() || '',
5703
5688
  }));
5704
5689
 
5705
5690
  const useLocationDialog = (props) => {
@@ -5727,7 +5712,7 @@
5727
5712
 
5728
5713
  const HeaderSecondaryMenu = JSX(({ className, version, ...rest }) => {
5729
5714
  const iconVersion = version === 'transparent' ? 'white' : 'black';
5730
- const currentLocation = useLocationState(rest?.branches?.default);
5715
+ const [currentLocation] = useLocation(rest?.branches?.default);
5731
5716
  const searchDialog = useSearchDialog(rest);
5732
5717
  const locationDialog = useLocationDialog(rest);
5733
5718
  const openSearchDialog = useCallback(() => searchDialog.open(), [searchDialog]);
@@ -6566,7 +6551,7 @@
6566
6551
  designDisabledPeople: (item) => Boolean(item.designDisabledPeople),
6567
6552
  };
6568
6553
  const AtmsMap = JSX(({ descriptionData, className }) => {
6569
- const currentLocation = useLocationState();
6554
+ const [currentLocation] = useLocation();
6570
6555
  const regionCode = currentLocation?.code ?? '000';
6571
6556
  const { data: officesData, isLoad } = useAtms(regionCode);
6572
6557
  return (jsx(OfficesAtmsMapLayout, { className: className, filterItems: filterItems, data: officesData, isLoad: isLoad, initFilterState: INITIAL_FILTRATION_STATE, renderCard: renderAtmCard, getBalloon: getAtmPoint, title: `Банкоматы филиала ${currentLocation?.name}`, descriptionData: descriptionData }));
@@ -6785,7 +6770,7 @@
6785
6770
  };
6786
6771
 
6787
6772
  const OfficesMap = JSX(({ className }) => {
6788
- const currentLocation = useLocationState();
6773
+ const [currentLocation] = useLocation();
6789
6774
  const regionCode = currentLocation?.code ?? '000';
6790
6775
  const { data, isLoad } = useOffices(regionCode);
6791
6776
  return (jsx(OfficesAtmsMapLayout, { className: className, data: data?.branches, isLoad: isLoad, remoteWorkplaces: data?.remoteWorkplaces, renderCard: renderOfficeCard, renderRemoteWorkplaceCard: renderRemoteWorkplaceCard, getBalloon: getOfficePoint, getBalloonRemoteWorkplaces: getRemoteWorkplacePoint, title: `Офисы филиала ${currentLocation?.name}` }));
@@ -7469,7 +7454,7 @@
7469
7454
  onClose && onClose(dialogs[dialogs.length - 1]);
7470
7455
  pop();
7471
7456
  }, [dialogs, onClose]);
7472
- useEffect(() => defaultEventBus.observable.subscribe('dialog', (action) => {
7457
+ useEffect(() => defaultEventBus.subscribe('dialog', (action) => {
7473
7458
  switch (action.type) {
7474
7459
  case 'open':
7475
7460
  push(action);
@@ -7526,7 +7511,7 @@
7526
7511
  const close = useCallback(() => {
7527
7512
  setPopup(null);
7528
7513
  }, []);
7529
- useEffect(() => defaultEventBus.observable.subscribe('popup', (action) => {
7514
+ useEffect(() => defaultEventBus.subscribe('popup', (action) => {
7530
7515
  switch (action.type) {
7531
7516
  case 'open':
7532
7517
  case 'update':
@@ -7581,7 +7566,7 @@
7581
7566
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
7582
7567
  });
7583
7568
 
7584
- const packageVersion = "0.14.599";
7569
+ const packageVersion = "0.14.601";
7585
7570
 
7586
7571
  exports.Blocks = Blocks;
7587
7572
  exports.ContentPage = ContentPage;