@redneckz/wildless-cms-uni-blocks 0.14.680 → 0.14.682

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 (533) hide show
  1. package/bundle/api/RetailAPI/getPaymentSystems.d.ts +1 -1
  2. package/bundle/api/RetailAPI/updateRefreshToken.d.ts +1 -1
  3. package/bundle/api/RetailAPI/updateUserTask.d.ts +1 -0
  4. package/bundle/blocks.schema.json +1 -1
  5. package/bundle/bundle.umd.js +157 -159
  6. package/bundle/bundle.umd.min.js +1 -1
  7. package/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  8. package/bundle/components/CreditCardForm/getSixthStepData.d.ts +5 -0
  9. package/bundle/components/LinkDocs/renderDefaultItem.d.ts +1 -1
  10. package/bundle/external/locationNavigator.d.ts +11 -0
  11. package/bundle/index.d.ts +3 -3
  12. package/bundle/ui-kit/FormField/Fields/ProductField.d.ts +1 -1
  13. package/bundle/utils/adjustSrc.d.ts +1 -1
  14. package/dist/api/RetailAPI/getPaymentSystems.d.ts +1 -1
  15. package/dist/api/RetailAPI/getPaymentSystems.js +2 -2
  16. package/dist/api/RetailAPI/getPaymentSystems.js.map +1 -1
  17. package/dist/api/RetailAPI/updateRefreshToken.d.ts +1 -1
  18. package/dist/api/RetailAPI/updateRefreshToken.js +9 -4
  19. package/dist/api/RetailAPI/updateRefreshToken.js.map +1 -1
  20. package/dist/api/RetailAPI/updateUserTask.d.ts +1 -0
  21. package/dist/api/RetailAPI/updateUserTask.js.map +1 -1
  22. package/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  23. package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js +3 -1
  24. package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
  25. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +4 -2
  26. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  27. package/dist/components/Blocks.js +0 -2
  28. package/dist/components/Blocks.js.map +1 -1
  29. package/dist/components/CreditCardForm/CreditCardForm.js +1 -4
  30. package/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
  31. package/dist/components/CreditCardForm/getCreditCardFormTaskData.js +4 -4
  32. package/dist/components/CreditCardForm/getCreditCardFormTaskData.js.map +1 -1
  33. package/dist/components/CreditCardForm/getFourthStepData.js +3 -1
  34. package/dist/components/CreditCardForm/getFourthStepData.js.map +1 -1
  35. package/dist/components/CreditCardForm/getSixthStepData.d.ts +5 -0
  36. package/dist/components/CreditCardForm/getSixthStepData.js +8 -1
  37. package/dist/components/CreditCardForm/getSixthStepData.js.map +1 -1
  38. package/dist/components/CreditCardForm/getThirdStepData.js +3 -1
  39. package/dist/components/CreditCardForm/getThirdStepData.js.map +1 -1
  40. package/dist/components/CreditCardForm/useCreditCardFormAPI.js +0 -1
  41. package/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  42. package/dist/components/CreditForm/CreditForm.js +1 -4
  43. package/dist/components/CreditForm/CreditForm.js.map +1 -1
  44. package/dist/components/CreditForm/getCreditFormTaskData.js +28 -27
  45. package/dist/components/CreditForm/getCreditFormTaskData.js.map +1 -1
  46. package/dist/components/CreditForm/getSecondStepData.js +3 -1
  47. package/dist/components/CreditForm/getSecondStepData.js.map +1 -1
  48. package/dist/components/CreditForm/getThirdStepData.js +3 -1
  49. package/dist/components/CreditForm/getThirdStepData.js.map +1 -1
  50. package/dist/components/Header/HeaderTop.js +1 -1
  51. package/dist/components/Header/HeaderTop.js.map +1 -1
  52. package/dist/components/LinkDocs/LinkDocs.js +1 -1
  53. package/dist/components/LinkDocs/LinkDocs.js.map +1 -1
  54. package/dist/components/LinkDocs/renderDefaultItem.d.ts +1 -1
  55. package/dist/components/TabsLayout/TabsLayout.js +1 -1
  56. package/dist/components/TabsLayout/TabsLayout.js.map +1 -1
  57. package/dist/components/VerticalLayout/VerticalLayout.js +1 -1
  58. package/dist/components/VerticalLayout/VerticalLayout.js.map +1 -1
  59. package/dist/components/Video/Video.js +1 -1
  60. package/dist/components/Video/Video.js.map +1 -1
  61. package/dist/external/handlerDecorator.js.map +1 -0
  62. package/dist/external/locationNavigator.d.ts +11 -0
  63. package/dist/external/locationNavigator.js +21 -0
  64. package/dist/external/locationNavigator.js.map +1 -0
  65. package/dist/external/useRouter.js.map +1 -0
  66. package/dist/hooks/useActiveRoute.js +1 -1
  67. package/dist/hooks/useActiveRoute.js.map +1 -1
  68. package/dist/hooks/useAspects/aspects/forwardQuery.js +4 -15
  69. package/dist/hooks/useAspects/aspects/forwardQuery.js.map +1 -1
  70. package/dist/hooks/useClickHandler.js +1 -1
  71. package/dist/hooks/useClickHandler.js.map +1 -1
  72. package/dist/hooks/useLink.js +2 -2
  73. package/dist/hooks/useLink.js.map +1 -1
  74. package/dist/index.d.ts +3 -3
  75. package/dist/index.js +5 -5
  76. package/dist/index.js.map +1 -1
  77. package/dist/setup-fixture.js +2 -2
  78. package/dist/setup-fixture.js.map +1 -1
  79. package/dist/ui-kit/BaseTile/BaseTile.js +1 -1
  80. package/dist/ui-kit/BaseTile/BaseTile.js.map +1 -1
  81. package/dist/ui-kit/Button/useButton.js +1 -1
  82. package/dist/ui-kit/Button/useButton.js.map +1 -1
  83. package/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js +4 -2
  84. package/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
  85. package/dist/ui-kit/EsiaLoginDialog/useEsiaLoginDialog.js +3 -1
  86. package/dist/ui-kit/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -1
  87. package/dist/ui-kit/FormField/Fields/ProductField.d.ts +1 -1
  88. package/dist/ui-kit/FormField/Fields/ProductField.js +2 -2
  89. package/dist/ui-kit/FormField/Fields/ProductField.js.map +1 -1
  90. package/dist/ui-kit/Icon/Icon.js +1 -1
  91. package/dist/ui-kit/Icon/Icon.js.map +1 -1
  92. package/dist/ui-kit/Img/ImgAsPicture.js +1 -1
  93. package/dist/ui-kit/Img/ImgAsPicture.js.map +1 -1
  94. package/dist/ui-kit/ReportDialog/ReportDialog.js +1 -1
  95. package/dist/ui-kit/ReportDialog/ReportDialog.js.map +1 -1
  96. package/dist/utils/adjustSrc.d.ts +1 -1
  97. package/lib/api/RetailAPI/getPaymentSystems.d.ts +1 -1
  98. package/lib/api/RetailAPI/getPaymentSystems.js +2 -2
  99. package/lib/api/RetailAPI/getPaymentSystems.js.map +1 -1
  100. package/lib/api/RetailAPI/updateRefreshToken.d.ts +1 -1
  101. package/lib/api/RetailAPI/updateRefreshToken.js +9 -4
  102. package/lib/api/RetailAPI/updateRefreshToken.js.map +1 -1
  103. package/lib/api/RetailAPI/updateUserTask.d.ts +1 -0
  104. package/lib/api/RetailAPI/updateUserTask.js.map +1 -1
  105. package/lib/common.css +1 -1
  106. package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  107. package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js +3 -1
  108. package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
  109. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +4 -2
  110. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  111. package/lib/components/Blocks.js +0 -2
  112. package/lib/components/Blocks.js.map +1 -1
  113. package/lib/components/CreditCardForm/CreditCardForm.js +1 -4
  114. package/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
  115. package/lib/components/CreditCardForm/getCreditCardFormTaskData.js +5 -5
  116. package/lib/components/CreditCardForm/getCreditCardFormTaskData.js.map +1 -1
  117. package/lib/components/CreditCardForm/getFourthStepData.js +3 -1
  118. package/lib/components/CreditCardForm/getFourthStepData.js.map +1 -1
  119. package/lib/components/CreditCardForm/getSixthStepData.d.ts +5 -0
  120. package/lib/components/CreditCardForm/getSixthStepData.js +6 -0
  121. package/lib/components/CreditCardForm/getSixthStepData.js.map +1 -1
  122. package/lib/components/CreditCardForm/getThirdStepData.js +3 -1
  123. package/lib/components/CreditCardForm/getThirdStepData.js.map +1 -1
  124. package/lib/components/CreditCardForm/useCreditCardFormAPI.js +0 -1
  125. package/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  126. package/lib/components/CreditForm/CreditForm.js +1 -4
  127. package/lib/components/CreditForm/CreditForm.js.map +1 -1
  128. package/lib/components/CreditForm/getCreditFormTaskData.js +28 -27
  129. package/lib/components/CreditForm/getCreditFormTaskData.js.map +1 -1
  130. package/lib/components/CreditForm/getSecondStepData.js +3 -1
  131. package/lib/components/CreditForm/getSecondStepData.js.map +1 -1
  132. package/lib/components/CreditForm/getThirdStepData.js +3 -1
  133. package/lib/components/CreditForm/getThirdStepData.js.map +1 -1
  134. package/lib/components/Header/HeaderTop.js +1 -1
  135. package/lib/components/Header/HeaderTop.js.map +1 -1
  136. package/lib/components/LinkDocs/LinkDocs.js +1 -1
  137. package/lib/components/LinkDocs/LinkDocs.js.map +1 -1
  138. package/lib/components/LinkDocs/renderDefaultItem.d.ts +1 -1
  139. package/lib/components/TabsLayout/TabsLayout.js +1 -1
  140. package/lib/components/TabsLayout/TabsLayout.js.map +1 -1
  141. package/lib/components/VerticalLayout/VerticalLayout.js +1 -1
  142. package/lib/components/VerticalLayout/VerticalLayout.js.map +1 -1
  143. package/lib/components/Video/Video.js +1 -1
  144. package/lib/components/Video/Video.js.map +1 -1
  145. package/lib/external/handlerDecorator.js.map +1 -0
  146. package/lib/external/locationNavigator.d.ts +11 -0
  147. package/lib/external/locationNavigator.js +18 -0
  148. package/lib/external/locationNavigator.js.map +1 -0
  149. package/lib/external/useRouter.js.map +1 -0
  150. package/lib/hooks/useActiveRoute.js +1 -1
  151. package/lib/hooks/useActiveRoute.js.map +1 -1
  152. package/lib/hooks/useAspects/aspects/forwardQuery.js +4 -15
  153. package/lib/hooks/useAspects/aspects/forwardQuery.js.map +1 -1
  154. package/lib/hooks/useClickHandler.js +1 -1
  155. package/lib/hooks/useClickHandler.js.map +1 -1
  156. package/lib/hooks/useLink.js +2 -2
  157. package/lib/hooks/useLink.js.map +1 -1
  158. package/lib/index.d.ts +3 -3
  159. package/lib/index.js +3 -3
  160. package/lib/index.js.map +1 -1
  161. package/lib/setup-fixture.js +2 -2
  162. package/lib/setup-fixture.js.map +1 -1
  163. package/lib/ui-kit/BaseTile/BaseTile.js +1 -1
  164. package/lib/ui-kit/BaseTile/BaseTile.js.map +1 -1
  165. package/lib/ui-kit/Button/useButton.js +1 -1
  166. package/lib/ui-kit/Button/useButton.js.map +1 -1
  167. package/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js +4 -2
  168. package/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
  169. package/lib/ui-kit/EsiaLoginDialog/useEsiaLoginDialog.js +3 -1
  170. package/lib/ui-kit/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -1
  171. package/lib/ui-kit/FormField/Fields/ProductField.d.ts +1 -1
  172. package/lib/ui-kit/FormField/Fields/ProductField.js +2 -2
  173. package/lib/ui-kit/FormField/Fields/ProductField.js.map +1 -1
  174. package/lib/ui-kit/Icon/Icon.js +1 -1
  175. package/lib/ui-kit/Icon/Icon.js.map +1 -1
  176. package/lib/ui-kit/Img/ImgAsPicture.js +1 -1
  177. package/lib/ui-kit/Img/ImgAsPicture.js.map +1 -1
  178. package/lib/ui-kit/ReportDialog/ReportDialog.js +1 -1
  179. package/lib/ui-kit/ReportDialog/ReportDialog.js.map +1 -1
  180. package/lib/utils/adjustSrc.d.ts +1 -1
  181. package/mobile/bundle/api/RetailAPI/getPaymentSystems.d.ts +1 -1
  182. package/mobile/bundle/api/RetailAPI/updateRefreshToken.d.ts +1 -1
  183. package/mobile/bundle/api/RetailAPI/updateUserTask.d.ts +1 -0
  184. package/mobile/bundle/bundle.umd.js +141 -130
  185. package/mobile/bundle/bundle.umd.min.js +1 -1
  186. package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  187. package/mobile/bundle/components/CreditCardForm/getSixthStepData.d.ts +5 -0
  188. package/mobile/bundle/components/LinkDocs/renderDefaultItem.d.ts +1 -1
  189. package/mobile/bundle/external/locationNavigator.d.ts +11 -0
  190. package/mobile/bundle/index.d.ts +3 -3
  191. package/mobile/bundle/ui-kit/FormField/Fields/ProductField.d.ts +1 -1
  192. package/mobile/bundle/utils/adjustSrc.d.ts +1 -1
  193. package/mobile/dist/api/RetailAPI/getPaymentSystems.d.ts +1 -1
  194. package/mobile/dist/api/RetailAPI/getPaymentSystems.js +2 -2
  195. package/mobile/dist/api/RetailAPI/getPaymentSystems.js.map +1 -1
  196. package/mobile/dist/api/RetailAPI/updateRefreshToken.d.ts +1 -1
  197. package/mobile/dist/api/RetailAPI/updateRefreshToken.js +9 -4
  198. package/mobile/dist/api/RetailAPI/updateRefreshToken.js.map +1 -1
  199. package/mobile/dist/api/RetailAPI/updateUserTask.d.ts +1 -0
  200. package/mobile/dist/api/RetailAPI/updateUserTask.js.map +1 -1
  201. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  202. package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js +3 -1
  203. package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
  204. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +4 -2
  205. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  206. package/mobile/dist/components/CreditCardForm/CreditCardForm.js +1 -4
  207. package/mobile/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
  208. package/mobile/dist/components/CreditCardForm/getCreditCardFormTaskData.js +4 -4
  209. package/mobile/dist/components/CreditCardForm/getCreditCardFormTaskData.js.map +1 -1
  210. package/mobile/dist/components/CreditCardForm/getFourthStepData.js +3 -1
  211. package/mobile/dist/components/CreditCardForm/getFourthStepData.js.map +1 -1
  212. package/mobile/dist/components/CreditCardForm/getSixthStepData.d.ts +5 -0
  213. package/mobile/dist/components/CreditCardForm/getSixthStepData.js +8 -1
  214. package/mobile/dist/components/CreditCardForm/getSixthStepData.js.map +1 -1
  215. package/mobile/dist/components/CreditCardForm/getThirdStepData.js +3 -1
  216. package/mobile/dist/components/CreditCardForm/getThirdStepData.js.map +1 -1
  217. package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js +0 -1
  218. package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  219. package/mobile/dist/components/CreditForm/CreditForm.js +1 -4
  220. package/mobile/dist/components/CreditForm/CreditForm.js.map +1 -1
  221. package/mobile/dist/components/CreditForm/getCreditFormTaskData.js +28 -27
  222. package/mobile/dist/components/CreditForm/getCreditFormTaskData.js.map +1 -1
  223. package/mobile/dist/components/CreditForm/getSecondStepData.js +3 -1
  224. package/mobile/dist/components/CreditForm/getSecondStepData.js.map +1 -1
  225. package/mobile/dist/components/CreditForm/getThirdStepData.js +3 -1
  226. package/mobile/dist/components/CreditForm/getThirdStepData.js.map +1 -1
  227. package/mobile/dist/components/Header/HeaderTop.js +1 -1
  228. package/mobile/dist/components/Header/HeaderTop.js.map +1 -1
  229. package/mobile/dist/components/LinkDocs/LinkDocs.js +1 -1
  230. package/mobile/dist/components/LinkDocs/LinkDocs.js.map +1 -1
  231. package/mobile/dist/components/LinkDocs/renderDefaultItem.d.ts +1 -1
  232. package/mobile/dist/components/TabsLayout/TabsLayout.js +1 -1
  233. package/mobile/dist/components/TabsLayout/TabsLayout.js.map +1 -1
  234. package/mobile/dist/components/VerticalLayout/VerticalLayout.js +1 -1
  235. package/mobile/dist/components/VerticalLayout/VerticalLayout.js.map +1 -1
  236. package/mobile/dist/components/Video/Video.js +1 -1
  237. package/mobile/dist/components/Video/Video.js.map +1 -1
  238. package/mobile/dist/external/handlerDecorator.js.map +1 -0
  239. package/mobile/dist/external/locationNavigator.d.ts +11 -0
  240. package/mobile/dist/external/locationNavigator.js +21 -0
  241. package/mobile/dist/external/locationNavigator.js.map +1 -0
  242. package/mobile/dist/external/useRouter.js.map +1 -0
  243. package/mobile/dist/hooks/useActiveRoute.js +1 -1
  244. package/mobile/dist/hooks/useActiveRoute.js.map +1 -1
  245. package/mobile/dist/hooks/useAspects/aspects/forwardQuery.js +4 -15
  246. package/mobile/dist/hooks/useAspects/aspects/forwardQuery.js.map +1 -1
  247. package/mobile/dist/hooks/useClickHandler.js +1 -1
  248. package/mobile/dist/hooks/useClickHandler.js.map +1 -1
  249. package/mobile/dist/hooks/useLink.js +2 -2
  250. package/mobile/dist/hooks/useLink.js.map +1 -1
  251. package/mobile/dist/index.d.ts +3 -3
  252. package/mobile/dist/index.js +5 -5
  253. package/mobile/dist/index.js.map +1 -1
  254. package/mobile/dist/setup-fixture.js +2 -2
  255. package/mobile/dist/setup-fixture.js.map +1 -1
  256. package/mobile/dist/ui-kit/BaseTile/BaseTile.js +1 -1
  257. package/mobile/dist/ui-kit/BaseTile/BaseTile.js.map +1 -1
  258. package/mobile/dist/ui-kit/Button/useButton.js +1 -1
  259. package/mobile/dist/ui-kit/Button/useButton.js.map +1 -1
  260. package/mobile/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js +4 -2
  261. package/mobile/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
  262. package/mobile/dist/ui-kit/EsiaLoginDialog/useEsiaLoginDialog.js +3 -1
  263. package/mobile/dist/ui-kit/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -1
  264. package/mobile/dist/ui-kit/FormField/Fields/ProductField.d.ts +1 -1
  265. package/mobile/dist/ui-kit/FormField/Fields/ProductField.js +2 -2
  266. package/mobile/dist/ui-kit/FormField/Fields/ProductField.js.map +1 -1
  267. package/mobile/dist/ui-kit/Icon/Icon.js +1 -1
  268. package/mobile/dist/ui-kit/Icon/Icon.js.map +1 -1
  269. package/mobile/dist/ui-kit/Img/ImgAsPicture.js +1 -1
  270. package/mobile/dist/ui-kit/Img/ImgAsPicture.js.map +1 -1
  271. package/mobile/dist/ui-kit/ReportDialog/ReportDialog.js +1 -1
  272. package/mobile/dist/ui-kit/ReportDialog/ReportDialog.js.map +1 -1
  273. package/mobile/dist/utils/adjustSrc.d.ts +1 -1
  274. package/mobile/lib/api/RetailAPI/getPaymentSystems.d.ts +1 -1
  275. package/mobile/lib/api/RetailAPI/getPaymentSystems.js +2 -2
  276. package/mobile/lib/api/RetailAPI/getPaymentSystems.js.map +1 -1
  277. package/mobile/lib/api/RetailAPI/updateRefreshToken.d.ts +1 -1
  278. package/mobile/lib/api/RetailAPI/updateRefreshToken.js +9 -4
  279. package/mobile/lib/api/RetailAPI/updateRefreshToken.js.map +1 -1
  280. package/mobile/lib/api/RetailAPI/updateUserTask.d.ts +1 -0
  281. package/mobile/lib/api/RetailAPI/updateUserTask.js.map +1 -1
  282. package/mobile/lib/common.css +1 -1
  283. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  284. package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js +3 -1
  285. package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
  286. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +4 -2
  287. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  288. package/mobile/lib/components/CreditCardForm/CreditCardForm.js +1 -4
  289. package/mobile/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
  290. package/mobile/lib/components/CreditCardForm/getCreditCardFormTaskData.js +5 -5
  291. package/mobile/lib/components/CreditCardForm/getCreditCardFormTaskData.js.map +1 -1
  292. package/mobile/lib/components/CreditCardForm/getFourthStepData.js +3 -1
  293. package/mobile/lib/components/CreditCardForm/getFourthStepData.js.map +1 -1
  294. package/mobile/lib/components/CreditCardForm/getSixthStepData.d.ts +5 -0
  295. package/mobile/lib/components/CreditCardForm/getSixthStepData.js +6 -0
  296. package/mobile/lib/components/CreditCardForm/getSixthStepData.js.map +1 -1
  297. package/mobile/lib/components/CreditCardForm/getThirdStepData.js +3 -1
  298. package/mobile/lib/components/CreditCardForm/getThirdStepData.js.map +1 -1
  299. package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js +0 -1
  300. package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
  301. package/mobile/lib/components/CreditForm/CreditForm.js +1 -4
  302. package/mobile/lib/components/CreditForm/CreditForm.js.map +1 -1
  303. package/mobile/lib/components/CreditForm/getCreditFormTaskData.js +28 -27
  304. package/mobile/lib/components/CreditForm/getCreditFormTaskData.js.map +1 -1
  305. package/mobile/lib/components/CreditForm/getSecondStepData.js +3 -1
  306. package/mobile/lib/components/CreditForm/getSecondStepData.js.map +1 -1
  307. package/mobile/lib/components/CreditForm/getThirdStepData.js +3 -1
  308. package/mobile/lib/components/CreditForm/getThirdStepData.js.map +1 -1
  309. package/mobile/lib/components/Header/HeaderTop.js +1 -1
  310. package/mobile/lib/components/Header/HeaderTop.js.map +1 -1
  311. package/mobile/lib/components/LinkDocs/LinkDocs.js +1 -1
  312. package/mobile/lib/components/LinkDocs/LinkDocs.js.map +1 -1
  313. package/mobile/lib/components/LinkDocs/renderDefaultItem.d.ts +1 -1
  314. package/mobile/lib/components/TabsLayout/TabsLayout.js +1 -1
  315. package/mobile/lib/components/TabsLayout/TabsLayout.js.map +1 -1
  316. package/mobile/lib/components/VerticalLayout/VerticalLayout.js +1 -1
  317. package/mobile/lib/components/VerticalLayout/VerticalLayout.js.map +1 -1
  318. package/mobile/lib/components/Video/Video.js +1 -1
  319. package/mobile/lib/components/Video/Video.js.map +1 -1
  320. package/mobile/lib/external/handlerDecorator.js.map +1 -0
  321. package/mobile/lib/external/locationNavigator.d.ts +11 -0
  322. package/mobile/lib/external/locationNavigator.js +18 -0
  323. package/mobile/lib/external/locationNavigator.js.map +1 -0
  324. package/mobile/lib/external/useRouter.js.map +1 -0
  325. package/mobile/lib/hooks/useActiveRoute.js +1 -1
  326. package/mobile/lib/hooks/useActiveRoute.js.map +1 -1
  327. package/mobile/lib/hooks/useAspects/aspects/forwardQuery.js +4 -15
  328. package/mobile/lib/hooks/useAspects/aspects/forwardQuery.js.map +1 -1
  329. package/mobile/lib/hooks/useClickHandler.js +1 -1
  330. package/mobile/lib/hooks/useClickHandler.js.map +1 -1
  331. package/mobile/lib/hooks/useLink.js +2 -2
  332. package/mobile/lib/hooks/useLink.js.map +1 -1
  333. package/mobile/lib/index.d.ts +3 -3
  334. package/mobile/lib/index.js +3 -3
  335. package/mobile/lib/index.js.map +1 -1
  336. package/mobile/lib/setup-fixture.js +2 -2
  337. package/mobile/lib/setup-fixture.js.map +1 -1
  338. package/mobile/lib/ui-kit/BaseTile/BaseTile.js +1 -1
  339. package/mobile/lib/ui-kit/BaseTile/BaseTile.js.map +1 -1
  340. package/mobile/lib/ui-kit/Button/useButton.js +1 -1
  341. package/mobile/lib/ui-kit/Button/useButton.js.map +1 -1
  342. package/mobile/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js +4 -2
  343. package/mobile/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
  344. package/mobile/lib/ui-kit/EsiaLoginDialog/useEsiaLoginDialog.js +3 -1
  345. package/mobile/lib/ui-kit/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -1
  346. package/mobile/lib/ui-kit/FormField/Fields/ProductField.d.ts +1 -1
  347. package/mobile/lib/ui-kit/FormField/Fields/ProductField.js +2 -2
  348. package/mobile/lib/ui-kit/FormField/Fields/ProductField.js.map +1 -1
  349. package/mobile/lib/ui-kit/Icon/Icon.js +1 -1
  350. package/mobile/lib/ui-kit/Icon/Icon.js.map +1 -1
  351. package/mobile/lib/ui-kit/Img/ImgAsPicture.js +1 -1
  352. package/mobile/lib/ui-kit/Img/ImgAsPicture.js.map +1 -1
  353. package/mobile/lib/ui-kit/ReportDialog/ReportDialog.js +1 -1
  354. package/mobile/lib/ui-kit/ReportDialog/ReportDialog.js.map +1 -1
  355. package/mobile/lib/utils/adjustSrc.d.ts +1 -1
  356. package/mobile/src/api/RetailAPI/getPaymentSystems.ts +6 -4
  357. package/mobile/src/api/RetailAPI/updateRefreshToken.ts +11 -4
  358. package/mobile/src/api/RetailAPI/updateUserTask.ts +1 -0
  359. package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -1
  360. package/mobile/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +3 -1
  361. package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +4 -2
  362. package/mobile/src/components/CreditCardForm/CreditCardForm.tsx +1 -6
  363. package/mobile/src/components/CreditCardForm/getCreditCardFormTaskData.ts +6 -5
  364. package/mobile/src/components/CreditCardForm/getFourthStepData.ts +4 -0
  365. package/mobile/src/components/CreditCardForm/getSixthStepData.ts +8 -0
  366. package/mobile/src/components/CreditCardForm/getThirdStepData.tsx +3 -0
  367. package/mobile/src/components/CreditCardForm/useCreditCardFormAPI.tsx +1 -1
  368. package/mobile/src/components/CreditForm/CreditForm.tsx +1 -6
  369. package/mobile/src/components/CreditForm/getCreditFormTaskData.ts +31 -29
  370. package/mobile/src/components/CreditForm/getSecondStepData.tsx +3 -0
  371. package/mobile/src/components/CreditForm/getThirdStepData.ts +4 -0
  372. package/mobile/src/components/Header/HeaderTop.tsx +1 -1
  373. package/mobile/src/components/LinkDocs/LinkDocs.tsx +1 -1
  374. package/mobile/src/components/LinkDocs/renderDefaultItem.tsx +1 -1
  375. package/mobile/src/components/TabsLayout/TabsLayout.tsx +1 -1
  376. package/mobile/src/components/VerticalLayout/VerticalLayout.tsx +1 -1
  377. package/mobile/src/components/Video/Video.tsx +1 -1
  378. package/mobile/src/external/locationNavigator.ts +27 -0
  379. package/mobile/src/hooks/useActiveRoute.ts +1 -2
  380. package/mobile/src/hooks/useAspects/aspects/forwardQuery.ts +4 -16
  381. package/mobile/src/hooks/useClickHandler.ts +1 -1
  382. package/mobile/src/hooks/useLink.ts +2 -2
  383. package/mobile/src/index.ts +3 -3
  384. package/mobile/src/setup-fixture.ts +2 -2
  385. package/mobile/src/ui-kit/BaseTile/BaseTile.tsx +1 -1
  386. package/mobile/src/ui-kit/Button/useButton.ts +1 -1
  387. package/mobile/src/ui-kit/EsiaLoginDialog/EsiaLoginDialog.tsx +5 -2
  388. package/mobile/src/ui-kit/EsiaLoginDialog/useEsiaLoginDialog.tsx +3 -1
  389. package/mobile/src/ui-kit/FormField/Fields/ProductField.tsx +2 -2
  390. package/mobile/src/ui-kit/Icon/Icon.tsx +1 -1
  391. package/mobile/src/ui-kit/Img/ImgAsPicture.tsx +1 -1
  392. package/mobile/src/ui-kit/ReportDialog/ReportDialog.tsx +1 -1
  393. package/mobile/src/utils/adjustSrc.ts +1 -1
  394. package/package.json +1 -1
  395. package/src/api/RetailAPI/getPaymentSystems.ts +6 -4
  396. package/src/api/RetailAPI/updateRefreshToken.ts +11 -4
  397. package/src/api/RetailAPI/updateUserTask.ts +1 -0
  398. package/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -1
  399. package/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +3 -1
  400. package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +4 -2
  401. package/src/components/Blocks.ts +0 -2
  402. package/src/components/CreditCardForm/CreditCardForm.tsx +1 -6
  403. package/src/components/CreditCardForm/getCreditCardFormTaskData.ts +6 -5
  404. package/src/components/CreditCardForm/getFourthStepData.ts +4 -0
  405. package/src/components/CreditCardForm/getSixthStepData.ts +8 -0
  406. package/src/components/CreditCardForm/getThirdStepData.tsx +3 -0
  407. package/src/components/CreditCardForm/useCreditCardFormAPI.tsx +1 -1
  408. package/src/components/CreditForm/CreditForm.tsx +1 -6
  409. package/src/components/CreditForm/getCreditFormTaskData.ts +31 -29
  410. package/src/components/CreditForm/getSecondStepData.tsx +3 -0
  411. package/src/components/CreditForm/getThirdStepData.ts +4 -0
  412. package/src/components/Header/HeaderTop.tsx +1 -1
  413. package/src/components/LinkDocs/LinkDocs.tsx +1 -1
  414. package/src/components/LinkDocs/renderDefaultItem.tsx +1 -1
  415. package/src/components/TabsLayout/TabsLayout.tsx +1 -1
  416. package/src/components/VerticalLayout/VerticalLayout.tsx +1 -1
  417. package/src/components/Video/Video.tsx +1 -1
  418. package/src/external/locationNavigator.ts +27 -0
  419. package/src/hooks/useActiveRoute.ts +1 -2
  420. package/src/hooks/useAspects/aspects/forwardQuery.ts +4 -16
  421. package/src/hooks/useClickHandler.ts +1 -1
  422. package/src/hooks/useLink.ts +2 -2
  423. package/src/index.ts +3 -3
  424. package/src/setup-fixture.ts +2 -2
  425. package/src/ui-kit/BaseTile/BaseTile.tsx +1 -1
  426. package/src/ui-kit/Button/useButton.ts +1 -1
  427. package/src/ui-kit/EsiaLoginDialog/EsiaLoginDialog.tsx +5 -2
  428. package/src/ui-kit/EsiaLoginDialog/useEsiaLoginDialog.tsx +3 -1
  429. package/src/ui-kit/FormField/Fields/ProductField.tsx +2 -2
  430. package/src/ui-kit/Icon/Icon.tsx +1 -1
  431. package/src/ui-kit/Img/ImgAsPicture.tsx +1 -1
  432. package/src/ui-kit/ReportDialog/ReportDialog.tsx +1 -1
  433. package/src/utils/adjustSrc.ts +1 -1
  434. package/bundle/components/ApplicationStatus/ApplicationStatus.d.ts +0 -5
  435. package/bundle/components/ApplicationStatus/ApplicationStatusContent.d.ts +0 -18
  436. package/bundle/hooks/useNavigator.d.ts +0 -8
  437. package/dist/components/ApplicationStatus/ApplicationStatus.d.ts +0 -5
  438. package/dist/components/ApplicationStatus/ApplicationStatus.js +0 -25
  439. package/dist/components/ApplicationStatus/ApplicationStatus.js.map +0 -1
  440. package/dist/components/ApplicationStatus/ApplicationStatusContent.d.ts +0 -18
  441. package/dist/components/ApplicationStatus/ApplicationStatusContent.js +0 -2
  442. package/dist/components/ApplicationStatus/ApplicationStatusContent.js.map +0 -1
  443. package/dist/hooks/handlerDecorator.js.map +0 -1
  444. package/dist/hooks/useNavigator.d.ts +0 -8
  445. package/dist/hooks/useNavigator.js +0 -13
  446. package/dist/hooks/useNavigator.js.map +0 -1
  447. package/dist/hooks/useRouter.js.map +0 -1
  448. package/dist/ui-kit/FormField/Fields/FeedbackTypeField.d.ts +0 -0
  449. package/dist/ui-kit/FormField/Fields/FeedbackTypeField.js +0 -1
  450. package/dist/ui-kit/FormField/Fields/FeedbackTypeField.js.map +0 -1
  451. package/lib/components/ApplicationStatus/ApplicationStatus.d.ts +0 -5
  452. package/lib/components/ApplicationStatus/ApplicationStatus.fixture.d.ts +0 -9
  453. package/lib/components/ApplicationStatus/ApplicationStatus.js +0 -23
  454. package/lib/components/ApplicationStatus/ApplicationStatus.js.map +0 -1
  455. package/lib/components/ApplicationStatus/ApplicationStatusContent.d.ts +0 -18
  456. package/lib/components/ApplicationStatus/ApplicationStatusContent.js +0 -2
  457. package/lib/components/ApplicationStatus/ApplicationStatusContent.js.map +0 -1
  458. package/lib/hooks/handlerDecorator.js.map +0 -1
  459. package/lib/hooks/useNavigator.d.ts +0 -8
  460. package/lib/hooks/useNavigator.js +0 -10
  461. package/lib/hooks/useNavigator.js.map +0 -1
  462. package/lib/hooks/useRouter.js.map +0 -1
  463. package/lib/ui-kit/FormField/Fields/FeedbackTypeField.d.ts +0 -0
  464. package/lib/ui-kit/FormField/Fields/FeedbackTypeField.js +0 -1
  465. package/lib/ui-kit/FormField/Fields/FeedbackTypeField.js.map +0 -1
  466. package/mobile/bundle/components/ApplicationStatus/ApplicationStatus.d.ts +0 -5
  467. package/mobile/bundle/components/ApplicationStatus/ApplicationStatusContent.d.ts +0 -18
  468. package/mobile/bundle/hooks/useNavigator.d.ts +0 -8
  469. package/mobile/dist/components/ApplicationStatus/ApplicationStatus.d.ts +0 -5
  470. package/mobile/dist/components/ApplicationStatus/ApplicationStatus.js +0 -25
  471. package/mobile/dist/components/ApplicationStatus/ApplicationStatus.js.map +0 -1
  472. package/mobile/dist/components/ApplicationStatus/ApplicationStatusContent.d.ts +0 -18
  473. package/mobile/dist/components/ApplicationStatus/ApplicationStatusContent.js +0 -2
  474. package/mobile/dist/components/ApplicationStatus/ApplicationStatusContent.js.map +0 -1
  475. package/mobile/dist/hooks/handlerDecorator.js.map +0 -1
  476. package/mobile/dist/hooks/useNavigator.d.ts +0 -8
  477. package/mobile/dist/hooks/useNavigator.js +0 -13
  478. package/mobile/dist/hooks/useNavigator.js.map +0 -1
  479. package/mobile/dist/hooks/useRouter.js.map +0 -1
  480. package/mobile/dist/ui-kit/FormField/Fields/FeedbackTypeField.d.ts +0 -0
  481. package/mobile/dist/ui-kit/FormField/Fields/FeedbackTypeField.js +0 -1
  482. package/mobile/dist/ui-kit/FormField/Fields/FeedbackTypeField.js.map +0 -1
  483. package/mobile/lib/components/ApplicationStatus/ApplicationStatus.d.ts +0 -5
  484. package/mobile/lib/components/ApplicationStatus/ApplicationStatus.js +0 -23
  485. package/mobile/lib/components/ApplicationStatus/ApplicationStatus.js.map +0 -1
  486. package/mobile/lib/components/ApplicationStatus/ApplicationStatusContent.d.ts +0 -18
  487. package/mobile/lib/components/ApplicationStatus/ApplicationStatusContent.js +0 -2
  488. package/mobile/lib/components/ApplicationStatus/ApplicationStatusContent.js.map +0 -1
  489. package/mobile/lib/hooks/handlerDecorator.js.map +0 -1
  490. package/mobile/lib/hooks/useNavigator.d.ts +0 -8
  491. package/mobile/lib/hooks/useNavigator.js +0 -10
  492. package/mobile/lib/hooks/useNavigator.js.map +0 -1
  493. package/mobile/lib/hooks/useRouter.js.map +0 -1
  494. package/mobile/lib/ui-kit/FormField/Fields/FeedbackTypeField.d.ts +0 -0
  495. package/mobile/lib/ui-kit/FormField/Fields/FeedbackTypeField.js +0 -1
  496. package/mobile/lib/ui-kit/FormField/Fields/FeedbackTypeField.js.map +0 -1
  497. package/mobile/src/components/ApplicationStatus/ApplicationStatus.example.json +0 -6
  498. package/mobile/src/components/ApplicationStatus/ApplicationStatus.tsx +0 -108
  499. package/mobile/src/components/ApplicationStatus/ApplicationStatus.ui.json +0 -1
  500. package/mobile/src/components/ApplicationStatus/ApplicationStatusContent.ts +0 -19
  501. package/mobile/src/hooks/useNavigator.ts +0 -15
  502. package/mobile/src/ui-kit/FormField/Fields/FeedbackTypeField.tsx +0 -0
  503. package/src/components/ApplicationStatus/ApplicationStatus.example.json +0 -6
  504. package/src/components/ApplicationStatus/ApplicationStatus.fixture.tsx +0 -129
  505. package/src/components/ApplicationStatus/ApplicationStatus.tsx +0 -108
  506. package/src/components/ApplicationStatus/ApplicationStatus.ui.json +0 -1
  507. package/src/components/ApplicationStatus/ApplicationStatusContent.ts +0 -19
  508. package/src/hooks/useNavigator.ts +0 -15
  509. package/src/ui-kit/FormField/Fields/FeedbackTypeField.tsx +0 -0
  510. /package/bundle/{hooks → external}/handlerDecorator.d.ts +0 -0
  511. /package/bundle/{hooks → external}/useRouter.d.ts +0 -0
  512. /package/dist/{hooks → external}/handlerDecorator.d.ts +0 -0
  513. /package/dist/{hooks → external}/handlerDecorator.js +0 -0
  514. /package/dist/{hooks → external}/useRouter.d.ts +0 -0
  515. /package/dist/{hooks → external}/useRouter.js +0 -0
  516. /package/lib/{hooks → external}/handlerDecorator.d.ts +0 -0
  517. /package/lib/{hooks → external}/handlerDecorator.js +0 -0
  518. /package/lib/{hooks → external}/useRouter.d.ts +0 -0
  519. /package/lib/{hooks → external}/useRouter.js +0 -0
  520. /package/mobile/bundle/{hooks → external}/handlerDecorator.d.ts +0 -0
  521. /package/mobile/bundle/{hooks → external}/useRouter.d.ts +0 -0
  522. /package/mobile/dist/{hooks → external}/handlerDecorator.d.ts +0 -0
  523. /package/mobile/dist/{hooks → external}/handlerDecorator.js +0 -0
  524. /package/mobile/dist/{hooks → external}/useRouter.d.ts +0 -0
  525. /package/mobile/dist/{hooks → external}/useRouter.js +0 -0
  526. /package/mobile/lib/{hooks → external}/handlerDecorator.d.ts +0 -0
  527. /package/mobile/lib/{hooks → external}/handlerDecorator.js +0 -0
  528. /package/mobile/lib/{hooks → external}/useRouter.d.ts +0 -0
  529. /package/mobile/lib/{hooks → external}/useRouter.js +0 -0
  530. /package/mobile/src/{hooks → external}/handlerDecorator.ts +0 -0
  531. /package/mobile/src/{hooks → external}/useRouter.ts +0 -0
  532. /package/src/{hooks → external}/handlerDecorator.ts +0 -0
  533. /package/src/{hooks → external}/useRouter.ts +0 -0
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniBlocks={})}(this,(function(e){"use strict";let t;const n=e=>(...n)=>t[e](...n),i=n("useState"),a=n("useEffect"),l=n("useCallback"),r=n("useMemo"),s=n("useRef"),o=(...e)=>globalThis._uni._jsx(...e),c=(...e)=>globalThis._uni._jsxs(...e),d=e=>{const t=e;return t._tmpl||(t._tmpl=globalThis.__UNI_REACT__?e:m(e)),t._tmpl},m=e=>{function t(t,n){const{children:i,...a}=t||{},l=n?.slots?.default,r=i||l&&l();return e(Object.assign(a,r&&{children:r}),n)}return t.inheritAttrs=!1,t},u=(...e)=>e.map((e=>h(e)?Object.entries(e).filter((([,e])=>e)).map((([e])=>e)):e)).flatMap((e=>e)).filter(Boolean).join(" "),h=e=>Boolean(e&&"object"==typeof e&&!Array.isArray(e)),p={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white",gray:"bg-main-divider text-primary-text",transparent:"bg-transparent text-primary-text","":""},g=d((({className:e,version:t="primary",isTheme:n=!0,defaultPadding:i="p-xl",padding:a,block:l,tag:r="section",role:s,children:c,style:d})=>{const m=t&&n;return o(r,{className:u("@container font-sans",{group:m},p[t],a||i,e),...m?{"data-ver":t}:{},...l?.anchor?{id:l.anchor}:{},role:s,style:d,children:c})})),f=d((({className:e,size:t})=>o("figure",{className:u("m-0 mt-xl min-w-[80%]",e),children:x(t)}))),x=(e=3)=>y(100,e).map((e=>Math.floor(e))).map(b),b=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),y=(e,t)=>[e].concat(t>0?y(e/1.618,t-1):[]),v={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},N=d((({className:e="",headingType:t="h3",as:n="h3",title:i,children:a})=>o(n,{role:"heading",className:u("font-sans m-0",v[t],e),children:i||a}))),w=d((({children:e,...t})=>o("p",{className:u("font-sans",Object.values(t)),children:e}))),C={XXL:{title:{headingType:"h0",as:"h1"},descriptionSize:"text-h5",descriptionWeight:"font-normal",descriptionStyle:"mt-xl"},XL:{title:{headingType:"h1",as:"h1"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},L:{title:{headingType:"h2",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},M:{title:{headingType:"h3",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-s"},S:{title:{headingType:"h4",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-xs"},XS:{title:{headingType:"h5",as:"h2"},descriptionSize:"text-m",descriptionWeight:"font-light",descriptionStyle:"mt-xs"}},S=d((({className:e,version:t="",headlineVersion:n="XL",title:i,description:a,align:l="text-center",as:r,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=C[n],p={marginTop:h.descriptionStyle};return c(g,{className:u({"@container-normal":s},e),defaultPadding:s?"":"p-6xl",version:t,isTheme:d,...m,children:[i?o(N,{className:u("whitespace-pre-wrap",l),...h?.title,as:r||h?.title.as,title:i}):null,a?o(w,{size:h.descriptionSize,font:h.descriptionWeight,align:l,...p,children:a}):null]})})),k=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),I=[];function T(e,t,{className:n,...i}={}){const{key:a,blockDecorator:l=k,blocksRegistry:r={},ancestors:s=I}=t,{type:c}=e;c&&c in r||console.warn(`No block with "${c}" is registered`);const d=c&&r[c];return l({blockClassName:u(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:l})=>{const{content:r}=n;return d?o(d,{className:l,block:e,options:t,...r,...i},a):null}},a)}const B=[],P=(e,{key:t,ancestors:n=B,slotName:i=null,extraProps:a,renderProps:l=T,...r})=>{const s=a?(e,t)=>T(e,t,a):l;return(e||[]).map(((e,a)=>s(e,{...r,key:`${t||e.type}-${a}`,ancestors:r.parent?[...n||B,[r.parent,i]]:n},a)))};function R({block:e,options:t,children:n,extraProps:i,renderProps:a}){return n||(e&&t?P(e.blocks,{...t,parent:e,extraProps:i,renderProps:a}):null)}function D(){return D._impl()}D._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),D.setup=e=>{D._impl=e};const _=["CDN","BASE_PATH"],M=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return _.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),A=e=>Boolean(e?.includes(":")),z=(e,t)=>Boolean(e&&!A(e)&&(!t||"_self"===t)),E=e=>Boolean(e?.startsWith("#")),O=e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),F=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),V=(e,t)=>!(!e||!t)&&(!!e.startsWith(t)&&["/"===t,e===t,"/"===e[t.length]].some(Boolean));var L=Object.freeze({__proto__:null,isURL:A,isLocalURL:z,isHash:E,withoutQuery:O,joinPath:F,hasPrefix:V});const j="/api/",q=`${j}v1/storage`,$=e=>(t,n)=>{if([!t,A(t),E(t),[M.CDN,j].some((e=>V(t,e)))].some(Boolean))return t;if(((e="")=>/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}(\/revs\/[0-9]{1,20})?$/.test(e))(t))return`${q}/${t}/attachment`;const i=t?.startsWith("/");return F(V(t,n)?"":n,i?"/":e.pathname?.split("/").slice(0,-1).join("/"),t)},U={"":"",normal:"",color:"text-primary-main",black:"text-black",white:"text-black",gray:"text-gray"},W=d((({className:e="",imageClassName:t="",name:n="",alt:i=`Иконка ${n}`,title:a=i,iconVersion:l="color",width:r,height:s})=>{const d=D(),m="normal"===l?`${n}.svg`:`sprites.svg#${n}`,h=$(d)(F(M.CDN,"/icons/",m));return"normal"===l?o("img",{className:e,src:h,alt:i,title:a,"aria-hidden":"true",width:r,height:s,style:H(e,s)}):o(K,{className:e,children:c("svg",{className:u(Y(r),U[l],{invert:"white"===l},t),width:r,height:s,"aria-hidden":"true",children:[a?o("title",{children:a}):null,i?o("desc",{children:i}):null,o("use",{href:h,xlinkHref:h})]})})})),H=(e,t)=>{return e?.includes("h-")?{}:{height:(n=t,n&&!/\D/.test(n)?`${t}px`:t),width:"auto"};var n},Y=e=>e?"":"w-full h-full",K=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),G=new Proxy({_:{},setup(e){this._=e}},{get:(e,t)=>e._[t]||e[t]});function X(e=""){try{return new URL(e).pathname}catch(e){return""}}const J=e=>t=>{const n=t?.startsWith("/wcms-resources")?"":X(G.SITE_URL);return t&&!A(t)?$(e)(t,n):t},Z=(e,t)=>e?.media&&t?.media?e.media-t.media:0,Q=d((({className:e="",image:t,imageClassName:n=""})=>{const i=D();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(Z).map((({src:e,format:n,media:a},l)=>o("source",{srcSet:J(i)(e),type:te(n),media:a?`(max-width: ${a}px)`:"",width:t?.size?.width,height:t?.size?.height},`${l}_${e}`))):null,t?.src?ee({...t,src:J(i)(t.src)},n):null]})})),ee=(e,t="")=>o("img",{src:e.src,className:u("object-contain",t),alt:e?.alt||e?.title||"",title:e?.title||"",style:{width:e?.size?.width?`${e.size?.width}px`:"100%",height:e?.size?.height?`${e.size?.height}px`:"auto"},width:e?.size?.width,height:e?.size?.height}),te=e=>e?`image/${String(e)}`:void 0,ne=d((({className:e="",image:t,imageClassName:n="",...i})=>t?.src||t?.icon?t.icon?o(W,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...i}):o(Q,{className:e,imageClassName:n,image:t}):null)),ie={primary:"text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active",secondary:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active",white:"text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main",link:"text-primary-main",transparent:"",gray:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active","":""},ae="bg-main-divider text-main-disabled",le={primary:ae,secondary:ae,white:ae,link:"",transparent:"",gray:ae,"":""},re="text-center font-sans select-none",se={primary:"group-hover/btn:brightness-0 group-hover/btn:invert",secondary:"group-hover/btn:brightness-0 group-hover/btn:invert",white:"group-hover/btn:brightness-0 group-hover/btn:invert",link:"text-primary-main",transparent:"",gray:"group-hover/btn:brightness-0 group-hover/btn:invert","":""},oe=({className:e,rounded:t,version:n})=>[re,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",n?ie[n]:"",t?"rounded-full":"rounded-md",e].join(" ");class ce{watchers=new Set;subscribersMap={};subjectsStateMap={};emitter=this;observable=this;watch(e){return this.watchers.add(e),()=>{this.watchers.delete(e)}}subscribe(e,t){this.subscribersMap[e]||=new Set,this.subscribersMap[e]?.add(t);const n=this.subjectsStateMap[e];return n&&t(n),()=>{this.subscribersMap[e]?.delete(t)}}fire(e,t){e in this.subjectsStateMap?this.subject(e,t):this.fireSubscribers(e,t)}subject(e,t){return this.subjectsStateMap[e]!==t&&(this.subjectsStateMap[e]=t??void 0,this.fireSubscribers(e,t)),()=>{delete this.subjectsStateMap[e]}}fireSubscribers(e,t){for(const n of this.subscribersMap[e]??[])n(t??null);for(const n of this.watchers)n({type:e,event:t??null})}}const de=new ce,me=()=>({open:(e,t={})=>de.fire("dialog",{type:"open",dialog:e,...t}),close:()=>de.fire("dialog",{type:"close"}),closeAll:()=>de.fire("dialog",{type:"close",all:!0})}),ue=e=>ue._impl(e);function he(){const e=X(G.SITE_URL),t=D(),{closeAll:n}=me();return e=>{const n=$(t)(e.href);return{...e,href:n,"aria-label":e.text,onClick:ue(i({...e,href:n}))}};function i({href:i,target:a,onClick:l}){return r=>{l?.(r),pe(i,a,e)||(n(),r?.preventDefault(),t.push(((e,t="")=>e?.replace(t,"")||"/")(i,e)))}}}ue._impl=e=>e,ue.setup=e=>{ue._impl=e};const pe=(e,t,n)=>{if(!z(e,t))return!0;const i=G.SUB_PORTALS?.split(",");return!!i?.some((t=>V(e,t)))||!V(e,n||"/")},ge=e=>{if(!Array.isArray(e)||!e.length)return{};try{return{"data-aspects":JSON.stringify(e)}}catch(e){return{}}},fe=d((e=>{const{text:t,aboveText:n,appendLeft:i,appendRight:a,version:l="primary"}=e,r=be(e)&&"hidden lg:block";return c("div",{className:u(xe(e),"flex gap-xs"),children:[i?o("div",{className:u(r,se[l]),children:i}):null,be(e)?c("div",{className:"whitespace-pre",children:[n?o("div",{className:"text-xs font-light text-left",children:n}):null,o("div",{className:"text-left "+(n?"text-s -mt-3xs":"text-l"),children:t})]}):null,a?o("div",{className:u(r,se[l]),children:a}):null]})})),xe=e=>{const{version:t,aboveText:n,rounded:i}=e;if("link"===t)return"";const a=""+(n?"py-2.5 px-9":"py-4 px-9");return u("group/btn items-center justify-center",be(e)?a:"h-12 w-12 m-auto",{"rounded-full":i})},be=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),ye=({className:e,rounded:t,version:n})=>["inline-block",re,n?le[n]:"",t?"rounded-full":"rounded-md",e].join(" "),ve=d((({disabled:e,children:t,method:n="LINK",href:i,...a})=>{const r=(({method:e,href:t})=>l((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:i,pathname:a,searchParams:l}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[i,a].join(""));for(const[e,t]of l.entries()){const n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t),r.appendChild(n)}document.body.appendChild(r),r.submit()}),[]))({method:n,href:i}),s=he()({onClick:r,href:i,...a}),c=t??o(fe,{...s});return o(e?we:Ne,{...s,children:c})})),Ne=d((({className:e="",href:t,rel:n,target:i,ariaLabel:a,version:l,rounded:r,onClick:s,type:c,data:d,children:m,text:u})=>o("a",{className:oe({className:e,version:l,rounded:r}),href:t,rel:n,target:i,"aria-label":a||`Ссылка на ${u}`,role:t?"link":"button",onClick:s,type:c,...ge(d),children:m}))),we=d((({className:e,ariaLabel:t,version:n,rounded:i,children:a})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:ye({className:e,rounded:i,version:n}),children:a})));function Ce({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:i=!1}){if(!n)return null;const a="primary"===e?"white":"black",l="primary"===e?"bg-primary-main":"bg-white";return c("div",{className:u(i?"flex":"hidden sm:flex","items-center gap-s"),children:[o("div",{className:u(oe({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",rounded:!0}),l),onClick:t,children:o(ne,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:a}})}),o(ve,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const Se=()=>{const[e,t]=i(false);return a((()=>{const e=globalThis.matchMedia?.("(max-width: 1024px)"),n=()=>{t(Boolean(e?.matches))};return e?.addEventListener("change",n),e?.matches&&t(Boolean(e.matches)),()=>{e?.removeEventListener("change",n)}}),[]),e},ke={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},Ie=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&ke[n],t),children:e}):null,Te=d((({className:e,version:t="primary",defaultPadding:n,padding:i="",title:a,buttons:r,leftImage:s,rightImage:d,imageAlign:m,insetTitle:h,isImageAlwaysOnRight:p=!1,isImageSecondary:g=!1,backwardButton:f,children:x,...b})=>{const y=Se(),v=D(),N=l((()=>v.back()),[]),w=b.options?.page?.common?.backwardButton,C=f&&!y;return c("div",{className:u("relative flex flex-col gap-3xl overflow-hidden",i||n,e),children:[C&&Ce({version:t,handleClick:N,text:w}),a?o("div",{className:"relative h-full",children:a}):null,c("div",{className:u("grow relative flex flex-col @xl:flex-row gap-3xl w-full",{"self-start @xl:w-auto":s}),children:[Ie(s,{imageAlign:m,className:"mx-auto"}),c("div",{className:u("grid gap-3xl items-center md:items-stretch",{"@xl:grid-cols-2 auto-cols-fr":d,grow:!s},"h-full","auto-rows-[max-content_1fr]"),children:[c("div",{className:"grow space-y-lg min-w-fit",children:[h,x]}),Pe(R({...b,extraProps:{className:"@container-normal"}})),Ie(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[Be(p)]:r,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),r?o("div",{className:"self-end",children:r}):null]})]})]})})),Be=e=>u(e?"row-span-2":"@xl:row-span-2"),Pe=e=>e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,Re=(e,t="normal")=>e?.icon||e?.src?o("div",{className:u("sm:w-12 sm:h-12 sm:min-w-12 w-11 h-11 min-w-11 box-border flex items-center justify-center rounded-icon","normal"===t?"bg-secondary-light text-primary-main":"bg-primary-main text-black group-data-secondary:bg-white/30 group-data-secondary:text-black"),children:o(ne,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,De=d((e=>{const{__html:t="",richVersion:n="",itemSize:i="list-m",isDotted:a=!0}=e,l=a?"":"without-dots";return t&&"<p><br></p>"!==t.replace(/<\/?[^>]+\/?>/g,"").trim()?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(n,i,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",l),dangerouslySetInnerHTML:{__html:t}})}):null})),_e=(e,t)=>e?o(w,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,Me=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),Ae=(e,t)=>e?o(Me,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,ze=(e,t)=>["label"in e?Ae(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:_e(e.description,t)},String(t)):null,"__html"in e?o(De,{...e},`rte-${t}`):null],Ee=d((({className:e,benefitsVersion:t,...n})=>c("div",{className:u("flex gap-m min-w-56 items-center",e),role:"listitem",children:["icon"in n?Re(n.icon,t):null,o("div",{children:ze(n)})]}))),Oe=d((({className:e,benefitsVersion:t="normal",benefits:n})=>n?.length?o("div",{className:u("flex gap-x-m gap-y-s flex-col",e),role:"list",children:n.map(((e,n)=>o(Ee,{benefitsVersion:t,...e},String(n))))}):null)),Fe=d((({className:e,benefits:t})=>t?.length?o("div",{className:u("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),role:"list",children:t.flatMap(ze)}):null)),Ve=d((({isTabularBenefits:e,...t})=>o(e?Fe:Oe,{...t}))),Le=e=>Boolean(e?.src||e?.icon),je=(e,{className:t,buttonClassName:n,isVertical:i}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:u("flex",i?"flex-col gap-xs justify-items-stretch":"flex-wrap @xl:flex-nowrap gap-lg sm:gap-m w-full @lg:w-auto",t),role:"group",children:e.map(qe(n))}):null,qe=(e="")=>(t,n)=>{const{text:i,icon:a,iconRight:l,version:r,...s}=t||{},c=$e(a,r),d=$e(l,r);return i||a?.icon?o(ve,{className:u("basis-full @lg:basis-auto",e),appendLeft:Ue({...a,iconVersion:c}),appendRight:Ue({...l,iconVersion:d}),version:r,text:i,...s},n?String(n):""):null},$e=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},Ue=e=>Le(e)&&o(ne,{image:e,width:String(e?.size?.width||24),height:String(24)}),We=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),He=d((({priceList:e})=>e?.length?o("div",{className:"flex flex-wrap xl:flex-nowrap xl:bg-main-divider xl:rounded-md p-xs gap-xl",role:"list",children:e.map(Ye)}):null)),Ye=({label:e,amount:t,unit:n},i)=>c("div",{className:"basis-full flex flex-col-reverse sm:flex-row sm:justify-between sm:bg-main-divider sm:py-m sm:px-lg sm:rounded-md items-baseline whitespace-pre",role:"listitem",children:[o(Me,{font:"font-light",size:"text-l",color:"text-secondary-text",children:e}),t?c("span",{className:"font-sans text-h6 sm:text-primary-main text-primary-text",children:[We(2)(t)," ",n||"₽"]}):null]},String(i)),Ke=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(Ge)}):null)),Ge=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(Me,{size:"text-m",font:"font-light",children:e})},String(t)),Xe={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},Je=d((({className:e,padding:t,defaultPadding:n,title:i,description:a,headlineVersion:l="L",align:r="text-left",benefitsVersion:s,isTabularBenefits:d,isDotted:m=!0,benefits:u,__html:h,richVersion:p,isFullWidthTitle:g,priceList:f=[],tags:x=[],buttons:b,image:y,imageOptions:{imageAlign:v="center",directionRight:N=!0,isImageAlwaysOnRight:w,isImageSecondary:C=!1}={},backwardButton:k,children:I,...T})=>{const B=y?.src?o(ne,{image:y}):null,P=o(S,{title:i,description:a,headlineVersion:l,align:r,isEmbedded:!0}),R=u?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Te,{className:e,padding:t,defaultPadding:n,...g?{title:P}:{insetTitle:P},...Ze(B,N),isImageSecondary:C,imageAlign:v,isImageAlwaysOnRight:w,buttons:je(b),backwardButton:k,...T,children:c("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[R?.length?o(Ve,{benefitsVersion:s,isTabularBenefits:d,benefits:R}):null,h?o(De,{richVersion:p,__html:h,isDotted:m,itemSize:Xe[l]}):null,I,f?.length?o(He,{priceList:f}):null,Qe(x)]})})})),Ze=(e,t)=>t?{rightImage:e}:{leftImage:e},Qe=e=>e?.length?o(Ke,{tags:e}):null;class et{_;constructor(e){this._=e}of(e){return new this.constructor(e instanceof et?e._:e)}filter(e){return this.from(this.entries().filter(e))}map(e){return this.from(this.entries().map(e))}flatMap(e){return this.from(this.entries().flatMap(e))}reduce(e,t){return this.entries().reduce(e.bind(this),t)}}const tt=()=>!0,nt=(e,t)=>(...n)=>e(...n)&&t(...n),it=(...e)=>(...t)=>{const[,n]=function(e){if(!e)throw new Error("Value should be fulfilled");return e}(e.find((([e])=>e(...t))));return n(...t)};const at=e=>Boolean(e&&Array.isArray(e)),lt=e=>Boolean(e&&"object"==typeof e&&!at(e)),rt=e=>e;function st(e){return e instanceof et?e._:e}class ot extends et{from(e){return this.of(e.map(((e=rt)=>([,t])=>e(t))(st)))}entries(){return(this._??[]).map(((e,t)=>[t,this.of(e)]))}size(){return this._?.length??0}get(e){return this.of("number"==typeof e?this._?.[e]:void 0)}set(e,t){return this.of(at(this._)?Array.from({length:Math.max(this._.length,Number(e)+1)},((n,i)=>i===e?t:this._[i])):Array.from({length:Number(e)+1},((n,i)=>i===e?t:void 0)))}}class ct extends et{from(){return this}entries(){return[]}size(){return 0}get(e){return this.of(void 0!==e?void 0:this._)}set(e,t){return this.of(t)}}class dt extends et{from(e){return this.of(Object.fromEntries(e.map((([e,t])=>[e,st(t)]))))}entries(){return Object.entries(this._??{}).map((([e,t])=>[e,this.of(t)]))}size(){return Object.keys(this._??{}).length}get(e){return this.of("string"==typeof e?this._?.[e]:void 0)}set(e,t){return this.of({...this._,[e]:t})}}class mt extends et{proto=it([e=>at(this._)||"number"==typeof e,()=>ot.prototype],[e=>lt(this._)||"string"==typeof e,()=>dt.prototype],[tt,()=>ct.prototype]);from(e){return this.proto(void 0).from.call(this,e)}entries(){return this.proto(void 0).entries.call(this)}size(){return this.proto(void 0).size.call(this)}get(e){return this.proto(e).get.call(this,e)}set(e,t){return this.proto(e).set.call(this,e,t)}}const ut=e=>e instanceof et?e:new mt(e),ht=e=>{const t=(t,...n)=>st(e(ut(t),...n));return t.fn=e,t},pt=[],gt=e=>e instanceof Function?e:t=>e===t,ft=e=>(t,n,i=pt)=>ut(t).entries().reduce(((t,[n,a])=>ft(e)(a,t,i.concat(n))),e(n,[i,ut(t)])),xt=ht(((e,[t,n])=>{const[i,...a]=t;return e.set(i,a.length?xt(e.get(i),[a,n]):n)})),bt=ht(((e,t)=>t.reduce(xt.fn,e))),yt=e=>ft(((e,[t,n])=>vt(n)?[...e,[t,st(n)]]:e))(e,[]),vt=e=>0===e.size();ht(((e,t=pt)=>t.reduce(((e,t)=>e.get(t)),e)));const Nt=ht(((e,[t,...n])=>n.length?e.set(t,Nt(e.get(t),n)):e.filter((([e])=>e!==t)))),wt=(Ct=["$ref"]).map(((e,t)=>n=>gt(e)(n[t+n.length-Ct.length]))).reduceRight(nt,tt);var Ct;const St=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(kt,e),kt=it([at,(e,t)=>e[parseInt(t,10)]],[lt,(e,t)=>e[t]],[tt,rt]),It=(e,t)=>((e,t={})=>n=>bt(t,yt(n).map((t=>e(t)))))((([e,n])=>{return wt(e)?[(i=e,i.slice(0,-1)),St(t(n),n)]:[e,n];var i}))(e),Tt=e=>yt(e).filter(((e=rt)=>([t])=>e(t))(wt)),Bt=e=>{return t=Tt(e).map((([,e])=>e)),[...new Set(t)];var t};async function Pt(e,t){try{return e?await Rt(e,t):null}catch(e){console.error(e)}return null}const Rt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),Dt=e=>[...new Set(e)],_t={},Mt=["/portal-resources"],At=(e,t)=>It(e,(e=>t?.[e])),zt=(e,t)=>{const n=Bt(e),[l,r]=i({});return a((()=>{n.length&&(async e=>Object.fromEntries((await Promise.allSettled(Dt(e).filter((e=>!Mt.some((t=>e.startsWith(t))))).map((async e=>[e,_t[e]||=await Rt(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(n).then(r)}),[n.join()]),n.length?At(e,{...t,...l}):e};function Et(e,t={}){const n=d((t=>{const n=zt((({block:e,options:t,className:n,defaultPadding:i,padding:a,isTheme:l,version:r,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...n})}));return Object.assign(n,t),n}const Ot=Et((({className:e,padding:t,defaultPadding:n,...i})=>o(g,{className:u("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...i,children:o(Je,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...i})})),{childrenTypes:["UnitBlock"]}),Ft=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=r((()=>Vt(0,t?.length)),[t]),i=t?.[n];return i?o(Ot,{suppressHydrationWarning:!0,...i,...e}):o(g,{...e,children:o(f,{})})})),Vt=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),Lt=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const n=String(e.getDate()).padStart(2,"0"),i=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getFullYear());return t?`${a}-${i}-${n}`:`${n}.${i}.${a}`}},jt=e=>e?.replace(/[^+\d]/g,"");const qt=e=>e?{phone:jt(e)}:{},$t=(e,t="birthday")=>e?{[t]:Lt(e)}:{},Ut=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),Wt=(e,t=!0)=>({[t?"email":"mail"]:e}),Ht=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:jt(e)}:{},Yt=({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:i,params:a}of e)t[i??""]?.(n,a)},Kt="rshb-query-params";function Gt(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(Kt)||"";return e&&globalThis.sessionStorage?.setItem(Kt,e),e}function Xt(e){if(!e)throw new Error("Value should be fulfilled");return e}const Jt=e=>t=>{const[,n]=Xt(e.find((([e])=>e(t))));return n(t)},Zt=e=>Jt(e.map((([e,t])=>[e,()=>t])));Zt.if=e=>new Qt(void 0,e);class Qt{parent;predicate;unit;get entry(){return[Xt(this.predicate),Xt(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new Qt(this,e)}then(e){return new Qt(this.parent,this.predicate,e)}else(e){return Jt([...en(this),[()=>!0,e]])}}const en=e=>[...e?.parent?en(e.parent):[],e.entry],tn=e=>{const t=e.target?.closest("a");if(A(t?.href)&&!t?.href?.startsWith(globalThis.location?.origin)){e.preventDefault(),e.stopPropagation();const n=(e=>{const t=Gt();if(!A(e)||!t)return e;const n=new URL(e);for(const[e,i]of new URLSearchParams(t))n.searchParams.set(e,i);return n.toString()})(t?.href)||t?.href;if(n){nn(t?.target)?.(n)}}},nn=Zt([[e=>"_blank"===e,e=>globalThis.open(e,"_blank")],[e=>"_parent"===e,e=>globalThis.parent&&(globalThis.parent.location.href=e)],[e=>"_top"===e,e=>{globalThis.top&&(globalThis.top.location.href=e)}],[()=>!0,e=>globalThis.location&&(globalThis.location.href=e)]]);function an(){return an._impl()}an._impl=()=>({forwardQuery:tn}),an.setup=e=>{an._impl=e};const ln=e=>e,rn=(e,{resetOnSubmit:t,onSubmit:n,normalize:r}={})=>{const[s,o]=i(e),c=l(r?e=>o(e instanceof Function?t=>{const n=r(e(t));return sn(t,n)?t:n}:r(e)):o,[r]);a((()=>{r&&o(r)}),[r]);const[d,m]=i(!1),[u,h]=i({}),p=l(((e,t)=>{const{parse:n=ln,format:i=ln}=t||{};return{value:i(s[e]),isDirty:d||u[e],onChange:t=>{c((i=>({...i,[e]:n(t)}))),h((t=>({...t,[e]:!0})))}}}),[c,d,u]),g=l((e=>{c(e),h(e)}),[]),f=l((()=>{c(e),m(!1),h({})}),[e]),x=l((e=>(e.preventDefault(),t?f():m(!0),n&&n(s,e),s)),[n,s]);return[s,{isDirty:d||Object.values(u).some(Boolean),field:p,update:g,reset:f,onSubmit:x}]},sn=(e,t)=>e&&t&&Object.keys({...e,...t}).every((n=>e[n]===t[n])),on=d((e=>{const{className:t,title:n,children:i,...a}=e;return o(g,{className:t,defaultPadding:"p-6xl",...a,children:c("div",{className:"container max-w-[978px] space-y-lg",children:[n?o(N,{headingType:"h3",title:n,className:"@xl:text-center"}):null,i]})})})),cn=e=>"OUTSERVICE"===e?"/api/v1/outservice/outserviceregions":void 0;function dn(e=!1){const[t,n]=i(e),a=l((()=>n(!0)),[]),r=l((()=>n(!1)),[]),s=l((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:a,setFalse:r,toggle:s}]}function mn(e,t,n,i){a((()=>{if(e&&n)return e.addEventListener(t,n,i),()=>{e.removeEventListener(t,n,i)}}),[e,t,n])}function un(e){const t=s(null),n=l((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return mn(globalThis.document,"click",n),t}const hn=({label:e,errors:t})=>e&&t?`${e}*`:e,pn=()=>{},gn="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",fn=e=>e?o(Me,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,xn=d((({key:e,className:t="",id:n,name:i,type:r="text",label:d,placeholder:m,value:h="",valid:p=!0,children:g,onChange:f,onFocus:x,onBlur:b,pattern:y,autoFocus:v=!1,isTextarea:N=!1,disabled:w=!1})=>{const C=s(null),S=l((e=>{const t=(e.target?.value||"").trimStart();f&&f(t)}),[f]);a((()=>{v&&C.current?.focus()}),[v,C]);const k=g?"pr-3xl":"",I=bn(p);return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[fn(d),N?o("textarea",{className:u("block resize-y min-h-24",yn,I),id:u("textarea",n),name:i||n,placeholder:m,value:h,onChange:S,onFocus:x,onBlur:b,disabled:w},e):o("input",{type:r,className:u("h-14",yn,k,I),ref:C,id:n,name:i||n,placeholder:m,value:h,onChange:S,onFocus:x,onBlur:b,pattern:y,disabled:w},e)]}),g]})})),bn=e=>e?gn:"border-error",yn="w-full border rounded-md text-primary-text outline-none p-m",vn=e=>o("div",{className:"h-6",children:e?o(Me,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),Nn=e=>e?.value||"",wn={url:"suggest/address"},Cn={name:{url:"suggest/fio",requestData:{parts:["NAME"],gender:"UNKNOWN"}},surname:{url:"suggest/fio",requestData:{parts:["SURNAME"],gender:"UNKNOWN"}},middleName:{url:"suggest/fio",requestData:{parts:["PATRONYMIC"],gender:"UNKNOWN"}},email:{url:"suggest/email"},dulSubdivisionCode:{url:"suggest/fms_unit",responseItemHandler:e=>e?.data?.code?.replace("-","")||""},dulIssuedBy:{url:"suggest/fms_unit"},organizationName:{url:"suggest/party"},inn:{url:"suggest/party",responseItemHandler:e=>e?.data?.inn||""},addressRegistration:wn,addressFact:wn,organizationAddress:wn,addressCourier:wn},Sn=()=>({open:(e,t)=>de.fire("popup",{type:"open",popup:e,...t}),update:(e,t)=>de.fire("popup",{type:"update",popup:e,...t}),close:()=>de.fire("popup",{type:"close"})}),kn=d((({options:e,onChange:t})=>o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",children:e?.map(((e,n)=>o("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem",onMouseDown:()=>t(e),children:o("span",{className:"min-h-6",children:e.processedValue})},n.toString())))})));function In({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),h=s(t),[p,g]=i([]),f=Sn(),x=Cn[n],b=l((()=>{h.current=t,f.close()}),[t]),y=l((e=>{b(),h.current=e.processedValue,c&&c(e.processedValue),d&&d(e)}),[b,c]),v=s(null),N=r((()=>async e=>{if(!x)return;const t=await(e=>{const{url:t,query:n,queryPrefix:i,requestData:a={},responseItemHandler:l=Nn}=e,r=(s=l,e=>(e?.suggestions||[]).map((e=>{const t=s(e);return{...e,processedValue:t}})));var s;const o=`${i?`${i}, `:""}${n}`;return fetch(`/api/v1/suggestions/${t}`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:10,...a,query:o})}).then((e=>e.json())).then(r)})({url:x.url,responseItemHandler:x.responseItemHandler,requestData:{...x?.requestData},query:e,queryPrefix:m});t?.length&&g(t)}),[m]),w=r((()=>((e,t=600)=>{let n;const i=(...a)=>{i.dispose(),n=setTimeout((()=>{e(...a)}),t)};return i.dispose=()=>{n&&clearTimeout(n)},i})(N,300)),[N]);return a((()=>{if(!e||!v.current||h.current===t)return void b();const n=v.current,{top:i,left:a,width:l,height:r}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.update(o(kn,{options:p,value:t,onChange:y}),{top:i+globalThis.scrollY+r,left:a,width:l})}),[e,p,t,y]),v}const Tn=d((({className:e,label:t,value:n="",placeholder:i,error:a,errors:r,onChange:s=pn,onDaDataChange:d,onBlur:m,isTextarea:h,type:p,name:g="",daDataQueryPrefix:f,maxLength:x,dadata:b=!1,disabled:y=!1})=>{const[v,{setFalse:N,setTrue:w}]=dn(),C=un(N),S=l((e=>{b&&!v&&w(),x?e.length<=x&&s(e):s(e)}),[b,v,s]),k=In({isOpen:v&&b,name:g,value:n,daDataQueryPrefix:f,onChange:s,onDaDataChange:d});return c("div",{className:u("shrink-0 w-full",e),ref:C,onBlur:N,onFocus:w,children:[o("div",{ref:k,children:o(xn,{disabled:y,type:p||"text","aria-label":t,label:hn({label:t,errors:r}),valid:Boolean(!a),value:n,onChange:S,onBlur:m,isTextarea:h,placeholder:Bn(i,r,t)})}),vn(a)]})})),Bn=(e,t,n)=>t&&!n?`${e}*`:e,Pn=e=>e?.text||e?.key||"",Rn=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,Dn=d((({popupRef:e,options:t,value:n,query:i,onChange:a,iconVersion:l})=>t?.length?o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",ref:e,children:Rn(t,i).map((e=>c("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem","aria-selected":e.key===n?.key,onClick:t=>{t.stopPropagation(),a&&a(e)},children:[o("span",{className:"min-h-6",children:Pn(e)}),o(W,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:l,className:u("absolute right-4 pt-3xs",{hidden:e.key!==n?.key})})]},e.key)))}):null));const _n=d((({className:e,label:t,options:n=[],value:r,valid:d=!0,isBorder:m=!0,placeholder:h="",isSearch:p=!1,iconVersion:g="black",onChange:f,disabled:x=!1})=>{const[b,{setFalse:y,setTrue:v}]=dn(),[N,w]=i(""),C=zn(x,n.length),S=b&&!C,k=l((()=>{w(""),y()}),[]),I=function({isOpen:e,options:t,value:n,query:i,onChange:r,onClose:c,iconVersion:d}){const m=Sn(),u=l((()=>{m.close(),c&&c()}),[c]),h=l((e=>{u(),r&&r(e)}),[u,r]),p=s(null),g=un(u);return a((()=>{if(!e||!p.current)return;const a=p.current,{top:l,left:r,width:s,height:c}=a.getBoundingClientRect();m.update(o(Dn,{popupRef:g,options:t,value:n,query:i,onChange:h,iconVersion:d}),{top:l+window.scrollY+c,left:r,width:s})}),[e,t,n,i,h]),p}({isOpen:b,options:n,value:r,query:N,onChange:f,onClose:k,iconVersion:g});return c("div",{className:u("space-y-xs",e),children:[fn(t),c("div",{className:u("relative",S?"z-20":"z-10"),ref:I,children:[c("div",{className:u("h-14 [&>*]:p-m pr-6 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden",An(m,d,C)),onClick:S?k:v,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:Pn(r)||h}),Mn(S,g)]}),p&&S?o("div",{className:u("absolute top-0 w-full z-20"),children:o(xn,{type:"text",autoFocus:!0,value:N,onChange:w})}):null]})]})})),Mn=(e,t)=>o(W,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),An=(e,t,n)=>u(e?"border rounded-md ":"",e&&!n?"hover:border-primary-hover":"",n?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error"),zn=(e,t)=>e||0===t,En=d((({className:e="",label:t,error:n,errors:i,...a})=>c("div",{className:e,children:[o(_n,{...a,valid:!n,label:hn({label:t,errors:i})}),vn(n)]}))),On=e=>!e?.length,Fn=e=>t=>n=>e(n)?[]:[t],Vn=Fn((e=>null!=e&&""!==e)),Ln="Некорректно заполненное поле",jn="Укажите регион, город/населенный пункт, улицу, дом",qn=e=>Vn(e??Ln),$n=e=>Fn((e=>e?.key&&""!==e?.key))(e??Ln),Un=e=>Fn((e=>"string"==typeof e&&e.length>0&&e.length<=2))(e??Ln),Wn=e=>Fn((e=>"string"==typeof e&&e.length>1&&ei(e)))(e??Ln),Hn=(e,t)=>Fn((t=>"string"==typeof t&&t.length>=1&&t.length<=e))(t??Ln),Yn=e=>Fn((e=>"string"==typeof e&&6===e.length))(e),Kn=e=>{return(t=/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/,Fn((e=>"string"==typeof e&&t.test(e))))(e);var t},Gn=Fn((e=>"boolean"==typeof e&&e))("Согласие обязательно"),Xn=e=>{const t=String(e).replace(/[^0-9]+/g,"");if(11===t.length){let e=0;for(let n=0;n<9;n++)e+=parseInt(t.charAt(n))*(9-n);return e>101&&(e%=101),100!==e&&101!==e||(e=0),e===parseInt(t.substr(9))}return!1},Jn=e=>Boolean(e.region&&e.city&&e.house),Zn=()=>Fn(Jn)(jn),Qn=/^[\u0400-\u04FF\d]+$/u,ei=(e="")=>Qn.test(e),ti=e=>{const t=new Date,n=new Date(t.getFullYear()-23,t.getMonth(),t.getDate()),i=new Date(t.getFullYear()-75,t.getMonth(),t.getDate());return!(!e||e>n||e<i)},ni={typeForm:qn(),surname:Wn("Укажите свою фамилию"),name:Wn("Укажите своё имя"),middleName:Wn("Укажите своё отчество"),region:$n(),addressBranch:$n(),phone:Kn("Укажите номер телефона"),secondaryPhone:Kn("Укажите номер телефона"),organizationPhone:Kn("Укажите номер телефона"),birthday:qn("Укажите дату рождения"),limitedBirthday:Fn(ti)("Допустимый возраст заёмщика - от 23 до 75 лет"),birthPlace:qn("Укажите место рождения"),education:qn("Выберите ваше образование"),housing:qn("Выберите тип жилья"),employment:qn("Выберите информацию о трудоустройстве"),organization:qn("Выберите тип организации"),amountWorkers:qn("Выберите информацию о количестве сотрудников"),employerActivities:qn("Выберите вид деятельности организации"),employerOrganization:qn("Выберите вид организации"),positionOrganization:qn("Выберите вашу должность"),dulSerie:(ii="Укажите серию паспорта",Fn((e=>"string"==typeof e&&4===e.length))(ii)),dulNumber:Yn("Укажите номер паспорта"),dulIssueDateField:qn("Укажите дату выдачи паспорта"),dulSubdivisionCode:Yn("Укажите код подразделения"),dulIssuedBy:qn("Укажите организацию, выдавшую паспорт"),email:(e=>Fn((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(e))("Укажите электронную почту"),fullName:Wn(),inn:(e=>Fn((e=>"string"==typeof e&&(10===e.length||12===e.length)))(e))("Укажите ИНН"),legalForm:qn("Укажите ОПФ"),organizationName:qn("Укажите наименование организации"),generalSeniority:Un("Укажите количество лет стажа"),lastJobExperience:Un("Укажите стаж на последнем месте работы"),experience5Years:Un("Укажите общий стаж за последние 5 лет"),jobsNumber:Un("Укажите количество мест работы за последние 5 лет"),beginDate:qn("Укажите дату заключения трудового договора"),addressFact:Zn(),partnerComments:qn(),collectionCount:qn(),comment:qn(),acquiringType:$n(),feedbackMethod:$n(),serviceType:$n(),serviceDirection:$n(),regionRetail:$n("Выберите регион"),meetingDay:qn(),product:qn(),localities:qn(),consentDataProcessing:Gn,annualRevenue:qn(),consentToReceiveMaterials:Gn,processPersonalDataFlg:Gn,consentProviderFlg:Gn,consentPfrFlg:Gn,consentOthersFlg:Gn,consentInformFlg:Gn,familyStatus:qn("Выберите семейное положение"),children:Hn(2,"Укажите количество детей"),familyMembers:Hn(2,"Укажите количество членов семьи"),dependents:Hn(2,"Укажите количество иждивенцев"),totalIncome:Hn(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:Hn(10,"Укажите сумму обязательных выплат"),snils:(e=>Fn(Xn)(e))("Некорректный номер СНИЛС"),conscription:qn(),armyIdFlg:Gn,sex:qn("Укажите свой пол"),addressRegistration:Zn(),organizationAddress:Fn((e=>Boolean(e.fiasCode&&e.city&&e.house)))(jn),participantDateRegistration:qn("Укажите дату регистрации"),retirementIncome:qn(),otherIncome:qn(),wages:qn(),mandatoryPayments:qn(),disablePeopleFlg:qn(),bankruptcyFlg:qn(),shareholderFlg:qn(),legalEntityName:qn(),bankEmployeeCode:qn(),partInBusiness:qn(),addressRetail:$n("Выберите адрес банка"),addressMatch:qn(),codeWord:(e=>Fn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&ei(e)))(e??Ln))("Необходимо ввести кодовое слово"),confirmationIncome:qn(),deliveryDate:qn("Укажите дату доставки"),addressCourier:Zn()};var ii;const ai=e=>{const t=(e=>Object.values(e.filter((e=>e)))?.map((e=>e.name)))(e.filter((e=>Boolean(e?.required))));return Object.fromEntries(t.map((e=>[e,ni?.[e||""]])).filter((([,e])=>e)))},li=(e,t)=>{const{value:n,isDirty:i}=e,a=i?t(n):[];return{...e,errors:a,error:a[0]}},ri=(e,t,n=!1)=>n&&t?li(e,t):e,si=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],oi=d((({field:e,input:t})=>o(En,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:si,...ri(e("acquiringType"),ni.acquiringType,t?.required)}))),ci=(e="")=>Boolean("trade"===e||"all"===e),di=e=>null!=e,mi=new Map,ui=e=>Boolean(e?.every((e=>Array.isArray(e)?ui(e):!e||"string"==typeof e))),hi=e=>ui(e)?e.toString():"";function pi(e,t,{fallback:n,cache:l}={}){const s=r((()=>gi(e)),[e]),[o,c]=i(void 0),[d,m]=i(void 0);a((()=>{if(!s.some(di))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await((e,t=mi)=>n=>{const i=hi(n),a=t.get(i);if(i&&di(a))return a;const l=e(...n);return i&&di(l)&&t.set(i,Promise.resolve(l)),l})(t,l)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,l,s]);const u=n&&(e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]))(s)&&n[s[0]];return{data:!o&&u?u:o,error:d,mutate:()=>Promise.resolve(void 0)}}function gi(e){return Array.isArray(e)?e:e instanceof Function?gi(e()):[e]}const fi=[];const xi=async e=>await Pt(e,{method:"GET"})||fi;function bi(e=!1){const{data:t}=pi("/api/v1"+(e?"/premiumBranchesByRegions":"/branchesByRegions"),Rt);return Array.isArray(t)?t:[]}const yi=d((({field:e,input:t,isPremium:n=!1})=>{const i=e("region"),l=i?.value?.key,r=i?.value?.text,s=n?bi(n)?.find((e=>e?.region===r))?.branches:function(e){const{data:t}=pi(e?`/api/v1/branches?regionCode=${e}`:null,xi);return t||fi}(l)?.filter((e=>e?.address));return a((()=>{""!==i?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[i?.value]),o(En,{label:"Отделение",placeholder:"Выберите отделение",options:(s||[]).map((({address:e=""})=>({key:e,text:e}))),...ri(e("addressBranch"),ni.addressBranch,t?.required),isSearch:!0})})),vi=d((({field:e,input:t})=>{const n="addressFact",i=e(n).value,{value:r}=e("addressMatch");a((()=>{r&&e("addressFact")?.onChange?.(e("addressRegistration").value)}),[r,e("addressRegistration").value]);const s=l((t=>{e?.(n)?.onChange?.({apartment:t?.data?.flat,city:t?.data?.city,district:t?.data?.area_with_type,fullAddress:t?.value,fiasCode:t?.data?.fias_id,house:t?.data?.house,locality:t?.data?.settlement_with_type,okatoRegionCode:t?.data?.okato,postcode:t?.data?.postal_code,region:t?.data?.region,regionCode:t?.data?.region_kladr_id?t?.data?.region_kladr_id.substring(0,2):"",street:t?.data?.house,qc:t?.data?.qc,qcComplete:t?.data?.qc_complete,qcHouse:t?.data?.qc_house})}),[]),c=l((t=>{e?.(n)?.onChange?.({...e(n).value,fullAddress:t})}),[]);return o(Tn,{label:"Адрес",disabled:r,...ri(e(n),ni[n],t?.required),value:i.fullAddress,onChange:c,...t,onDaDataChange:s})})),Ni=(e,t)=>Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t).value,wi=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",i=e(n).value,a=l((t=>{e?.(n)?.onChange?.({apartment:t?.data?.flat,city:t?.data?.city,district:t?.data?.area_with_type,fullAddress:t?.value,fiasCode:t?.data?.fias_id,house:t?.data?.house,locality:t?.data?.settlement_with_type,okatoRegionCode:t?.data?.okato,postcode:t?.data?.postal_code,region:t?.data?.region,regionCode:t?.data?.region_kladr_id?t?.data?.region_kladr_id.substring(0,2):"",street:t?.data?.house,qc:t?.data?.qc,qcComplete:t?.data?.qc_complete,qcHouse:t?.data?.qc_house})}),[]),r=l((t=>{e?.(n)?.onChange?.({...e(n).value,fullAddress:t})}),[]);return o(Tn,{disabled:t?.filledByEsia&&Ni(e,n),label:"Адрес",...ri(e(n),ni[n],t?.required),value:i.fullAddress,onChange:r,...t,onDaDataChange:a})})),Ci=d((({className:e,viewBox:t,fill:n="none",width:i,height:a,paths:l,...r})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:i,height:a,children:l.map((({d:e,fill:t,...n},i)=>{const a={...r,...n};return o("path",{d:e,fill:t||"currentColor",stroke:a.stroke,strokeLinecap:a.strokeLinecap,strokeLinejoin:a.strokeLinejoin,strokeWidth:a.strokeWidth,strokeMiterlimit:a.strokeMiterlimit},i)}))}))),Si="appearance-none w-5 h-5 border-solid flex-none",ki=[{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",fillRule:"evenodd",clipRule:"evenodd",fill:"white"}],Ii=d((({className:e,value:t,text:n,disabled:i,isRadio:a,onChange:r})=>{const s=l((e=>{i||(e.preventDefault(),r&&r(!t))}),[r,i,t]),d=a?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(Ci,{paths:ki,className:"absolute left-1 ml-px block",width:"11",height:"9",fill:"white",viewBox:"0 0 11 9"});return o("div",{className:e,children:c("label",{className:u("flex items-center relative group/box",Bi(i)),onClick:s,children:[o("div",{className:u(Si,"m-0",a?"rounded-full border-2":Ri(t),!i&&t?"border-primary-main":"border-gray",i?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:Pi(a),"aria-checked":Boolean(t),"aria-disabled":Boolean(i),"aria-label":n}),t?d:null,Ti(n)]})})})),Ti=e=>e?o("div",{className:"ml-s",children:o(Me,{size:"text-l",font:"font-light",children:e})}):null,Bi=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",Pi=(e=!1)=>e?"radio":"checkbox",Ri=(e=!1)=>u("rounded border",{"bg-primary-main":e}),Di=d((({className:e,text:t,value:n,key:i,disabled:a,error:l,onChange:r})=>c("div",{className:u("shrink-0",e),children:[o(Ii,{text:t,value:n,disabled:a,onChange:r},i),vn(l)]}))),_i=d((({field:e,input:t})=>o(Di,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...ri(e("addressMatch"),ni.addressMatch,t?.required)}))),Mi=d((({color:e="text-primary-main",position:t="absolute",blur:n=!0})=>o("div",{className:u("flex justify-center items-center h-full w-full z-50",t,{"backdrop-blur":n}),children:o("div",{className:u("inline-block h-28 w-28","animate-spin rounded-full","border-8 border-solid border-current","border-r-transparent",e),role:"status"})}))),Ai="/icons/MapMarkerClusterIcon.svg",zi="/icons/MapMarkerClusterYellowIcon.svg";function Ei({yandexMaps:e,map:t,points:n,isLoad:i}){if(i||!n)return;if(t.geoObjects.removeAll(),!n.length)return;const a=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),l=Oi("offices",e,a);if(n.length&&n.every((e=>"type"in e))){const i=Oi("workplaces",e,a),r=Fi(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=Fi(n.filter((e=>"offices"===e.type)),"offices",e);l.add(s),i.add(r),t.geoObjects.add(i),t.geoObjects.add(l)}else{const i=Fi(n,"offices",e);l.add(i),t.geoObjects.add(l)}t.setBounds(e.util.bounds.fromPoints(n.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const Oi=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?Ai:zi,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),Fi=(e,t,n)=>e.map((({coords:e,content:i})=>new n.Placemark(e,{balloonContentHeader:i?.header,balloonContentBody:i?.body,balloonContentFooter:i?.footer,hintContent:i?.hint},{iconLayout:"default#image",iconImageHref:"offices"===t?Ai:zi,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),Vi={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},Li={...Vi,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},ji=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(Li).join(" ")} ${n}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.current.geoObjects.add(t.geoObjects)}))},children:o(W,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),qi=e=>globalThis[e],$i=(e,t)=>{const n=document.getElementById(t);if(n){const t=qi(e);return t?Promise.resolve(t):new Promise((t=>{n.addEventListener("load",(()=>{t(qi(e))}))}))}return new Promise(((n,i)=>{const a=document.createElement("script");a.src=t,a.async=!0,a.id=t,a.addEventListener("load",(()=>{n(qi(e))})),a.addEventListener("error",(e=>{i(e)})),document.head.appendChild(a)}))};const Ui=()=>function(e,t,n=!0){const[l,r]=i(void 0);return a((()=>{let i=!0;return $i(e,t).then((e=>{i&&r(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(i=!1,n){const e=document.getElementById(t);e&&document.head.removeChild(e),r(void 0)}}}),[e,t,n]),l}("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${M.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1),Wi={...Vi,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},Hi=d((({yandexMaps:e,direction:t="in"})=>{const n="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const n=e.current.getZoom(),i="in"===t?n+1:n-1;e.current.setZoom(i,{checkZoomRange:!0})},className:`${Object.values(Wi).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(W,{name:n,width:"20",height:"16"})})})),Yi=[55.753995,37.614069],Ki=d((({points:e,className:t="",zoom:n=5,isLoad:i,selectedAddress:l})=>{const r=s(null),d=s(null),m=Ui();if(a((()=>{r.current?Ei({yandexMaps:m,map:r.current,points:e,isLoad:i}):m?.ready((()=>{r.current||(r.current=new m.Map(d.current,{center:Gi(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),Ei({yandexMaps:m,map:r.current,points:e,isLoad:i})})),r.current&&l&&m?.geocode(l).then((e=>{const t=e.geoObjects.get(0).geometry.getCoordinates();r.current.setCenter(t),r.current.setZoom(18)}))}),[m,e,n,i,l]),!m)return null;const h="z-10";return c("div",{ref:d,className:u("relative","w-full",t),children:[i?o(Mi,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(Hi,{yandexMaps:r}),o(Hi,{yandexMaps:r,direction:"out"})]}),ji(r,m,u("right-2 top-80",h))]})})),Gi=e=>{const t=[Ji(Xi(e,0)),Ji(Xi(e,1))];return t.every((e=>e))?t:Yi},Xi=(e,t)=>e.map((e=>e.coords?.[t])),Ji=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,Zi=async(e,t,n)=>{try{return(await Qi(e,t,n)).json()}catch(e){return console.error(e),null}};async function Qi(e,t,n){return globalThis?.fetch?.(`/api/v1${e}`,{method:t,headers:{"Content-Type":"application/json",...ea()},credentials:"include",body:n?JSON.stringify(n):null})}const ea=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},ta=e=>Number(e.toString().replace(",",".")),na=d((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:n=!1,renderFoldableSection:a,renderFoldButton:r})=>{const[s,o]=i(n),d=l((()=>{o((e=>!e))}),[]),m=a({isUnfolded:s,onToggle:d}),u=r?r({isUnfolded:s,onToggle:d}):null;return c("div",t?{className:e,role:"group",children:[u,m]}:{className:e,role:"group",children:[m,u]})}));const ia=d((({className:e="",isUnfolded:t,children:n})=>{const i=s(null),l=function(e,t){const n=s(null);return a((()=>{const t=n?.current;if(!t)return;const i=new ResizeObserver((n=>{e(t,n[0])}));return i.observe(t),()=>{i.disconnect()}}),[e,...t]),n}((e=>{i.current&&(i.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:i,className:`transition-max-h duration-300 overflow-hidden ${i.current||!t?"max-h-0":""} `,children:o("div",{className:e,ref:l,children:n})})})),aa=d((({value:e,subText:t,children:n,isPhone:i,...a})=>{const l=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[l.length,n,t].every((e=>!e))?null:la({textItems:l,subText:t,children:n,isPhone:i,...a})})),la=({label:e,labelSize:t="text-m",textItems:n,subColor:i,subText:a,className:l,children:r,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",l),children:[e?o(Me,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||ra(n,s),a?o(Me,{color:i,size:"text-m",children:a}):null]}),ra=(e,t)=>e.filter(Boolean).map(((e,n)=>o(Me,{size:"text-l",children:t?o("a",{href:`tel:${sa(e)}`,children:e.trim()}):e.trim()},String(n)))),sa=e=>e.replace(/\D/g,""),oa=d((({className:e,children:t})=>o("div",{className:u("flex flex-col sm:flex-row sm:border-t sm:border-solid sm:border-main-divider py-xl gap-x-6xl gap-y-xl",e),children:t}))),ca=e=>{const t=ma(e);return o(aa,{label:"Режим работы",value:t,className:"max-w-none"})},da=({workTime:e="",lunchHour:t="",daysOff:n=""},i=!1)=>e?[`${i?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",ma=e=>{const t=e.find((e=>"workingSaturday"!==e.key&&Boolean(e.status)&&Boolean(e.workTime))),n=e.find((e=>"workingSaturday"===e.key&&Boolean(e.status)&&Boolean(e.workTime))),i=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[da({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":i}),da({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:i},!0)].filter(Boolean)},ua=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],ha=e=>ua.map((([t,n,i])=>({key:t,title:i,short:n,status:Boolean(e?.[t]),get workTime(){return"workingSaturday"===t?e?.workTimeSaturday:e?.workTime},get lunchHour(){return"workingSaturday"===t?e?.lunchHourSaturday:e?.lunchHour},get hasLunch(){return/\d+/.test(this.lunchHour??"")}}))),pa=e=>{if(!e)return null;const t=ga(e);return c(oa,{className:"border-none",children:[o(aa,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(fa)})}),o(aa,{label:"Режим работы",className:"max-w-none",children:o(Me,{children:e})})]})},ga=e=>{const t=ua.map((([,e])=>({short:e,status:!0}))),n=e.split("/")??[],i=n[n.length-1]?.toLowerCase();return i?.includes("выходной")?t.map((e=>({...e,status:!i?.includes(e.short.toLowerCase())}))):t},fa=({short:e,status:t},n)=>o("div",{className:u("w-9 h-9 rounded-md flex items-center justify-center",t?"bg-green-more-light text-green-dark":"bg-error/30 text-error"),children:o(Me,{size:"text-xs",children:e})},String(n)),xa=({currency:e,buyExchangeRate:t,saleExchangeRate:n},i)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(aa,{label:"Валюта",value:e.currency}):null,t?o(aa,{label:"Купить",value:String(t)}):null,n?o(aa,{label:"Продать",value:String(n)}):null]},String(i)),ba={yellow:{border:"border-yellow-light",text:"text-yellow"},green:{border:"border-green-more-light",text:"text-green-dark"},gray:{border:"border-gray",text:"text-secondary-text"},red:{border:"border-error/30",text:"text-error"}},ya=d((({className:e,children:t,color:n="gray"})=>c("div",{className:u("sm:p-s sm:border sm:border-green rounded-md flex items-center h-fit",ba[n].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(ne,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(Me,{size:"text-m",color:ba[n].text,children:t})]}))),va=(new Date).getDay(),Na=e=>{const[t]=e?.slice(va-1)??[];if(!t)return null;const{lunchHour:n,status:i,workTime:a,hasLunch:l}=t;return i?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[a?o(ya,{color:"green",children:a}):null,n&&l?o(ya,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(ya,{color:"red",children:"Выходной"})},wa=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",Ca=({title:e,status:t,workTime:n,lunchHour:i,hasLunch:a},l)=>o(aa,{label:e,value:t&&n?n:"",subText:wa({lunchHour:i,hasLunch:a,status:t}),subColor:!t||a?"text-error":"text-green-dark"},String(l)),Sa=["ArrowDownIcon","ArrowUpIcon"],ka=["Подробнее","Скрыть"],Ia=({isUnfolded:e,onToggle:t})=>c("button",{className:"w-full py-2xl cursor-pointer text-primary-main flex items-center border-b border-solid border-main-divider",onClick:t,type:"button",children:[o("div",{className:"pr-m",children:ka[Number(e)]}),o(W,{className:"text-primary-text",name:Sa[Number(e)],width:"16",height:"16"})]}),Ta=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,Ba=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,Pa=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,Ra=({name:e,address:t,phone:n,fax:i,phoneBusiness:a,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m},u)=>{if(!d)return null;const h=ha(d);return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(Me,{size:"text-h4",children:e}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Me,{size:"text-l",children:t})]}):null]}),Na(h)]}),o("div",{className:"hidden sm:block",children:Da({phone:n,fax:i,phoneBusiness:a,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(na,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ia,{isUnfolded:e,children:Da({phone:n,fax:i,phoneBusiness:a,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Ia({isUnfolded:e,onToggle:t})})]},String(u))},Da=({phone:e,fax:t,phoneBusiness:n,phoneNatural:i,phoneCallCentre:a,phoneCurrencyControl:l,workSchedule:r,exchangeRate:s})=>{const d=ha(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(oa,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(aa,{label:"Факс",value:t,isPhone:!0}),o(aa,{label:"Телефон филиала",value:e,isPhone:!0}),o(aa,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(aa,{label:"Обслуживание физических лиц",value:i,isPhone:!0}),o(aa,{label:"Для консультаций по валютному контролю",value:l,isPhone:!0}),o(aa,{label:"Контакт-центр",value:a,isPhone:!0})]}),r?.isMatchesPattern?o(oa,{children:o(aa,{label:m,labelSize:"text-l",className:"w-full max-w-none",children:o("div",{className:"flex flex-wrap gap-xs sm:justify-between pt-xs",children:d?.map(Ca)})})}):c(oa,{children:[o(aa,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(fa)})}),ca(d)]}),r?.businessScheduleVisibleTag?pa(r?.businessScheduleDescription):null,s?.currencies?.length?o(oa,{className:"flex-wrap",children:s?.currencies?.map(xa)}):null]})},_a=({name:e="",address:t="",workSchedule:n})=>{const i=(a=e)?`${a?.charAt(0)?.toUpperCase()}${a?.slice(1)}`:"";var a;const l=`${t} ${(e=>{const t=ha(e),n=e?ma(t):"",i=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?Ta(n):Pa(n,i):Ba(n):""})(n)}`;return{header:i,body:l}},Ma=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),Aa=d((({children:e})=>Ma?e:null)),za={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},Ea={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",locationDisabledPeople:"Для маломобильных",designDisabledPeople:"Для слабовидящих",remoteWorkplace:"Удаленное рабочее место",serviceDisabledPeople:"Для маломобильных граждан"},Oa={workingSaturday:e=>Boolean("workSchedule"in e&&e.workSchedule?.workingSaturday),premiumService:e=>Boolean("premiumService"in e&&e.premiumService),privateBanking:e=>Boolean("privateBanking"in e&&e.privateBanking),remoteWorkplace:e=>Boolean("workScheduleDescription"in e),serviceDisabledPeople:e=>Boolean("serviceDisabledPeople"in e&&e.serviceDisabledPeople),sellingCoins:e=>Boolean("sellingCoins"in e&&e.sellingCoins),buyingCoins:e=>Boolean("buyingCoins"in e&&e.buyingCoins),bullionOperations:e=>Boolean("bullionOperations"in e&&e.bullionOperations),preciousMetalsOperations:e=>Boolean("preciousMetalsOperations"in e&&e.preciousMetalsOperations),transferringDataToBiometricSystem:e=>Boolean("transferringDataToBiometricSystem"in e&&e.transferringDataToBiometricSystem)};function Fa({disabled:e,onClick:t}){return n=>{!e&&t&&t(n)}}const Va={primary:"text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active",secondary:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active"},La={primary:u("group-data-secondary:text-primary-main group-data-secondary:bg-white","group-data-secondary:hover:text-white group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active"),secondary:u("group-data-secondary:text-white group-data-secondary:bg-white/20","group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active")},ja=d((({children:e,...t})=>{const n=e=>({...e,onClick:ue(Fa(e))}),{className:i,version:a="primary",active:l,disabled:r,type:s="button",rounded:c=!0,role:d,onClick:m}=n(t);return o("button",{className:u("font-sans px-9 py-4","flex justify-center items-center gap-xs",{"text-white bg-primary-active":l,"bg-main-gray text-main-disabled cursor-not-allowed":r,"rounded-md":c},l||r?"":u(Va[a],La[a]),i),type:s,role:d,onClick:m,children:e})})),qa=(e,t)=>e&&"underlined"!==t?"primary":"secondary",$a=(e,t,n)=>{const i=qa("all"===t),a=qa("business"===t),l=(e,t,i)=>{const a=e.currentTarget===e.target&&"business"===t?r(i):i;return n(t),a},r=e=>e.filter((e=>e.workSchedule&&e.workSchedule.businessScheduleVisibleTag&&!e.workSchedule.businessScheduleDescription));return c("div",{className:"flex gap-lg flex-col sm:flex-row pb-lg",children:[o(ja,{"data-id":"all",onClick:t=>l(t,"all",e),version:i,children:"Для физических лиц"}),o(ja,{"data-id":"business",onClick:t=>l(t,"business",e),version:a,children:"Для юридических лиц"})]})},Ua=({__html:e,list:t,richVersion:n})=>e||t?.length?c("div",{className:"mb-2xl border-b sm:border border-main-divider sm:rounded-md",children:[e?o("div",{className:"mb-2xl",children:o(De,{__html:e,richVersion:n})}):null,t?.length?o("div",{className:"flex flex-col sm:flex-row gap-2xl sm:flex-wrap pb-2xl sm:pb-xl",children:t.map(((e,t)=>c("div",{className:"flex gap-xs items-center",children:[e?.image?o(ne,{image:e.image}):null,e?.text?o(Me,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,Wa="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",Ha=({filters:e,field:{field:t,reset:n},onlyOffice:i,labels:a})=>{const l=i?5:6,r=(e||[]).map((e=>o(Ii,{text:a[e],...t(e)},e))),[s,d]=l>0?[r.slice(0,l),r.slice(l)]:[r,[]];return o("div",{children:e?.length?o("div",{children:o(na,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[o("div",{className:Wa,children:s}),o(ia,{className:Wa,isUnfolded:e,children:d})]}),renderFoldButton:Ya(n,i)})}):null})},Ya=(e,t=!1)=>({isUnfolded:n,onToggle:i})=>c("div",{className:"flex space-x-lg",children:[t?o(ve,{version:"transparent",className:"text-secondary-text [&>*]:p-0",appendRight:o(W,{name:["ArrowDownIcon","ArrowUpIcon"][Number(n)],width:"16",height:"16"}),text:["Больше фильтров","Меньше фильтров"][Number(n)],onClick:i}):null,o(ve,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:e,children:Ka()})]}),Ka=()=>c("div",{className:"flex items-center",children:["Очистить фильтр",o(W,{name:"CloseIcon",width:"16",height:"16",className:"ml-2xs"})]}),Ga=(e,t)=>o("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:c(N,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(Me,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}),Xa=()=>{},Ja=e=>"all"===e?"block":"hidden",Za=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:a=[],renderCard:l=Xa,renderRemoteWorkplaceCard:r=Xa,getBalloon:s=Xa,getBalloonRemoteWorkplaces:d=Xa,descriptionData:m,title:h})=>{const p=h?.includes("Офис"),[g,{field:f,reset:x}]=rn(za),{filteredItems:b,points:y,filteredRemoteWorkplaces:v,lengthItems:N}=nl({data:t,remoteWorkplaces:a,filtrationState:g,getBalloon:s,getBalloonRemoteWorkplaces:d}),[w,C]=i("all"),S={filters:el([...t,...a]),field:{field:f,reset:x},onlyOffice:p,labels:Ea};return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0",children:[Ga(h,N),m?Ua(m):null,p&&$a(t,w,C),o("div",{className:u("pb-3xl",Ja(w)),children:Ha(S)})]}),o("div",{className:"h-[600px]",children:o(Aa,{children:o(Ki,{points:y,isLoad:n,className:"h-full"})})})]}),c(Aa,{children:[b.map(l),v.map(r)]})]})})),Qa=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>Oa[t](e)))))},el=e=>Object.keys(za).filter((t=>e.filter((e=>Oa[t](e))).length)),tl=()=>{},nl=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:i=tl,getBalloonRemoteWorkplaces:a=tl})=>{const[l,s,o,c]=r((()=>{const l=Qa(e,n),r=Qa(t,n),s=[...l.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:i(e)}))),...r.map((e=>({type:"workplaces",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:a({address:e.address,workScheduleDescription:e.workScheduleDescription})})))].filter((e=>e.coords&&2===e.coords.length));return[l,s,r,l.length+r?.length]}),[e,t,n,i,a]);return{filteredItems:l,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},il=e=>{const{data:t,error:n}=pi(`/api/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,al);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},al=async e=>await Pt(e,{method:"POST"})||[],ll=d((({field:e,input:t})=>{const[n,l]=i([]),{data:r}=il("REGION_RF"),s=e("regionRetail")?.value||{},d=e("addressRetail");a((()=>{(async()=>{const e=await(async e=>(await Zi("/public-data/regionOffices","POST",{regionRfCd:{key:e},cashCardFlg:!0}))?.offices?.map((e=>({...e,gpsLatitude:ta(e.latitude??Yi[0]),gpsLongitude:ta(e.longitude??Yi[1])})))||[])(s?.key??"");l(e)})(),s?.key&&e?.("addressRetail")?.onChange?.("")}),[s.key]);const{points:m}=nl({data:n,filtrationState:{},getBalloon:_a}),u=Boolean(s?.key);return c("div",{children:[o(En,{label:"Адрес отделения",placeholder:"Выберите отделение",options:n.map((({id:e,address:t=""})=>({key:e?.toString()||"",text:t}))),...ri(e("addressRetail"),ni.addressRetail,t?.required&&u),isSearch:!0}),o("div",{className:"h-[600px]",children:o(Aa,{children:o(Ki,{points:m,isLoad:!r,className:"h-full",selectedAddress:d?.value?.text})})})]})})),rl=(e,{normalize:t,format:n})=>{const{value:a,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=i(!1),m=l((e=>{d(!0),r&&r(e)}),[]),u=l((()=>{d(!1),o&&o(t(a)),s&&s()}),[o,a]);return{value:c||!n?a:n(a),onFocus:m,onBlur:u}},sl=(e,t,n)=>Math.max(t,Math.min(e,n));function ol(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function cl({list:e=[],min:t,max:n,step:i,value:a=e[0]||t,disabled:l,onChange:r}){const s=e.length?e.indexOf(a):a,d={backgroundSize:`${(100*(s>t?s-t:0)/(n-t)).toFixed(2)}% 100%`};return c("div",{children:[e.length?o("div",{className:"absolute w-full flex justify-between -bottom-[3px] px-m",children:e.map(((e,t)=>o("div",{className:u("w-2 h-2 rounded-full",s<=t||l?"bg-gray":"bg-primary-main")},String(t))))}):null,o("div",{className:"absolute inset-x-0 -bottom-1 px-m leading-[18px]",children:o("input",{className:"box-border w-full m-0 cursor-pointer slider relative z-10",style:d,type:"range",min:t,max:n,step:i,value:s,disabled:l,onChange:t=>{const n=ol(t.target?.value),i=e.length?e[n]:n;r&&r(i||0)}})})]})}const dl=1,ml=100,ul=d((e=>{const{className:t,title:n,items:i=[],list:a=[],min:r=(a.length?0:dl),max:s=(a.length?a.length-1:ml),step:d=1,value:m=a[0]||r,disabled:h=!1,onChange:p}=e,g=rl(e,{normalize:(e=0)=>a.length?hl(a)(e):sl(e,r,s),format:We()}),f=l((e=>{p&&p(ol(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(Me,{size:"text-m",font:"font-light",color:"text-primary-text",children:n}):null,o("input",{className:u("text-h3 w-full h-14","pl-m mt-xs box-border","text-primary-text",gn,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:f,...g}),cl({list:a,min:r,max:s,step:d,disabled:h,value:m,onChange:p})]}),pl(i)]})})),hl=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),pl=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(Me,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),gl=["От 1 000 ₽","До 1 000 000 000 ₽"],fl=d((({field:e})=>o(ul,{title:"Сумма, ₽",items:gl,min:1e3,max:1e9,...e("amount")}))),xl=Et((({field:e,source:t,label:n,fieldName:i,input:a,placeholder:l="Выберите из списка",isSearch:r=!1})=>{const s=t&&t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(En,{placeholder:l,label:n,options:s,isSearch:r,...ri(e(i),ni[i],a?.required)})})),bl=d((({field:e,input:t})=>{const{data:n}=il("EMPLOYEES_NUMBER");return o(xl,{field:e,source:n,label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),yl=d((({field:e,input:t})=>o(Tn,{label:"Годовая выручка, ₽",...ri(e("annualRevenue"),ni.annualRevenue,t?.required)}))),vl=d((({field:e,input:t})=>o(Di,{text:"Наличие военного билета",...ri(e("armyIdFlg"),ni.armyIdFlg,t?.required)}))),Nl=d((({field:e,input:t})=>o(Tn,{label:"Код представителя Банка",placeholder:"Введите код",type:"number",...ri(e("bankEmployeeCode"),ni.bankEmployeeCode,t?.required),...t}))),wl=d((({field:e})=>o(Tn,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e("bankEmpolee")}))),Cl=d((({field:e,input:t})=>o(Di,{text:"В отношении меня ведётся производство по делу о банкротстве",...ri(e("bankruptcyFlg"),ni.bankruptcyFlg,t?.required)}))),Sl=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:i,currentYear:a,min:l,max:r,onDateClick:s})=>{const c=[];let d=1;for(let m=0;m<6;m++){const u=[];for(let c=0;c<7;c++)if(0===m&&c<t)u.push(o("td",{},`empty-${c}`));else if(d>n)u.push(o("td",{},`empty-${c}`));else{const t=new Date(a,i,d),n=kl(t,e),c=Il(t,l,r);u.push(o("td",{children:o("div",{className:Tl(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},kl=(e,t)=>t&&e.toDateString()===t.toDateString(),Il=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),Tl=(e=!1,t=!1)=>u("p-s text-center rounded-md border",{"border-transparent hover:bg-gray":!e},t?"text-gray hover:bg-transparent":"cursor-pointer"),Bl=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Pl=d((({today:e,currentMonth:t,currentYear:n,min:i,max:a,onDateSelect:s=pn,setValue:d=pn})=>{const m=l((e=>{s(e),d(!1)}),[]),{firstDayOfWeek:u,totalDays:h}=r((()=>({firstDayOfWeek:new Date(n,t,1).getDay()-1,totalDays:new Date(n,t+1,0).getDate()})),[n,t]);return c("table",{className:"mx-auto",children:[o("thead",{className:"text-gray font-light",children:o("tr",{children:Bl.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:Sl({firstDayOfWeek:u,today:e,totalDays:h,currentYear:n,currentMonth:t,min:i,max:a,onDateClick:m})})]})})),Rl=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function Dl(e,t){const n=e.replace(/\D/g,"");if(""===n||e?.length===t.length)return e;const i=[...t],a=i.findIndex(_l),l=i.map(((e,t)=>Al(e)?i.slice(0,t).filter(Al).length:-1)),r=i.map(((e,t)=>Ml(e)?e:n.charAt(l[t])||e)),s=l.indexOf(n.length-1)+1;return r.slice(0,Math.max(a,s)).join("")}const _l=e=>"_"===e,Ml=e=>/\d/.test(e),Al=e=>_l(e)||Ml(e),zl=1940,El={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},Ol=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:l,disabled:r,onChange:d,onClick:m})=>{const h=s(null),[p,g]=i(l||"");return a((()=>{g(l||"")}),[l]),c("div",{onClick:()=>{null!==h.current&&h.current.focus(),m?.()},className:u("relative",n),children:[o("input",{ref:h,className:"h-full w-full px-m text-l text-black focus-visible:outline-none",value:p,type:"text",onChange:e=>{const t=e.target?.value;"string"==typeof t&&t?.length<11&&g(Dl(t,"__.__.____"))},onBlur:()=>{if(Fl(p)){const[n,i,a]=p.split(".");d?.(new Date(Number(a),Number(i)-1,Number(n))),e(Number(i)-1),t(Number(a))}else g(l||"")},disabled:r}),r?null:o(W,{className:"mr-s",...El})]})})),Fl=e=>{const[t,n,i]=e.split(".");if((e=>Number(e)>=zl&&Number(e)<=(new Date).getFullYear())(i)&&(e=>Number(e)>0&&Number(e)<13)(n)){const e=new Date(Number(i),Number(n)-1,1);let a=0;for(;e.getMonth()===Number(n)-1;)e.setDate(e.getDate()+1),a++;if(Number(t)>0&&Number(t)<=a)return!0}return!1},Vl=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:i,setSelectedMonth:a,setSelectedYear:l,disabled:r=!1})=>o(Ol,{onChange:i,disabled:r,onClick:e,value:t&&Lt(t),setSelectedMonth:a,setSelectedYear:l,className:u("flex justify-between items-center h-14 border rounded-md cursor-pointer hover:border-black active:border-black focus:border-black",n?"border-gray":"border-error")}),Ll=Rl.map((e=>({key:e}))),jl=Array.from({length:(new Date).getFullYear()-zl+1},((e,t)=>zl+t)).reverse().map((e=>({key:String(e)}))),ql=(e,t)=>{const n=new Date(e,t,1);let i=0;for(;n.getMonth()===t;)i++,n.setDate(n.getDate()+1);return i},$l=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:i,onChange:a})=>{i&&a?.(new Date(t,n,Math.min(e,i.getDate())))},Ul={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},Wl={className:"min-w-32",iconVersion:"black",isBorder:!1},Hl=d((({className:e="",label:t="",value:n,valid:r=!0,minDate:s,maxDate:d,disabled:m,onChange:h})=>{const[p,{setValue:g}]=dn(!1),[f,x]=i(n?.getMonth()||(new Date).getMonth()),[b,y]=i(n?.getFullYear()||(new Date).getFullYear()),{handlePrevMonth:v,handleNextMonth:N,handleSelectMonth:w,handleSelectYear:C,monthsOptions:S,yearsOptions:k,handleChangeVisibleCalendar:I,ref:T}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:i,onYearSelect:a,selectedYear:r,onChange:s,value:o})=>{const c=un(l((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:l((()=>e(!t)),[t]),handleNextMonth:l((()=>{n+1<=11?i(n+1):(i(0),a(r+1))}),[n]),handlePrevMonth:l((()=>{n-1>=0?i(n-1):(i(11),a(r-1))}),[n]),handleSelectMonth:l((({key:e})=>{i(Rl.indexOf(e));const t=ql(r,Rl.indexOf(e));$l({maxDateOfMonth:t,selectedYear:r,selectedMonth:Rl.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:l((({key:e})=>{a(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:Ll,yearsOptions:jl,ref:c}})({onYearSelect:y,onMonthSelect:x,onShowCalendar:g,selectedYear:b,selectedMonth:f,showCalendar:p,onChange:h,value:n}),B=((e,t)=>{const[n,l]=i(!1);return a((()=>{const n=()=>{if(e?.current){const{top:n}=e.current.getBoundingClientRect();l(n>t)}};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}),[e]),n})(T,370);return c("div",{className:u("space-y-xs",e),ref:T,children:[fn(t),c("div",{className:"relative",children:[Vl({handleChangeVisibleCalendar:I,value:n,valid:r,onChange:h,disabled:m,setSelectedMonth:x,setSelectedYear:y}),p&&!m?c("div",{className:u("absolute bg-white z-20 select-none",{"bottom-full":B}),children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:v,children:o(W,{...Ul,className:"-rotate-90 cursor-pointer"})}),o(_n,{onChange:w,value:{key:Rl[f]},options:S,...Wl}),o(_n,{onChange:C,value:{key:String(b)},options:k,...Wl}),o("div",{className:"my-auto",onClick:N,children:o(W,{...Ul,className:"rotate-90 cursor-pointer"})})]}),o(Pl,{today:n,currentMonth:f,currentYear:b,onDateSelect:h,min:s,max:d,setValue:g})]}):null]})]})})),Yl=d((({className:e,label:t,error:n,errors:i,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Hl,{label:hn({label:t,errors:i}),valid:Boolean(!n),...a}),vn(n)]}))),Kl=d((({field:e,input:t})=>o(Yl,{label:"Дата начала работы на текущем месте",...ri(e("beginDate"),ni.beginDate,t?.required),...t}))),Gl=d((({field:e,input:t})=>o(Yl,{label:"Дата рождения",...ri(e("birthday"),ni.birthday,t?.required)}))),Xl=d((({field:e,input:t})=>o(Tn,{label:"Место рождения",...ri(e("birthPlace"),ni.birthPlace,t?.required),...t,disabled:t?.filledByEsia&&Ni(e,"birthPlace")}))),Jl=d((({field:e,input:t})=>{const[n,l]=i([]),r=e("paymentSystem").value;return a((()=>{(async()=>{const e=await(async e=>{const t=await Qi("/dictionaryFiltered","POST",{type:"CARD_TYPE",presets:{paymentSystemType:e,creditProgramId:13}});return await(t?.json())})(r);l(e)})()}),[r]),o(xl,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t})})),Zl=d((({field:e,input:t})=>o(Tn,{label:"Количество детей до 18 лет",placeholder:"Введите значение",type:"number",...ri(e("children"),ni.children,t?.required),...t}))),Ql=d((({field:e,input:t})=>o(Tn,{label:"Кодовое слово",...ri(e("codeWord"),ni.codeWord,t?.required),...t}))),er=d((({field:e,input:t})=>o(Tn,{label:"Количество объектов инкассации",type:"number",...ri(e("collectionCount"),ni.collectionCount,t?.required)}))),tr=d((({field:e,input:t})=>o(Tn,{className:"col-span-2",...ri(e("comment"),ni.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),nr=d((({field:e,input:t})=>{const{data:n}=il("INCOME_CERT_UNITED");return o(xl,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t})})),ir=d((({field:e,input:t})=>{const{data:n}=il("MILITARY_STATUS");return o(xl,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),ar={processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в ПФР",docId:3},consentToReceiveMaterials:{text:"Согласен на получение информационных и аналитических материалов по электронной почте"}},lr=async(e,t=!1)=>{const n=await(async(e,t=!1)=>{const n=await Qi(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return n?await n.blob():new Blob})(e,t);return URL.createObjectURL(n)},rr=d((({className:e,onClose:t})=>o("button",{className:u("flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none",e),onClick:t,title:"Закрыть",type:"button",children:o(W,{name:"CloseIcon",width:"20",height:"20",iconVersion:"gray"})}))),sr=d((({className:e,head:t,children:n,onClose:i,onClick:a})=>{const{close:r}=me(),s=l((()=>{r(),i&&i()}),[i]);return c("div",{onClick:a,className:u("relative min-h-full bg-white pt-0 p-lg",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(rr,{className:"absolute top-0 right-0",onClose:s}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})})),or=async(e,t,n=!1)=>{const i=await lr(t,n);e(o(sr,{className:"my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0",children:n?o("img",{src:i}):o("iframe",{src:`${i}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"})}))},cr=d((({className:e,error:t,docId:n,...i})=>{const{open:a}=me(),l=Se();return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(Ii,{...i}),n?o(ve,{className:"text-primary-main",onClick:()=>or(a,n,l),children:o(Me,{children:"Ознакомиться"})}):null]}),vn(t)]})})),dr=d((({field:e,input:t})=>t&&t.name?o(cr,{text:ar[t.name]?.text,docId:ar[t.name]?.docId,...ri(e(t.name),ni[t.name],t?.required)}):null)),mr=d((({field:e,input:t})=>{const{data:n}=il("CREDIT_IN_RSHB");return o(xl,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком / \n вкладчиком с долей участия более 20% уставного капитала руководителем, \n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t})})),ur={horizontal:"@lg:flex-row",vertical:""},hr=d((({label:e,items:t,value:n,className:i,onChange:a,disabled:l=!1,orientation:r="horizontal"})=>c("div",{className:"grid gap-xs whitespace-nowrap",children:[e?o("div",{role:"radiogroup","aria-label":e,children:o(Me,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",ur[r],i),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(Ii,{isRadio:!0,text:t,value:n===e,onChange:()=>a&&a(e),disabled:l},String(e))))})]}))),pr=d((({className:e,label:t,onChange:n,error:i,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(hr,{label:hn({label:t,errors:a?.errors}),onChange:e=>n&&n(e),...a}),vn(i)]}))),gr=[{id:"rub",text:"Рубль"}],fr=d((({field:e,input:t})=>{const{value:n,onChange:i}=e("currency");return o(pr,{label:"Валюта",orientation:"horizontal",items:gr,value:n,onChange:e=>i?.(e),...ri(e("currency"),ni.currency,t?.required)})})),xr=d((({field:e,input:t})=>o(Yl,{label:"Дата доставки",...ri(e("deliveryDate"),ni.deliveryDate,t?.required)}))),br=d((({field:e,input:t})=>o(Tn,{label:"Количество иждивенцев",placeholder:"За исключение детей до 18 лет",type:"number",maxLength:2,...ri(e("dependents"),ni.dependents,t?.required),...t}))),yr=d((({field:e,input:t})=>o(Yl,{label:"Желаемая дата встречи",...ri(e("desiredMeetingDate"),ni.meetingDay,t?.required)}))),vr=d((({field:e,input:t})=>o(Di,{text:"Являюсь инвалидом",...ri(e("disablePeopleFlg"),ni.disablePeopleFlg,t?.required)}))),Nr="dulIssueDateField",wr=d((({field:e,input:t})=>o(Yl,{label:"Дата выдачи",...ri(e(Nr),ni.dulIssueDateField,t?.required),disabled:t?.filledByEsia&&Ni(e,Nr)}))),Cr="dulIssuedBy",Sr=d((({field:e,input:t})=>{const{value:n,onChange:i}=e("dulSubdivisionCode"),a=l((e=>{i?.(e?.data?.code?.replace("-",""))}),[]);return o(Tn,{disabled:t?.filledByEsia&&Ni(e,Cr),label:"Кем выдан",...t,...ri(e(Cr),ni.dulIssuedBy,t?.required),onDaDataChange:a,daDataQueryPrefix:n})})),kr=d((({field:e,input:t})=>o(Tn,{disabled:t?.filledByEsia&&Ni(e,"dulNumber"),label:"Номер документа",type:"number",maxLength:6,...ri(e("dulNumber"),ni.dulNumber,t?.required)}))),Ir=d((({field:e,input:t})=>o(Tn,{disabled:t?.filledByEsia&&Ni(e,"dulSerie"),label:"Серия документа",type:"number",maxLength:4,...ri(e("dulSerie"),ni.dulSerie,t?.required)}))),Tr="dulSubdivisionCode",Br=d((({field:e,input:t})=>{const n=l((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(Tn,{disabled:t?.filledByEsia&&Ni(e,Tr),label:"Код подразделения",type:"number",maxLength:6,...t,...ri(e(Tr),ni.dulSubdivisionCode,t?.required),onDaDataChange:n})})),Pr=d((({field:e,input:t})=>{const{data:n}=il("EDUCATION_LEVEL");return o(xl,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),Rr=d((({field:e,input:t})=>{const{required:n,...i}=t;return o(Tn,{label:"Электронная почта",...ri(e("email"),ni.email,n),...i})})),Dr=d((({field:e,input:t})=>{const{data:n}=il("ORGANIZATION_ACTIVITY_TYPE");return o(xl,{field:e,source:n,label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),_r=d((({field:e,input:t})=>{const{data:n}=il("ORGANIZATION_KIND");return o(xl,{field:e,source:n,label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),Mr=d((({field:e,input:t})=>{const{data:n}=il("EMPLOYMENT_INFO_UNITED");return o(xl,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),Ar=d((({field:e,input:t})=>o(Tn,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",type:"number",...ri(e("expenses"),ni.expenses,t?.required),...t}))),zr=d((({field:e,input:t})=>o(Tn,{label:"Стаж",placeholder:"За последние 5 лет",type:"number",maxLength:2,...ri(e("experience5Years"),ni.experience5Years,t?.required),...t}))),Er=d((({field:e})=>{const{value:t,onChange:n}=e("familyMembers"),i=e("familyStatus")?.value?.key,l="MARRIED"===i?2:1,r=Number(e("children")?.value),s=Number(e("dependents")?.value),c=l+r+s;return a((()=>{e?.("familyMembers")?.onChange?.(c)}),[i,r,s]),o(Tn,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:t,onChange:e=>n?.(e)})})),Or=d((({field:e,input:t})=>{const{data:n}=il("MARITAL_STATUS");return o(xl,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),Fr=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],Vr=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],Lr=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],jr=d((({field:e,input:t})=>o(En,{label:"Способ получения ответа",options:Lr,...ri(e("feedbackMethod"),ni.feedbackMethod,t?.required)}))),qr=d((({field:e,input:t})=>o(Tn,{label:"ФИО",...ri(e("fullName"),ni.fullName,t?.required),...t}))),$r=d((({field:e,input:t})=>o(Tn,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",...ri(e("generalSeniority"),ni.generalSeniority,t?.required),...t}))),Ur=d((({field:e,input:t})=>{const{data:n}=il("HOUSE_TYPE");return o(xl,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),Wr=d((({field:e,input:t})=>{const n=l((t=>{e?.("organizationName")?.onChange?.(t.data?.name?.short_with_opf),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(Tn,{label:"ИНН",type:"number",maxLength:12,...t,...ri(e("inn"),ni.inn,t?.required),onDaDataChange:n})})),Hr=d((({field:e})=>o(Di,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),Yr=d((({field:e,input:t})=>o(Tn,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",type:"number",maxLength:2,...ri(e("jobsNumber"),ni.jobsNumber,t?.required),...t}))),Kr=d((({field:e,input:t})=>o(Tn,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,...ri(e("lastJobExperience"),ni.lastJobExperience,t?.required),...t}))),Gr=d((({field:e,input:t})=>o(Tn,{label:"Наименование юридического лица",...t,...ri(e("legalEntityName"),ni.legalEntityName,t?.required)}))),Xr=d((({field:e,input:t})=>o(Tn,{label:"ОПФ",placeholder:"ООО, ПАО и др.",...ri(e("legalForm"),ni.legalForm,t?.required),...t}))),Jr="limitedBirthday",Zr=d((({field:e,input:t})=>o(Yl,{label:"Дата рождения",...ri(e(Jr),ni.limitedBirthday,t?.required),disabled:t?.filledByEsia&&Ni(e,Jr)}))),Qr=[];async function es(){const e=await Pt("/api/v1/outservice/outserviceregions");return e&&Array.isArray(e)?e:Qr}const ts=d((({field:e,input:t})=>{const n=e("region")?.value?.key,{data:i}=pi("outServiceRegions",es),l=i?.find((e=>e.code===n))?.localities?.map((e=>({key:e,text:e})));return a((()=>{""!==n&&e?.("localities")?.onChange?.("")}),[n]),o(En,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:l,...ri(e("localities"),ni.localities,t?.required),isSearch:!0})})),ns=d((({field:e,input:t})=>o(Tn,{label:"Обязательные выплаты",placeholder:"Введите значение",type:"number",...ri(e("mandatoryPayments"),ni.mandatoryPayments,t?.required),...t}))),is=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],as=d((({field:e,input:t})=>o(pr,{orientation:"horizontal",items:is,...ri(e("methodObtain"),ni.methodObtain,t?.required)}))),ls="middleName",rs=d((({field:e,input:t})=>{const n=l((t=>{const n=t?.data?.gender;n&&"UNKNOWN"!==n&&e("sex")?.onChange?.(n.toLowerCase())}),[]);return o(Tn,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&Ni(e,ls),...ri(e(ls),ni.middleName,t?.required),...t,onDaDataChange:n})})),ss=d((({field:e,input:t})=>o(Tn,{label:"Имя",maxLength:60,disabled:t?.filledByEsia&&Ni(e,t.name??""),...ri(e("name"),ni.name,t?.required),...t}))),os=d((({value:e=!1,text:t,type:n="checkbox",onChange:i})=>c("div",{role:n,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>i&&i(!e),children:[o("div",{className:u("relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl",e?"bg-primary-main":"bg-main-divider"),children:o("div",{className:u("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?o(Me,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),cs=d((({field:e})=>ci(e("acquiringType")?.value?.key)?o(os,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),ds=d((({field:e,input:t})=>{const{data:n}=il("ORGANIZATION_TYPE");return o(xl,{field:e,source:n,label:"Тип организации",fieldName:"organization",input:t})})),ms=d((({field:e,input:t})=>{const n=l((t=>{e?.("inn")?.onChange?.(t.data?.inn),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(Tn,{label:"Наименование организации",...t,...ri(e("organizationName"),ni.organizationName,t?.required),onDaDataChange:n})})),us=d((({field:e,input:t})=>o(Tn,{label:"Иные доходы",placeholder:"Введите значение",type:"number",...ri(e("otherIncome"),ni.otherIncome,t?.required),...t}))),hs=d((({field:e,input:t})=>o(Yl,{label:"Дата регистрации по месту жительства",...ri(e("participantDateRegistration"),ni.participantDateRegistration,t?.required)}))),ps="partInBusiness",gs=d((({field:e,input:t})=>{const n=l((t=>{e(ps)?.onChange?.(String(Number(t)>100?100:Number(t)||""))}),[]);return o(Tn,{label:"Доля участия в бизнесе",placeholder:"в %",type:"number",maxLength:3,...ri(e(ps),ni.partInBusiness,t?.required),...t,onChange:n})})),fs=d((({field:e,input:t})=>{const{required:n,...i}=t;return o(Tn,{...ri(e("partnerComments"),ni.partnerComments,n),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...i})})),xs=d((({field:e,input:t})=>{const{value:n,onChange:l}=e("paymentSystem"),[r,s]=i([]);return a((()=>{(async()=>{const e=await(async()=>{const e=await Qi("/public-data/creditProgramConditions","POST",{creditProgramId:13});return(await(e?.json()))?.paymentSystems?.map((e=>({id:e.type,text:e.name})))})();s(e||[])})()}),[]),o(pr,{label:"Платежная система",orientation:"horizontal",items:r,value:n,onChange:e=>l?.(e),...ri(e("paymentSystem"),ni.paymentSystem,t?.required)})})),bs=e=>"_"===e,ys=e=>/\d/.test(e),vs=e=>bs(e)||ys(e),Ns=[..."+7 (___) ___-__-__"],ws=Ns.findIndex(bs),Cs=Ns.map(((e,t)=>vs(e)?Ns.slice(0,t).filter(vs).length:-1));function Ss(e){const t=e.replace(/\D/g,""),n=Ns.map(((e,n)=>ys(e)?e:t.charAt(Cs[n])||e)),i=Cs.indexOf(t.length-1)+1;return(i?n.slice(0,Math.max(ws,i)):n).join("")}const ks=d((({children:e,onChange:t,...n})=>{const i=l((e=>t&&t(Ss(e))),[t]),a=l((e=>{"+7 ("===e&&t&&t("")}),[]);return o(xn,{...n,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>a(e?.target?.value||""),children:e})})),Is=d((({className:e,label:t,error:n,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(ks,{"aria-label":t,label:hn({label:t,errors:i?.errors}),valid:Boolean(!n),placeholder:"+7 (___) ___-__-__",...i}),vn(n)]}))),Ts=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(Is,{label:"Телефон",...ri(e(n),ni.phone,t?.required),disabled:t?.filledByEsia&&Ni(e,n),...t})})),Bs=d((({field:e,input:t})=>{const{data:n}=il("POSITION");return o(xl,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),Ps=d((({field:e})=>ci(e("acquiringType")?.value?.key)?o(os,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),Rs=Et((({field:e,source:t})=>o(En,{placeholder:"Выберите продукт",label:"Продукт",options:Ds(t?.productList),...li(e("product"),ni.product)}))),Ds=e=>(e??[]).map((e=>({key:e,value:e}))),_s=[];function Ms(e="/api/v1/regions"){const{data:t}=pi(e,Rt);return Array.isArray(t)?t:_s}const As=d((({field:e,input:t,url:n})=>{const i=Ms(n);return o(En,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:r((()=>i?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[i]),...ri(e("region"),ni.region,t?.required)})})),zs=d((({field:e,input:t})=>{const n=bi(!0),i=r((()=>n?.map((({region:e})=>({key:e,text:e})))),[n]);return o(En,{label:"Регион",placeholder:"Выберите регион",options:i,...ri(e("region"),ni.region,t?.required)})})),Es=d((({field:e,input:t})=>{const{data:n}=il("REGION_RF"),i=n?.map((({key:e,value:t})=>({key:e,text:t})));return o(En,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,options:i,...ri(e("regionRetail"),ni.regionRetail,t?.required)})})),Os=d((({field:e,input:t})=>{const n=e("wages")?.value,i=l((t=>{const i=Number(t)+Number(n||0);e("retirementIncome")?.onChange?.(t),e("incomeAverage")?.onChange?.(String(i))}),[n]);return o(Tn,{label:"Пенсионные доходы",placeholder:"Введите значение",type:"number",...ri(e("retirementIncome"),ni.retirementIncome,t?.required),...t,onChange:i})})),Fs=d((({field:e})=>{const t=e("secondaryPhone");return o(Is,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?li(t,ni.secondaryPhone):t})})),Vs=d((({field:e,input:t})=>o(En,{label:"Направление обслуживания",placeholder:"Выберите направление",options:Vr,...ri(e("serviceDirection"),ni.serviceDirection,t?.required)}))),Ls=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],js=d((({field:e,input:t})=>o(pr,{label:"Пол",orientation:"horizontal",items:Ls,...ri(e("sex"),ni.sex,t?.required)}))),qs=d((({field:e,input:t})=>o(Di,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...ri(e("shareholderFlg"),ni.shareholderFlg,t?.required)}))),$s=d((({children:e,onChange:t,...n})=>{const i=l((e=>t&&t(Dl(e,"___-___-___ __"))),[t]),a=l((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(xn,{...n,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>a(e?.target?.value||""),children:e})})),Us=d((({className:e,label:t,value:n,error:i,onChange:a,onBlur:l,...r})=>c("div",{className:u("shrink-0 w-full",e),children:[o($s,{"aria-label":t,label:hn({label:t,errors:r?.errors}),valid:Boolean(!i),value:n,onChange:a,onBlur:l,placeholder:"___-___-___ __"}),vn(i)]}))),Ws=d((({field:e,input:t})=>{const n=e("consentPfrFlg")?.value;return o(Us,{label:"СНИЛС",...ri(e("snils"),ni.snils,!!n&&t?.required),...t})})),Hs=d((({field:e,input:t})=>o(Tn,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&Ni(e,"surname"),...ri(e("surname"),ni.surname,t?.required),...t}))),Ys=["От 1 мес","До 15 лет"],Ks=d((({field:e})=>o(ul,{title:"Срок, месяцев",items:Ys,min:1,max:180,...e("term")}))),Gs=d((({field:e,input:t})=>o(Tn,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",type:"number",...ri(e("totalIncome"),ni.totalIncome,t?.required),...t}))),Xs=d((({field:e,input:t})=>o(En,{label:"Тип обслуживания",options:Fr,...ri(e("serviceType"),ni.serviceType,t?.required)}))),Js=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],Zs=d((({field:e})=>{const{value:t,onChange:n}=e("vedTypes");return a((()=>{"currencyControl"!==t&&(e?.("inn")?.onChange?.(""),e?.("region")?.onChange?.(""))}),[t]),o("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:o(hr,{className:"whitespace-normal",orientation:"horizontal",items:Js,value:t,onChange:e=>n&&n(e)})})})),Qs=d((({field:e,input:t})=>{const n=e("retirementIncome")?.value,i=l((t=>{const i=Number(t)+Number(n||0);e("wages")?.onChange?.(t),e("incomeAverage")?.onChange?.(String(i))}),[n]);return o(Tn,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",type:"number",...ri(e("wages"),ni.wages,t?.required),...t,onChange:i})}));const eo={$ref:"/wcms-resources/outservice-productlist.json"},to=(e,t)=>(n,i)=>{const a="ULTRASERVICE"===t||"PREMIUMSERVICE"===t,l={surname:o(Hs,{field:e,input:n}),name:o(ss,{field:e,input:n}),middleName:o(rs,{field:e,input:n}),phone:o(Ts,{field:e,input:n}),organizationPhone:o(Ts,{field:e,input:n}),email:o(Rr,{field:e,input:n}),fullName:o(qr,{field:e,input:n}),inn:o(Wr,{field:e,input:n}),legalForm:o(Xr,{field:e,input:n}),organizationName:o(ms,{field:e,input:n}),generalSeniority:o($r,{field:e,input:n}),lastJobExperience:o(Kr,{field:e,input:n}),experience5Years:o(zr,{field:e,input:n}),jobsNumber:o(Yr,{field:e,input:n}),beginDate:o(Kl,{field:e,input:n}),addressFact:o(vi,{field:e,input:n}),organizationAddress:o(wi,{field:e,input:n}),comment:o(tr,{field:e,input:n}),addressBranch:o(yi,{field:e,input:n,isPremium:a}),sex:o(js,{field:e,input:n}),birthday:o(Gl,{field:e,input:n}),limitedBirthday:o(Zr,{field:e,input:n}),birthPlace:o(Xl,{field:e,input:n}),desiredMeetingDate:o(yr,{field:e,input:n}),product:o(Rs,{field:e,source:eo}),localities:o(ts,{field:e,input:n}),isClient:o(Hr,{field:e}),partnerComments:o(fs,{field:e,input:n}),collectionCount:o(er,{field:e,input:n}),acquiringType:o(oi,{field:e,input:n}),onlineCheckout:o(cs,{field:e}),posTerminal:o(Ps,{field:e}),serviceType:o(Xs,{field:e,input:n}),term:o(Ks,{field:e}),amount:o(fl,{field:e}),annualRevenue:o(yl,{field:e,input:n}),vedTypes:o(Zs,{field:e}),feedbackMethod:o(jr,{field:e,input:n}),serviceDirection:o(Vs,{field:e,input:n}),bankEmpolee:o(wl,{field:e}),secondaryPhone:o(Fs,{field:e}),consentToReceiveMaterials:o(dr,{field:e,input:n}),processPersonalDataFlg:o(dr,{field:e,input:n}),consentProviderFlg:o(dr,{field:e,input:n}),consentOthersFlg:o(dr,{field:e,input:n}),consentInformFlg:o(dr,{field:e,input:n}),consentPfrFlg:o(dr,{field:e,input:n}),applicationDate:o(Tn,{label:"Дата и время обращения в Банк",...e("applicationDate")}),region:a?o(zs,{field:e}):o(As,{field:e,input:n,url:cn(t)}),education:o(Pr,{field:e,input:n}),housing:o(Ur,{field:e,input:n}),employment:o(Mr,{field:e,input:n}),organization:o(ds,{field:e,input:n}),amountWorkers:o(bl,{field:e,input:n}),employerActivities:o(Dr,{field:e,input:n}),employerOrganization:o(_r,{field:e,input:n}),positionOrganization:o(Bs,{field:e,input:n}),familyStatus:o(Or,{field:e,input:n}),children:o(Zl,{field:e,input:n}),familyMembers:o(Er,{field:e,input:n}),dependents:o(br,{field:e,input:n}),totalIncome:o(Gs,{field:e,input:n}),expenses:o(Ar,{field:e,input:n}),snils:o(Ws,{field:e,input:n}),conscription:o(ir,{field:e,input:n}),armyIdFlg:o(vl,{field:e,input:n}),dulSerie:o(Ir,{field:e,input:n}),dulNumber:o(kr,{field:e,input:n}),dulIssueDateField:o(wr,{field:e,input:n}),dulSubdivisionCode:o(Br,{field:e,input:n}),dulIssuedBy:o(Sr,{field:e,input:n}),addressRegistration:o(wi,{field:e,input:n}),addressCourier:o(wi,{field:e,input:n}),participantDateRegistration:o(hs,{field:e,input:n}),retirementIncome:o(Os,{field:e,input:n}),otherIncome:o(us,{field:e,input:n}),wages:o(Qs,{field:e,input:n}),mandatoryPayments:o(ns,{field:e,input:n}),disablePeopleFlg:o(vr,{field:e,input:n}),bankruptcyFlg:o(Cl,{field:e,input:n}),shareholderFlg:o(qs,{field:e,input:n}),legalEntityName:o(Gr,{field:e,input:n}),creditInRshbCd:o(mr,{field:e,input:n}),bankEmployeeCode:o(Nl,{field:e,input:n}),partInBusiness:o(gs,{field:e,input:n}),regionRetail:o(Es,{field:e,input:n}),addressRetail:o(ll,{field:e,input:n}),addressMatch:o(_i,{field:e,input:n}),paymentSystem:o(xs,{field:e,input:n}),currency:o(fr,{field:e,input:n}),cardCategory:o(Jl,{field:e,input:n}),codeWord:o(Ql,{field:e,input:n}),confirmationIncome:o(nr,{field:e,input:n}),methodObtain:o(as,{field:e,input:n}),deliveryDate:o(xr,{field:e,input:n})};return function({input:e,field:t}){const{condition:n}=e,{value:i}=t(n?.name||"");return!n||n?.values?.find((e=>e===(i?.key??i)))}({input:n,field:e})?o("div",{children:l[n?.name||""]},String(i)):null},no=e=>2===e?"@xl:grid-cols-2":"",io=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(Me,{size:"text-h6",children:e})}):null,ao=d((function({responseType:e,typeForm:t}){const n="OK"===e,i=n?"ResponseOKIcon":"ResponseFailIcon",{close:a}=me(),r=l((()=>{a()}),[]),s="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся";return o(sr,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto ",children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ne,{image:{icon:i,iconVersion:"normal"},width:"136",height:"136"}),o(S,{className:"w-full",title:n?"Ваша заявка отправлена":"Не удалось отправить заявку",description:n?s:"Пожалуйста, повторите позднее",headlineVersion:"XS",isEmbedded:!0}),o(ja,{type:"button",onClick:r,children:"Хорошо"})]})})})),lo=e=>{const{open:t,close:n}=me();return{open:(n,i={})=>t(o(ao,{...e,...n}),i),close:n}},ro=e=>t=>t&&Object.entries(e).flatMap((([e,n])=>n(t[e])))||[],so=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:i,amount:a,term:l,annualRevenue:r,serviceType:s,vedTypes:o,region:c,...d}=e,m=t||r?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:i=!1,term:a,amount:l,annualRevenue:r}=e;return t?`Вид эквайринга=${t?.text||""}${ci(t?.key)?`/Онлайн касса=${n}/POS-терминал=${i}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${l}/Срок=${a}/Выручка=${r}`})(e):null,u={...d,...co(o),...oo(c),...m?{partnerComments:m}:{},...s?{typeForm:s}:{}};return Object.fromEntries(Object.entries(u)?.map((([e,t])=>[e,t?.key||t])))},oo=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},co=e=>e?{vedTypes:Object.fromEntries(Js.map((({id:t})=>[t,t===e])))}:{},mo={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:si[0],serviceType:Fr[0],feedbackMethod:Lr[0],serviceDirection:Vr[0],vedTypes:Js[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""}},uo=d((({text:e,link:t})=>c(w,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(Me,{children:e}):null,t?o(ve,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"!text-left text-primary-main",children:o(Me,{children:t.text})}):null]}))),ho=(e,t)=>o(ja,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),po=(e,t,n)=>c("div",{className:"flex col-span-2 gap-xs flex-col w-full items-baseline",children:[e?c("div",{children:[c("div",{className:"flex gap-3 items-center",children:[o(Ii,{...e}),o(uo,{link:t})]}),vn(li(e,Gn).error)]}):o(uo,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),ho(n)]}),go={send:async function(e,t=!1){const{typeForm:n,region:i,phone:a="",email:l,birthday:r,desiredMeetingDate:s,inn:o,addressBranch:c,secondaryPhone:d="",bankEmpolee:m,applicationDate:u,serviceDirection:h,...p}=e,g=t&&"Юридическое лицо / ИП"!==h,f="/api/v1"+(g?"/lead":"/sendcorporatelead"),x={typeForm:n,...Ut(i,g),...Wt(l,g),...qt(a),...$t(s,"desiredMeetingDate"),...g?$t(r):{inn:o},..."FEEDBACK"===n?{}:{addressBranch:c,bankEmpolee:m,applicationDate:u,...Ht(d)},...p};try{const e=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(x)});return e?.ok?await e.json():null}catch(e){return null}}},fo=d((({className:e,title:t,typeForm:n="",sections:r=[],button:s,link:d,endpoint:m,additionalParams:h,isContacts:p,data:g,...f})=>{const x=r?.flatMap((e=>e?.inputs))||[],b=((e,t="")=>{const n=Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||mo[e.name||""]])));return n?.serviceType&&"PREMIUMSERVICE"===t&&(n.serviceType=Fr[1]),{...n,typeForm:{key:t,text:""}}})(x,n),[y,v]=i(""),w=lo({typeForm:n}),C=l((async(e,t)=>{const n=xo(x,e),i=ro(ai(n));if(!On(i(e)))return console.warn("validation fail");const a=so({...e,...h}),l=await go.send(a,"lead"===m)?"OK":"Fail";if(v(l),l&&w.open({responseType:l}),"OK"===l&&g){const e=an();Yt({aspectsAttributes:g,aspects:e,ev:t})}return l}),[]),[,{field:S,onSubmit:k,reset:I}]=rn(b,{onSubmit:C}),T=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(x)?.name;return a((()=>{"OK"===y&&(v(""),I())}),[y]),c(on,{className:u("container space-y-m",e),title:t,...f,children:[c("form",{onSubmit:k,children:[r.map(((e,t)=>c("div",{className:u(no(e.columns),"grid gap-x-m"),children:[io(e.title),(e?.inputs||[])?.map(to(S,n))]},`section-${t}`))),po(T?S("consentDataProcessing"):void 0,d,s)]}),p?c("div",{className:"space-y-m",children:[o(N,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),c("div",{className:"flex sm:justify-center gap-xl",children:[c("a",{className:"flex gap-s items-center text-primary-text no-underline",href:"tel:8 (800) 200-78-70","aria-label":"телефон 8 (800) 200-78-70",children:[o(ne,{image:{icon:"PhoneIcon"},width:"24",height:"24"}),o("span",{children:"8 (800) 200-78-70"})]}),c("a",{className:"flex gap-s items-center text-primary-text no-underline","aria-label":"почта ved@rshb.ru",href:"mailto:ved@rshb.ru",children:[o(ne,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]}):null]})})),xo=(e,t)=>e.filter((e=>"secondaryPhone"===e?.name?Boolean(t.secondaryPhone):e)).filter((e=>!e?.condition||e?.condition.values.find((n=>{const i=t?.[e?.condition?.name??""];return n===(i?.key??i)}))));function bo(e){const[t,n]=i(JSON.parse(globalThis.localStorage?.getItem(e)||"null"));return[t,l((t=>{globalThis.localStorage?.setItem(e,JSON.stringify(t)),n(t)}),[e,globalThis.localStorage])]}const yo=d((({inputs:e=[],typeForm:t="",field:n,key:i})=>{const a=e.every((e=>Boolean(n(e.name).value))),l=r((()=>e?.filter((e=>e.required))?.some((e=>Boolean(li(n(e?.name),ni[e?.name]).error)))),[e]);return o("div",{className:"w-fit",children:o(na,{isFoldButtonOnTop:!0,unfoldedByDefault:!0,renderFoldableSection:({isUnfolded:i})=>o(ia,{isUnfolded:i,className:"flex flex-col pl-2xl",children:e.map(to(n,t))}),renderFoldButton:vo(c("div",{children:[o(Ii,{value:a,onChange:t=>{for(const i of e){const e=n(i.name);e?.onChange&&e.onChange(t)}},text:"Согласие на все документы"},i),vn(l?"Отметьте все обязательные соглашения":"")]}))})})})),vo=e=>t=>c("div",{className:"flex items-start",children:[e,o("button",{onClick:t.onToggle,className:"px-m py-2xs",type:"button",children:o(W,{className:"text-primary-text",name:t.isUnfolded?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})})]}),No=({field:e,typeForm:t="",inputs:n})=>{const{consentInputs:i,restInputs:a}=wo(n||[]);return i.length>2?c("div",{children:[a.map(to(e,t)),o(yo,{inputs:i,field:e})]}):(n||[])?.map(to(e,t))},wo=e=>({consentInputs:e?.filter((e=>Object.keys(ar).includes(e.name||"")))||[],restInputs:e?.filter((e=>!Object.keys(ar).includes(e.name||"")))||[]}),Co={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",organizationPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:si[0],serviceType:Fr[0],feedbackMethod:Lr[0],serviceDirection:Vr[0],vedTypes:Js[0],birthday:void 0,limitedBirthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,processPersonalDataFlg:!1,consentProviderFlg:!1,consentOthersFlg:!1,consentInformFlg:!1,addressRegistration:"",participantDateRegistration:void 0,currency:"",paymentSystem:"",cardCategory:{key:"",text:""},codeWord:"",addressRetail:{key:"",text:""}},So=(e,t,n="")=>{if(t){const e={...t};return e.limitedBirthday=new Date(e?.limitedBirthday||0),e}return{...Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||Co[e.name||""]]))),typeForm:{key:n,text:""}}},ko=(e,t)=>o(ja,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),Io=e=>Zi("/user-data/updateUserProfile","PUT",e),To=e=>Zi("/user-data/updateUserTask","PUT",e),Bo=(e,t)=>Boolean(e)&&"string"!=typeof e&&Boolean(e?.errorMessage.startsWith(`Too many request for phoneNumber [${t}]`)),Po={width:"118",height:"24"},Ro={"bg-white":"color",transparent:"white"},Do={"bg-white":"text-primary-main",transparent:"text-white"},_o=(e,t,n)=>o(ne,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:Ro[e]},className:Do[e],width:n?.width,height:n?.height}),Mo={"bg-white":"text-primary-text",transparent:"text-white"},Ao=d((({className:e,href:t="/",logo:n,children:i,targetBlank:a,bgColor:l="bg-white",showTitle:r=!0,data:s})=>c("a",{className:u("inline-flex items-center font-sans no-underline",e),href:n?.href??t,target:a?"_blank":"_self","aria-label":n?.title??"Россельхозбанк",...ge(s),children:[_o(l,n?.image,Po),r?i??o("div",{className:"ml-s",children:o(Me,{font:"font-medium",color:Mo[l],size:"",children:n?.title??"Россельхозбанк"})}):null]}))),zo=d((({phoneNumber:e,close:t,sendCode:n,onClose:r})=>{const[s,d]=i(""),[m,u]=i(""),[h,p]=i(!1),g=l((async()=>{const e=await(i={captchaText:m},Qi("/sms/checkCaptcha","POST",i).then((e=>e.text())).then((e=>"ERROR"!==e)));var i;e?(n?.(),t?.()):p(e)}),[m]),f=l((()=>{(async()=>{d(URL.createObjectURL(await(e=>Qi(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET").then((async e=>e?await e.blob():new Blob)))(e)))})()}),[]);return a(f,[]),o(sr,{head:o(Ao,{}),onClose:r,className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex h-36 w-72",children:[o("img",{className:"grow",src:s}),o("div",{onClick:f,className:"flex w-8 items-center justify-center cursor-pointer",children:o(W,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(xn,{className:"w-[300px]",onChange:u,value:m,placeholder:"Введите код с картинки"}),h?o("div",{className:"text-error",children:"Неверный код"}):null,c("div",{className:"flex w-[310px] justify-between",children:[o(ja,{onClick:t,version:"secondary",children:"Вернуться"}),o(ja,{type:"submit",disabled:!m,onClick:g,version:"secondary",children:"Отправить"})]})]})})})),Eo=d((({time:e,setTime:t,className:n})=>(a((()=>{const n=setInterval((()=>{t(e-1)}),1e3);return 0===e&&clearInterval(n),()=>{clearInterval(n)}}),[e]),o("span",{className:n,children:Oo(e)})))),Oo=e=>`${`${Math.floor(e/60)}`.padStart(2,"0")}:${(""+e%60).padStart(2,"0")}`,Fo=d((({values:e,setValues:t,hasError:n,errorText:r})=>{const[d,m]=i(0),u=s([]);a((()=>{u.current?.[d]?.focus()}),[d]);const h=l((n=>i=>{const{value:a}=i.currentTarget,l=a.slice(0,1);t(e.map(((e,t)=>t===n?l:e))),m(n+1)}),[e]),p=l((n=>i=>{const{key:a}=i;if("Backspace"===a&&!e[n]){const i=n>0?n-1:e.length-1,a=e.map(((e,t)=>t===i?"":e));t(a),m(i)}}),[e]),g=l((n=>{n.preventDefault();const i=n.clipboardData.getData("text"),a=e.map(((e,t)=>t<i.length?i[t]:e));t(a),m(a.length-1)}),[e]);return c("div",{className:"flex flex-col gap-2 text-center",children:[o("div",{children:e.map(((t,i)=>o("input",{type:"number",maxLength:1,value:t,onChange:h(i),onPaste:g,ref:e=>{u.current||(u.current=[]),u.current[i]=e},onFocus:e=>e.target.select(),onKeyDown:p(i),className:Vo(i,e,n)},i)))}),n?o("div",{className:"text-error",children:r}):null]})})),Vo=(e,t,n=!1)=>{const i=!t[e];return`w-20 h-24 text-5xl text-center p-lg m-2 border ${n&&i?"border-error":"border-gray"} rounded-md caret-transparent outline-none`},Lo=d((({isDisabled:e,onClick:t,text:n})=>o(ja,{type:"button",onClick:t,disabled:e,children:o(Me,{font:"font-normal",children:n})}))),jo=e=>{e&&(globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token))},qo=({close:e,values:t})=>{const[n,s]=i(!1),[o,c]=i(""),[d,m]=i(!1),[u,h]=i(0),[p,g]=i(!1),[f,x]=i(0),b=l((()=>{s(!1),c("")}),[]),y=r((()=>0===u&&p),[u,p]),v=r((()=>f>2||!t.every(Boolean)||y),[t]),N=l((async()=>{try{g(!1),h(0),x(f+1),m(!0),await(async e=>Zi("/sms/checkCode","POST",e).then(jo))({smsText:t.join(""),smsCodesSetName:{key:"AUTHENTICATION"}}),b(),e&&e(t.join(""))}catch{m(!1),c(f>1?"Исчерпан лимит ввода смс-кода":"Неверный код"),s(!0)}}),[t,f]);return a((()=>{y?(s(!0),c("Код просрочен")):s(!1)}),[y]),{handleSubmit:N,hasError:n,errorText:o,isLoading:d,timeNextReq:u,isSubmitButtonDisabled:v,setTimeNextReq:h,setIsTimerStarted:g,setAttemps:x}},$o=d((({close:e=pn,onClose:t=pn,title:n,description:r,__html:s,code:d=!0,codeLength:m=4,textButton:u="",phoneNumber:h="+79999999999"})=>{const[p,g]=i(Array(m).fill("")),{handleSubmit:f,hasError:x,errorText:b,isLoading:y,timeNextReq:v,isSubmitButtonDisabled:N,setTimeNextReq:w,setIsTimerStarted:C,setAttemps:k}=qo({values:p,close:e}),I=l((async()=>{var e;await(e={phoneNumber:h,smsCodesSetName:{key:"AUTHENTICATION"}},Zi("/sms/sendCode","POST",e).then((t=>!Bo(t,e.phoneNumber))))?(k(0),w(180),C(!0)):T.open()}),[]),T=((e,t)=>{const{open:n,close:i,closeAll:a}=me();return{open:()=>n(o(zo,{close:i,onClose:t,...e})),close:i,closeAll:a}})({phoneNumber:h,sendCode:I},t);return a((()=>{I()}),[]),o(sr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-xl px-5xl py-0",children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[o(S,{className:"w-full",title:n,description:r,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),d?o(Fo,{values:p,setValues:g,errorText:b,hasError:x}):null,Wo(v,w,I),o(De,{itemSize:"list-s",__html:s}),Uo(u,N,f),y?o(Mi,{blur:!1}):null]})})})),Uo=(e,t,n)=>e?o(Lo,{isDisabled:t,onClick:n,text:e}):null,Wo=(e,t,n)=>e?c("div",{className:"flex flex-row text-l font-light text-base",children:["Получить новый код можно через",o(Eo,{className:"text-base ml-1",time:e,setTime:t})]}):o(ve,{onClick:n,className:"text-primary-main",children:"Получить новый код"}),Ho=()=>{const{open:e,close:t}=me();return{open:(n,i)=>e(o($o,{onClose:t,close:n,...i})),close:t}},Yo={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},Ko={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},Go=d((function({handleSubmit:e=pn,onClose:t=pn}){const[n,a]=i(""),[r,s]=i(!1),{open:d,close:m}=me(),u=Se(),h=l((()=>{m(),e(n)}),[n]),p=l((e=>{a(e),"REFUSE"===e&&s(!0)}),[]),g=r?Ko:Yo;return o(sr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl",onClose:t,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o("div",{role:"button",onClick:()=>or(d,Jo,u),children:o(N,{className:"text-center text-balance",headingType:"h2",title:g.title})}),o(w,{align:"text-center",children:g.description}),o(hr,{className:"whitespace-normal",orientation:"horizontal",items:Xo,value:n,onChange:p}),o(ja,{disabled:!n,type:"button",onClick:h,children:"Продолжить"})]})})})),Xo=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],Jo=2,Zo=e=>{const{open:t,close:n}=me(),i=Ho(),a=(t,a)=>async l=>{n(),"SIGNED"===l&&t?i.open((t=>async n=>{t&&await Io({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()})(a),Qo(t)):e()};return{open:(n,i)=>t(o(Go,{handleSubmit:a(n,i),onClose:e}))}},Qo=e=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:jt(e),textButton:"Отправить",__html:"<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>\n <ul><li>согласие на запрос информации в БКИ</li></ul>"}),ec=d((function({handleClose:e}){const t=l((async()=>{const e=await(t={redirectUri:globalThis.location.href},Zi("/esia/getLink","POST",t));var t;e&&(globalThis.location.href=e.link)}),[]);return o(sr,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",onClose:e,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex items-center justify-around w-full",children:[c("ul",{className:"list-disc",children:[o("li",{children:"Вероятность одобрения выше"}),o("li",{children:"Без справок о доходах и трудоустройстве"}),o("li",{children:"С защитой Ваших данных"})]}),o(ne,{image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"70"})]}),c("div",{className:"flex items-center justify-between w-full m-0",children:[o(ja,{type:"button",onClick:t,children:"Заполнить через Госуслуги"}),o(ja,{type:"button",version:"secondary",onClick:e,children:"Пропустить"})]})]})})})),tc={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},nc={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK"},ic={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},ac=e=>Object.entries(e).reduce(((e,[t,n])=>t in tc?[...e,{contactTypeCd:{key:tc[t]},value:n}]:e),[]),lc=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in nc){const i=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:nc[t]},...i}]}return e}),[]),rc=e=>Object.entries(e).reduce(((e,[t,n])=>t in ic?[...e,{incomeTypeCd:{key:ic[t]},value:Number(n||0)}]:e),[]),sc=({inputs:e,programId:t,nextStepLink:n,saveForm:a})=>{const[r,s]=i(""),[,c]=bo("taskId"),[,d]=bo("profileId"),[,m]=bo("participantId"),u=(e=>{const{open:t,close:n}=me(),i=l((()=>{n(),globalThis.location.href=e}),[]);return{open:(e={})=>t(o(ec,{handleClose:i}),e),close:n}})(n),h=Zo(u.open),p=Ho(),g=l(((e,t,n)=>{m(e),c(t),d(n)}),[]);return{handleSubmit:l((async n=>{const i=ro(ai(e));if(!On(i(n)))return console.warn("validation fail");try{const e=await(l={profile:{phone:jt(n.phone)}},Zi("/public-data/createUserProfile","POST",l).then((e=>e?.profile?.id||null)));if(e&&n?.phone){const i=async()=>{try{await oc({programId:t,profileId:e,formData:n,saveUserData:g,saveForm:a}),p.close(),h.open(n.phone,e)}catch{s("Fail")}},l=Object.keys(ar).filter((e=>n[e])).map((e=>ar[e]?.text));p.open(i,cc(n?.phone,l))}}catch{s("Fail")}var l}),[]),responseStatus:r}},oc=async({programId:e,profileId:t,formData:n,saveUserData:i,saveForm:a})=>{const l=mc(n);await Io(((e,t)=>{const{name:n="",surname:i="",middleName:a="",birthday:l="",phone:r="",email:s="",processPersonalDataFlg:o,consentProviderFlg:c,consentPfrFlg:d,consentPhotoFlg:m,consentAssignmentClaimsFlg:u,consentCollectionFlg:h,consentInformFlg:p}=t;return{profile:{id:e,name:n,surname:i,midname:a,birthDate:l&&Lt(l,!0),email:s,phone:jt(r),processPersonalDataFlg:Boolean(o),consentProviderFlg:Boolean(c),consentPfrFlg:Boolean(d),consentPhotoFlg:Boolean(m),consentAssignmentClaimsFlg:Boolean(u),consentCollectionFlg:Boolean(h),consentInformFlg:Boolean(p)}}})(t,l));const{taskId:r,participantId:s}=await(async e=>await Zi("/user-data/createDraftTask","POST",e)||{})({profileId:t,programId:e});await To((({participantId:e,taskId:t,profileId:n,formData:i})=>{const{name:a,surname:l,middleName:r,limitedBirthday:s,phone:o,email:c}=i;return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:globalThis.location.origin,id:t,participants:[{birthDate:s&&Lt(s,!0),id:e,midname:r,name:a,surname:l,profile:{id:n},participantContacts:ac({phone:o&&jt(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"}}]}}})({participantId:s,taskId:r,profileId:t,formData:l})),i(s,r,t),a(n)},cc=(e,t)=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:jt(e),textButton:"Оформить",__html:`<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>${dc(t)}`}),dc=e=>`<ul>${e?.map((e=>"<li>"+e+"</li>")).join("")}</ul>`,mc=e=>{const{consentOthersFlg:t,...n}=e;return{...n,consentCollectionFlg:t,consentAssignmentClaimsFlg:t,consentPhotoFlg:t}},uc=e=>{const{profile:t,addInfo:n,document:i,addressRegistration:a,addressFact:l}=e;return{name:t?.name,surname:t?.surname,middleName:t?.midname,limitedBirthday:t?.birthDate,phone:Ss(t?.phone),email:t?.email,dulIssueDateField:i?.dulIssueDate,dulIssuedBy:i?.dulIssuedBy,dulNumber:i?.dulNumber,dulSerie:i?.dulSerie,dulSubdivisionCode:i?.dulSubdivisionCode,snils:n?.snils,birthPlace:n?.birthPlace,addressRegistration:hc(a),addressFact:hc(l),esiaAccountTypeCd:t?.esiaAccountType}},hc=e=>{const{postcode:t,region:n,regionCode:i,locality:a,city:l,street:r,house:s,building:o,block:c,apartment:d}=e,m=[t,n,a||l,r?`ул ${r}`:void 0,s?`д ${s}`:void 0,c?`к ${c}`:void 0,o?`стр ${o}`:void 0,d?`кв ${d}`:void 0].reduce(((e,t)=>t?e?`${e}, ${t}`:t:e),"");return{...e,regionCode:i?.key,fullAddress:m}},pc=e=>{const[t,n]=i(!1),[r]=bo("profileId"),[s,o]=bo("leadForm"),c=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),d=c.get("code"),m=c.get("state"),u=l((async()=>{if(r&&d&&m){const n=await(t={profileId:r,code:d,state:m,redirectUri:globalThis.location?.href},Zi("/esia/updateProfileEsia","POST",t));n&&o({...s,...uc(n)}),globalThis.location.href=e}var t}),[]);return a((()=>{d?(n(!0),u()):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),{isLoading:t}},gc=d((({className:e,title:t,programId:n="",nextStepLink:l="/credit-lead",sections:r=[],button:s,...d})=>{const m=r?.flatMap((e=>e?.inputs))||[],[h,p]=i(""),{isLoading:g}=pc(l),[f,x]=bo("leadForm"),b=So(m,f),{handleSubmit:y,responseStatus:v}=sc({inputs:m,programId:n,nextStepLink:l,saveForm:x});if(v){lo({responseType:v}).open()}const[,{field:N,onSubmit:w,reset:C}]=rn(b,{onSubmit:y});return a((()=>{"OK"===h&&(p(""),C())}),[h]),o(on,{className:u("container space-y-m",e),title:t,...d,children:c("form",{onSubmit:w,className:"space-y-m relative",children:[g?o(Mi,{blur:!1}):null,r.map(((e,t)=>c("div",{className:u(no(e.columns),"grid gap-x-m"),children:[io(e.title),No({field:N,inputs:e?.inputs})]},`section-${t}`))),ko(s)]})})})),fc=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black",link:i})=>c("div",{className:"flex flex-row items-center w-full min-h-14 bg-main-gray rounded-lg gap-m p-m",children:[o("div",{className:"rounded-full bg-white p-xs",children:o(W,{name:t,width:"24",height:"24",iconVersion:n})}),c("div",{className:"",children:[o(De,{__html:e}),i?.text?o(ve,{className:"text-primary-main",children:i.text}):null]})]}))),xc=d((({interval:e=0,intervalExpireAction:t=(()=>null),title:n,__html:a})=>{const[l,r]=i(e),s=100-(e-l)/e*100;return c("div",{children:[n?o(S,{title:n,headlineVersion:"S"}):null,c("div",{className:"flex justify-center items-center flex-col",children:[c("div",{className:u("relative flex items-center justify-center w-24 h-24 rounded-full bg-gray text-transparent mb-5"),children:[o("div",{className:"absolute inset-0 rounded-full",style:{background:`conic-gradient(rgb(66, 171, 68) ${s}%, rgb(125, 126, 127) 0deg)`}}),o("div",{className:"z-10 flex items-center justify-center px-4 py-2 rounded-full w-20 h-20 bg-white text-primary-text text-m",children:o(Eo,{interval:e,time:l,setTime:e=>{0===e&&t(),r(e)}})})]}),a?o(De,{__html:a}):null]})]})})),bc=d((({title:e,description:t,infoCard:n,sectionInfoTitle:i,sectionInfo:a,sectionAdditionalTitle:l,sectionInfoAdditional:r,buttonText:s,interval:d,...m})=>c(g,{...m,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(S,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(xc,{interval:d}):null]}),o(yc,{title:i,items:a}),o(yc,{title:l,items:r,countColumns:!0}),n?.__html?o(fc,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(ja,{className:"w-full mt-lg",children:s}):null]}))),yc=({title:e,items:t,countColumns:n=!1})=>{const i=Se();return t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(Me,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",no(n||i?1:2)),children:t.map(((e,t)=>o("div",{children:vc(e)},t)))}):null]})]}):null},vc=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Me,{color:"text-secondary-text",size:"text-l",children:e}),o(Me,{color:"text-primary-text",size:"text-xl",children:t})]}),Nc=d((({title:e,description:t})=>{const n=Se();return c("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[o(ne,{image:{icon:"MagnifierIcon",iconVersion:"normal"},width:"120",height:"120"}),o(S,{title:e,description:t,headlineVersion:n?"L":"S",isEmbedded:!0,className:"space-y-s"})]})})),wc=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",Cc=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`});function Sc(e,{sensitivity:t,rootRef:n}={}){const i=s(null),l=r((()=>({threshold:kc(t),root:n?.current})),[t,n?.current]);return a((()=>{if(!i.current)return;const t=new IntersectionObserver(e,l);return t.observe(i.current),()=>{t.disconnect()}}),[e,l]),i}function kc(e=0){const t=Math.round(10*e);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const Ic=d((({className:e,style:t,idx:n,activeIndex:i,observerOptions:a,children:r,onIntersection:s})=>{const c=Sc(l((e=>{e.length&&s&&s(n||0,e[e.length-1])}),[s,n]),a);return o("div",{className:u("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(n===i),ref:c,role:"listitem",children:r})})),Tc=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],Bc=d((({className:e,itemClassName:t,containerRef:n,activeIndex:i,visibleItemCount:a=0,gap:r=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:p,onVisibleItemsChange:g,onVisibleIndicesChange:f})=>{const x={sensitivity:1,rootRef:n},b=s([]),y=l(((e,t)=>{const n=[...b.current||[]];n[e]=t,b.current=n,g&&g(n),f&&f(Rc(n))}),[g,f]),v=a>0?r*Number(a)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?Pc(c,v):{},...N?Cc(h):{},gap:`${r}px`};return o("div",{className:u("box-border overflow-auto no-scrollbar",d,e),style:C,ref:n,role:"list",children:(S=(e,n)=>o(Ic,{className:u(m,a?Tc[a-1]:"",{"h-full":N},t),style:w?Pc(c/4):{},activeIndex:i,idx:n,observerOptions:x,onIntersection:y,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(S):S(e,0))(p)});var S})),Pc=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),Rc=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),Dc={"horizontal-list":"w-6","vertical-list":"h-6"},_c=({activeIndex:e,onClick:t,listType:n="horizontal-list"})=>(i,a)=>o("div",{className:u("cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white",a===e?Dc[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(a)},String(a)),Mc=({activeIndex:e,onClick:t})=>(n,i)=>{const a=i===e,l=a?"min-w-[350px] bg-white shadow-dark-blue border-none p-6":"min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",r=a?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=a?"text-l":"text-m group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(i),"aria-label":n?.title,className:u("max-h-28 mt-xs ml-xs relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50 whitespace-nowrap",l),children:[o("div",{className:r,children:n?.title}),o("div",{className:u("text-secondary-text font-light",s),children:n?.description})]},String(i))},Ac=e=>e,zc=(e=Ac)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),Ec=zc(),Oc=(e=Ac)=>zc((t=>-e(t))),Fc=Oc(),Vc=e=>t=>e.scrollWidth/t,Lc=e=>(t,n)=>{e.scrollBy({left:n*Vc(e)(t),behavior:"smooth"})},jc=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[a,r]=i([]),o=l((e=>{r((t=>{return(n=t)===(i=e)||Boolean(n&&i&&n?.length===i?.length&&n.every(((e,t)=>e===i[t])))?t:e;var n,i})),t&&t(e)}),[t]),[c,d]=a.length?[Oc()(a),zc()(a)]:[-1,-1],m=c>0,u=d<e-1,h=l((()=>{var t;n.current&&(m?Lc(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=l((()=>{n.current&&(u?Lc(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,u]),g=l(((e,t={behavior:"smooth",block:"nearest",inline:"center"})=>{n?.current&&n.current.children[e]?.scrollIntoView(t)}),[n]);return[n,{scrollLeft:h,scrollRight:p,scrollTo:g,canScrollLeft:m,canScrollRight:u,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},qc={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},$c=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:i="horizontal-list",version:r,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=Se(),[h,p]=jc({itemCount:s.length}),g=Uc(Boolean(s?.length));a((()=>{s?.length&&t>=0&&h?.current&&p.scrollTo(t,g)}),[t]);const f=l((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o(Bc,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(Mc({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",qc[i],r?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":r,children:Array.from({length:n}).fill(null).map(_c({activeIndex:t,onClick:f,listType:i}))}):null})),Uc=(e=!1)=>({behavior:e?"auto":"smooth"}),Wc=d((({className:e,disabled:t,...n})=>o(ve,{rounded:!0,className:u("group/btn w-12 h-12 min-h-12 max-h-12 flex items-center justify-center shadow-main-black",t?"bg-secondary-light text-secondary-text":"bg-white text-primary-text hover:text-primary-main",e),disabled:t,...n,children:o(ne,{className:"w-4 h-4 min-w-4 min-h-4 rounded-full box-border",image:{icon:"ArrowLeftIcon",iconVersion:"black"},imageClassName:"group-hover/btn:text-primary-main",width:"16",height:"16"})}))),Hc=d((e=>o(Wc,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),Yc=d((e=>o(Wc,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),Kc="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",Gc=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:i,isBottom:a})=>{const{canScrollLeft:l,canScrollRight:r,scrollLeft:s,scrollRight:d}=t,m=i&&!a;return c("div",{className:e,children:[n?Xc(t):null,l?o(Hc,{className:u(Jc(a),m?"left-1":"left-0"),onClick:s}):null,r?o(Yc,{className:u(Jc(a),m?"right-1":"right-0"),onClick:d}):null]})})),Xc=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(Kc,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(Kc,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),Jc=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),Zc=d((({className:e,version:t,gap:n=14,padding:i=16,visibleItemCount:a=1,listType:l="horizontal-list",snapAlign:r,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:h,showDots:p,children:g,onVisibleIndicesChange:f,navButtons:x})=>{const b=Array.isArray(g)?g.length:0,[y,v]=jc({itemCount:b,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===l?"relative h-full":""),children:[o(Bc,{containerRef:y,activeIndex:N,visibleItemCount:a,gap:n,padding:i,listType:l,snapAlign:r,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(Gc,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(x?.length)}),o($c,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:b,listType:l,version:t,navButtons:x,containerRef:y,containerScroll:v})]})})),Qc=({blocksToRender:e,...t})=>o(Zc,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:P(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",wc(!0)),children:T(e,t)},String(n))})}),ed=e=>e%2!=0,td=d((({textNode:e,iconNode:t,tag:n,onClick:i,justifyContent:a="between",className:l,role:r,...s})=>c(n,{tag:n,className:u("flex items-center w-full gap-1","between"===a?"justify-between":"justify-center",l),onClick:i,role:r,...s,children:[e?o("div",{children:e}):null,t?o("div",{children:t}):null]}))),nd=d((({className:e="",label:t,icon:n,dataTheme:i="pc",disabled:a=!1,onClick:l})=>o(td,{tag:"button",onClick:l,disabled:a,"data-theme":i,justifyContent:"center",role:"button",className:u("py-4 border border-transparent outline-none focus:border-primary-text space-x-s",a?"bg-main-divider text-main-disabled hover:bg-main-divider":"bg-primary-main text-white hover:bg-primary-hove",e),textNode:o(Me,{size:"text-h4",children:t}),iconNode:n?o(ne,{image:{icon:n,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),id=({isUnfolded:e,onToggle:t})=>o(nd,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),ad=["ArrowDownIcon","ArrowUpIcon"],ld="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",rd=({topItemsCount:e=0,label:t="",block:n,blocksToRender:i=[],...a})=>{const[l,r]=e>0?[i.slice(0,e),i.slice(e)]:[i,[]];return c("div",{className:u("space-y-2xs",{hidden:!i.length}),children:[c("div",{className:u(ld),children:[P(l,{...a.options,parent:n}),ed(l.length)?o(Ft,{className:"col-span-6",...a}):null]}),o(na,{renderFoldableSection:({isUnfolded:e})=>c(ia,{className:u(ld),isUnfolded:e,children:[P(r,{...a.options,parent:n}),ed(r.length)?o(Ft,{className:"col-span-6",...a}):null]}),renderFoldButton:({isUnfolded:n,onToggle:i})=>o(nd,{className:u({hidden:e<1}),disabled:!r?.length,label:t,icon:ad[Number(n)],dataTheme:a.options?.page?.colorPalette,onClick:i})})]})},sd=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...i})=>{switch(e?.view){case"grid":return c("div",{children:[od(n,t),rd({...e,...i,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[od(n,t),Qc({...i,blocksToRender:t})]});default:return null}})),od=(e,t)=>e&&!t.length?o(Nc,{...e}):null,cd=e=>t=>t.reduce(((t,n,i)=>t.length?t.concat({...e,key:`sep-${i}`},n):[n]),[]),dd=d((({value:e,onChange:t,items:n=[],multiple:i})=>n.map((n=>o(os,{text:n?.title,value:[e].flatMap((e=>e)).includes(n.value),onChange:()=>(n=>{if(!t)return;const a=e?.includes(n);t(i?a?(e||[]).filter((e=>e!==n)):[...e||[],n]:a?[]:[n])})(n.value),type:i?"checkbox":"radio"},n.value))))),md=d((({children:e,filtrationSchema:t,resetButton:n,field:i,reset:a})=>c("form",{className:"flex flex-col @4xl:flex-row justify-between bg-white p-4xl gap-s @4xl:gap-0",children:[c("div",{className:"flex flex-col @4xl:flex-row gap-xl",children:[e,cd(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(ud(i)).filter(Boolean))]}),n?o("div",{children:o(ja,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:a,children:n?.text})}):null]}))),ud=e=>([t,n])=>{const i=n?.type;return"array"===i?hd(t,e)(n):null},hd=(e,t)=>n=>{const i=n?.items?.enum?.map(((e,t)=>({value:e,title:n?.items?.enumNames?.[t]||""})))||[];return c("div",{className:"flex-1",children:[n?.title?o("div",{className:"mb-m",children:o(Me,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(dd,{items:i,multiple:!n?.single,...t(e)})]},e)};function pd(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const gd=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,fd=(e,t)=>Object.entries(e).map((([n,i])=>"number"==typeof i?Array.isArray(t[n])?((e,t)=>n=>gd(t[e])||gd(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>gd(t[e])||gd(n[e])||xd(t[e])<=xd(n[e]))(n,e):"object"==typeof i&&"min"in i&&"max"in i?((e,t)=>n=>gd(t[e])||gd(n[e])||xd(t[e]?.min)>=xd(n[e]?.min)&&xd(t[e]?.min)<=xd(n[e]?.max))(n,e):Array.isArray(i)?((e,t)=>n=>gd(t[e])||gd(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>gd(t[e])||gd(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),xd=e=>Number(e||0),bd=(e,{block:t,page:n,normalize:i=ln})=>{const a=t?.blocks||[],[l,{field:s,reset:o,update:c}]=rn(e),d=r((()=>pd(a,a.map((e=>At(e.content,n?.fallback))))),[a,n?.fallback]),m=l===e?a:((e,t)=>(n=ln)=>e?.filter((([,e])=>fd(t,n(e)||{}))).map((([e])=>e)))(d,l)(i);return[l,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},yd={},vd={},Nd=Et((({className:e,filtrationSchema:t=yd,consumerField:n={},resetButton:i,...a})=>{const[,{blocksToRender:l},{field:r,reset:s}]=bd(vd,{block:a.block,page:a.options?.page}),d=o(_n,{className:"w-64",label:n?.title,options:wd(n),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>wd(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...a,children:[o(md,{filtrationSchema:t,field:r,reset:s,children:c("div",{children:[d,o("div",{children:o(ja,{type:"reset",className:"mt-lg w-64",onClick:s,version:i?.version,children:i?.text})})]})}),o(sd,{blocksToRender:l,...a})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),wd=e=>pd(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),Cd=(e=!1)=>e?"text-left":"text-center",Sd={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},kd=d((({className:e,defaultIconSize:t=44,iconBgVersion:n="primary",size:i,icon:a,...l})=>{const r=String(i?.width||t);return a?o("div",{style:{width:`${r}px`,height:`${r}px`},className:u("rounded-icon object-fit flex justify-center items-center",Sd[n],e),children:o(W,{...l,width:"54%",height:"54%",name:a})}):null})),Id=d((({className:e="",title:t,benefitList:n,...i})=>{const a=Se();return c(g,{className:e,defaultPadding:"p-6xl",...i,children:[t?o(N,{headingType:"h3",as:"h2",className:Cd(a),title:t}):null,n?.length?o("div",{className:"flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl",role:"list",children:n.map(Td)}):null]})})),Td=({label:e,description:t,__html:n,icon:i,isDotted:a=!1,iconBgVersion:l},r)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[i?.icon?o(kd,{className:"shrink-0",iconBgVersion:l,...i}):null,i?.src?o(ne,{className:"shrink-0",image:i}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(N,{headingType:"h6",children:e}),o(Me,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(De,{__html:n,isDotted:a,itemSize:"list-s"}):null]}):null]},String(r)),Bd=e=>({icon:t,title:n,description:i},a)=>c("div",{className:u("flex flex-col gap-1","items-center",{"justify-center":!i&&!n}),children:[n?o(Me,{size:"text-h6",font:"font-normal",align:e,children:n}):null,t?o(ne,{image:t,height:"180",className:"w-auto mx-auto"}):null,i?o(Me,{size:"text-h6",font:"font-normal",align:e,children:i}):null]},String(a)),Pd=(e,t,n)=>o("div",{className:`grid gap-2xs ${Rd(t)}`,children:e.map(Bd(n))}),Rd=e=>{switch(e){case"3":return"grid-cols-3";case"4":return"grid-cols-4";default:return"grid-cols-5"}},Dd=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:i="4",subtitle:a,title:l,...r})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...r,children:[o(S,{defaultPadding:"",title:l,description:a,headlineVersion:"M"}),e?.length?Pd(e,i,t):null]}))),_d={start:"justify-start",center:"justify-center",end:"justify-end"},Md=d((({buttons:e,className:t="",align:n,...i})=>{const a=n&&u("flex",_d[n]);return o(g,{className:u("!bg-transparent",a,t),defaultPadding:"p-0",...i,children:je(e)})})),Ad=d((({className:e,title:t,children:n,...i})=>c(g,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...i,children:[t?o(N,{className:"text-center",title:t}):null,n]}))),zd="flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl",Ed="flex flex-col lg:max-w-80 lg:w-1/2 gap-2xl",Od="flex flex-col gap-y-xl min-w-52",Fd=d((({value:e,fractionDigits:t,fixed:n,prefix:i,postfix:a})=>o(Me,{size:"text-h3",children:"number"==typeof e?[i,We(t,{fixed:n})(e),a].filter(Boolean).join(" "):e}))),Vd=d((({className:e,title:t,value:n,color:i="text-secondary-text",...a})=>c("div",{className:u("flex justify-between @xl:flex-col",e),children:[t?o(Me,{size:"text-l",font:"font-light",color:i,children:t}):null,n?o(Fd,{value:n,...a}):o(Me,{size:"text-h3",children:"-"})]}))),Ld=(e,t)=>e?o(w,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,jd=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:i=2,depositeName:a,isShowDepositeName:l,color:r="text-secondary-text"})=>c("div",{children:[o(Me,{size:"text-l",font:"font-light",color:r,children:t}),c("div",{className:"relative",children:[c("div",{className:"flex @xl:justify-center gradient-color-text",children:[o("span",{className:"font-mohave text-title-huge -mt-m tracking-[-15px]",children:We(i,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),a&&l?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:a}):null]})]}))),qd=d((({title:e="Ставка"})=>c("div",{className:"space-y-s min-w-96",children:[o(Me,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(W,{className:"w-10 h-auto lg:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:o(w,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Процентная ставка не найдена, выберите другие параметры"})})]}))),$d=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:i=2,color:a="text-secondary-text",children:l,...r})=>t?c("div",{className:"flex flex-col",children:[o("div",{className:"hidden lg:block min-w-96",children:o(jd,{title:e,rate:t,unit:n,fractionDigits:i,color:a,...r})}),o(Vd,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:i,fixed:!0,color:a,...r}),l]}):o(qd,{title:e,...r}),Ud=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...i})=>o(ul,{items:e?[`От ${We(1)(i.min||0)} ${n}`,`До ${We(1)(i.max||0)} ${n}`]:[],step:t,...i}),Wd={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Hd={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Yd=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:i}=e,[a,l]=((e,t,n)=>{const{maxBonus:i=5e3,prefMonthsNum:a=Wd.prefMonthsNum,prefTravelBonusRate:l=Wd.prefTravelBonusRate,prefRestBonusRate:r=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(l*t)+Math.round(r*n),i);return[c,c*a+Math.min(Math.round(s*t)+Math.round(o*n),i)*(12-a)]})(t||Hd,n,i);return{...t,...e,monthBonus:a,yearBonus:l}},Kd=Et((({className:e="",title:t,calcSource:n,buttons:i,footnote:a,...l})=>{const[r,{field:s}]=rn({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=Yd(r,n);return o(Ad,{className:e,title:t,...l,children:c("section",{className:u(zd,e),children:[c("div",{className:Ed,children:[Ud({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),Ud({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?$d({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:Od,children:[f>=0?o(Vd,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,je(i,{isVertical:!0}),Ld(a)]})]})})})),Gd=Math.round(29.5),Xd=(e,t=0)=>e?.sum?e.sum:t,Jd=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,Zd=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,Qd=({items:e,title:t,mobileTitle:n=t,orientation:i="horizontal",value:a,onChange:l,...r})=>c("div",{className:"grid gap-s whitespace-nowrap",children:[t?o("div",{className:"hidden @5xl:block",role:"radiogroup","aria-label":t,children:o(Me,{color:"text-secondary-text",font:"font-light",children:t})}):null,n?o("div",{className:"@5xl:hidden",role:"radiogroup","aria-label":n,children:o(Me,{color:"text-secondary-text",font:"font-light",children:n})}):null,o(hr,{orientation:i,items:e,value:e[a?0:1].id,onChange:t=>l&&l(t===e[0].id),...r})]}),em=e=>Qd({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),tm=" (c капитализацией)",nm=({income:e,finalSum:t,postfix:n="₽",buttons:i=[],footnotes:a=[],isCapitalization:l=!1})=>c("div",{className:Od,children:[o(Vd,{title:`Доход в конце срока${l?tm:""}`,value:e,postfix:n,prefix:"+"}),o(Vd,{title:`Сумма в конце срока${l?tm:""}`,value:t,postfix:n}),je(i,{isVertical:!0}),a?.map(Ld)]}),im=([e,t],n,i=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:am([e,t],i),am=([e,t],n=[])=>({[e]:n.length?Fc(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?Ec(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),lm=(e,[t,n],i)=>e>=i[t]&&e<=i[n],rm={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const sm={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},om=(e,t)=>{const{daysValue:n,moneyValue:i,isPartialWithdrawal:a,isReplenished:l,isMonthlyInterestPayment:r}=e,s=l||a,o=n<90||n>730,c=function(e){const t=e?.rateType?rm[e?.rateType]:"",{data:n}=pi(t?`/api/v1/depositrates/${t}`:null,Rt);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>r===e.isMonthlyInterestPayment&&cm(s,e)&&lm(i,["minSum","maxSum"],e)&&lm(n,["minDays","maxDays"],e)))||sm,{rate:m}=d,u=dm(m,e),h=i+u,p=c||[sm];return{...d,...am(["minSum","maxSum"],p),...am(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},cm=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,dm=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:i,daysValue:a}=t;return n?Math.round(i*Math.pow((1200+e)/1200,a/30)-i):Math.round(i*e*a/365/100)},mm=Et((({className:e="",title:t,buttons:n,footnote:i,bottomFootnote:a,isShowDepositeName:l,defaultParams:r,rateParams:s,...d})=>{const[m,{field:h}]=rn({moneyValue:Xd(r,1e5),daysValue:Jd(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),p=om(m,s),{income:g,finalSum:f,rate:x,depositeName:b}=p;return o(Ad,{className:e,title:t,...d,children:c("section",{className:u(zd,e),children:[c("div",{className:Ed,children:[Ud({title:"Сумма, ₽",min:p.minSum,max:p.maxSum,...h("moneyValue"),value:p.moneyValue}),(y={title:"Срок, дней",min:p.minDays,max:p.maxDays,...h("daysValue"),value:p.daysValue},o(ul,{items:[`От ${Zd(y.min||0)}`,`До ${Zd(y.max||0)}`],step:1,...y})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[um(p,h),em({title:"Выплата процентов",orientation:"vertical",...h("isMonthlyInterestPayment"),className:"sm:flex-col"})]})]}),$d({rate:x,depositeName:b,isShowDepositeName:l}),nm({income:g,finalSum:f,buttons:n,footnotes:[i,a]})]})});var y})),um=(e,t)=>c("div",{className:"space-y-s",children:[o(Me,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(Ii,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(Ii,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),hm=(e=[],t=!1)=>pm([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),pm=(e,t)=>{if(!t?.length)return;const n=t?.reduce(((t,n)=>e[0](n.rate,t[0].rate)?[n]:n.rate===t[0].rate?[...t,n]:t),[t[0]]);return n.length>1?n.reduce(((t,n)=>e[1](n,t)?n:t),n[0]):n[0]},gm=({min:e=0,max:t=0,availableMonths:n,...i})=>o(ul,{items:[`От ${fm(e)}`,`До ${fm(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...i}),fm=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,xm=e=>Qd({...e,className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),bm=({field:e,defParams:t,calcParams:n,map:i,monthsValue:a="maxMonths"})=>{Object.entries(i).forEach((([n,i])=>{e?.(n)?.onChange?.(t?.[i])})),e?.("monthsValue")?.onChange?.(sl(t?.[a],n.minMonths,n.maxMonths))},ym=(e,t)=>{const{isAnnuity:n,moneyValue:i,monthsValue:a,moneyExtra:l}=t;if(0===e)return 0;if(n){const t=e/1200;return l?(i+l)*(t+t/(Math.pow(1+t,a)-1)):i*(t+t/(Math.pow(1+t,a)-1))}return Math.round(i/a)+i*(e/1200)},vm={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Nm=e=>wm({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&wm({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&wm({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&wm({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),wm=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:i,viewSettingFieldKey:a})=>!!n&&!n[a]||t[i]===e[i],Cm=(e,t,n)=>{const{moneyValue:i,monthsValue:a}=e,l=t?.rateRows||[vm],r=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Nm({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=im(["minSum","maxSum"],r,l),{minMonths:c,maxMonths:d}=im(["minMonths","maxMonths"],r,l),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:i,monthsValue:a})=>e?.find((e=>Nm({row:e,userInputParams:t,paramsViewSettings:n})&&lm(i,["minSum","maxSum"],e)&&lm(a,["minMonths","maxMonths"],e)))||vm)({rateRows:l,userInputParams:e,paramsViewSettings:n,moneyValue:i,monthsValue:a}),{rate:u}=m,h=ym(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:i,monthsValue:a,monthlyPayment:h}},Sm=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),km={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},Im=Et((({className:e,title:t,calcSource:n,buttons:i,footnote:l,paramsViewSettings:r,defaultParams:s,registerSubmit:d,...m})=>{const h=(p=n?.rateRows,pm([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],p));var p;const[g,{field:f,onSubmit:x}]=rn({moneyValue:Xd(s,2e5),monthsValue:Jd(s,Gd),isAnnuity:Boolean(s?.isAnnuity),isInsurance:Boolean(s?.isEnableInsurance),isSalaryClient:Boolean(s?.isEnableSalaryClient),isPensionClient:Boolean(s?.isEnablePensionClient),isStateEmployee:Boolean(s?.isEnableStateEmployee)});d?.(x);const b=Cm(g,n,r),y=xm({title:"Тип платежа",orientation:"vertical",...f("isAnnuity")}),{onChange:v}=f("moneyValue"),{onChange:N}=f("monthsValue");return a((()=>{v&&v(sl(g.moneyValue,b.minSum,b.maxSum))}),[b.minSum,b.maxSum]),a((()=>{N&&N(sl(g.monthsValue,b.minMonths,b.maxMonths))}),[b.minMonths,b.maxMonths]),a((()=>{!Sm(s)&&h&&bm({field:f,defParams:h,calcParams:b,map:km,monthsValue:"minMonths"})}),[n,s]),o(Ad,{className:e,title:t,...m,children:c("section",{className:u(zd,e),children:[c("div",{className:Ed,children:[Ud({title:"Сумма кредита, ₽",step:500,min:b.minSum,max:b.maxSum,...f("moneyValue"),value:b.moneyValue}),gm({title:"Срок кредита, месяцев",min:b.minMonths,max:b.maxMonths,...f("monthsValue"),value:b.monthsValue}),Tm({...b,...r},f),o("div",{className:"sm:hidden",children:y})]}),c("div",{className:u(Od,"@4xl:w-1/2"),children:[o(Vd,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(Vd,{title:"Ставка",value:b?.rate,fractionDigits:2,postfix:"%"}),o(Vd,{title:"Ежемесячный платёж",value:b.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:y}),je(i,{isVertical:!0}),Ld(l)]})]})})})),Tm=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(Ii,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(Ii,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(Ii,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(Ii,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),Bm=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,i]=t[n-1],[a,l]=t[n];i>=a?t.splice(n-1,2,[e,Math.max(i,l)]):n++}return t},Pm={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},Rm=(e,t,n)=>{const{moneyValue:i,monthsValue:a}=e,l=t?.[0]?Mm(t[0].minMonths,t[0].maxMonths):0,r=!n?.isShowMonthlyInterestPayment,s=!n?.isShowRemoteRegistration,o=!n?.isShowReplenish,c=!n?.isShowWithdrawn,d=!n?.isShowNewClient,m=t?.find((t=>[_m({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),_m({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),_m({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r}),_m({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,lm(i,["minSum","maxSum"],t),lm(a||l,["minMonths","maxMonths"],t)].every(Boolean)))||Pm,{rate:u}=m,h=Dm(u,e),p=i+h,g=t||[Pm];return{...m,...am(["minSum","maxSum"],g),...am(["minMonths","maxMonths"],g),availableMonths:Bm(g.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,n=1)=>Array.from({length:Math.abs(t-e)/n+1},((i,a)=>t>=e?e+a*n:e-a*n)))(e,t))),...e,defaultMonth:l,income:h,finalSum:p}},Dm=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:i,monthsValue:a}=t;return n?Math.round(i*Math.pow((1200+e)/1200,a)-i):Math.round(i*e*30*a/365/100)},_m=({row:e,userInputParams:t,paramKey:n,isExclude:i})=>i||t[n]===e[n],Mm=(e,t)=>e+Math.round((t-e)/2),Am=(e="rub")=>"rub"===e,zm=(e,t)=>{const{minMonths:n,maxMonths:i}=am(["minMonths","maxMonths"],Vm(t,e?.currency)),a=e.monthsValue||Math.round((n+i)/2);return{monthsValue:sl(a,n,i)}},Em=(e,t)=>{const{minSum:n,maxSum:i}=am(["minSum","maxSum"],Vm(t,e?.currency)),a=e.moneyValue||n;return{moneyValue:sl(a,n,i)}},Om=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),Fm=e=>{const t=Am(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},Vm=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},Lm=(e,t)=>{const n="rub"!==e?.currency?.key;return c("div",{className:"grid gap-lg",children:[c("div",{className:"flex gap-lg",children:[e.isShowReplenish?Qd({title:"Пополнение",...t("isReplenish"),value:e.isReplenish,orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,e.isShowWithdrawn?Qd({title:"Снятие",...t("isWithdrawn"),value:e.isWithdrawn,orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null]}),jm(e.isShowReplenish||e.isShowWithdrawn),c("div",{className:"flex gap-lg",children:[e.isShowMonthlyInterestPayment?em({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment,orientation:"vertical"}):null,e.isShowRemoteRegistration?(i={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration,orientation:"vertical"},Qd({...i,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]}),jm(e.isShowNewClient),e.isShowNewClient?o(Ii,{text:"Новый вкладчик",...t("isNewClient")}):null]});var i},jm=(e=!1)=>e?o("div",{className:"border-b border-main-divider w-full"}):null,qm={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum"},$m={text:"₽",key:"rub"},Um=Et((({className:e,title:t,calcSource:n,buttons:i=[],footnote:r="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=n??{},p=h?.map((e=>e.currency))??[$m],g=l((e=>t=>e?{...t,...Fm(t),...Em(t,e),...zm(t,e),...Om(t,e)}:t)(h),[h]),[f,{field:x}]=rn({moneyValue:Xd(d,2e4),monthsValue:Jd(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:$m},{normalize:g}),b=x?.("currency")?.value??$m,y=x?.("isNewClient")?.value,v=Vm(h,b),N=Rm(f,v,s),{rate:w,income:C,finalSum:S,type:k=""}=N,I=l((()=>{bm({field:x,defParams:hm(v,y),calcParams:N,monthsValue:"minMonths",map:qm})}),[x,h]);a((()=>{!Sm(d)&&v&&I()}),[d,h]);const T=w===hm(v,y)?.rate;return o(Ad,{className:e,title:t,...m,children:c("section",{className:u(zd,e),children:[c("div",{className:Ed,children:[c("div",{className:"flex gap-m",children:[Ud({className:"w-full",title:`Сумма, ${b?.text}`,min:N.minSum,max:N.maxSum,...x("moneyValue"),value:N.moneyValue,postfix:b?.text,step:Wm(b?.key)}),h&&h?.length>1?o(En,{label:"Валюта",options:p,...x("currency")}):null]}),gm({title:"Срок, месяцев",min:N.minMonths,max:N.maxMonths,availableMonths:N.availableMonths,...x("monthsValue"),value:N.monthsValue}),Lm({...N,...s},x)]}),$d({rate:w,children:Ym(I,T)}),nm({income:C,finalSum:S,buttons:[...i,Hm(n?.buttons,k)],footnotes:[r],postfix:b?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),Wm=(e="")=>Am(e)?1e3:100,Hm=(e=[],t="")=>{const{type:n,...i}=e.find((e=>e.type===t))??{};return i},Ym=(e,t=!1)=>t?null:o(ja,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),Km=e=>Gm({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Gm({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Gm=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:i,viewSettingFieldKey:a})=>!!n&&!n[a]||t[i]===e[i],Xm={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},Jm=(e,t,n)=>{const{moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r}=e,s=t?.rateRows||[Xm],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Km({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=im(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=im(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r})=>e?.find((e=>Km({row:e,userInputParams:t,paramsViewSettings:n})&&lm(i+r,["minSum","maxSum"],e)&&lm(l,["minSumOld","maxSumOld"],e)&&lm(r,["minSumExtra","maxSumExtra"],e)&&lm(a,["minMonths","maxMonths"],e)))||Xm)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r}),{rate:p}=h,g=ym(p,e),f=e.oldMonthlyPayment-g;return{...h,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r,monthlyPayment:g,benefit:f}},Zm=Et((({className:e="",title:t,calcSource:n,buttons:i,footnote:a,paramsViewSettings:l,...r})=>{const[s,{field:d}]=rn({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),m=Jm(s,n,l),h=xm({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...d("isAnnuity")});return o(Ad,{className:e,title:t,...r,children:c("section",{className:u(zd,e),children:[c("div",{className:Ed,children:[Ud({title:"Остаток долга в других банках, ₽ ",step:500,min:m.minSum,max:m.maxSum-m.maxSumExtra,...d("moneyValue"),value:m.moneyValue}),Ud({title:"Ежемесячный платёж в других банках, ₽",step:500,min:m.minSumOld,max:m.maxSumOld,...d("oldMonthlyPayment"),value:m.oldMonthlyPayment}),gm({title:"Новый срок кредита, месяцев",min:m.minMonths,max:m.maxMonths,...d("monthsValue"),value:m.monthsValue}),Qm({...m,...l},d),m.isExtraMoney?Ud({title:"Дополнительная сумма, ₽ ",step:500,min:m.minSumExtra,max:m.maxSumExtra,...d("moneyExtra"),value:m.moneyExtra}):null,o("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:h})]}),c("div",{className:u(Od,"@4xl:w-1/2"),children:[o(Vd,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(Vd,{title:"Ставка",value:m?.rate,fractionDigits:2,postfix:"%"}),o(Vd,{title:"Ежемесячный платёж",value:m.monthlyPayment,postfix:"₽"}),m.benefit>0?o(Vd,{title:"Выгода в месяц",value:m.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:h}),je(i,{isVertical:!0}),Ld(a)]})]})})})),Qm=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(Ii,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(Ii,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(Ii,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),eu=d((e=>{const{onChange:t,min:n,max:i,defaultValue:a="0",fractionDigits:r=0,...s}=e,c=rl(e,{normalize:(e=a)=>n&&i?String(sl(Number(tu(e)),n,i)):tu(e),format:We(r)}),d=l((e=>t&&t(tu(e))),[t]);return o(xn,{onChange:d,...s,...c})})),tu=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),nu=d((e=>o(eu,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Me,{size:"text-xl",font:"font-light",children:"₽"})})}))),iu={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},au={amount:1500},lu=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:l,formType:r="private",...s})=>{const[{amount:d},{field:m}]=rn(au),[h,p]=i(!1);return a((()=>{p(d<=0)}),[d]),c(g,{className:u("flex flex-col items-center",e),defaultPadding:"p-6xl",...s,children:[t?o(N,{className:"pb-lg xl:pb-4xl self-start xl:self-center",headingType:"h3",title:t}):null,c("form",{className:"w-full xl:max-w-[468px]",method:"POST",action:iu[r],children:[o(nu,{valid:!h,label:n,max:3e5,min:1,...m("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:d}),l?.text?o(ja,{className:"w-full mt-lg",type:"submit",disabled:h,children:l.text}):null]})]})})),ru=({className:e,text:t="ХИТ"}={})=>c("div",{className:u("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[o(W,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),o(w,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),su="relative h-full",ou={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},cu=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...i})=>{const{blocks:a}=i.block||{},l=a?.some(uu),r=n?{defaultPadding:"p-6xl pb-m"}:{};return R({...i,renderProps:(n,i,a)=>c("div",{className:du(n,{someCardsHighlighted:l}),children:[T(n,i,{className:mu(n,{someCardsHighlighted:l,showBorder:!e,cardSize:t}),...r,blockIndex:a}),uu(n)?ru({className:"absolute top-0 -right-4 z-40"}):null]},String(a))})},du=(e,{someCardsHighlighted:t})=>u(su,t&&(uu(e)?"pt-3xl":"pt-3xl sm:pt-16")),mu=(e,{someCardsHighlighted:t,showBorder:n,cardSize:i="normal"})=>u(su,"min-w-80",ou[i],t&&(uu(e)?"pt-3xl sm:pt-16":"pt-3xl"),wc(n),n&&"h-full"),uu=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,hu=Et((({className:e,visibleItemCount:t=1,noCardBorder:n,arrowsPadded:i=!0,isGap:a=!0,cardSize:l="normal",isNavButtons:r=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o(Zc,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:a?16:0,padding:0,arrowsPadded:i,navButtons:r?pu(s?.block?.blocks):[],hasBlur:!0,children:cu({noCardBorder:n,cardSize:l,isNavButtons:r,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),pu=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],gu="z-10 border border-solid w-full h-full",fu=u(gu,"absolute hidden @xl:block border-transparent"),xu=d((({className:e,title:t,description:n,button:i,...a})=>o(g,{className:u("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...a,children:c("div",{className:"relative h-full",children:[o("div",{className:u(fu,"top-9 right-12 bg-green-dark")}),o("div",{className:u(fu,"top-6 right-8 bg-green")}),o("div",{className:u(fu,"top-3 right-4 bg-green-light")}),c("div",{className:u(gu,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[o(S,{title:t,description:n,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),je([i],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),bu={black:"bg-black",white:"bg-white"},yu=d((({className:e="",title:t,description:n,image:i,price:a,button:l,colors:r=[],align:s="text-left",padding:d,...m})=>o(g,{className:u("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(Te,{className:"h-full",padding:d,title:o(S,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:i?.src?o(ne,{className:"flex justify-center align-center mb-xl",image:i}):null,buttons:je([l],{buttonClassName:"w-full self-end"}),children:[r?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(Me,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(vu)]}):null,a?c(Me,{size:"text-h3",align:"text-left",children:[a," ₽"]}):null]})}))),vu=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${bu[e]}`},String(t)),Nu=d((({icon:e,...t})=>{const n=he(),{text:i,href:a,target:l,onClick:r}=n(t);return i?o("div",{className:u("p-3 rounded-lg bg-white text-secondary-text flex justify-center"),children:o("a",{role:"link",href:a,target:l,onClick:r,children:c("div",{className:"flex flex-col items-center gap-3 break-words max-w-[150px]",children:[e?o(ne,{className:"w-7 h-7 md:w-12 md:h-12",image:{...e,iconVersion:e?.iconVersion},alt:i}):null,o("div",{className:"font-light md:font-normal text-primary-text text-center text-xs md:text-sm whitespace-wrap",children:i})]})})}):null})),wu=d((({className:e,additionalDescription:t,description:n,links:i,title:a,...l})=>o(g,{defaultPadding:"p-5xl",className:u("overflow-hidden",e),...l,children:c("div",{className:"flex flex-col lg:flex-row gap-5 justify-between",children:[c("div",{className:"flex-1",children:[o(S,{isEmbedded:!0,title:a,description:n,as:"h1",align:"text-left",headlineVersion:"XL"}),o(S,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),i?.length?Cu(i):null]})}))),Cu=e=>o("div",{className:u("lg:grid-cols-9 lg:[&>*]:col-span-2 lg:[&>*:nth-child(14n+2)]:col-span-3 lg:[&>*:nth-child(7n+5)]:col-span-3","lg:[&>*:nth-child(7n+6)]:col-span-3 lg:[&>*:nth-child(7n+7)]:col-span-3 lg:[&>*:nth-child(14n+10)]:col-span-3 lg:w-3/6","grid-cols-3 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+3)]:col-span-2 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+4)]:col-span-2","grid gap-3 lg:gap-5"),children:e.map(((e,t)=>o(Nu,{...e},String(t))))}),Su=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"mindboxEvent"===e?{...n,eventJson:t}:n}))),ku=d((({className:e="",href:t,target:n,onClick:i,data:a,children:l})=>{const r=he()({href:t,target:n,onClick:i});return o(t?"a":"div",{className:u("block",e),...t?r:{},role:t?"link":"none",...ge(a),children:l})})),Iu=[{origins:["t.me","telegram.org"],iconMapped:{icon:"TelegramIcon"}},{origins:["vk.com"],iconMapped:{icon:"VKIcon"}},{origins:["ok.ru"],iconMapped:{icon:"OkIcon"}},{origins:["apps.apple.com"],iconMapped:{icon:"AppleIcon"}},{origins:["play.google.com"],iconMapped:{icon:"PlayMarketIcon"}},{origins:["appgallery.huawei.com"],iconMapped:{icon:"HuaweiIcon"}},{origins:["youtube.com"],iconMapped:{icon:"YoutubeIcon"}},{origins:["rutube.ru"],iconMapped:{icon:"RutubeIcon"}},{origins:["dzen.ru"],iconMapped:{icon:"DzenIcon"}},{origins:["rustore.ru"],iconMapped:{icon:"RustoreIcon"}}],Tu=d((({className:e="",media:t,showButtonText:n,stretched:a,version:l="white",children:r})=>{if(!t?.length)return null;const[s,d]=i(),m=t?.map((e=>{const{href:t,icon:i,text:a}=e,{iconMapped:r}=(e=>Iu.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=Le(i)?i:r,c=n?{text:a}:{text:""},m=e?.icon?.iconVersion||"color";return!s&&a&&d(!0),{...e,...c,icon:{...o,iconVersion:m},version:e?.version??l}})),h=u("border border-solid hover:border-transparent border-main-divider","group-data-primary:border-main-divider group-data-gray:border-green group/media",{"basis-auto":!n&&!s},Bu(a));return c("div",{className:u("flex flex-col gap-m xl:gap-xs",e),"aria-label":"Социальные сети",children:[o("div",{className:"flex gap-xs",children:je(m,{className:Pu(s??!1,a??!1,n),buttonClassName:h})}),r?o(Me,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),Bu=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",Pu=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),Ru=d((({className:e,padding:t,description:n,additionalDescription:i,href:a,icon:l,isDotted:r,__html:s,socialMedia:d=[],target:m,title:h,align:p="text-left",benefits:f,imageOptions:{directionRight:x=!0,isImageAlwaysOnRight:b=true,isImageSecondary:y=!1}={},data:v,...N})=>o(g,{className:u("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...N,children:o(ku,{href:a,target:m,className:"h-full",data:Su(v),children:c(Te,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(S,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...Ze(Le(l)?o(ne,{image:l}):null,x),buttons:d.length?o(Tu,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:b,isImageSecondary:y,imageAlign:"center",children:[o(Ve,{benefits:f}),s?o(De,{__html:s,isDotted:r,itemSize:"list-s"}):null,Du(i,p)]})})}))),Du=(e,t)=>e?o(w,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,_u=(e,t)=>{const{title:n,description:i,buttons:a}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[n?o("div",{className:"opacity-80",children:o(Me,{size:"text-m",color:"text-secondary-text",children:n})}):null,i?o("div",{className:"mt-2xs",children:o(Me,{size:"text-xl",color:"text-primary-text",children:i})}):null,a?.length?o("div",{className:"text-primary-main",children:je(a)}):null]},String(t))},Mu=d((({className:e="",title:t,align:n="text-center",icon:l,button:r,visibleCellsCount:s=1,cardCells:d=[],options:m,data:h,...p})=>{const f=d.map(_u),[x,b]=s>0?[f.slice(0,s),f.slice(s)]:[f,[]],[y,v]=i(!1);return a((()=>de.subscribe("fold",(e=>{e&&void 0!==m?.parent&&e.parent===m?.parent&&v(e.isUnfolded)}))),[m?.parent]),c(g,{className:u("flex flex-col",e),defaultPadding:"p-2xl",...p,children:[Le(l)?o("div",{className:"self-center",children:o(ne,{image:l})}):null,t?o(N,{className:u("pt-xs",n),headingType:"h5",title:t}):null,r?.text?o(ve,{className:"w-full mt-m mb-lg",...r}):null,b.length?o(na,{renderFoldableSection:()=>c("div",{children:[x,o(ia,{isUnfolded:y,children:b})]}),renderFoldButton:d.length>=s?Au(m?.parent,h,y):null}):o("div",{children:x})]})})),Au=(e,t,n=!1)=>()=>c("button",{className:"w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center",onClick:()=>{void 0!==e&&de.fire("fold",{type:"fold",isUnfolded:!n,parent:e})},type:"button",...n?ge(t):{},children:[o("div",{children:n?"Скрыть":"Подробнее о тарифе"}),o(W,{className:"text-primary-text",name:n?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),zu=d((({className:e,contacts:t,info:n,version:i="secondary",...a})=>c(g,{className:u("flex",e),defaultPadding:"p-6xl",version:i,...a,children:[n?.length?Eu(n):null,t?.length?Eu(t):null]}))),Eu=e=>o("div",{className:"flex gap-5xl grow basis-0",children:e.map(((e,t)=>Ou({column:e,i:t})))}),Ou=({column:e,i:t})=>e?o("div",{className:"flex flex-col gap-xl grow basis-0",children:e.map((({title:e="",description:t,additionalDescription:n,button:i},a)=>c("div",{children:[o(S,{title:e,description:t,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),n?o("div",{className:"mt-xs opacity-80",children:o(w,{size:"text-m",font:"font-light",children:n})}):null,o("div",{className:u({"mt-xl":Boolean(i?.text)}),children:je([i])})]},String(a))))},`col-${String(t)}`):null,Fu=e=>{const t=globalThis.sessionStorage?.getItem("refreshToken"),n=globalThis.sessionStorage?.getItem("accessToken"),i=globalThis.localStorage.getItem("taskId");if(!n||!t||!i)return e(),()=>null;const a=async()=>{const i=await Qi("/auth/refresh","POST",{refresh_token:t,access_token:n});if(401==i?.status&&e(),i?.ok){const e=await i.json();globalThis.sessionStorage.setItem("refreshToken",e.refresh_token),globalThis.sessionStorage.setItem("accessToken",e.access_token)}};a();const l=setInterval(a,24e4);return()=>clearInterval(l)};function Vu(){return Vu._impl()}Vu._impl=()=>({assign:e=>globalThis.location.assign(e)}),Vu.setup=e=>{Vu._impl=e};const Lu=d((({step:e=10,description:t,showPercentage:n=!0})=>c("div",{children:[o("div",{className:"h-4 w-full bg-gray relative",children:o("div",{className:"h-4 bg-green",style:{width:`${e}%`}})}),c("div",{className:"relative",children:[n?c("div",{className:"absolute left-2/4 text-green",children:[e,"%"]}):null,t?o("div",{className:"text-right mr-4 text-gray",children:t}):null]})]}))),ju=d((({step:e=1,totalSteps:t=6,stepsTitles:n=[]})=>{const i=r((()=>(e+1)/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e+1," из ",t,"."]}),n[e]||null,o(Lu,{step:i,showPercentage:!1})]})})}));var qu;!function(e){e.process="IN_PROCESS",e.ok="APPROVED",e.fail="CANCELLED",e.rework="REVISION"}(qu||(qu={}));const $u=e=>Zi("/user-data/getTaskStatus","POST",e),Uu=e=>Qi("/user-data/sendSignalToProcess","POST",e),Wu=d((({title:e,description:t,infoCard:n,sectionInfoTitle:i,sectionInfo:a,sectionAdditionalTitle:l,sectionInfoAdditional:r,buttonText:s,interval:d,...m})=>c(g,{...m,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(S,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(xc,{interval:d}):null]}),o(Hu,{title:i,items:a}),o(Hu,{title:l,items:r,countColumns:!0}),n?.__html?o(fc,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(ve,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),Hu=({title:e,items:t,countColumns:n=!1})=>{const i=Se();return t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(Me,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",no(n||i?1:2)),children:t.map(((e,t)=>o("div",{children:Yu(e)},t)))}):null]})]}):null},Yu=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Me,{color:"text-secondary-text",size:"text-l",children:e}),o(Me,{color:"text-primary-text",size:"text-xl",children:t})]}),Ku=d((()=>o(Wu,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Gu=d((()=>{const[e]=bo("leadForm");return o(Wu,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:e?.cardCategory?.text}]})})),Xu=d((()=>{const[e]=bo("leadForm");return o(Wu,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Ju=d((()=>{const[e]=bo("leadForm");return o(Wu,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),Zu=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],Qu=d((()=>{const[e,t]=i(qu.process),[n]=bo("taskId");return a((()=>{(async()=>{for(const e of Zu)await Uu({signalType:e,taskId:n})})();const e=l((async()=>{const e=await $u({taskId:n});e&&e?.statusCd!==qu.process&&(clearInterval(i),t(e.statusCd))}),[]),i=setInterval(e,3e4)}),[]),eh(e)})),eh=e=>({IN_PROCESS:o(Gu,{}),CANCELLED:o(Ku,{}),APPROVED:o(Ju,{}),REVISION:o(Xu,{})}[e]||null),th=[{paymentSystem:"",currency:"rub",codeWord:""},{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDateField:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0,methodObtain:"office",addressCourier:{fullAddress:"",fiasCode:""}},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},dependents:void 0,familyMembers:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!1},{disablePeopleFlg:!1,bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:"",addressRetail:{key:"",text:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:"office",deliveryDate:void 0}],nh=e=>{if(e)try{return new Date(e)}catch(e){return}},ih=e=>(t,n)=>t.filter((e=>e)).map((t=>[ah(n,e),lh(t,e),rh(t,e),sh(t,e),oh(t,e),ch(t,e)].some(Boolean)?{...t,required:!1}:t)),ah=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,lh=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,rh=({name:e},t)=>"snils"===e&&!t("consentPfrFlg"),sh=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,oh=({name:e},t)=>"addressFact"===e&&t("addressMatch"),ch=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const i=t(e?.name);return n!==(i?.key??i)})),dh=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(fc,{__html:e},`${t}_${n}`))):null},mh=({field:e,inputs:t})=>t.map(to(e,"")),uh=({sections:e,field:t,step:n})=>e?.map((({inputs:e=[],columns:i,title:a},l)=>{const r=ih(hh(t))(e,n),s=r.filter((e=>!ch(e,hh(t))));return c("div",{className:u(no(i),"grid gap-x-m"),children:[dh(s),io(a),mh({field:t,inputs:r})]},`section-${l}`)})),hh=e=>t=>e(t)?.value,ph=d((({step:e,onPrevStep:t})=>{const n=6===e;return c("div",{className:"flex justify-between gap-m",children:[o(ja,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(ja,{type:"submit",children:n?"Отправить заявку":"Далее"})]})})),gh=e=>{const{methodObtain:t,deliveryDate:n=""}=e;return{courierDeliveryFlg:"courier"===t,deliveryDate:(i=n,i?new Date(i).toISOString().split(".")[0]:""),deliveryTimeCd:{value:"TIME_2"}};var i},fh=(e,t)=>{switch(e){case 0:return(e=>{const{currency:t,paymentSystem:n,cardCategory:i,codeWord:a}=e;return{currencyCode:t,paymentSystemTypeCd:n,classCard:i,codeWord:a}})(t);case 1:return(e=>{const{name:t,surname:n,middleName:i,limitedBirthday:a="",phone:l="",email:r,sex:s,birthPlace:o,dulIssueDateField:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g="",housing:f,addressRegistration:x,addressFact:b}=e;return{birthDate:Lt(a,!0),midname:i,name:t,surname:n,birthPlace:o,dulIssueDate:Lt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:Lt(g,!0),houseTypeCd:f,participantContacts:ac({phone:jt(l),email:r}),participantAddresses:lc({addressRegistration:x,addressFact:b}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{employment:t,organizationName:n,inn:i,legalForm:a,organization:l,amountWorkers:r,employerActivities:s,employerOrganization:o,generalSeniority:c,lastJobExperience:d,experience5Years:m,jobsNumber:u,organizationPhone:h,organizationAddress:p,positionOrganization:g}=e;return{employmentTypeCd:t,organizationName:n,organizationInn:i,organizationActivityTypeCd:s,organizationTypeCd:l,organizationKindCd:o,employeesNumberCd:r,opf:a,seniority:c,generalSeniority:m,jobsNumber:u,lastWorkDuration:d,payrollCardRshbFlg:!0,positionCd:g,participantContacts:ac({organizationPhone:h&&jt(h)}),participantAddresses:lc({organizationAddress:p})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:i,wages:a,mandatoryPayments:l,incomeAverage:r,additionalIncome:s,otherIncome:o,otherPayments:c,rentalIncome:d,retirementIncome:m,snils:u,armyIdFlg:h}=e;return{maritalStatusCd:t,totalDependents:i,otherDependents:n,participantIncomes:rc({wages:a,mandatoryPayments:l,incomeAverage:r,additionalIncome:s,otherIncome:o,otherPayments:c,rentalIncome:d,retirementIncome:m}),snils:u?.replaceAll(" ",""),armyIdFlg:h}})(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:i,creditInRshbCd:a}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:i,creditInRshbCd:a}})(t);case 5:return(e=>{const{addressCourier:t}=e;return{participantAddresses:lc({addressCourier:t})}})(t);default:return{}}},xh=({step:e,inputs:t,onNextStep:n,saveStep:i,finishForm:a})=>{const[r]=bo("taskId"),[s]=bo("profileId"),[o]=bo("participantId"),c=l((async l=>{const c=ro(ai(ih(bh(l))(t,e)));if(console.log(ai(ih(bh(l))(t,e))),!On(c(l)))return console.warn("validation fail");i(l);try{r&&s&&o&&await To((({participantId:e,taskId:t,profileId:n,formData:i,step:a=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:globalThis.location.origin,id:t,office:{id:"650"},authorizedAgentId:i?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...fh(a,i)}],...gh(i)}}))({participantId:o,taskId:r,profileId:s,step:e,formData:l}))}catch(e){return"Fail"}return n(),5===e&&a?.(!0),"OK"}),[]);return{handleSubmit:c}},bh=e=>t=>e[t],yh=d((({step:e,sections:t,onPrevStep:n,onNextStep:i,isFormFinished:a,finishForm:r})=>{const[d,m]=bo("leadForm"),u=((e,t)=>({...th[e],...t,limitedBirthday:nh(t?.limitedBirthday),dulIssueDateField:nh(t?.dulIssueDateField),participantDateRegistration:nh(t?.participantDateRegistration),beginDate:nh(t?.beginDate),deliveryDate:nh(t?.deliveryDate)}))(e,d),h=s(void 0),p=t?.flatMap((e=>e?.inputs))||[],g=l((e=>{h.current=e}),[]),{handleSubmit:f}=xh({step:e,inputs:p,onNextStep:i,saveStep:m,finishForm:r}),[,{field:x,onSubmit:b}]=rn(u,{onSubmit:(e,t)=>{f({...e,...h.current?.(t)})}});return a?o(Qu,{}):c("form",{onSubmit:b,className:"space-y-m",children:[uh({sections:t,field:x,step:e,registerSubmit:g}),o(ph,{step:e,onPrevStep:n})]})})),vh=[[{title:"Параметры карты",inputs:[]},{inputs:[{fieldType:"common",name:"currency",required:!0},{fieldType:"common",name:"paymentSystem",required:!0},{fieldType:"common",name:"cardCategory",required:!0},{fieldType:"common",name:"codeWord",required:!0}]}],[{title:"Персональные данные",columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"name",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"middleName",dadata:!0,filledByEsia:!0},{fieldType:"common",name:"sex",required:!0},{fieldType:"common",name:"limitedBirthday",required:!0,filledByEsia:!0},{fieldType:"common",name:"birthPlace",required:!0},{fieldType:"common",name:"phone",required:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{fieldType:"common",name:"dulSerie",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulNumber",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulIssueDateField",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{fieldType:"common",name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"addressMatch"}]},{columns:2,inputs:[{fieldType:"common",name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{fieldType:"common",name:"housing",required:!0}]},{inputs:[{fieldType:"common",name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{fieldType:"info",text:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{fieldType:"common",name:"employment"},{fieldType:"common",name:"organizationName",required:!0,dadata:!0}]},{columns:2,inputs:[{fieldType:"common",name:"inn",required:!0,dadata:!0},{fieldType:"common",name:"legalForm",required:!0}]},{inputs:[{fieldType:"common",name:"organization",required:!1},{fieldType:"common",name:"amountWorkers",required:!1}]},{columns:2,inputs:[{fieldType:"common",name:"employerActivities",required:!1},{fieldType:"common",name:"employerOrganization",required:!1},{fieldType:"common",name:"generalSeniority",required:!0},{fieldType:"common",name:"lastJobExperience",required:!0},{fieldType:"common",name:"experience5Years",required:!0},{fieldType:"common",name:"jobsNumber",required:!0}]},{inputs:[{fieldType:"common",name:"organizationPhone",label:"Телефон работодателя",required:!0},{fieldType:"common",name:"beginDate",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"positionOrganization",required:!1},{fieldType:"common",name:"partInBusiness",required:!0,condition:{name:"positionOrganization",values:["BUSINESS_OWNER"]}}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{fieldType:"common",name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{fieldType:"common",name:"familyStatus",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"dependents",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"familyMembers"},{fieldType:"common",name:"children",required:!0}]},{title:"Совокупный доход"},{inputs:[{fieldType:"info",text:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{fieldType:"common",name:"wages",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"snils",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"conscription",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"disablePeopleFlg"}]},{inputs:[{fieldType:"common",name:"bankruptcyFlg"}]},{inputs:[{fieldType:"common",name:"shareholderFlg"}]},{inputs:[{fieldType:"common",name:"legalEntityName"}]},{inputs:[{fieldType:"common",name:"creditInRshbCd"}]}],[{title:"Способ получения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"methodObtain"}]},{title:"Адрес",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressCourier",dadata:!0,condition:{name:"methodObtain",values:["courier"]},required:!0},{fieldType:"common",name:"deliveryDate",condition:{name:"methodObtain",values:["courier"]},required:!0},{fieldType:"common",name:"comment",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{fieldType:"common",name:"regionRetail",required:!0,condition:{name:"methodObtain",values:["office"]}},{fieldType:"common",name:"addressRetail",required:!0,condition:{name:"methodObtain",values:["office"]}}]},{inputs:[{fieldType:"info",text:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код",condition:{name:"methodObtain",values:["office"]}},{fieldType:"common",name:"bankEmployeeCode",condition:{name:"methodObtain",values:["office"]}}]}]],Nh=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],wh=d((({className:e,...t})=>{const[n,d]=i(0),m=s(null),h=l((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]),p=Vu();a((()=>Fu((()=>p.assign("/")))),[]);const f=l((()=>{d((e=>Math.min(e+1,6))),h()}),[]),x=l((()=>{d((e=>Math.max(e-1,0))),h()}),[]),b=r((()=>vh[n]),[n]),[y,v]=i(!1);return o(g,{className:u("bg-transparent",e),defaultPadding:"p-0",...t,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[y?null:o(ju,{stepsTitles:Nh,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(yh,{step:n,sections:b,onNextStep:f,onPrevStep:x,isFormFinished:y,finishForm:v},String(n))})]})})})),Ch=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const i=r((()=>e/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e," из ",t,"."]}),n[e]||null,o(Lu,{step:i,showPercentage:!1})]})})})),Sh=d((({title:e,description:t,infoCard:n,sectionInfoTitle:i,sectionInfo:a,sectionAdditionalTitle:l,sectionInfoAdditional:r,buttonText:s,interval:d,intervalExpireAction:m=(()=>{}),...u})=>c(g,{...u,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(S,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(xc,{interval:d,intervalExpireAction:m}):null]}),o(kh,{title:i,items:a}),o(kh,{title:l,items:r,countColumns:!0}),n?.__html?o(fc,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(ve,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),kh=({title:e,items:t,countColumns:n=!1})=>{const i=Se();return t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(Me,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",no(n||i?1:2)),children:t.map(((e,t)=>o("div",{children:Ih(e)},t)))}):null]})]}):null},Ih=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Me,{color:"text-secondary-text",size:"text-l",children:e}),o(Me,{color:"text-primary-text",size:"text-xl",children:t})]}),Th=d((()=>o(Sh,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Bh=d((({handleExpireTimer:e})=>{const[t]=bo("leadForm");return o(Sh,{interval:300,intervalExpireAction:e,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Цель кредита",description:"На любые цели"},{label:"Сумма",description:t?.moneyValue?.toLocaleString()+" ₽"},{label:"Срок кредита",description:t?.monthsValue+" мес"},{label:"Тип платежа",description:t?.isAnnuity?"Аннуитетный":"Дифференцированный"}]})})),Ph=d((()=>{const[e]=bo("leadForm");return o(Sh,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Rh=d((()=>{const[e]=bo("leadForm");return o(Sh,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),Dh=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],_h=d((()=>{const[e,t]=i(qu.process),[n]=bo("taskId");a((()=>{(async()=>{for(const e of Dh)await Uu({signalType:e,taskId:n})})();const e=setInterval((()=>n&&$u({taskId:n}).then((n=>{n?.statusCd&&n.statusCd!==qu.process&&(clearInterval(e),t(n.statusCd))}))),3e4);return()=>clearInterval(e)}),[]);return Mh(e,(()=>t(qu.rework)))})),Mh=(e,t)=>({IN_PROCESS:o(Bh,{handleExpireTimer:t}),CANCELLED:o(Th,{}),APPROVED:o(Rh,{}),REVISION:o(Ph,{})}[e]||null),Ah=[{moneyValue:0,monthsValue:0,isAnnuity:!1,isInsurance:!1,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1},{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDateField:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},dependents:void 0,familyMembers:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!1},{disablePeopleFlg:!1,bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:"",addressRetail:void 0,bankEmployeeCode:void 0}],zh=e=>{if(e)try{return new Date(e)}catch(e){return}},Eh=e=>(t,n)=>t.filter((e=>e)).map((t=>[Oh(n,e),Fh(t,e),Vh(t,e),Lh(t,e),jh(t,e),qh(t,e)].some(Boolean)?{...t,required:!1}:t)),Oh=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Fh=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Vh=({name:e},t)=>"snils"===e&&!t("consentPfrFlg"),Lh=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,jh=({name:e},t)=>"addressFact"===e&&t("addressMatch"),qh=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const i=t(e?.name);return n!==(i?.key??i)})),$h=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(fc,{__html:e},`${t}_${n}`))):null},Uh=({field:e,inputs:t})=>t.map(to(e,"")),Wh=({sections:e,field:t,step:n})=>e?.map((({inputs:e=[],columns:i,title:a},l)=>{const r=Eh(Hh(t))(e,n);return c("div",{className:u(no(i),"grid gap-x-m"),children:[$h(r),io(a),Uh({field:t,inputs:r})]},`section-${l}`)})),Hh=e=>t=>e(t)?.value,Yh=d((({step:e,onPrevStep:t})=>{const n=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(ja,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(ja,{type:"submit",children:n?"Отправить заявку":"Далее"})]})})),Kh=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},Gh={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIAL",value:"Дифференцированный "}},Xh=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:i}=e;return{loanAmount:t,creditPeriod:n,paymentTypeCd:Gh[i?"annuity":"differential"]}},Jh=(e,t)=>{switch(e){case 0:default:return{};case 1:return(e=>{const{name:t,surname:n,middleName:i,limitedBirthday:a="",phone:l="",email:r,sex:s,birthPlace:o,dulIssueDateField:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g="",housing:f,addressRegistration:x,addressFact:b}=e;return{birthDate:Lt(a,!0),midname:i,name:t,surname:n,birthPlace:o,dulIssueDate:Lt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:Lt(g,!0),houseTypeCd:f,participantContacts:ac({phone:jt(l),email:r}),participantAddresses:lc({addressRegistration:x,addressFact:b}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{employment:t,organizationName:n,inn:i,legalForm:a,organization:l,amountWorkers:r,employerActivities:s,employerOrganization:o,generalSeniority:c,lastJobExperience:d,experience5Years:m,jobsNumber:u,organizationPhone:h,organizationAddress:p,positionOrganization:g}=e;return{employmentTypeCd:t,organizationName:n,organizationInn:i,organizationActivityTypeCd:s,organizationTypeCd:l,organizationKindCd:o,employeesNumberCd:r,opf:a,seniority:c,generalSeniority:m,jobsNumber:u,lastWorkDuration:d,payrollCardRshbFlg:!0,positionCd:g,participantContacts:ac({organizationPhone:h&&jt(h)}),participantAddresses:lc({organizationAddress:p})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:i,confirmationIncome:a,wages:l,mandatoryPayments:r,incomeAverage:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u,snils:h,armyIdFlg:p}=e;return{maritalStatusCd:t,totalDependents:i,incomeCertificateCd:a,otherDependents:n,participantIncomes:rc({wages:l,mandatoryPayments:r,incomeAverage:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u}),snils:h?.replaceAll(" ",""),armyIdFlg:p}})(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:i,creditInRshbCd:a}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:i,creditInRshbCd:a}})(t)}},Zh=({step:e,inputs:t,onNextStep:n,saveStep:i,finishForm:a})=>{const[r]=bo("taskId"),[s]=bo("profileId"),[o]=bo("participantId"),c=l((async l=>{const c=ro(ai(Eh(Qh(l))(t,e)));if(!On(c(l)))return console.warn("validation fail");i(l);try{r&&s&&o&&await To((({participantId:e,taskId:t,profileId:n,formData:i,step:a=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:globalThis.location.origin,id:t,office:{id:""},authorizedAgentId:i?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Jh(a,i)}],...Xh(i),...Kh(i),esiaAccountTypeCd:{key:i?.esiaAccountTypeCd?.key}}}))({participantId:o,taskId:r,profileId:s,step:e,formData:l}))}catch(e){return"Fail"}return n(),5===e&&a?.(!0),"OK"}),[]);return{handleSubmit:c}},Qh=e=>t=>e[t],ep=d((({step:e,sections:t,onPrevStep:n,onNextStep:i,renderStep:a=Wh,isFormFinished:r,finishForm:d})=>{const[m,u]=bo("leadForm"),h=((e,t)=>({...Ah[e],...t,limitedBirthday:zh(t?.limitedBirthday),dulIssueDateField:zh(t?.dulIssueDateField),participantDateRegistration:zh(t?.participantDateRegistration),beginDate:zh(t?.beginDate),deliveryDate:zh(t?.deliveryDate)}))(e,m),p=s(void 0),g=t?.flatMap((e=>e?.inputs))||[],f=l((e=>{p.current=e}),[]),{handleSubmit:x}=Zh({step:e,inputs:g,onNextStep:i,saveStep:u,finishForm:d}),[,{field:b,onSubmit:y}]=rn(h,{onSubmit:(e,t)=>{x({...e,...p.current?.(t)})}});return r?o(_h,{}):c("form",{onSubmit:y,className:"space-y-m",children:[a({sections:t,field:b,step:e,registerSubmit:f}),o(Yh,{step:e,onPrevStep:n})]})})),tp=[[],[{title:"Персональные данные",columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"name",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"middleName",dadata:!0,filledByEsia:!0},{fieldType:"common",name:"sex",required:!0},{fieldType:"common",name:"limitedBirthday",required:!0,filledByEsia:!0},{fieldType:"common",name:"birthPlace",required:!0,filledByEsia:!0},{fieldType:"common",name:"phone",required:!0,filledByEsia:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{fieldType:"common",name:"dulSerie",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulNumber",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulIssueDateField",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{fieldType:"common",name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"addressMatch"}]},{columns:2,inputs:[{fieldType:"common",name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{fieldType:"common",name:"housing",required:!0}]},{inputs:[{fieldType:"common",name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{fieldType:"info",text:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{fieldType:"common",name:"employment"},{fieldType:"common",name:"organizationName",required:!0,dadata:!0}]},{columns:2,inputs:[{fieldType:"common",name:"inn",required:!0,dadata:!0},{fieldType:"common",name:"legalForm",required:!0}]},{inputs:[{fieldType:"common",name:"organization",required:!1},{fieldType:"common",name:"amountWorkers",required:!1}]},{columns:2,inputs:[{fieldType:"common",name:"employerActivities",required:!1},{fieldType:"common",name:"employerOrganization",required:!1},{fieldType:"common",name:"generalSeniority",required:!0},{fieldType:"common",name:"lastJobExperience",required:!0},{fieldType:"common",name:"experience5Years",required:!0},{fieldType:"common",name:"jobsNumber",required:!0}]},{inputs:[{fieldType:"common",name:"organizationPhone",label:"Телефон работодателя",required:!0},{fieldType:"common",name:"beginDate",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"positionOrganization",required:!1},{fieldType:"common",name:"partInBusiness",required:!0,condition:{name:"positionOrganization",values:["BUSINESS_OWNER"]}}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{fieldType:"common",name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{fieldType:"common",name:"familyStatus",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"dependents",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"familyMembers"},{fieldType:"common",name:"children",required:!0}]},{title:"Совокупный доход"},{inputs:[{fieldType:"info",text:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{fieldType:"common",name:"confirmationIncome",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"wages",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"snils",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"conscription",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"disablePeopleFlg"}]},{inputs:[{fieldType:"common",name:"bankruptcyFlg"}]},{inputs:[{fieldType:"common",name:"shareholderFlg"}]},{inputs:[{fieldType:"common",name:"legalEntityName"}]},{inputs:[{fieldType:"common",name:"creditInRshbCd"}]}],[{title:"Отделение Банка",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"regionRetail",required:!0}]},{inputs:[{fieldType:"common",name:"addressRetail",required:!0}]},{title:"Код представителя Банка",columns:1,inputs:[]},{inputs:[{fieldType:"info",text:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код"}]},{inputs:[{fieldType:"common",name:"bankEmployeeCode"}]}]],np=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Отделение Банка"],ip=d((({className:e,...t})=>{const[n,d]=i(0),m=s(null),h=l((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]),p=Vu();a((()=>Fu((()=>p.assign("/")))),[]);const f=l((()=>{d((e=>Math.min(e+1,5))),h()}),[]),x=l((()=>{d((e=>Math.max(e-1,0))),h()}),[]),b=r((()=>tp[n]),[n]),y=0===n,[v,N]=i(!1);return o(g,{className:u("bg-transparent",e),defaultPadding:"p-0",...t,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[y||v?null:o(Ch,{stepsTitles:np,step:n,totalSteps:5}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(ep,{step:n,sections:b,onNextStep:f,onPrevStep:x,isFormFinished:v,finishForm:N,renderStep:y?({registerSubmit:e,field:t})=>o(Im,{defaultParams:{sum:t("moneyValue").value,period:t("monthsValue").value,isAnnuity:t("isAnnuity").value},title:"Калькулятор кредита",footnote:"Расчёт является предварительным. Точные условия будут предоставлены в отделении Банка.",calcSource:{$ref:"/wcms-resources/credit-calculator-data.json"},registerSubmit:e}):void 0},String(n))})]})})})),ap=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,lp=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),rp=1e9,sp={sum:{min:1e4,max:rp},period:3},op=Et((({className:e,filtrationSchema:t={},resetButton:n,sumInput:i,periodInput:a,...l})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=bd(sp,{block:l.block,page:l.options?.page,normalize:e=>({...e,period:cp(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=dp(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...l,children:[o(md,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(nu,{label:i?.title,min:500,max:rp,...d("sum",{parse:e=>({min:Number(e),max:rp}),format:({min:e})=>String(e)})}),o(ul,{title:a?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(sd,{blocksToRender:r,...l})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),cp=e=>Dt((e?.paramsSource?.rateRows||[]).filter(ap).flatMap((e=>lp(e.minMonths,e.maxMonths)))),dp=e=>Dt(e.flatMap((e=>e||[])).filter(ap).flatMap((e=>lp(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],mp=[{key:"10"},{key:"50"},{key:"100"}],up=({itemCount:e,onItemCountChange:t})=>{const n=l((({key:e})=>t(Number(e))),[]);return c("div",{className:"mt-2 @lg:mt-0 items-center gap-s hidden @lg:flex",children:[o("span",{children:"Показать по"}),o(_n,{className:"min-w-20",onChange:n,value:{key:String(e)},options:mp,iconVersion:"black"})]})},hp="py-m @lg:px-lg px-m rounded-md cursor-pointer text-center min-w-10 @lg:min-w-0 hover:bg-primary-hover hover:text-white",pp=(e,t)=>{const{currentPage:n,onPageChange:i,totalPages:a}=e,l=t+1;return l===n?o("div",{"aria-current":"true",className:"py-m @lg:px-lg px-m bg-primary-main text-center min-w-10 @lg:min-w-0 text-white rounded-md",children:l},String(t)):1!==l&&l!==a&&((e,t,n)=>e<t&&e>=t-1||e<=t+1&&e>t||((e,t,n)=>t<=2&&e<=t+2||t>=n-1&&e>=n-3)(e,t,n))(l,n,a)?o("div",{onClick:()=>i(l),className:hp,"aria-label":`Страница ${l}`,children:l},String(t)):null},gp={width:"24",height:"24"},fp=({currentPage:e,onPageChange:t,totalPages:n})=>{const i=r((()=>Array.from({length:n}).fill({currentPage:e,onPageChange:t,totalPages:n})),[n,e]),a=l((()=>{e>1&&t(e-1)}),[e]),s=l((()=>{e<n&&t(e+1)}),[e,n]),d=l((()=>t(1)),[]),m=l((()=>t(n)),[n]);return c("div",{className:"flex gap-m items-center",children:[o("div",{onClick:a,children:o(W,{name:"ArrowLeftIcon",iconVersion:"black",imageClassName:xp(1===e),...gp})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:hp,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,i.map(pp),e<n-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<n?o("div",{onClick:m,className:hp,"aria-label":`Страница ${n}`,children:n}):null]}),o("div",{onClick:s,children:o(W,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:xp(e===n),...gp})})]})},xp=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",bp=({currentPage:e,onPageChange:t,totalPages:n,itemCount:i,onItemCountChange:a})=>c("div",{className:"mt-3xl flex justify-between flex-col @lg:flex-row items-center select-none",role:"navigation","aria-label":"Пагинация",children:[o(fp,{currentPage:e,onPageChange:t,totalPages:n}),i&&a?o(up,{itemCount:i,onItemCountChange:a}):null]}),yp=d((({className:e,value:t,autoFocus:n,onChange:i,onFocus:a,placeholder:r="Поиск по сайту"})=>{const s=l((e=>{i&&i(e.target?.value||"")}),[i]);return c("div",{className:u("relative",e),role:"form",children:[o("div",{className:"absolute h-full flex items-center pl-m pointer-events-none",children:o(ne,{image:{icon:"LoupeIcon",iconVersion:"black"},width:"24",height:"24"})}),o("input",{className:u("h-14 w-full px-10 text-l text-black box-border rounded-md",gn),value:t,type:"text",name:"search-bar-input",placeholder:r,autoFocus:n,onChange:s,onFocus:a})]})})),vp=d((({field:e,onClearFilter:t,filtrationState:n})=>c("div",{className:"grid grid-cols-12 mb-3xl @lg:space-x-xl",children:[o(yp,{className:"col-span-12 @lg:col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),o(Hl,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период от",maxDate:n.endDate,...e("startDate")}),o(Hl,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период до",minDate:n.startDate,...e("endDate")}),o("div",{className:"col-span-12 @lg:col-span-2 mt-8 @lg:mt-auto",children:o(ja,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),Np=({title:e,timestamp:t,publicId:n})=>{const i=he(),{href:a}=i({href:`/api/v1/depository/${n}/file`});return c("div",{className:"flex gap-3 items-center py-lg border-gray border-opacity-50 border-b",children:[null,c("div",{className:"flex flex-col gap-x-6xl lg:flex-row lg:items-center",children:[t?o(Me,{size:"text-m","font-weight":"font-light",children:Lt(t)}):null,o("a",{className:"text-h6 hover:text-primary-active",href:a,download:!0,"aria-label":"Скачать",children:e})]})]},n)},wp="/api/v1/depository",Cp={startDate:void 0,endDate:void 0,query:""},Sp=Et((({className:e,...t})=>{const[n,a]=i(0),[r,s]=i(10),[d,{field:m,reset:h}]=rn(Cp),{totalPages:p=0,items:f=[]}=(({size:e,page:t,query:n,startDate:i,endDate:a})=>{const l=i?Lt(i,!0):"",r=a?Lt(a,!0):"",s=new URLSearchParams(wp);s.set("page",String(t)),s.set("size",String(e)),s.set("query",n),s.set("timestampStart",l),s.set("timestampEnd",r);const o=`?${s.toString()}`,{data:c}=pi(wp+o,Rt);return{items:c?.content,totalPages:c?.totalPages}})({size:r,page:n,...d}),x=l((e=>a(e-1)),[]),b=l((e=>{r!==e?(s(e),a(0)):s(e)}),[]);return c(g,{className:u(e,"container p-6xl"),...t,children:[o(vp,{filtrationState:d,field:m,onClearFilter:h}),c("div",{className:"flex flex-col",children:[c("div",{className:"grid grid-cols-12 pb-lg border-gray border-opacity-50 border-b",children:[o("div",{className:"col-span-4 @lg:col-span-2 hidden @lg:block",children:o(Me,{size:"text-m",color:"text-secondary-text",children:"Дата"})}),o("span",{className:"col-span-8 @lg:col-span-10 hidden @lg:block",children:o(Me,{size:"text-m",color:"text-secondary-text",children:"Тема"})})]}),f.length?f.map((e=>o(Np,{...e},String(e.publicId)))):o(Nc,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(bp,{currentPage:n+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:b})]})]})})),kp=e=>"Image"===e?.contentType&&e?.image?o(ne,{image:e.image}):"Code"===e?.contentType&&e.code?o("div",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:e.code}):null,Ip=d((({className:e="",title:t,description:n,error:i,button:a,...l})=>c(g,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...l,children:[o("div",{className:"flex justify-center",children:kp(i)}),o(S,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),a?.text?o(ve,{version:a?.version,text:a?.text,...a}):null]})));function Tp(e,t){for(const[n,i]of e.entries())null!=i?t.setItem(n,i):t.removeItem(n)}const Bp={};function Pp(e,t=Bp){const n=s(null),o=function(){const[,e]=i(0);return l((()=>e((e=>(e+1)%65536))),[])}();return a((()=>e.bus.watch((e=>{n.current?.has(String(e.type))&&o()}))),[e,o]),r((()=>new Proxy(t,{get:(t,i)=>(n.current||=new Set,n.current.add(i),e.getItem(i)),has:(t,i)=>(n.current||=new Set,n.current.add(i),e.hasItem(i)),set:(t,n,i)=>(e.setItem(n,i),!0),deleteProperty:(t,n)=>(e.removeItem(n),!0)})),[e])}const Rp=new class{bus;store=new Map;get size(){return this.store.size}constructor(e=new ce){this.bus=e}hasItem(e){return this.store.has(e)}getItem(e){return this.store.get(e)}entries(){return this.store.entries()}setItem(e,t){this.store.set(e,t),this.bus.subject(e,t)}removeItem(e){this.store.delete(e),this.bus.subject(e,null)}};var Dp,_p;function Mp(e){return Pp(Rp,e)}Dp=Rp,_p=new class{storage;bus;get size(){return this.storage?.length??0}constructor(e,t=new ce){this.storage=e,this.bus=t}hasItem(e){return Boolean(this.storage?.getItem(String(e)))}getItem(e){const t=this.storage?.getItem(String(e))??null;try{return JSON.parse(String(t))}catch(e){return null}}entries(){return Array.from({length:this.size},((e,t)=>{const n=String(this.storage?.key(t));return[n,this.getItem(n)]}))}setItem(e,t){null!==t?this.storage?.setItem(String(e),JSON.stringify(t)):this.storage?.removeItem(String(e)),this.bus?.subject(e,t)}removeItem(e){this.storage?.removeItem(String(e)),this.bus?.subject(e,null)}}(globalThis?.localStorage),Tp(Dp,_p),Tp(_p,Dp),Dp.bus.watch((({type:e,event:t})=>{null!=t?_p.setItem(e,t):_p.removeItem(e)}));const Ap="/api/v1/region";function zp(e="Москва"){return Mp().location??{name:e}}function Ep(e="Москва"){const t=Mp(),n=l((async()=>{if(!t.location){const n=await Pt(Ap);t.location=n??{name:e}}}),[t,e]);return pi(Ap,n),t}var Op;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(Op||(Op={}));const Fp=new Intl.NumberFormat("ru",{style:"currency",currency:Op.RUB}),Vp=e=>e?Fp.format(e):"",Lp="text-m font-light text-secondary-text ",jp=`${Lp} text-left`,qp=`${Lp} pl-5xl text-center`,$p=`${Lp} pl-5xl text-right`,Up={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},Wp=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:jp,children:o(Me,{size:"text-m",children:"Валюта"})}),o("th",{className:qp,children:o(Me,{size:"text-m",children:"Купить"})}),o("th",{className:$p,children:o(Me,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(Hp)})]}))),Hp=e=>{const t=e?.currency?.currency;return c("tr",{className:"pb-2xs text-h6",children:[o("td",{className:"pt-m m-auto flex text-left",children:c("div",{className:"flex items-center gap-xs",children:[t?o(ne,{image:{icon:Up[t]},width:"24",height:"24"}):null,o(Me,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(Me,{size:"text-h6",children:Vp(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(Me,{size:"text-h6",children:Vp(e?.buyExchangeRate)})})]},t)},Yp={icon:"GpsIcon"},Kp=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(kd,{...Yp,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(w,{size:"text-l",color:"text-primary-main",children:t}):null,o(w,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),Gp=(e,t,n)=>{const i=Number(Xp(e))*Math.pow(t,n?-1:1);return Number.isInteger(i)?i:((e,t=2)=>{const n=10**t;return Math.round(parseFloat(String(e))*n)/n})(i)},Xp=e=>e.replace(/[^\d.,]/g,"").replace(",","."),Jp=e=>Zt([[e=>e.value!==Op.RUB&&e.oppositeValue!==Op.RUB,()=>e.handleConvert(e.value,Op.RUB)],[e=>e.value===Op.RUB&&e.oppositeValue===Op.RUB,()=>e.handleConvert(e.value,Op.USD)],[e=>e.value===Op.RUB&&e.oppositeValue===Op.RUB,()=>e.handleConvert(e.value,Op.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function Zp(e){const{placeholder:t,rates:n,selected:i,value:a,setValue:l,setSelected:r}=e,s=n.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:i,text:i};return c("div",{className:"relative flex",children:[o(xn,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:a,onChange:l}),s.length?o(_n,{className:"absolute right-0",isBorder:!1,onChange:e=>r(e.key),options:s,value:d}):null]})}const Qp=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:a})=>{const[r,s]=i({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||Op.RUB,selectBuy:n?.[0]?.currency?.currency||Op.USD}),d=l((e=>s((t=>({...t,...e})))),[]);return c("div",{className:`flex flex-col gap-m pt-2xl ${e}`,children:[t&&n?c("div",{className:"grid gap-m",children:[Zp({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:eg(r,d,n),value:r.inputSell,setValue:e=>ng(d,n)(e,r.selectSell,r.selectBuy)}),Zp({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:tg(r,d,t),value:r.inputBuy,setValue:e=>ig(d,t)(e,r.selectBuy,r.selectSell)})]}):null,a?.text?o(ve,{text:a.text,version:a?.version,...a}):null]})})),eg=(e,t,n)=>i=>{t({selectSell:i}),Jp({value:i,oppositeValue:e.selectBuy,handleConvert:(i=e.selectSell,a=e.selectBuy)=>{ng(t,n)(e.inputSell,i,a)}})},tg=(e,t,n)=>i=>{t({selectBuy:i}),Jp({value:i,oppositeValue:e.selectSell,handleConvert:(i=e.selectBuy,a=e.selectSell)=>ig(t,n)(e.inputBuy,i,a)})},ng=(e,t)=>(n,i,a)=>{e({inputSell:Xp(n),selectBuy:a});const l=t.find((e=>e.currency?.currency===a))?.buyExchangeRate||t.find((e=>e.currency?.currency===i))?.buyExchangeRate;l&&e({inputBuy:String(Gp(n,l,i===Op.RUB)||"")})},ig=(e,t)=>(n,i,a)=>{e({inputBuy:Xp(n),selectSell:a});const l=t.find((e=>e.currency?.currency===a))?.saleExchangeRate||t.find((e=>e.currency?.currency===i))?.saleExchangeRate;l&&e({inputSell:String(Gp(n,l,i===Op.RUB)||"")})};const ag=d((({className:e="",title:t="Курсы обмена валют",button:n,...i})=>{const a=function(e){const t=e?.code||"000",{data:n}=pi(`/api/v1/exchangerates?regionCode=${t}`,Rt);return n||{}}(zp()),l=lg(a?.exchangeRate?.currencies),r=l.filter((e=>e.buyExchangeRate));r.unshift({currency:{currency:Op.RUB}});const s=l.filter((e=>e.saleExchangeRate));return s.push({currency:{currency:Op.RUB}}),o(g,{className:u("box-border min-h-80",e),...i,children:o(Te,{className:"h-full",title:o(N,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex w-full gap-6xl flex-wrap @lg:flex-nowrap",children:[c("div",{className:"w-full @2xl:w-auto @5xl:w-1/2",children:[l?o(Wp,{className:"mb-xl",exchangeCurrencyItems:l}):null,o(Kp,{address:a?.address})]}),o(Qp,{className:"grow w-1/2",currencyRatesBuy:r,currencyRatesSell:s,button:n})]})})})})),lg=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],rg=d((({className:e="",items:t})=>{const n=he();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(sg(n))})})),sg=e=>({dataFooter:t,...n},i)=>{const{text:a,href:l,target:r,onClick:s}=e(n);return a?o("li",{className:"list-none",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:l,target:r||"_self",onClick:s,...ge(t),children:a||null})},String(i)):null},og=e=>t=>!t.displayArea||e.includes(t.displayArea.toLowerCase()),cg=["all","footer"],dg=d((({className:e,navigationItems:t})=>{const n=he();return o("div",{role:"menu",className:u("w-full flex items-start justify-between flex-col md:flex-row gap-y-m lg:order-2",e),children:t?.filter(og(cg)).map(n).map(mg)})})),mg=(e,t)=>{const{text:n,items:i=[],href:a,target:l="_self",onClick:r,dataFooter:s}=e,d=i.filter(og(cg));return c("div",{role:"menuitem",className:"flex flex-col gap-s w-full @md:w-1/4",children:[o("a",{className:"leading-5 text-l text-primary-text hover:text-primary-main no-underline",href:a,target:l,onClick:r,...ge(s),children:n}),d?o(rg,{items:d}):null]},String(t))},ug=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(hg)}):null)),hg=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(Me,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(pg)})]},String(t)),pg=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:gg(e.type,e.text)}),o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),gg=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${fg(t)}`,children:o(Me,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(w,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},fg=e=>e.replaceAll(/\D/g,""),xg=d((({className:e="",index:t,text:n,...i})=>{const a=he(),{href:l,target:r,onClick:s}=a(i);return o("a",{className:u("text-secondary-text",e),href:l,target:r,onClick:s,children:n||`Документ ${t}`})})),bg=d((({className:e="",title:t,links:n})=>o("div",{className:e,children:n?.length?c("div",{className:"flex justify-between lg:items-center flex-col lg:flex-row gap-lg py-lg border-y border-y-main-divider",children:[o("div",{className:"lg:hidden",children:o(Me,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(xg,{index:t,className:"text-l font-light lg:max-w-[292px]",...e},String(t))))]}):null}))),yg="w-full lg:w-52";function vg(e,t,n=300){a((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}const Ng=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:n,s1Matches:i,s2Matches:a}=function(e,t){const n=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),i=Array.from({length:e.length}),a=Array.from({length:t.length});let l=0;for(let r=0;r<e.length;r++){const s=Math.max(0,r-n),o=Math.min(r+n,t.length-1);for(let n=s;n<=o;n++)i[r]||a[n]||e[r]!==t[n]||(l++,i[r]=!0,a[n]=!0)}return{m:l,s1Matches:i,s2Matches:a}}(e,t);if(0===n)return 0;const l=function(e,t,{s1Matches:n,s2Matches:i}){let a=0;for(let l=0,r=0;l<e.length;l++){if(!n[l])continue;let s=r;for(;s<t.length;s++)if(i[s]){r=s+1;break}e[l]!==t[s]&&a++}return a}(e,t,{s1Matches:i,s2Matches:a}),r=(n/e.length+n/t.length+(n-l/2)/n)/3,s=r>.7?.1*function(e,t){let n=0;for(;e[n]===t[n]&&n<4;)n++;return n}(e,t):0;return r+s*(1-r)};const wg=(e,t)=>(n,i)=>{for(const[a,l]of i)n.set(a,e(n.get(a)||t,l));return n},Cg=(e=[])=>e.reduce(((e,t)=>e+t),0),Sg=e=>e.toLowerCase().split(/[^0-9a-zа-я-]+/).filter((e=>e.length>=3&&!/[0-9a-z]/.test(e))),kg=e=>t=>e.map((([e,n])=>[Ng(t)(e),n])).filter((([e])=>e>=.8)).map((([e,t])=>Tg(t,e))).reduce(wg(Math.max,0),new Map),Ig=e=>t=>{return pd(t,t.map((({title:e})=>e)).map((e=>t=>{const n=Sg(t||"");return n.length?Cg(e.map((e=>Ec(n.map(Ng(e)))))):0})(e))).sort((e=>(t,n)=>-e(t,n))((n=([,e])=>e,(e,t)=>n(e)-n(t)))).map((([e])=>e));var n},Tg=(e,t)=>new Map(e.map((e=>[e,t]))),Bg=({basePathList:e,initialQuery:t=""})=>{const[n,l]=i(t||"");a((()=>{null!=t&&l(t)}),[t]);const{data:r}=pi(e?.length?e:null,Pg),[s,o]=i(null);return vg((()=>{r&&o(r.map((e=>t=>{const{corpus:n,dictionary:i}=t||{};if(!(e&&n?.length&&i&&Object.keys(i).length))return[];const a=Sg(e);if(!a.length)return[];const l=Object.entries(i),r=[...a.map(kg(l)).reduce(wg(((e,t)=>e+t),0),new Map).entries()].filter((([,e])=>e>=.799*a.length)).map((([e])=>n[e]));return Ig(a)(r)})(n)))}),[r,n]),[s,{value:n,onChange:l}]},Pg=async(...e)=>(await Promise.allSettled(e.map((e=>Pt(F(e,"/","search.index.json")))))).map((e=>"fulfilled"===e.status?e.value:{})),Rg=d((({initialQuery:e,navigationItems:t})=>{const n=r((()=>t?.map((e=>e.href||"/"))),[t]),[i,a]=Bg({basePathList:n,initialQuery:e}),l=r((()=>Dg(t)(i)),[t,i]);return o(sr,{head:o(yp,{autoFocus:!0,...a}),children:o(dg,{navigationItems:l})})})),Dg=e=>t=>e?.length&&t?.length?pd(e,t).map((([e,t])=>({...e,items:t?.map((({title:e,uri:t})=>({text:e,href:F("/",t)})))}))):[],_g=(e={})=>{const{open:t,close:n}=me();return{open:(n={},i={})=>t(o(Rg,{...e,...n}),i),close:n}},Mg=d((({className:e,search:t,...n})=>{const[a,r]=i(""),s=l((()=>r("")),[]),d=_g(n),m=l((e=>{r(e),Ag(e)&&d.open({initialQuery:e},{onClose:s})}),[s,d]);return c("div",{className:u("relative",e),role:"search",children:[o(yp,{value:a,placeholder:t?.placeholder,onChange:m}),o(rr,{className:"absolute top-0 right-0 sm:hidden",onClose:s})]})})),Ag=e=>e&&e.length>=3,zg=(e,t)=>{const{logo:n}=e??{},{dataHeader:i,dataFooter:a,...l}=n??{};return c("div",{className:"flex items-stretch gap-3xl",children:[o(Ao,{className:yg,logo:l,data:a,showTitle:!1}),o(Mg,{className:"grow",navigationItems:t,...e})]})},Eg=d((({className:e="",index:t,...n})=>{const i=he(),{href:a,target:l,text:r,onClick:s}=i(n);return o("a",{className:u("text-xs font-light text-secondary-text visited:text-secondary-text hover:text-primary-main inline-block no-underline max-w-[292px]",e),href:a,target:l,onClick:s,children:r||`Документ ${t}`})})),Og=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(Me,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} ${n}`})}):null,t?.length?o("div",{className:"flex flex-col @5xl:flex-row justify-start items-start gap-x-lg gap-y-xs",children:t.map(((e,t)=>o(Eg,{index:t,...e},String(t))))}):null]}))),Fg=Et((({className:e,footer:t,...n})=>{const{navigationItems:i}=n.options?.page?.navigation??{},a=n.options?.page?.common??{},{documents:l,relatedEnterprises:r,contacts:s,mediaLinks:d=[],horizontalNavigationTitle:m,feedbackButton:h,license:p,otherLinks:f=[]}=t??{};return c(g,{tag:"footer",className:u("grid gap-y-xl p-4xl pb-24 lg:p-xl",e),...n,children:[zg(a,i),c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(dg,{navigationItems:i}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u(yg,"flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(ug,{items:s}),h?o(ve,{className:"w-full",version:"primary",...h}):null,d.map(((e,t)=>o(Tu,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),f.map(((e,t)=>o(ve,{className:"!text-left text-s font-light",version:"link",...e,children:e?.text},String(t))))]})]}),o(bg,{title:m,links:r}),o(Og,{links:l,license:p})]})})),Vg=d((({className:e="",title:t,description:n,calendar:i,...a})=>c(g,{className:u("space-y-m",e),defaultPadding:"p-6xl",...a,children:[o(S,{title:t,description:n,headlineVersion:"M",isEmbedded:!0}),i?Lg(i):null]}))),Lg=e=>{const t=100/(e.reduce(((e,t)=>t?.month?.length?e+t.month.length:e),0)||1),n=e.filter((e=>e?.month?.length)).map((e=>({...e,flexBasis:`${e?.month?.length?e.month.length*t:""}%`})));return c("div",{className:"w-full flex flex-col justify-center gap-s",children:[o("div",{className:"flex w-full text-h6 text-center",children:n.map((e=>jg(e,t)))}),o("div",{className:"flex gap-s w-full",children:n.map(((e,t)=>c("div",{className:"border-r border-main-divider last:border-r-0 space-y-s",style:{flexBasis:e.flexBasis},children:[o("div",{className:"flex gap-s",children:qg(e)}),c("div",{className:"text-s",children:[o(Me,{size:"text-s",font:"font-light",color:"text-primary-text",children:e.text})," ",o(Me,{size:"text-s",font:"font-light",color:"text-primary-main",children:e.greenText})]})]},`monthItem-${t}`)))})]})},jg=(e,t)=>e.month?.map(((e,n)=>o("div",{style:{flexBasis:`${t}%`},children:e.text},`monthName-${n}`))),qg=e=>e.month?.map((e=>e.image?.src?o("div",{className:"h-52 border-r pr-s border-main-divider last:border-r-0",children:o(ne,{image:e.image,className:"flex"})},`monthImage-${e.image.src}`):null)),$g=Et((({className:e,title:t,button:n,regionSource:a,data:l,...r})=>{const[s,d]=i({key:""}),m=a?.regions??[],h=oe({className:"text-white",version:n?.version||"primary"}),p=m?.find((e=>e.name===s.key))?.href,f=n?.text?n.text:"Перейти";return o(g,{className:e,defaultPadding:"p-6xl",...r,children:c("div",{className:"container max-w-[978px] space-y-m",children:[t?o(N,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(En,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:m.map((({name:e=""})=>({key:e,text:e}))),value:s,onChange:d}):null,p?o("div",{className:"text-center",children:o(ve,{href:p,target:"_blank",className:u("p-m w-full @xl:w-auto",h),data:Su(l,s?.key),children:f})}):null]})})}));function Ug(e=[]){const t=D(),n=Array.from(e.entries()).filter((([,e])=>Wg(t)(e)));return n.find((([,e])=>Wg(t,!0)(e)))??n[n.length-1]??[]}const Wg=(e,t=!1)=>({href:n})=>{if(!n)return!1;const i=O(Hg(e)(n));return t?i===O(n):i.startsWith(O(n))},Hg=e=>t=>{const n=X(G.SITE_URL);return A(t)?e.href:F(n,e.pathname)},Yg=d((({className:e="",items:t,activeItem:n,ariaLabel:i="Меню"})=>{const[r,{setFalse:d,toggle:m}]=dn(!1),h=un(d),p=s(null),g=l((({isOpened:e,buttonRef:t,menuRef:n})=>{if(e&&t.current&&n.current){const e=n.current.getBoundingClientRect(),i=t.current.getBoundingClientRect(),a=globalThis.innerWidth-e.width;e.right>=globalThis.innerWidth?n.current.style.left=`${a}px`:i.left>e.left&&(a>i.left?n.current.style.left="":n.current.style.left=`${a}px`)}}),[r]);return mn(globalThis,"resize",(()=>g({isOpened:r,buttonRef:h,menuRef:p}))),a((()=>{g({isOpened:r,buttonRef:h,menuRef:p})}),[r]),c("div",{className:u(r?"rounded-md shadow-blue-gray":"",e),ref:h,role:"navigation",children:[o("button",{type:"button",className:"group/btn flex justify-between items-center h-6","aria-label":i,onClick:m,role:"button","aria-labelledby":"labeldiv",children:Array(3).fill(null).map(((e,t)=>o("div",{className:"w-[3px] h-[3px] rounded mr-2xs bg-primary-text group-hover/btn:bg-primary-hover group-data-transparent:bg-white"},String(t))))}),o("div",{ref:p,className:u("absolute flex flex-col rounded-md bg-white p-xl pb-xs w-56 z-40",{hidden:!r}),"aria-hidden":!r,children:Gg(t,n)})]})})),Kg=d((({isActive:e,...t})=>{const n=he(),{text:i,href:a,target:l,onClick:r}=n(t);return o("a",{className:u("text-l font-light pb-m hover:text-primary-main",{"text-primary-main":e}),href:a,target:l,onClick:r,role:"link",...ge(t?.data),children:i})})),Gg=(e,t)=>e?.map(((e,n)=>o(Kg,{isActive:e===t,...e},e?.text??String(n)))),Xg={default:"w-6 h-6",large:"w-12 h-12"},Jg=d((({className:e,isRounded:t,buttonSize:n="default",isGrayBg:i=!1,disabled:a,ariaLabel:l="Меню второго уровня",image:r,data:s,onClick:c,version:d})=>o("button",{className:u("group/btn border-0 flex shrink-0 items-center",i?"p-s rounded-full":"p-0 bg-inherit","transparent"===d?"backdrop-opacity-30 bg-white/30":i&&!t?"bg-main-divider":"",t?"w-8 h-8 text-secondary-light hover:text-secondary-hove":`${Xg[n]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:a,"aria-label":l,onClick:c,...ge(s),children:o(ne,{image:r,className:u("h-full",{"bg-main-divider/20 rounded-full":t}),imageClassName:"group-hover/btn:text-primary-hover group-hover/btn:invert-0"})}))),Zg="chatbot",Qg="text-page__btn-chat",ef={personal:"//chat.mes.rshb.ru/assets/js/webchat_rshb",business:""},tf=d((({chat:e="personal",iconVersion:t,className:n,ariaLabel:i="Чат",version:l})=>{const r=(e=>{a((()=>globalThis.localStorage?.setItem("webchat-keep-open",String(Date.now()))),[]);const t=ef[e??""];return n=>{if(t)if("personal"!==e)$i(Zg,t);else{const e=n.target;e?.classList.contains(Qg)||e?.classList.add(Qg),document.getElementById("webchat-js-container:webchat_rshb")||$i(Zg,t)}}})(e);return o(Jg,{className:n,image:{icon:"HeadphonesIcon",iconVersion:t},ariaLabel:i,onClick:r,buttonSize:"large",isGrayBg:!0,version:l})})),nf=d((({className:e="",active:t,dataItemName:n,children:i,data:a,...l})=>{const r=he(),{href:s,target:d,text:m,onClick:h}=r(l);return c("a",{className:u("relative inline-block bg-transparent text-center no-underline",e),href:s,target:d,"data-item-name":n,onClick:h,...ge(a),children:[o("span",{className:af(t),children:m||i}),t?o("div",{className:"absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-white"}):null]})})),af=(e=!1)=>u("font-sans text-l lg:font-light",e?"text-primary-main":"text-primary-text hover:text-primary-main","group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),lf=d((({observerOptions:e,onVisibilityChange:t,children:n,className:i,...a})=>{const r=Sc(l((e=>{if(!e.length||!t)return;const n=e[e.length-1];t(n.isIntersecting)}),[t]),e);return o("span",{ref:r,className:i,role:"menuitem",children:o(nf,{...a,children:n})})})),rf={default:"bg-main-divider text-primary-main rounded hover:text-primary-main",transparent:"backdrop-opacity-30 bg-white/30 hover:text-primary-hover text-white"},sf=d((({version:e,text:t,mobileText:n,...i})=>{const a=Se()?n:t;return a?o(ve,{className:u("py-s px-lg font-light whitespace-nowrap",rf["transparent"===e?"transparent":"default"]),...i,children:a}):null})),of=d((({subItems:e=[],version:t,internetBankButton:n,dropdownMenuAriaLabel:a,chatBotAriaLabel:l})=>{const d="transparent"===t?"white":"black",[,m]=Ug(e),[u,h]=i(e.length),p=e.slice(u),g=s(null),f={rootRef:g},x=r((()=>e.map(((e,t)=>e=>{h(e?cf(t):df(t))}))),[e]);return c("nav",{className:"mt-s flex gap-s items-center justify-between",children:[o("div",{ref:g,className:"overflow-hidden whitespace-nowrap pb-s mt-xs space-x-lg",role:"menu",children:e.map(((e,t)=>o(lf,{className:u-1<t?"invisible":"",active:e===m,observerOptions:f,onVisibilityChange:x[t],data:e.dataHeader,...e},String(t))))}),p.length?o(Yg,{items:p,activeItem:m,ariaLabel:a}):null,M.CHAT_BOT?o(tf,{version:t,iconVersion:d,chat:M.CHAT_BOT,ariaLabel:l}):null,o(sf,{version:t,...n})]})})),cf=e=>t=>Math.max(t,e+1),df=e=>t=>Math.min(t,e),mf=e=>e?.length?c("div",{className:"sm:border-t sm:border-main-divider mt-2xs pt-2xs",children:[o("div",{className:"mb-m",children:o(Me,{size:"text-m",font:"font-light",color:"text-secondary-text",children:"Представительства за рубежом:"})}),o("div",{className:"flex flex-col sm:flex-row gap-5xl",children:e.map(((e,t)=>o(uf,{...e},String(t))))})]}):null,uf=d((({icon:e,...t})=>{const n=he(),{text:i,target:a,href:l,onClick:r}=n(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ne,{image:e}):null,i?o("a",{className:"hover:text-primary-hover",href:l,target:a,onClick:r,children:o(Me,{size:"text-l",font:"font-light",color:"text-primary-text",children:i})}):null]})})),hf=(e,t)=>n=>n.name?o(ku,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:Su(e,n.name),children:o(Me,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,pf=d((({className:e,searchTerm:t,onSearch:n})=>c("form",{className:`font-sans relative ${e}`,children:[o("div",{className:"absolute rounded h-full flex items-center justify-center pl-m max-w-44 gap-s pointer-events-none",children:t?null:o("label",{htmlFor:"search-bar-input",className:"text-secondary-text ",children:"Поиск по филиалам"})}),o("input",{id:"search-bar-input",className:u(gn,"h-12 pl-m w-full peer text-l text-black rounded-md box-border"),value:t,onChange:e=>n(e.target.value.toLowerCase()),type:"text",name:"location-search-bar-input"})]}))),gf=d((({defaultLocation:e})=>{const t=zp(e),n=he(),{href:i}=n({href:`/branches/${t.slug}`});return t?o("div",{className:"mb-s",children:c(w,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(ku,{href:i,className:"inline mx-2xs text-primary-main",children:t.name})]})}):null})),ff=d((({foreignOffices:e,branches:t})=>{const n=Ep(t?.default),[a,s]=i(""),d=Ms(),m=r((()=>bf(d).sort(((e,t)=>e.name.localeCompare(t.name)))),[d]),u=r((()=>((e,t)=>{const n=new Map;for(const i of e){const e=t(i),a=n.get(e)||[];n.set(e,[...a,i])}return n})(m,xf)),[m]),{close:h}=me(),p=l((e=>{n.location=e,h()}),[n]);return c(sr,{className:"pb-20",head:c("div",{children:[o(Me,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),o(gf,{defaultLocation:t?.default}),o(pf,{onSearch:s,searchTerm:a})]}),children:[a&&a.length>=3?o("div",{children:m.filter((({name:e})=>e&&Ng(e.toLowerCase())(a.toLowerCase())>=.8)).map(hf(t?.dataSelect,p))}):o("div",{className:"columns-1 sm:columns-3 md:columns-4 lg:columns-5",children:Array.from(u.entries()).map((g=p,f=t?.dataSelect,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(Me,{size:"text-h6",children:e})}),t.map(hf(f,g))]},e)))}),mf(e)]});var g,f})),xf=e=>e.name?.charAt(0)??"",bf=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()??""}))),yf=d((({className:e="",active:t,flat:n,children:i,data:a,...l})=>{const r=he(),{href:s,target:c,text:d,onClick:m}=r(l);return o("a",{className:u(vf(t,n),e),href:s,target:c,onClick:m,rel:"noopener noreferrer","aria-label":`Ссылка на ${d}`,...ge(a),children:o("span",{suppressHydrationWarning:!0,className:Nf(t,n),children:d||i})})})),vf=(e=!1,t=!1)=>u("inline-block border border-solid bg-transparent text-center no-underline",e?"rounded-md border-primary-main group-data-transparent:border-white":"border-transparent",{"px-m py-xs":!t}),Nf=(e=!1,t=!1)=>u("font-sans text-s font-light",e?"text-primary-main":u(t?"text-primary-text":"text-secondary-text","hover:text-primary-main"),"group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),wf=d((({className:e,version:t,...n})=>{const i="transparent"===t?"white":"black",a=zp(n?.branches?.default),r=_g(n),s=(e=>{const{open:t,close:n}=me();return{open:(n={})=>t(o(ff,{...e}),n),close:n}})(n),d=l((()=>r.open()),[r]),m=l((()=>s.open()),[s]);return c("div",{className:u("flex items-center ml-5 md:max-w-[300px] xl:max-w-full gap-lg",e),role:"navigation",children:[n?.branches?.visible?o(yf,{className:"whitespace-nowrap text-ellipsis overflow-hidden",flat:!0,href:"#",text:a?.name,data:Su(n?.branches?.dataClick,a?.name??""),onClick:m}):null,n?.officesAtms?.href?o(yf,{className:"whitespace-nowrap",flat:!0,...n.officesAtms}):null,o(Jg,{image:{icon:"LoupeIcon",iconVersion:i},ariaLabel:n?.search?.ariaLabel??"Поиск",onClick:d,data:n?.search?.data})]})})),Cf=d((({observerOptions:e,onVisibilityChange:t,children:n,className:i,...a})=>{const r=Sc(l((e=>{if(!e.length||!t)return;const n=e[e.length-1];t(n.isIntersecting)}),[t]),e);return o("span",{ref:r,className:i,role:"menuitem",children:o(yf,{...a,children:n})})})),Sf=d((({navigationItems:e=[],activeTopItem:t,dropdownMenuAriaLabel:n,version:a,headerData:l,search:d,bgColor:m,logo:u})=>{const[h,p]=i(e.length),g=e.slice(h),f=s(null),x={rootRef:f},b=r((()=>e.map(((e,t)=>e=>{p(e?kf(t):If(t))}))),[e]),{dataFooter:y,dataHeader:v,...N}=u??{};return c("div",{className:"flex items-center justify-between",children:[o(Ao,{className:"mr-3xl",bgColor:m,logo:N,data:v,showTitle:!1}),o("div",{ref:f,className:"overflow-hidden min-w-[160px] pb-xs mt-xs",role:"menu",children:e.map(((e,n)=>o(Cf,{className:h-1<n?"invisible":"",active:e===t,observerOptions:x,onVisibilityChange:b[n],data:e.dataHeader,...e},String(n))))}),g.length?o(Yg,{className:"mx-xs",items:g,activeItem:t,ariaLabel:n}):null,o(wf,{version:a,className:"ml-auto",search:d,navigationItems:e,...l})]})})),kf=e=>t=>Math.max(t,e+1),If=e=>t=>Math.min(t,e),Tf={"bg-white":"primary",transparent:"transparent"},Bf=["all","header"],Pf=Et((({className:e,bgColor:t="bg-white",logo:n={},version:i=Tf[t],portal:a,header:l={},...r})=>{const{common:s,navigation:d}=Df(r?.options?.page),{navigationItems:m}=d,{logo:h={}}=s,[,p]=Ug(m),{internetBankButton:f}=a||{},x=n.image?.icon||n.image?.src||n?.title?n:h;return o(g,{tag:"header",className:u("pt-m px-20",p?.items?.length?"pb-m":"pb-lg",e),defaultPadding:"",version:i,...r,children:c("div",{className:"container",children:[o("div",{className:"whitespace-nowrap",children:o(Sf,{activeTopItem:p,navigationItems:m?.filter(og(Bf)),version:i,headerData:{...l,...d},search:s.search,bgColor:t,logo:x})}),o("div",{className:u("mt-s h-px bg-main-divider",Rf(i))}),p?.items?.length&&o(of,{subItems:p?.items?.filter(og(Bf)),version:i,internetBankButton:f})]})})})),Rf=e=>"transparent"===e?"opacity-30":"",Df=e=>({navigation:e?.navigation??{},common:e?.common??{}}),_f=(e=!1)=>e?{}:{padding:"p-0"},Mf={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},Af=Et((({className:e="",padding:t="p-0",gap:n="XS",isInnerPadding:i=!0,version:a="transparent",isTheme:l=!1,isCardBorder:r,...s})=>o(g,{className:u("relative","grid grid-cols-12",Mf[n],e),padding:t,version:a,isTheme:l,...s,children:R({...s,extraProps:{..._f(i),className:wc(r)}})})),{childrenTypes:{exclude:["HorizontalLayout"]}}),zf=d((e=>{const{className:t,align:n,image:i,...a}=e,l=n?u("flex",_d[n]):"";return o(g,{className:u(l,t),defaultPadding:"p-0",...a,children:o(ne,{image:i})})})),Ef=(e,t=0)=>{const{itemCount:n,visibleItemCount:a}=e,[r,s]=i(t),o=l((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=l((()=>s((e=>Math.max(e-1,0)))),[n]),d=a?n>a&&r<n-a:r<n-1,m=r>0;return[r,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]};function Of({dec:e,inc:t,canDec:n,canInc:i,btnClass:a,className:l=""}){return n||i?c("div",{children:[n?o(Wc,{className:u("absolute z-40",a[0],l),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!n}):null,i?o(Wc,{className:u("absolute z-40 rotate-180",a[1],l),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!i}):null]}):null}const Ff=d((({className:e="",cards:t=[],button:n})=>{const[a,r]=i(0),s=l((e=>r(e)),[]),d=t.length,[m,u]=Ef({itemCount:d,visibleItemCount:2}),{canDec:h,canInc:p}=u,g=t[m]?.href;return c("section",{role:"listitem",className:`min-w-full text-center ${e}`,children:[c("div",{className:"relative overflow-hidden","aria-label":"Страховые программы",children:[d?Vf({activeIndex:m,cards:t,selectedCardIndex:a,onClick:s}):null,Of({...u,btnClass:["left-12","right-12"],className:"top-16"}),h?o("div",{className:"absolute top-0 left-0 h-full w-32 bg-opacity-from-white"}):null,p?o("div",{className:"absolute top-0 right-0 h-full w-32 bg-opacity-to-white"}):null]}),o(ve,{className:"w-60 text-center",version:"primary",...n,href:g})]})}));function Vf({activeIndex:e,cards:t,selectedCardIndex:n,onClick:i}){const a=460*e,l=t.length>2?"justify-start":"justify-center";return o("div",{style:{transform:`translateX(-${a}px)`},className:"duration-1000 px-6xl",children:o("div",{className:`w-full flex flex-nowrap gap-s pb-6xl ${l}`,children:t.map(((e,t)=>function({slide:e,i:t,isActive:n,onClick:i}){return c("button",{type:"button",onClick:i,className:"p-3xl min-w-fit flex items-center gap-2xl bg-white border-solid border relative "+(n?"shadow-dark-blue border-primary-main":"ease-in duration-300 border-gray"),children:[e?.icon?o(ne,{className:"p-lg rounded-full bg-secondary-light",image:e.icon,width:"108",height:"108"}):null,c("div",{className:"flex gap-s",children:[e?.sum?Lf("страховая сумма",e.sum):null,e?.fee?Lf("страховой взнос",e.fee):null]}),jf(n)]},String(t))}({slide:e,i:t,isActive:Boolean(t===n),onClick:()=>i(t)})))})})}function Lf(e,t){return c("div",{className:"flex flex-col text-left whitespace-pre",children:[c(Me,{size:"text-h6",children:[We(2)(t)," ₽"]}),o("div",{className:"mt-2xs",children:o(Me,{size:"text-l",color:"text-secondary-text",children:e})})]})}function jf(e){return e?o(ne,{className:"h-6 w-6 min-w-6 min-h-6 absolute right-4 top-4",image:{icon:"DoneIcon"},width:"24",height:"24"}):null}const qf=d((({className:e="",title:t,insuranceTabs:n=[],button:a,...r})=>{const[s,d]=i(0),m=l((e=>d(e)),[]);return c(g,{className:u("box-border overflow-hidden relative px-0 space-y-2xl",e),defaultPadding:"p-6xl",...r,children:[t?o(N,{className:"text-center",title:t,headingType:"h3"}):null,n?.length>1?o("div",{className:"p-xs bg-secondary-light w-fit mx-auto rounded-md",children:n.map(((e,t)=>function({title:e,i:t,isActive:n,onClick:i}){return o("button",{type:"button",onClick:i,"aria-label":`Кнопка ${e}`,className:"box-border px-m py-s text-m font-light "+(n?"bg-primary-main text-white rounded-md":"text-secondary-text"),children:e},String(t))}({title:e?.title,i:t,isActive:Boolean(t===s),onClick:()=>m(t)})))}):null,o("div",{className:"flex",style:{transform:`translateX(-${s}00%)`},role:"list",children:$f({insuranceTabs:n,button:a})})]})})),$f=({insuranceTabs:e,button:t})=>{const n=e?.map((e=>e.cards));return n?.length?n.map(((e,n)=>o(Ff,{button:t,cards:e},String(n)))):null};const Uf={yellow:"bg-yellow",green:"bg-green","green-light":"bg-green-light","green-dark":"bg-green-dark"},Wf={XS:"h-10",S:"h-16",M:"h-24",L:"h-32",XL:"h-52"},Hf=d((e=>{const{className:t="",__html:n,isDotted:i,investmentZeroColumn:a,investmentColumns:l,...r}=e,s=l?[...l]:[];return a&&s.unshift(a),o(g,{className:t,defaultPadding:"p-4xl",...r,children:c("div",{className:"container text-m font-light space-y-4xl",children:[s?.length?c("div",{children:[c("div",{className:"flex items-end relative pl-3xl pr-lg text-white",children:[cd(o("div",{className:"w-px h-4 bg-gray"}))(s.map(Yf)),o("div",{className:"absolute right-3xl w-px h-4 bg-gray"})]}),o("div",{className:"border-t border-gray -mt-xs mx-3xl"}),o("div",{className:"flex justify-between text-primary-text mt-s -mx-5xl",children:s.map(Xf)})]}):null,n?o("div",{className:"max-w-2xl font-light text-base",children:o(De,{__html:n,isDotted:i,itemSize:"list-s"})}):null]})})})),Yf=(e,t,n)=>{const i=1===t,a=t===n.length-1,l=e.cells?.reverse()||[];return o("div",{className:`${Kf(i,a,e.cells)}`,children:l.length?o("div",{className:"w-full "+(a?"border-4 border-green-more-dark p-1.5 min-w-72":""),children:l.map(Gf)}):null},`column_${t}`)},Kf=(e,t,n=[])=>[n.length?"flex-1":"flex-0",!n.length||e||t?"":"pl-s",n.length&&!t?"pr-s pb-3xl":"pb-xl"].join(" "),Gf=(e,t)=>{const n=e.cellSize||"XS",i=e.cellColor||"green";return e.text?o("div",{className:`flex-1 flex items-center justify-center relative py-xs ${Wf[n]} ${Uf[i]} ${"XS"===n?"px-s":"px-5xl"}`,children:o(Me,{align:"text-center",children:e.text})},`cell_${t}`):null},Xf=(e,t)=>e?.title?o("div",{className:"flex-1 max-w-44 text-center px-xs last:pr-4xl last:max-w-52",children:e.title},`title_${t}`):null,Jf=["байт","Кб","Мб","Гб","Тб","Пб"],Zf=d((({icon:e,text:t,href:n,target:i,fileFormat:a,data:l,fileSize:r})=>{const s=r&&a?",":"",d=r??"",m=a?String(a):"";return c("a",{className:"flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main",href:n,target:i,...ge(l),children:[e,t?c(Me,{size:"text-l",font:"font-light",children:[t," ",Qf(d,m),o(Me,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),Qf=(e,t)=>e||t?o("span",{children:", "}):"",ex=(e,t)=>(n,i)=>{const a=$(e)("Attachment"===n?.docType?n?.attachment?.src:n?.href),l="Attachment"===n?.docType?((e,t=2)=>{if(0===e)return"";const n=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,n)).toFixed(t))} ${Jf[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,r="Attachment"===n?.docType?nx(a):n?.fileFormat;return c("div",{role:"listitem",children:[o(Zf,{text:n?.text,target:n?.target,href:a,fileFormat:r,fileSize:l,icon:tx(t),data:n?.data}),o(De,{__html:n?.__html})]},String(i))},tx=e=>e?o(ne,{className:"min-w-6 min-h-6",image:e,width:"24",height:"24"}):null,nx=e=>{if(!e)return"";const t=e.lastIndexOf("."),n=new RegExp(/\/(.*)/),i=-1!==t?e.substring(t+1):"";return i.includes("/")?i.replace(n,""):i},ix=d((({href:e,__html:t,target:n})=>{const{close:i}=me(),a=D(),r=$(a)(e),s=l((()=>{i()}),[]);return c(sr,{className:"my-6xl min-h-fit w-fit mx-auto",children:[t?o(De,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(ve,{text:"Я согласен",version:"primary",target:n,href:r,onClick:s}),o(ja,{type:"button",version:"secondary",onClick:s,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]})})),ax=d((({text:e,href:t,target:n,__html:i,icon:a})=>{if(!e&&!i)return null;const r=(e=>{const{open:t,close:n}=me();return{open:(n={})=>t(o(ix,{...e}),n),close:n}})({__html:i,href:t,target:n}),s=l((()=>r.open()),[r]);return c("button",{className:"flex gap-s text-primary-text no-underline hover:text-primary-main",onClick:s,children:[tx(a),o(Me,{font:"font-light",children:e})]})})),lx={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},rx=Et((({className:e="",title:t,description:n,align:i="text-center",documents:a,icon:l={icon:"DocIcon"},columnsMode:r="double",...s})=>{const d=D();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(S,{title:t,description:n,align:i,headlineVersion:"M",as:"h2",isEmbedded:!0}),a?.length?o("div",{className:u("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",lx[r]),role:"list",children:a.map(sx(d,l))}):null]})})),sx=(e,t)=>(n,i)=>{const a=n?.docType;return""===a?null:"reportSource"in n&&n?.reportSource?.__html?ox(t)(n,i):ex(e,t)(n,i)},ox=e=>(t,n)=>{const i={text:t.text,target:t.target,__html:t.reportSource?.__html};return t.reportSource?.__html&&t.text?c("div",{role:"listitem",children:[o(ax,{...i,icon:e,href:cx(t)?t?.href:t?.attachment?.src}),o(De,{__html:t?.__html})]},String(n)):null},cx=e=>"href"in e,dx=Et((({className:e,padding:t,align:n="text-left",buttons:i=[],description:a,image:l,__html:r,headingType:s,qr:d,additionalDescription:m="",title:h="Мобильное приложение",version:p="primary",...f})=>{const x="secondary"===p?"p-m min-w-32":"min-w-24",b=l?.src?o(ne,{className:"hidden lg:block",image:l}):null;return o(g,{className:u("min-h-80",e),padding:"p-0",version:p,...f,children:c(Te,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(N,{headingType:s,title:h,className:u("whitespace-pre-wrap",n)}),rightImage:b,buttons:je(i,{className:"flex-wrap"}),children:[a?o(Me,{size:"text-xl","font-weight":"font-light",children:a}):null,c("div",{className:u("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[r?o(De,{__html:r,itemSize:"list-m"}):null,o(Me,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:m}),d?.src?o("div",{className:u("flex justify-center bg-white rounded-md @xl:-order-1",x),children:o(ne,{className:"w-fit",image:d})}):null,l?.src?o(ne,{className:"lg:hidden",image:l}):null]})]})})})),mx=(e=[],t={})=>e.filter((({content:e={}})=>fd(t,e))).length,ux=(e,t)=>e===t;const hx=(e=>(t,n)=>t===n||Boolean(t&&n&&Object.keys(t).length===Object.keys(n).length&&Object.entries(t).every((([t,i])=>e(i,n[t])))))(function(...e){return(t,n)=>e.some((e=>e(t,n)))}(ux,((e=ux)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,i)=>e(t,n[i])))))())),px=[],gx={},fx={primary:"bg-white/30",secondary:"bg-main-divider"},xx={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},bx=d((({count:e,version:t="secondary"})=>{const n=Se(),i=n?"bg-main-divider":fx[t],a=xx[t][n?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",i),role:"status","aria-label":`Количество ${e} доступных программ и сервисов`,children:o(Me,{size:"text-xs",color:a,children:e})})})),yx=({text:e,description:t,icon:n,isActive:i,type:a})=>{const l=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white"),text:e?"mb-xs text-xl":"mb-2xs text-l text-primary-text",desc:"font-light "+(e?"text-l text-white":"text-m text-secondary-text"),icon:e?"":"text-primary-main",iconVersion:e?"white":"normal",oldText:"text-m text-center",oldDesc:"text-m-light"}))(i);return c("div",{className:u("cursor-pointer text-left border-b-0 flex gap-2xs"),"aria-label":e,"aria-labelledby":`${e}-label`,children:[n?o(ne,{className:u("h-6 w-6 min-w-6 min-h-6",l.icon),image:{...n,iconVersion:n?.iconVersion??l.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===a?l.text:l.oldText,children:e}),o("div",{className:"animated"===a?l.desc:l.oldDesc,children:t})]})]})},vx={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},Nx={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},wx={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},Cx={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},Sx=d((({tag:e="div",item:t={},isActive:n=!1,type:i="default",onClick:a})=>{const l=e,{text:r,description:s,icon:d,count:m,tabName:h,...p}=t;return o(l,{className:u("h-12","block flex-1","cursor-pointer",vx[i],n?Cx[i]:wx[i]),role:"tablist","aria-label":"Список табов",onClick:a,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?Nx[i]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${r}`,children:[yx({text:r,description:s,icon:d,isActive:n,type:i}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o(bx,{count:m,version:qa(n,i)})}):null]})})})),kx=d((e=>o(e?.item?.href?Ix:Tx,{...e}))),Ix=d((e=>{const t=he(),n=l((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:i,...a}=t({...e.item,onClick:n});return o(Sx,{...e,tag:"a",item:a,onClick:i})})),Tx=d((({item:e={},onClick:t,...n})=>{const i=l((()=>{t&&t(e)}),[t,e]);return o(Sx,{item:e,onClick:i,...n})})),Bx=(e,t,n)=>(i,a)=>o(kx,{isActive:i===e,onClick:t,type:n,item:i},String(a)),Px=d((({className:e,tabsType:t="default",items:n=[],activeItem:i,onChange:a})=>o("div",{className:u("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tabpanel","aria-label":"Панель управления табами",children:n.map(Bx(i,a,t))}))),Rx={categories:[],extraOptions:[],propertyType:[],stage:[]},Dx=Et((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:i,...a})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=bd(Rx,{block:a.block,page:a.options?.page}),f=l(((e=Rx)=>p(e)),[]),x=(({hotFilters:e=px,filtrationState:t=gx,blocks:n=px,onFiltrationStateChange:i})=>{const a=r((()=>Math.max(0,e.findIndex((e=>hx(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:mx(n,t.filter),version:qa(t===e[a])})))),[e,n,a]),o=l((t=>{i(e[s.indexOf(t)].filter)}),[e,s]);return{activeItem:s[a],items:s,onChange:o}})({hotFilters:t,filtrationState:s,blocks:a.block?.blocks,onFiltrationStateChange:f});return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...a,children:[o(Px,{...x}),o(md,{filtrationSchema:n,resetButton:i,field:m,reset:h}),o(sd,{blocksToRender:d,...a})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),_x=({location:e,address:t,billAcceptorType:n,terminalType:i,billAcceptorEnable:a,atmCode:l="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:zx(i)},{label:"Модуль приема наличных",value:a?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:l}];return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(Me,{size:"text-h4",children:zx(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Me,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(ya,{color:"green",children:zx(s)})})]}),o("div",{className:"hidden sm:block",children:o(oa,{className:"flex-wrap",children:m?.map(Ax)})}),o(na,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ia,{isUnfolded:e,children:o(oa,{className:"flex-wrap",children:m?.map(Ax)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Ia({isUnfolded:e,onToggle:t})})]},String(d))},Mx=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${zx(t)} №${n}`,body:e.toUpperCase()}),Ax=(e,t)=>o(aa,{...e},String(t)),zx=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",Ex=[];const Ox=async e=>{const t=await Pt(e,{method:"GET"});return Array.isArray(t)?t:Ex},Fx={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},Vx={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable),locationDisabledPeople:e=>Boolean(e.locationDisabledPeople),designDisabledPeople:e=>Boolean(e.designDisabledPeople)},Lx=d((({descriptionData:e,className:t})=>{const n=zp(),i=n?.code??"000",{data:a,isLoad:l}=function(e){const{data:t,error:n}=pi(`/api/v1/atms?regionCode=${e}`,Ox);return{data:t||Ex,isLoad:!t&&!n}}(i);return o(Za,{className:t,filterItems:jx,data:a,isLoad:l,initFilterState:Fx,renderCard:_x,getBalloon:Mx,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),jx=(e,t)=>{const n=Object.keys(t).filter((e=>t[e])),i=n.filter((e=>e.startsWith("terminalType"))),a=n.filter((e=>!i.includes(e)));return e.filter((e=>{const t=a.every((t=>Vx[t](e))),n=!i.length||i.some((t=>Vx[t](e)));return t&&n}))},qx=({address:e,workScheduleDescription:t},n)=>t?c("div",{className:"bg-white col-span-12 p-3xl sm:border-yellow sm:border",children:[o("div",{className:"sm:flex sm:justify-between",children:c("div",{children:[o(Me,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Me,{size:"text-l",children:e})]}):null]})}),o("div",{className:"hidden sm:block",children:$x({workScheduleDescription:t})}),o(na,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ia,{isUnfolded:e,children:$x({workScheduleDescription:t})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Ia({isUnfolded:e,onToggle:t})})]},String(n)):null,$x=({workScheduleDescription:e})=>c("div",{children:[c(oa,{className:"flex",children:[o(aa,{label:"Операции для физических лиц",children:o(Me,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(aa,{label:"Операции для физических лиц",children:o(Me,{children:"Оформление и обслуживание банковских карт"})}),o(aa,{label:"Операции для физических лиц",children:o(Me,{children:"Инвестиционное и накопительное страхование"})}),o(aa,{label:"Операции для физических лиц",children:o(Me,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(aa,{label:"Режим работы",className:"max-w-none",children:o(Me,{children:e})})]}),Ux=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),Wx={branches:[],remoteWorkplaces:[]};const Hx=async e=>await Pt(e,{method:"GET"})||Wx,Yx=d((({className:e})=>{const t=zp(),n=t?.code??"000",{data:i,isLoad:a}=function(e="000"){const{data:t,error:n}=pi(`/api/v1/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,Hx);return{data:t||Wx,isLoad:!t&&!n}}(n);return o(Za,{className:e,data:i?.branches,isLoad:a,remoteWorkplaces:i?.remoteWorkplaces,renderCard:Ra,renderRemoteWorkplaceCard:qx,getBalloon:_a,getBalloonRemoteWorkplaces:Ux,title:`Офисы филиала ${t?.name}`})})),Kx=d((({data:e,className:t,...n})=>{const i=e?.dataType??"offices";return o(g,{version:"transparent",className:u(t),defaultPadding:"p-0",...n,children:"offices"===i?o(Yx,{}):o(Lx,{descriptionData:e})})})),Gx=d((({className:e,title:t,description:n="Блок в разработке...",...i})=>c(g,{className:u("box-border",e),...i,children:[o(S,{className:"max-w-[600px]",title:t,description:n,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(f,{})]}))),Xx="hidden sm:flex absolute z-40 top-10",Jx=Et((({className:e="",padding:t,slides:n=[],...a})=>{const[l,r]=i(0),[s,d]=jc({itemCount:n?.length||0});return c(g,{className:u("box-border overflow-hidden",e),defaultPadding:"pt-6xl",padding:t,...a,children:[o("div",{className:"flex duration-1000",style:{transform:`translateX(-${100*l}%)`},role:"list",children:n.map((({productBlock:e},t)=>o("div",{className:"box-border grow-0 shrink-0 basis-full",role:"listitem",children:o(Je,{className:"pl-6xl h-full",headlineVersion:"M",isFullWidthTitle:!1,...e,...a})},String(t))))}),c("div",{className:"relative pr-xs mt-m -mb-m flex gap-xs box-border",children:[o(Bc,{containerRef:s,snapAlign:"snap-start",onVisibleIndicesChange:d.handleVisibleIndicesChange,itemClassName:"h-40 flex items-stretch w-screen",gap:8,children:n.map(Zx({activeSlideIndex:l,onClick:r}))}),d.canScrollLeft?o(Hc,{className:u("left-6",Xx),onClick:d.scrollLeft}):null,d.canScrollRight?o(Yc,{className:u("right-6",Xx),onClick:d.scrollRight}):null]})]})})),Zx=({activeSlideIndex:e,onClick:t})=>({nav:n},i)=>{const a=i===e,l=a?"min-w-[370px] mt-s h-28 bg-white shadow-dark-blue border-none p-6":"min-w-72 mt-lg h-24 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",r=a?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=a?"text-secondary-text text-l font-light":"text-secondary-text text-m font-light group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(i),"aria-label":n?.title,className:u("relative overflow-hidden grow","ml-xs px-xl","box-border basis-0 border","border-gray group-data-secondary:border-white/50","text-left whitespace-nowrap",l),children:[o("div",{className:r,children:n?.title}),o("div",{className:s,children:n?.description})]},String(i))},Qx=d((({address:e,email:t,telephone:n,button:i,className:a="",__html:l,richVersion:r,icon:s,title:d,version:m="primary",...h})=>c(g,{className:u("box-border text-left space-y-s",a),version:m,...h,children:[c("div",{className:"w-full flex justify-between flex-row-reverse",children:[Le(s)?o("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:o(ne,{image:s})}):null,d?o(N,{headingType:"h3",as:"h3",title:d}):null]}),c("div",{className:"w-full space-y-m",children:[l?eb({__html:l,richVersion:r}):null,tb({label:"Адрес",data:e,iconName:"GeolocationIcon"}),tb({label:"Телефон(факс)",data:n,iconName:"PhoneIcon"}),tb({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),i?.text?je([i]):null]})]}))),eb=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(De,{...e,itemSize:"list-s"})}),tb=({label:e,data:t,iconName:n,dataColor:i=""})=>t?c("div",{className:"flex gap-s",children:[o(W,{iconVersion:"black",name:n,width:"24",height:"24"}),c("div",{className:"flex flex-col gap-2xs",children:[o(Me,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(Me,{size:"text-xl",color:i,children:t})]})]}):null,nb=d((e=>{const{__html:t,richVersion:n="",...i}=e;return o(g,{defaultPadding:"p-0",...i,children:o(De,{__html:t,richVersion:n})})})),ib=d((({label:e,labelIconBgVersion:t,icon:n,onToggle:i,labelIcon:a})=>o(td,{tag:"button",className:u("border-none bg-transparent items-center group/button",a?.icon?"py-xs":"py-lg"),onClick:i,textNode:c("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[null,e?o(Me,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:n?o(W,{name:n,iconVersion:"color",width:"24",height:"24"}):null}))),ab=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",lb=(e=!1)=>e?"MinusIcon":"PlusIcon",rb=(e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon",sb=Et((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,label:i="Развернуть",labelIcon:a,labelIconBgVersion:l,foldButtonVersion:r="default",version:s,role:c,...d})=>{const m=Se();return o(g,{className:u("w-full border-0 border-b border-solid border-main-divider last:border-b-0",e),defaultPadding:"p-0",tag:"div",version:"transparent",role:c,...d,children:o(na,{isFoldButtonOnTop:n,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o(ia,{className:u("gap-lg",ab(m)),isUnfolded:e,children:R({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>ob({foldButtonVersion:r,label:i,labelIcon:a,labelIconBgVersion:l,isUnfolded:e,onToggle:t,isMobile:m})})})}),{childrenTypes:{exclude:["RollupItem"]}}),ob=({foldButtonVersion:e,label:t,labelIcon:n,labelIconBgVersion:i,isUnfolded:a,onToggle:l,isMobile:r=!1})=>{const s=t||(a?"Скрыть":"Развернуть"),c=((e=!1,t=!1)=>t?rb(e):lb(e))(a,r);return"accordion"===e?o(ib,{label:s,labelIcon:n,labelIconBgVersion:i,icon:c,onToggle:l}):o(nd,{label:s,icon:a?"ArrowUpIcon":"ArrowDownIcon",onClick:l})},cb=d((({name:e,text:t,value:n,checked:i,onChange:a,className:l})=>o("div",{className:l,children:c("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[o("input",{className:u(gn.split(" ").filter((e=>"rounded"!==e)),Si,"flex justify-center items-center after:block after:w-2.5 after:h-2.5 after:rounded-full rounded-full","checked:border-2 checked:!border-primary-main focus:checked:border-primary-main checked:after:bg-primary-main"),type:"radio",value:n,name:e,checked:i,onChange:e=>a?.(e.target.value),role:"radio"}),t?o(Me,{color:"text-primary-text",children:t}):null]})}))),db=d((({className:e=""})=>{const[t,n]=i("option2"),a=l((e=>n(e)),[]);return c("div",{className:u("order-4",e),role:"radiogroup",children:[o(cb,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:a}),o(cb,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:a})]})})),mb=d((({data:e,fieldLabel:t,fieldValue:n,selected:i,placeholder:a="",setSelected:l,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[n||t],text:e?.[t]}))),c=s.find((e=>e.key===i));return o(_n,{options:s,label:r,placeholder:a||i,onChange:e=>l(e.key),value:c})})),ub=d((({regions:e=[],selectedRegion:t,onSelectedRegion:n,branches:i=[],selectedBranch:a,onSelectedBranch:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(mb,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(mb,{data:i,fieldValue:"branchCode",fieldLabel:"address",selected:a,setSelected:l,label:"Отделение",placeholder:"Выберите отделение"})})]}))),hb=["От 1 дня","До 365 дней"],pb=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(Me,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(ul,{min:1,max:365,value:e,items:hb,onChange:t})]}))),gb=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:n,safeBoxCases:i=[],selectedBoxSize:a,onSelectedBoxSize:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(mb,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(mb,{data:i,fieldLabel:"safeBoxCasesSize",selected:a,setSelected:l,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),fb=d((({regions:e,selectedRegion:t,branches:n,selectedBranch:i,days:a,selectedCaseVolume:l,selectedBoxSize:r,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:u})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(ub,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:n,selectedBranch:i,onSelectedBranch:xb(m)}),o(pb,{days:a,setDays:e=>m({days:e})}),o(gb,{caseVolumes:d,selectedCaseVolume:l,onSelectedCaseVolume:bb(m),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(Me,{size:"text-l",font:"font-light",color:"text-secondary-text",children:"Тип договора"})}),c("div",{className:"contents @md:flex justify-between items-center gap-m",children:[o(db,{}),o(ve,{text:"Офисы на карте",version:"primary",onClick:u,className:"order-6"})]})]}))),xb=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},bb=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},yb=d((({days:e,tariffs:t=[]})=>{const n=Nb(e,t),i="На рисунке изображена пачка листов\nформата А4";return c("div",{className:"contents @xl:flex flex-col justify-between gap-xl order-2",children:[c("div",{className:"flex flex-col @xl:flex-row gap-x-6xl gap-y-2xl order-5 @xl:order-none py-2xl @xl:py-0 border-t border-main-divider @xl:border-none",children:[vb("Аренда за",e),vb("Цена",n+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:i})}),c("div",{className:"flex flex-col items-center gap-s order-3 @xl:order-none mb-xl @xl:mb-0 bg-primary-main py-s @xl:p-3xl text-center",children:[o(ne,{image:{icon:"PackA4Icon"},className:"@xl:h-60"}),o("div",{className:"hidden @xl:inline opacity-80 whitespace-pre-line",children:o(w,{size:"text-s",font:"font-light",color:"text-white",children:i})})]})]})})),vb=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(Me,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o("span",{className:"text-l @xl:text-h3 text-primary-text",children:t})]}),Nb=(e,t)=>{const n=wb(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},wb=e=>{let t=1;switch(!0){case e>30&&e<=90:t=2;break;case e>90&&e<=180:t=3;break;case e>180&&e<=365:t=4}return t},Cb=(e,t)=>e.find((e=>e.branchCode===t)),Sb=d((e=>{const{regions:t,data:n,branches:i,onChange:l,onClick:r}=e;a((()=>{l({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,l]);const s=Cb(i,n.selectedBranch),d=kb(s?.safeBoxCaseVolumes),m=Ib(s?.safeBoxCaseVolumes,n.selectedCaseVolume)?.safeBoxCases,u=Tb(m,n.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(fb,{...n,regions:t,onClick:r,branches:i,caseVolumes:d,safeBoxCases:m,onChange:l}),o(yb,{days:n.days,tariffs:u})]})})),kb=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Ib=(e,t)=>e?.find((e=>e.volume===t)),Tb=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Bb=[];const Pb=async e=>await Pt(e,{method:"GET"})||Bb,Rb=d((({title:e,footnote:t,className:n="",...a})=>{const[r,s]=i(!1),d=l((()=>s((e=>!e))),[]),[m,u]=i({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),h=Ms(),p=Db(m.selectedRegion,h),f=function(e){const{data:t}=pi(e?`/api/v1/safeboxes?regionCode=${e}`:null,Pb);return t||Bb}(p),x=l((e=>u((t=>({...t,...e})))),[u]),b=(y=Cb(f,m.selectedBranch)||f,Array.isArray(y)?y.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)].filter(Boolean),content:void 0}))).filter((e=>e.coords&&2===e.coords.length)):y?.gpsLatitude&&y?.gpsLongitude?[{coords:[y.gpsLatitude,y.gpsLongitude]}]:[]);var y;return c(g,{className:n,defaultPadding:"",...a,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(N,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(Sb,{regions:h,branches:f,data:{...m,selectedRegion:p},onClick:d,onChange:x}),t?o(w,{size:"text-s",font:"font-light",children:t}):null]}),b.length&&r?o(Ki,{points:b,className:"h-[640px]"}):null]})})),Db=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,_b=e=>e<4?"w-72":"w-52",Mb={description:"text-white/80 text-l font-light group-data-primary:text-secondary-text group-data-gray:text-secondary-text",iconText:"text-white group-data-primary:text-secondary-text group-data-gray:text-secondary-text",iconBackground:"bg-white/30 group-data-primary:bg-main-divider",iconConnector:"bg-white group-data-primary:bg-secondary-light",dot:"bg-white/80 group-data-primary:bg-secondary-text"},Ab=d((({buttons:e,className:t="",description:n,showLines:i=!0,steps:a=[],stepVersion:l="gray",title:r,version:s="primary",...d})=>{const m=a.length>3,h=Mb,p=(e=>e?"":"opacity-0")(i),f=Se();return c(g,{className:u("box-border flex flex-col items-center overflow-hidden gap-y-3xl",t),defaultPadding:"p-6xl",version:s,...d,children:[o(S,{headlineVersion:"S",title:r,description:n,isEmbedded:!0,className:"w-full",align:Cd(f)}),a?.length?c("div",{className:"box-border space-y-lg flex flex-col justify-center",children:[o("div",{className:u("flex items-center",m?"px-16":"px-24"),children:cd(o("div",{className:u("h-0.5 w-full bg-secondary-light flex-1",p)}))(a.map(zb(h,m,l)))}),o("div",{className:u("flex justify-between",m?"gap-x-s":"gap-x-20"),children:a.map((x={styleMap:h,version:s},(e,t,n)=>{const{styleMap:i,version:a}=x,{label:l,description:r,button:s,isDotted:d}=e;return c("div",{className:u("relative flex flex-col items-center text-center justify-between whitespace-pre-line overflow-hidden space-y-3xl",_b(n.length)),children:[c("div",{className:"space-y-xs",children:[l?o(Me,{size:"text-h6",align:"text-center",children:l}):null,c("div",{className:"flex flex-col items-center gap-3xs",children:[r?o("div",{className:i.description,children:r}):null,o(De,{__html:e.__html,itemSize:"list-s",isDotted:d})]})]}),s?.text?o(ve,{className:"box-border py-s w-full max-w-60 mt-auto",version:a,...s,children:s?.text}):null]},String(t))}))})]}):null,je(e)]});var x})),zb=(e,t,n)=>({icon:i},a)=>{const l="secondary"===n?"white":"color";return o(g,{defaultPadding:"",className:`${Eb(t)} flex justify-center items-center text-center rounded-full box-border z-10`,version:n,children:Le(i)?o(ne,{image:{...i,iconVersion:i?.iconVersion||l},width:"48",height:"48"}):o("span",{className:u("text-h4","transparent"===n?e.iconText:(r=n,"secondary"===r?"group-data-primary:text-white":"text-secondary-text")),children:a+1})},String(a));var r},Eb=e=>e?"h-16 w-16":"h-24 w-24",Ob=d((()=>o("div",{className:"hidden",role:"none"}))),Fb="hidden sm:flex absolute z-40",Vb={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},Lb=d((({className:e,items:t=[],activeItem:n,onChange:i,tabsType:l="default"})=>{const[r,s]=jc({itemCount:t?.length||0});return a((()=>jb(r.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(Bc,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:Vb[l].item,gap:Vb[l].gap,children:t.map(Bx(n,i,l))}),s.canScrollLeft?o(Hc,{className:u("left-6",Fb,Vb[l].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(Yc,{className:u("right-6",Fb,Vb[l].buttonTop),onClick:s.scrollRight}):null]})})),jb=(e,t,n)=>{const i=t.findIndex((e=>e===n));e&&i>0&&e.scrollTo({left:e?.children[i]?.offsetLeft,behavior:"smooth"})},qb={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},$b=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(qb[t].wrapper,e),children:o(Lb,{className:qb[t].component,tabsType:t,...n})}):null,Ub=Et((({className:e="",tabs:t=[],block:n,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=Wb(n??{}),p=D(),f=t.every((e=>"link"===e?.type)),x=s?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,{isReady:b}=p,[y,v]=i(Kb(x,((e="")=>{const t=globalThis?.location?.href;return t?new URL(t).searchParams.get(e):null})(h))),N=x[y],w=x.findIndex((e=>Boolean(e.selected)));a((()=>{const e=p.query[h]?x.findIndex(((e,t)=>"group"===e.type&&(e?.tabName??String(t))===p.query[h])):w;v(-1===e?0:e)}),[b,w,h]);const C=Yb(x[y],y),S=l((e=>{const t=x.indexOf(e),n=x[t];v(t),"group"===n.type&&((e,t)=>{const n=new URLSearchParams(p.query);e.text?n.set(h,e?.tabName??String(t)):n.delete(h),p.replace(`${p.pathname}?${n}`,"",{scroll:!1})})(e,t)}),[x]);return c(g,{className:u({"sticky top-1 z-20":d&&f},e),defaultPadding:"p-0",block:n,...m,children:[$b({className:u({"pb-1":n?.slots&&"default"===r,"sticky top-1 z-20":d&&!f}),items:Hb(t,x),activeItem:N,tabsType:r,onChange:S}),o("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:Object.entries(n?.slots??{}).map((([e,t])=>P(t,{...m?.options,slotName:C,parent:n,extraProps:{className:e===C?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(Yb)?.filter(Boolean)||[]}),Wb=({__id:e,anchor:t})=>t??e??"tabs",Hb=(e,t)=>t?.length?t:e,Yb=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",Kb=(e,t)=>t?Number(t):e.reduce(((e,t,n)=>t.selected?n:e),0),Gb={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},Xb=d((({children:e,activeIndex:t,columnWidth:n,version:i="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:Gb[i],style:{transform:`translateX(-${t*n}px)`},children:e})}))),Jb=d((({className:e="",isOpen:t,onClick:n})=>o(ve,{className:e,appendRight:o(ne,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"24",height:"24"}),text:t?"Скрыть":"Показать",version:"gray",onClick:n}))),Zb={Buttons:({buttons:e})=>je(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?o(ne,{image:e}):null,RichText:({__html:e,isDotted:t=!0})=>o("div",{className:"flex flex-col justify-between items-start text-h6",children:o(De,{__html:e,isDotted:t,itemSize:"list-m"})}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(Me,{size:"text-h6",children:e})}):null,t?o("div",{className:"lg:text-l font-light text-xs",children:o(Me,{color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,tableSource:n,pdfUrl:i,isOpen:a})=>e?o(Jb,{className:"w-fit",isOpen:a,onClick:()=>{t({tableSource:n,pdfUrl:i})}}):null},Qb=d((({cell:e,fieldIdx:t,rowIdx:n,cellIdx:l,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=i(!0);a((()=>{l===o&&s||m(!0)}),[s,o]);return ey({cell:e,cellProps:{rowIdx:n,cellIdx:l,fieldIdx:t,displayTable:e=>{m(!1),c(l),r(e)},isVisible:d}})})),ey=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...i}=e;if(!n||!(n in Zb))return null;return o(Zb[n],{...t,...i})},ty=d((({cells:e,rowIdx:t,cellIdx:n,setTableInner:i,tableInner:a,openTableInnerIdx:l,setOpenTableInnerIdx:r})=>o("div",{className:"w-80 flex-grow flex flex-col gap-m @4xl:gap-lg",role:"cell",children:e?.length?e.map(((e,s)=>o(Qb,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:i,tableInner:a,openTableInnerIdx:l,setOpenTableInnerIdx:r},String(s)))):null}))),ny=(e,t)=>140*Cg(e.slice(0,t).map((e=>e?.cols?.length??1))),iy=(e,t)=>e?.length>0?o("div",{className:u("flex",{"text-secondary-text":0===t}),children:e.map(((e,t)=>o("div",{className:"w-20 mx-lg",children:o(Me,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,ay=d((({rows:e})=>{const t=e?.[0]?.length??0,[n,i]=Ef({itemCount:t,visibleItemCount:5});return c("div",{children:[e?.map((a=n,(e,t)=>{if(!e?.length)return null;const[n,...i]=e,l=u("flex duration-1000 text-center",0!==t?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[n?.data?o("div",{className:"whitespace-pre-wrap sm:whitespace-normal w-48 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0",children:o(Me,{size:"text-xl",font:"font-light",children:n.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:l,style:{transform:`translateX(-${ny(i,a)}px)`},children:i?.map(((e,t)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(Me,{size:"text-xl",children:e.data}):null,e?.cols?iy(e.cols,a):null]},`row${t}`)))})})]},String(t))})),Of({...i,btnClass:["left-3 top-20","right-3 top-20"],className:""})]});var a})),ly=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,n)=>{const i=`activeTabIdx:${e}-tableIdx:${n}`;return c("div",{className:"w-full @container",children:[o("div",{className:"flex py-m sm:px-m bg-white @4xl:bg-gray relative",children:o(Me,{size:"text-xl",align:"text-left",children:t.title})}),o("div",{className:"w-full sm:pl-xs overflow-hidden transition-height duration-500 ease-in-out",children:o("div",{className:"relative",children:o(ay,{rows:t.rowsData})})})]},i)}))}))),ry=(e=!1)=>""+(e?"text-white":"text-secondary-text"),sy=d((({currencies:e,linkToPDF:t,activeTabIndex:n,setActiveTabIndex:i})=>c("div",{className:"flex justify-between items-center w-full py-lg",children:[e&&e.length>1?o("div",{className:"flex bg-secondary-light p-2xs rounded-md",children:e.map(((e,t)=>o("div",{className:u("rounded-md px-4 py-3 cursor-pointer",{"bg-primary-main":t===n}),onClick:()=>i(t),children:o(Me,{size:"text-xl",font:"font-light",color:ry(t===n),children:e||t+1})},e)))}):null,t?o(ve,{className:"text-primary-main",href:t,version:"secondary",target:"_blank",appendLeft:o(W,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),oy=Et((({tableSource:e,pdfUrl:t,onClick:n})=>{const a=e?.tableData,[r,s]=i(0),d=l((e=>s(e)),[]),m=a?.[r]?.items??[],u=a?.map((e=>e.currency??""));return c("div",a?{className:"bg-white z-10",children:[o(sy,{currencies:u,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(ly,{activeTabIndex:r,items:m}),o(Jb,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(Me,{size:"text-h6",children:"Данных нет"}),o(Jb,{onClick:n,isOpen:!0})]})})),cy=d((({children:e,tableInner:t,onHideContentClick:n})=>c("div",{className:"self-start flex flex-col",role:"row",children:[o("div",{className:u("@4xl:border-main-divider @4xl:border-b","flex flex-col @4xl:flex-row gap-y-xs gap-x-5xl pb-lg @4xl:pt-lg"),children:e}),t?o("div",{className:"origin-top animate-expansion",children:o(oy,{...t,onClick:n})}):null]}))),dy=d((({row:{header:e,data:t},activeIndex:n,rowIdx:a,...r})=>{const[s,d]=i(void 0),m=l((e=>d(e)),[]),[h,p]=i(void 0),g=l((e=>p(e)),[]);return c(cy,{onHideContentClick:()=>d(void 0),tableInner:s,...r,children:[o("div",{className:u("text-s","w-80 flex-shrink-0"),children:c("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?o(ne,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?o(Me,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(Xb,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(ty,{cells:e,rowIdx:a,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})})),my=d((({children:e,controls:t})=>{const{isScrollAvailable:n}=t;return c("div",{role:"table",className:"overflow-x-auto w-auto grid md:block",children:[c("div",{className:"relative space-y-xs",children:[e,Of({...t,btnClass:["top-28","top-11"],className:"right-7"})]}),n?o("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),uy=d((({className:e="",title:t,description:n,rowHeaders:i,tariffsColumns:a,hiddenRowsNum:l=0,...r})=>{const s=a?.map((({data:e})=>e))||[],d=i?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),m=s.length,[h,p]=Ef({itemCount:m,visibleItemCount:2}),f=(d||[]).map(((e,t)=>o(dy,{row:e,activeIndex:h,rowIdx:t,...r},String(t)))),[x,b]=l>0?[f.slice(0,-l),f.slice(-l)]:[f,[]];return c(g,{className:u("relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...r,children:[o(S,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:l>0?o(na,{renderFoldableSection:({isUnfolded:e})=>c(my,{controls:p,children:[x,o(ia,{isUnfolded:e,children:b})]}),renderFoldButton:id}):o(my,{controls:p,children:f})})]})})),hy=d((({className:e="",title:t,description:n,iconVersion:i,__html:a,richVersion:l,...r})=>c(g,{className:u("flex gap-s sm:gap-m bg-white group-data-secondary:bg-primary-main/10",e),...r,children:["small"===i?py():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(Me,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?gy(n):null,a?o(De,{richVersion:l,__html:a}):null]})]}))),py=()=>o("div",{className:"rounded-full h-4 w-4 text-center text-xs font-light bg-primary-main text-white group-data-secondary:bg-white group-data-secondary:text-primary-main",children:"i"}),gy=e=>o(w,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),fy=d((({prefix:e,unit:t,suffix:n})=>c("div",{className:"w-full flex items-end",children:[e?o("div",{className:"gradient-color-text",children:o(Me,{size:"text-h2",children:e})}):null,t?o("div",{className:"-mb-6 @xl:-mb-4",children:o("span",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:t})}):null,n?o("div",{className:"gradient-color-text",children:o(Me,{size:"text-h2",children:n})}):null]}))),xy=d((e=>{const{prefix:t,unit:n,suffix:i,...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(fy,{prefix:t,unit:n,suffix:i})})})),by=Et((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:i=!0,version:a="transparent",isTheme:l=!1,isCardBorder:r=!1,image:s,...c})=>{const d=D();return o(g,{className:u("relative flex flex-col",Mf[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${J(d)(s?.src)})`}}:{},padding:t,version:a,isTheme:l,...c,children:R({...c,extraProps:{className:u("w-full",wc(r)),..._f(i)}})})}),{childrenTypes:[]}),yy=e=>(e=>{const t="col-span-",n=e?.split(/\s+/).find((e=>e.startsWith(t)));return n?parseInt(n.substring(t.length),10):12})(e)<10?"py-xl px-6xl":"py-6xl px-32",vy=d((({className:e,title:t,url:n,previewImg:i,...a})=>{const l=D();return c(g,{className:e,defaultPadding:yy(e),...a,children:[o(S,{title:t,headlineVersion:"M"}),n?o("video",{className:"m-auto w-full object-fill",preload:"metadata",poster:$(l)(i?.src),style:{maxHeight:524},controls:!0,children:o("source",{src:$(l)(n)})}):null]})})),Ny={AdTile:Ft,ApplicationForm:fo,ApplicationLeadForm:gc,ApplicationStatus:bc,BankAccountFiltration:Nd,BenefitsBlock:Id,BonusBenefitsBlock:Dd,ButtonsBlock:Md,CalculatorBonus:Kd,CalculatorBusinessDeposit:mm,CalculatorCredit:Im,CalculatorDeposit:Um,CalculatorRefinancing:Zm,CardTransfer:lu,Carousel:hu,CarouselCard:xu,CarouselCatalogCard:yu,CarouselLinks:wu,CarouselRecommendationCard:Ru,CarouselTariffsCard:Mu,ContactsBlock:zu,CreditCardForm:wh,CreditForm:ip,DepositFiltration:op,Depository:Sp,ErrorBlock:Ip,ExchangeRateTile:ag,Footer:Fg,GracePeriod:Vg,GrantSupport:$g,Header:Pf,Headline:S,HorizontalLayout:Af,ImgBlock:zf,InsuranceAmountBlock:qf,InvestmentInfo:Hf,LinkDocs:rx,MobileAppTile:dx,MortgageFiltration:Dx,OfficesAtmsMap:Kx,Placeholder:Gx,ProductBlock:Ot,ProductGallery:Jx,RepresentativeOfficeInfo:Qx,RichTextBlock:nb,RollupItem:sb,SafeDepositRental:Rb,StepsBlock:Ab,StickyBottomMenu:Ob,TabsLayout:Ub,TariffsTable:uy,TextBlock:hy,UnitBlock:xy,VerticalLayout:by,Video:vy},wy=ue((()=>{a((()=>{Gt()}),[]);const e=an();mn(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const i=JSON.parse(n?.dataset?.aspects??"[]");Yt({aspectsAttributes:i,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))})),Cy="cookie",Sy=d((({__html:e})=>{const[t,{setTrue:n,setFalse:i}]=dn();vg((()=>{globalThis.localStorage?.getItem(Cy)||n()}),[],3e3);const a=l((()=>{globalThis.localStorage?.setItem(Cy,"true"),i()}),[]);return t&&e?o("div",{className:"container fixed left-0 right-0 bottom-0 z-50",role:"dialog",children:c("div",{className:"bg-white m-xl p-xl rounded-md flex sm:items-center shadow-main-black",children:[o("div",{className:"sm:flex-1",children:o(De,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(rr,{className:"bg-main-gray rounded-md w-11 h-11",onClose:a})})]})}):null}));function ky(e){throw new Error(e)}const Iy=({onCloseAll:e,onClose:t}={})=>{const[n,{push:r,pop:s,clear:o}]=function(e=[]){const[t,n]=i(e),a=l((e=>n((t=>[...t,e]))),[]),r=l((()=>n((e=>e.slice(0,-1)))),[]),s=l((e=>n((t=>t.filter((t=>t!==e))))),[]),o=l((()=>n([])),[]);return[t,{setList:n,push:a,pop:r,remove:s,clear:o}]}(),c=l((()=>{e&&e(n),o()}),[n,e]),d=l((()=>{t&&t(n[n.length-1]),s()}),[n,t]);return a((()=>de.subscribe("dialog",(e=>{if(e)switch(e.type){case"open":r(e);break;case"close":e.all?c():d();break;default:ky(e)}}))),[c,d]),n},Ty=d((()=>{const e=l((e=>{for(const t of e)t?.onClose&&t.onClose()}),[]),t=l((e=>{e?.onClose&&e.onClose()}),[]),n=Iy({onCloseAll:e,onClose:t}),{close:i}=me(),r=l((({key:e})=>{"Escape"===e&&i()}),[]);return mn(globalThis.document,"keydown",r),a((()=>{n.length?(globalThis.document?.body.classList.add("no-scrollbar"),globalThis.document?.body.classList.add("overflow-hidden")):(globalThis.document?.body.classList.remove("no-scrollbar"),globalThis.document?.body.classList.remove("overflow-hidden"))}),[n]),n.length?o("div",{className:"fixed inset-0 z-50",role:"dialog",children:n.map((({dialog:e,id:t},i)=>o("div",{className:u("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar bg-black/50",{hidden:i!==n.length-1}),children:e},String(t||i))))}):null})),By=d((()=>{const[e,t]=i(null),n=l((()=>{t(null)}),[]);a((()=>de.subscribe("popup",(e=>{if(e)switch(e.type){case"open":case"update":t(e);break;case"close":n();break;default:ky(e)}}))),[]);const r=l((({key:e})=>{"Escape"===e&&n()}),[n]);return mn(globalThis.document,"keydown",r),e?o("div",{className:u("z-50",e.fixed?"fixed":"absolute"),style:{left:`${e.left}px`,top:`${e.top}px`,...e.width?{width:`${e.width}px`}:{}},role:"dialog",children:e.popup}):null})),Py="header",Ry="footer",Dy="sticky-footer",_y={},My=d((({className:e,data:t=_y,blocksRegistry:n,blockDecorator:i})=>{const{slots:a,blocks:l,fallback:r,...s}=t,d=zt(s,r);wy(),Ep();const m={key:"",page:{slots:a,blocks:l,fallback:r,...d},blocksRegistry:n,blockDecorator:i,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:u("@container relative",t.style,e),children:[a?.header?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:P(a?.header,{...m,slotName:Py})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[R({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),P(a?.footer,{...m,slotName:Ry})]})]}),a?.["sticky-footer"]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:P(a?.["sticky-footer"],{...m,slotName:Dy})}):null,o(Ty,{}),o(By,{}),o(Sy,{__html:d?.cookieContent?.__html})]})}));Object.assign(My,{childrenTypes:[],slots:()=>[Py,Ry,Dy]});e.Blocks=Ny,e.ContentPage=My,e.handlerDecorator=ue,e.joinList=cd,e.packageVersion="0.14.679",e.projectSettings=M,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=L,e.useNavigator=Vu,e.useRouter=D,Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniBlocks={})}(this,(function(e){"use strict";let t;const n=e=>(...n)=>t[e](...n),i=n("useState"),a=n("useEffect"),l=n("useCallback"),r=n("useMemo"),s=n("useRef"),o=(...e)=>globalThis._uni._jsx(...e),c=(...e)=>globalThis._uni._jsxs(...e),d=e=>{const t=e;return t._tmpl||(t._tmpl=globalThis.__UNI_REACT__?e:m(e)),t._tmpl},m=e=>{function t(t,n){const{children:i,...a}=t||{},l=n?.slots?.default,r=i||l&&l();return e(Object.assign(a,r&&{children:r}),n)}return t.inheritAttrs=!1,t},u=(...e)=>e.map((e=>h(e)?Object.entries(e).filter((([,e])=>e)).map((([e])=>e)):e)).flatMap((e=>e)).filter(Boolean).join(" "),h=e=>Boolean(e&&"object"==typeof e&&!Array.isArray(e)),p={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white",gray:"bg-main-divider text-primary-text",transparent:"bg-transparent text-primary-text","":""},g=d((({className:e,version:t="primary",isTheme:n=!0,defaultPadding:i="p-xl",padding:a,block:l,tag:r="section",role:s,children:c,style:d})=>{const m=t&&n;return o(r,{className:u("@container font-sans",{group:m},p[t],a||i,e),...m?{"data-ver":t}:{},...l?.anchor?{id:l.anchor}:{},role:s,style:d,children:c})})),f=d((({className:e,size:t})=>o("figure",{className:u("m-0 mt-xl min-w-[80%]",e),children:x(t)}))),x=(e=3)=>b(100,e).map((e=>Math.floor(e))).map(y),y=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),b=(e,t)=>[e].concat(t>0?b(e/1.618,t-1):[]),v={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},N=d((({className:e="",headingType:t="h3",as:n="h3",title:i,children:a})=>o(n,{role:"heading",className:u("font-sans m-0",v[t],e),children:i||a}))),w=d((({children:e,...t})=>o("p",{className:u("font-sans",Object.values(t)),children:e}))),C={XXL:{title:{headingType:"h0",as:"h1"},descriptionSize:"text-h5",descriptionWeight:"font-normal",descriptionStyle:"mt-xl"},XL:{title:{headingType:"h1",as:"h1"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},L:{title:{headingType:"h2",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},M:{title:{headingType:"h3",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-s"},S:{title:{headingType:"h4",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-xs"},XS:{title:{headingType:"h5",as:"h2"},descriptionSize:"text-m",descriptionWeight:"font-light",descriptionStyle:"mt-xs"}},S=d((({className:e,version:t="",headlineVersion:n="XL",title:i,description:a,align:l="text-center",as:r,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=C[n],p={marginTop:h.descriptionStyle};return c(g,{className:u({"@container-normal":s},e),defaultPadding:s?"":"p-6xl",version:t,isTheme:d,...m,children:[i?o(N,{className:u("whitespace-pre-wrap",l),...h?.title,as:r||h?.title.as,title:i}):null,a?o(w,{size:h.descriptionSize,font:h.descriptionWeight,align:l,...p,children:a}):null]})})),k=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),I=[];function T(e,t,{className:n,...i}={}){const{key:a,blockDecorator:l=k,blocksRegistry:r={},ancestors:s=I}=t,{type:c}=e;c&&c in r||console.warn(`No block with "${c}" is registered`);const d=c&&r[c];return l({blockClassName:u(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:l})=>{const{content:r}=n;return d?o(d,{className:l,block:e,options:t,...r,...i},a):null}},a)}const B=[],P=(e,{key:t,ancestors:n=B,slotName:i=null,extraProps:a,renderProps:l=T,...r})=>{const s=a?(e,t)=>T(e,t,a):l;return(e||[]).map(((e,a)=>s(e,{...r,key:`${t||e.type}-${a}`,ancestors:r.parent?[...n||B,[r.parent,i]]:n},a)))};function R({block:e,options:t,children:n,extraProps:i,renderProps:a}){return n||(e&&t?P(e.blocks,{...t,parent:e,extraProps:i,renderProps:a}):null)}function D(){return D._impl()}D._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),D.setup=e=>{D._impl=e};const M=["CDN","BASE_PATH"],_=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return M.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),A=e=>Boolean(e?.includes(":")),E=(e,t)=>Boolean(e&&!A(e)&&(!t||"_self"===t)),z=e=>Boolean(e?.startsWith("#")),O=e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),F=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),V=(e,t)=>!(!e||!t)&&(!!e.startsWith(t)&&["/"===t,e===t,"/"===e[t.length]].some(Boolean));var L=Object.freeze({__proto__:null,isURL:A,isLocalURL:E,isHash:z,withoutQuery:O,joinPath:F,hasPrefix:V});const j="/api/",q=`${j}v1/storage`,$=e=>(t,n)=>{if([!t,A(t),z(t),[_.CDN,j].some((e=>V(t,e)))].some(Boolean))return t;if(((e="")=>/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}(\/revs\/[0-9]{1,20})?$/.test(e))(t))return`${q}/${t}/attachment`;const i=t?.startsWith("/");return F(V(t,n)?"":n,i?"/":e.pathname?.split("/").slice(0,-1).join("/"),t)},U={"":"",normal:"",color:"text-primary-main",black:"text-black",white:"text-black",gray:"text-gray"},W=d((({className:e="",imageClassName:t="",name:n="",alt:i=`Иконка ${n}`,title:a=i,iconVersion:l="color",width:r,height:s})=>{const d=D(),m="normal"===l?`${n}.svg`:`sprites.svg#${n}`,h=$(d)(F(_.CDN,"/icons/",m));return"normal"===l?o("img",{className:e,src:h,alt:i,title:a,"aria-hidden":"true",width:r,height:s,style:H(e,s)}):o(K,{className:e,children:c("svg",{className:u(Y(r),U[l],{invert:"white"===l},t),width:r,height:s,"aria-hidden":"true",children:[a?o("title",{children:a}):null,i?o("desc",{children:i}):null,o("use",{href:h,xlinkHref:h})]})})})),H=(e,t)=>{return e?.includes("h-")?{}:{height:(n=t,n&&!/\D/.test(n)?`${t}px`:t),width:"auto"};var n},Y=e=>e?"":"w-full h-full",K=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),G=new Proxy({_:{},setup(e){this._=e}},{get:(e,t)=>e._[t]||e[t]});function X(e=""){try{return new URL(e).pathname}catch(e){return""}}const J=e=>t=>{const n=t?.startsWith("/wcms-resources")?"":X(G.SITE_URL);return t&&!A(t)?$(e)(t,n):t},Z=(e,t)=>e?.media&&t?.media?e.media-t.media:0,Q=d((({className:e="",image:t,imageClassName:n=""})=>{const i=D();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(Z).map((({src:e,format:n,media:a},l)=>o("source",{srcSet:J(i)(e),type:te(n),media:a?`(max-width: ${a}px)`:"",width:t?.size?.width,height:t?.size?.height},`${l}_${e}`))):null,t?.src?ee({...t,src:J(i)(t.src)},n):null]})})),ee=(e,t="")=>o("img",{src:e.src,className:u("object-contain",t),alt:e?.alt||e?.title||"",title:e?.title||"",style:{width:e?.size?.width?`${e.size?.width}px`:"100%",height:e?.size?.height?`${e.size?.height}px`:"auto"},width:e?.size?.width,height:e?.size?.height}),te=e=>e?`image/${String(e)}`:void 0,ne=d((({className:e="",image:t,imageClassName:n="",...i})=>t?.src||t?.icon?t.icon?o(W,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...i}):o(Q,{className:e,imageClassName:n,image:t}):null)),ie={primary:"text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active",secondary:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active",white:"text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main",link:"text-primary-main",transparent:"",gray:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active","":""},ae="bg-main-divider text-main-disabled",le={primary:ae,secondary:ae,white:ae,link:"",transparent:"",gray:ae,"":""},re="text-center font-sans select-none",se={primary:"group-hover/btn:brightness-0 group-hover/btn:invert",secondary:"group-hover/btn:brightness-0 group-hover/btn:invert",white:"group-hover/btn:brightness-0 group-hover/btn:invert",link:"text-primary-main",transparent:"",gray:"group-hover/btn:brightness-0 group-hover/btn:invert","":""},oe=({className:e,rounded:t,version:n})=>[re,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",n?ie[n]:"",t?"rounded-full":"rounded-md",e].join(" "),ce=e=>ce._impl(e);ce._impl=e=>e,ce.setup=e=>{ce._impl=e};class de{watchers=new Set;subscribersMap={};subjectsStateMap={};emitter=this;observable=this;watch(e){return this.watchers.add(e),()=>{this.watchers.delete(e)}}subscribe(e,t){this.subscribersMap[e]||=new Set,this.subscribersMap[e]?.add(t);const n=this.subjectsStateMap[e];return n&&t(n),()=>{this.subscribersMap[e]?.delete(t)}}fire(e,t){e in this.subjectsStateMap?this.subject(e,t):this.fireSubscribers(e,t)}subject(e,t){return this.subjectsStateMap[e]!==t&&(this.subjectsStateMap[e]=t??void 0,this.fireSubscribers(e,t)),()=>{delete this.subjectsStateMap[e]}}fireSubscribers(e,t){for(const n of this.subscribersMap[e]??[])n(t??null);for(const n of this.watchers)n({type:e,event:t??null})}}const me=new de,ue=()=>({open:(e,t={})=>me.fire("dialog",{type:"open",dialog:e,...t}),close:()=>me.fire("dialog",{type:"close"}),closeAll:()=>me.fire("dialog",{type:"close",all:!0})});function he(){const e=X(G.SITE_URL),t=D(),{closeAll:n}=ue();return e=>{const n=$(t)(e.href);return{...e,href:n,"aria-label":e.text,onClick:ce(i({...e,href:n}))}};function i({href:i,target:a,onClick:l}){return r=>{l?.(r),pe(i,a,e)||(n(),r?.preventDefault(),t.push(((e,t="")=>e?.replace(t,"")||"/")(i,e)))}}}const pe=(e,t,n)=>{if(!E(e,t))return!0;const i=G.SUB_PORTALS?.split(",");return!!i?.some((t=>V(e,t)))||!V(e,n||"/")},ge=e=>{if(!Array.isArray(e)||!e.length)return{};try{return{"data-aspects":JSON.stringify(e)}}catch(e){return{}}},fe=d((e=>{const{text:t,aboveText:n,appendLeft:i,appendRight:a,version:l="primary"}=e,r=ye(e)&&"hidden lg:block";return c("div",{className:u(xe(e),"flex gap-xs"),children:[i?o("div",{className:u(r,se[l]),children:i}):null,ye(e)?c("div",{className:"whitespace-pre",children:[n?o("div",{className:"text-xs font-light text-left",children:n}):null,o("div",{className:"text-left "+(n?"text-s -mt-3xs":"text-l"),children:t})]}):null,a?o("div",{className:u(r,se[l]),children:a}):null]})})),xe=e=>{const{version:t,aboveText:n,rounded:i}=e;if("link"===t)return"";const a=""+(n?"py-2.5 px-9":"py-4 px-9");return u("group/btn items-center justify-center",ye(e)?a:"h-12 w-12 m-auto",{"rounded-full":i})},ye=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),be=({className:e,rounded:t,version:n})=>["inline-block",re,n?le[n]:"",t?"rounded-full":"rounded-md",e].join(" "),ve=d((({disabled:e,children:t,method:n="LINK",href:i,...a})=>{const r=(({method:e,href:t})=>l((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:i,pathname:a,searchParams:l}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[i,a].join(""));for(const[e,t]of l.entries()){const n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t),r.appendChild(n)}document.body.appendChild(r),r.submit()}),[]))({method:n,href:i}),s=he()({onClick:r,href:i,...a}),c=t??o(fe,{...s});return o(e?we:Ne,{...s,children:c})})),Ne=d((({className:e="",href:t,rel:n,target:i,ariaLabel:a,version:l,rounded:r,onClick:s,type:c,data:d,children:m,text:u})=>o("a",{className:oe({className:e,version:l,rounded:r}),href:t,rel:n,target:i,"aria-label":a||`Ссылка на ${u}`,role:t?"link":"button",onClick:s,type:c,...ge(d),children:m}))),we=d((({className:e,ariaLabel:t,version:n,rounded:i,children:a})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:be({className:e,rounded:i,version:n}),children:a})));function Ce({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:i=!1}){if(!n)return null;const a="primary"===e?"white":"black",l="primary"===e?"bg-primary-main":"bg-white";return c("div",{className:u(i?"flex":"hidden sm:flex","items-center gap-s"),children:[o("div",{className:u(oe({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",rounded:!0}),l),onClick:t,children:o(ne,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:a}})}),o(ve,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const Se=()=>{const[e,t]=i(false);return a((()=>{const e=globalThis.matchMedia?.("(max-width: 1024px)"),n=()=>{t(Boolean(e?.matches))};return e?.addEventListener("change",n),e?.matches&&t(Boolean(e.matches)),()=>{e?.removeEventListener("change",n)}}),[]),e},ke={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},Ie=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&ke[n],t),children:e}):null,Te=d((({className:e,version:t="primary",defaultPadding:n,padding:i="",title:a,buttons:r,leftImage:s,rightImage:d,imageAlign:m,insetTitle:h,isImageAlwaysOnRight:p=!1,isImageSecondary:g=!1,backwardButton:f,children:x,...y})=>{const b=Se(),v=D(),N=l((()=>v.back()),[]),w=y.options?.page?.common?.backwardButton,C=f&&!b;return c("div",{className:u("relative flex flex-col gap-3xl overflow-hidden",i||n,e),children:[C&&Ce({version:t,handleClick:N,text:w}),a?o("div",{className:"relative h-full",children:a}):null,c("div",{className:u("grow relative flex flex-col @xl:flex-row gap-3xl w-full",{"self-start @xl:w-auto":s}),children:[Ie(s,{imageAlign:m,className:"mx-auto"}),c("div",{className:u("grid gap-3xl items-center md:items-stretch",{"@xl:grid-cols-2 auto-cols-fr":d,grow:!s},"h-full","auto-rows-[max-content_1fr]"),children:[c("div",{className:"grow space-y-lg min-w-fit",children:[h,x]}),Pe(R({...y,extraProps:{className:"@container-normal"}})),Ie(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[Be(p)]:r,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),r?o("div",{className:"self-end",children:r}):null]})]})]})})),Be=e=>u(e?"row-span-2":"@xl:row-span-2"),Pe=e=>e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,Re=(e,t="normal")=>e?.icon||e?.src?o("div",{className:u("sm:w-12 sm:h-12 sm:min-w-12 w-11 h-11 min-w-11 box-border flex items-center justify-center rounded-icon","normal"===t?"bg-secondary-light text-primary-main":"bg-primary-main text-black group-data-secondary:bg-white/30 group-data-secondary:text-black"),children:o(ne,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,De=d((e=>{const{__html:t="",richVersion:n="",itemSize:i="list-m",isDotted:a=!0}=e,l=a?"":"without-dots";return t&&"<p><br></p>"!==t.replace(/<\/?[^>]+\/?>/g,"").trim()?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(n,i,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",l),dangerouslySetInnerHTML:{__html:t}})}):null})),Me=(e,t)=>e?o(w,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,_e=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),Ae=(e,t)=>e?o(_e,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,Ee=(e,t)=>["label"in e?Ae(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:Me(e.description,t)},String(t)):null,"__html"in e?o(De,{...e},`rte-${t}`):null],ze=d((({className:e,benefitsVersion:t,...n})=>c("div",{className:u("flex gap-m min-w-56 items-center",e),role:"listitem",children:["icon"in n?Re(n.icon,t):null,o("div",{children:Ee(n)})]}))),Oe=d((({className:e,benefitsVersion:t="normal",benefits:n})=>n?.length?o("div",{className:u("flex gap-x-m gap-y-s flex-col",e),role:"list",children:n.map(((e,n)=>o(ze,{benefitsVersion:t,...e},String(n))))}):null)),Fe=d((({className:e,benefits:t})=>t?.length?o("div",{className:u("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),role:"list",children:t.flatMap(Ee)}):null)),Ve=d((({isTabularBenefits:e,...t})=>o(e?Fe:Oe,{...t}))),Le=e=>Boolean(e?.src||e?.icon),je=(e,{className:t,buttonClassName:n,isVertical:i}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:u("flex",i?"flex-col gap-xs justify-items-stretch":"flex-wrap @xl:flex-nowrap gap-lg sm:gap-m w-full @lg:w-auto",t),role:"group",children:e.map(qe(n))}):null,qe=(e="")=>(t,n)=>{const{text:i,icon:a,iconRight:l,version:r,...s}=t||{},c=$e(a,r),d=$e(l,r);return i||a?.icon?o(ve,{className:u("basis-full @lg:basis-auto",e),appendLeft:Ue({...a,iconVersion:c}),appendRight:Ue({...l,iconVersion:d}),version:r,text:i,...s},n?String(n):""):null},$e=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},Ue=e=>Le(e)&&o(ne,{image:e,width:String(e?.size?.width||24),height:String(24)}),We=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),He=d((({priceList:e})=>e?.length?o("div",{className:"flex flex-wrap xl:flex-nowrap xl:bg-main-divider xl:rounded-md p-xs gap-xl",role:"list",children:e.map(Ye)}):null)),Ye=({label:e,amount:t,unit:n},i)=>c("div",{className:"basis-full flex flex-col-reverse sm:flex-row sm:justify-between sm:bg-main-divider sm:py-m sm:px-lg sm:rounded-md items-baseline whitespace-pre",role:"listitem",children:[o(_e,{font:"font-light",size:"text-l",color:"text-secondary-text",children:e}),t?c("span",{className:"font-sans text-h6 sm:text-primary-main text-primary-text",children:[We(2)(t)," ",n||"₽"]}):null]},String(i)),Ke=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(Ge)}):null)),Ge=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(_e,{size:"text-m",font:"font-light",children:e})},String(t)),Xe={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},Je=d((({className:e,padding:t,defaultPadding:n,title:i,description:a,headlineVersion:l="L",align:r="text-left",benefitsVersion:s,isTabularBenefits:d,isDotted:m=!0,benefits:u,__html:h,richVersion:p,isFullWidthTitle:g,priceList:f=[],tags:x=[],buttons:y,image:b,imageOptions:{imageAlign:v="center",directionRight:N=!0,isImageAlwaysOnRight:w,isImageSecondary:C=!1}={},backwardButton:k,children:I,...T})=>{const B=b?.src?o(ne,{image:b}):null,P=o(S,{title:i,description:a,headlineVersion:l,align:r,isEmbedded:!0}),R=u?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Te,{className:e,padding:t,defaultPadding:n,...g?{title:P}:{insetTitle:P},...Ze(B,N),isImageSecondary:C,imageAlign:v,isImageAlwaysOnRight:w,buttons:je(y),backwardButton:k,...T,children:c("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[R?.length?o(Ve,{benefitsVersion:s,isTabularBenefits:d,benefits:R}):null,h?o(De,{richVersion:p,__html:h,isDotted:m,itemSize:Xe[l]}):null,I,f?.length?o(He,{priceList:f}):null,Qe(x)]})})})),Ze=(e,t)=>t?{rightImage:e}:{leftImage:e},Qe=e=>e?.length?o(Ke,{tags:e}):null;class et{_;constructor(e){this._=e}of(e){return new this.constructor(e instanceof et?e._:e)}filter(e){return this.from(this.entries().filter(e))}map(e){return this.from(this.entries().map(e))}flatMap(e){return this.from(this.entries().flatMap(e))}reduce(e,t){return this.entries().reduce(e.bind(this),t)}}const tt=()=>!0,nt=(e,t)=>(...n)=>e(...n)&&t(...n),it=(...e)=>(...t)=>{const[,n]=function(e){if(!e)throw new Error("Value should be fulfilled");return e}(e.find((([e])=>e(...t))));return n(...t)};const at=e=>Boolean(e&&Array.isArray(e)),lt=e=>Boolean(e&&"object"==typeof e&&!at(e)),rt=e=>e;function st(e){return e instanceof et?e._:e}class ot extends et{from(e){return this.of(e.map(((e=rt)=>([,t])=>e(t))(st)))}entries(){return(this._??[]).map(((e,t)=>[t,this.of(e)]))}size(){return this._?.length??0}get(e){return this.of("number"==typeof e?this._?.[e]:void 0)}set(e,t){return this.of(at(this._)?Array.from({length:Math.max(this._.length,Number(e)+1)},((n,i)=>i===e?t:this._[i])):Array.from({length:Number(e)+1},((n,i)=>i===e?t:void 0)))}}class ct extends et{from(){return this}entries(){return[]}size(){return 0}get(e){return this.of(void 0!==e?void 0:this._)}set(e,t){return this.of(t)}}class dt extends et{from(e){return this.of(Object.fromEntries(e.map((([e,t])=>[e,st(t)]))))}entries(){return Object.entries(this._??{}).map((([e,t])=>[e,this.of(t)]))}size(){return Object.keys(this._??{}).length}get(e){return this.of("string"==typeof e?this._?.[e]:void 0)}set(e,t){return this.of({...this._,[e]:t})}}class mt extends et{proto=it([e=>at(this._)||"number"==typeof e,()=>ot.prototype],[e=>lt(this._)||"string"==typeof e,()=>dt.prototype],[tt,()=>ct.prototype]);from(e){return this.proto(void 0).from.call(this,e)}entries(){return this.proto(void 0).entries.call(this)}size(){return this.proto(void 0).size.call(this)}get(e){return this.proto(e).get.call(this,e)}set(e,t){return this.proto(e).set.call(this,e,t)}}const ut=e=>e instanceof et?e:new mt(e),ht=e=>{const t=(t,...n)=>st(e(ut(t),...n));return t.fn=e,t},pt=[],gt=e=>e instanceof Function?e:t=>e===t,ft=e=>(t,n,i=pt)=>ut(t).entries().reduce(((t,[n,a])=>ft(e)(a,t,i.concat(n))),e(n,[i,ut(t)])),xt=ht(((e,[t,n])=>{const[i,...a]=t;return e.set(i,a.length?xt(e.get(i),[a,n]):n)})),yt=ht(((e,t)=>t.reduce(xt.fn,e))),bt=e=>ft(((e,[t,n])=>vt(n)?[...e,[t,st(n)]]:e))(e,[]),vt=e=>0===e.size();ht(((e,t=pt)=>t.reduce(((e,t)=>e.get(t)),e)));const Nt=ht(((e,[t,...n])=>n.length?e.set(t,Nt(e.get(t),n)):e.filter((([e])=>e!==t)))),wt=(Ct=["$ref"]).map(((e,t)=>n=>gt(e)(n[t+n.length-Ct.length]))).reduceRight(nt,tt);var Ct;const St=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(kt,e),kt=it([at,(e,t)=>e[parseInt(t,10)]],[lt,(e,t)=>e[t]],[tt,rt]),It=(e,t)=>((e,t={})=>n=>yt(t,bt(n).map((t=>e(t)))))((([e,n])=>{return wt(e)?[(i=e,i.slice(0,-1)),St(t(n),n)]:[e,n];var i}))(e),Tt=e=>bt(e).filter(((e=rt)=>([t])=>e(t))(wt)),Bt=e=>{return t=Tt(e).map((([,e])=>e)),[...new Set(t)];var t};async function Pt(e,t){try{return e?await Rt(e,t):null}catch(e){console.error(e)}return null}const Rt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),Dt=e=>[...new Set(e)],Mt={},_t=["/portal-resources"],At=(e,t)=>It(e,(e=>t?.[e])),Et=(e,t)=>{const n=Bt(e),[l,r]=i({});return a((()=>{n.length&&(async e=>Object.fromEntries((await Promise.allSettled(Dt(e).filter((e=>!_t.some((t=>e.startsWith(t))))).map((async e=>[e,Mt[e]||=await Rt(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(n).then(r)}),[n.join()]),n.length?At(e,{...t,...l}):e};function zt(e,t={}){const n=d((t=>{const n=Et((({block:e,options:t,className:n,defaultPadding:i,padding:a,isTheme:l,version:r,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...n})}));return Object.assign(n,t),n}const Ot=zt((({className:e,padding:t,defaultPadding:n,...i})=>o(g,{className:u("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...i,children:o(Je,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...i})})),{childrenTypes:["UnitBlock"]}),Ft=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=r((()=>Vt(0,t?.length)),[t]),i=t?.[n];return i?o(Ot,{suppressHydrationWarning:!0,...i,...e}):o(g,{...e,children:o(f,{})})})),Vt=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),Lt=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const n=String(e.getDate()).padStart(2,"0"),i=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getFullYear());return t?`${a}-${i}-${n}`:`${n}.${i}.${a}`}},jt=e=>e?.replace(/[^+\d]/g,"");const qt=e=>e?{phone:jt(e)}:{},$t=(e,t="birthday")=>e?{[t]:Lt(e)}:{},Ut=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),Wt=(e,t=!0)=>({[t?"email":"mail"]:e}),Ht=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:jt(e)}:{},Yt=({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:i,params:a}of e)t[i??""]?.(n,a)};function Kt(){return Kt._impl()}Kt._impl=()=>({assign:(e,t)=>{globalThis.open(e,t||"_self")},get origin(){return globalThis.location.origin},get href(){return globalThis.location.href}}),Kt.setup=e=>{Kt._impl=e};const Gt="rshb-query-params";function Xt(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(Gt)||"";return e&&globalThis.sessionStorage?.setItem(Gt,e),e}const Jt=e=>{const t=e.target?.closest("a"),n=Kt();if(A(t?.href)&&!t?.href?.startsWith(n.origin)){e.preventDefault(),e.stopPropagation();const i=(e=>{const t=Xt();if(!A(e)||!t)return e;const n=new URL(e);for(const[e,i]of new URLSearchParams(t))n.searchParams.set(e,i);return n.toString()})(t?.href)||t?.href;i&&n.assign(i,t?.target)}};function Zt(){return Zt._impl()}Zt._impl=()=>({forwardQuery:Jt}),Zt.setup=e=>{Zt._impl=e};const Qt=e=>e,en=(e,{resetOnSubmit:t,onSubmit:n,normalize:r}={})=>{const[s,o]=i(e),c=l(r?e=>o(e instanceof Function?t=>{const n=r(e(t));return tn(t,n)?t:n}:r(e)):o,[r]);a((()=>{r&&o(r)}),[r]);const[d,m]=i(!1),[u,h]=i({}),p=l(((e,t)=>{const{parse:n=Qt,format:i=Qt}=t||{};return{value:i(s[e]),isDirty:d||u[e],onChange:t=>{c((i=>({...i,[e]:n(t)}))),h((t=>({...t,[e]:!0})))}}}),[c,d,u]),g=l((e=>{c(e),h(e)}),[]),f=l((()=>{c(e),m(!1),h({})}),[e]),x=l((e=>(e.preventDefault(),t?f():m(!0),n&&n(s,e),s)),[n,s]);return[s,{isDirty:d||Object.values(u).some(Boolean),field:p,update:g,reset:f,onSubmit:x}]},tn=(e,t)=>e&&t&&Object.keys({...e,...t}).every((n=>e[n]===t[n])),nn=d((e=>{const{className:t,title:n,children:i,...a}=e;return o(g,{className:t,defaultPadding:"p-6xl",...a,children:c("div",{className:"container max-w-[978px] space-y-lg",children:[n?o(N,{headingType:"h3",title:n,className:"@xl:text-center"}):null,i]})})})),an=e=>"OUTSERVICE"===e?"/api/v1/outservice/outserviceregions":void 0;function ln(e=!1){const[t,n]=i(e),a=l((()=>n(!0)),[]),r=l((()=>n(!1)),[]),s=l((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:a,setFalse:r,toggle:s}]}function rn(e,t,n,i){a((()=>{if(e&&n)return e.addEventListener(t,n,i),()=>{e.removeEventListener(t,n,i)}}),[e,t,n])}function sn(e){const t=s(null),n=l((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return rn(globalThis.document,"click",n),t}const on=({label:e,errors:t})=>e&&t?`${e}*`:e,cn=()=>{},dn="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",mn=e=>e?o(_e,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,un=d((({key:e,className:t="",id:n,name:i,type:r="text",label:d,placeholder:m,value:h="",valid:p=!0,children:g,onChange:f,onFocus:x,onBlur:y,pattern:b,autoFocus:v=!1,isTextarea:N=!1,disabled:w=!1})=>{const C=s(null),S=l((e=>{const t=(e.target?.value||"").trimStart();f&&f(t)}),[f]);a((()=>{v&&C.current?.focus()}),[v,C]);const k=g?"pr-3xl":"",I=hn(p);return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[mn(d),N?o("textarea",{className:u("block resize-y min-h-24",pn,I),id:u("textarea",n),name:i||n,placeholder:m,value:h,onChange:S,onFocus:x,onBlur:y,disabled:w},e):o("input",{type:r,className:u("h-14",pn,k,I),ref:C,id:n,name:i||n,placeholder:m,value:h,onChange:S,onFocus:x,onBlur:y,pattern:b,disabled:w},e)]}),g]})})),hn=e=>e?dn:"border-error",pn="w-full border rounded-md text-primary-text outline-none p-m",gn=e=>o("div",{className:"h-6",children:e?o(_e,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),fn=e=>e?.value||"",xn={url:"suggest/address"},yn={name:{url:"suggest/fio",requestData:{parts:["NAME"],gender:"UNKNOWN"}},surname:{url:"suggest/fio",requestData:{parts:["SURNAME"],gender:"UNKNOWN"}},middleName:{url:"suggest/fio",requestData:{parts:["PATRONYMIC"],gender:"UNKNOWN"}},email:{url:"suggest/email"},dulSubdivisionCode:{url:"suggest/fms_unit",responseItemHandler:e=>e?.data?.code?.replace("-","")||""},dulIssuedBy:{url:"suggest/fms_unit"},organizationName:{url:"suggest/party"},inn:{url:"suggest/party",responseItemHandler:e=>e?.data?.inn||""},addressRegistration:xn,addressFact:xn,organizationAddress:xn,addressCourier:xn},bn=()=>({open:(e,t)=>me.fire("popup",{type:"open",popup:e,...t}),update:(e,t)=>me.fire("popup",{type:"update",popup:e,...t}),close:()=>me.fire("popup",{type:"close"})}),vn=d((({options:e,onChange:t})=>o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",children:e?.map(((e,n)=>o("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem",onMouseDown:()=>t(e),children:o("span",{className:"min-h-6",children:e.processedValue})},n.toString())))})));function Nn({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),h=s(t),[p,g]=i([]),f=bn(),x=yn[n],y=l((()=>{h.current=t,f.close()}),[t]),b=l((e=>{y(),h.current=e.processedValue,c&&c(e.processedValue),d&&d(e)}),[y,c]),v=s(null),N=r((()=>async e=>{if(!x)return;const t=await(e=>{const{url:t,query:n,queryPrefix:i,requestData:a={},responseItemHandler:l=fn}=e,r=(s=l,e=>(e?.suggestions||[]).map((e=>{const t=s(e);return{...e,processedValue:t}})));var s;const o=`${i?`${i}, `:""}${n}`;return fetch(`/api/v1/suggestions/${t}`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:10,...a,query:o})}).then((e=>e.json())).then(r)})({url:x.url,responseItemHandler:x.responseItemHandler,requestData:{...x?.requestData},query:e,queryPrefix:m});t?.length&&g(t)}),[m]),w=r((()=>((e,t=600)=>{let n;const i=(...a)=>{i.dispose(),n=setTimeout((()=>{e(...a)}),t)};return i.dispose=()=>{n&&clearTimeout(n)},i})(N,300)),[N]);return a((()=>{if(!e||!v.current||h.current===t)return void y();const n=v.current,{top:i,left:a,width:l,height:r}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.update(o(vn,{options:p,value:t,onChange:b}),{top:i+globalThis.scrollY+r,left:a,width:l})}),[e,p,t,b]),v}const wn=d((({className:e,label:t,value:n="",placeholder:i,error:a,errors:r,onChange:s=cn,onDaDataChange:d,onBlur:m,isTextarea:h,type:p,name:g="",daDataQueryPrefix:f,maxLength:x,dadata:y=!1,disabled:b=!1})=>{const[v,{setFalse:N,setTrue:w}]=ln(),C=sn(N),S=l((e=>{y&&!v&&w(),x?e.length<=x&&s(e):s(e)}),[y,v,s]),k=Nn({isOpen:v&&y,name:g,value:n,daDataQueryPrefix:f,onChange:s,onDaDataChange:d});return c("div",{className:u("shrink-0 w-full",e),ref:C,onBlur:N,onFocus:w,children:[o("div",{ref:k,children:o(un,{disabled:b,type:p||"text","aria-label":t,label:on({label:t,errors:r}),valid:Boolean(!a),value:n,onChange:S,onBlur:m,isTextarea:h,placeholder:Cn(i,r,t)})}),gn(a)]})})),Cn=(e,t,n)=>t&&!n?`${e}*`:e,Sn=e=>e?.text||e?.key||"",kn=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,In=d((({popupRef:e,options:t,value:n,query:i,onChange:a,iconVersion:l})=>t?.length?o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",ref:e,children:kn(t,i).map((e=>c("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem","aria-selected":e.key===n?.key,onClick:t=>{t.stopPropagation(),a&&a(e)},children:[o("span",{className:"min-h-6",children:Sn(e)}),o(W,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:l,className:u("absolute right-4 pt-3xs",{hidden:e.key!==n?.key})})]},e.key)))}):null));const Tn=d((({className:e,label:t,options:n=[],value:r,valid:d=!0,isBorder:m=!0,placeholder:h="",isSearch:p=!1,iconVersion:g="black",onChange:f,disabled:x=!1})=>{const[y,{setFalse:b,setTrue:v}]=ln(),[N,w]=i(""),C=Rn(x,n.length),S=y&&!C,k=l((()=>{w(""),b()}),[]),I=function({isOpen:e,options:t,value:n,query:i,onChange:r,onClose:c,iconVersion:d}){const m=bn(),u=l((()=>{m.close(),c&&c()}),[c]),h=l((e=>{u(),r&&r(e)}),[u,r]),p=s(null),g=sn(u);return a((()=>{if(!e||!p.current)return;const a=p.current,{top:l,left:r,width:s,height:c}=a.getBoundingClientRect();m.update(o(In,{popupRef:g,options:t,value:n,query:i,onChange:h,iconVersion:d}),{top:l+window.scrollY+c,left:r,width:s})}),[e,t,n,i,h]),p}({isOpen:y,options:n,value:r,query:N,onChange:f,onClose:k,iconVersion:g});return c("div",{className:u("space-y-xs",e),children:[mn(t),c("div",{className:u("relative",S?"z-20":"z-10"),ref:I,children:[c("div",{className:u("h-14 [&>*]:p-m pr-6 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden",Pn(m,d,C)),onClick:S?k:v,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:Sn(r)||h}),Bn(S,g)]}),p&&S?o("div",{className:u("absolute top-0 w-full z-20"),children:o(un,{type:"text",autoFocus:!0,value:N,onChange:w})}):null]})]})})),Bn=(e,t)=>o(W,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),Pn=(e,t,n)=>u(e?"border rounded-md ":"",e&&!n?"hover:border-primary-hover":"",n?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error"),Rn=(e,t)=>e||0===t,Dn=d((({className:e="",label:t,error:n,errors:i,...a})=>c("div",{className:e,children:[o(Tn,{...a,valid:!n,label:on({label:t,errors:i})}),gn(n)]}))),Mn=e=>!e?.length,_n=e=>t=>n=>e(n)?[]:[t],An=_n((e=>null!=e&&""!==e)),En="Некорректно заполненное поле",zn="Укажите регион, город/населенный пункт, улицу, дом",On=e=>An(e??En),Fn=e=>_n((e=>e?.key&&""!==e?.key))(e??En),Vn=e=>_n((e=>"string"==typeof e&&e.length>0&&e.length<=2))(e??En),Ln=e=>_n((e=>"string"==typeof e&&e.length>1&&Gn(e)))(e??En),jn=(e,t)=>_n((t=>"string"==typeof t&&t.length>=1&&t.length<=e))(t??En),qn=e=>_n((e=>"string"==typeof e&&6===e.length))(e),$n=e=>{return(t=/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/,_n((e=>"string"==typeof e&&t.test(e))))(e);var t},Un=_n((e=>"boolean"==typeof e&&e))("Согласие обязательно"),Wn=e=>{const t=String(e).replace(/[^0-9]+/g,"");if(11===t.length){let e=0;for(let n=0;n<9;n++)e+=parseInt(t.charAt(n))*(9-n);return e>101&&(e%=101),100!==e&&101!==e||(e=0),e===parseInt(t.substr(9))}return!1},Hn=e=>Boolean(e.region&&e.city&&e.house),Yn=()=>_n(Hn)(zn),Kn=/^[\u0400-\u04FF\d]+$/u,Gn=(e="")=>Kn.test(e),Xn=e=>{const t=new Date,n=new Date(t.getFullYear()-23,t.getMonth(),t.getDate()),i=new Date(t.getFullYear()-75,t.getMonth(),t.getDate());return!(!e||e>n||e<i)},Jn={typeForm:On(),surname:Ln("Укажите свою фамилию"),name:Ln("Укажите своё имя"),middleName:Ln("Укажите своё отчество"),region:Fn(),addressBranch:Fn(),phone:$n("Укажите номер телефона"),secondaryPhone:$n("Укажите номер телефона"),organizationPhone:$n("Укажите номер телефона"),birthday:On("Укажите дату рождения"),limitedBirthday:_n(Xn)("Допустимый возраст заёмщика - от 23 до 75 лет"),birthPlace:On("Укажите место рождения"),education:On("Выберите ваше образование"),housing:On("Выберите тип жилья"),employment:On("Выберите информацию о трудоустройстве"),organization:On("Выберите тип организации"),amountWorkers:On("Выберите информацию о количестве сотрудников"),employerActivities:On("Выберите вид деятельности организации"),employerOrganization:On("Выберите вид организации"),positionOrganization:On("Выберите вашу должность"),dulSerie:(Zn="Укажите серию паспорта",_n((e=>"string"==typeof e&&4===e.length))(Zn)),dulNumber:qn("Укажите номер паспорта"),dulIssueDateField:On("Укажите дату выдачи паспорта"),dulSubdivisionCode:qn("Укажите код подразделения"),dulIssuedBy:On("Укажите организацию, выдавшую паспорт"),email:(e=>_n((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(e))("Укажите электронную почту"),fullName:Ln(),inn:(e=>_n((e=>"string"==typeof e&&(10===e.length||12===e.length)))(e))("Укажите ИНН"),legalForm:On("Укажите ОПФ"),organizationName:On("Укажите наименование организации"),generalSeniority:Vn("Укажите количество лет стажа"),lastJobExperience:Vn("Укажите стаж на последнем месте работы"),experience5Years:Vn("Укажите общий стаж за последние 5 лет"),jobsNumber:Vn("Укажите количество мест работы за последние 5 лет"),beginDate:On("Укажите дату заключения трудового договора"),addressFact:Yn(),partnerComments:On(),collectionCount:On(),comment:On(),acquiringType:Fn(),feedbackMethod:Fn(),serviceType:Fn(),serviceDirection:Fn(),regionRetail:Fn("Выберите регион"),meetingDay:On(),product:On(),localities:On(),consentDataProcessing:Un,annualRevenue:On(),consentToReceiveMaterials:Un,processPersonalDataFlg:Un,consentProviderFlg:Un,consentPfrFlg:Un,consentOthersFlg:Un,consentInformFlg:Un,familyStatus:On("Выберите семейное положение"),children:jn(2,"Укажите количество детей"),familyMembers:jn(2,"Укажите количество членов семьи"),dependents:jn(2,"Укажите количество иждивенцев"),totalIncome:jn(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:jn(10,"Укажите сумму обязательных выплат"),snils:(e=>_n(Wn)(e))("Некорректный номер СНИЛС"),conscription:On(),armyIdFlg:Un,sex:On("Укажите свой пол"),addressRegistration:Yn(),organizationAddress:_n((e=>Boolean(e.fiasCode&&e.city&&e.house)))(zn),participantDateRegistration:On("Укажите дату регистрации"),retirementIncome:On(),otherIncome:On(),wages:On(),mandatoryPayments:On(),disablePeopleFlg:On(),bankruptcyFlg:On(),shareholderFlg:On(),legalEntityName:On(),bankEmployeeCode:On(),partInBusiness:On(),addressRetail:Fn("Выберите адрес банка"),addressMatch:On(),codeWord:(e=>_n((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&Gn(e)))(e??En))("Необходимо ввести кодовое слово"),confirmationIncome:On(),deliveryDate:On("Укажите дату доставки"),addressCourier:Yn()};var Zn;const Qn=e=>{const t=(e=>Object.values(e.filter((e=>e)))?.map((e=>e.name)))(e.filter((e=>Boolean(e?.required))));return Object.fromEntries(t.map((e=>[e,Jn?.[e||""]])).filter((([,e])=>e)))},ei=(e,t)=>{const{value:n,isDirty:i}=e,a=i?t(n):[];return{...e,errors:a,error:a[0]}},ti=(e,t,n=!1)=>n&&t?ei(e,t):e,ni=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],ii=d((({field:e,input:t})=>o(Dn,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:ni,...ti(e("acquiringType"),Jn.acquiringType,t?.required)}))),ai=(e="")=>Boolean("trade"===e||"all"===e),li=e=>null!=e,ri=new Map,si=e=>Boolean(e?.every((e=>Array.isArray(e)?si(e):!e||"string"==typeof e))),oi=e=>si(e)?e.toString():"";function ci(e,t,{fallback:n,cache:l}={}){const s=r((()=>di(e)),[e]),[o,c]=i(void 0),[d,m]=i(void 0);a((()=>{if(!s.some(li))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await((e,t=ri)=>n=>{const i=oi(n),a=t.get(i);if(i&&li(a))return a;const l=e(...n);return i&&li(l)&&t.set(i,Promise.resolve(l)),l})(t,l)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,l,s]);const u=n&&(e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]))(s)&&n[s[0]];return{data:!o&&u?u:o,error:d,mutate:()=>Promise.resolve(void 0)}}function di(e){return Array.isArray(e)?e:e instanceof Function?di(e()):[e]}const mi=[];const ui=async e=>await Pt(e,{method:"GET"})||mi;function hi(e=!1){const{data:t}=ci("/api/v1"+(e?"/premiumBranchesByRegions":"/branchesByRegions"),Rt);return Array.isArray(t)?t:[]}const pi=d((({field:e,input:t,isPremium:n=!1})=>{const i=e("region"),l=i?.value?.key,r=i?.value?.text,s=n?hi(n)?.find((e=>e?.region===r))?.branches:function(e){const{data:t}=ci(e?`/api/v1/branches?regionCode=${e}`:null,ui);return t||mi}(l)?.filter((e=>e?.address));return a((()=>{""!==i?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[i?.value]),o(Dn,{label:"Отделение",placeholder:"Выберите отделение",options:(s||[]).map((({address:e=""})=>({key:e,text:e}))),...ti(e("addressBranch"),Jn.addressBranch,t?.required),isSearch:!0})})),gi=d((({field:e,input:t})=>{const n="addressFact",i=e(n).value,{value:r}=e("addressMatch");a((()=>{r&&e("addressFact")?.onChange?.(e("addressRegistration").value)}),[r,e("addressRegistration").value]);const s=l((t=>{e?.(n)?.onChange?.({apartment:t?.data?.flat,city:t?.data?.city,district:t?.data?.area_with_type,fullAddress:t?.value,fiasCode:t?.data?.fias_id,house:t?.data?.house,locality:t?.data?.settlement_with_type,okatoRegionCode:t?.data?.okato,postcode:t?.data?.postal_code,region:t?.data?.region,regionCode:t?.data?.region_kladr_id?t?.data?.region_kladr_id.substring(0,2):"",street:t?.data?.house,qc:t?.data?.qc,qcComplete:t?.data?.qc_complete,qcHouse:t?.data?.qc_house})}),[]),c=l((t=>{e?.(n)?.onChange?.({...e(n).value,fullAddress:t})}),[]);return o(wn,{label:"Адрес",disabled:r,...ti(e(n),Jn[n],t?.required),value:i.fullAddress,onChange:c,...t,onDaDataChange:s})})),fi=(e,t)=>Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t).value,xi=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",i=e(n).value,a=l((t=>{e?.(n)?.onChange?.({apartment:t?.data?.flat,city:t?.data?.city,district:t?.data?.area_with_type,fullAddress:t?.value,fiasCode:t?.data?.fias_id,house:t?.data?.house,locality:t?.data?.settlement_with_type,okatoRegionCode:t?.data?.okato,postcode:t?.data?.postal_code,region:t?.data?.region,regionCode:t?.data?.region_kladr_id?t?.data?.region_kladr_id.substring(0,2):"",street:t?.data?.house,qc:t?.data?.qc,qcComplete:t?.data?.qc_complete,qcHouse:t?.data?.qc_house})}),[]),r=l((t=>{e?.(n)?.onChange?.({...e(n).value,fullAddress:t})}),[]);return o(wn,{disabled:t?.filledByEsia&&fi(e,n),label:"Адрес",...ti(e(n),Jn[n],t?.required),value:i.fullAddress,onChange:r,...t,onDaDataChange:a})})),yi=d((({className:e,viewBox:t,fill:n="none",width:i,height:a,paths:l,...r})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:i,height:a,children:l.map((({d:e,fill:t,...n},i)=>{const a={...r,...n};return o("path",{d:e,fill:t||"currentColor",stroke:a.stroke,strokeLinecap:a.strokeLinecap,strokeLinejoin:a.strokeLinejoin,strokeWidth:a.strokeWidth,strokeMiterlimit:a.strokeMiterlimit},i)}))}))),bi="appearance-none w-5 h-5 border-solid flex-none",vi=[{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",fillRule:"evenodd",clipRule:"evenodd",fill:"white"}],Ni=d((({className:e,value:t,text:n,disabled:i,isRadio:a,onChange:r})=>{const s=l((e=>{i||(e.preventDefault(),r&&r(!t))}),[r,i,t]),d=a?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(yi,{paths:vi,className:"absolute left-1 ml-px block",width:"11",height:"9",fill:"white",viewBox:"0 0 11 9"});return o("div",{className:e,children:c("label",{className:u("flex items-center relative group/box",Ci(i)),onClick:s,children:[o("div",{className:u(bi,"m-0",a?"rounded-full border-2":ki(t),!i&&t?"border-primary-main":"border-gray",i?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:Si(a),"aria-checked":Boolean(t),"aria-disabled":Boolean(i),"aria-label":n}),t?d:null,wi(n)]})})})),wi=e=>e?o("div",{className:"ml-s",children:o(_e,{size:"text-l",font:"font-light",children:e})}):null,Ci=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",Si=(e=!1)=>e?"radio":"checkbox",ki=(e=!1)=>u("rounded border",{"bg-primary-main":e}),Ii=d((({className:e,text:t,value:n,key:i,disabled:a,error:l,onChange:r})=>c("div",{className:u("shrink-0",e),children:[o(Ni,{text:t,value:n,disabled:a,onChange:r},i),gn(l)]}))),Ti=d((({field:e,input:t})=>o(Ii,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...ti(e("addressMatch"),Jn.addressMatch,t?.required)}))),Bi=d((({color:e="text-primary-main",position:t="absolute",blur:n=!0})=>o("div",{className:u("flex justify-center items-center h-full w-full z-50",t,{"backdrop-blur":n}),children:o("div",{className:u("inline-block h-28 w-28","animate-spin rounded-full","border-8 border-solid border-current","border-r-transparent",e),role:"status"})}))),Pi="/icons/MapMarkerClusterIcon.svg",Ri="/icons/MapMarkerClusterYellowIcon.svg";function Di({yandexMaps:e,map:t,points:n,isLoad:i}){if(i||!n)return;if(t.geoObjects.removeAll(),!n.length)return;const a=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),l=Mi("offices",e,a);if(n.length&&n.every((e=>"type"in e))){const i=Mi("workplaces",e,a),r=_i(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=_i(n.filter((e=>"offices"===e.type)),"offices",e);l.add(s),i.add(r),t.geoObjects.add(i),t.geoObjects.add(l)}else{const i=_i(n,"offices",e);l.add(i),t.geoObjects.add(l)}t.setBounds(e.util.bounds.fromPoints(n.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const Mi=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?Pi:Ri,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),_i=(e,t,n)=>e.map((({coords:e,content:i})=>new n.Placemark(e,{balloonContentHeader:i?.header,balloonContentBody:i?.body,balloonContentFooter:i?.footer,hintContent:i?.hint},{iconLayout:"default#image",iconImageHref:"offices"===t?Pi:Ri,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),Ai={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},Ei={...Ai,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},zi=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(Ei).join(" ")} ${n}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.current.geoObjects.add(t.geoObjects)}))},children:o(W,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),Oi=e=>globalThis[e],Fi=(e,t)=>{const n=document.getElementById(t);if(n){const t=Oi(e);return t?Promise.resolve(t):new Promise((t=>{n.addEventListener("load",(()=>{t(Oi(e))}))}))}return new Promise(((n,i)=>{const a=document.createElement("script");a.src=t,a.async=!0,a.id=t,a.addEventListener("load",(()=>{n(Oi(e))})),a.addEventListener("error",(e=>{i(e)})),document.head.appendChild(a)}))};const Vi=()=>function(e,t,n=!0){const[l,r]=i(void 0);return a((()=>{let i=!0;return Fi(e,t).then((e=>{i&&r(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(i=!1,n){const e=document.getElementById(t);e&&document.head.removeChild(e),r(void 0)}}}),[e,t,n]),l}("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${_.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1),Li={...Ai,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},ji=d((({yandexMaps:e,direction:t="in"})=>{const n="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const n=e.current.getZoom(),i="in"===t?n+1:n-1;e.current.setZoom(i,{checkZoomRange:!0})},className:`${Object.values(Li).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(W,{name:n,width:"20",height:"16"})})})),qi=[55.753995,37.614069],$i=d((({points:e,className:t="",zoom:n=5,isLoad:i,selectedAddress:l})=>{const r=s(null),d=s(null),m=Vi();if(a((()=>{r.current?Di({yandexMaps:m,map:r.current,points:e,isLoad:i}):m?.ready((()=>{r.current||(r.current=new m.Map(d.current,{center:Ui(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),Di({yandexMaps:m,map:r.current,points:e,isLoad:i})})),r.current&&l&&m?.geocode(l).then((e=>{const t=e.geoObjects.get(0).geometry.getCoordinates();r.current.setCenter(t),r.current.setZoom(18)}))}),[m,e,n,i,l]),!m)return null;const h="z-10";return c("div",{ref:d,className:u("relative","w-full",t),children:[i?o(Bi,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(ji,{yandexMaps:r}),o(ji,{yandexMaps:r,direction:"out"})]}),zi(r,m,u("right-2 top-80",h))]})})),Ui=e=>{const t=[Hi(Wi(e,0)),Hi(Wi(e,1))];return t.every((e=>e))?t:qi},Wi=(e,t)=>e.map((e=>e.coords?.[t])),Hi=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,Yi=async(e,t,n)=>{try{return(await Ki(e,t,n)).json()}catch(e){return console.error(e),null}};async function Ki(e,t,n){return globalThis?.fetch?.(`/api/v1${e}`,{method:t,headers:{"Content-Type":"application/json",...Gi()},credentials:"include",body:n?JSON.stringify(n):null})}const Gi=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},Xi=e=>Number(e.toString().replace(",",".")),Ji=d((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:n=!1,renderFoldableSection:a,renderFoldButton:r})=>{const[s,o]=i(n),d=l((()=>{o((e=>!e))}),[]),m=a({isUnfolded:s,onToggle:d}),u=r?r({isUnfolded:s,onToggle:d}):null;return c("div",t?{className:e,role:"group",children:[u,m]}:{className:e,role:"group",children:[m,u]})}));const Zi=d((({className:e="",isUnfolded:t,children:n})=>{const i=s(null),l=function(e,t){const n=s(null);return a((()=>{const t=n?.current;if(!t)return;const i=new ResizeObserver((n=>{e(t,n[0])}));return i.observe(t),()=>{i.disconnect()}}),[e,...t]),n}((e=>{i.current&&(i.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:i,className:`transition-max-h duration-300 overflow-hidden ${i.current||!t?"max-h-0":""} `,children:o("div",{className:e,ref:l,children:n})})})),Qi=d((({value:e,subText:t,children:n,isPhone:i,...a})=>{const l=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[l.length,n,t].every((e=>!e))?null:ea({textItems:l,subText:t,children:n,isPhone:i,...a})})),ea=({label:e,labelSize:t="text-m",textItems:n,subColor:i,subText:a,className:l,children:r,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",l),children:[e?o(_e,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||ta(n,s),a?o(_e,{color:i,size:"text-m",children:a}):null]}),ta=(e,t)=>e.filter(Boolean).map(((e,n)=>o(_e,{size:"text-l",children:t?o("a",{href:`tel:${na(e)}`,children:e.trim()}):e.trim()},String(n)))),na=e=>e.replace(/\D/g,""),ia=d((({className:e,children:t})=>o("div",{className:u("flex flex-col sm:flex-row sm:border-t sm:border-solid sm:border-main-divider py-xl gap-x-6xl gap-y-xl",e),children:t}))),aa=e=>{const t=ra(e);return o(Qi,{label:"Режим работы",value:t,className:"max-w-none"})},la=({workTime:e="",lunchHour:t="",daysOff:n=""},i=!1)=>e?[`${i?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",ra=e=>{const t=e.find((e=>"workingSaturday"!==e.key&&Boolean(e.status)&&Boolean(e.workTime))),n=e.find((e=>"workingSaturday"===e.key&&Boolean(e.status)&&Boolean(e.workTime))),i=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[la({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":i}),la({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:i},!0)].filter(Boolean)},sa=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],oa=e=>sa.map((([t,n,i])=>({key:t,title:i,short:n,status:Boolean(e?.[t]),get workTime(){return"workingSaturday"===t?e?.workTimeSaturday:e?.workTime},get lunchHour(){return"workingSaturday"===t?e?.lunchHourSaturday:e?.lunchHour},get hasLunch(){return/\d+/.test(this.lunchHour??"")}}))),ca=e=>{if(!e)return null;const t=da(e);return c(ia,{className:"border-none",children:[o(Qi,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(ma)})}),o(Qi,{label:"Режим работы",className:"max-w-none",children:o(_e,{children:e})})]})},da=e=>{const t=sa.map((([,e])=>({short:e,status:!0}))),n=e.split("/")??[],i=n[n.length-1]?.toLowerCase();return i?.includes("выходной")?t.map((e=>({...e,status:!i?.includes(e.short.toLowerCase())}))):t},ma=({short:e,status:t},n)=>o("div",{className:u("w-9 h-9 rounded-md flex items-center justify-center",t?"bg-green-more-light text-green-dark":"bg-error/30 text-error"),children:o(_e,{size:"text-xs",children:e})},String(n)),ua=({currency:e,buyExchangeRate:t,saleExchangeRate:n},i)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(Qi,{label:"Валюта",value:e.currency}):null,t?o(Qi,{label:"Купить",value:String(t)}):null,n?o(Qi,{label:"Продать",value:String(n)}):null]},String(i)),ha={yellow:{border:"border-yellow-light",text:"text-yellow"},green:{border:"border-green-more-light",text:"text-green-dark"},gray:{border:"border-gray",text:"text-secondary-text"},red:{border:"border-error/30",text:"text-error"}},pa=d((({className:e,children:t,color:n="gray"})=>c("div",{className:u("sm:p-s sm:border sm:border-green rounded-md flex items-center h-fit",ha[n].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(ne,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(_e,{size:"text-m",color:ha[n].text,children:t})]}))),ga=(new Date).getDay(),fa=e=>{const[t]=e?.slice(ga-1)??[];if(!t)return null;const{lunchHour:n,status:i,workTime:a,hasLunch:l}=t;return i?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[a?o(pa,{color:"green",children:a}):null,n&&l?o(pa,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(pa,{color:"red",children:"Выходной"})},xa=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",ya=({title:e,status:t,workTime:n,lunchHour:i,hasLunch:a},l)=>o(Qi,{label:e,value:t&&n?n:"",subText:xa({lunchHour:i,hasLunch:a,status:t}),subColor:!t||a?"text-error":"text-green-dark"},String(l)),ba=["ArrowDownIcon","ArrowUpIcon"],va=["Подробнее","Скрыть"],Na=({isUnfolded:e,onToggle:t})=>c("button",{className:"w-full py-2xl cursor-pointer text-primary-main flex items-center border-b border-solid border-main-divider",onClick:t,type:"button",children:[o("div",{className:"pr-m",children:va[Number(e)]}),o(W,{className:"text-primary-text",name:ba[Number(e)],width:"16",height:"16"})]}),wa=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,Ca=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,Sa=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,ka=({name:e,address:t,phone:n,fax:i,phoneBusiness:a,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m},u)=>{if(!d)return null;const h=oa(d);return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(_e,{size:"text-h4",children:e}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(_e,{size:"text-l",children:t})]}):null]}),fa(h)]}),o("div",{className:"hidden sm:block",children:Ia({phone:n,fax:i,phoneBusiness:a,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(Ji,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(Zi,{isUnfolded:e,children:Ia({phone:n,fax:i,phoneBusiness:a,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Na({isUnfolded:e,onToggle:t})})]},String(u))},Ia=({phone:e,fax:t,phoneBusiness:n,phoneNatural:i,phoneCallCentre:a,phoneCurrencyControl:l,workSchedule:r,exchangeRate:s})=>{const d=oa(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(ia,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(Qi,{label:"Факс",value:t,isPhone:!0}),o(Qi,{label:"Телефон филиала",value:e,isPhone:!0}),o(Qi,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(Qi,{label:"Обслуживание физических лиц",value:i,isPhone:!0}),o(Qi,{label:"Для консультаций по валютному контролю",value:l,isPhone:!0}),o(Qi,{label:"Контакт-центр",value:a,isPhone:!0})]}),r?.isMatchesPattern?o(ia,{children:o(Qi,{label:m,labelSize:"text-l",className:"w-full max-w-none",children:o("div",{className:"flex flex-wrap gap-xs sm:justify-between pt-xs",children:d?.map(ya)})})}):c(ia,{children:[o(Qi,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(ma)})}),aa(d)]}),r?.businessScheduleVisibleTag?ca(r?.businessScheduleDescription):null,s?.currencies?.length?o(ia,{className:"flex-wrap",children:s?.currencies?.map(ua)}):null]})},Ta=({name:e="",address:t="",workSchedule:n})=>{const i=(a=e)?`${a?.charAt(0)?.toUpperCase()}${a?.slice(1)}`:"";var a;const l=`${t} ${(e=>{const t=oa(e),n=e?ra(t):"",i=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?wa(n):Sa(n,i):Ca(n):""})(n)}`;return{header:i,body:l}},Ba=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),Pa=d((({children:e})=>Ba?e:null)),Ra={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},Da={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",locationDisabledPeople:"Для маломобильных",designDisabledPeople:"Для слабовидящих",remoteWorkplace:"Удаленное рабочее место",serviceDisabledPeople:"Для маломобильных граждан"},Ma={workingSaturday:e=>Boolean("workSchedule"in e&&e.workSchedule?.workingSaturday),premiumService:e=>Boolean("premiumService"in e&&e.premiumService),privateBanking:e=>Boolean("privateBanking"in e&&e.privateBanking),remoteWorkplace:e=>Boolean("workScheduleDescription"in e),serviceDisabledPeople:e=>Boolean("serviceDisabledPeople"in e&&e.serviceDisabledPeople),sellingCoins:e=>Boolean("sellingCoins"in e&&e.sellingCoins),buyingCoins:e=>Boolean("buyingCoins"in e&&e.buyingCoins),bullionOperations:e=>Boolean("bullionOperations"in e&&e.bullionOperations),preciousMetalsOperations:e=>Boolean("preciousMetalsOperations"in e&&e.preciousMetalsOperations),transferringDataToBiometricSystem:e=>Boolean("transferringDataToBiometricSystem"in e&&e.transferringDataToBiometricSystem)};function _a({disabled:e,onClick:t}){return n=>{!e&&t&&t(n)}}const Aa={primary:"text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active",secondary:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active"},Ea={primary:u("group-data-secondary:text-primary-main group-data-secondary:bg-white","group-data-secondary:hover:text-white group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active"),secondary:u("group-data-secondary:text-white group-data-secondary:bg-white/20","group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active")},za=d((({children:e,...t})=>{const n=e=>({...e,onClick:ce(_a(e))}),{className:i,version:a="primary",active:l,disabled:r,type:s="button",rounded:c=!0,role:d,onClick:m}=n(t);return o("button",{className:u("font-sans px-9 py-4","flex justify-center items-center gap-xs",{"text-white bg-primary-active":l,"bg-main-gray text-main-disabled cursor-not-allowed":r,"rounded-md":c},l||r?"":u(Aa[a],Ea[a]),i),type:s,role:d,onClick:m,children:e})})),Oa=(e,t)=>e&&"underlined"!==t?"primary":"secondary",Fa=(e,t,n)=>{const i=Oa("all"===t),a=Oa("business"===t),l=(e,t,i)=>{const a=e.currentTarget===e.target&&"business"===t?r(i):i;return n(t),a},r=e=>e.filter((e=>e.workSchedule&&e.workSchedule.businessScheduleVisibleTag&&!e.workSchedule.businessScheduleDescription));return c("div",{className:"flex gap-lg flex-col sm:flex-row pb-lg",children:[o(za,{"data-id":"all",onClick:t=>l(t,"all",e),version:i,children:"Для физических лиц"}),o(za,{"data-id":"business",onClick:t=>l(t,"business",e),version:a,children:"Для юридических лиц"})]})},Va=({__html:e,list:t,richVersion:n})=>e||t?.length?c("div",{className:"mb-2xl border-b sm:border border-main-divider sm:rounded-md",children:[e?o("div",{className:"mb-2xl",children:o(De,{__html:e,richVersion:n})}):null,t?.length?o("div",{className:"flex flex-col sm:flex-row gap-2xl sm:flex-wrap pb-2xl sm:pb-xl",children:t.map(((e,t)=>c("div",{className:"flex gap-xs items-center",children:[e?.image?o(ne,{image:e.image}):null,e?.text?o(_e,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,La="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",ja=({filters:e,field:{field:t,reset:n},onlyOffice:i,labels:a})=>{const l=i?5:6,r=(e||[]).map((e=>o(Ni,{text:a[e],...t(e)},e))),[s,d]=l>0?[r.slice(0,l),r.slice(l)]:[r,[]];return o("div",{children:e?.length?o("div",{children:o(Ji,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[o("div",{className:La,children:s}),o(Zi,{className:La,isUnfolded:e,children:d})]}),renderFoldButton:qa(n,i)})}):null})},qa=(e,t=!1)=>({isUnfolded:n,onToggle:i})=>c("div",{className:"flex space-x-lg",children:[t?o(ve,{version:"transparent",className:"text-secondary-text [&>*]:p-0",appendRight:o(W,{name:["ArrowDownIcon","ArrowUpIcon"][Number(n)],width:"16",height:"16"}),text:["Больше фильтров","Меньше фильтров"][Number(n)],onClick:i}):null,o(ve,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:e,children:$a()})]}),$a=()=>c("div",{className:"flex items-center",children:["Очистить фильтр",o(W,{name:"CloseIcon",width:"16",height:"16",className:"ml-2xs"})]}),Ua=(e,t)=>o("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:c(N,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(_e,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}),Wa=()=>{},Ha=e=>"all"===e?"block":"hidden",Ya=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:a=[],renderCard:l=Wa,renderRemoteWorkplaceCard:r=Wa,getBalloon:s=Wa,getBalloonRemoteWorkplaces:d=Wa,descriptionData:m,title:h})=>{const p=h?.includes("Офис"),[g,{field:f,reset:x}]=en(Ra),{filteredItems:y,points:b,filteredRemoteWorkplaces:v,lengthItems:N}=Ja({data:t,remoteWorkplaces:a,filtrationState:g,getBalloon:s,getBalloonRemoteWorkplaces:d}),[w,C]=i("all"),S={filters:Ga([...t,...a]),field:{field:f,reset:x},onlyOffice:p,labels:Da};return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0",children:[Ua(h,N),m?Va(m):null,p&&Fa(t,w,C),o("div",{className:u("pb-3xl",Ha(w)),children:ja(S)})]}),o("div",{className:"h-[600px]",children:o(Pa,{children:o($i,{points:b,isLoad:n,className:"h-full"})})})]}),c(Pa,{children:[y.map(l),v.map(r)]})]})})),Ka=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>Ma[t](e)))))},Ga=e=>Object.keys(Ra).filter((t=>e.filter((e=>Ma[t](e))).length)),Xa=()=>{},Ja=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:i=Xa,getBalloonRemoteWorkplaces:a=Xa})=>{const[l,s,o,c]=r((()=>{const l=Ka(e,n),r=Ka(t,n),s=[...l.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:i(e)}))),...r.map((e=>({type:"workplaces",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:a({address:e.address,workScheduleDescription:e.workScheduleDescription})})))].filter((e=>e.coords&&2===e.coords.length));return[l,s,r,l.length+r?.length]}),[e,t,n,i,a]);return{filteredItems:l,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},Za=e=>{const{data:t,error:n}=ci(`/api/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,Qa);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},Qa=async e=>await Pt(e,{method:"POST"})||[],el=d((({field:e,input:t})=>{const[n,l]=i([]),{data:r}=Za("REGION_RF"),s=e("regionRetail")?.value||{},d=e("addressRetail");a((()=>{(async()=>{const e=await(async e=>(await Yi("/public-data/regionOffices","POST",{regionRfCd:{key:e},cashCardFlg:!0}))?.offices?.map((e=>({...e,gpsLatitude:Xi(e.latitude??qi[0]),gpsLongitude:Xi(e.longitude??qi[1])})))||[])(s?.key??"");l(e)})(),s?.key&&e?.("addressRetail")?.onChange?.("")}),[s.key]);const{points:m}=Ja({data:n,filtrationState:{},getBalloon:Ta}),u=Boolean(s?.key);return c("div",{children:[o(Dn,{label:"Адрес отделения",placeholder:"Выберите отделение",options:n.map((({id:e,address:t=""})=>({key:e?.toString()||"",text:t}))),...ti(e("addressRetail"),Jn.addressRetail,t?.required&&u),isSearch:!0}),o("div",{className:"h-[600px]",children:o(Pa,{children:o($i,{points:m,isLoad:!r,className:"h-full",selectedAddress:d?.value?.text})})})]})})),tl=(e,{normalize:t,format:n})=>{const{value:a,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=i(!1),m=l((e=>{d(!0),r&&r(e)}),[]),u=l((()=>{d(!1),o&&o(t(a)),s&&s()}),[o,a]);return{value:c||!n?a:n(a),onFocus:m,onBlur:u}},nl=(e,t,n)=>Math.max(t,Math.min(e,n));function il(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function al({list:e=[],min:t,max:n,step:i,value:a=e[0]||t,disabled:l,onChange:r}){const s=e.length?e.indexOf(a):a,d={backgroundSize:`${(100*(s>t?s-t:0)/(n-t)).toFixed(2)}% 100%`};return c("div",{children:[e.length?o("div",{className:"absolute w-full flex justify-between -bottom-[3px] px-m",children:e.map(((e,t)=>o("div",{className:u("w-2 h-2 rounded-full",s<=t||l?"bg-gray":"bg-primary-main")},String(t))))}):null,o("div",{className:"absolute inset-x-0 -bottom-1 px-m leading-[18px]",children:o("input",{className:"box-border w-full m-0 cursor-pointer slider relative z-10",style:d,type:"range",min:t,max:n,step:i,value:s,disabled:l,onChange:t=>{const n=il(t.target?.value),i=e.length?e[n]:n;r&&r(i||0)}})})]})}const ll=1,rl=100,sl=d((e=>{const{className:t,title:n,items:i=[],list:a=[],min:r=(a.length?0:ll),max:s=(a.length?a.length-1:rl),step:d=1,value:m=a[0]||r,disabled:h=!1,onChange:p}=e,g=tl(e,{normalize:(e=0)=>a.length?ol(a)(e):nl(e,r,s),format:We()}),f=l((e=>{p&&p(il(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(_e,{size:"text-m",font:"font-light",color:"text-primary-text",children:n}):null,o("input",{className:u("text-h3 w-full h-14","pl-m mt-xs box-border","text-primary-text",dn,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:f,...g}),al({list:a,min:r,max:s,step:d,disabled:h,value:m,onChange:p})]}),cl(i)]})})),ol=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),cl=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(_e,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),dl=["От 1 000 ₽","До 1 000 000 000 ₽"],ml=d((({field:e})=>o(sl,{title:"Сумма, ₽",items:dl,min:1e3,max:1e9,...e("amount")}))),ul=zt((({field:e,source:t,label:n,fieldName:i,input:a,placeholder:l="Выберите из списка",isSearch:r=!1})=>{const s=t&&t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(Dn,{placeholder:l,label:n,options:s,isSearch:r,...ti(e(i),Jn[i],a?.required)})})),hl=d((({field:e,input:t})=>{const{data:n}=Za("EMPLOYEES_NUMBER");return o(ul,{field:e,source:n,label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),pl=d((({field:e,input:t})=>o(wn,{label:"Годовая выручка, ₽",...ti(e("annualRevenue"),Jn.annualRevenue,t?.required)}))),gl=d((({field:e,input:t})=>o(Ii,{text:"Наличие военного билета",...ti(e("armyIdFlg"),Jn.armyIdFlg,t?.required)}))),fl=d((({field:e,input:t})=>o(wn,{label:"Код представителя Банка",placeholder:"Введите код",type:"number",...ti(e("bankEmployeeCode"),Jn.bankEmployeeCode,t?.required),...t}))),xl=d((({field:e})=>o(wn,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e("bankEmpolee")}))),yl=d((({field:e,input:t})=>o(Ii,{text:"В отношении меня ведётся производство по делу о банкротстве",...ti(e("bankruptcyFlg"),Jn.bankruptcyFlg,t?.required)}))),bl=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:i,currentYear:a,min:l,max:r,onDateClick:s})=>{const c=[];let d=1;for(let m=0;m<6;m++){const u=[];for(let c=0;c<7;c++)if(0===m&&c<t)u.push(o("td",{},`empty-${c}`));else if(d>n)u.push(o("td",{},`empty-${c}`));else{const t=new Date(a,i,d),n=vl(t,e),c=Nl(t,l,r);u.push(o("td",{children:o("div",{className:wl(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},vl=(e,t)=>t&&e.toDateString()===t.toDateString(),Nl=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),wl=(e=!1,t=!1)=>u("p-s text-center rounded-md border",{"border-transparent hover:bg-gray":!e},t?"text-gray hover:bg-transparent":"cursor-pointer"),Cl=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Sl=d((({today:e,currentMonth:t,currentYear:n,min:i,max:a,onDateSelect:s=cn,setValue:d=cn})=>{const m=l((e=>{s(e),d(!1)}),[]),{firstDayOfWeek:u,totalDays:h}=r((()=>({firstDayOfWeek:new Date(n,t,1).getDay()-1,totalDays:new Date(n,t+1,0).getDate()})),[n,t]);return c("table",{className:"mx-auto",children:[o("thead",{className:"text-gray font-light",children:o("tr",{children:Cl.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:bl({firstDayOfWeek:u,today:e,totalDays:h,currentYear:n,currentMonth:t,min:i,max:a,onDateClick:m})})]})})),kl=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function Il(e,t){const n=e.replace(/\D/g,"");if(""===n||e?.length===t.length)return e;const i=[...t],a=i.findIndex(Tl),l=i.map(((e,t)=>Pl(e)?i.slice(0,t).filter(Pl).length:-1)),r=i.map(((e,t)=>Bl(e)?e:n.charAt(l[t])||e)),s=l.indexOf(n.length-1)+1;return r.slice(0,Math.max(a,s)).join("")}const Tl=e=>"_"===e,Bl=e=>/\d/.test(e),Pl=e=>Tl(e)||Bl(e),Rl=1940,Dl={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},Ml=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:l,disabled:r,onChange:d,onClick:m})=>{const h=s(null),[p,g]=i(l||"");return a((()=>{g(l||"")}),[l]),c("div",{onClick:()=>{null!==h.current&&h.current.focus(),m?.()},className:u("relative",n),children:[o("input",{ref:h,className:"h-full w-full px-m text-l text-black focus-visible:outline-none",value:p,type:"text",onChange:e=>{const t=e.target?.value;"string"==typeof t&&t?.length<11&&g(Il(t,"__.__.____"))},onBlur:()=>{if(_l(p)){const[n,i,a]=p.split(".");d?.(new Date(Number(a),Number(i)-1,Number(n))),e(Number(i)-1),t(Number(a))}else g(l||"")},disabled:r}),r?null:o(W,{className:"mr-s",...Dl})]})})),_l=e=>{const[t,n,i]=e.split(".");if((e=>Number(e)>=Rl&&Number(e)<=(new Date).getFullYear())(i)&&(e=>Number(e)>0&&Number(e)<13)(n)){const e=new Date(Number(i),Number(n)-1,1);let a=0;for(;e.getMonth()===Number(n)-1;)e.setDate(e.getDate()+1),a++;if(Number(t)>0&&Number(t)<=a)return!0}return!1},Al=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:i,setSelectedMonth:a,setSelectedYear:l,disabled:r=!1})=>o(Ml,{onChange:i,disabled:r,onClick:e,value:t&&Lt(t),setSelectedMonth:a,setSelectedYear:l,className:u("flex justify-between items-center h-14 border rounded-md cursor-pointer hover:border-black active:border-black focus:border-black",n?"border-gray":"border-error")}),El=kl.map((e=>({key:e}))),zl=Array.from({length:(new Date).getFullYear()-Rl+1},((e,t)=>Rl+t)).reverse().map((e=>({key:String(e)}))),Ol=(e,t)=>{const n=new Date(e,t,1);let i=0;for(;n.getMonth()===t;)i++,n.setDate(n.getDate()+1);return i},Fl=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:i,onChange:a})=>{i&&a?.(new Date(t,n,Math.min(e,i.getDate())))},Vl={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},Ll={className:"min-w-32",iconVersion:"black",isBorder:!1},jl=d((({className:e="",label:t="",value:n,valid:r=!0,minDate:s,maxDate:d,disabled:m,onChange:h})=>{const[p,{setValue:g}]=ln(!1),[f,x]=i(n?.getMonth()||(new Date).getMonth()),[y,b]=i(n?.getFullYear()||(new Date).getFullYear()),{handlePrevMonth:v,handleNextMonth:N,handleSelectMonth:w,handleSelectYear:C,monthsOptions:S,yearsOptions:k,handleChangeVisibleCalendar:I,ref:T}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:i,onYearSelect:a,selectedYear:r,onChange:s,value:o})=>{const c=sn(l((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:l((()=>e(!t)),[t]),handleNextMonth:l((()=>{n+1<=11?i(n+1):(i(0),a(r+1))}),[n]),handlePrevMonth:l((()=>{n-1>=0?i(n-1):(i(11),a(r-1))}),[n]),handleSelectMonth:l((({key:e})=>{i(kl.indexOf(e));const t=Ol(r,kl.indexOf(e));Fl({maxDateOfMonth:t,selectedYear:r,selectedMonth:kl.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:l((({key:e})=>{a(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:El,yearsOptions:zl,ref:c}})({onYearSelect:b,onMonthSelect:x,onShowCalendar:g,selectedYear:y,selectedMonth:f,showCalendar:p,onChange:h,value:n}),B=((e,t)=>{const[n,l]=i(!1);return a((()=>{const n=()=>{if(e?.current){const{top:n}=e.current.getBoundingClientRect();l(n>t)}};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}),[e]),n})(T,370);return c("div",{className:u("space-y-xs",e),ref:T,children:[mn(t),c("div",{className:"relative",children:[Al({handleChangeVisibleCalendar:I,value:n,valid:r,onChange:h,disabled:m,setSelectedMonth:x,setSelectedYear:b}),p&&!m?c("div",{className:u("absolute bg-white z-20 select-none",{"bottom-full":B}),children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:v,children:o(W,{...Vl,className:"-rotate-90 cursor-pointer"})}),o(Tn,{onChange:w,value:{key:kl[f]},options:S,...Ll}),o(Tn,{onChange:C,value:{key:String(y)},options:k,...Ll}),o("div",{className:"my-auto",onClick:N,children:o(W,{...Vl,className:"rotate-90 cursor-pointer"})})]}),o(Sl,{today:n,currentMonth:f,currentYear:y,onDateSelect:h,min:s,max:d,setValue:g})]}):null]})]})})),ql=d((({className:e,label:t,error:n,errors:i,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(jl,{label:on({label:t,errors:i}),valid:Boolean(!n),...a}),gn(n)]}))),$l=d((({field:e,input:t})=>o(ql,{label:"Дата начала работы на текущем месте",...ti(e("beginDate"),Jn.beginDate,t?.required),...t}))),Ul=d((({field:e,input:t})=>o(ql,{label:"Дата рождения",...ti(e("birthday"),Jn.birthday,t?.required)}))),Wl=d((({field:e,input:t})=>o(wn,{label:"Место рождения",...ti(e("birthPlace"),Jn.birthPlace,t?.required),...t,disabled:t?.filledByEsia&&fi(e,"birthPlace")}))),Hl=d((({field:e,input:t})=>{const[n,l]=i([]),r=e("paymentSystem").value;return a((()=>{(async()=>{const e=await(async e=>{const t=await Ki("/dictionaryFiltered","POST",{type:"CARD_TYPE",presets:{paymentSystemType:e,creditProgramId:13}});return await(t?.json())})(r);l(e)})()}),[r]),o(ul,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t})})),Yl=d((({field:e,input:t})=>o(wn,{label:"Количество детей до 18 лет",placeholder:"Введите значение",type:"number",...ti(e("children"),Jn.children,t?.required),...t}))),Kl=d((({field:e,input:t})=>o(wn,{label:"Кодовое слово",...ti(e("codeWord"),Jn.codeWord,t?.required),...t}))),Gl=d((({field:e,input:t})=>o(wn,{label:"Количество объектов инкассации",type:"number",...ti(e("collectionCount"),Jn.collectionCount,t?.required)}))),Xl=d((({field:e,input:t})=>o(wn,{className:"col-span-2",...ti(e("comment"),Jn.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),Jl=d((({field:e,input:t})=>{const{data:n}=Za("INCOME_CERT_UNITED");return o(ul,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t})})),Zl=d((({field:e,input:t})=>{const{data:n}=Za("MILITARY_STATUS");return o(ul,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),Ql={processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в ПФР",docId:3},consentToReceiveMaterials:{text:"Согласен на получение информационных и аналитических материалов по электронной почте"}},er=async(e,t=!1)=>{const n=await(async(e,t=!1)=>{const n=await Ki(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return n?await n.blob():new Blob})(e,t);return URL.createObjectURL(n)},tr=d((({className:e,onClose:t})=>o("button",{className:u("flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none",e),onClick:t,title:"Закрыть",type:"button",children:o(W,{name:"CloseIcon",width:"20",height:"20",iconVersion:"gray"})}))),nr=d((({className:e,head:t,children:n,onClose:i,onClick:a})=>{const{close:r}=ue(),s=l((()=>{r(),i&&i()}),[i]);return c("div",{onClick:a,className:u("relative min-h-full bg-white pt-0 p-lg",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(tr,{className:"absolute top-0 right-0",onClose:s}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})})),ir=async(e,t,n=!1)=>{const i=await er(t,n);e(o(nr,{className:"my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0",children:n?o("img",{src:i}):o("iframe",{src:`${i}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"})}))},ar=d((({className:e,error:t,docId:n,...i})=>{const{open:a}=ue(),l=Se();return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(Ni,{...i}),n?o(ve,{className:"text-primary-main",onClick:()=>ir(a,n,l),children:o(_e,{children:"Ознакомиться"})}):null]}),gn(t)]})})),lr=d((({field:e,input:t})=>t&&t.name?o(ar,{text:Ql[t.name]?.text,docId:Ql[t.name]?.docId,...ti(e(t.name),Jn[t.name],t?.required)}):null)),rr=d((({field:e,input:t})=>{const{data:n}=Za("CREDIT_IN_RSHB");return o(ul,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком / \n вкладчиком с долей участия более 20% уставного капитала руководителем, \n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t})})),sr={horizontal:"@lg:flex-row",vertical:""},or=d((({label:e,items:t,value:n,className:i,onChange:a,disabled:l=!1,orientation:r="horizontal"})=>c("div",{className:"grid gap-xs whitespace-nowrap",children:[e?o("div",{role:"radiogroup","aria-label":e,children:o(_e,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",sr[r],i),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(Ni,{isRadio:!0,text:t,value:n===e,onChange:()=>a&&a(e),disabled:l},String(e))))})]}))),cr=d((({className:e,label:t,onChange:n,error:i,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(or,{label:on({label:t,errors:a?.errors}),onChange:e=>n&&n(e),...a}),gn(i)]}))),dr=[{id:"rub",text:"Рубль"}],mr=d((({field:e,input:t})=>{const{value:n,onChange:i}=e("currency");return o(cr,{label:"Валюта",orientation:"horizontal",items:dr,value:n,onChange:e=>i?.(e),...ti(e("currency"),Jn.currency,t?.required)})})),ur=d((({field:e,input:t})=>o(ql,{label:"Дата доставки",...ti(e("deliveryDate"),Jn.deliveryDate,t?.required)}))),hr=d((({field:e,input:t})=>o(wn,{label:"Количество иждивенцев",placeholder:"За исключение детей до 18 лет",type:"number",maxLength:2,...ti(e("dependents"),Jn.dependents,t?.required),...t}))),pr=d((({field:e,input:t})=>o(ql,{label:"Желаемая дата встречи",...ti(e("desiredMeetingDate"),Jn.meetingDay,t?.required)}))),gr=d((({field:e,input:t})=>o(Ii,{text:"Являюсь инвалидом",...ti(e("disablePeopleFlg"),Jn.disablePeopleFlg,t?.required)}))),fr="dulIssueDateField",xr=d((({field:e,input:t})=>o(ql,{label:"Дата выдачи",...ti(e(fr),Jn.dulIssueDateField,t?.required),disabled:t?.filledByEsia&&fi(e,fr)}))),yr="dulIssuedBy",br=d((({field:e,input:t})=>{const{value:n,onChange:i}=e("dulSubdivisionCode"),a=l((e=>{i?.(e?.data?.code?.replace("-",""))}),[]);return o(wn,{disabled:t?.filledByEsia&&fi(e,yr),label:"Кем выдан",...t,...ti(e(yr),Jn.dulIssuedBy,t?.required),onDaDataChange:a,daDataQueryPrefix:n})})),vr=d((({field:e,input:t})=>o(wn,{disabled:t?.filledByEsia&&fi(e,"dulNumber"),label:"Номер документа",type:"number",maxLength:6,...ti(e("dulNumber"),Jn.dulNumber,t?.required)}))),Nr=d((({field:e,input:t})=>o(wn,{disabled:t?.filledByEsia&&fi(e,"dulSerie"),label:"Серия документа",type:"number",maxLength:4,...ti(e("dulSerie"),Jn.dulSerie,t?.required)}))),wr="dulSubdivisionCode",Cr=d((({field:e,input:t})=>{const n=l((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(wn,{disabled:t?.filledByEsia&&fi(e,wr),label:"Код подразделения",type:"number",maxLength:6,...t,...ti(e(wr),Jn.dulSubdivisionCode,t?.required),onDaDataChange:n})})),Sr=d((({field:e,input:t})=>{const{data:n}=Za("EDUCATION_LEVEL");return o(ul,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),kr=d((({field:e,input:t})=>{const{required:n,...i}=t;return o(wn,{label:"Электронная почта",...ti(e("email"),Jn.email,n),...i})})),Ir=d((({field:e,input:t})=>{const{data:n}=Za("ORGANIZATION_ACTIVITY_TYPE");return o(ul,{field:e,source:n,label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),Tr=d((({field:e,input:t})=>{const{data:n}=Za("ORGANIZATION_KIND");return o(ul,{field:e,source:n,label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),Br=d((({field:e,input:t})=>{const{data:n}=Za("EMPLOYMENT_INFO_UNITED");return o(ul,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),Pr=d((({field:e,input:t})=>o(wn,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",type:"number",...ti(e("expenses"),Jn.expenses,t?.required),...t}))),Rr=d((({field:e,input:t})=>o(wn,{label:"Стаж",placeholder:"За последние 5 лет",type:"number",maxLength:2,...ti(e("experience5Years"),Jn.experience5Years,t?.required),...t}))),Dr=d((({field:e})=>{const{value:t,onChange:n}=e("familyMembers"),i=e("familyStatus")?.value?.key,l="MARRIED"===i?2:1,r=Number(e("children")?.value),s=Number(e("dependents")?.value),c=l+r+s;return a((()=>{e?.("familyMembers")?.onChange?.(c)}),[i,r,s]),o(wn,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:t,onChange:e=>n?.(e)})})),Mr=d((({field:e,input:t})=>{const{data:n}=Za("MARITAL_STATUS");return o(ul,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),_r=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],Ar=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],Er=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],zr=d((({field:e,input:t})=>o(Dn,{label:"Способ получения ответа",options:Er,...ti(e("feedbackMethod"),Jn.feedbackMethod,t?.required)}))),Or=d((({field:e,input:t})=>o(wn,{label:"ФИО",...ti(e("fullName"),Jn.fullName,t?.required),...t}))),Fr=d((({field:e,input:t})=>o(wn,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",...ti(e("generalSeniority"),Jn.generalSeniority,t?.required),...t}))),Vr=d((({field:e,input:t})=>{const{data:n}=Za("HOUSE_TYPE");return o(ul,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),Lr=d((({field:e,input:t})=>{const n=l((t=>{e?.("organizationName")?.onChange?.(t.data?.name?.short_with_opf),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(wn,{label:"ИНН",type:"number",maxLength:12,...t,...ti(e("inn"),Jn.inn,t?.required),onDaDataChange:n})})),jr=d((({field:e})=>o(Ii,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),qr=d((({field:e,input:t})=>o(wn,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",type:"number",maxLength:2,...ti(e("jobsNumber"),Jn.jobsNumber,t?.required),...t}))),$r=d((({field:e,input:t})=>o(wn,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,...ti(e("lastJobExperience"),Jn.lastJobExperience,t?.required),...t}))),Ur=d((({field:e,input:t})=>o(wn,{label:"Наименование юридического лица",...t,...ti(e("legalEntityName"),Jn.legalEntityName,t?.required)}))),Wr=d((({field:e,input:t})=>o(wn,{label:"ОПФ",placeholder:"ООО, ПАО и др.",...ti(e("legalForm"),Jn.legalForm,t?.required),...t}))),Hr="limitedBirthday",Yr=d((({field:e,input:t})=>o(ql,{label:"Дата рождения",...ti(e(Hr),Jn.limitedBirthday,t?.required),disabled:t?.filledByEsia&&fi(e,Hr)}))),Kr=[];async function Gr(){const e=await Pt("/api/v1/outservice/outserviceregions");return e&&Array.isArray(e)?e:Kr}const Xr=d((({field:e,input:t})=>{const n=e("region")?.value?.key,{data:i}=ci("outServiceRegions",Gr),l=i?.find((e=>e.code===n))?.localities?.map((e=>({key:e,text:e})));return a((()=>{""!==n&&e?.("localities")?.onChange?.("")}),[n]),o(Dn,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:l,...ti(e("localities"),Jn.localities,t?.required),isSearch:!0})})),Jr=d((({field:e,input:t})=>o(wn,{label:"Обязательные выплаты",placeholder:"Введите значение",type:"number",...ti(e("mandatoryPayments"),Jn.mandatoryPayments,t?.required),...t}))),Zr=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],Qr=d((({field:e,input:t})=>o(cr,{orientation:"horizontal",items:Zr,...ti(e("methodObtain"),Jn.methodObtain,t?.required)}))),es="middleName",ts=d((({field:e,input:t})=>{const n=l((t=>{const n=t?.data?.gender;n&&"UNKNOWN"!==n&&e("sex")?.onChange?.(n.toLowerCase())}),[]);return o(wn,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&fi(e,es),...ti(e(es),Jn.middleName,t?.required),...t,onDaDataChange:n})})),ns=d((({field:e,input:t})=>o(wn,{label:"Имя",maxLength:60,disabled:t?.filledByEsia&&fi(e,t.name??""),...ti(e("name"),Jn.name,t?.required),...t}))),is=d((({value:e=!1,text:t,type:n="checkbox",onChange:i})=>c("div",{role:n,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>i&&i(!e),children:[o("div",{className:u("relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl",e?"bg-primary-main":"bg-main-divider"),children:o("div",{className:u("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?o(_e,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),as=d((({field:e})=>ai(e("acquiringType")?.value?.key)?o(is,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),ls=d((({field:e,input:t})=>{const{data:n}=Za("ORGANIZATION_TYPE");return o(ul,{field:e,source:n,label:"Тип организации",fieldName:"organization",input:t})})),rs=d((({field:e,input:t})=>{const n=l((t=>{e?.("inn")?.onChange?.(t.data?.inn),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(wn,{label:"Наименование организации",...t,...ti(e("organizationName"),Jn.organizationName,t?.required),onDaDataChange:n})})),ss=d((({field:e,input:t})=>o(wn,{label:"Иные доходы",placeholder:"Введите значение",type:"number",...ti(e("otherIncome"),Jn.otherIncome,t?.required),...t}))),os=d((({field:e,input:t})=>o(ql,{label:"Дата регистрации по месту жительства",...ti(e("participantDateRegistration"),Jn.participantDateRegistration,t?.required)}))),cs="partInBusiness",ds=d((({field:e,input:t})=>{const n=l((t=>{e(cs)?.onChange?.(String(Number(t)>100?100:Number(t)||""))}),[]);return o(wn,{label:"Доля участия в бизнесе",placeholder:"в %",type:"number",maxLength:3,...ti(e(cs),Jn.partInBusiness,t?.required),...t,onChange:n})})),ms=d((({field:e,input:t})=>{const{required:n,...i}=t;return o(wn,{...ti(e("partnerComments"),Jn.partnerComments,n),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...i})})),us=d((({field:e,input:t})=>{const{value:n,onChange:l}=e("paymentSystem"),[r,s]=i([]);return a((()=>{(async()=>{const e=await(async()=>{const e=await Ki("/public-data/creditProgramConditions","POST",{creditProgramId:13});return(await(e?.json()))?.paymentSystems?.map((e=>({id:e.type,text:e.name})))??[]})();s(e||[])})()}),[]),o(cr,{label:"Платежная система",orientation:"horizontal",items:r,value:n,onChange:e=>l?.(e),...ti(e("paymentSystem"),Jn.paymentSystem,t?.required)})})),hs=e=>"_"===e,ps=e=>/\d/.test(e),gs=e=>hs(e)||ps(e),fs=[..."+7 (___) ___-__-__"],xs=fs.findIndex(hs),ys=fs.map(((e,t)=>gs(e)?fs.slice(0,t).filter(gs).length:-1));function bs(e){const t=e.replace(/\D/g,""),n=fs.map(((e,n)=>ps(e)?e:t.charAt(ys[n])||e)),i=ys.indexOf(t.length-1)+1;return(i?n.slice(0,Math.max(xs,i)):n).join("")}const vs=d((({children:e,onChange:t,...n})=>{const i=l((e=>t&&t(bs(e))),[t]),a=l((e=>{"+7 ("===e&&t&&t("")}),[]);return o(un,{...n,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>a(e?.target?.value||""),children:e})})),Ns=d((({className:e,label:t,error:n,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(vs,{"aria-label":t,label:on({label:t,errors:i?.errors}),valid:Boolean(!n),placeholder:"+7 (___) ___-__-__",...i}),gn(n)]}))),ws=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(Ns,{label:"Телефон",...ti(e(n),Jn.phone,t?.required),disabled:t?.filledByEsia&&fi(e,n),...t})})),Cs=d((({field:e,input:t})=>{const{data:n}=Za("POSITION");return o(ul,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),Ss=d((({field:e})=>ai(e("acquiringType")?.value?.key)?o(is,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),ks=d((({field:e,source:t})=>o(Dn,{placeholder:"Выберите продукт",label:"Продукт",options:Is(t?.productList),...ei(e("product"),Jn.product)}))),Is=e=>(e??[]).map((e=>({key:e,value:e}))),Ts=[];function Bs(e="/api/v1/regions"){const{data:t}=ci(e,Rt);return Array.isArray(t)?t:Ts}const Ps=d((({field:e,input:t,url:n})=>{const i=Bs(n);return o(Dn,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:r((()=>i?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[i]),...ti(e("region"),Jn.region,t?.required)})})),Rs=d((({field:e,input:t})=>{const n=hi(!0),i=r((()=>n?.map((({region:e})=>({key:e,text:e})))),[n]);return o(Dn,{label:"Регион",placeholder:"Выберите регион",options:i,...ti(e("region"),Jn.region,t?.required)})})),Ds=d((({field:e,input:t})=>{const{data:n}=Za("REGION_RF"),i=n?.map((({key:e,value:t})=>({key:e,text:t})));return o(Dn,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,options:i,...ti(e("regionRetail"),Jn.regionRetail,t?.required)})})),Ms=d((({field:e,input:t})=>{const n=e("wages")?.value,i=l((t=>{const i=Number(t)+Number(n||0);e("retirementIncome")?.onChange?.(t),e("incomeAverage")?.onChange?.(String(i))}),[n]);return o(wn,{label:"Пенсионные доходы",placeholder:"Введите значение",type:"number",...ti(e("retirementIncome"),Jn.retirementIncome,t?.required),...t,onChange:i})})),_s=d((({field:e})=>{const t=e("secondaryPhone");return o(Ns,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?ei(t,Jn.secondaryPhone):t})})),As=d((({field:e,input:t})=>o(Dn,{label:"Направление обслуживания",placeholder:"Выберите направление",options:Ar,...ti(e("serviceDirection"),Jn.serviceDirection,t?.required)}))),Es=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],zs=d((({field:e,input:t})=>o(cr,{label:"Пол",orientation:"horizontal",items:Es,...ti(e("sex"),Jn.sex,t?.required)}))),Os=d((({field:e,input:t})=>o(Ii,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...ti(e("shareholderFlg"),Jn.shareholderFlg,t?.required)}))),Fs=d((({children:e,onChange:t,...n})=>{const i=l((e=>t&&t(Il(e,"___-___-___ __"))),[t]),a=l((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(un,{...n,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>a(e?.target?.value||""),children:e})})),Vs=d((({className:e,label:t,value:n,error:i,onChange:a,onBlur:l,...r})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Fs,{"aria-label":t,label:on({label:t,errors:r?.errors}),valid:Boolean(!i),value:n,onChange:a,onBlur:l,placeholder:"___-___-___ __"}),gn(i)]}))),Ls=d((({field:e,input:t})=>{const n=e("consentPfrFlg")?.value;return o(Vs,{label:"СНИЛС",...ti(e("snils"),Jn.snils,!!n&&t?.required),...t})})),js=d((({field:e,input:t})=>o(wn,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&fi(e,"surname"),...ti(e("surname"),Jn.surname,t?.required),...t}))),qs=["От 1 мес","До 15 лет"],$s=d((({field:e})=>o(sl,{title:"Срок, месяцев",items:qs,min:1,max:180,...e("term")}))),Us=d((({field:e,input:t})=>o(wn,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",type:"number",...ti(e("totalIncome"),Jn.totalIncome,t?.required),...t}))),Ws=d((({field:e,input:t})=>o(Dn,{label:"Тип обслуживания",options:_r,...ti(e("serviceType"),Jn.serviceType,t?.required)}))),Hs=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],Ys=d((({field:e})=>{const{value:t,onChange:n}=e("vedTypes");return a((()=>{"currencyControl"!==t&&(e?.("inn")?.onChange?.(""),e?.("region")?.onChange?.(""))}),[t]),o("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:o(or,{className:"whitespace-normal",orientation:"horizontal",items:Hs,value:t,onChange:e=>n&&n(e)})})})),Ks=d((({field:e,input:t})=>{const n=e("retirementIncome")?.value,i=l((t=>{const i=Number(t)+Number(n||0);e("wages")?.onChange?.(t),e("incomeAverage")?.onChange?.(String(i))}),[n]);return o(wn,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",type:"number",...ti(e("wages"),Jn.wages,t?.required),...t,onChange:i})}));const Gs={$ref:"/wcms-resources/outservice-productlist.json"},Xs=(e,t)=>(n,i)=>{const a="ULTRASERVICE"===t||"PREMIUMSERVICE"===t,l={surname:o(js,{field:e,input:n}),name:o(ns,{field:e,input:n}),middleName:o(ts,{field:e,input:n}),phone:o(ws,{field:e,input:n}),organizationPhone:o(ws,{field:e,input:n}),email:o(kr,{field:e,input:n}),fullName:o(Or,{field:e,input:n}),inn:o(Lr,{field:e,input:n}),legalForm:o(Wr,{field:e,input:n}),organizationName:o(rs,{field:e,input:n}),generalSeniority:o(Fr,{field:e,input:n}),lastJobExperience:o($r,{field:e,input:n}),experience5Years:o(Rr,{field:e,input:n}),jobsNumber:o(qr,{field:e,input:n}),beginDate:o($l,{field:e,input:n}),addressFact:o(gi,{field:e,input:n}),organizationAddress:o(xi,{field:e,input:n}),comment:o(Xl,{field:e,input:n}),addressBranch:o(pi,{field:e,input:n,isPremium:a}),sex:o(zs,{field:e,input:n}),birthday:o(Ul,{field:e,input:n}),limitedBirthday:o(Yr,{field:e,input:n}),birthPlace:o(Wl,{field:e,input:n}),desiredMeetingDate:o(pr,{field:e,input:n}),product:o(ks,{field:e,source:Gs}),localities:o(Xr,{field:e,input:n}),isClient:o(jr,{field:e}),partnerComments:o(ms,{field:e,input:n}),collectionCount:o(Gl,{field:e,input:n}),acquiringType:o(ii,{field:e,input:n}),onlineCheckout:o(as,{field:e}),posTerminal:o(Ss,{field:e}),serviceType:o(Ws,{field:e,input:n}),term:o($s,{field:e}),amount:o(ml,{field:e}),annualRevenue:o(pl,{field:e,input:n}),vedTypes:o(Ys,{field:e}),feedbackMethod:o(zr,{field:e,input:n}),serviceDirection:o(As,{field:e,input:n}),bankEmpolee:o(xl,{field:e}),secondaryPhone:o(_s,{field:e}),consentToReceiveMaterials:o(lr,{field:e,input:n}),processPersonalDataFlg:o(lr,{field:e,input:n}),consentProviderFlg:o(lr,{field:e,input:n}),consentOthersFlg:o(lr,{field:e,input:n}),consentInformFlg:o(lr,{field:e,input:n}),consentPfrFlg:o(lr,{field:e,input:n}),applicationDate:o(wn,{label:"Дата и время обращения в Банк",...e("applicationDate")}),region:a?o(Rs,{field:e}):o(Ps,{field:e,input:n,url:an(t)}),education:o(Sr,{field:e,input:n}),housing:o(Vr,{field:e,input:n}),employment:o(Br,{field:e,input:n}),organization:o(ls,{field:e,input:n}),amountWorkers:o(hl,{field:e,input:n}),employerActivities:o(Ir,{field:e,input:n}),employerOrganization:o(Tr,{field:e,input:n}),positionOrganization:o(Cs,{field:e,input:n}),familyStatus:o(Mr,{field:e,input:n}),children:o(Yl,{field:e,input:n}),familyMembers:o(Dr,{field:e,input:n}),dependents:o(hr,{field:e,input:n}),totalIncome:o(Us,{field:e,input:n}),expenses:o(Pr,{field:e,input:n}),snils:o(Ls,{field:e,input:n}),conscription:o(Zl,{field:e,input:n}),armyIdFlg:o(gl,{field:e,input:n}),dulSerie:o(Nr,{field:e,input:n}),dulNumber:o(vr,{field:e,input:n}),dulIssueDateField:o(xr,{field:e,input:n}),dulSubdivisionCode:o(Cr,{field:e,input:n}),dulIssuedBy:o(br,{field:e,input:n}),addressRegistration:o(xi,{field:e,input:n}),addressCourier:o(xi,{field:e,input:n}),participantDateRegistration:o(os,{field:e,input:n}),retirementIncome:o(Ms,{field:e,input:n}),otherIncome:o(ss,{field:e,input:n}),wages:o(Ks,{field:e,input:n}),mandatoryPayments:o(Jr,{field:e,input:n}),disablePeopleFlg:o(gr,{field:e,input:n}),bankruptcyFlg:o(yl,{field:e,input:n}),shareholderFlg:o(Os,{field:e,input:n}),legalEntityName:o(Ur,{field:e,input:n}),creditInRshbCd:o(rr,{field:e,input:n}),bankEmployeeCode:o(fl,{field:e,input:n}),partInBusiness:o(ds,{field:e,input:n}),regionRetail:o(Ds,{field:e,input:n}),addressRetail:o(el,{field:e,input:n}),addressMatch:o(Ti,{field:e,input:n}),paymentSystem:o(us,{field:e,input:n}),currency:o(mr,{field:e,input:n}),cardCategory:o(Hl,{field:e,input:n}),codeWord:o(Kl,{field:e,input:n}),confirmationIncome:o(Jl,{field:e,input:n}),methodObtain:o(Qr,{field:e,input:n}),deliveryDate:o(ur,{field:e,input:n})};return function({input:e,field:t}){const{condition:n}=e,{value:i}=t(n?.name||"");return!n||n?.values?.find((e=>e===(i?.key??i)))}({input:n,field:e})?o("div",{children:l[n?.name||""]},String(i)):null},Js=e=>2===e?"@xl:grid-cols-2":"",Zs=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(_e,{size:"text-h6",children:e})}):null,Qs=d((function({responseType:e,typeForm:t}){const n="OK"===e,i=n?"ResponseOKIcon":"ResponseFailIcon",{close:a}=ue(),r=l((()=>{a()}),[]),s="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся";return o(nr,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto ",children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ne,{image:{icon:i,iconVersion:"normal"},width:"136",height:"136"}),o(S,{className:"w-full",title:n?"Ваша заявка отправлена":"Не удалось отправить заявку",description:n?s:"Пожалуйста, повторите позднее",headlineVersion:"XS",isEmbedded:!0}),o(za,{type:"button",onClick:r,children:"Хорошо"})]})})})),eo=e=>{const{open:t,close:n}=ue();return{open:(n,i={})=>t(o(Qs,{...e,...n}),i),close:n}},to=e=>t=>t&&Object.entries(e).flatMap((([e,n])=>n(t[e])))||[],no=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:i,amount:a,term:l,annualRevenue:r,serviceType:s,vedTypes:o,region:c,...d}=e,m=t||r?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:i=!1,term:a,amount:l,annualRevenue:r}=e;return t?`Вид эквайринга=${t?.text||""}${ai(t?.key)?`/Онлайн касса=${n}/POS-терминал=${i}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${l}/Срок=${a}/Выручка=${r}`})(e):null,u={...d,...ao(o),...io(c),...m?{partnerComments:m}:{},...s?{typeForm:s}:{}};return Object.fromEntries(Object.entries(u)?.map((([e,t])=>[e,t?.key||t])))},io=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},ao=e=>e?{vedTypes:Object.fromEntries(Hs.map((({id:t})=>[t,t===e])))}:{},lo={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:ni[0],serviceType:_r[0],feedbackMethod:Er[0],serviceDirection:Ar[0],vedTypes:Hs[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""}},ro=d((({text:e,link:t})=>c(w,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(_e,{children:e}):null,t?o(ve,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"!text-left text-primary-main",children:o(_e,{children:t.text})}):null]}))),so=(e,t)=>o(za,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),oo=(e,t,n)=>c("div",{className:"flex col-span-2 gap-xs flex-col w-full items-baseline",children:[e?c("div",{children:[c("div",{className:"flex gap-3 items-center",children:[o(Ni,{...e}),o(ro,{link:t})]}),gn(ei(e,Un).error)]}):o(ro,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),so(n)]}),co={send:async function(e,t=!1){const{typeForm:n,region:i,phone:a="",email:l,birthday:r,desiredMeetingDate:s,inn:o,addressBranch:c,secondaryPhone:d="",bankEmpolee:m,applicationDate:u,serviceDirection:h,...p}=e,g=t&&"Юридическое лицо / ИП"!==h,f="/api/v1"+(g?"/lead":"/sendcorporatelead"),x={typeForm:n,...Ut(i,g),...Wt(l,g),...qt(a),...$t(s,"desiredMeetingDate"),...g?$t(r):{inn:o},..."FEEDBACK"===n?{}:{addressBranch:c,bankEmpolee:m,applicationDate:u,...Ht(d)},...p};try{const e=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(x)});return e?.ok?await e.json():null}catch(e){return null}}},mo=d((({className:e,title:t,typeForm:n="",sections:r=[],button:s,link:d,endpoint:m,additionalParams:h,isContacts:p,data:g,...f})=>{const x=r?.flatMap((e=>e?.inputs))||[],y=((e,t="")=>{const n=Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||lo[e.name||""]])));return n?.serviceType&&"PREMIUMSERVICE"===t&&(n.serviceType=_r[1]),{...n,typeForm:{key:t,text:""}}})(x,n),[b,v]=i(""),w=eo({typeForm:n}),C=l((async(e,t)=>{const n=uo(x,e),i=to(Qn(n));if(!Mn(i(e)))return console.warn("validation fail");const a=no({...e,...h}),l=await co.send(a,"lead"===m)?"OK":"Fail";if(v(l),l&&w.open({responseType:l}),"OK"===l&&g){const e=Zt();Yt({aspectsAttributes:g,aspects:e,ev:t})}return l}),[]),[,{field:S,onSubmit:k,reset:I}]=en(y,{onSubmit:C}),T=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(x)?.name;return a((()=>{"OK"===b&&(v(""),I())}),[b]),c(nn,{className:u("container space-y-m",e),title:t,...f,children:[c("form",{onSubmit:k,children:[r.map(((e,t)=>c("div",{className:u(Js(e.columns),"grid gap-x-m"),children:[Zs(e.title),(e?.inputs||[])?.map(Xs(S,n))]},`section-${t}`))),oo(T?S("consentDataProcessing"):void 0,d,s)]}),p?c("div",{className:"space-y-m",children:[o(N,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),c("div",{className:"flex sm:justify-center gap-xl",children:[c("a",{className:"flex gap-s items-center text-primary-text no-underline",href:"tel:8 (800) 200-78-70","aria-label":"телефон 8 (800) 200-78-70",children:[o(ne,{image:{icon:"PhoneIcon"},width:"24",height:"24"}),o("span",{children:"8 (800) 200-78-70"})]}),c("a",{className:"flex gap-s items-center text-primary-text no-underline","aria-label":"почта ved@rshb.ru",href:"mailto:ved@rshb.ru",children:[o(ne,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]}):null]})})),uo=(e,t)=>e.filter((e=>"secondaryPhone"===e?.name?Boolean(t.secondaryPhone):e)).filter((e=>!e?.condition||e?.condition.values.find((n=>{const i=t?.[e?.condition?.name??""];return n===(i?.key??i)}))));function ho(e){const[t,n]=i(JSON.parse(globalThis.localStorage?.getItem(e)||"null"));return[t,l((t=>{globalThis.localStorage?.setItem(e,JSON.stringify(t)),n(t)}),[e,globalThis.localStorage])]}const po=d((({inputs:e=[],typeForm:t="",field:n,key:i})=>{const a=e.every((e=>Boolean(n(e.name).value))),l=r((()=>e?.filter((e=>e.required))?.some((e=>Boolean(ei(n(e?.name),Jn[e?.name]).error)))),[e]);return o("div",{className:"w-fit",children:o(Ji,{isFoldButtonOnTop:!0,unfoldedByDefault:!0,renderFoldableSection:({isUnfolded:i})=>o(Zi,{isUnfolded:i,className:"flex flex-col pl-2xl",children:e.map(Xs(n,t))}),renderFoldButton:go(c("div",{children:[o(Ni,{value:a,onChange:t=>{for(const i of e){const e=n(i.name);e?.onChange&&e.onChange(t)}},text:"Согласие на все документы"},i),gn(l?"Отметьте все обязательные соглашения":"")]}))})})})),go=e=>t=>c("div",{className:"flex items-start",children:[e,o("button",{onClick:t.onToggle,className:"px-m py-2xs",type:"button",children:o(W,{className:"text-primary-text",name:t.isUnfolded?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})})]}),fo=({field:e,typeForm:t="",inputs:n})=>{const{consentInputs:i,restInputs:a}=xo(n||[]);return i.length>2?c("div",{children:[a.map(Xs(e,t)),o(po,{inputs:i,field:e})]}):(n||[])?.map(Xs(e,t))},xo=e=>({consentInputs:e?.filter((e=>Object.keys(Ql).includes(e.name||"")))||[],restInputs:e?.filter((e=>!Object.keys(Ql).includes(e.name||"")))||[]}),yo={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",organizationPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:ni[0],serviceType:_r[0],feedbackMethod:Er[0],serviceDirection:Ar[0],vedTypes:Hs[0],birthday:void 0,limitedBirthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,processPersonalDataFlg:!1,consentProviderFlg:!1,consentOthersFlg:!1,consentInformFlg:!1,addressRegistration:"",participantDateRegistration:void 0,currency:"",paymentSystem:"",cardCategory:{key:"",text:""},codeWord:"",addressRetail:{key:"",text:""}},bo=(e,t,n="")=>{if(t){const e={...t};return e.limitedBirthday=new Date(e?.limitedBirthday||0),e}return{...Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||yo[e.name||""]]))),typeForm:{key:n,text:""}}},vo=(e,t)=>o(za,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),No=e=>Yi("/user-data/updateUserProfile","PUT",e),wo=e=>Yi("/user-data/updateUserTask","PUT",e),Co=(e,t)=>Boolean(e)&&"string"!=typeof e&&Boolean(e?.errorMessage.startsWith(`Too many request for phoneNumber [${t}]`)),So={width:"118",height:"24"},ko={"bg-white":"color",transparent:"white"},Io={"bg-white":"text-primary-main",transparent:"text-white"},To=(e,t,n)=>o(ne,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:ko[e]},className:Io[e],width:n?.width,height:n?.height}),Bo={"bg-white":"text-primary-text",transparent:"text-white"},Po=d((({className:e,href:t="/",logo:n,children:i,targetBlank:a,bgColor:l="bg-white",showTitle:r=!0,data:s})=>c("a",{className:u("inline-flex items-center font-sans no-underline",e),href:n?.href??t,target:a?"_blank":"_self","aria-label":n?.title??"Россельхозбанк",...ge(s),children:[To(l,n?.image,So),r?i??o("div",{className:"ml-s",children:o(_e,{font:"font-medium",color:Bo[l],size:"",children:n?.title??"Россельхозбанк"})}):null]}))),Ro=d((({phoneNumber:e,close:t,sendCode:n,onClose:r})=>{const[s,d]=i(""),[m,u]=i(""),[h,p]=i(!1),g=l((async()=>{const e=await(i={captchaText:m},Ki("/sms/checkCaptcha","POST",i).then((e=>e.text())).then((e=>"ERROR"!==e)));var i;e?(n?.(),t?.()):p(e)}),[m]),f=l((()=>{(async()=>{d(URL.createObjectURL(await(e=>Ki(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET").then((async e=>e?await e.blob():new Blob)))(e)))})()}),[]);return a(f,[]),o(nr,{head:o(Po,{}),onClose:r,className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex h-36 w-72",children:[o("img",{className:"grow",src:s}),o("div",{onClick:f,className:"flex w-8 items-center justify-center cursor-pointer",children:o(W,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(un,{className:"w-[300px]",onChange:u,value:m,placeholder:"Введите код с картинки"}),h?o("div",{className:"text-error",children:"Неверный код"}):null,c("div",{className:"flex w-[310px] justify-between",children:[o(za,{onClick:t,version:"secondary",children:"Вернуться"}),o(za,{type:"submit",disabled:!m,onClick:g,version:"secondary",children:"Отправить"})]})]})})})),Do=d((({time:e,setTime:t,className:n})=>(a((()=>{const n=setInterval((()=>{t(e-1)}),1e3);return 0===e&&clearInterval(n),()=>{clearInterval(n)}}),[e]),o("span",{className:n,children:Mo(e)})))),Mo=e=>`${`${Math.floor(e/60)}`.padStart(2,"0")}:${(""+e%60).padStart(2,"0")}`,_o=d((({values:e,setValues:t,hasError:n,errorText:r})=>{const[d,m]=i(0),u=s([]);a((()=>{u.current?.[d]?.focus()}),[d]);const h=l((n=>i=>{const{value:a}=i.currentTarget,l=a.slice(0,1);t(e.map(((e,t)=>t===n?l:e))),m(n+1)}),[e]),p=l((n=>i=>{const{key:a}=i;if("Backspace"===a&&!e[n]){const i=n>0?n-1:e.length-1,a=e.map(((e,t)=>t===i?"":e));t(a),m(i)}}),[e]),g=l((n=>{n.preventDefault();const i=n.clipboardData.getData("text"),a=e.map(((e,t)=>t<i.length?i[t]:e));t(a),m(a.length-1)}),[e]);return c("div",{className:"flex flex-col gap-2 text-center",children:[o("div",{children:e.map(((t,i)=>o("input",{type:"number",maxLength:1,value:t,onChange:h(i),onPaste:g,ref:e=>{u.current||(u.current=[]),u.current[i]=e},onFocus:e=>e.target.select(),onKeyDown:p(i),className:Ao(i,e,n)},i)))}),n?o("div",{className:"text-error",children:r}):null]})})),Ao=(e,t,n=!1)=>{const i=!t[e];return`w-20 h-24 text-5xl text-center p-lg m-2 border ${n&&i?"border-error":"border-gray"} rounded-md caret-transparent outline-none`},Eo=d((({isDisabled:e,onClick:t,text:n})=>o(za,{type:"button",onClick:t,disabled:e,children:o(_e,{font:"font-normal",children:n})}))),zo=e=>{e&&(globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token))},Oo=({close:e,values:t})=>{const[n,s]=i(!1),[o,c]=i(""),[d,m]=i(!1),[u,h]=i(0),[p,g]=i(!1),[f,x]=i(0),y=l((()=>{s(!1),c("")}),[]),b=r((()=>0===u&&p),[u,p]),v=r((()=>f>2||!t.every(Boolean)||b),[t]),N=l((async()=>{try{g(!1),h(0),x(f+1),m(!0),await(async e=>Yi("/sms/checkCode","POST",e).then(zo))({smsText:t.join(""),smsCodesSetName:{key:"AUTHENTICATION"}}),y(),e&&e(t.join(""))}catch{m(!1),c(f>1?"Исчерпан лимит ввода смс-кода":"Неверный код"),s(!0)}}),[t,f]);return a((()=>{b?(s(!0),c("Код просрочен")):s(!1)}),[b]),{handleSubmit:N,hasError:n,errorText:o,isLoading:d,timeNextReq:u,isSubmitButtonDisabled:v,setTimeNextReq:h,setIsTimerStarted:g,setAttemps:x}},Fo=d((({close:e=cn,onClose:t=cn,title:n,description:r,__html:s,code:d=!0,codeLength:m=4,textButton:u="",phoneNumber:h="+79999999999"})=>{const[p,g]=i(Array(m).fill("")),{handleSubmit:f,hasError:x,errorText:y,isLoading:b,timeNextReq:v,isSubmitButtonDisabled:N,setTimeNextReq:w,setIsTimerStarted:C,setAttemps:k}=Oo({values:p,close:e}),I=l((async()=>{var e;await(e={phoneNumber:h,smsCodesSetName:{key:"AUTHENTICATION"}},Yi("/sms/sendCode","POST",e).then((t=>!Co(t,e.phoneNumber))))?(k(0),w(180),C(!0)):T.open()}),[]),T=((e,t)=>{const{open:n,close:i,closeAll:a}=ue();return{open:()=>n(o(Ro,{close:i,onClose:t,...e})),close:i,closeAll:a}})({phoneNumber:h,sendCode:I},t);return a((()=>{I()}),[]),o(nr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-xl px-5xl py-0",children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[o(S,{className:"w-full",title:n,description:r,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),d?o(_o,{values:p,setValues:g,errorText:y,hasError:x}):null,Lo(v,w,I),o(De,{itemSize:"list-s",__html:s}),Vo(u,N,f),b?o(Bi,{blur:!1}):null]})})})),Vo=(e,t,n)=>e?o(Eo,{isDisabled:t,onClick:n,text:e}):null,Lo=(e,t,n)=>e?c("div",{className:"flex flex-row text-l font-light text-base",children:["Получить новый код можно через",o(Do,{className:"text-base ml-1",time:e,setTime:t})]}):o(ve,{onClick:n,className:"text-primary-main",children:"Получить новый код"}),jo=()=>{const{open:e,close:t}=ue();return{open:(n,i)=>e(o(Fo,{onClose:t,close:n,...i})),close:t}},qo={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},$o={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},Uo=d((function({handleSubmit:e=cn,onClose:t=cn}){const[n,a]=i(""),[r,s]=i(!1),{open:d,close:m}=ue(),u=Se(),h=l((()=>{m(),e(n)}),[n]),p=l((e=>{a(e),"REFUSE"===e&&s(!0)}),[]),g=r?$o:qo;return o(nr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl",onClose:t,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o("div",{role:"button",onClick:()=>ir(d,Ho,u),children:o(N,{className:"text-center text-balance",headingType:"h2",title:g.title})}),o(w,{align:"text-center",children:g.description}),o(or,{className:"whitespace-normal",orientation:"horizontal",items:Wo,value:n,onChange:p}),o(za,{disabled:!n,type:"button",onClick:h,children:"Продолжить"})]})})})),Wo=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],Ho=2,Yo=e=>{const{open:t,close:n}=ue(),i=jo(),a=(t,a)=>async l=>{n(),"SIGNED"===l&&t?i.open((t=>async n=>{t&&await No({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()})(a),Ko(t)):e()};return{open:(n,i)=>t(o(Uo,{handleSubmit:a(n,i),onClose:e}))}},Ko=e=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:jt(e),textButton:"Отправить",__html:"<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>\n <ul><li>согласие на запрос информации в БКИ</li></ul>"}),Go=d((function({handleClose:e}){const t=Kt(),n=l((async()=>{const e=await(n={redirectUri:t.href},Yi("/esia/getLink","POST",n));var n;e&&t.assign(e.link)}),[]);return o(nr,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",onClose:e,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex items-center justify-around w-full",children:[c("ul",{className:"list-disc",children:[o("li",{children:"Вероятность одобрения выше"}),o("li",{children:"Без справок о доходах и трудоустройстве"}),o("li",{children:"С защитой Ваших данных"})]}),o(ne,{image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"70"})]}),c("div",{className:"flex items-center justify-between w-full m-0",children:[o(za,{type:"button",onClick:n,children:"Заполнить через Госуслуги"}),o(za,{type:"button",version:"secondary",onClick:e,children:"Пропустить"})]})]})})})),Xo={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},Jo={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK"},Zo={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},Qo=e=>Object.entries(e).reduce(((e,[t,n])=>t in Xo?[...e,{contactTypeCd:{key:Xo[t]},value:n}]:e),[]),ec=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in Jo){const i=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:Jo[t]},...i}]}return e}),[]),tc=e=>Object.entries(e).reduce(((e,[t,n])=>t in Zo?[...e,{incomeTypeCd:{key:Zo[t]},value:Number(n||0)}]:e),[]),nc=({inputs:e,programId:t,nextStepLink:n,saveForm:a})=>{const[r,s]=i(""),[,c]=ho("taskId"),[,d]=ho("profileId"),[,m]=ho("participantId"),u=(e=>{const{open:t,close:n}=ue(),i=Kt(),a=l((()=>{n(),i.assign(e)}),[]);return{open:(e={})=>t(o(Go,{handleClose:a}),e),close:n}})(n),h=Yo(u.open),p=jo(),g=l(((e,t,n)=>{m(e),c(t),d(n)}),[]);return{handleSubmit:l((async n=>{const i=to(Qn(e));if(!Mn(i(n)))return console.warn("validation fail");try{const e=await(l={profile:{phone:jt(n.phone)}},Yi("/public-data/createUserProfile","POST",l).then((e=>e?.profile?.id||null)));if(e&&n?.phone){const i=async()=>{try{await ic({programId:t,profileId:e,formData:n,saveUserData:g,saveForm:a}),p.close(),h.open(n.phone,e)}catch{s("Fail")}},l=Object.keys(Ql).filter((e=>n[e])).map((e=>Ql[e]?.text));p.open(i,ac(n?.phone,l))}}catch{s("Fail")}var l}),[]),responseStatus:r}},ic=async({programId:e,profileId:t,formData:n,saveUserData:i,saveForm:a})=>{const l=rc(n);await No(((e,t)=>{const{name:n="",surname:i="",middleName:a="",birthday:l="",phone:r="",email:s="",processPersonalDataFlg:o,consentProviderFlg:c,consentPfrFlg:d,consentPhotoFlg:m,consentAssignmentClaimsFlg:u,consentCollectionFlg:h,consentInformFlg:p}=t;return{profile:{id:e,name:n,surname:i,midname:a,birthDate:l&&Lt(l,!0),email:s,phone:jt(r),processPersonalDataFlg:Boolean(o),consentProviderFlg:Boolean(c),consentPfrFlg:Boolean(d),consentPhotoFlg:Boolean(m),consentAssignmentClaimsFlg:Boolean(u),consentCollectionFlg:Boolean(h),consentInformFlg:Boolean(p)}}})(t,l));const{taskId:r,participantId:s}=await(async e=>await Yi("/user-data/createDraftTask","POST",e)||{})({profileId:t,programId:e});await wo((({participantId:e,taskId:t,profileId:n,formData:i})=>{const{name:a,surname:l,middleName:r,limitedBirthday:s,phone:o,email:c}=i;return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:Kt().origin,id:t,participants:[{birthDate:s&&Lt(s,!0),id:e,midname:r,name:a,surname:l,profile:{id:n},participantContacts:Qo({phone:o&&jt(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"}}]}}})({participantId:s,taskId:r,profileId:t,formData:l})),i(s,r,t),a(n)},ac=(e,t)=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:jt(e),textButton:"Оформить",__html:`<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>${lc(t)}`}),lc=e=>`<ul>${e?.map((e=>"<li>"+e+"</li>")).join("")}</ul>`,rc=e=>{const{consentOthersFlg:t,...n}=e;return{...n,consentCollectionFlg:t,consentAssignmentClaimsFlg:t,consentPhotoFlg:t}},sc=e=>{const{profile:t,addInfo:n,document:i,addressRegistration:a,addressFact:l}=e;return{name:t?.name,surname:t?.surname,middleName:t?.midname,limitedBirthday:t?.birthDate,phone:bs(t?.phone),email:t?.email,dulIssueDateField:i?.dulIssueDate,dulIssuedBy:i?.dulIssuedBy,dulNumber:i?.dulNumber,dulSerie:i?.dulSerie,dulSubdivisionCode:i?.dulSubdivisionCode,snils:n?.snils,birthPlace:n?.birthPlace,addressRegistration:oc(a),addressFact:oc(l),esiaAccountTypeCd:t?.esiaAccountType}},oc=e=>{const{postcode:t,region:n,regionCode:i,locality:a,city:l,street:r,house:s,building:o,block:c,apartment:d}=e,m=[t,n,a||l,r?`ул ${r}`:void 0,s?`д ${s}`:void 0,c?`к ${c}`:void 0,o?`стр ${o}`:void 0,d?`кв ${d}`:void 0].reduce(((e,t)=>t?e?`${e}, ${t}`:t:e),"");return{...e,regionCode:i?.key,fullAddress:m}},cc=e=>{const t=Kt(),[n,r]=i(!1),[s]=ho("profileId"),[o,c]=ho("leadForm"),d=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),m=d.get("code"),u=d.get("state"),h=l((async()=>{if(s&&m&&u){const i=await(n={profileId:s,code:m,state:u,redirectUri:t.href},Yi("/esia/updateProfileEsia","POST",n));i&&c({...o,...sc(i)}),t.assign(e)}var n}),[]);return a((()=>{m?(r(!0),h()):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),{isLoading:n}},dc=d((({className:e,title:t,programId:n="",nextStepLink:l="/credit-lead",sections:r=[],button:s,...d})=>{const m=r?.flatMap((e=>e?.inputs))||[],[h,p]=i(""),{isLoading:g}=cc(l),[f,x]=ho("leadForm"),y=bo(m,f),{handleSubmit:b,responseStatus:v}=nc({inputs:m,programId:n,nextStepLink:l,saveForm:x});if(v){eo({responseType:v}).open()}const[,{field:N,onSubmit:w,reset:C}]=en(y,{onSubmit:b});return a((()=>{"OK"===h&&(p(""),C())}),[h]),o(nn,{className:u("container space-y-m",e),title:t,...d,children:c("form",{onSubmit:w,className:"space-y-m relative",children:[g?o(Bi,{blur:!1}):null,r.map(((e,t)=>c("div",{className:u(Js(e.columns),"grid gap-x-m"),children:[Zs(e.title),fo({field:N,inputs:e?.inputs})]},`section-${t}`))),vo(s)]})})})),mc=d((({title:e,description:t})=>{const n=Se();return c("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[o(ne,{image:{icon:"MagnifierIcon",iconVersion:"normal"},width:"120",height:"120"}),o(S,{title:e,description:t,headlineVersion:n?"L":"S",isEmbedded:!0,className:"space-y-s"})]})})),uc=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",hc=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`});function pc(e,{sensitivity:t,rootRef:n}={}){const i=s(null),l=r((()=>({threshold:gc(t),root:n?.current})),[t,n?.current]);return a((()=>{if(!i.current)return;const t=new IntersectionObserver(e,l);return t.observe(i.current),()=>{t.disconnect()}}),[e,l]),i}function gc(e=0){const t=Math.round(10*e);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const fc=d((({className:e,style:t,idx:n,activeIndex:i,observerOptions:a,children:r,onIntersection:s})=>{const c=pc(l((e=>{e.length&&s&&s(n||0,e[e.length-1])}),[s,n]),a);return o("div",{className:u("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(n===i),ref:c,role:"listitem",children:r})})),xc=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],yc=d((({className:e,itemClassName:t,containerRef:n,activeIndex:i,visibleItemCount:a=0,gap:r=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:p,onVisibleItemsChange:g,onVisibleIndicesChange:f})=>{const x={sensitivity:1,rootRef:n},y=s([]),b=l(((e,t)=>{const n=[...y.current||[]];n[e]=t,y.current=n,g&&g(n),f&&f(vc(n))}),[g,f]),v=a>0?r*Number(a)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?bc(c,v):{},...N?hc(h):{},gap:`${r}px`};return o("div",{className:u("box-border overflow-auto no-scrollbar",d,e),style:C,ref:n,role:"list",children:(S=(e,n)=>o(fc,{className:u(m,a?xc[a-1]:"",{"h-full":N},t),style:w?bc(c/4):{},activeIndex:i,idx:n,observerOptions:x,onIntersection:b,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(S):S(e,0))(p)});var S})),bc=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),vc=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),Nc={"horizontal-list":"w-6","vertical-list":"h-6"},wc=({activeIndex:e,onClick:t,listType:n="horizontal-list"})=>(i,a)=>o("div",{className:u("cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white",a===e?Nc[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(a)},String(a)),Cc=({activeIndex:e,onClick:t})=>(n,i)=>{const a=i===e,l=a?"min-w-[350px] bg-white shadow-dark-blue border-none p-6":"min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",r=a?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=a?"text-l":"text-m group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(i),"aria-label":n?.title,className:u("max-h-28 mt-xs ml-xs relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50 whitespace-nowrap",l),children:[o("div",{className:r,children:n?.title}),o("div",{className:u("text-secondary-text font-light",s),children:n?.description})]},String(i))},Sc=e=>e,kc=(e=Sc)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),Ic=kc(),Tc=(e=Sc)=>kc((t=>-e(t))),Bc=Tc(),Pc=e=>t=>e.scrollWidth/t,Rc=e=>(t,n)=>{e.scrollBy({left:n*Pc(e)(t),behavior:"smooth"})},Dc=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[a,r]=i([]),o=l((e=>{r((t=>{return(n=t)===(i=e)||Boolean(n&&i&&n?.length===i?.length&&n.every(((e,t)=>e===i[t])))?t:e;var n,i})),t&&t(e)}),[t]),[c,d]=a.length?[Tc()(a),kc()(a)]:[-1,-1],m=c>0,u=d<e-1,h=l((()=>{var t;n.current&&(m?Rc(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=l((()=>{n.current&&(u?Rc(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,u]),g=l(((e,t={behavior:"smooth",block:"nearest",inline:"center"})=>{n?.current&&n.current.children[e]?.scrollIntoView(t)}),[n]);return[n,{scrollLeft:h,scrollRight:p,scrollTo:g,canScrollLeft:m,canScrollRight:u,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},Mc={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},_c=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:i="horizontal-list",version:r,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=Se(),[h,p]=Dc({itemCount:s.length}),g=Ac(Boolean(s?.length));a((()=>{s?.length&&t>=0&&h?.current&&p.scrollTo(t,g)}),[t]);const f=l((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o(yc,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(Cc({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",Mc[i],r?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":r,children:Array.from({length:n}).fill(null).map(wc({activeIndex:t,onClick:f,listType:i}))}):null})),Ac=(e=!1)=>({behavior:e?"auto":"smooth"}),Ec=d((({className:e,disabled:t,...n})=>o(ve,{rounded:!0,className:u("group/btn w-12 h-12 min-h-12 max-h-12 flex items-center justify-center shadow-main-black",t?"bg-secondary-light text-secondary-text":"bg-white text-primary-text hover:text-primary-main",e),disabled:t,...n,children:o(ne,{className:"w-4 h-4 min-w-4 min-h-4 rounded-full box-border",image:{icon:"ArrowLeftIcon",iconVersion:"black"},imageClassName:"group-hover/btn:text-primary-main",width:"16",height:"16"})}))),zc=d((e=>o(Ec,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),Oc=d((e=>o(Ec,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),Fc="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",Vc=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:i,isBottom:a})=>{const{canScrollLeft:l,canScrollRight:r,scrollLeft:s,scrollRight:d}=t,m=i&&!a;return c("div",{className:e,children:[n?Lc(t):null,l?o(zc,{className:u(jc(a),m?"left-1":"left-0"),onClick:s}):null,r?o(Oc,{className:u(jc(a),m?"right-1":"right-0"),onClick:d}):null]})})),Lc=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(Fc,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(Fc,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),jc=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),qc=d((({className:e,version:t,gap:n=14,padding:i=16,visibleItemCount:a=1,listType:l="horizontal-list",snapAlign:r,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:h,showDots:p,children:g,onVisibleIndicesChange:f,navButtons:x})=>{const y=Array.isArray(g)?g.length:0,[b,v]=Dc({itemCount:y,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===l?"relative h-full":""),children:[o(yc,{containerRef:b,activeIndex:N,visibleItemCount:a,gap:n,padding:i,listType:l,snapAlign:r,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(Vc,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(x?.length)}),o(_c,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:y,listType:l,version:t,navButtons:x,containerRef:b,containerScroll:v})]})})),$c=({blocksToRender:e,...t})=>o(qc,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:P(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",uc(!0)),children:T(e,t)},String(n))})}),Uc=e=>e%2!=0,Wc=d((({textNode:e,iconNode:t,tag:n,onClick:i,justifyContent:a="between",className:l,role:r,...s})=>c(n,{tag:n,className:u("flex items-center w-full gap-1","between"===a?"justify-between":"justify-center",l),onClick:i,role:r,...s,children:[e?o("div",{children:e}):null,t?o("div",{children:t}):null]}))),Hc=d((({className:e="",label:t,icon:n,dataTheme:i="pc",disabled:a=!1,onClick:l})=>o(Wc,{tag:"button",onClick:l,disabled:a,"data-theme":i,justifyContent:"center",role:"button",className:u("py-4 border border-transparent outline-none focus:border-primary-text space-x-s",a?"bg-main-divider text-main-disabled hover:bg-main-divider":"bg-primary-main text-white hover:bg-primary-hove",e),textNode:o(_e,{size:"text-h4",children:t}),iconNode:n?o(ne,{image:{icon:n,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),Yc=({isUnfolded:e,onToggle:t})=>o(Hc,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),Kc=["ArrowDownIcon","ArrowUpIcon"],Gc="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",Xc=({topItemsCount:e=0,label:t="",block:n,blocksToRender:i=[],...a})=>{const[l,r]=e>0?[i.slice(0,e),i.slice(e)]:[i,[]];return c("div",{className:u("space-y-2xs",{hidden:!i.length}),children:[c("div",{className:u(Gc),children:[P(l,{...a.options,parent:n}),Uc(l.length)?o(Ft,{className:"col-span-6",...a}):null]}),o(Ji,{renderFoldableSection:({isUnfolded:e})=>c(Zi,{className:u(Gc),isUnfolded:e,children:[P(r,{...a.options,parent:n}),Uc(r.length)?o(Ft,{className:"col-span-6",...a}):null]}),renderFoldButton:({isUnfolded:n,onToggle:i})=>o(Hc,{className:u({hidden:e<1}),disabled:!r?.length,label:t,icon:Kc[Number(n)],dataTheme:a.options?.page?.colorPalette,onClick:i})})]})},Jc=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...i})=>{switch(e?.view){case"grid":return c("div",{children:[Zc(n,t),Xc({...e,...i,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[Zc(n,t),$c({...i,blocksToRender:t})]});default:return null}})),Zc=(e,t)=>e&&!t.length?o(mc,{...e}):null,Qc=e=>t=>t.reduce(((t,n,i)=>t.length?t.concat({...e,key:`sep-${i}`},n):[n]),[]),ed=d((({value:e,onChange:t,items:n=[],multiple:i})=>n.map((n=>o(is,{text:n?.title,value:[e].flatMap((e=>e)).includes(n.value),onChange:()=>(n=>{if(!t)return;const a=e?.includes(n);t(i?a?(e||[]).filter((e=>e!==n)):[...e||[],n]:a?[]:[n])})(n.value),type:i?"checkbox":"radio"},n.value))))),td=d((({children:e,filtrationSchema:t,resetButton:n,field:i,reset:a})=>c("form",{className:"flex flex-col @4xl:flex-row justify-between bg-white p-4xl gap-s @4xl:gap-0",children:[c("div",{className:"flex flex-col @4xl:flex-row gap-xl",children:[e,Qc(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(nd(i)).filter(Boolean))]}),n?o("div",{children:o(za,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:a,children:n?.text})}):null]}))),nd=e=>([t,n])=>{const i=n?.type;return"array"===i?id(t,e)(n):null},id=(e,t)=>n=>{const i=n?.items?.enum?.map(((e,t)=>({value:e,title:n?.items?.enumNames?.[t]||""})))||[];return c("div",{className:"flex-1",children:[n?.title?o("div",{className:"mb-m",children:o(_e,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(ed,{items:i,multiple:!n?.single,...t(e)})]},e)};function ad(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const ld=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,rd=(e,t)=>Object.entries(e).map((([n,i])=>"number"==typeof i?Array.isArray(t[n])?((e,t)=>n=>ld(t[e])||ld(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>ld(t[e])||ld(n[e])||sd(t[e])<=sd(n[e]))(n,e):"object"==typeof i&&"min"in i&&"max"in i?((e,t)=>n=>ld(t[e])||ld(n[e])||sd(t[e]?.min)>=sd(n[e]?.min)&&sd(t[e]?.min)<=sd(n[e]?.max))(n,e):Array.isArray(i)?((e,t)=>n=>ld(t[e])||ld(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>ld(t[e])||ld(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),sd=e=>Number(e||0),od=(e,{block:t,page:n,normalize:i=Qt})=>{const a=t?.blocks||[],[l,{field:s,reset:o,update:c}]=en(e),d=r((()=>ad(a,a.map((e=>At(e.content,n?.fallback))))),[a,n?.fallback]),m=l===e?a:((e,t)=>(n=Qt)=>e?.filter((([,e])=>rd(t,n(e)||{}))).map((([e])=>e)))(d,l)(i);return[l,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},cd={},dd={},md=zt((({className:e,filtrationSchema:t=cd,consumerField:n={},resetButton:i,...a})=>{const[,{blocksToRender:l},{field:r,reset:s}]=od(dd,{block:a.block,page:a.options?.page}),d=o(Tn,{className:"w-64",label:n?.title,options:ud(n),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>ud(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...a,children:[o(td,{filtrationSchema:t,field:r,reset:s,children:c("div",{children:[d,o("div",{children:o(za,{type:"reset",className:"mt-lg w-64",onClick:s,version:i?.version,children:i?.text})})]})}),o(Jc,{blocksToRender:l,...a})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),ud=e=>ad(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),hd=(e=!1)=>e?"text-left":"text-center",pd={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},gd=d((({className:e,defaultIconSize:t=44,iconBgVersion:n="primary",size:i,icon:a,...l})=>{const r=String(i?.width||t);return a?o("div",{style:{width:`${r}px`,height:`${r}px`},className:u("rounded-icon object-fit flex justify-center items-center",pd[n],e),children:o(W,{...l,width:"54%",height:"54%",name:a})}):null})),fd=d((({className:e="",title:t,benefitList:n,...i})=>{const a=Se();return c(g,{className:e,defaultPadding:"p-6xl",...i,children:[t?o(N,{headingType:"h3",as:"h2",className:hd(a),title:t}):null,n?.length?o("div",{className:"flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl",role:"list",children:n.map(xd)}):null]})})),xd=({label:e,description:t,__html:n,icon:i,isDotted:a=!1,iconBgVersion:l},r)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[i?.icon?o(gd,{className:"shrink-0",iconBgVersion:l,...i}):null,i?.src?o(ne,{className:"shrink-0",image:i}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(N,{headingType:"h6",children:e}),o(_e,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(De,{__html:n,isDotted:a,itemSize:"list-s"}):null]}):null]},String(r)),yd=e=>({icon:t,title:n,description:i},a)=>c("div",{className:u("flex flex-col gap-1","items-center",{"justify-center":!i&&!n}),children:[n?o(_e,{size:"text-h6",font:"font-normal",align:e,children:n}):null,t?o(ne,{image:t,height:"180",className:"w-auto mx-auto"}):null,i?o(_e,{size:"text-h6",font:"font-normal",align:e,children:i}):null]},String(a)),bd=(e,t,n)=>o("div",{className:`grid gap-2xs ${vd(t)}`,children:e.map(yd(n))}),vd=e=>{switch(e){case"3":return"grid-cols-3";case"4":return"grid-cols-4";default:return"grid-cols-5"}},Nd=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:i="4",subtitle:a,title:l,...r})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...r,children:[o(S,{defaultPadding:"",title:l,description:a,headlineVersion:"M"}),e?.length?bd(e,i,t):null]}))),wd={start:"justify-start",center:"justify-center",end:"justify-end"},Cd=d((({buttons:e,className:t="",align:n,...i})=>{const a=n&&u("flex",wd[n]);return o(g,{className:u("!bg-transparent",a,t),defaultPadding:"p-0",...i,children:je(e)})})),Sd=d((({className:e,title:t,children:n,...i})=>c(g,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...i,children:[t?o(N,{className:"text-center",title:t}):null,n]}))),kd="flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl",Id="flex flex-col lg:max-w-80 lg:w-1/2 gap-2xl",Td="flex flex-col gap-y-xl min-w-52",Bd=d((({value:e,fractionDigits:t,fixed:n,prefix:i,postfix:a})=>o(_e,{size:"text-h3",children:"number"==typeof e?[i,We(t,{fixed:n})(e),a].filter(Boolean).join(" "):e}))),Pd=d((({className:e,title:t,value:n,color:i="text-secondary-text",...a})=>c("div",{className:u("flex justify-between @xl:flex-col",e),children:[t?o(_e,{size:"text-l",font:"font-light",color:i,children:t}):null,n?o(Bd,{value:n,...a}):o(_e,{size:"text-h3",children:"-"})]}))),Rd=(e,t)=>e?o(w,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,Dd=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:i=2,depositeName:a,isShowDepositeName:l,color:r="text-secondary-text"})=>c("div",{children:[o(_e,{size:"text-l",font:"font-light",color:r,children:t}),c("div",{className:"relative",children:[c("div",{className:"flex @xl:justify-center gradient-color-text",children:[o("span",{className:"font-mohave text-title-huge -mt-m tracking-[-15px]",children:We(i,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),a&&l?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:a}):null]})]}))),Md=d((({title:e="Ставка"})=>c("div",{className:"space-y-s min-w-96",children:[o(_e,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(W,{className:"w-10 h-auto lg:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:o(w,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Процентная ставка не найдена, выберите другие параметры"})})]}))),_d=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:i=2,color:a="text-secondary-text",children:l,...r})=>t?c("div",{className:"flex flex-col",children:[o("div",{className:"hidden lg:block min-w-96",children:o(Dd,{title:e,rate:t,unit:n,fractionDigits:i,color:a,...r})}),o(Pd,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:i,fixed:!0,color:a,...r}),l]}):o(Md,{title:e,...r}),Ad=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...i})=>o(sl,{items:e?[`От ${We(1)(i.min||0)} ${n}`,`До ${We(1)(i.max||0)} ${n}`]:[],step:t,...i}),Ed={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},zd={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Od=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:i}=e,[a,l]=((e,t,n)=>{const{maxBonus:i=5e3,prefMonthsNum:a=Ed.prefMonthsNum,prefTravelBonusRate:l=Ed.prefTravelBonusRate,prefRestBonusRate:r=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(l*t)+Math.round(r*n),i);return[c,c*a+Math.min(Math.round(s*t)+Math.round(o*n),i)*(12-a)]})(t||zd,n,i);return{...t,...e,monthBonus:a,yearBonus:l}},Fd=zt((({className:e="",title:t,calcSource:n,buttons:i,footnote:a,...l})=>{const[r,{field:s}]=en({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=Od(r,n);return o(Sd,{className:e,title:t,...l,children:c("section",{className:u(kd,e),children:[c("div",{className:Id,children:[Ad({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),Ad({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?_d({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:Td,children:[f>=0?o(Pd,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,je(i,{isVertical:!0}),Rd(a)]})]})})})),Vd=Math.round(29.5),Ld=(e,t=0)=>e?.sum?e.sum:t,jd=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,qd=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,$d=({items:e,title:t,mobileTitle:n=t,orientation:i="horizontal",value:a,onChange:l,...r})=>c("div",{className:"grid gap-s whitespace-nowrap",children:[t?o("div",{className:"hidden @5xl:block",role:"radiogroup","aria-label":t,children:o(_e,{color:"text-secondary-text",font:"font-light",children:t})}):null,n?o("div",{className:"@5xl:hidden",role:"radiogroup","aria-label":n,children:o(_e,{color:"text-secondary-text",font:"font-light",children:n})}):null,o(or,{orientation:i,items:e,value:e[a?0:1].id,onChange:t=>l&&l(t===e[0].id),...r})]}),Ud=e=>$d({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),Wd=" (c капитализацией)",Hd=({income:e,finalSum:t,postfix:n="₽",buttons:i=[],footnotes:a=[],isCapitalization:l=!1})=>c("div",{className:Td,children:[o(Pd,{title:`Доход в конце срока${l?Wd:""}`,value:e,postfix:n,prefix:"+"}),o(Pd,{title:`Сумма в конце срока${l?Wd:""}`,value:t,postfix:n}),je(i,{isVertical:!0}),a?.map(Rd)]}),Yd=([e,t],n,i=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:Kd([e,t],i),Kd=([e,t],n=[])=>({[e]:n.length?Bc(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?Ic(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),Gd=(e,[t,n],i)=>e>=i[t]&&e<=i[n],Xd={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const Jd={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},Zd=(e,t)=>{const{daysValue:n,moneyValue:i,isPartialWithdrawal:a,isReplenished:l,isMonthlyInterestPayment:r}=e,s=l||a,o=n<90||n>730,c=function(e){const t=e?.rateType?Xd[e?.rateType]:"",{data:n}=ci(t?`/api/v1/depositrates/${t}`:null,Rt);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>r===e.isMonthlyInterestPayment&&Qd(s,e)&&Gd(i,["minSum","maxSum"],e)&&Gd(n,["minDays","maxDays"],e)))||Jd,{rate:m}=d,u=em(m,e),h=i+u,p=c||[Jd];return{...d,...Kd(["minSum","maxSum"],p),...Kd(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},Qd=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,em=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:i,daysValue:a}=t;return n?Math.round(i*Math.pow((1200+e)/1200,a/30)-i):Math.round(i*e*a/365/100)},tm=zt((({className:e="",title:t,buttons:n,footnote:i,bottomFootnote:a,isShowDepositeName:l,defaultParams:r,rateParams:s,...d})=>{const[m,{field:h}]=en({moneyValue:Ld(r,1e5),daysValue:jd(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),p=Zd(m,s),{income:g,finalSum:f,rate:x,depositeName:y}=p;return o(Sd,{className:e,title:t,...d,children:c("section",{className:u(kd,e),children:[c("div",{className:Id,children:[Ad({title:"Сумма, ₽",min:p.minSum,max:p.maxSum,...h("moneyValue"),value:p.moneyValue}),(b={title:"Срок, дней",min:p.minDays,max:p.maxDays,...h("daysValue"),value:p.daysValue},o(sl,{items:[`От ${qd(b.min||0)}`,`До ${qd(b.max||0)}`],step:1,...b})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[nm(p,h),Ud({title:"Выплата процентов",orientation:"vertical",...h("isMonthlyInterestPayment"),className:"sm:flex-col"})]})]}),_d({rate:x,depositeName:y,isShowDepositeName:l}),Hd({income:g,finalSum:f,buttons:n,footnotes:[i,a]})]})});var b})),nm=(e,t)=>c("div",{className:"space-y-s",children:[o(_e,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(Ni,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(Ni,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),im=(e=[],t=!1)=>am([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),am=(e,t)=>{if(!t?.length)return;const n=t?.reduce(((t,n)=>e[0](n.rate,t[0].rate)?[n]:n.rate===t[0].rate?[...t,n]:t),[t[0]]);return n.length>1?n.reduce(((t,n)=>e[1](n,t)?n:t),n[0]):n[0]},lm=({min:e=0,max:t=0,availableMonths:n,...i})=>o(sl,{items:[`От ${rm(e)}`,`До ${rm(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...i}),rm=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,sm=e=>$d({...e,className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),om=({field:e,defParams:t,calcParams:n,map:i,monthsValue:a="maxMonths"})=>{Object.entries(i).forEach((([n,i])=>{e?.(n)?.onChange?.(t?.[i])})),e?.("monthsValue")?.onChange?.(nl(t?.[a],n.minMonths,n.maxMonths))},cm=(e,t)=>{const{isAnnuity:n,moneyValue:i,monthsValue:a,moneyExtra:l}=t;if(0===e)return 0;if(n){const t=e/1200;return l?(i+l)*(t+t/(Math.pow(1+t,a)-1)):i*(t+t/(Math.pow(1+t,a)-1))}return Math.round(i/a)+i*(e/1200)},dm={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},mm=e=>um({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&um({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&um({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&um({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),um=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:i,viewSettingFieldKey:a})=>!!n&&!n[a]||t[i]===e[i],hm=(e,t,n)=>{const{moneyValue:i,monthsValue:a}=e,l=t?.rateRows||[dm],r=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>mm({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=Yd(["minSum","maxSum"],r,l),{minMonths:c,maxMonths:d}=Yd(["minMonths","maxMonths"],r,l),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:i,monthsValue:a})=>e?.find((e=>mm({row:e,userInputParams:t,paramsViewSettings:n})&&Gd(i,["minSum","maxSum"],e)&&Gd(a,["minMonths","maxMonths"],e)))||dm)({rateRows:l,userInputParams:e,paramsViewSettings:n,moneyValue:i,monthsValue:a}),{rate:u}=m,h=cm(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:i,monthsValue:a,monthlyPayment:h}},pm=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),gm={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},fm=zt((({className:e,title:t,calcSource:n,buttons:i,footnote:l,paramsViewSettings:r,defaultParams:s,registerSubmit:d,...m})=>{const h=(p=n?.rateRows,am([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],p));var p;const[g,{field:f,onSubmit:x}]=en({moneyValue:Ld(s,2e5),monthsValue:jd(s,Vd),isAnnuity:Boolean(s?.isAnnuity),isInsurance:Boolean(s?.isEnableInsurance),isSalaryClient:Boolean(s?.isEnableSalaryClient),isPensionClient:Boolean(s?.isEnablePensionClient),isStateEmployee:Boolean(s?.isEnableStateEmployee)});d?.(x);const y=hm(g,n,r),b=sm({title:"Тип платежа",orientation:"vertical",...f("isAnnuity")}),{onChange:v}=f("moneyValue"),{onChange:N}=f("monthsValue");return a((()=>{v&&v(nl(g.moneyValue,y.minSum,y.maxSum))}),[y.minSum,y.maxSum]),a((()=>{N&&N(nl(g.monthsValue,y.minMonths,y.maxMonths))}),[y.minMonths,y.maxMonths]),a((()=>{!pm(s)&&h&&om({field:f,defParams:h,calcParams:y,map:gm,monthsValue:"minMonths"})}),[n,s]),o(Sd,{className:e,title:t,...m,children:c("section",{className:u(kd,e),children:[c("div",{className:Id,children:[Ad({title:"Сумма кредита, ₽",step:500,min:y.minSum,max:y.maxSum,...f("moneyValue"),value:y.moneyValue}),lm({title:"Срок кредита, месяцев",min:y.minMonths,max:y.maxMonths,...f("monthsValue"),value:y.monthsValue}),xm({...y,...r},f),o("div",{className:"sm:hidden",children:b})]}),c("div",{className:u(Td,"@4xl:w-1/2"),children:[o(Pd,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(Pd,{title:"Ставка",value:y?.rate,fractionDigits:2,postfix:"%"}),o(Pd,{title:"Ежемесячный платёж",value:y.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:b}),je(i,{isVertical:!0}),Rd(l)]})]})})})),xm=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(Ni,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(Ni,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(Ni,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(Ni,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),ym=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,i]=t[n-1],[a,l]=t[n];i>=a?t.splice(n-1,2,[e,Math.max(i,l)]):n++}return t},bm={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},vm=(e,t,n)=>{const{moneyValue:i,monthsValue:a}=e,l=t?.[0]?Cm(t[0].minMonths,t[0].maxMonths):0,r=!n?.isShowMonthlyInterestPayment,s=!n?.isShowRemoteRegistration,o=!n?.isShowReplenish,c=!n?.isShowWithdrawn,d=!n?.isShowNewClient,m=t?.find((t=>[wm({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),wm({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),wm({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r}),wm({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,Gd(i,["minSum","maxSum"],t),Gd(a||l,["minMonths","maxMonths"],t)].every(Boolean)))||bm,{rate:u}=m,h=Nm(u,e),p=i+h,g=t||[bm];return{...m,...Kd(["minSum","maxSum"],g),...Kd(["minMonths","maxMonths"],g),availableMonths:ym(g.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,n=1)=>Array.from({length:Math.abs(t-e)/n+1},((i,a)=>t>=e?e+a*n:e-a*n)))(e,t))),...e,defaultMonth:l,income:h,finalSum:p}},Nm=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:i,monthsValue:a}=t;return n?Math.round(i*Math.pow((1200+e)/1200,a)-i):Math.round(i*e*30*a/365/100)},wm=({row:e,userInputParams:t,paramKey:n,isExclude:i})=>i||t[n]===e[n],Cm=(e,t)=>e+Math.round((t-e)/2),Sm=(e="rub")=>"rub"===e,km=(e,t)=>{const{minMonths:n,maxMonths:i}=Kd(["minMonths","maxMonths"],Pm(t,e?.currency)),a=e.monthsValue||Math.round((n+i)/2);return{monthsValue:nl(a,n,i)}},Im=(e,t)=>{const{minSum:n,maxSum:i}=Kd(["minSum","maxSum"],Pm(t,e?.currency)),a=e.moneyValue||n;return{moneyValue:nl(a,n,i)}},Tm=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),Bm=e=>{const t=Sm(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},Pm=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},Rm=(e,t)=>{const n="rub"!==e?.currency?.key;return c("div",{className:"grid gap-lg",children:[c("div",{className:"flex gap-lg",children:[e.isShowReplenish?$d({title:"Пополнение",...t("isReplenish"),value:e.isReplenish,orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,e.isShowWithdrawn?$d({title:"Снятие",...t("isWithdrawn"),value:e.isWithdrawn,orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null]}),Dm(e.isShowReplenish||e.isShowWithdrawn),c("div",{className:"flex gap-lg",children:[e.isShowMonthlyInterestPayment?Ud({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment,orientation:"vertical"}):null,e.isShowRemoteRegistration?(i={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration,orientation:"vertical"},$d({...i,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]}),Dm(e.isShowNewClient),e.isShowNewClient?o(Ni,{text:"Новый вкладчик",...t("isNewClient")}):null]});var i},Dm=(e=!1)=>e?o("div",{className:"border-b border-main-divider w-full"}):null,Mm={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum"},_m={text:"₽",key:"rub"},Am=zt((({className:e,title:t,calcSource:n,buttons:i=[],footnote:r="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=n??{},p=h?.map((e=>e.currency))??[_m],g=l((e=>t=>e?{...t,...Bm(t),...Im(t,e),...km(t,e),...Tm(t,e)}:t)(h),[h]),[f,{field:x}]=en({moneyValue:Ld(d,2e4),monthsValue:jd(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:_m},{normalize:g}),y=x?.("currency")?.value??_m,b=x?.("isNewClient")?.value,v=Pm(h,y),N=vm(f,v,s),{rate:w,income:C,finalSum:S,type:k=""}=N,I=l((()=>{om({field:x,defParams:im(v,b),calcParams:N,monthsValue:"minMonths",map:Mm})}),[x,h]);a((()=>{!pm(d)&&v&&I()}),[d,h]);const T=w===im(v,b)?.rate;return o(Sd,{className:e,title:t,...m,children:c("section",{className:u(kd,e),children:[c("div",{className:Id,children:[c("div",{className:"flex gap-m",children:[Ad({className:"w-full",title:`Сумма, ${y?.text}`,min:N.minSum,max:N.maxSum,...x("moneyValue"),value:N.moneyValue,postfix:y?.text,step:Em(y?.key)}),h&&h?.length>1?o(Dn,{label:"Валюта",options:p,...x("currency")}):null]}),lm({title:"Срок, месяцев",min:N.minMonths,max:N.maxMonths,availableMonths:N.availableMonths,...x("monthsValue"),value:N.monthsValue}),Rm({...N,...s},x)]}),_d({rate:w,children:Om(I,T)}),Hd({income:C,finalSum:S,buttons:[...i,zm(n?.buttons,k)],footnotes:[r],postfix:y?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),Em=(e="")=>Sm(e)?1e3:100,zm=(e=[],t="")=>{const{type:n,...i}=e.find((e=>e.type===t))??{};return i},Om=(e,t=!1)=>t?null:o(za,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),Fm=e=>Vm({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Vm({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Vm=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:i,viewSettingFieldKey:a})=>!!n&&!n[a]||t[i]===e[i],Lm={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},jm=(e,t,n)=>{const{moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r}=e,s=t?.rateRows||[Lm],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Fm({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=Yd(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=Yd(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r})=>e?.find((e=>Fm({row:e,userInputParams:t,paramsViewSettings:n})&&Gd(i+r,["minSum","maxSum"],e)&&Gd(l,["minSumOld","maxSumOld"],e)&&Gd(r,["minSumExtra","maxSumExtra"],e)&&Gd(a,["minMonths","maxMonths"],e)))||Lm)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r}),{rate:p}=h,g=cm(p,e),f=e.oldMonthlyPayment-g;return{...h,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r,monthlyPayment:g,benefit:f}},qm=zt((({className:e="",title:t,calcSource:n,buttons:i,footnote:a,paramsViewSettings:l,...r})=>{const[s,{field:d}]=en({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),m=jm(s,n,l),h=sm({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...d("isAnnuity")});return o(Sd,{className:e,title:t,...r,children:c("section",{className:u(kd,e),children:[c("div",{className:Id,children:[Ad({title:"Остаток долга в других банках, ₽ ",step:500,min:m.minSum,max:m.maxSum-m.maxSumExtra,...d("moneyValue"),value:m.moneyValue}),Ad({title:"Ежемесячный платёж в других банках, ₽",step:500,min:m.minSumOld,max:m.maxSumOld,...d("oldMonthlyPayment"),value:m.oldMonthlyPayment}),lm({title:"Новый срок кредита, месяцев",min:m.minMonths,max:m.maxMonths,...d("monthsValue"),value:m.monthsValue}),$m({...m,...l},d),m.isExtraMoney?Ad({title:"Дополнительная сумма, ₽ ",step:500,min:m.minSumExtra,max:m.maxSumExtra,...d("moneyExtra"),value:m.moneyExtra}):null,o("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:h})]}),c("div",{className:u(Td,"@4xl:w-1/2"),children:[o(Pd,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(Pd,{title:"Ставка",value:m?.rate,fractionDigits:2,postfix:"%"}),o(Pd,{title:"Ежемесячный платёж",value:m.monthlyPayment,postfix:"₽"}),m.benefit>0?o(Pd,{title:"Выгода в месяц",value:m.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:h}),je(i,{isVertical:!0}),Rd(a)]})]})})})),$m=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(Ni,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(Ni,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(Ni,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),Um=d((e=>{const{onChange:t,min:n,max:i,defaultValue:a="0",fractionDigits:r=0,...s}=e,c=tl(e,{normalize:(e=a)=>n&&i?String(nl(Number(Wm(e)),n,i)):Wm(e),format:We(r)}),d=l((e=>t&&t(Wm(e))),[t]);return o(un,{onChange:d,...s,...c})})),Wm=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Hm=d((e=>o(Um,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(_e,{size:"text-xl",font:"font-light",children:"₽"})})}))),Ym={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},Km={amount:1500},Gm=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:l,formType:r="private",...s})=>{const[{amount:d},{field:m}]=en(Km),[h,p]=i(!1);return a((()=>{p(d<=0)}),[d]),c(g,{className:u("flex flex-col items-center",e),defaultPadding:"p-6xl",...s,children:[t?o(N,{className:"pb-lg xl:pb-4xl self-start xl:self-center",headingType:"h3",title:t}):null,c("form",{className:"w-full xl:max-w-[468px]",method:"POST",action:Ym[r],children:[o(Hm,{valid:!h,label:n,max:3e5,min:1,...m("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:d}),l?.text?o(za,{className:"w-full mt-lg",type:"submit",disabled:h,children:l.text}):null]})]})})),Xm=({className:e,text:t="ХИТ"}={})=>c("div",{className:u("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[o(W,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),o(w,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),Jm="relative h-full",Zm={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},Qm=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...i})=>{const{blocks:a}=i.block||{},l=a?.some(nu),r=n?{defaultPadding:"p-6xl pb-m"}:{};return R({...i,renderProps:(n,i,a)=>c("div",{className:eu(n,{someCardsHighlighted:l}),children:[T(n,i,{className:tu(n,{someCardsHighlighted:l,showBorder:!e,cardSize:t}),...r,blockIndex:a}),nu(n)?Xm({className:"absolute top-0 -right-4 z-40"}):null]},String(a))})},eu=(e,{someCardsHighlighted:t})=>u(Jm,t&&(nu(e)?"pt-3xl":"pt-3xl sm:pt-16")),tu=(e,{someCardsHighlighted:t,showBorder:n,cardSize:i="normal"})=>u(Jm,"min-w-80",Zm[i],t&&(nu(e)?"pt-3xl sm:pt-16":"pt-3xl"),uc(n),n&&"h-full"),nu=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,iu=zt((({className:e,visibleItemCount:t=1,noCardBorder:n,arrowsPadded:i=!0,isGap:a=!0,cardSize:l="normal",isNavButtons:r=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o(qc,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:a?16:0,padding:0,arrowsPadded:i,navButtons:r?au(s?.block?.blocks):[],hasBlur:!0,children:Qm({noCardBorder:n,cardSize:l,isNavButtons:r,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),au=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],lu="z-10 border border-solid w-full h-full",ru=u(lu,"absolute hidden @xl:block border-transparent"),su=d((({className:e,title:t,description:n,button:i,...a})=>o(g,{className:u("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...a,children:c("div",{className:"relative h-full",children:[o("div",{className:u(ru,"top-9 right-12 bg-green-dark")}),o("div",{className:u(ru,"top-6 right-8 bg-green")}),o("div",{className:u(ru,"top-3 right-4 bg-green-light")}),c("div",{className:u(lu,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[o(S,{title:t,description:n,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),je([i],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),ou={black:"bg-black",white:"bg-white"},cu=d((({className:e="",title:t,description:n,image:i,price:a,button:l,colors:r=[],align:s="text-left",padding:d,...m})=>o(g,{className:u("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(Te,{className:"h-full",padding:d,title:o(S,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:i?.src?o(ne,{className:"flex justify-center align-center mb-xl",image:i}):null,buttons:je([l],{buttonClassName:"w-full self-end"}),children:[r?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(_e,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(du)]}):null,a?c(_e,{size:"text-h3",align:"text-left",children:[a," ₽"]}):null]})}))),du=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${ou[e]}`},String(t)),mu=d((({icon:e,...t})=>{const n=he(),{text:i,href:a,target:l,onClick:r}=n(t);return i?o("div",{className:u("p-3 rounded-lg bg-white text-secondary-text flex justify-center"),children:o("a",{role:"link",href:a,target:l,onClick:r,children:c("div",{className:"flex flex-col items-center gap-3 break-words max-w-[150px]",children:[e?o(ne,{className:"w-7 h-7 md:w-12 md:h-12",image:{...e,iconVersion:e?.iconVersion},alt:i}):null,o("div",{className:"font-light md:font-normal text-primary-text text-center text-xs md:text-sm whitespace-wrap",children:i})]})})}):null})),uu=d((({className:e,additionalDescription:t,description:n,links:i,title:a,...l})=>o(g,{defaultPadding:"p-5xl",className:u("overflow-hidden",e),...l,children:c("div",{className:"flex flex-col lg:flex-row gap-5 justify-between",children:[c("div",{className:"flex-1",children:[o(S,{isEmbedded:!0,title:a,description:n,as:"h1",align:"text-left",headlineVersion:"XL"}),o(S,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),i?.length?hu(i):null]})}))),hu=e=>o("div",{className:u("lg:grid-cols-9 lg:[&>*]:col-span-2 lg:[&>*:nth-child(14n+2)]:col-span-3 lg:[&>*:nth-child(7n+5)]:col-span-3","lg:[&>*:nth-child(7n+6)]:col-span-3 lg:[&>*:nth-child(7n+7)]:col-span-3 lg:[&>*:nth-child(14n+10)]:col-span-3 lg:w-3/6","grid-cols-3 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+3)]:col-span-2 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+4)]:col-span-2","grid gap-3 lg:gap-5"),children:e.map(((e,t)=>o(mu,{...e},String(t))))}),pu=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"mindboxEvent"===e?{...n,eventJson:t}:n}))),gu=d((({className:e="",href:t,target:n,onClick:i,data:a,children:l})=>{const r=he()({href:t,target:n,onClick:i});return o(t?"a":"div",{className:u("block",e),...t?r:{},role:t?"link":"none",...ge(a),children:l})})),fu=[{origins:["t.me","telegram.org"],iconMapped:{icon:"TelegramIcon"}},{origins:["vk.com"],iconMapped:{icon:"VKIcon"}},{origins:["ok.ru"],iconMapped:{icon:"OkIcon"}},{origins:["apps.apple.com"],iconMapped:{icon:"AppleIcon"}},{origins:["play.google.com"],iconMapped:{icon:"PlayMarketIcon"}},{origins:["appgallery.huawei.com"],iconMapped:{icon:"HuaweiIcon"}},{origins:["youtube.com"],iconMapped:{icon:"YoutubeIcon"}},{origins:["rutube.ru"],iconMapped:{icon:"RutubeIcon"}},{origins:["dzen.ru"],iconMapped:{icon:"DzenIcon"}},{origins:["rustore.ru"],iconMapped:{icon:"RustoreIcon"}}],xu=d((({className:e="",media:t,showButtonText:n,stretched:a,version:l="white",children:r})=>{if(!t?.length)return null;const[s,d]=i(),m=t?.map((e=>{const{href:t,icon:i,text:a}=e,{iconMapped:r}=(e=>fu.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=Le(i)?i:r,c=n?{text:a}:{text:""},m=e?.icon?.iconVersion||"color";return!s&&a&&d(!0),{...e,...c,icon:{...o,iconVersion:m},version:e?.version??l}})),h=u("border border-solid hover:border-transparent border-main-divider","group-data-primary:border-main-divider group-data-gray:border-green group/media",{"basis-auto":!n&&!s},yu(a));return c("div",{className:u("flex flex-col gap-m xl:gap-xs",e),"aria-label":"Социальные сети",children:[o("div",{className:"flex gap-xs",children:je(m,{className:bu(s??!1,a??!1,n),buttonClassName:h})}),r?o(_e,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),yu=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",bu=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),vu=d((({className:e,padding:t,description:n,additionalDescription:i,href:a,icon:l,isDotted:r,__html:s,socialMedia:d=[],target:m,title:h,align:p="text-left",benefits:f,imageOptions:{directionRight:x=!0,isImageAlwaysOnRight:y=true,isImageSecondary:b=!1}={},data:v,...N})=>o(g,{className:u("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...N,children:o(gu,{href:a,target:m,className:"h-full",data:pu(v),children:c(Te,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(S,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...Ze(Le(l)?o(ne,{image:l}):null,x),buttons:d.length?o(xu,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:y,isImageSecondary:b,imageAlign:"center",children:[o(Ve,{benefits:f}),s?o(De,{__html:s,isDotted:r,itemSize:"list-s"}):null,Nu(i,p)]})})}))),Nu=(e,t)=>e?o(w,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,wu=(e,t)=>{const{title:n,description:i,buttons:a}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[n?o("div",{className:"opacity-80",children:o(_e,{size:"text-m",color:"text-secondary-text",children:n})}):null,i?o("div",{className:"mt-2xs",children:o(_e,{size:"text-xl",color:"text-primary-text",children:i})}):null,a?.length?o("div",{className:"text-primary-main",children:je(a)}):null]},String(t))},Cu=d((({className:e="",title:t,align:n="text-center",icon:l,button:r,visibleCellsCount:s=1,cardCells:d=[],options:m,data:h,...p})=>{const f=d.map(wu),[x,y]=s>0?[f.slice(0,s),f.slice(s)]:[f,[]],[b,v]=i(!1);return a((()=>me.subscribe("fold",(e=>{e&&void 0!==m?.parent&&e.parent===m?.parent&&v(e.isUnfolded)}))),[m?.parent]),c(g,{className:u("flex flex-col",e),defaultPadding:"p-2xl",...p,children:[Le(l)?o("div",{className:"self-center",children:o(ne,{image:l})}):null,t?o(N,{className:u("pt-xs",n),headingType:"h5",title:t}):null,r?.text?o(ve,{className:"w-full mt-m mb-lg",...r}):null,y.length?o(Ji,{renderFoldableSection:()=>c("div",{children:[x,o(Zi,{isUnfolded:b,children:y})]}),renderFoldButton:d.length>=s?Su(m?.parent,h,b):null}):o("div",{children:x})]})})),Su=(e,t,n=!1)=>()=>c("button",{className:"w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center",onClick:()=>{void 0!==e&&me.fire("fold",{type:"fold",isUnfolded:!n,parent:e})},type:"button",...n?ge(t):{},children:[o("div",{children:n?"Скрыть":"Подробнее о тарифе"}),o(W,{className:"text-primary-text",name:n?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),ku=d((({className:e,contacts:t,info:n,version:i="secondary",...a})=>c(g,{className:u("flex",e),defaultPadding:"p-6xl",version:i,...a,children:[n?.length?Iu(n):null,t?.length?Iu(t):null]}))),Iu=e=>o("div",{className:"flex gap-5xl grow basis-0",children:e.map(((e,t)=>Tu({column:e,i:t})))}),Tu=({column:e,i:t})=>e?o("div",{className:"flex flex-col gap-xl grow basis-0",children:e.map((({title:e="",description:t,additionalDescription:n,button:i},a)=>c("div",{children:[o(S,{title:e,description:t,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),n?o("div",{className:"mt-xs opacity-80",children:o(w,{size:"text-m",font:"font-light",children:n})}):null,o("div",{className:u({"mt-xl":Boolean(i?.text)}),children:je([i])})]},String(a))))},`col-${String(t)}`):null,Bu=()=>{const e=globalThis.sessionStorage?.getItem("refreshToken"),t=globalThis.sessionStorage?.getItem("accessToken"),n=globalThis.localStorage.getItem("taskId"),i=Kt();if(!t||!e||!n)return i.assign("/"),()=>{};const a=async()=>{const n=await Ki("/auth/refresh","POST",{refresh_token:e,access_token:t});if(401==n?.status&&i.assign("/"),n?.ok){const e=await n.json();globalThis.sessionStorage.setItem("refreshToken",e.refresh_token),globalThis.sessionStorage.setItem("accessToken",e.access_token)}};a();const l=setInterval(a,24e4);return()=>clearInterval(l)},Pu=d((({step:e=10,description:t,showPercentage:n=!0})=>c("div",{children:[o("div",{className:"h-4 w-full bg-gray relative",children:o("div",{className:"h-4 bg-green",style:{width:`${e}%`}})}),c("div",{className:"relative",children:[n?c("div",{className:"absolute left-2/4 text-green",children:[e,"%"]}):null,t?o("div",{className:"text-right mr-4 text-gray",children:t}):null]})]}))),Ru=d((({step:e=1,totalSteps:t=6,stepsTitles:n=[]})=>{const i=r((()=>(e+1)/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e+1," из ",t,"."]}),n[e]||null,o(Pu,{step:i,showPercentage:!1})]})})}));var Du;!function(e){e.process="IN_PROCESS",e.ok="APPROVED",e.fail="CANCELLED",e.rework="REVISION"}(Du||(Du={}));const Mu=e=>Yi("/user-data/getTaskStatus","POST",e),_u=e=>Ki("/user-data/sendSignalToProcess","POST",e),Au=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black",link:i})=>c("div",{className:"flex flex-row items-center w-full min-h-14 bg-main-gray rounded-lg gap-m p-m",children:[o("div",{className:"rounded-full bg-white p-xs",children:o(W,{name:t,width:"24",height:"24",iconVersion:n})}),c("div",{className:"",children:[o(De,{__html:e}),i?.text?o(ve,{className:"text-primary-main",children:i.text}):null]})]}))),Eu=d((({interval:e=0,intervalExpireAction:t=(()=>null),title:n,__html:a})=>{const[l,r]=i(e),s=100-(e-l)/e*100;return c("div",{children:[n?o(S,{title:n,headlineVersion:"S"}):null,c("div",{className:"flex justify-center items-center flex-col",children:[c("div",{className:u("relative flex items-center justify-center w-24 h-24 rounded-full bg-gray text-transparent mb-5"),children:[o("div",{className:"absolute inset-0 rounded-full",style:{background:`conic-gradient(rgb(66, 171, 68) ${s}%, rgb(125, 126, 127) 0deg)`}}),o("div",{className:"z-10 flex items-center justify-center px-4 py-2 rounded-full w-20 h-20 bg-white text-primary-text text-m",children:o(Do,{interval:e,time:l,setTime:e=>{0===e&&t(),r(e)}})})]}),a?o(De,{__html:a}):null]})]})})),zu=d((({title:e,description:t,infoCard:n,sectionInfoTitle:i,sectionInfo:a,sectionAdditionalTitle:l,sectionInfoAdditional:r,buttonText:s,interval:d,...m})=>c(g,{...m,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(S,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(Eu,{interval:d}):null]}),o(Ou,{title:i,items:a}),o(Ou,{title:l,items:r,countColumns:!0}),n?.__html?o(Au,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(ve,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),Ou=({title:e,items:t,countColumns:n=!1})=>{const i=Se();return t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(_e,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",Js(n||i?1:2)),children:t.map(((e,t)=>o("div",{children:Fu(e)},t)))}):null]})]}):null},Fu=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(_e,{color:"text-secondary-text",size:"text-l",children:e}),o(_e,{color:"text-primary-text",size:"text-xl",children:t})]}),Vu=d((()=>o(zu,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Lu=d((()=>{const[e]=ho("leadForm");return o(zu,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:e?.cardCategory?.text}]})})),ju=d((()=>{const[e]=ho("leadForm");return o(zu,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),qu=d((()=>{const[e]=ho("leadForm");return o(zu,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),$u=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],Uu=d((()=>{const[e,t]=i(Du.process),[n]=ho("taskId");return a((()=>{(async()=>{for(const e of $u)await _u({signalType:e,taskId:n})})();const e=l((async()=>{const e=await Mu({taskId:n});e&&e?.statusCd!==Du.process&&(clearInterval(i),t(e.statusCd))}),[]),i=setInterval(e,3e4)}),[]),Wu(e)})),Wu=e=>({IN_PROCESS:o(Lu,{}),CANCELLED:o(Vu,{}),APPROVED:o(qu,{}),REVISION:o(ju,{})}[e]||null),Hu=[{paymentSystem:"",currency:"rub",codeWord:""},{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDateField:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0,methodObtain:"office",addressCourier:{fullAddress:"",fiasCode:""}},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},dependents:void 0,familyMembers:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!1},{disablePeopleFlg:!1,bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:"",addressRetail:{key:"",text:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:"office",deliveryDate:void 0}],Yu=e=>{if(e)try{return new Date(e)}catch(e){return}},Ku=e=>(t,n)=>t.filter((e=>e)).map((t=>[Gu(n,e),Xu(t,e),Ju(t,e),Zu(t,e),Qu(t,e),eh(t,e)].some(Boolean)?{...t,required:!1}:t)),Gu=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Xu=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Ju=({name:e},t)=>"snils"===e&&!t("consentPfrFlg"),Zu=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Qu=({name:e},t)=>"addressFact"===e&&t("addressMatch"),eh=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const i=t(e?.name);return n!==(i?.key??i)})),th=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(Au,{__html:e},`${t}_${n}`))):null},nh=({field:e,inputs:t})=>t.map(Xs(e,"")),ih=({sections:e,field:t,step:n})=>e?.map((({inputs:e=[],columns:i,title:a},l)=>{const r=Ku(ah(t))(e,n),s=r.filter((e=>!eh(e,ah(t))));return c("div",{className:u(Js(i),"grid gap-x-m"),children:[th(s),Zs(a),nh({field:t,inputs:r})]},`section-${l}`)})),ah=e=>t=>e(t)?.value,lh=d((({step:e,onPrevStep:t})=>{const n=6===e;return c("div",{className:"flex justify-between gap-m",children:[o(za,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(za,{type:"submit",children:n?"Отправить заявку":"Далее"})]})})),rh=e=>{const{methodObtain:t,deliveryDate:n=""}=e;return{courierDeliveryFlg:"courier"===t,deliveryDate:(i=n,i?new Date(i).toISOString().split(".")[0]:""),deliveryTimeCd:{value:"TIME_2"}};var i},sh=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},oh=(e,t)=>{switch(e){case 0:return(e=>{const{currency:t,paymentSystem:n,cardCategory:i,codeWord:a}=e;return{currencyCode:t,paymentSystemTypeCd:n,classCard:i,codeWord:a}})(t);case 1:return(e=>{const{name:t,surname:n,middleName:i,limitedBirthday:a="",phone:l="",email:r,sex:s,birthPlace:o,dulIssueDateField:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g="",housing:f,addressRegistration:x,addressFact:y}=e;return{birthDate:Lt(a,!0),midname:i,name:t,surname:n,birthPlace:o,dulIssueDate:Lt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:Lt(g,!0),houseTypeCd:f,participantContacts:Qo({phone:jt(l),email:r}),participantAddresses:ec({addressRegistration:x,addressFact:y}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{beginDate:t,employment:n,organizationName:i,inn:a,legalForm:l,organization:r,amountWorkers:s,employerActivities:o,employerOrganization:c,generalSeniority:d,lastJobExperience:m,experience5Years:u,jobsNumber:h,organizationPhone:p,organizationAddress:g,positionOrganization:f}=e;return{employmentContractDate:Lt(t||"",!0),employmentTypeCd:n,organizationName:i,organizationInn:a,organizationActivityTypeCd:o,organizationTypeCd:r,organizationKindCd:c,employeesNumberCd:s,opf:l,seniority:d,generalSeniority:u,jobsNumber:h,lastWorkDuration:m,payrollCardRshbFlg:!0,positionCd:f,participantContacts:Qo({organizationPhone:p&&jt(p)}),participantAddresses:ec({organizationAddress:g})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:i,children:a,wages:l,mandatoryPayments:r,incomeAverage:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u,snils:h,armyIdFlg:p,conscription:g}=e;return{maritalStatusCd:t,childrenDependents:a,totalDependents:i,otherDependents:n,militaryStatusCd:g,participantIncomes:tc({wages:l,mandatoryPayments:r,incomeAverage:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u}),snils:h?.replaceAll(" ",""),armyIdFlg:p}})(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:i,creditInRshbCd:a}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:i,creditInRshbCd:a}})(t);case 5:return(e=>{const{addressCourier:t}=e;return{participantAddresses:ec({addressCourier:t})}})(t);default:return{}}},ch=({step:e,inputs:t,onNextStep:n,saveStep:i,finishForm:a})=>{const[r]=ho("taskId"),[s]=ho("profileId"),[o]=ho("participantId"),c=l((async l=>{const c=to(Qn(Ku(dh(l))(t,e)));if(!Mn(c(l)))return console.warn("validation fail");i(l);try{r&&s&&o&&await wo((({participantId:e,taskId:t,profileId:n,formData:i,step:a=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:Kt().origin,id:t,...sh(i),authorizedAgentId:i?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...oh(a,i)}],...rh(i)}}))({participantId:o,taskId:r,profileId:s,step:e,formData:l}))}catch(e){return"Fail"}return n(),5===e&&a?.(!0),"OK"}),[]);return{handleSubmit:c}},dh=e=>t=>e[t],mh=d((({step:e,sections:t,onPrevStep:n,onNextStep:i,isFormFinished:a,finishForm:r})=>{const[d,m]=ho("leadForm"),u=((e,t)=>({...Hu[e],...t,limitedBirthday:Yu(t?.limitedBirthday),dulIssueDateField:Yu(t?.dulIssueDateField),participantDateRegistration:Yu(t?.participantDateRegistration),beginDate:Yu(t?.beginDate),deliveryDate:Yu(t?.deliveryDate)}))(e,d),h=s(void 0),p=t?.flatMap((e=>e?.inputs))||[],g=l((e=>{h.current=e}),[]),{handleSubmit:f}=ch({step:e,inputs:p,onNextStep:i,saveStep:m,finishForm:r}),[,{field:x,onSubmit:y}]=en(u,{onSubmit:(e,t)=>{f({...e,...h.current?.(t)})}});return a?o(Uu,{}):c("form",{onSubmit:y,className:"space-y-m",children:[ih({sections:t,field:x,step:e,registerSubmit:g}),o(lh,{step:e,onPrevStep:n})]})})),uh=[[{title:"Параметры карты",inputs:[]},{inputs:[{fieldType:"common",name:"currency",required:!0},{fieldType:"common",name:"paymentSystem",required:!0},{fieldType:"common",name:"cardCategory",required:!0},{fieldType:"common",name:"codeWord",required:!0}]}],[{title:"Персональные данные",columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"name",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"middleName",dadata:!0,filledByEsia:!0},{fieldType:"common",name:"sex",required:!0},{fieldType:"common",name:"limitedBirthday",required:!0,filledByEsia:!0},{fieldType:"common",name:"birthPlace",required:!0},{fieldType:"common",name:"phone",required:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{fieldType:"common",name:"dulSerie",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulNumber",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulIssueDateField",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{fieldType:"common",name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"addressMatch"}]},{columns:2,inputs:[{fieldType:"common",name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{fieldType:"common",name:"housing",required:!0}]},{inputs:[{fieldType:"common",name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{fieldType:"info",text:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{fieldType:"common",name:"employment"},{fieldType:"common",name:"organizationName",required:!0,dadata:!0}]},{columns:2,inputs:[{fieldType:"common",name:"inn",required:!0,dadata:!0},{fieldType:"common",name:"legalForm",required:!0}]},{inputs:[{fieldType:"common",name:"organization",required:!1},{fieldType:"common",name:"amountWorkers",required:!1}]},{columns:2,inputs:[{fieldType:"common",name:"employerActivities",required:!1},{fieldType:"common",name:"employerOrganization",required:!1},{fieldType:"common",name:"generalSeniority",required:!0},{fieldType:"common",name:"lastJobExperience",required:!0},{fieldType:"common",name:"experience5Years",required:!0},{fieldType:"common",name:"jobsNumber",required:!0}]},{inputs:[{fieldType:"common",name:"organizationPhone",label:"Телефон работодателя",required:!0},{fieldType:"common",name:"beginDate",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"positionOrganization",required:!1},{fieldType:"common",name:"partInBusiness",required:!0,condition:{name:"positionOrganization",values:["BUSINESS_OWNER"]}}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{fieldType:"common",name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{fieldType:"common",name:"familyStatus",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"dependents",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"familyMembers"},{fieldType:"common",name:"children",required:!0}]},{title:"Совокупный доход"},{inputs:[{fieldType:"info",text:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{fieldType:"common",name:"wages",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"snils",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"conscription",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"disablePeopleFlg"}]},{inputs:[{fieldType:"common",name:"bankruptcyFlg"}]},{inputs:[{fieldType:"common",name:"shareholderFlg"}]},{inputs:[{fieldType:"common",name:"legalEntityName"}]},{inputs:[{fieldType:"common",name:"creditInRshbCd"}]}],[{title:"Способ получения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"methodObtain"}]},{title:"Адрес",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressCourier",dadata:!0,condition:{name:"methodObtain",values:["courier"]},required:!0},{fieldType:"common",name:"deliveryDate",condition:{name:"methodObtain",values:["courier"]},required:!0},{fieldType:"common",name:"comment",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{fieldType:"common",name:"regionRetail",required:!0,condition:{name:"methodObtain",values:["office"]}},{fieldType:"common",name:"addressRetail",required:!0,condition:{name:"methodObtain",values:["office"]}}]},{inputs:[{fieldType:"info",text:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код",condition:{name:"methodObtain",values:["office"]}},{fieldType:"common",name:"bankEmployeeCode",condition:{name:"methodObtain",values:["office"]}}]}]],hh=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],ph=d((({className:e,...t})=>{const[n,d]=i(0),m=s(null),h=l((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);a(Bu,[]);const p=l((()=>{d((e=>Math.min(e+1,6))),h()}),[]),f=l((()=>{d((e=>Math.max(e-1,0))),h()}),[]),x=r((()=>uh[n]),[n]),[y,b]=i(!1);return o(g,{className:u("bg-transparent",e),defaultPadding:"p-0",...t,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[y?null:o(Ru,{stepsTitles:hh,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(mh,{step:n,sections:x,onNextStep:p,onPrevStep:f,isFormFinished:y,finishForm:b},String(n))})]})})})),gh=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const i=r((()=>e/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e," из ",t,"."]}),n[e]||null,o(Pu,{step:i,showPercentage:!1})]})})})),fh=d((({title:e,description:t,infoCard:n,sectionInfoTitle:i,sectionInfo:a,sectionAdditionalTitle:l,sectionInfoAdditional:r,buttonText:s,interval:d,intervalExpireAction:m=(()=>{}),...u})=>c(g,{...u,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(S,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(Eu,{interval:d,intervalExpireAction:m}):null]}),o(xh,{title:i,items:a}),o(xh,{title:l,items:r,countColumns:!0}),n?.__html?o(Au,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(ve,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),xh=({title:e,items:t,countColumns:n=!1})=>{const i=Se();return t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(_e,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",Js(n||i?1:2)),children:t.map(((e,t)=>o("div",{children:yh(e)},t)))}):null]})]}):null},yh=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(_e,{color:"text-secondary-text",size:"text-l",children:e}),o(_e,{color:"text-primary-text",size:"text-xl",children:t})]}),bh=d((()=>o(fh,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),vh=d((({handleExpireTimer:e})=>{const[t]=ho("leadForm");return o(fh,{interval:300,intervalExpireAction:e,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Цель кредита",description:"На любые цели"},{label:"Сумма",description:t?.moneyValue?.toLocaleString()+" ₽"},{label:"Срок кредита",description:t?.monthsValue+" мес"},{label:"Тип платежа",description:t?.isAnnuity?"Аннуитетный":"Дифференцированный"}]})})),Nh=d((()=>{const[e]=ho("leadForm");return o(fh,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),wh=d((()=>{const[e]=ho("leadForm");return o(fh,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),Ch=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],Sh=d((()=>{const[e,t]=i(Du.process),[n]=ho("taskId");a((()=>{(async()=>{for(const e of Ch)await _u({signalType:e,taskId:n})})();const e=setInterval((()=>n&&Mu({taskId:n}).then((n=>{n?.statusCd&&n.statusCd!==Du.process&&(clearInterval(e),t(n.statusCd))}))),3e4);return()=>clearInterval(e)}),[]);return kh(e,(()=>t(Du.rework)))})),kh=(e,t)=>({IN_PROCESS:o(vh,{handleExpireTimer:t}),CANCELLED:o(bh,{}),APPROVED:o(wh,{}),REVISION:o(Nh,{})}[e]||null),Ih=[{moneyValue:0,monthsValue:0,isAnnuity:!1,isInsurance:!1,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1},{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDateField:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},dependents:void 0,familyMembers:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!1},{disablePeopleFlg:!1,bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:"",addressRetail:void 0,bankEmployeeCode:void 0}],Th=e=>{if(e)try{return new Date(e)}catch(e){return}},Bh=e=>(t,n)=>t.filter((e=>e)).map((t=>[Ph(n,e),Rh(t,e),Dh(t,e),Mh(t,e),_h(t,e),Ah(t,e)].some(Boolean)?{...t,required:!1}:t)),Ph=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Rh=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Dh=({name:e},t)=>"snils"===e&&!t("consentPfrFlg"),Mh=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,_h=({name:e},t)=>"addressFact"===e&&t("addressMatch"),Ah=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const i=t(e?.name);return n!==(i?.key??i)})),Eh=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(Au,{__html:e},`${t}_${n}`))):null},zh=({field:e,inputs:t})=>t.map(Xs(e,"")),Oh=({sections:e,field:t,step:n})=>e?.map((({inputs:e=[],columns:i,title:a},l)=>{const r=Bh(Fh(t))(e,n);return c("div",{className:u(Js(i),"grid gap-x-m"),children:[Eh(r),Zs(a),zh({field:t,inputs:r})]},`section-${l}`)})),Fh=e=>t=>e(t)?.value,Vh=d((({step:e,onPrevStep:t})=>{const n=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(za,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(za,{type:"submit",children:n?"Отправить заявку":"Далее"})]})})),Lh=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},jh={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIAL",value:"Дифференцированный "}},qh=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:i}=e;return{loanAmount:t,creditPeriod:n,paymentTypeCd:jh[i?"annuity":"differential"]}},$h=(e,t)=>{switch(e){case 0:default:return{};case 1:return(e=>{const{name:t,surname:n,middleName:i,limitedBirthday:a="",phone:l="",email:r,sex:s,birthPlace:o,dulIssueDateField:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g="",housing:f,addressRegistration:x,addressFact:y}=e;return{birthDate:Lt(a,!0),midname:i,name:t,surname:n,birthPlace:o,dulIssueDate:Lt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:Lt(g,!0),houseTypeCd:f,participantContacts:Qo({phone:jt(l),email:r}),participantAddresses:ec({addressRegistration:x,addressFact:y}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{beginDate:t,employment:n,organizationName:i,inn:a,legalForm:l,organization:r,amountWorkers:s,employerActivities:o,employerOrganization:c,generalSeniority:d,lastJobExperience:m,experience5Years:u,jobsNumber:h,organizationPhone:p,organizationAddress:g,positionOrganization:f}=e;return{employmentContractDate:Lt(t||"",!0),employmentTypeCd:n,organizationName:i,organizationInn:a,organizationActivityTypeCd:o,organizationTypeCd:r,organizationKindCd:c,employeesNumberCd:s,opf:l,seniority:d,generalSeniority:u,jobsNumber:h,lastWorkDuration:m,payrollCardRshbFlg:!0,positionCd:f,participantContacts:Qo({organizationPhone:p&&jt(p)}),participantAddresses:ec({organizationAddress:g})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:i,children:a,confirmationIncome:l,wages:r,mandatoryPayments:s,incomeAverage:o,additionalIncome:c,otherIncome:d,otherPayments:m,rentalIncome:u,retirementIncome:h,snils:p,armyIdFlg:g,conscription:f}=e;return{maritalStatusCd:t,totalDependents:i,incomeCertificateCd:l,otherDependents:n,childrenDependents:a,militaryStatusCd:f,participantIncomes:tc({wages:r,mandatoryPayments:s,incomeAverage:o,additionalIncome:c,otherIncome:d,otherPayments:m,rentalIncome:u,retirementIncome:h}),snils:p?.replaceAll(" ",""),armyIdFlg:g}})(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:i,creditInRshbCd:a}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:i,creditInRshbCd:a}})(t)}},Uh=({step:e,inputs:t,onNextStep:n,saveStep:i,finishForm:a})=>{const[r]=ho("taskId"),[s]=ho("profileId"),[o]=ho("participantId"),c=l((async l=>{const c=to(Qn(Bh(Wh(l))(t,e)));if(!Mn(c(l)))return console.warn("validation fail");i(l);try{r&&s&&o&&await wo((({participantId:e,taskId:t,profileId:n,formData:i,step:a=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:Kt().origin,id:t,authorizedAgentId:i?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...$h(a,i)}],...qh(i),...Lh(i),esiaAccountTypeCd:{key:i?.esiaAccountTypeCd?.key}}}))({participantId:o,taskId:r,profileId:s,step:e,formData:l}))}catch(e){return"Fail"}return n(),5===e&&a?.(!0),"OK"}),[]);return{handleSubmit:c}},Wh=e=>t=>e[t],Hh=d((({step:e,sections:t,onPrevStep:n,onNextStep:i,renderStep:a=Oh,isFormFinished:r,finishForm:d})=>{const[m,u]=ho("leadForm"),h=((e,t)=>({...Ih[e],...t,limitedBirthday:Th(t?.limitedBirthday),dulIssueDateField:Th(t?.dulIssueDateField),participantDateRegistration:Th(t?.participantDateRegistration),beginDate:Th(t?.beginDate),deliveryDate:Th(t?.deliveryDate)}))(e,m),p=s(void 0),g=t?.flatMap((e=>e?.inputs))||[],f=l((e=>{p.current=e}),[]),{handleSubmit:x}=Uh({step:e,inputs:g,onNextStep:i,saveStep:u,finishForm:d}),[,{field:y,onSubmit:b}]=en(h,{onSubmit:(e,t)=>{x({...e,...p.current?.(t)})}});return r?o(Sh,{}):c("form",{onSubmit:b,className:"space-y-m",children:[a({sections:t,field:y,step:e,registerSubmit:f}),o(Vh,{step:e,onPrevStep:n})]})})),Yh=[[],[{title:"Персональные данные",columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"name",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"middleName",dadata:!0,filledByEsia:!0},{fieldType:"common",name:"sex",required:!0},{fieldType:"common",name:"limitedBirthday",required:!0,filledByEsia:!0},{fieldType:"common",name:"birthPlace",required:!0,filledByEsia:!0},{fieldType:"common",name:"phone",required:!0,filledByEsia:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{fieldType:"common",name:"dulSerie",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulNumber",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulIssueDateField",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{fieldType:"common",name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"addressMatch"}]},{columns:2,inputs:[{fieldType:"common",name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{fieldType:"common",name:"housing",required:!0}]},{inputs:[{fieldType:"common",name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{fieldType:"info",text:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{fieldType:"common",name:"employment"},{fieldType:"common",name:"organizationName",required:!0,dadata:!0}]},{columns:2,inputs:[{fieldType:"common",name:"inn",required:!0,dadata:!0},{fieldType:"common",name:"legalForm",required:!0}]},{inputs:[{fieldType:"common",name:"organization",required:!1},{fieldType:"common",name:"amountWorkers",required:!1}]},{columns:2,inputs:[{fieldType:"common",name:"employerActivities",required:!1},{fieldType:"common",name:"employerOrganization",required:!1},{fieldType:"common",name:"generalSeniority",required:!0},{fieldType:"common",name:"lastJobExperience",required:!0},{fieldType:"common",name:"experience5Years",required:!0},{fieldType:"common",name:"jobsNumber",required:!0}]},{inputs:[{fieldType:"common",name:"organizationPhone",label:"Телефон работодателя",required:!0},{fieldType:"common",name:"beginDate",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"positionOrganization",required:!1},{fieldType:"common",name:"partInBusiness",required:!0,condition:{name:"positionOrganization",values:["BUSINESS_OWNER"]}}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{fieldType:"common",name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{fieldType:"common",name:"familyStatus",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"dependents",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"familyMembers"},{fieldType:"common",name:"children",required:!0}]},{title:"Совокупный доход"},{inputs:[{fieldType:"info",text:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{fieldType:"common",name:"confirmationIncome",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"wages",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"snils",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"conscription",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"disablePeopleFlg"}]},{inputs:[{fieldType:"common",name:"bankruptcyFlg"}]},{inputs:[{fieldType:"common",name:"shareholderFlg"}]},{inputs:[{fieldType:"common",name:"legalEntityName"}]},{inputs:[{fieldType:"common",name:"creditInRshbCd"}]}],[{title:"Отделение Банка",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"regionRetail",required:!0}]},{inputs:[{fieldType:"common",name:"addressRetail",required:!0}]},{title:"Код представителя Банка",columns:1,inputs:[]},{inputs:[{fieldType:"info",text:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код"}]},{inputs:[{fieldType:"common",name:"bankEmployeeCode"}]}]],Kh=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Отделение Банка"],Gh=d((({className:e,...t})=>{const[n,d]=i(0),m=s(null),h=l((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);a(Bu,[]);const p=l((()=>{d((e=>Math.min(e+1,5))),h()}),[]),f=l((()=>{d((e=>Math.max(e-1,0))),h()}),[]),x=r((()=>Yh[n]),[n]),y=0===n,[b,v]=i(!1);return o(g,{className:u("bg-transparent",e),defaultPadding:"p-0",...t,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[y||b?null:o(gh,{stepsTitles:Kh,step:n,totalSteps:5}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(Hh,{step:n,sections:x,onNextStep:p,onPrevStep:f,isFormFinished:b,finishForm:v,renderStep:y?({registerSubmit:e,field:t})=>o(fm,{defaultParams:{sum:t("moneyValue").value,period:t("monthsValue").value,isAnnuity:t("isAnnuity").value},title:"Калькулятор кредита",footnote:"Расчёт является предварительным. Точные условия будут предоставлены в отделении Банка.",calcSource:{$ref:"/wcms-resources/credit-calculator-data.json"},registerSubmit:e}):void 0},String(n))})]})})})),Xh=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,Jh=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),Zh=1e9,Qh={sum:{min:1e4,max:Zh},period:3},ep=zt((({className:e,filtrationSchema:t={},resetButton:n,sumInput:i,periodInput:a,...l})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=od(Qh,{block:l.block,page:l.options?.page,normalize:e=>({...e,period:tp(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=np(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...l,children:[o(td,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(Hm,{label:i?.title,min:500,max:Zh,...d("sum",{parse:e=>({min:Number(e),max:Zh}),format:({min:e})=>String(e)})}),o(sl,{title:a?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(Jc,{blocksToRender:r,...l})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),tp=e=>Dt((e?.paramsSource?.rateRows||[]).filter(Xh).flatMap((e=>Jh(e.minMonths,e.maxMonths)))),np=e=>Dt(e.flatMap((e=>e||[])).filter(Xh).flatMap((e=>Jh(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],ip=[{key:"10"},{key:"50"},{key:"100"}],ap=({itemCount:e,onItemCountChange:t})=>{const n=l((({key:e})=>t(Number(e))),[]);return c("div",{className:"mt-2 @lg:mt-0 items-center gap-s hidden @lg:flex",children:[o("span",{children:"Показать по"}),o(Tn,{className:"min-w-20",onChange:n,value:{key:String(e)},options:ip,iconVersion:"black"})]})},lp="py-m @lg:px-lg px-m rounded-md cursor-pointer text-center min-w-10 @lg:min-w-0 hover:bg-primary-hover hover:text-white",rp=(e,t)=>{const{currentPage:n,onPageChange:i,totalPages:a}=e,l=t+1;return l===n?o("div",{"aria-current":"true",className:"py-m @lg:px-lg px-m bg-primary-main text-center min-w-10 @lg:min-w-0 text-white rounded-md",children:l},String(t)):1!==l&&l!==a&&((e,t,n)=>e<t&&e>=t-1||e<=t+1&&e>t||((e,t,n)=>t<=2&&e<=t+2||t>=n-1&&e>=n-3)(e,t,n))(l,n,a)?o("div",{onClick:()=>i(l),className:lp,"aria-label":`Страница ${l}`,children:l},String(t)):null},sp={width:"24",height:"24"},op=({currentPage:e,onPageChange:t,totalPages:n})=>{const i=r((()=>Array.from({length:n}).fill({currentPage:e,onPageChange:t,totalPages:n})),[n,e]),a=l((()=>{e>1&&t(e-1)}),[e]),s=l((()=>{e<n&&t(e+1)}),[e,n]),d=l((()=>t(1)),[]),m=l((()=>t(n)),[n]);return c("div",{className:"flex gap-m items-center",children:[o("div",{onClick:a,children:o(W,{name:"ArrowLeftIcon",iconVersion:"black",imageClassName:cp(1===e),...sp})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:lp,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,i.map(rp),e<n-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<n?o("div",{onClick:m,className:lp,"aria-label":`Страница ${n}`,children:n}):null]}),o("div",{onClick:s,children:o(W,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:cp(e===n),...sp})})]})},cp=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",dp=({currentPage:e,onPageChange:t,totalPages:n,itemCount:i,onItemCountChange:a})=>c("div",{className:"mt-3xl flex justify-between flex-col @lg:flex-row items-center select-none",role:"navigation","aria-label":"Пагинация",children:[o(op,{currentPage:e,onPageChange:t,totalPages:n}),i&&a?o(ap,{itemCount:i,onItemCountChange:a}):null]}),mp=d((({className:e,value:t,autoFocus:n,onChange:i,onFocus:a,placeholder:r="Поиск по сайту"})=>{const s=l((e=>{i&&i(e.target?.value||"")}),[i]);return c("div",{className:u("relative",e),role:"form",children:[o("div",{className:"absolute h-full flex items-center pl-m pointer-events-none",children:o(ne,{image:{icon:"LoupeIcon",iconVersion:"black"},width:"24",height:"24"})}),o("input",{className:u("h-14 w-full px-10 text-l text-black box-border rounded-md",dn),value:t,type:"text",name:"search-bar-input",placeholder:r,autoFocus:n,onChange:s,onFocus:a})]})})),up=d((({field:e,onClearFilter:t,filtrationState:n})=>c("div",{className:"grid grid-cols-12 mb-3xl @lg:space-x-xl",children:[o(mp,{className:"col-span-12 @lg:col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),o(jl,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период от",maxDate:n.endDate,...e("startDate")}),o(jl,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период до",minDate:n.startDate,...e("endDate")}),o("div",{className:"col-span-12 @lg:col-span-2 mt-8 @lg:mt-auto",children:o(za,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),hp=({title:e,timestamp:t,publicId:n})=>{const i=he(),{href:a}=i({href:`/api/v1/depository/${n}/file`});return c("div",{className:"flex gap-3 items-center py-lg border-gray border-opacity-50 border-b",children:[null,c("div",{className:"flex flex-col gap-x-6xl lg:flex-row lg:items-center",children:[t?o(_e,{size:"text-m","font-weight":"font-light",children:Lt(t)}):null,o("a",{className:"text-h6 hover:text-primary-active",href:a,download:!0,"aria-label":"Скачать",children:e})]})]},n)},pp="/api/v1/depository",gp={startDate:void 0,endDate:void 0,query:""},fp=zt((({className:e,...t})=>{const[n,a]=i(0),[r,s]=i(10),[d,{field:m,reset:h}]=en(gp),{totalPages:p=0,items:f=[]}=(({size:e,page:t,query:n,startDate:i,endDate:a})=>{const l=i?Lt(i,!0):"",r=a?Lt(a,!0):"",s=new URLSearchParams(pp);s.set("page",String(t)),s.set("size",String(e)),s.set("query",n),s.set("timestampStart",l),s.set("timestampEnd",r);const o=`?${s.toString()}`,{data:c}=ci(pp+o,Rt);return{items:c?.content,totalPages:c?.totalPages}})({size:r,page:n,...d}),x=l((e=>a(e-1)),[]),y=l((e=>{r!==e?(s(e),a(0)):s(e)}),[]);return c(g,{className:u(e,"container p-6xl"),...t,children:[o(up,{filtrationState:d,field:m,onClearFilter:h}),c("div",{className:"flex flex-col",children:[c("div",{className:"grid grid-cols-12 pb-lg border-gray border-opacity-50 border-b",children:[o("div",{className:"col-span-4 @lg:col-span-2 hidden @lg:block",children:o(_e,{size:"text-m",color:"text-secondary-text",children:"Дата"})}),o("span",{className:"col-span-8 @lg:col-span-10 hidden @lg:block",children:o(_e,{size:"text-m",color:"text-secondary-text",children:"Тема"})})]}),f.length?f.map((e=>o(hp,{...e},String(e.publicId)))):o(mc,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(dp,{currentPage:n+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:y})]})]})})),xp=e=>"Image"===e?.contentType&&e?.image?o(ne,{image:e.image}):"Code"===e?.contentType&&e.code?o("div",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:e.code}):null,yp=d((({className:e="",title:t,description:n,error:i,button:a,...l})=>c(g,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...l,children:[o("div",{className:"flex justify-center",children:xp(i)}),o(S,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),a?.text?o(ve,{version:a?.version,text:a?.text,...a}):null]})));function bp(e,t){for(const[n,i]of e.entries())null!=i?t.setItem(n,i):t.removeItem(n)}const vp={};function Np(e,t=vp){const n=s(null),o=function(){const[,e]=i(0);return l((()=>e((e=>(e+1)%65536))),[])}();return a((()=>e.bus.watch((e=>{n.current?.has(String(e.type))&&o()}))),[e,o]),r((()=>new Proxy(t,{get:(t,i)=>(n.current||=new Set,n.current.add(i),e.getItem(i)),has:(t,i)=>(n.current||=new Set,n.current.add(i),e.hasItem(i)),set:(t,n,i)=>(e.setItem(n,i),!0),deleteProperty:(t,n)=>(e.removeItem(n),!0)})),[e])}const wp=new class{bus;store=new Map;get size(){return this.store.size}constructor(e=new de){this.bus=e}hasItem(e){return this.store.has(e)}getItem(e){return this.store.get(e)}entries(){return this.store.entries()}setItem(e,t){this.store.set(e,t),this.bus.subject(e,t)}removeItem(e){this.store.delete(e),this.bus.subject(e,null)}};var Cp,Sp;function kp(e){return Np(wp,e)}Cp=wp,Sp=new class{storage;bus;get size(){return this.storage?.length??0}constructor(e,t=new de){this.storage=e,this.bus=t}hasItem(e){return Boolean(this.storage?.getItem(String(e)))}getItem(e){const t=this.storage?.getItem(String(e))??null;try{return JSON.parse(String(t))}catch(e){return null}}entries(){return Array.from({length:this.size},((e,t)=>{const n=String(this.storage?.key(t));return[n,this.getItem(n)]}))}setItem(e,t){null!==t?this.storage?.setItem(String(e),JSON.stringify(t)):this.storage?.removeItem(String(e)),this.bus?.subject(e,t)}removeItem(e){this.storage?.removeItem(String(e)),this.bus?.subject(e,null)}}(globalThis?.localStorage),bp(Cp,Sp),bp(Sp,Cp),Cp.bus.watch((({type:e,event:t})=>{null!=t?Sp.setItem(e,t):Sp.removeItem(e)}));const Ip="/api/v1/region";function Tp(e="Москва"){return kp().location??{name:e}}function Bp(e="Москва"){const t=kp(),n=l((async()=>{if(!t.location){const n=await Pt(Ip);t.location=n??{name:e}}}),[t,e]);return ci(Ip,n),t}var Pp;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(Pp||(Pp={}));const Rp=new Intl.NumberFormat("ru",{style:"currency",currency:Pp.RUB}),Dp=e=>e?Rp.format(e):"",Mp="text-m font-light text-secondary-text ",_p=`${Mp} text-left`,Ap=`${Mp} pl-5xl text-center`,Ep=`${Mp} pl-5xl text-right`,zp={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},Op=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:_p,children:o(_e,{size:"text-m",children:"Валюта"})}),o("th",{className:Ap,children:o(_e,{size:"text-m",children:"Купить"})}),o("th",{className:Ep,children:o(_e,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(Fp)})]}))),Fp=e=>{const t=e?.currency?.currency;return c("tr",{className:"pb-2xs text-h6",children:[o("td",{className:"pt-m m-auto flex text-left",children:c("div",{className:"flex items-center gap-xs",children:[t?o(ne,{image:{icon:zp[t]},width:"24",height:"24"}):null,o(_e,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(_e,{size:"text-h6",children:Dp(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(_e,{size:"text-h6",children:Dp(e?.buyExchangeRate)})})]},t)},Vp={icon:"GpsIcon"},Lp=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(gd,{...Vp,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(w,{size:"text-l",color:"text-primary-main",children:t}):null,o(w,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),jp=(e,t,n)=>{const i=Number(qp(e))*Math.pow(t,n?-1:1);return Number.isInteger(i)?i:((e,t=2)=>{const n=10**t;return Math.round(parseFloat(String(e))*n)/n})(i)},qp=e=>e.replace(/[^\d.,]/g,"").replace(",",".");function $p(e){if(!e)throw new Error("Value should be fulfilled");return e}const Up=e=>t=>{const[,n]=$p(e.find((([e])=>e(t))));return n(t)},Wp=e=>Up(e.map((([e,t])=>[e,()=>t])));Wp.if=e=>new Hp(void 0,e);class Hp{parent;predicate;unit;get entry(){return[$p(this.predicate),$p(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new Hp(this,e)}then(e){return new Hp(this.parent,this.predicate,e)}else(e){return Up([...Yp(this),[()=>!0,e]])}}const Yp=e=>[...e?.parent?Yp(e.parent):[],e.entry],Kp=e=>Wp([[e=>e.value!==Pp.RUB&&e.oppositeValue!==Pp.RUB,()=>e.handleConvert(e.value,Pp.RUB)],[e=>e.value===Pp.RUB&&e.oppositeValue===Pp.RUB,()=>e.handleConvert(e.value,Pp.USD)],[e=>e.value===Pp.RUB&&e.oppositeValue===Pp.RUB,()=>e.handleConvert(e.value,Pp.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function Gp(e){const{placeholder:t,rates:n,selected:i,value:a,setValue:l,setSelected:r}=e,s=n.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:i,text:i};return c("div",{className:"relative flex",children:[o(un,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:a,onChange:l}),s.length?o(Tn,{className:"absolute right-0",isBorder:!1,onChange:e=>r(e.key),options:s,value:d}):null]})}const Xp=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:a})=>{const[r,s]=i({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||Pp.RUB,selectBuy:n?.[0]?.currency?.currency||Pp.USD}),d=l((e=>s((t=>({...t,...e})))),[]);return c("div",{className:`flex flex-col gap-m pt-2xl ${e}`,children:[t&&n?c("div",{className:"grid gap-m",children:[Gp({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:Jp(r,d,n),value:r.inputSell,setValue:e=>Qp(d,n)(e,r.selectSell,r.selectBuy)}),Gp({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:Zp(r,d,t),value:r.inputBuy,setValue:e=>eg(d,t)(e,r.selectBuy,r.selectSell)})]}):null,a?.text?o(ve,{text:a.text,version:a?.version,...a}):null]})})),Jp=(e,t,n)=>i=>{t({selectSell:i}),Kp({value:i,oppositeValue:e.selectBuy,handleConvert:(i=e.selectSell,a=e.selectBuy)=>{Qp(t,n)(e.inputSell,i,a)}})},Zp=(e,t,n)=>i=>{t({selectBuy:i}),Kp({value:i,oppositeValue:e.selectSell,handleConvert:(i=e.selectBuy,a=e.selectSell)=>eg(t,n)(e.inputBuy,i,a)})},Qp=(e,t)=>(n,i,a)=>{e({inputSell:qp(n),selectBuy:a});const l=t.find((e=>e.currency?.currency===a))?.buyExchangeRate||t.find((e=>e.currency?.currency===i))?.buyExchangeRate;l&&e({inputBuy:String(jp(n,l,i===Pp.RUB)||"")})},eg=(e,t)=>(n,i,a)=>{e({inputBuy:qp(n),selectSell:a});const l=t.find((e=>e.currency?.currency===a))?.saleExchangeRate||t.find((e=>e.currency?.currency===i))?.saleExchangeRate;l&&e({inputSell:String(jp(n,l,i===Pp.RUB)||"")})};const tg=d((({className:e="",title:t="Курсы обмена валют",button:n,...i})=>{const a=function(e){const t=e?.code||"000",{data:n}=ci(`/api/v1/exchangerates?regionCode=${t}`,Rt);return n||{}}(Tp()),l=ng(a?.exchangeRate?.currencies),r=l.filter((e=>e.buyExchangeRate));r.unshift({currency:{currency:Pp.RUB}});const s=l.filter((e=>e.saleExchangeRate));return s.push({currency:{currency:Pp.RUB}}),o(g,{className:u("box-border min-h-80",e),...i,children:o(Te,{className:"h-full",title:o(N,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex w-full gap-6xl flex-wrap @lg:flex-nowrap",children:[c("div",{className:"w-full @2xl:w-auto @5xl:w-1/2",children:[l?o(Op,{className:"mb-xl",exchangeCurrencyItems:l}):null,o(Lp,{address:a?.address})]}),o(Xp,{className:"grow w-1/2",currencyRatesBuy:r,currencyRatesSell:s,button:n})]})})})})),ng=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],ig=d((({className:e="",items:t})=>{const n=he();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(ag(n))})})),ag=e=>({dataFooter:t,...n},i)=>{const{text:a,href:l,target:r,onClick:s}=e(n);return a?o("li",{className:"list-none",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:l,target:r||"_self",onClick:s,...ge(t),children:a||null})},String(i)):null},lg=e=>t=>!t.displayArea||e.includes(t.displayArea.toLowerCase()),rg=["all","footer"],sg=d((({className:e,navigationItems:t})=>{const n=he();return o("div",{role:"menu",className:u("w-full flex items-start justify-between flex-col md:flex-row gap-y-m lg:order-2",e),children:t?.filter(lg(rg)).map(n).map(og)})})),og=(e,t)=>{const{text:n,items:i=[],href:a,target:l="_self",onClick:r,dataFooter:s}=e,d=i.filter(lg(rg));return c("div",{role:"menuitem",className:"flex flex-col gap-s w-full @md:w-1/4",children:[o("a",{className:"leading-5 text-l text-primary-text hover:text-primary-main no-underline",href:a,target:l,onClick:r,...ge(s),children:n}),d?o(ig,{items:d}):null]},String(t))},cg=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(dg)}):null)),dg=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(_e,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(mg)})]},String(t)),mg=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:ug(e.type,e.text)}),o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),ug=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${hg(t)}`,children:o(_e,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(w,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},hg=e=>e.replaceAll(/\D/g,""),pg=d((({className:e="",index:t,text:n,...i})=>{const a=he(),{href:l,target:r,onClick:s}=a(i);return o("a",{className:u("text-secondary-text",e),href:l,target:r,onClick:s,children:n||`Документ ${t}`})})),gg=d((({className:e="",title:t,links:n})=>o("div",{className:e,children:n?.length?c("div",{className:"flex justify-between lg:items-center flex-col lg:flex-row gap-lg py-lg border-y border-y-main-divider",children:[o("div",{className:"lg:hidden",children:o(_e,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(pg,{index:t,className:"text-l font-light lg:max-w-[292px]",...e},String(t))))]}):null}))),fg="w-full lg:w-52";function xg(e,t,n=300){a((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}const yg=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:n,s1Matches:i,s2Matches:a}=function(e,t){const n=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),i=Array.from({length:e.length}),a=Array.from({length:t.length});let l=0;for(let r=0;r<e.length;r++){const s=Math.max(0,r-n),o=Math.min(r+n,t.length-1);for(let n=s;n<=o;n++)i[r]||a[n]||e[r]!==t[n]||(l++,i[r]=!0,a[n]=!0)}return{m:l,s1Matches:i,s2Matches:a}}(e,t);if(0===n)return 0;const l=function(e,t,{s1Matches:n,s2Matches:i}){let a=0;for(let l=0,r=0;l<e.length;l++){if(!n[l])continue;let s=r;for(;s<t.length;s++)if(i[s]){r=s+1;break}e[l]!==t[s]&&a++}return a}(e,t,{s1Matches:i,s2Matches:a}),r=(n/e.length+n/t.length+(n-l/2)/n)/3,s=r>.7?.1*function(e,t){let n=0;for(;e[n]===t[n]&&n<4;)n++;return n}(e,t):0;return r+s*(1-r)};const bg=(e,t)=>(n,i)=>{for(const[a,l]of i)n.set(a,e(n.get(a)||t,l));return n},vg=(e=[])=>e.reduce(((e,t)=>e+t),0),Ng=e=>e.toLowerCase().split(/[^0-9a-zа-я-]+/).filter((e=>e.length>=3&&!/[0-9a-z]/.test(e))),wg=e=>t=>e.map((([e,n])=>[yg(t)(e),n])).filter((([e])=>e>=.8)).map((([e,t])=>Sg(t,e))).reduce(bg(Math.max,0),new Map),Cg=e=>t=>{return ad(t,t.map((({title:e})=>e)).map((e=>t=>{const n=Ng(t||"");return n.length?vg(e.map((e=>Ic(n.map(yg(e)))))):0})(e))).sort((e=>(t,n)=>-e(t,n))((n=([,e])=>e,(e,t)=>n(e)-n(t)))).map((([e])=>e));var n},Sg=(e,t)=>new Map(e.map((e=>[e,t]))),kg=({basePathList:e,initialQuery:t=""})=>{const[n,l]=i(t||"");a((()=>{null!=t&&l(t)}),[t]);const{data:r}=ci(e?.length?e:null,Ig),[s,o]=i(null);return xg((()=>{r&&o(r.map((e=>t=>{const{corpus:n,dictionary:i}=t||{};if(!(e&&n?.length&&i&&Object.keys(i).length))return[];const a=Ng(e);if(!a.length)return[];const l=Object.entries(i),r=[...a.map(wg(l)).reduce(bg(((e,t)=>e+t),0),new Map).entries()].filter((([,e])=>e>=.799*a.length)).map((([e])=>n[e]));return Cg(a)(r)})(n)))}),[r,n]),[s,{value:n,onChange:l}]},Ig=async(...e)=>(await Promise.allSettled(e.map((e=>Pt(F(e,"/","search.index.json")))))).map((e=>"fulfilled"===e.status?e.value:{})),Tg=d((({initialQuery:e,navigationItems:t})=>{const n=r((()=>t?.map((e=>e.href||"/"))),[t]),[i,a]=kg({basePathList:n,initialQuery:e}),l=r((()=>Bg(t)(i)),[t,i]);return o(nr,{head:o(mp,{autoFocus:!0,...a}),children:o(sg,{navigationItems:l})})})),Bg=e=>t=>e?.length&&t?.length?ad(e,t).map((([e,t])=>({...e,items:t?.map((({title:e,uri:t})=>({text:e,href:F("/",t)})))}))):[],Pg=(e={})=>{const{open:t,close:n}=ue();return{open:(n={},i={})=>t(o(Tg,{...e,...n}),i),close:n}},Rg=d((({className:e,search:t,...n})=>{const[a,r]=i(""),s=l((()=>r("")),[]),d=Pg(n),m=l((e=>{r(e),Dg(e)&&d.open({initialQuery:e},{onClose:s})}),[s,d]);return c("div",{className:u("relative",e),role:"search",children:[o(mp,{value:a,placeholder:t?.placeholder,onChange:m}),o(tr,{className:"absolute top-0 right-0 sm:hidden",onClose:s})]})})),Dg=e=>e&&e.length>=3,Mg=(e,t)=>{const{logo:n}=e??{},{dataHeader:i,dataFooter:a,...l}=n??{};return c("div",{className:"flex items-stretch gap-3xl",children:[o(Po,{className:fg,logo:l,data:a,showTitle:!1}),o(Rg,{className:"grow",navigationItems:t,...e})]})},_g=d((({className:e="",index:t,...n})=>{const i=he(),{href:a,target:l,text:r,onClick:s}=i(n);return o("a",{className:u("text-xs font-light text-secondary-text visited:text-secondary-text hover:text-primary-main inline-block no-underline max-w-[292px]",e),href:a,target:l,onClick:s,children:r||`Документ ${t}`})})),Ag=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(_e,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} ${n}`})}):null,t?.length?o("div",{className:"flex flex-col @5xl:flex-row justify-start items-start gap-x-lg gap-y-xs",children:t.map(((e,t)=>o(_g,{index:t,...e},String(t))))}):null]}))),Eg=zt((({className:e,footer:t,...n})=>{const{navigationItems:i}=n.options?.page?.navigation??{},a=n.options?.page?.common??{},{documents:l,relatedEnterprises:r,contacts:s,mediaLinks:d=[],horizontalNavigationTitle:m,feedbackButton:h,license:p,otherLinks:f=[]}=t??{};return c(g,{tag:"footer",className:u("grid gap-y-xl p-4xl pb-24 lg:p-xl",e),...n,children:[Mg(a,i),c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(sg,{navigationItems:i}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u(fg,"flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(cg,{items:s}),h?o(ve,{className:"w-full",version:"primary",...h}):null,d.map(((e,t)=>o(xu,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),f.map(((e,t)=>o(ve,{className:"!text-left text-s font-light",version:"link",...e,children:e?.text},String(t))))]})]}),o(gg,{title:m,links:r}),o(Ag,{links:l,license:p})]})})),zg=d((({className:e="",title:t,description:n,calendar:i,...a})=>c(g,{className:u("space-y-m",e),defaultPadding:"p-6xl",...a,children:[o(S,{title:t,description:n,headlineVersion:"M",isEmbedded:!0}),i?Og(i):null]}))),Og=e=>{const t=100/(e.reduce(((e,t)=>t?.month?.length?e+t.month.length:e),0)||1),n=e.filter((e=>e?.month?.length)).map((e=>({...e,flexBasis:`${e?.month?.length?e.month.length*t:""}%`})));return c("div",{className:"w-full flex flex-col justify-center gap-s",children:[o("div",{className:"flex w-full text-h6 text-center",children:n.map((e=>Fg(e,t)))}),o("div",{className:"flex gap-s w-full",children:n.map(((e,t)=>c("div",{className:"border-r border-main-divider last:border-r-0 space-y-s",style:{flexBasis:e.flexBasis},children:[o("div",{className:"flex gap-s",children:Vg(e)}),c("div",{className:"text-s",children:[o(_e,{size:"text-s",font:"font-light",color:"text-primary-text",children:e.text})," ",o(_e,{size:"text-s",font:"font-light",color:"text-primary-main",children:e.greenText})]})]},`monthItem-${t}`)))})]})},Fg=(e,t)=>e.month?.map(((e,n)=>o("div",{style:{flexBasis:`${t}%`},children:e.text},`monthName-${n}`))),Vg=e=>e.month?.map((e=>e.image?.src?o("div",{className:"h-52 border-r pr-s border-main-divider last:border-r-0",children:o(ne,{image:e.image,className:"flex"})},`monthImage-${e.image.src}`):null)),Lg=zt((({className:e,title:t,button:n,regionSource:a,data:l,...r})=>{const[s,d]=i({key:""}),m=a?.regions??[],h=oe({className:"text-white",version:n?.version||"primary"}),p=m?.find((e=>e.name===s.key))?.href,f=n?.text?n.text:"Перейти";return o(g,{className:e,defaultPadding:"p-6xl",...r,children:c("div",{className:"container max-w-[978px] space-y-m",children:[t?o(N,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(Dn,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:m.map((({name:e=""})=>({key:e,text:e}))),value:s,onChange:d}):null,p?o("div",{className:"text-center",children:o(ve,{href:p,target:"_blank",className:u("p-m w-full @xl:w-auto",h),data:pu(l,s?.key),children:f})}):null]})})}));function jg(e=[]){const t=D(),n=Array.from(e.entries()).filter((([,e])=>qg(t)(e)));return n.find((([,e])=>qg(t,!0)(e)))??n[n.length-1]??[]}const qg=(e,t=!1)=>({href:n})=>{if(!n)return!1;const i=O($g(e)(n));return t?i===O(n):i.startsWith(O(n))},$g=e=>t=>{const n=X(G.SITE_URL);return A(t)?e.href:F(n,e.pathname)},Ug=d((({className:e="",items:t,activeItem:n,ariaLabel:i="Меню"})=>{const[r,{setFalse:d,toggle:m}]=ln(!1),h=sn(d),p=s(null),g=l((({isOpened:e,buttonRef:t,menuRef:n})=>{if(e&&t.current&&n.current){const e=n.current.getBoundingClientRect(),i=t.current.getBoundingClientRect(),a=globalThis.innerWidth-e.width;e.right>=globalThis.innerWidth?n.current.style.left=`${a}px`:i.left>e.left&&(a>i.left?n.current.style.left="":n.current.style.left=`${a}px`)}}),[r]);return rn(globalThis,"resize",(()=>g({isOpened:r,buttonRef:h,menuRef:p}))),a((()=>{g({isOpened:r,buttonRef:h,menuRef:p})}),[r]),c("div",{className:u(r?"rounded-md shadow-blue-gray":"",e),ref:h,role:"navigation",children:[o("button",{type:"button",className:"group/btn flex justify-between items-center h-6","aria-label":i,onClick:m,role:"button","aria-labelledby":"labeldiv",children:Array(3).fill(null).map(((e,t)=>o("div",{className:"w-[3px] h-[3px] rounded mr-2xs bg-primary-text group-hover/btn:bg-primary-hover group-data-transparent:bg-white"},String(t))))}),o("div",{ref:p,className:u("absolute flex flex-col rounded-md bg-white p-xl pb-xs w-56 z-40",{hidden:!r}),"aria-hidden":!r,children:Hg(t,n)})]})})),Wg=d((({isActive:e,...t})=>{const n=he(),{text:i,href:a,target:l,onClick:r}=n(t);return o("a",{className:u("text-l font-light pb-m hover:text-primary-main",{"text-primary-main":e}),href:a,target:l,onClick:r,role:"link",...ge(t?.data),children:i})})),Hg=(e,t)=>e?.map(((e,n)=>o(Wg,{isActive:e===t,...e},e?.text??String(n)))),Yg={default:"w-6 h-6",large:"w-12 h-12"},Kg=d((({className:e,isRounded:t,buttonSize:n="default",isGrayBg:i=!1,disabled:a,ariaLabel:l="Меню второго уровня",image:r,data:s,onClick:c,version:d})=>o("button",{className:u("group/btn border-0 flex shrink-0 items-center",i?"p-s rounded-full":"p-0 bg-inherit","transparent"===d?"backdrop-opacity-30 bg-white/30":i&&!t?"bg-main-divider":"",t?"w-8 h-8 text-secondary-light hover:text-secondary-hove":`${Yg[n]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:a,"aria-label":l,onClick:c,...ge(s),children:o(ne,{image:r,className:u("h-full",{"bg-main-divider/20 rounded-full":t}),imageClassName:"group-hover/btn:text-primary-hover group-hover/btn:invert-0"})}))),Gg="chatbot",Xg="text-page__btn-chat",Jg={personal:"//chat.mes.rshb.ru/assets/js/webchat_rshb",business:""},Zg=d((({chat:e="personal",iconVersion:t,className:n,ariaLabel:i="Чат",version:l})=>{const r=(e=>{a((()=>globalThis.localStorage?.setItem("webchat-keep-open",String(Date.now()))),[]);const t=Jg[e??""];return n=>{if(t)if("personal"!==e)Fi(Gg,t);else{const e=n.target;e?.classList.contains(Xg)||e?.classList.add(Xg),document.getElementById("webchat-js-container:webchat_rshb")||Fi(Gg,t)}}})(e);return o(Kg,{className:n,image:{icon:"HeadphonesIcon",iconVersion:t},ariaLabel:i,onClick:r,buttonSize:"large",isGrayBg:!0,version:l})})),Qg=d((({className:e="",active:t,dataItemName:n,children:i,data:a,...l})=>{const r=he(),{href:s,target:d,text:m,onClick:h}=r(l);return c("a",{className:u("relative inline-block bg-transparent text-center no-underline",e),href:s,target:d,"data-item-name":n,onClick:h,...ge(a),children:[o("span",{className:ef(t),children:m||i}),t?o("div",{className:"absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-white"}):null]})})),ef=(e=!1)=>u("font-sans text-l lg:font-light",e?"text-primary-main":"text-primary-text hover:text-primary-main","group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),tf=d((({observerOptions:e,onVisibilityChange:t,children:n,className:i,...a})=>{const r=pc(l((e=>{if(!e.length||!t)return;const n=e[e.length-1];t(n.isIntersecting)}),[t]),e);return o("span",{ref:r,className:i,role:"menuitem",children:o(Qg,{...a,children:n})})})),nf={default:"bg-main-divider text-primary-main rounded hover:text-primary-main",transparent:"backdrop-opacity-30 bg-white/30 hover:text-primary-hover text-white"},af=d((({version:e,text:t,mobileText:n,...i})=>{const a=Se()?n:t;return a?o(ve,{className:u("py-s px-lg font-light whitespace-nowrap",nf["transparent"===e?"transparent":"default"]),...i,children:a}):null})),lf=d((({subItems:e=[],version:t,internetBankButton:n,dropdownMenuAriaLabel:a,chatBotAriaLabel:l})=>{const d="transparent"===t?"white":"black",[,m]=jg(e),[u,h]=i(e.length),p=e.slice(u),g=s(null),f={rootRef:g},x=r((()=>e.map(((e,t)=>e=>{h(e?rf(t):sf(t))}))),[e]);return c("nav",{className:"mt-s flex gap-s items-center justify-between",children:[o("div",{ref:g,className:"overflow-hidden whitespace-nowrap pb-s mt-xs space-x-lg",role:"menu",children:e.map(((e,t)=>o(tf,{className:u-1<t?"invisible":"",active:e===m,observerOptions:f,onVisibilityChange:x[t],data:e.dataHeader,...e},String(t))))}),p.length?o(Ug,{items:p,activeItem:m,ariaLabel:a}):null,_.CHAT_BOT?o(Zg,{version:t,iconVersion:d,chat:_.CHAT_BOT,ariaLabel:l}):null,o(af,{version:t,...n})]})})),rf=e=>t=>Math.max(t,e+1),sf=e=>t=>Math.min(t,e),of=e=>e?.length?c("div",{className:"sm:border-t sm:border-main-divider mt-2xs pt-2xs",children:[o("div",{className:"mb-m",children:o(_e,{size:"text-m",font:"font-light",color:"text-secondary-text",children:"Представительства за рубежом:"})}),o("div",{className:"flex flex-col sm:flex-row gap-5xl",children:e.map(((e,t)=>o(cf,{...e},String(t))))})]}):null,cf=d((({icon:e,...t})=>{const n=he(),{text:i,target:a,href:l,onClick:r}=n(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ne,{image:e}):null,i?o("a",{className:"hover:text-primary-hover",href:l,target:a,onClick:r,children:o(_e,{size:"text-l",font:"font-light",color:"text-primary-text",children:i})}):null]})})),df=(e,t)=>n=>n.name?o(gu,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:pu(e,n.name),children:o(_e,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,mf=d((({className:e,searchTerm:t,onSearch:n})=>c("form",{className:`font-sans relative ${e}`,children:[o("div",{className:"absolute rounded h-full flex items-center justify-center pl-m max-w-44 gap-s pointer-events-none",children:t?null:o("label",{htmlFor:"search-bar-input",className:"text-secondary-text ",children:"Поиск по филиалам"})}),o("input",{id:"search-bar-input",className:u(dn,"h-12 pl-m w-full peer text-l text-black rounded-md box-border"),value:t,onChange:e=>n(e.target.value.toLowerCase()),type:"text",name:"location-search-bar-input"})]}))),uf=d((({defaultLocation:e})=>{const t=Tp(e),n=he(),{href:i}=n({href:`/branches/${t.slug}`});return t?o("div",{className:"mb-s",children:c(w,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(gu,{href:i,className:"inline mx-2xs text-primary-main",children:t.name})]})}):null})),hf=d((({foreignOffices:e,branches:t})=>{const n=Bp(t?.default),[a,s]=i(""),d=Bs(),m=r((()=>gf(d).sort(((e,t)=>e.name.localeCompare(t.name)))),[d]),u=r((()=>((e,t)=>{const n=new Map;for(const i of e){const e=t(i),a=n.get(e)||[];n.set(e,[...a,i])}return n})(m,pf)),[m]),{close:h}=ue(),p=l((e=>{n.location=e,h()}),[n]);return c(nr,{className:"pb-20",head:c("div",{children:[o(_e,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),o(uf,{defaultLocation:t?.default}),o(mf,{onSearch:s,searchTerm:a})]}),children:[a&&a.length>=3?o("div",{children:m.filter((({name:e})=>e&&yg(e.toLowerCase())(a.toLowerCase())>=.8)).map(df(t?.dataSelect,p))}):o("div",{className:"columns-1 sm:columns-3 md:columns-4 lg:columns-5",children:Array.from(u.entries()).map((g=p,f=t?.dataSelect,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(_e,{size:"text-h6",children:e})}),t.map(df(f,g))]},e)))}),of(e)]});var g,f})),pf=e=>e.name?.charAt(0)??"",gf=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()??""}))),ff=d((({className:e="",active:t,flat:n,children:i,data:a,...l})=>{const r=he(),{href:s,target:c,text:d,onClick:m}=r(l);return o("a",{className:u(xf(t,n),e),href:s,target:c,onClick:m,rel:"noopener noreferrer","aria-label":`Ссылка на ${d}`,...ge(a),children:o("span",{suppressHydrationWarning:!0,className:yf(t,n),children:d||i})})})),xf=(e=!1,t=!1)=>u("inline-block border border-solid bg-transparent text-center no-underline",e?"rounded-md border-primary-main group-data-transparent:border-white":"border-transparent",{"px-m py-xs":!t}),yf=(e=!1,t=!1)=>u("font-sans text-s font-light",e?"text-primary-main":u(t?"text-primary-text":"text-secondary-text","hover:text-primary-main"),"group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),bf=d((({className:e,version:t,...n})=>{const i="transparent"===t?"white":"black",a=Tp(n?.branches?.default),r=Pg(n),s=(e=>{const{open:t,close:n}=ue();return{open:(n={})=>t(o(hf,{...e}),n),close:n}})(n),d=l((()=>r.open()),[r]),m=l((()=>s.open()),[s]);return c("div",{className:u("flex items-center ml-5 md:max-w-[300px] xl:max-w-full gap-lg",e),role:"navigation",children:[n?.branches?.visible?o(ff,{className:"whitespace-nowrap text-ellipsis overflow-hidden",flat:!0,href:"#",text:a?.name,data:pu(n?.branches?.dataClick,a?.name??""),onClick:m}):null,n?.officesAtms?.href?o(ff,{className:"whitespace-nowrap",flat:!0,...n.officesAtms}):null,o(Kg,{image:{icon:"LoupeIcon",iconVersion:i},ariaLabel:n?.search?.ariaLabel??"Поиск",onClick:d,data:n?.search?.data})]})})),vf=d((({observerOptions:e,onVisibilityChange:t,children:n,className:i,...a})=>{const r=pc(l((e=>{if(!e.length||!t)return;const n=e[e.length-1];t(n.isIntersecting)}),[t]),e);return o("span",{ref:r,className:i,role:"menuitem",children:o(ff,{...a,children:n})})})),Nf=d((({navigationItems:e=[],activeTopItem:t,dropdownMenuAriaLabel:n,version:a,headerData:l,search:d,bgColor:m,logo:u})=>{const[h,p]=i(e.length),g=e.slice(h),f=s(null),x={rootRef:f},y=r((()=>e.map(((e,t)=>e=>{p(e?wf(t):Cf(t))}))),[e]),{dataFooter:b,dataHeader:v,...N}=u??{};return c("div",{className:"flex items-center justify-between",children:[o(Po,{className:"mr-3xl",bgColor:m,logo:N,data:v,showTitle:!1}),o("div",{ref:f,className:"overflow-hidden min-w-[160px] pb-xs mt-xs",role:"menu",children:e.map(((e,n)=>o(vf,{className:h-1<n?"invisible":"",active:e===t,observerOptions:x,onVisibilityChange:y[n],data:e.dataHeader,...e},String(n))))}),g.length?o(Ug,{className:"mx-xs",items:g,activeItem:t,ariaLabel:n}):null,o(bf,{version:a,className:"ml-auto",search:d,navigationItems:e,...l})]})})),wf=e=>t=>Math.max(t,e+1),Cf=e=>t=>Math.min(t,e),Sf={"bg-white":"primary",transparent:"transparent"},kf=["all","header"],If=zt((({className:e,bgColor:t="bg-white",logo:n={},version:i=Sf[t],portal:a,header:l={},...r})=>{const{common:s,navigation:d}=Bf(r?.options?.page),{navigationItems:m}=d,{logo:h={}}=s,[,p]=jg(m),{internetBankButton:f}=a||{},x=n.image?.icon||n.image?.src||n?.title?n:h;return o(g,{tag:"header",className:u("pt-m px-20",p?.items?.length?"pb-m":"pb-lg",e),defaultPadding:"",version:i,...r,children:c("div",{className:"container",children:[o("div",{className:"whitespace-nowrap",children:o(Nf,{activeTopItem:p,navigationItems:m?.filter(lg(kf)),version:i,headerData:{...l,...d},search:s.search,bgColor:t,logo:x})}),o("div",{className:u("mt-s h-px bg-main-divider",Tf(i))}),p?.items?.length&&o(lf,{subItems:p?.items?.filter(lg(kf)),version:i,internetBankButton:f})]})})})),Tf=e=>"transparent"===e?"opacity-30":"",Bf=e=>({navigation:e?.navigation??{},common:e?.common??{}}),Pf=(e=!1)=>e?{}:{padding:"p-0"},Rf={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},Df=zt((({className:e="",padding:t="p-0",gap:n="XS",isInnerPadding:i=!0,version:a="transparent",isTheme:l=!1,isCardBorder:r,...s})=>o(g,{className:u("relative","grid grid-cols-12",Rf[n],e),padding:t,version:a,isTheme:l,...s,children:R({...s,extraProps:{...Pf(i),className:uc(r)}})})),{childrenTypes:{exclude:["HorizontalLayout"]}}),Mf=d((e=>{const{className:t,align:n,image:i,...a}=e,l=n?u("flex",wd[n]):"";return o(g,{className:u(l,t),defaultPadding:"p-0",...a,children:o(ne,{image:i})})})),_f=(e,t=0)=>{const{itemCount:n,visibleItemCount:a}=e,[r,s]=i(t),o=l((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=l((()=>s((e=>Math.max(e-1,0)))),[n]),d=a?n>a&&r<n-a:r<n-1,m=r>0;return[r,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]};function Af({dec:e,inc:t,canDec:n,canInc:i,btnClass:a,className:l=""}){return n||i?c("div",{children:[n?o(Ec,{className:u("absolute z-40",a[0],l),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!n}):null,i?o(Ec,{className:u("absolute z-40 rotate-180",a[1],l),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!i}):null]}):null}const Ef=d((({className:e="",cards:t=[],button:n})=>{const[a,r]=i(0),s=l((e=>r(e)),[]),d=t.length,[m,u]=_f({itemCount:d,visibleItemCount:2}),{canDec:h,canInc:p}=u,g=t[m]?.href;return c("section",{role:"listitem",className:`min-w-full text-center ${e}`,children:[c("div",{className:"relative overflow-hidden","aria-label":"Страховые программы",children:[d?zf({activeIndex:m,cards:t,selectedCardIndex:a,onClick:s}):null,Af({...u,btnClass:["left-12","right-12"],className:"top-16"}),h?o("div",{className:"absolute top-0 left-0 h-full w-32 bg-opacity-from-white"}):null,p?o("div",{className:"absolute top-0 right-0 h-full w-32 bg-opacity-to-white"}):null]}),o(ve,{className:"w-60 text-center",version:"primary",...n,href:g})]})}));function zf({activeIndex:e,cards:t,selectedCardIndex:n,onClick:i}){const a=460*e,l=t.length>2?"justify-start":"justify-center";return o("div",{style:{transform:`translateX(-${a}px)`},className:"duration-1000 px-6xl",children:o("div",{className:`w-full flex flex-nowrap gap-s pb-6xl ${l}`,children:t.map(((e,t)=>function({slide:e,i:t,isActive:n,onClick:i}){return c("button",{type:"button",onClick:i,className:"p-3xl min-w-fit flex items-center gap-2xl bg-white border-solid border relative "+(n?"shadow-dark-blue border-primary-main":"ease-in duration-300 border-gray"),children:[e?.icon?o(ne,{className:"p-lg rounded-full bg-secondary-light",image:e.icon,width:"108",height:"108"}):null,c("div",{className:"flex gap-s",children:[e?.sum?Of("страховая сумма",e.sum):null,e?.fee?Of("страховой взнос",e.fee):null]}),Ff(n)]},String(t))}({slide:e,i:t,isActive:Boolean(t===n),onClick:()=>i(t)})))})})}function Of(e,t){return c("div",{className:"flex flex-col text-left whitespace-pre",children:[c(_e,{size:"text-h6",children:[We(2)(t)," ₽"]}),o("div",{className:"mt-2xs",children:o(_e,{size:"text-l",color:"text-secondary-text",children:e})})]})}function Ff(e){return e?o(ne,{className:"h-6 w-6 min-w-6 min-h-6 absolute right-4 top-4",image:{icon:"DoneIcon"},width:"24",height:"24"}):null}const Vf=d((({className:e="",title:t,insuranceTabs:n=[],button:a,...r})=>{const[s,d]=i(0),m=l((e=>d(e)),[]);return c(g,{className:u("box-border overflow-hidden relative px-0 space-y-2xl",e),defaultPadding:"p-6xl",...r,children:[t?o(N,{className:"text-center",title:t,headingType:"h3"}):null,n?.length>1?o("div",{className:"p-xs bg-secondary-light w-fit mx-auto rounded-md",children:n.map(((e,t)=>function({title:e,i:t,isActive:n,onClick:i}){return o("button",{type:"button",onClick:i,"aria-label":`Кнопка ${e}`,className:"box-border px-m py-s text-m font-light "+(n?"bg-primary-main text-white rounded-md":"text-secondary-text"),children:e},String(t))}({title:e?.title,i:t,isActive:Boolean(t===s),onClick:()=>m(t)})))}):null,o("div",{className:"flex",style:{transform:`translateX(-${s}00%)`},role:"list",children:Lf({insuranceTabs:n,button:a})})]})})),Lf=({insuranceTabs:e,button:t})=>{const n=e?.map((e=>e.cards));return n?.length?n.map(((e,n)=>o(Ef,{button:t,cards:e},String(n)))):null};const jf={yellow:"bg-yellow",green:"bg-green","green-light":"bg-green-light","green-dark":"bg-green-dark"},qf={XS:"h-10",S:"h-16",M:"h-24",L:"h-32",XL:"h-52"},$f=d((e=>{const{className:t="",__html:n,isDotted:i,investmentZeroColumn:a,investmentColumns:l,...r}=e,s=l?[...l]:[];return a&&s.unshift(a),o(g,{className:t,defaultPadding:"p-4xl",...r,children:c("div",{className:"container text-m font-light space-y-4xl",children:[s?.length?c("div",{children:[c("div",{className:"flex items-end relative pl-3xl pr-lg text-white",children:[Qc(o("div",{className:"w-px h-4 bg-gray"}))(s.map(Uf)),o("div",{className:"absolute right-3xl w-px h-4 bg-gray"})]}),o("div",{className:"border-t border-gray -mt-xs mx-3xl"}),o("div",{className:"flex justify-between text-primary-text mt-s -mx-5xl",children:s.map(Yf)})]}):null,n?o("div",{className:"max-w-2xl font-light text-base",children:o(De,{__html:n,isDotted:i,itemSize:"list-s"})}):null]})})})),Uf=(e,t,n)=>{const i=1===t,a=t===n.length-1,l=e.cells?.reverse()||[];return o("div",{className:`${Wf(i,a,e.cells)}`,children:l.length?o("div",{className:"w-full "+(a?"border-4 border-green-more-dark p-1.5 min-w-72":""),children:l.map(Hf)}):null},`column_${t}`)},Wf=(e,t,n=[])=>[n.length?"flex-1":"flex-0",!n.length||e||t?"":"pl-s",n.length&&!t?"pr-s pb-3xl":"pb-xl"].join(" "),Hf=(e,t)=>{const n=e.cellSize||"XS",i=e.cellColor||"green";return e.text?o("div",{className:`flex-1 flex items-center justify-center relative py-xs ${qf[n]} ${jf[i]} ${"XS"===n?"px-s":"px-5xl"}`,children:o(_e,{align:"text-center",children:e.text})},`cell_${t}`):null},Yf=(e,t)=>e?.title?o("div",{className:"flex-1 max-w-44 text-center px-xs last:pr-4xl last:max-w-52",children:e.title},`title_${t}`):null,Kf=["байт","Кб","Мб","Гб","Тб","Пб"],Gf=d((({icon:e,text:t,href:n,target:i,fileFormat:a,data:l,fileSize:r})=>{const s=r&&a?",":"",d=r??"",m=a?String(a):"";return c("a",{className:"flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main",href:n,target:i,...ge(l),children:[e,t?c(_e,{size:"text-l",font:"font-light",children:[t," ",Xf(d,m),o(_e,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),Xf=(e,t)=>e||t?o("span",{children:", "}):"",Jf=(e,t)=>(n,i)=>{const a=$(e)("Attachment"===n?.docType?n?.attachment?.src:n?.href),l="Attachment"===n?.docType?((e,t=2)=>{if(0===e)return"";const n=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,n)).toFixed(t))} ${Kf[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,r="Attachment"===n?.docType?Qf(a):n?.fileFormat;return c("div",{role:"listitem",children:[o(Gf,{text:n?.text,target:n?.target,href:a,fileFormat:r,fileSize:l,icon:Zf(t),data:n?.data}),o(De,{__html:n?.__html})]},String(i))},Zf=e=>e?o(ne,{className:"min-w-6 min-h-6",image:e,width:"24",height:"24"}):null,Qf=e=>{if(!e)return"";const t=e.lastIndexOf("."),n=new RegExp(/\/(.*)/),i=-1!==t?e.substring(t+1):"";return i.includes("/")?i.replace(n,""):i},ex=d((({href:e,__html:t,target:n})=>{const{close:i}=ue(),a=D(),r=$(a)(e),s=l((()=>{i()}),[]);return c(nr,{className:"my-6xl min-h-fit w-fit mx-auto",children:[t?o(De,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(ve,{text:"Я согласен",version:"primary",target:n,href:r,onClick:s}),o(za,{type:"button",version:"secondary",onClick:s,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]})})),tx=d((({text:e,href:t,target:n,__html:i,icon:a})=>{if(!e&&!i)return null;const r=(e=>{const{open:t,close:n}=ue();return{open:(n={})=>t(o(ex,{...e}),n),close:n}})({__html:i,href:t,target:n}),s=l((()=>r.open()),[r]);return c("button",{className:"flex gap-s text-primary-text no-underline hover:text-primary-main",onClick:s,children:[Zf(a),o(_e,{font:"font-light",children:e})]})})),nx={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},ix=zt((({className:e="",title:t,description:n,align:i="text-center",documents:a,icon:l={icon:"DocIcon"},columnsMode:r="double",...s})=>{const d=D();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(S,{title:t,description:n,align:i,headlineVersion:"M",as:"h2",isEmbedded:!0}),a?.length?o("div",{className:u("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",nx[r]),role:"list",children:a.map(ax(d,l))}):null]})})),ax=(e,t)=>(n,i)=>{const a=n?.docType;return""===a?null:"reportSource"in n&&n?.reportSource?.__html?lx(t)(n,i):Jf(e,t)(n,i)},lx=e=>(t,n)=>{const i={text:t.text,target:t.target,__html:t.reportSource?.__html};return t.reportSource?.__html&&t.text?c("div",{role:"listitem",children:[o(tx,{...i,icon:e,href:rx(t)?t?.href:t?.attachment?.src}),o(De,{__html:t?.__html})]},String(n)):null},rx=e=>"href"in e,sx=zt((({className:e,padding:t,align:n="text-left",buttons:i=[],description:a,image:l,__html:r,headingType:s,qr:d,additionalDescription:m="",title:h="Мобильное приложение",version:p="primary",...f})=>{const x="secondary"===p?"p-m min-w-32":"min-w-24",y=l?.src?o(ne,{className:"hidden lg:block",image:l}):null;return o(g,{className:u("min-h-80",e),padding:"p-0",version:p,...f,children:c(Te,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(N,{headingType:s,title:h,className:u("whitespace-pre-wrap",n)}),rightImage:y,buttons:je(i,{className:"flex-wrap"}),children:[a?o(_e,{size:"text-xl","font-weight":"font-light",children:a}):null,c("div",{className:u("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[r?o(De,{__html:r,itemSize:"list-m"}):null,o(_e,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:m}),d?.src?o("div",{className:u("flex justify-center bg-white rounded-md @xl:-order-1",x),children:o(ne,{className:"w-fit",image:d})}):null,l?.src?o(ne,{className:"lg:hidden",image:l}):null]})]})})})),ox=(e=[],t={})=>e.filter((({content:e={}})=>rd(t,e))).length,cx=(e,t)=>e===t;const dx=(e=>(t,n)=>t===n||Boolean(t&&n&&Object.keys(t).length===Object.keys(n).length&&Object.entries(t).every((([t,i])=>e(i,n[t])))))(function(...e){return(t,n)=>e.some((e=>e(t,n)))}(cx,((e=cx)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,i)=>e(t,n[i])))))())),mx=[],ux={},hx={primary:"bg-white/30",secondary:"bg-main-divider"},px={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},gx=d((({count:e,version:t="secondary"})=>{const n=Se(),i=n?"bg-main-divider":hx[t],a=px[t][n?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",i),role:"status","aria-label":`Количество ${e} доступных программ и сервисов`,children:o(_e,{size:"text-xs",color:a,children:e})})})),fx=({text:e,description:t,icon:n,isActive:i,type:a})=>{const l=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white"),text:e?"mb-xs text-xl":"mb-2xs text-l text-primary-text",desc:"font-light "+(e?"text-l text-white":"text-m text-secondary-text"),icon:e?"":"text-primary-main",iconVersion:e?"white":"normal",oldText:"text-m text-center",oldDesc:"text-m-light"}))(i);return c("div",{className:u("cursor-pointer text-left border-b-0 flex gap-2xs"),"aria-label":e,"aria-labelledby":`${e}-label`,children:[n?o(ne,{className:u("h-6 w-6 min-w-6 min-h-6",l.icon),image:{...n,iconVersion:n?.iconVersion??l.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===a?l.text:l.oldText,children:e}),o("div",{className:"animated"===a?l.desc:l.oldDesc,children:t})]})]})},xx={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},yx={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},bx={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},vx={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},Nx=d((({tag:e="div",item:t={},isActive:n=!1,type:i="default",onClick:a})=>{const l=e,{text:r,description:s,icon:d,count:m,tabName:h,...p}=t;return o(l,{className:u("h-12","block flex-1","cursor-pointer",xx[i],n?vx[i]:bx[i]),role:"tablist","aria-label":"Список табов",onClick:a,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?yx[i]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${r}`,children:[fx({text:r,description:s,icon:d,isActive:n,type:i}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o(gx,{count:m,version:Oa(n,i)})}):null]})})})),wx=d((e=>o(e?.item?.href?Cx:Sx,{...e}))),Cx=d((e=>{const t=he(),n=l((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:i,...a}=t({...e.item,onClick:n});return o(Nx,{...e,tag:"a",item:a,onClick:i})})),Sx=d((({item:e={},onClick:t,...n})=>{const i=l((()=>{t&&t(e)}),[t,e]);return o(Nx,{item:e,onClick:i,...n})})),kx=(e,t,n)=>(i,a)=>o(wx,{isActive:i===e,onClick:t,type:n,item:i},String(a)),Ix=d((({className:e,tabsType:t="default",items:n=[],activeItem:i,onChange:a})=>o("div",{className:u("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tabpanel","aria-label":"Панель управления табами",children:n.map(kx(i,a,t))}))),Tx={categories:[],extraOptions:[],propertyType:[],stage:[]},Bx=zt((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:i,...a})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=od(Tx,{block:a.block,page:a.options?.page}),f=l(((e=Tx)=>p(e)),[]),x=(({hotFilters:e=mx,filtrationState:t=ux,blocks:n=mx,onFiltrationStateChange:i})=>{const a=r((()=>Math.max(0,e.findIndex((e=>dx(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:ox(n,t.filter),version:Oa(t===e[a])})))),[e,n,a]),o=l((t=>{i(e[s.indexOf(t)].filter)}),[e,s]);return{activeItem:s[a],items:s,onChange:o}})({hotFilters:t,filtrationState:s,blocks:a.block?.blocks,onFiltrationStateChange:f});return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...a,children:[o(Ix,{...x}),o(td,{filtrationSchema:n,resetButton:i,field:m,reset:h}),o(Jc,{blocksToRender:d,...a})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),Px=({location:e,address:t,billAcceptorType:n,terminalType:i,billAcceptorEnable:a,atmCode:l="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:Mx(i)},{label:"Модуль приема наличных",value:a?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:l}];return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(_e,{size:"text-h4",children:Mx(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(_e,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(pa,{color:"green",children:Mx(s)})})]}),o("div",{className:"hidden sm:block",children:o(ia,{className:"flex-wrap",children:m?.map(Dx)})}),o(Ji,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(Zi,{isUnfolded:e,children:o(ia,{className:"flex-wrap",children:m?.map(Dx)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Na({isUnfolded:e,onToggle:t})})]},String(d))},Rx=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${Mx(t)} №${n}`,body:e.toUpperCase()}),Dx=(e,t)=>o(Qi,{...e},String(t)),Mx=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",_x=[];const Ax=async e=>{const t=await Pt(e,{method:"GET"});return Array.isArray(t)?t:_x},Ex={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},zx={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable),locationDisabledPeople:e=>Boolean(e.locationDisabledPeople),designDisabledPeople:e=>Boolean(e.designDisabledPeople)},Ox=d((({descriptionData:e,className:t})=>{const n=Tp(),i=n?.code??"000",{data:a,isLoad:l}=function(e){const{data:t,error:n}=ci(`/api/v1/atms?regionCode=${e}`,Ax);return{data:t||_x,isLoad:!t&&!n}}(i);return o(Ya,{className:t,filterItems:Fx,data:a,isLoad:l,initFilterState:Ex,renderCard:Px,getBalloon:Rx,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),Fx=(e,t)=>{const n=Object.keys(t).filter((e=>t[e])),i=n.filter((e=>e.startsWith("terminalType"))),a=n.filter((e=>!i.includes(e)));return e.filter((e=>{const t=a.every((t=>zx[t](e))),n=!i.length||i.some((t=>zx[t](e)));return t&&n}))},Vx=({address:e,workScheduleDescription:t},n)=>t?c("div",{className:"bg-white col-span-12 p-3xl sm:border-yellow sm:border",children:[o("div",{className:"sm:flex sm:justify-between",children:c("div",{children:[o(_e,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(_e,{size:"text-l",children:e})]}):null]})}),o("div",{className:"hidden sm:block",children:Lx({workScheduleDescription:t})}),o(Ji,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(Zi,{isUnfolded:e,children:Lx({workScheduleDescription:t})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Na({isUnfolded:e,onToggle:t})})]},String(n)):null,Lx=({workScheduleDescription:e})=>c("div",{children:[c(ia,{className:"flex",children:[o(Qi,{label:"Операции для физических лиц",children:o(_e,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(Qi,{label:"Операции для физических лиц",children:o(_e,{children:"Оформление и обслуживание банковских карт"})}),o(Qi,{label:"Операции для физических лиц",children:o(_e,{children:"Инвестиционное и накопительное страхование"})}),o(Qi,{label:"Операции для физических лиц",children:o(_e,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(Qi,{label:"Режим работы",className:"max-w-none",children:o(_e,{children:e})})]}),jx=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),qx={branches:[],remoteWorkplaces:[]};const $x=async e=>await Pt(e,{method:"GET"})||qx,Ux=d((({className:e})=>{const t=Tp(),n=t?.code??"000",{data:i,isLoad:a}=function(e="000"){const{data:t,error:n}=ci(`/api/v1/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,$x);return{data:t||qx,isLoad:!t&&!n}}(n);return o(Ya,{className:e,data:i?.branches,isLoad:a,remoteWorkplaces:i?.remoteWorkplaces,renderCard:ka,renderRemoteWorkplaceCard:Vx,getBalloon:Ta,getBalloonRemoteWorkplaces:jx,title:`Офисы филиала ${t?.name}`})})),Wx=d((({data:e,className:t,...n})=>{const i=e?.dataType??"offices";return o(g,{version:"transparent",className:u(t),defaultPadding:"p-0",...n,children:"offices"===i?o(Ux,{}):o(Ox,{descriptionData:e})})})),Hx=d((({className:e,title:t,description:n="Блок в разработке...",...i})=>c(g,{className:u("box-border",e),...i,children:[o(S,{className:"max-w-[600px]",title:t,description:n,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(f,{})]}))),Yx="hidden sm:flex absolute z-40 top-10",Kx=zt((({className:e="",padding:t,slides:n=[],...a})=>{const[l,r]=i(0),[s,d]=Dc({itemCount:n?.length||0});return c(g,{className:u("box-border overflow-hidden",e),defaultPadding:"pt-6xl",padding:t,...a,children:[o("div",{className:"flex duration-1000",style:{transform:`translateX(-${100*l}%)`},role:"list",children:n.map((({productBlock:e},t)=>o("div",{className:"box-border grow-0 shrink-0 basis-full",role:"listitem",children:o(Je,{className:"pl-6xl h-full",headlineVersion:"M",isFullWidthTitle:!1,...e,...a})},String(t))))}),c("div",{className:"relative pr-xs mt-m -mb-m flex gap-xs box-border",children:[o(yc,{containerRef:s,snapAlign:"snap-start",onVisibleIndicesChange:d.handleVisibleIndicesChange,itemClassName:"h-40 flex items-stretch w-screen",gap:8,children:n.map(Gx({activeSlideIndex:l,onClick:r}))}),d.canScrollLeft?o(zc,{className:u("left-6",Yx),onClick:d.scrollLeft}):null,d.canScrollRight?o(Oc,{className:u("right-6",Yx),onClick:d.scrollRight}):null]})]})})),Gx=({activeSlideIndex:e,onClick:t})=>({nav:n},i)=>{const a=i===e,l=a?"min-w-[370px] mt-s h-28 bg-white shadow-dark-blue border-none p-6":"min-w-72 mt-lg h-24 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",r=a?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=a?"text-secondary-text text-l font-light":"text-secondary-text text-m font-light group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(i),"aria-label":n?.title,className:u("relative overflow-hidden grow","ml-xs px-xl","box-border basis-0 border","border-gray group-data-secondary:border-white/50","text-left whitespace-nowrap",l),children:[o("div",{className:r,children:n?.title}),o("div",{className:s,children:n?.description})]},String(i))},Xx=d((({address:e,email:t,telephone:n,button:i,className:a="",__html:l,richVersion:r,icon:s,title:d,version:m="primary",...h})=>c(g,{className:u("box-border text-left space-y-s",a),version:m,...h,children:[c("div",{className:"w-full flex justify-between flex-row-reverse",children:[Le(s)?o("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:o(ne,{image:s})}):null,d?o(N,{headingType:"h3",as:"h3",title:d}):null]}),c("div",{className:"w-full space-y-m",children:[l?Jx({__html:l,richVersion:r}):null,Zx({label:"Адрес",data:e,iconName:"GeolocationIcon"}),Zx({label:"Телефон(факс)",data:n,iconName:"PhoneIcon"}),Zx({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),i?.text?je([i]):null]})]}))),Jx=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(De,{...e,itemSize:"list-s"})}),Zx=({label:e,data:t,iconName:n,dataColor:i=""})=>t?c("div",{className:"flex gap-s",children:[o(W,{iconVersion:"black",name:n,width:"24",height:"24"}),c("div",{className:"flex flex-col gap-2xs",children:[o(_e,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(_e,{size:"text-xl",color:i,children:t})]})]}):null,Qx=d((e=>{const{__html:t,richVersion:n="",...i}=e;return o(g,{defaultPadding:"p-0",...i,children:o(De,{__html:t,richVersion:n})})})),ey=d((({label:e,labelIconBgVersion:t,icon:n,onToggle:i,labelIcon:a})=>o(Wc,{tag:"button",className:u("border-none bg-transparent items-center group/button",a?.icon?"py-xs":"py-lg"),onClick:i,textNode:c("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[null,e?o(_e,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:n?o(W,{name:n,iconVersion:"color",width:"24",height:"24"}):null}))),ty=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",ny=(e=!1)=>e?"MinusIcon":"PlusIcon",iy=(e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon",ay=zt((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,label:i="Развернуть",labelIcon:a,labelIconBgVersion:l,foldButtonVersion:r="default",version:s,role:c,...d})=>{const m=Se();return o(g,{className:u("w-full border-0 border-b border-solid border-main-divider last:border-b-0",e),defaultPadding:"p-0",tag:"div",version:"transparent",role:c,...d,children:o(Ji,{isFoldButtonOnTop:n,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o(Zi,{className:u("gap-lg",ty(m)),isUnfolded:e,children:R({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>ly({foldButtonVersion:r,label:i,labelIcon:a,labelIconBgVersion:l,isUnfolded:e,onToggle:t,isMobile:m})})})}),{childrenTypes:{exclude:["RollupItem"]}}),ly=({foldButtonVersion:e,label:t,labelIcon:n,labelIconBgVersion:i,isUnfolded:a,onToggle:l,isMobile:r=!1})=>{const s=t||(a?"Скрыть":"Развернуть"),c=((e=!1,t=!1)=>t?iy(e):ny(e))(a,r);return"accordion"===e?o(ey,{label:s,labelIcon:n,labelIconBgVersion:i,icon:c,onToggle:l}):o(Hc,{label:s,icon:a?"ArrowUpIcon":"ArrowDownIcon",onClick:l})},ry=d((({name:e,text:t,value:n,checked:i,onChange:a,className:l})=>o("div",{className:l,children:c("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[o("input",{className:u(dn.split(" ").filter((e=>"rounded"!==e)),bi,"flex justify-center items-center after:block after:w-2.5 after:h-2.5 after:rounded-full rounded-full","checked:border-2 checked:!border-primary-main focus:checked:border-primary-main checked:after:bg-primary-main"),type:"radio",value:n,name:e,checked:i,onChange:e=>a?.(e.target.value),role:"radio"}),t?o(_e,{color:"text-primary-text",children:t}):null]})}))),sy=d((({className:e=""})=>{const[t,n]=i("option2"),a=l((e=>n(e)),[]);return c("div",{className:u("order-4",e),role:"radiogroup",children:[o(ry,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:a}),o(ry,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:a})]})})),oy=d((({data:e,fieldLabel:t,fieldValue:n,selected:i,placeholder:a="",setSelected:l,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[n||t],text:e?.[t]}))),c=s.find((e=>e.key===i));return o(Tn,{options:s,label:r,placeholder:a||i,onChange:e=>l(e.key),value:c})})),cy=d((({regions:e=[],selectedRegion:t,onSelectedRegion:n,branches:i=[],selectedBranch:a,onSelectedBranch:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(oy,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(oy,{data:i,fieldValue:"branchCode",fieldLabel:"address",selected:a,setSelected:l,label:"Отделение",placeholder:"Выберите отделение"})})]}))),dy=["От 1 дня","До 365 дней"],my=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(_e,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(sl,{min:1,max:365,value:e,items:dy,onChange:t})]}))),uy=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:n,safeBoxCases:i=[],selectedBoxSize:a,onSelectedBoxSize:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(oy,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(oy,{data:i,fieldLabel:"safeBoxCasesSize",selected:a,setSelected:l,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),hy=d((({regions:e,selectedRegion:t,branches:n,selectedBranch:i,days:a,selectedCaseVolume:l,selectedBoxSize:r,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:u})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(cy,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:n,selectedBranch:i,onSelectedBranch:py(m)}),o(my,{days:a,setDays:e=>m({days:e})}),o(uy,{caseVolumes:d,selectedCaseVolume:l,onSelectedCaseVolume:gy(m),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(_e,{size:"text-l",font:"font-light",color:"text-secondary-text",children:"Тип договора"})}),c("div",{className:"contents @md:flex justify-between items-center gap-m",children:[o(sy,{}),o(ve,{text:"Офисы на карте",version:"primary",onClick:u,className:"order-6"})]})]}))),py=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},gy=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},fy=d((({days:e,tariffs:t=[]})=>{const n=yy(e,t),i="На рисунке изображена пачка листов\nформата А4";return c("div",{className:"contents @xl:flex flex-col justify-between gap-xl order-2",children:[c("div",{className:"flex flex-col @xl:flex-row gap-x-6xl gap-y-2xl order-5 @xl:order-none py-2xl @xl:py-0 border-t border-main-divider @xl:border-none",children:[xy("Аренда за",e),xy("Цена",n+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:i})}),c("div",{className:"flex flex-col items-center gap-s order-3 @xl:order-none mb-xl @xl:mb-0 bg-primary-main py-s @xl:p-3xl text-center",children:[o(ne,{image:{icon:"PackA4Icon"},className:"@xl:h-60"}),o("div",{className:"hidden @xl:inline opacity-80 whitespace-pre-line",children:o(w,{size:"text-s",font:"font-light",color:"text-white",children:i})})]})]})})),xy=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(_e,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o("span",{className:"text-l @xl:text-h3 text-primary-text",children:t})]}),yy=(e,t)=>{const n=by(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},by=e=>{let t=1;switch(!0){case e>30&&e<=90:t=2;break;case e>90&&e<=180:t=3;break;case e>180&&e<=365:t=4}return t},vy=(e,t)=>e.find((e=>e.branchCode===t)),Ny=d((e=>{const{regions:t,data:n,branches:i,onChange:l,onClick:r}=e;a((()=>{l({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,l]);const s=vy(i,n.selectedBranch),d=wy(s?.safeBoxCaseVolumes),m=Cy(s?.safeBoxCaseVolumes,n.selectedCaseVolume)?.safeBoxCases,u=Sy(m,n.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(hy,{...n,regions:t,onClick:r,branches:i,caseVolumes:d,safeBoxCases:m,onChange:l}),o(fy,{days:n.days,tariffs:u})]})})),wy=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Cy=(e,t)=>e?.find((e=>e.volume===t)),Sy=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,ky=[];const Iy=async e=>await Pt(e,{method:"GET"})||ky,Ty=d((({title:e,footnote:t,className:n="",...a})=>{const[r,s]=i(!1),d=l((()=>s((e=>!e))),[]),[m,u]=i({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),h=Bs(),p=By(m.selectedRegion,h),f=function(e){const{data:t}=ci(e?`/api/v1/safeboxes?regionCode=${e}`:null,Iy);return t||ky}(p),x=l((e=>u((t=>({...t,...e})))),[u]),y=(b=vy(f,m.selectedBranch)||f,Array.isArray(b)?b.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)].filter(Boolean),content:void 0}))).filter((e=>e.coords&&2===e.coords.length)):b?.gpsLatitude&&b?.gpsLongitude?[{coords:[b.gpsLatitude,b.gpsLongitude]}]:[]);var b;return c(g,{className:n,defaultPadding:"",...a,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(N,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(Ny,{regions:h,branches:f,data:{...m,selectedRegion:p},onClick:d,onChange:x}),t?o(w,{size:"text-s",font:"font-light",children:t}):null]}),y.length&&r?o($i,{points:y,className:"h-[640px]"}):null]})})),By=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,Py=e=>e<4?"w-72":"w-52",Ry={description:"text-white/80 text-l font-light group-data-primary:text-secondary-text group-data-gray:text-secondary-text",iconText:"text-white group-data-primary:text-secondary-text group-data-gray:text-secondary-text",iconBackground:"bg-white/30 group-data-primary:bg-main-divider",iconConnector:"bg-white group-data-primary:bg-secondary-light",dot:"bg-white/80 group-data-primary:bg-secondary-text"},Dy=d((({buttons:e,className:t="",description:n,showLines:i=!0,steps:a=[],stepVersion:l="gray",title:r,version:s="primary",...d})=>{const m=a.length>3,h=Ry,p=(e=>e?"":"opacity-0")(i),f=Se();return c(g,{className:u("box-border flex flex-col items-center overflow-hidden gap-y-3xl",t),defaultPadding:"p-6xl",version:s,...d,children:[o(S,{headlineVersion:"S",title:r,description:n,isEmbedded:!0,className:"w-full",align:hd(f)}),a?.length?c("div",{className:"box-border space-y-lg flex flex-col justify-center",children:[o("div",{className:u("flex items-center",m?"px-16":"px-24"),children:Qc(o("div",{className:u("h-0.5 w-full bg-secondary-light flex-1",p)}))(a.map(My(h,m,l)))}),o("div",{className:u("flex justify-between",m?"gap-x-s":"gap-x-20"),children:a.map((x={styleMap:h,version:s},(e,t,n)=>{const{styleMap:i,version:a}=x,{label:l,description:r,button:s,isDotted:d}=e;return c("div",{className:u("relative flex flex-col items-center text-center justify-between whitespace-pre-line overflow-hidden space-y-3xl",Py(n.length)),children:[c("div",{className:"space-y-xs",children:[l?o(_e,{size:"text-h6",align:"text-center",children:l}):null,c("div",{className:"flex flex-col items-center gap-3xs",children:[r?o("div",{className:i.description,children:r}):null,o(De,{__html:e.__html,itemSize:"list-s",isDotted:d})]})]}),s?.text?o(ve,{className:"box-border py-s w-full max-w-60 mt-auto",version:a,...s,children:s?.text}):null]},String(t))}))})]}):null,je(e)]});var x})),My=(e,t,n)=>({icon:i},a)=>{const l="secondary"===n?"white":"color";return o(g,{defaultPadding:"",className:`${_y(t)} flex justify-center items-center text-center rounded-full box-border z-10`,version:n,children:Le(i)?o(ne,{image:{...i,iconVersion:i?.iconVersion||l},width:"48",height:"48"}):o("span",{className:u("text-h4","transparent"===n?e.iconText:(r=n,"secondary"===r?"group-data-primary:text-white":"text-secondary-text")),children:a+1})},String(a));var r},_y=e=>e?"h-16 w-16":"h-24 w-24",Ay=d((()=>o("div",{className:"hidden",role:"none"}))),Ey="hidden sm:flex absolute z-40",zy={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},Oy=d((({className:e,items:t=[],activeItem:n,onChange:i,tabsType:l="default"})=>{const[r,s]=Dc({itemCount:t?.length||0});return a((()=>Fy(r.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(yc,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:zy[l].item,gap:zy[l].gap,children:t.map(kx(n,i,l))}),s.canScrollLeft?o(zc,{className:u("left-6",Ey,zy[l].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(Oc,{className:u("right-6",Ey,zy[l].buttonTop),onClick:s.scrollRight}):null]})})),Fy=(e,t,n)=>{const i=t.findIndex((e=>e===n));e&&i>0&&e.scrollTo({left:e?.children[i]?.offsetLeft,behavior:"smooth"})},Vy={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},Ly=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(Vy[t].wrapper,e),children:o(Oy,{className:Vy[t].component,tabsType:t,...n})}):null,jy=zt((({className:e="",tabs:t=[],block:n,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=qy(n??{}),p=D(),f=t.every((e=>"link"===e?.type)),x=s?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,{isReady:y}=p,[b,v]=i(Wy(x,((e="")=>{const t=globalThis?.location?.href;return t?new URL(t).searchParams.get(e):null})(h))),N=x[b],w=x.findIndex((e=>Boolean(e.selected)));a((()=>{const e=p.query[h]?x.findIndex(((e,t)=>"group"===e.type&&(e?.tabName??String(t))===p.query[h])):w;v(-1===e?0:e)}),[y,w,h]);const C=Uy(x[b],b),S=l((e=>{const t=x.indexOf(e),n=x[t];v(t),"group"===n.type&&((e,t)=>{const n=new URLSearchParams(p.query);e.text?n.set(h,e?.tabName??String(t)):n.delete(h),p.replace(`${p.pathname}?${n}`,"",{scroll:!1})})(e,t)}),[x]);return c(g,{className:u({"sticky top-1 z-20":d&&f},e),defaultPadding:"p-0",block:n,...m,children:[Ly({className:u({"pb-1":n?.slots&&"default"===r,"sticky top-1 z-20":d&&!f}),items:$y(t,x),activeItem:N,tabsType:r,onChange:S}),o("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:Object.entries(n?.slots??{}).map((([e,t])=>P(t,{...m?.options,slotName:C,parent:n,extraProps:{className:e===C?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(Uy)?.filter(Boolean)||[]}),qy=({__id:e,anchor:t})=>t??e??"tabs",$y=(e,t)=>t?.length?t:e,Uy=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",Wy=(e,t)=>t?Number(t):e.reduce(((e,t,n)=>t.selected?n:e),0),Hy={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},Yy=d((({children:e,activeIndex:t,columnWidth:n,version:i="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:Hy[i],style:{transform:`translateX(-${t*n}px)`},children:e})}))),Ky=d((({className:e="",isOpen:t,onClick:n})=>o(ve,{className:e,appendRight:o(ne,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"24",height:"24"}),text:t?"Скрыть":"Показать",version:"gray",onClick:n}))),Gy={Buttons:({buttons:e})=>je(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?o(ne,{image:e}):null,RichText:({__html:e,isDotted:t=!0})=>o("div",{className:"flex flex-col justify-between items-start text-h6",children:o(De,{__html:e,isDotted:t,itemSize:"list-m"})}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(_e,{size:"text-h6",children:e})}):null,t?o("div",{className:"lg:text-l font-light text-xs",children:o(_e,{color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,tableSource:n,pdfUrl:i,isOpen:a})=>e?o(Ky,{className:"w-fit",isOpen:a,onClick:()=>{t({tableSource:n,pdfUrl:i})}}):null},Xy=d((({cell:e,fieldIdx:t,rowIdx:n,cellIdx:l,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=i(!0);a((()=>{l===o&&s||m(!0)}),[s,o]);return Jy({cell:e,cellProps:{rowIdx:n,cellIdx:l,fieldIdx:t,displayTable:e=>{m(!1),c(l),r(e)},isVisible:d}})})),Jy=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...i}=e;if(!n||!(n in Gy))return null;return o(Gy[n],{...t,...i})},Zy=d((({cells:e,rowIdx:t,cellIdx:n,setTableInner:i,tableInner:a,openTableInnerIdx:l,setOpenTableInnerIdx:r})=>o("div",{className:"w-80 flex-grow flex flex-col gap-m @4xl:gap-lg",role:"cell",children:e?.length?e.map(((e,s)=>o(Xy,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:i,tableInner:a,openTableInnerIdx:l,setOpenTableInnerIdx:r},String(s)))):null}))),Qy=(e,t)=>140*vg(e.slice(0,t).map((e=>e?.cols?.length??1))),eb=(e,t)=>e?.length>0?o("div",{className:u("flex",{"text-secondary-text":0===t}),children:e.map(((e,t)=>o("div",{className:"w-20 mx-lg",children:o(_e,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,tb=d((({rows:e})=>{const t=e?.[0]?.length??0,[n,i]=_f({itemCount:t,visibleItemCount:5});return c("div",{children:[e?.map((a=n,(e,t)=>{if(!e?.length)return null;const[n,...i]=e,l=u("flex duration-1000 text-center",0!==t?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[n?.data?o("div",{className:"whitespace-pre-wrap sm:whitespace-normal w-48 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0",children:o(_e,{size:"text-xl",font:"font-light",children:n.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:l,style:{transform:`translateX(-${Qy(i,a)}px)`},children:i?.map(((e,t)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(_e,{size:"text-xl",children:e.data}):null,e?.cols?eb(e.cols,a):null]},`row${t}`)))})})]},String(t))})),Af({...i,btnClass:["left-3 top-20","right-3 top-20"],className:""})]});var a})),nb=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,n)=>{const i=`activeTabIdx:${e}-tableIdx:${n}`;return c("div",{className:"w-full @container",children:[o("div",{className:"flex py-m sm:px-m bg-white @4xl:bg-gray relative",children:o(_e,{size:"text-xl",align:"text-left",children:t.title})}),o("div",{className:"w-full sm:pl-xs overflow-hidden transition-height duration-500 ease-in-out",children:o("div",{className:"relative",children:o(tb,{rows:t.rowsData})})})]},i)}))}))),ib=(e=!1)=>""+(e?"text-white":"text-secondary-text"),ab=d((({currencies:e,linkToPDF:t,activeTabIndex:n,setActiveTabIndex:i})=>c("div",{className:"flex justify-between items-center w-full py-lg",children:[e&&e.length>1?o("div",{className:"flex bg-secondary-light p-2xs rounded-md",children:e.map(((e,t)=>o("div",{className:u("rounded-md px-4 py-3 cursor-pointer",{"bg-primary-main":t===n}),onClick:()=>i(t),children:o(_e,{size:"text-xl",font:"font-light",color:ib(t===n),children:e||t+1})},e)))}):null,t?o(ve,{className:"text-primary-main",href:t,version:"secondary",target:"_blank",appendLeft:o(W,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),lb=zt((({tableSource:e,pdfUrl:t,onClick:n})=>{const a=e?.tableData,[r,s]=i(0),d=l((e=>s(e)),[]),m=a?.[r]?.items??[],u=a?.map((e=>e.currency??""));return c("div",a?{className:"bg-white z-10",children:[o(ab,{currencies:u,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(nb,{activeTabIndex:r,items:m}),o(Ky,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(_e,{size:"text-h6",children:"Данных нет"}),o(Ky,{onClick:n,isOpen:!0})]})})),rb=d((({children:e,tableInner:t,onHideContentClick:n})=>c("div",{className:"self-start flex flex-col",role:"row",children:[o("div",{className:u("@4xl:border-main-divider @4xl:border-b","flex flex-col @4xl:flex-row gap-y-xs gap-x-5xl pb-lg @4xl:pt-lg"),children:e}),t?o("div",{className:"origin-top animate-expansion",children:o(lb,{...t,onClick:n})}):null]}))),sb=d((({row:{header:e,data:t},activeIndex:n,rowIdx:a,...r})=>{const[s,d]=i(void 0),m=l((e=>d(e)),[]),[h,p]=i(void 0),g=l((e=>p(e)),[]);return c(rb,{onHideContentClick:()=>d(void 0),tableInner:s,...r,children:[o("div",{className:u("text-s","w-80 flex-shrink-0"),children:c("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?o(ne,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?o(_e,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(Yy,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(Zy,{cells:e,rowIdx:a,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})})),ob=d((({children:e,controls:t})=>{const{isScrollAvailable:n}=t;return c("div",{role:"table",className:"overflow-x-auto w-auto grid md:block",children:[c("div",{className:"relative space-y-xs",children:[e,Af({...t,btnClass:["top-28","top-11"],className:"right-7"})]}),n?o("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),cb=d((({className:e="",title:t,description:n,rowHeaders:i,tariffsColumns:a,hiddenRowsNum:l=0,...r})=>{const s=a?.map((({data:e})=>e))||[],d=i?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),m=s.length,[h,p]=_f({itemCount:m,visibleItemCount:2}),f=(d||[]).map(((e,t)=>o(sb,{row:e,activeIndex:h,rowIdx:t,...r},String(t)))),[x,y]=l>0?[f.slice(0,-l),f.slice(-l)]:[f,[]];return c(g,{className:u("relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...r,children:[o(S,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:l>0?o(Ji,{renderFoldableSection:({isUnfolded:e})=>c(ob,{controls:p,children:[x,o(Zi,{isUnfolded:e,children:y})]}),renderFoldButton:Yc}):o(ob,{controls:p,children:f})})]})})),db=d((({className:e="",title:t,description:n,iconVersion:i,__html:a,richVersion:l,...r})=>c(g,{className:u("flex gap-s sm:gap-m bg-white group-data-secondary:bg-primary-main/10",e),...r,children:["small"===i?mb():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(_e,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?ub(n):null,a?o(De,{richVersion:l,__html:a}):null]})]}))),mb=()=>o("div",{className:"rounded-full h-4 w-4 text-center text-xs font-light bg-primary-main text-white group-data-secondary:bg-white group-data-secondary:text-primary-main",children:"i"}),ub=e=>o(w,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),hb=d((({prefix:e,unit:t,suffix:n})=>c("div",{className:"w-full flex items-end",children:[e?o("div",{className:"gradient-color-text",children:o(_e,{size:"text-h2",children:e})}):null,t?o("div",{className:"-mb-6 @xl:-mb-4",children:o("span",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:t})}):null,n?o("div",{className:"gradient-color-text",children:o(_e,{size:"text-h2",children:n})}):null]}))),pb=d((e=>{const{prefix:t,unit:n,suffix:i,...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(hb,{prefix:t,unit:n,suffix:i})})})),gb=zt((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:i=!0,version:a="transparent",isTheme:l=!1,isCardBorder:r=!1,image:s,...c})=>{const d=D();return o(g,{className:u("relative flex flex-col",Rf[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${J(d)(s?.src)})`}}:{},padding:t,version:a,isTheme:l,...c,children:R({...c,extraProps:{className:u("w-full",uc(r)),...Pf(i)}})})}),{childrenTypes:[]}),fb=e=>(e=>{const t="col-span-",n=e?.split(/\s+/).find((e=>e.startsWith(t)));return n?parseInt(n.substring(t.length),10):12})(e)<10?"py-xl px-6xl":"py-6xl px-32",xb=d((({className:e,title:t,url:n,previewImg:i,...a})=>{const l=D();return c(g,{className:e,defaultPadding:fb(e),...a,children:[o(S,{title:t,headlineVersion:"M"}),n?o("video",{className:"m-auto w-full object-fill",preload:"metadata",poster:$(l)(i?.src),style:{maxHeight:524},controls:!0,children:o("source",{src:$(l)(n)})}):null]})})),yb={AdTile:Ft,ApplicationForm:mo,ApplicationLeadForm:dc,BankAccountFiltration:md,BenefitsBlock:fd,BonusBenefitsBlock:Nd,ButtonsBlock:Cd,CalculatorBonus:Fd,CalculatorBusinessDeposit:tm,CalculatorCredit:fm,CalculatorDeposit:Am,CalculatorRefinancing:qm,CardTransfer:Gm,Carousel:iu,CarouselCard:su,CarouselCatalogCard:cu,CarouselLinks:uu,CarouselRecommendationCard:vu,CarouselTariffsCard:Cu,ContactsBlock:ku,CreditCardForm:ph,CreditForm:Gh,DepositFiltration:ep,Depository:fp,ErrorBlock:yp,ExchangeRateTile:tg,Footer:Eg,GracePeriod:zg,GrantSupport:Lg,Header:If,Headline:S,HorizontalLayout:Df,ImgBlock:Mf,InsuranceAmountBlock:Vf,InvestmentInfo:$f,LinkDocs:ix,MobileAppTile:sx,MortgageFiltration:Bx,OfficesAtmsMap:Wx,Placeholder:Hx,ProductBlock:Ot,ProductGallery:Kx,RepresentativeOfficeInfo:Xx,RichTextBlock:Qx,RollupItem:ay,SafeDepositRental:Ty,StepsBlock:Dy,StickyBottomMenu:Ay,TabsLayout:jy,TariffsTable:cb,TextBlock:db,UnitBlock:pb,VerticalLayout:gb,Video:xb},bb=ce((()=>{a((()=>{Xt()}),[]);const e=Zt();rn(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const i=JSON.parse(n?.dataset?.aspects??"[]");Yt({aspectsAttributes:i,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))})),vb="cookie",Nb=d((({__html:e})=>{const[t,{setTrue:n,setFalse:i}]=ln();xg((()=>{globalThis.localStorage?.getItem(vb)||n()}),[],3e3);const a=l((()=>{globalThis.localStorage?.setItem(vb,"true"),i()}),[]);return t&&e?o("div",{className:"container fixed left-0 right-0 bottom-0 z-50",role:"dialog",children:c("div",{className:"bg-white m-xl p-xl rounded-md flex sm:items-center shadow-main-black",children:[o("div",{className:"sm:flex-1",children:o(De,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(tr,{className:"bg-main-gray rounded-md w-11 h-11",onClose:a})})]})}):null}));function wb(e){throw new Error(e)}const Cb=({onCloseAll:e,onClose:t}={})=>{const[n,{push:r,pop:s,clear:o}]=function(e=[]){const[t,n]=i(e),a=l((e=>n((t=>[...t,e]))),[]),r=l((()=>n((e=>e.slice(0,-1)))),[]),s=l((e=>n((t=>t.filter((t=>t!==e))))),[]),o=l((()=>n([])),[]);return[t,{setList:n,push:a,pop:r,remove:s,clear:o}]}(),c=l((()=>{e&&e(n),o()}),[n,e]),d=l((()=>{t&&t(n[n.length-1]),s()}),[n,t]);return a((()=>me.subscribe("dialog",(e=>{if(e)switch(e.type){case"open":r(e);break;case"close":e.all?c():d();break;default:wb(e)}}))),[c,d]),n},Sb=d((()=>{const e=l((e=>{for(const t of e)t?.onClose&&t.onClose()}),[]),t=l((e=>{e?.onClose&&e.onClose()}),[]),n=Cb({onCloseAll:e,onClose:t}),{close:i}=ue(),r=l((({key:e})=>{"Escape"===e&&i()}),[]);return rn(globalThis.document,"keydown",r),a((()=>{n.length?(globalThis.document?.body.classList.add("no-scrollbar"),globalThis.document?.body.classList.add("overflow-hidden")):(globalThis.document?.body.classList.remove("no-scrollbar"),globalThis.document?.body.classList.remove("overflow-hidden"))}),[n]),n.length?o("div",{className:"fixed inset-0 z-50",role:"dialog",children:n.map((({dialog:e,id:t},i)=>o("div",{className:u("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar bg-black/50",{hidden:i!==n.length-1}),children:e},String(t||i))))}):null})),kb=d((()=>{const[e,t]=i(null),n=l((()=>{t(null)}),[]);a((()=>me.subscribe("popup",(e=>{if(e)switch(e.type){case"open":case"update":t(e);break;case"close":n();break;default:wb(e)}}))),[]);const r=l((({key:e})=>{"Escape"===e&&n()}),[n]);return rn(globalThis.document,"keydown",r),e?o("div",{className:u("z-50",e.fixed?"fixed":"absolute"),style:{left:`${e.left}px`,top:`${e.top}px`,...e.width?{width:`${e.width}px`}:{}},role:"dialog",children:e.popup}):null})),Ib="header",Tb="footer",Bb="sticky-footer",Pb={},Rb=d((({className:e,data:t=Pb,blocksRegistry:n,blockDecorator:i})=>{const{slots:a,blocks:l,fallback:r,...s}=t,d=Et(s,r);bb(),Bp();const m={key:"",page:{slots:a,blocks:l,fallback:r,...d},blocksRegistry:n,blockDecorator:i,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:u("@container relative",t.style,e),children:[a?.header?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:P(a?.header,{...m,slotName:Ib})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[R({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),P(a?.footer,{...m,slotName:Tb})]})]}),a?.["sticky-footer"]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:P(a?.["sticky-footer"],{...m,slotName:Bb})}):null,o(Sb,{}),o(kb,{}),o(Nb,{__html:d?.cookieContent?.__html})]})}));Object.assign(Rb,{childrenTypes:[],slots:()=>[Ib,Tb,Bb]});e.Blocks=yb,e.ContentPage=Rb,e.handlerDecorator=ce,e.joinList=Qc,e.locationNavigator=Kt,e.packageVersion="0.14.681",e.projectSettings=_,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=L,e.useRouter=D,Object.defineProperty(e,"__esModule",{value:!0})}));