@redneckz/wildless-cms-uni-blocks 0.14.876 → 0.14.878

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 (722) hide show
  1. package/bundle/api/LeadServiceAPI.d.ts +4 -0
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +300 -157
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/components/ApplicationForm/ApplicationForm.d.ts +2 -3
  6. package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +5 -1
  7. package/bundle/hooks/useInn.d.ts +7 -0
  8. package/bundle/model/FormTypeFieldDef.d.ts +1 -1
  9. package/bundle/retail/api/dadataHints/dadataHintsType.d.ts +10 -3
  10. package/bundle/retail/api/dadataHints/hintsListsOptions.d.ts +2 -10
  11. package/bundle/retail/components/Fields/SelectField.d.ts +1 -0
  12. package/bundle/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +0 -7
  13. package/bundle/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +7 -0
  14. package/bundle/retail/inputs.d.ts +0 -2
  15. package/bundle/retail/model/LeadFormState.d.ts +0 -2
  16. package/bundle/retail/model/NameFieldDef.d.ts +1 -1
  17. package/bundle/retail/validator/validators.d.ts +5 -3
  18. package/bundle/ui-kit/FormField/Fields/CompanyNameByInnField.d.ts +2 -0
  19. package/bundle/ui-kit/FormField/Fields/FullRegionField.d.ts +5 -0
  20. package/bundle/ui-kit/FormField/Fields/InnDadataField.d.ts +2 -0
  21. package/bundle/ui-kit/FormField/Fields/PartnerSymbolCodeField.d.ts +15 -0
  22. package/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  23. package/bundle/ui-kit/FormField/inputColumnStyle.d.ts +1 -1
  24. package/bundle/ui-kit/FormField/validators.d.ts +8 -1
  25. package/bundle/ui-kit/Select/Option.d.ts +6 -0
  26. package/bundle/ui-kit/Select/Select.d.ts +2 -0
  27. package/bundle/ui-kit/Select/SelectPopup.d.ts +1 -0
  28. package/bundle/ui-kit/Select/useSelectPopup.d.ts +2 -1
  29. package/dist/api/LeadServiceAPI.d.ts +4 -0
  30. package/dist/api/LeadServiceAPI.js +13 -6
  31. package/dist/api/LeadServiceAPI.js.map +1 -1
  32. package/dist/components/ApplicationForm/ApplicationForm.d.ts +2 -3
  33. package/dist/components/ApplicationForm/ApplicationForm.js +4 -3
  34. package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  35. package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +5 -1
  36. package/dist/components/ApplicationForm/ApplicationFormContent.js +0 -2
  37. package/dist/components/ApplicationForm/ApplicationFormContent.js.map +1 -1
  38. package/dist/hooks/useInn.d.ts +7 -0
  39. package/dist/hooks/useInn.js +11 -0
  40. package/dist/hooks/useInn.js.map +1 -0
  41. package/dist/model/FormTypeFieldDef.d.ts +1 -1
  42. package/dist/retail/adaptors/getPersonalInfoData.js +1 -1
  43. package/dist/retail/adaptors/getPersonalInfoData.js.map +1 -1
  44. package/dist/retail/api/dadataHints/dadataHints.js +11 -7
  45. package/dist/retail/api/dadataHints/dadataHints.js.map +1 -1
  46. package/dist/retail/api/dadataHints/dadataHintsType.d.ts +10 -3
  47. package/dist/retail/api/dadataHints/hintsListsOptions.d.ts +2 -10
  48. package/dist/retail/api/dadataHints/hintsListsOptions.js +17 -2
  49. package/dist/retail/api/dadataHints/hintsListsOptions.js.map +1 -1
  50. package/dist/retail/components/DaDataInputControl/DaDataInputControl.js +10 -2
  51. package/dist/retail/components/DaDataInputControl/DaDataInputControl.js.map +1 -1
  52. package/dist/retail/components/DaDataInputControl/InputPopup.js +2 -2
  53. package/dist/retail/components/DaDataInputControl/InputPopup.js.map +1 -1
  54. package/dist/retail/components/DaDataInputControl/useInputPopup.js +1 -0
  55. package/dist/retail/components/DaDataInputControl/useInputPopup.js.map +1 -1
  56. package/dist/retail/components/Fields/BirthPlaceField.js +1 -1
  57. package/dist/retail/components/Fields/BirthPlaceField.js.map +1 -1
  58. package/dist/retail/components/Fields/ChildrenField.js +1 -1
  59. package/dist/retail/components/Fields/ChildrenField.js.map +1 -1
  60. package/dist/retail/components/Fields/CodeWordField.js +1 -1
  61. package/dist/retail/components/Fields/CodeWordField.js.map +1 -1
  62. package/dist/retail/components/Fields/DependentsField.js +1 -1
  63. package/dist/retail/components/Fields/DependentsField.js.map +1 -1
  64. package/dist/retail/components/Fields/DulIssueDateField.js +1 -1
  65. package/dist/retail/components/Fields/DulIssueDateField.js.map +1 -1
  66. package/dist/retail/components/Fields/DulIssuedByField.js +2 -2
  67. package/dist/retail/components/Fields/DulIssuedByField.js.map +1 -1
  68. package/dist/retail/components/Fields/DulSubdivisionCodeField.js +14 -1
  69. package/dist/retail/components/Fields/DulSubdivisionCodeField.js.map +1 -1
  70. package/dist/retail/components/Fields/EmailField.js +1 -3
  71. package/dist/retail/components/Fields/EmailField.js.map +1 -1
  72. package/dist/retail/components/Fields/Experience5YearsField.js +1 -1
  73. package/dist/retail/components/Fields/Experience5YearsField.js.map +1 -1
  74. package/dist/retail/components/Fields/FamilyMembersField.js +2 -2
  75. package/dist/retail/components/Fields/FamilyMembersField.js.map +1 -1
  76. package/dist/retail/components/Fields/GeneralSeniorityField.js +12 -1
  77. package/dist/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  78. package/dist/retail/components/Fields/JobsNumberField.js +1 -1
  79. package/dist/retail/components/Fields/JobsNumberField.js.map +1 -1
  80. package/dist/retail/components/Fields/LastJobExperienceField.js +1 -1
  81. package/dist/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  82. package/dist/retail/components/Fields/LegalFormField.js +1 -1
  83. package/dist/retail/components/Fields/LegalFormField.js.map +1 -1
  84. package/dist/retail/components/Fields/MandatoryPaymentsField.js +1 -1
  85. package/dist/retail/components/Fields/MandatoryPaymentsField.js.map +1 -1
  86. package/dist/retail/components/Fields/MiddleNameField.js +1 -1
  87. package/dist/retail/components/Fields/NameField.js +1 -1
  88. package/dist/retail/components/Fields/RetirementIncomeField.js +1 -1
  89. package/dist/retail/components/Fields/RetirementIncomeField.js.map +1 -1
  90. package/dist/retail/components/Fields/SelectField.d.ts +1 -0
  91. package/dist/retail/components/Fields/SelectField.js.map +1 -1
  92. package/dist/retail/components/Fields/SurnameField.js +1 -1
  93. package/dist/retail/components/Fields/WagesField.js +1 -1
  94. package/dist/retail/components/Fields/WagesField.js.map +1 -1
  95. package/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +0 -7
  96. package/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +3 -4
  97. package/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
  98. package/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +7 -0
  99. package/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +3 -3
  100. package/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
  101. package/dist/retail/inputs.d.ts +0 -2
  102. package/dist/retail/inputs.js +0 -4
  103. package/dist/retail/inputs.js.map +1 -1
  104. package/dist/retail/model/LeadFormState.d.ts +0 -2
  105. package/dist/retail/model/NameFieldDef.d.ts +1 -1
  106. package/dist/retail/utils/calculateInputs.js +1 -1
  107. package/dist/retail/utils/calculateInputs.js.map +1 -1
  108. package/dist/retail/utils/updateOrganizationFields.js +1 -1
  109. package/dist/retail/utils/updateOrganizationFields.js.map +1 -1
  110. package/dist/retail/validator/getLimitedBirthdayValidation.js +2 -1
  111. package/dist/retail/validator/getLimitedBirthdayValidation.js.map +1 -1
  112. package/dist/retail/validator/getRetailFormValidator.js +3 -0
  113. package/dist/retail/validator/getRetailFormValidator.js.map +1 -1
  114. package/dist/retail/validator/validatorObj.js +4 -9
  115. package/dist/retail/validator/validatorObj.js.map +1 -1
  116. package/dist/retail/validator/validators.d.ts +5 -3
  117. package/dist/retail/validator/validators.js +27 -17
  118. package/dist/retail/validator/validators.js.map +1 -1
  119. package/dist/ui-kit/FormField/Fields/CompanyNameByInnField.d.ts +2 -0
  120. package/dist/ui-kit/FormField/Fields/CompanyNameByInnField.js +17 -0
  121. package/dist/ui-kit/FormField/Fields/CompanyNameByInnField.js.map +1 -0
  122. package/dist/ui-kit/FormField/Fields/FullRegionField.d.ts +5 -0
  123. package/{mobile/dist/ui-kit/FormField/Fields/RegionPremiumField.js → dist/ui-kit/FormField/Fields/FullRegionField.js} +5 -4
  124. package/dist/ui-kit/FormField/Fields/FullRegionField.js.map +1 -0
  125. package/dist/ui-kit/FormField/Fields/InnDadataField.d.ts +2 -0
  126. package/dist/ui-kit/FormField/Fields/InnDadataField.js +29 -0
  127. package/dist/ui-kit/FormField/Fields/InnDadataField.js.map +1 -0
  128. package/dist/ui-kit/FormField/Fields/PartnerSymbolCodeField.d.ts +15 -0
  129. package/dist/ui-kit/FormField/Fields/PartnerSymbolCodeField.js +19 -0
  130. package/dist/ui-kit/FormField/Fields/PartnerSymbolCodeField.js.map +1 -0
  131. package/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  132. package/dist/ui-kit/FormField/getField.js +12 -2
  133. package/dist/ui-kit/FormField/getField.js.map +1 -1
  134. package/dist/ui-kit/FormField/getObjectValidator.js +3 -0
  135. package/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
  136. package/dist/ui-kit/FormField/inputColumnStyle.d.ts +1 -1
  137. package/dist/ui-kit/FormField/inputColumnStyle.js +1 -1
  138. package/dist/ui-kit/FormField/inputColumnStyle.js.map +1 -1
  139. package/dist/ui-kit/FormField/validators.d.ts +8 -1
  140. package/dist/ui-kit/FormField/validators.js +5 -2
  141. package/dist/ui-kit/FormField/validators.js.map +1 -1
  142. package/dist/ui-kit/Input/renderErrorText.js +1 -1
  143. package/dist/ui-kit/Input/renderErrorText.js.map +1 -1
  144. package/dist/ui-kit/Select/Option.d.ts +6 -0
  145. package/dist/ui-kit/Select/Select.d.ts +2 -0
  146. package/dist/ui-kit/Select/Select.js +27 -5
  147. package/dist/ui-kit/Select/Select.js.map +1 -1
  148. package/dist/ui-kit/Select/SelectPopup.d.ts +1 -0
  149. package/dist/ui-kit/Select/SelectPopup.js +4 -2
  150. package/dist/ui-kit/Select/SelectPopup.js.map +1 -1
  151. package/dist/ui-kit/Select/useSelectPopup.d.ts +2 -1
  152. package/dist/ui-kit/Select/useSelectPopup.js +3 -2
  153. package/dist/ui-kit/Select/useSelectPopup.js.map +1 -1
  154. package/lib/api/LeadServiceAPI.d.ts +4 -0
  155. package/lib/api/LeadServiceAPI.js +13 -6
  156. package/lib/api/LeadServiceAPI.js.map +1 -1
  157. package/lib/common.css +1 -1
  158. package/lib/components/ApplicationForm/ApplicationForm.d.ts +2 -3
  159. package/lib/components/ApplicationForm/ApplicationForm.fixture.d.ts +1 -0
  160. package/lib/components/ApplicationForm/ApplicationForm.fixture.mobile.d.ts +1 -0
  161. package/lib/components/ApplicationForm/ApplicationForm.js +4 -3
  162. package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  163. package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +5 -1
  164. package/lib/components/ApplicationForm/ApplicationFormContent.js +0 -2
  165. package/lib/components/ApplicationForm/ApplicationFormContent.js.map +1 -1
  166. package/lib/hooks/useInn.d.ts +7 -0
  167. package/lib/hooks/useInn.js +8 -0
  168. package/lib/hooks/useInn.js.map +1 -0
  169. package/lib/model/FormTypeFieldDef.d.ts +1 -1
  170. package/lib/retail/adaptors/getPersonalInfoData.js +1 -1
  171. package/lib/retail/adaptors/getPersonalInfoData.js.map +1 -1
  172. package/lib/retail/api/dadataHints/dadataHints.js +11 -7
  173. package/lib/retail/api/dadataHints/dadataHints.js.map +1 -1
  174. package/lib/retail/api/dadataHints/dadataHintsType.d.ts +10 -3
  175. package/lib/retail/api/dadataHints/hintsListsOptions.d.ts +2 -10
  176. package/lib/retail/api/dadataHints/hintsListsOptions.js +17 -2
  177. package/lib/retail/api/dadataHints/hintsListsOptions.js.map +1 -1
  178. package/lib/retail/components/DaDataInputControl/DaDataInputControl.js +10 -2
  179. package/lib/retail/components/DaDataInputControl/DaDataInputControl.js.map +1 -1
  180. package/lib/retail/components/DaDataInputControl/InputPopup.js +3 -3
  181. package/lib/retail/components/DaDataInputControl/InputPopup.js.map +1 -1
  182. package/lib/retail/components/DaDataInputControl/useInputPopup.js +1 -0
  183. package/lib/retail/components/DaDataInputControl/useInputPopup.js.map +1 -1
  184. package/lib/retail/components/Fields/BirthPlaceField.js +1 -1
  185. package/lib/retail/components/Fields/BirthPlaceField.js.map +1 -1
  186. package/lib/retail/components/Fields/ChildrenField.js +1 -1
  187. package/lib/retail/components/Fields/ChildrenField.js.map +1 -1
  188. package/lib/retail/components/Fields/CodeWordField.js +1 -1
  189. package/lib/retail/components/Fields/CodeWordField.js.map +1 -1
  190. package/lib/retail/components/Fields/DependentsField.js +1 -1
  191. package/lib/retail/components/Fields/DependentsField.js.map +1 -1
  192. package/lib/retail/components/Fields/DulIssueDateField.js +1 -1
  193. package/lib/retail/components/Fields/DulIssueDateField.js.map +1 -1
  194. package/lib/retail/components/Fields/DulIssuedByField.js +2 -2
  195. package/lib/retail/components/Fields/DulIssuedByField.js.map +1 -1
  196. package/lib/retail/components/Fields/DulSubdivisionCodeField.js +15 -2
  197. package/lib/retail/components/Fields/DulSubdivisionCodeField.js.map +1 -1
  198. package/lib/retail/components/Fields/EmailField.js +1 -3
  199. package/lib/retail/components/Fields/EmailField.js.map +1 -1
  200. package/lib/retail/components/Fields/Experience5YearsField.js +1 -1
  201. package/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
  202. package/lib/retail/components/Fields/FamilyMembersField.js +2 -2
  203. package/lib/retail/components/Fields/FamilyMembersField.js.map +1 -1
  204. package/lib/retail/components/Fields/GeneralSeniorityField.js +12 -1
  205. package/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  206. package/lib/retail/components/Fields/JobsNumberField.js +1 -1
  207. package/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
  208. package/lib/retail/components/Fields/LastJobExperienceField.js +1 -1
  209. package/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  210. package/lib/retail/components/Fields/LegalFormField.js +1 -1
  211. package/lib/retail/components/Fields/LegalFormField.js.map +1 -1
  212. package/lib/retail/components/Fields/MandatoryPaymentsField.js +1 -1
  213. package/lib/retail/components/Fields/MandatoryPaymentsField.js.map +1 -1
  214. package/lib/retail/components/Fields/MiddleNameField.js +1 -1
  215. package/lib/retail/components/Fields/NameField.js +1 -1
  216. package/lib/retail/components/Fields/RetirementIncomeField.js +1 -1
  217. package/lib/retail/components/Fields/RetirementIncomeField.js.map +1 -1
  218. package/lib/retail/components/Fields/SelectField.d.ts +1 -0
  219. package/lib/retail/components/Fields/SelectField.js.map +1 -1
  220. package/lib/retail/components/Fields/SurnameField.js +1 -1
  221. package/lib/retail/components/Fields/WagesField.js +1 -1
  222. package/lib/retail/components/Fields/WagesField.js.map +1 -1
  223. package/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +0 -7
  224. package/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +1 -2
  225. package/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
  226. package/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +7 -0
  227. package/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +1 -1
  228. package/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
  229. package/lib/retail/inputs.d.ts +0 -2
  230. package/lib/retail/inputs.js +0 -4
  231. package/lib/retail/inputs.js.map +1 -1
  232. package/lib/retail/model/LeadFormState.d.ts +0 -2
  233. package/lib/retail/model/NameFieldDef.d.ts +1 -1
  234. package/lib/retail/utils/calculateInputs.js +1 -1
  235. package/lib/retail/utils/calculateInputs.js.map +1 -1
  236. package/lib/retail/utils/updateOrganizationFields.js +1 -1
  237. package/lib/retail/utils/updateOrganizationFields.js.map +1 -1
  238. package/lib/retail/validator/getLimitedBirthdayValidation.js +2 -1
  239. package/lib/retail/validator/getLimitedBirthdayValidation.js.map +1 -1
  240. package/lib/retail/validator/getRetailFormValidator.js +4 -1
  241. package/lib/retail/validator/getRetailFormValidator.js.map +1 -1
  242. package/lib/retail/validator/validatorObj.js +5 -10
  243. package/lib/retail/validator/validatorObj.js.map +1 -1
  244. package/lib/retail/validator/validators.d.ts +5 -3
  245. package/lib/retail/validator/validators.js +22 -14
  246. package/lib/retail/validator/validators.js.map +1 -1
  247. package/lib/ui-kit/FormField/Fields/CompanyNameByInnField.d.ts +2 -0
  248. package/lib/ui-kit/FormField/Fields/CompanyNameByInnField.js +15 -0
  249. package/lib/ui-kit/FormField/Fields/CompanyNameByInnField.js.map +1 -0
  250. package/lib/ui-kit/FormField/Fields/FullRegionField.d.ts +5 -0
  251. package/{mobile/lib/ui-kit/FormField/Fields/RegionPremiumField.js → lib/ui-kit/FormField/Fields/FullRegionField.js} +4 -3
  252. package/lib/ui-kit/FormField/Fields/FullRegionField.js.map +1 -0
  253. package/lib/ui-kit/FormField/Fields/InnDadataField.d.ts +2 -0
  254. package/lib/ui-kit/FormField/Fields/InnDadataField.js +27 -0
  255. package/lib/ui-kit/FormField/Fields/InnDadataField.js.map +1 -0
  256. package/lib/ui-kit/FormField/Fields/PartnerSymbolCodeField.d.ts +15 -0
  257. package/lib/ui-kit/FormField/Fields/PartnerSymbolCodeField.js +17 -0
  258. package/lib/ui-kit/FormField/Fields/PartnerSymbolCodeField.js.map +1 -0
  259. package/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  260. package/lib/ui-kit/FormField/getField.js +12 -2
  261. package/lib/ui-kit/FormField/getField.js.map +1 -1
  262. package/lib/ui-kit/FormField/getObjectValidator.js +4 -1
  263. package/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
  264. package/lib/ui-kit/FormField/inputColumnStyle.d.ts +1 -1
  265. package/lib/ui-kit/FormField/inputColumnStyle.js +1 -1
  266. package/lib/ui-kit/FormField/inputColumnStyle.js.map +1 -1
  267. package/lib/ui-kit/FormField/validators.d.ts +8 -1
  268. package/lib/ui-kit/FormField/validators.js +3 -1
  269. package/lib/ui-kit/FormField/validators.js.map +1 -1
  270. package/lib/ui-kit/Input/renderErrorText.js +1 -1
  271. package/lib/ui-kit/Input/renderErrorText.js.map +1 -1
  272. package/lib/ui-kit/Select/Option.d.ts +6 -0
  273. package/lib/ui-kit/Select/Select.d.ts +2 -0
  274. package/lib/ui-kit/Select/Select.js +28 -6
  275. package/lib/ui-kit/Select/Select.js.map +1 -1
  276. package/lib/ui-kit/Select/SelectPopup.d.ts +1 -0
  277. package/lib/ui-kit/Select/SelectPopup.js +4 -2
  278. package/lib/ui-kit/Select/SelectPopup.js.map +1 -1
  279. package/lib/ui-kit/Select/useSelectPopup.d.ts +2 -1
  280. package/lib/ui-kit/Select/useSelectPopup.js +3 -2
  281. package/lib/ui-kit/Select/useSelectPopup.js.map +1 -1
  282. package/mobile/bundle/api/LeadServiceAPI.d.ts +4 -0
  283. package/mobile/bundle/bundle.umd.js +300 -157
  284. package/mobile/bundle/bundle.umd.min.js +1 -1
  285. package/mobile/bundle/components/ApplicationForm/ApplicationForm.d.ts +2 -3
  286. package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +5 -1
  287. package/mobile/bundle/hooks/useInn.d.ts +7 -0
  288. package/mobile/bundle/model/FormTypeFieldDef.d.ts +1 -1
  289. package/mobile/bundle/retail/api/dadataHints/dadataHintsType.d.ts +10 -3
  290. package/mobile/bundle/retail/api/dadataHints/hintsListsOptions.d.ts +2 -10
  291. package/mobile/bundle/retail/components/Fields/SelectField.d.ts +1 -0
  292. package/mobile/bundle/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +0 -7
  293. package/mobile/bundle/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +7 -0
  294. package/mobile/bundle/retail/inputs.d.ts +0 -2
  295. package/mobile/bundle/retail/model/LeadFormState.d.ts +0 -2
  296. package/mobile/bundle/retail/model/NameFieldDef.d.ts +1 -1
  297. package/mobile/bundle/retail/validator/validators.d.ts +5 -3
  298. package/mobile/bundle/ui-kit/FormField/Fields/CompanyNameByInnField.d.ts +2 -0
  299. package/mobile/bundle/ui-kit/FormField/Fields/FullRegionField.d.ts +5 -0
  300. package/mobile/bundle/ui-kit/FormField/Fields/InnDadataField.d.ts +2 -0
  301. package/mobile/bundle/ui-kit/FormField/Fields/PartnerSymbolCodeField.d.ts +15 -0
  302. package/mobile/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  303. package/mobile/bundle/ui-kit/FormField/inputColumnStyle.d.ts +1 -1
  304. package/mobile/bundle/ui-kit/FormField/validators.d.ts +8 -1
  305. package/mobile/bundle/ui-kit/Select/Option.d.ts +6 -0
  306. package/mobile/bundle/ui-kit/Select/Select.d.ts +2 -0
  307. package/mobile/bundle/ui-kit/Select/SelectPopup.d.ts +1 -0
  308. package/mobile/bundle/ui-kit/Select/useSelectPopup.d.ts +2 -1
  309. package/mobile/dist/api/LeadServiceAPI.d.ts +4 -0
  310. package/mobile/dist/api/LeadServiceAPI.js +13 -6
  311. package/mobile/dist/api/LeadServiceAPI.js.map +1 -1
  312. package/mobile/dist/components/ApplicationForm/ApplicationForm.d.ts +2 -3
  313. package/mobile/dist/components/ApplicationForm/ApplicationForm.js +4 -3
  314. package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  315. package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +5 -1
  316. package/mobile/dist/components/ApplicationForm/ApplicationFormContent.js +0 -2
  317. package/mobile/dist/components/ApplicationForm/ApplicationFormContent.js.map +1 -1
  318. package/mobile/dist/hooks/useInn.d.ts +7 -0
  319. package/mobile/dist/hooks/useInn.js +11 -0
  320. package/mobile/dist/hooks/useInn.js.map +1 -0
  321. package/mobile/dist/model/FormTypeFieldDef.d.ts +1 -1
  322. package/mobile/dist/retail/adaptors/getPersonalInfoData.js +1 -1
  323. package/mobile/dist/retail/adaptors/getPersonalInfoData.js.map +1 -1
  324. package/mobile/dist/retail/api/dadataHints/dadataHints.js +11 -7
  325. package/mobile/dist/retail/api/dadataHints/dadataHints.js.map +1 -1
  326. package/mobile/dist/retail/api/dadataHints/dadataHintsType.d.ts +10 -3
  327. package/mobile/dist/retail/api/dadataHints/hintsListsOptions.d.ts +2 -10
  328. package/mobile/dist/retail/api/dadataHints/hintsListsOptions.js +17 -2
  329. package/mobile/dist/retail/api/dadataHints/hintsListsOptions.js.map +1 -1
  330. package/mobile/dist/retail/components/DaDataInputControl/DaDataInputControl.js +10 -2
  331. package/mobile/dist/retail/components/DaDataInputControl/DaDataInputControl.js.map +1 -1
  332. package/mobile/dist/retail/components/DaDataInputControl/InputPopup.js +2 -2
  333. package/mobile/dist/retail/components/DaDataInputControl/InputPopup.js.map +1 -1
  334. package/mobile/dist/retail/components/DaDataInputControl/useInputPopup.js +1 -0
  335. package/mobile/dist/retail/components/DaDataInputControl/useInputPopup.js.map +1 -1
  336. package/mobile/dist/retail/components/Fields/BirthPlaceField.js +1 -1
  337. package/mobile/dist/retail/components/Fields/BirthPlaceField.js.map +1 -1
  338. package/mobile/dist/retail/components/Fields/ChildrenField.js +1 -1
  339. package/mobile/dist/retail/components/Fields/ChildrenField.js.map +1 -1
  340. package/mobile/dist/retail/components/Fields/CodeWordField.js +1 -1
  341. package/mobile/dist/retail/components/Fields/CodeWordField.js.map +1 -1
  342. package/mobile/dist/retail/components/Fields/DependentsField.js +1 -1
  343. package/mobile/dist/retail/components/Fields/DependentsField.js.map +1 -1
  344. package/mobile/dist/retail/components/Fields/DulIssueDateField.js +1 -1
  345. package/mobile/dist/retail/components/Fields/DulIssueDateField.js.map +1 -1
  346. package/mobile/dist/retail/components/Fields/DulIssuedByField.js +2 -2
  347. package/mobile/dist/retail/components/Fields/DulIssuedByField.js.map +1 -1
  348. package/mobile/dist/retail/components/Fields/DulSubdivisionCodeField.js +14 -1
  349. package/mobile/dist/retail/components/Fields/DulSubdivisionCodeField.js.map +1 -1
  350. package/mobile/dist/retail/components/Fields/EmailField.js +1 -3
  351. package/mobile/dist/retail/components/Fields/EmailField.js.map +1 -1
  352. package/mobile/dist/retail/components/Fields/Experience5YearsField.js +1 -1
  353. package/mobile/dist/retail/components/Fields/Experience5YearsField.js.map +1 -1
  354. package/mobile/dist/retail/components/Fields/FamilyMembersField.js +2 -2
  355. package/mobile/dist/retail/components/Fields/FamilyMembersField.js.map +1 -1
  356. package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js +12 -1
  357. package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  358. package/mobile/dist/retail/components/Fields/JobsNumberField.js +1 -1
  359. package/mobile/dist/retail/components/Fields/JobsNumberField.js.map +1 -1
  360. package/mobile/dist/retail/components/Fields/LastJobExperienceField.js +1 -1
  361. package/mobile/dist/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  362. package/mobile/dist/retail/components/Fields/LegalFormField.js +1 -1
  363. package/mobile/dist/retail/components/Fields/LegalFormField.js.map +1 -1
  364. package/mobile/dist/retail/components/Fields/MandatoryPaymentsField.js +1 -1
  365. package/mobile/dist/retail/components/Fields/MandatoryPaymentsField.js.map +1 -1
  366. package/mobile/dist/retail/components/Fields/MiddleNameField.js +1 -1
  367. package/mobile/dist/retail/components/Fields/NameField.js +1 -1
  368. package/mobile/dist/retail/components/Fields/RetirementIncomeField.js +1 -1
  369. package/mobile/dist/retail/components/Fields/RetirementIncomeField.js.map +1 -1
  370. package/mobile/dist/retail/components/Fields/SelectField.d.ts +1 -0
  371. package/mobile/dist/retail/components/Fields/SelectField.js.map +1 -1
  372. package/mobile/dist/retail/components/Fields/SurnameField.js +1 -1
  373. package/mobile/dist/retail/components/Fields/WagesField.js +1 -1
  374. package/mobile/dist/retail/components/Fields/WagesField.js.map +1 -1
  375. package/mobile/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +0 -7
  376. package/mobile/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +3 -4
  377. package/mobile/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
  378. package/mobile/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +7 -0
  379. package/mobile/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +3 -3
  380. package/mobile/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
  381. package/mobile/dist/retail/inputs.d.ts +0 -2
  382. package/mobile/dist/retail/inputs.js +0 -4
  383. package/mobile/dist/retail/inputs.js.map +1 -1
  384. package/mobile/dist/retail/model/LeadFormState.d.ts +0 -2
  385. package/mobile/dist/retail/model/NameFieldDef.d.ts +1 -1
  386. package/mobile/dist/retail/utils/calculateInputs.js +1 -1
  387. package/mobile/dist/retail/utils/calculateInputs.js.map +1 -1
  388. package/mobile/dist/retail/utils/updateOrganizationFields.js +1 -1
  389. package/mobile/dist/retail/utils/updateOrganizationFields.js.map +1 -1
  390. package/mobile/dist/retail/validator/getLimitedBirthdayValidation.js +2 -1
  391. package/mobile/dist/retail/validator/getLimitedBirthdayValidation.js.map +1 -1
  392. package/mobile/dist/retail/validator/getRetailFormValidator.js +3 -0
  393. package/mobile/dist/retail/validator/getRetailFormValidator.js.map +1 -1
  394. package/mobile/dist/retail/validator/validatorObj.js +4 -9
  395. package/mobile/dist/retail/validator/validatorObj.js.map +1 -1
  396. package/mobile/dist/retail/validator/validators.d.ts +5 -3
  397. package/mobile/dist/retail/validator/validators.js +27 -17
  398. package/mobile/dist/retail/validator/validators.js.map +1 -1
  399. package/mobile/dist/ui-kit/FormField/Fields/CompanyNameByInnField.d.ts +2 -0
  400. package/mobile/dist/ui-kit/FormField/Fields/CompanyNameByInnField.js +17 -0
  401. package/mobile/dist/ui-kit/FormField/Fields/CompanyNameByInnField.js.map +1 -0
  402. package/mobile/dist/ui-kit/FormField/Fields/FullRegionField.d.ts +5 -0
  403. package/{dist/ui-kit/FormField/Fields/RegionPremiumField.js → mobile/dist/ui-kit/FormField/Fields/FullRegionField.js} +5 -4
  404. package/mobile/dist/ui-kit/FormField/Fields/FullRegionField.js.map +1 -0
  405. package/mobile/dist/ui-kit/FormField/Fields/InnDadataField.d.ts +2 -0
  406. package/mobile/dist/ui-kit/FormField/Fields/InnDadataField.js +29 -0
  407. package/mobile/dist/ui-kit/FormField/Fields/InnDadataField.js.map +1 -0
  408. package/mobile/dist/ui-kit/FormField/Fields/PartnerSymbolCodeField.d.ts +15 -0
  409. package/mobile/dist/ui-kit/FormField/Fields/PartnerSymbolCodeField.js +19 -0
  410. package/mobile/dist/ui-kit/FormField/Fields/PartnerSymbolCodeField.js.map +1 -0
  411. package/mobile/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  412. package/mobile/dist/ui-kit/FormField/getField.js +12 -2
  413. package/mobile/dist/ui-kit/FormField/getField.js.map +1 -1
  414. package/mobile/dist/ui-kit/FormField/getObjectValidator.js +3 -0
  415. package/mobile/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
  416. package/mobile/dist/ui-kit/FormField/inputColumnStyle.d.ts +1 -1
  417. package/mobile/dist/ui-kit/FormField/inputColumnStyle.js +1 -1
  418. package/mobile/dist/ui-kit/FormField/inputColumnStyle.js.map +1 -1
  419. package/mobile/dist/ui-kit/FormField/validators.d.ts +8 -1
  420. package/mobile/dist/ui-kit/FormField/validators.js +5 -2
  421. package/mobile/dist/ui-kit/FormField/validators.js.map +1 -1
  422. package/mobile/dist/ui-kit/Input/renderErrorText.js +1 -1
  423. package/mobile/dist/ui-kit/Input/renderErrorText.js.map +1 -1
  424. package/mobile/dist/ui-kit/Select/Option.d.ts +6 -0
  425. package/mobile/dist/ui-kit/Select/Select.d.ts +2 -0
  426. package/mobile/dist/ui-kit/Select/Select.js +27 -5
  427. package/mobile/dist/ui-kit/Select/Select.js.map +1 -1
  428. package/mobile/dist/ui-kit/Select/SelectPopup.d.ts +1 -0
  429. package/mobile/dist/ui-kit/Select/SelectPopup.js +4 -2
  430. package/mobile/dist/ui-kit/Select/SelectPopup.js.map +1 -1
  431. package/mobile/dist/ui-kit/Select/useSelectPopup.d.ts +2 -1
  432. package/mobile/dist/ui-kit/Select/useSelectPopup.js +3 -2
  433. package/mobile/dist/ui-kit/Select/useSelectPopup.js.map +1 -1
  434. package/mobile/lib/api/LeadServiceAPI.d.ts +4 -0
  435. package/mobile/lib/api/LeadServiceAPI.js +13 -6
  436. package/mobile/lib/api/LeadServiceAPI.js.map +1 -1
  437. package/mobile/lib/common.css +1 -1
  438. package/mobile/lib/components/ApplicationForm/ApplicationForm.d.ts +2 -3
  439. package/mobile/lib/components/ApplicationForm/ApplicationForm.js +4 -3
  440. package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  441. package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +5 -1
  442. package/mobile/lib/components/ApplicationForm/ApplicationFormContent.js +0 -2
  443. package/mobile/lib/components/ApplicationForm/ApplicationFormContent.js.map +1 -1
  444. package/mobile/lib/hooks/useInn.d.ts +7 -0
  445. package/mobile/lib/hooks/useInn.js +8 -0
  446. package/mobile/lib/hooks/useInn.js.map +1 -0
  447. package/mobile/lib/model/FormTypeFieldDef.d.ts +1 -1
  448. package/mobile/lib/retail/adaptors/getPersonalInfoData.js +1 -1
  449. package/mobile/lib/retail/adaptors/getPersonalInfoData.js.map +1 -1
  450. package/mobile/lib/retail/api/dadataHints/dadataHints.js +11 -7
  451. package/mobile/lib/retail/api/dadataHints/dadataHints.js.map +1 -1
  452. package/mobile/lib/retail/api/dadataHints/dadataHintsType.d.ts +10 -3
  453. package/mobile/lib/retail/api/dadataHints/hintsListsOptions.d.ts +2 -10
  454. package/mobile/lib/retail/api/dadataHints/hintsListsOptions.js +17 -2
  455. package/mobile/lib/retail/api/dadataHints/hintsListsOptions.js.map +1 -1
  456. package/mobile/lib/retail/components/DaDataInputControl/DaDataInputControl.js +10 -2
  457. package/mobile/lib/retail/components/DaDataInputControl/DaDataInputControl.js.map +1 -1
  458. package/mobile/lib/retail/components/DaDataInputControl/InputPopup.js +3 -3
  459. package/mobile/lib/retail/components/DaDataInputControl/InputPopup.js.map +1 -1
  460. package/mobile/lib/retail/components/DaDataInputControl/useInputPopup.js +1 -0
  461. package/mobile/lib/retail/components/DaDataInputControl/useInputPopup.js.map +1 -1
  462. package/mobile/lib/retail/components/Fields/BirthPlaceField.js +1 -1
  463. package/mobile/lib/retail/components/Fields/BirthPlaceField.js.map +1 -1
  464. package/mobile/lib/retail/components/Fields/ChildrenField.js +1 -1
  465. package/mobile/lib/retail/components/Fields/ChildrenField.js.map +1 -1
  466. package/mobile/lib/retail/components/Fields/CodeWordField.js +1 -1
  467. package/mobile/lib/retail/components/Fields/CodeWordField.js.map +1 -1
  468. package/mobile/lib/retail/components/Fields/DependentsField.js +1 -1
  469. package/mobile/lib/retail/components/Fields/DependentsField.js.map +1 -1
  470. package/mobile/lib/retail/components/Fields/DulIssueDateField.js +1 -1
  471. package/mobile/lib/retail/components/Fields/DulIssueDateField.js.map +1 -1
  472. package/mobile/lib/retail/components/Fields/DulIssuedByField.js +2 -2
  473. package/mobile/lib/retail/components/Fields/DulIssuedByField.js.map +1 -1
  474. package/mobile/lib/retail/components/Fields/DulSubdivisionCodeField.js +15 -2
  475. package/mobile/lib/retail/components/Fields/DulSubdivisionCodeField.js.map +1 -1
  476. package/mobile/lib/retail/components/Fields/EmailField.js +1 -3
  477. package/mobile/lib/retail/components/Fields/EmailField.js.map +1 -1
  478. package/mobile/lib/retail/components/Fields/Experience5YearsField.js +1 -1
  479. package/mobile/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
  480. package/mobile/lib/retail/components/Fields/FamilyMembersField.js +2 -2
  481. package/mobile/lib/retail/components/Fields/FamilyMembersField.js.map +1 -1
  482. package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js +12 -1
  483. package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  484. package/mobile/lib/retail/components/Fields/JobsNumberField.js +1 -1
  485. package/mobile/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
  486. package/mobile/lib/retail/components/Fields/LastJobExperienceField.js +1 -1
  487. package/mobile/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  488. package/mobile/lib/retail/components/Fields/LegalFormField.js +1 -1
  489. package/mobile/lib/retail/components/Fields/LegalFormField.js.map +1 -1
  490. package/mobile/lib/retail/components/Fields/MandatoryPaymentsField.js +1 -1
  491. package/mobile/lib/retail/components/Fields/MandatoryPaymentsField.js.map +1 -1
  492. package/mobile/lib/retail/components/Fields/MiddleNameField.js +1 -1
  493. package/mobile/lib/retail/components/Fields/NameField.js +1 -1
  494. package/mobile/lib/retail/components/Fields/RetirementIncomeField.js +1 -1
  495. package/mobile/lib/retail/components/Fields/RetirementIncomeField.js.map +1 -1
  496. package/mobile/lib/retail/components/Fields/SelectField.d.ts +1 -0
  497. package/mobile/lib/retail/components/Fields/SelectField.js.map +1 -1
  498. package/mobile/lib/retail/components/Fields/SurnameField.js +1 -1
  499. package/mobile/lib/retail/components/Fields/WagesField.js +1 -1
  500. package/mobile/lib/retail/components/Fields/WagesField.js.map +1 -1
  501. package/mobile/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +0 -7
  502. package/mobile/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +1 -2
  503. package/mobile/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
  504. package/mobile/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +7 -0
  505. package/mobile/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +1 -1
  506. package/mobile/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
  507. package/mobile/lib/retail/inputs.d.ts +0 -2
  508. package/mobile/lib/retail/inputs.js +0 -4
  509. package/mobile/lib/retail/inputs.js.map +1 -1
  510. package/mobile/lib/retail/model/LeadFormState.d.ts +0 -2
  511. package/mobile/lib/retail/model/NameFieldDef.d.ts +1 -1
  512. package/mobile/lib/retail/utils/calculateInputs.js +1 -1
  513. package/mobile/lib/retail/utils/calculateInputs.js.map +1 -1
  514. package/mobile/lib/retail/utils/updateOrganizationFields.js +1 -1
  515. package/mobile/lib/retail/utils/updateOrganizationFields.js.map +1 -1
  516. package/mobile/lib/retail/validator/getLimitedBirthdayValidation.js +2 -1
  517. package/mobile/lib/retail/validator/getLimitedBirthdayValidation.js.map +1 -1
  518. package/mobile/lib/retail/validator/getRetailFormValidator.js +4 -1
  519. package/mobile/lib/retail/validator/getRetailFormValidator.js.map +1 -1
  520. package/mobile/lib/retail/validator/validatorObj.js +5 -10
  521. package/mobile/lib/retail/validator/validatorObj.js.map +1 -1
  522. package/mobile/lib/retail/validator/validators.d.ts +5 -3
  523. package/mobile/lib/retail/validator/validators.js +22 -14
  524. package/mobile/lib/retail/validator/validators.js.map +1 -1
  525. package/mobile/lib/ui-kit/FormField/Fields/CompanyNameByInnField.d.ts +2 -0
  526. package/mobile/lib/ui-kit/FormField/Fields/CompanyNameByInnField.js +15 -0
  527. package/mobile/lib/ui-kit/FormField/Fields/CompanyNameByInnField.js.map +1 -0
  528. package/mobile/lib/ui-kit/FormField/Fields/FullRegionField.d.ts +5 -0
  529. package/{lib/ui-kit/FormField/Fields/RegionPremiumField.js → mobile/lib/ui-kit/FormField/Fields/FullRegionField.js} +4 -3
  530. package/mobile/lib/ui-kit/FormField/Fields/FullRegionField.js.map +1 -0
  531. package/mobile/lib/ui-kit/FormField/Fields/InnDadataField.d.ts +2 -0
  532. package/mobile/lib/ui-kit/FormField/Fields/InnDadataField.js +27 -0
  533. package/mobile/lib/ui-kit/FormField/Fields/InnDadataField.js.map +1 -0
  534. package/mobile/lib/ui-kit/FormField/Fields/PartnerSymbolCodeField.d.ts +15 -0
  535. package/mobile/lib/ui-kit/FormField/Fields/PartnerSymbolCodeField.js +17 -0
  536. package/mobile/lib/ui-kit/FormField/Fields/PartnerSymbolCodeField.js.map +1 -0
  537. package/mobile/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  538. package/mobile/lib/ui-kit/FormField/getField.js +12 -2
  539. package/mobile/lib/ui-kit/FormField/getField.js.map +1 -1
  540. package/mobile/lib/ui-kit/FormField/getObjectValidator.js +4 -1
  541. package/mobile/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
  542. package/mobile/lib/ui-kit/FormField/inputColumnStyle.d.ts +1 -1
  543. package/mobile/lib/ui-kit/FormField/inputColumnStyle.js +1 -1
  544. package/mobile/lib/ui-kit/FormField/inputColumnStyle.js.map +1 -1
  545. package/mobile/lib/ui-kit/FormField/validators.d.ts +8 -1
  546. package/mobile/lib/ui-kit/FormField/validators.js +3 -1
  547. package/mobile/lib/ui-kit/FormField/validators.js.map +1 -1
  548. package/mobile/lib/ui-kit/Input/renderErrorText.js +1 -1
  549. package/mobile/lib/ui-kit/Input/renderErrorText.js.map +1 -1
  550. package/mobile/lib/ui-kit/Select/Option.d.ts +6 -0
  551. package/mobile/lib/ui-kit/Select/Select.d.ts +2 -0
  552. package/mobile/lib/ui-kit/Select/Select.js +28 -6
  553. package/mobile/lib/ui-kit/Select/Select.js.map +1 -1
  554. package/mobile/lib/ui-kit/Select/SelectPopup.d.ts +1 -0
  555. package/mobile/lib/ui-kit/Select/SelectPopup.js +4 -2
  556. package/mobile/lib/ui-kit/Select/SelectPopup.js.map +1 -1
  557. package/mobile/lib/ui-kit/Select/useSelectPopup.d.ts +2 -1
  558. package/mobile/lib/ui-kit/Select/useSelectPopup.js +3 -2
  559. package/mobile/lib/ui-kit/Select/useSelectPopup.js.map +1 -1
  560. package/mobile/src/api/LeadServiceAPI.ts +28 -3
  561. package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +84 -0
  562. package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +29 -14
  563. package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +6 -4
  564. package/mobile/src/hooks/useInn.ts +16 -0
  565. package/mobile/src/model/FormTypeFieldDef.ts +2 -1
  566. package/mobile/src/retail/adaptors/getPersonalInfoData.tsx +1 -1
  567. package/mobile/src/retail/api/dadataHints/dadataHints.ts +17 -6
  568. package/mobile/src/retail/api/dadataHints/dadataHintsType.ts +10 -3
  569. package/mobile/src/retail/api/dadataHints/hintsListsOptions.ts +20 -13
  570. package/mobile/src/retail/components/DaDataInputControl/DaDataInputControl.tsx +15 -1
  571. package/mobile/src/retail/components/DaDataInputControl/InputPopup.tsx +5 -2
  572. package/mobile/src/retail/components/DaDataInputControl/useInputPopup.tsx +1 -0
  573. package/mobile/src/retail/components/Fields/BirthPlaceField.tsx +1 -0
  574. package/mobile/src/retail/components/Fields/ChildrenField.tsx +1 -0
  575. package/mobile/src/retail/components/Fields/CodeWordField.tsx +6 -1
  576. package/mobile/src/retail/components/Fields/DependentsField.tsx +1 -0
  577. package/mobile/src/retail/components/Fields/DulIssueDateField.tsx +1 -0
  578. package/mobile/src/retail/components/Fields/DulIssuedByField.tsx +2 -1
  579. package/mobile/src/retail/components/Fields/DulSubdivisionCodeField.tsx +21 -3
  580. package/mobile/src/retail/components/Fields/EmailField.tsx +8 -3
  581. package/mobile/src/retail/components/Fields/Experience5YearsField.tsx +2 -2
  582. package/mobile/src/retail/components/Fields/FamilyMembersField.tsx +2 -2
  583. package/mobile/src/retail/components/Fields/GeneralSeniorityField.tsx +28 -11
  584. package/mobile/src/retail/components/Fields/JobsNumberField.tsx +1 -0
  585. package/mobile/src/retail/components/Fields/LastJobExperienceField.tsx +1 -0
  586. package/mobile/src/retail/components/Fields/LegalFormField.tsx +1 -0
  587. package/mobile/src/retail/components/Fields/MandatoryPaymentsField.tsx +2 -0
  588. package/mobile/src/retail/components/Fields/MiddleNameField.tsx +1 -1
  589. package/mobile/src/retail/components/Fields/NameField.tsx +1 -1
  590. package/mobile/src/retail/components/Fields/RetirementIncomeField.tsx +2 -0
  591. package/mobile/src/retail/components/Fields/SelectField.tsx +1 -0
  592. package/mobile/src/retail/components/Fields/SurnameField.tsx +1 -1
  593. package/mobile/src/retail/components/Fields/WagesField.tsx +2 -0
  594. package/mobile/src/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.tsx +5 -9
  595. package/mobile/src/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.tsx +9 -1
  596. package/mobile/src/retail/inputs.tsx +0 -4
  597. package/mobile/src/retail/model/LeadFormState.ts +0 -2
  598. package/mobile/src/retail/model/NameFieldDef.ts +0 -2
  599. package/mobile/src/retail/utils/calculateInputs.ts +1 -1
  600. package/mobile/src/retail/utils/updateOrganizationFields.ts +1 -1
  601. package/mobile/src/retail/validator/getLimitedBirthdayValidation.ts +2 -1
  602. package/mobile/src/retail/validator/getRetailFormValidator.ts +9 -1
  603. package/mobile/src/retail/validator/validatorObj.ts +4 -12
  604. package/mobile/src/retail/validator/validators.ts +47 -28
  605. package/mobile/src/ui-kit/FormField/Fields/CompanyNameByInnField.tsx +24 -0
  606. package/mobile/src/ui-kit/FormField/Fields/{RegionPremiumField.tsx → FullRegionField.tsx} +7 -2
  607. package/mobile/src/ui-kit/FormField/Fields/InnDadataField.tsx +47 -0
  608. package/mobile/src/ui-kit/FormField/Fields/PartnerSymbolCodeField.tsx +47 -0
  609. package/mobile/src/ui-kit/FormField/NameFieldDef.ts +5 -1
  610. package/mobile/src/ui-kit/FormField/getField.tsx +15 -2
  611. package/mobile/src/ui-kit/FormField/getObjectValidator.tsx +4 -0
  612. package/mobile/src/ui-kit/FormField/inputColumnStyle.tsx +1 -1
  613. package/mobile/src/ui-kit/FormField/validators.ts +13 -1
  614. package/mobile/src/ui-kit/Input/renderErrorText.tsx +1 -1
  615. package/mobile/src/ui-kit/Select/Option.ts +6 -0
  616. package/mobile/src/ui-kit/Select/Select.tsx +71 -17
  617. package/mobile/src/ui-kit/Select/SelectPopup.tsx +20 -2
  618. package/mobile/src/ui-kit/Select/useSelectPopup.tsx +4 -0
  619. package/package.json +2 -2
  620. package/src/api/LeadServiceAPI.ts +28 -3
  621. package/src/components/ApplicationForm/ApplicationForm.example.json +84 -0
  622. package/src/components/ApplicationForm/ApplicationForm.fixture.mobile.tsx +47 -0
  623. package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +47 -0
  624. package/src/components/ApplicationForm/ApplicationForm.tsx +29 -14
  625. package/src/components/ApplicationForm/ApplicationFormContent.ts +6 -4
  626. package/src/hooks/useInn.ts +16 -0
  627. package/src/model/FormTypeFieldDef.ts +2 -1
  628. package/src/retail/adaptors/getPersonalInfoData.tsx +1 -1
  629. package/src/retail/api/dadataHints/dadataHints.ts +17 -6
  630. package/src/retail/api/dadataHints/dadataHintsType.ts +10 -3
  631. package/src/retail/api/dadataHints/hintsListsOptions.ts +20 -13
  632. package/src/retail/components/DaDataInputControl/DaDataInputControl.tsx +15 -1
  633. package/src/retail/components/DaDataInputControl/InputPopup.tsx +5 -2
  634. package/src/retail/components/DaDataInputControl/useInputPopup.tsx +1 -0
  635. package/src/retail/components/Fields/BirthPlaceField.tsx +1 -0
  636. package/src/retail/components/Fields/ChildrenField.tsx +1 -0
  637. package/src/retail/components/Fields/CodeWordField.tsx +6 -1
  638. package/src/retail/components/Fields/DependentsField.tsx +1 -0
  639. package/src/retail/components/Fields/DulIssueDateField.tsx +1 -0
  640. package/src/retail/components/Fields/DulIssuedByField.tsx +2 -1
  641. package/src/retail/components/Fields/DulSubdivisionCodeField.tsx +21 -3
  642. package/src/retail/components/Fields/EmailField.tsx +8 -3
  643. package/src/retail/components/Fields/Experience5YearsField.tsx +2 -2
  644. package/src/retail/components/Fields/FamilyMembersField.tsx +2 -2
  645. package/src/retail/components/Fields/GeneralSeniorityField.tsx +28 -11
  646. package/src/retail/components/Fields/JobsNumberField.tsx +1 -0
  647. package/src/retail/components/Fields/LastJobExperienceField.tsx +1 -0
  648. package/src/retail/components/Fields/LegalFormField.tsx +1 -0
  649. package/src/retail/components/Fields/MandatoryPaymentsField.tsx +2 -0
  650. package/src/retail/components/Fields/MiddleNameField.tsx +1 -1
  651. package/src/retail/components/Fields/NameField.tsx +1 -1
  652. package/src/retail/components/Fields/RetirementIncomeField.tsx +2 -0
  653. package/src/retail/components/Fields/SelectField.tsx +1 -0
  654. package/src/retail/components/Fields/SurnameField.tsx +1 -1
  655. package/src/retail/components/Fields/WagesField.tsx +2 -0
  656. package/src/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.tsx +5 -9
  657. package/src/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.tsx +9 -1
  658. package/src/retail/inputs.tsx +0 -4
  659. package/src/retail/model/LeadFormState.ts +0 -2
  660. package/src/retail/model/NameFieldDef.ts +0 -2
  661. package/src/retail/utils/calculateInputs.ts +1 -1
  662. package/src/retail/utils/updateOrganizationFields.ts +1 -1
  663. package/src/retail/validator/getLimitedBirthdayValidation.ts +2 -1
  664. package/src/retail/validator/getRetailFormValidator.ts +9 -1
  665. package/src/retail/validator/validatorObj.ts +4 -12
  666. package/src/retail/validator/validators.ts +47 -28
  667. package/src/ui-kit/FormField/Fields/CompanyNameByInnField.tsx +24 -0
  668. package/src/ui-kit/FormField/Fields/{RegionPremiumField.tsx → FullRegionField.tsx} +7 -2
  669. package/src/ui-kit/FormField/Fields/InnDadataField.tsx +47 -0
  670. package/src/ui-kit/FormField/Fields/PartnerSymbolCodeField.tsx +47 -0
  671. package/src/ui-kit/FormField/NameFieldDef.ts +5 -1
  672. package/src/ui-kit/FormField/getField.tsx +15 -2
  673. package/src/ui-kit/FormField/getObjectValidator.tsx +4 -0
  674. package/src/ui-kit/FormField/inputColumnStyle.tsx +1 -1
  675. package/src/ui-kit/FormField/validators.ts +13 -1
  676. package/src/ui-kit/Input/renderErrorText.tsx +1 -1
  677. package/src/ui-kit/Select/Option.ts +6 -0
  678. package/src/ui-kit/Select/Select.tsx +71 -17
  679. package/src/ui-kit/Select/SelectPopup.tsx +20 -2
  680. package/src/ui-kit/Select/useSelectPopup.tsx +4 -0
  681. package/bundle/retail/components/Fields/ExpensesField.d.ts +0 -2
  682. package/bundle/retail/components/Fields/TotalIncomeField.d.ts +0 -2
  683. package/bundle/ui-kit/FormField/Fields/RegionPremiumField.d.ts +0 -2
  684. package/dist/retail/components/Fields/ExpensesField.d.ts +0 -2
  685. package/dist/retail/components/Fields/ExpensesField.js +0 -7
  686. package/dist/retail/components/Fields/ExpensesField.js.map +0 -1
  687. package/dist/retail/components/Fields/TotalIncomeField.d.ts +0 -2
  688. package/dist/retail/components/Fields/TotalIncomeField.js +0 -7
  689. package/dist/retail/components/Fields/TotalIncomeField.js.map +0 -1
  690. package/dist/ui-kit/FormField/Fields/RegionPremiumField.d.ts +0 -2
  691. package/dist/ui-kit/FormField/Fields/RegionPremiumField.js.map +0 -1
  692. package/lib/retail/components/Fields/ExpensesField.d.ts +0 -2
  693. package/lib/retail/components/Fields/ExpensesField.js +0 -5
  694. package/lib/retail/components/Fields/ExpensesField.js.map +0 -1
  695. package/lib/retail/components/Fields/TotalIncomeField.d.ts +0 -2
  696. package/lib/retail/components/Fields/TotalIncomeField.js +0 -5
  697. package/lib/retail/components/Fields/TotalIncomeField.js.map +0 -1
  698. package/lib/ui-kit/FormField/Fields/RegionPremiumField.d.ts +0 -2
  699. package/lib/ui-kit/FormField/Fields/RegionPremiumField.js.map +0 -1
  700. package/mobile/bundle/retail/components/Fields/ExpensesField.d.ts +0 -2
  701. package/mobile/bundle/retail/components/Fields/TotalIncomeField.d.ts +0 -2
  702. package/mobile/bundle/ui-kit/FormField/Fields/RegionPremiumField.d.ts +0 -2
  703. package/mobile/dist/retail/components/Fields/ExpensesField.d.ts +0 -2
  704. package/mobile/dist/retail/components/Fields/ExpensesField.js +0 -7
  705. package/mobile/dist/retail/components/Fields/ExpensesField.js.map +0 -1
  706. package/mobile/dist/retail/components/Fields/TotalIncomeField.d.ts +0 -2
  707. package/mobile/dist/retail/components/Fields/TotalIncomeField.js +0 -7
  708. package/mobile/dist/retail/components/Fields/TotalIncomeField.js.map +0 -1
  709. package/mobile/dist/ui-kit/FormField/Fields/RegionPremiumField.d.ts +0 -2
  710. package/mobile/dist/ui-kit/FormField/Fields/RegionPremiumField.js.map +0 -1
  711. package/mobile/lib/retail/components/Fields/ExpensesField.d.ts +0 -2
  712. package/mobile/lib/retail/components/Fields/ExpensesField.js +0 -5
  713. package/mobile/lib/retail/components/Fields/ExpensesField.js.map +0 -1
  714. package/mobile/lib/retail/components/Fields/TotalIncomeField.d.ts +0 -2
  715. package/mobile/lib/retail/components/Fields/TotalIncomeField.js +0 -5
  716. package/mobile/lib/retail/components/Fields/TotalIncomeField.js.map +0 -1
  717. package/mobile/lib/ui-kit/FormField/Fields/RegionPremiumField.d.ts +0 -2
  718. package/mobile/lib/ui-kit/FormField/Fields/RegionPremiumField.js.map +0 -1
  719. package/mobile/src/retail/components/Fields/ExpensesField.tsx +0 -13
  720. package/mobile/src/retail/components/Fields/TotalIncomeField.tsx +0 -13
  721. package/src/retail/components/Fields/ExpensesField.tsx +0 -13
  722. package/src/retail/components/Fields/TotalIncomeField.tsx +0 -13
@@ -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),a=n("useState"),i=n("useEffect"),r=n("useCallback"),l=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:a,...i}=t||{},r=n?.slots?.default,l=a||r&&r();return e(Object.assign(i,l&&{children:l}),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:a="p-xl",padding:i,block:r,tag:l="section",role:s,children:c,style:d})=>{const m=t&&n;return o(l,{className:u("@container font-sans",{group:m},p[t],i||a,e),...m?{"data-ver":t}:{},...r?.anchor?{id:r.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:y(t)}))),y=(e=3)=>b(100,e).map((e=>Math.floor(e))).map(x),x=(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:a,children:i})=>o(n,{role:"heading",className:u("font-sans m-0",v[t],e),children:a||i}))),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:a,description:i,align:r="text-center",as:l,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:[a?o(N,{className:u("whitespace-normal",r),...h?.title,as:l||h?.title.as,title:a}):null,i?o(w,{size:h.descriptionSize,font:h.descriptionWeight,align:r,...p,children:i}):null]})})),k=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),I=[];function T(e,t,{className:n,...a}={}){const{key:i,blockDecorator:r=k,blocksRegistry:l={},ancestors:s=I}=t,{type:c}=e;c&&c in l||console.warn(`No block with "${c}" is registered`);const d=c&&l[c];return r({blockClassName:u(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:r})=>{const{content:l}=n;return d?o(d,{...l,...a,className:u(r,l?.className),block:e,options:t},i):null}},i)}const P=[],E=(e,{key:t,ancestors:n=P,slotName:a=null,extraProps:i,renderProps:r=T,...l})=>{const s=i?(e,t)=>T(e,t,i):r;return(e||[]).map(((e,i)=>s(e,{...l,key:`${t||e.type}-${i}`,ancestors:l.parent?[...n||P,[l.parent,a]]:n},i)))};function D({block:e,options:t,children:n,extraProps:a,renderProps:i}){return n||(e&&t?E(e.blocks,{...t,parent:e,extraProps:a,renderProps:i}):null)}function R(){return R._impl()}R._impl=()=>({pathname:globalThis.location?.pathname||"/",push:()=>{},replace:()=>{},back:()=>{}}),R.setup=e=>{R._impl=e};const _=["CDN","BASE_PATH"],A=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}}),O=e=>Boolean(e?.includes(":")),M=(e,t)=>Boolean(e&&!O(e)&&(!t||"_self"===t)),B=e=>Boolean(e?.startsWith("#")),F=e=>(e??"").replace(/\?.*/,"").replace(/\/$/,""),z=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),L=e=>t=>Boolean(e&&t&&e.startsWith(t)&&("/"===t||e===t||"/"===e[t.length]));var V=Object.freeze({__proto__:null,isURL:O,isLocalURL:M,isHash:B,withoutQuery:F,joinPath:z,hasPrefix:L});const $="/api/",j=`${$}v1/storage`,q=[A.CDN,$],U=e=>(t,n)=>{if(W(t))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`${j}/${t}/attachment`;const a=t?.startsWith("/");return z(L(t)(n)?"":n,a?"/":(i=e.pathname,i?.split("/").slice(0,-1).join("/")),t);var i},W=e=>!e||O(e)||B(e)||q.some(L(e)),H={"":"",normal:"",color:"text-primary-main",black:"text-black",white:"text-black",gray:"text-gray"},Y={small:"16",medium:"24",large:"48",xl:"78"},G=d((({className:e="",imageClassName:t="",name:n="",alt:a=`Иконка ${n}`,title:i=a,iconVersion:r="color",size:l,width:s=l&&Y[l],height:d=s})=>{const m=R(),h="normal"===r?`${n}.svg`:`sprites.svg#${n}`,p=U(m)(z(A.CDN,"/icons/",h));return"normal"===r?o("img",{className:e,style:K(e,d),src:p,alt:a,title:i,"aria-hidden":"true",width:s,height:d}):o(X,{className:e,children:c("svg",{className:u(H[r],{"w-full h-full":!s,invert:"white"===r},t),width:s,height:d,"aria-hidden":"true",children:[i?o("title",{children:i}):null,a?o("desc",{children:a}):null,o("use",{href:p,xlinkHref:p})]})})})),K=(e,t)=>{return e?.includes("h-")?{}:{height:(n=t,n&&!/\D/.test(n)?`${t}px`:t),width:"auto"};var n},X=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),J=new Proxy({_:{},setup(e){this._=e}},{get:(e,t)=>e._[t]||e[t]});function Z(e=""){try{return new URL(e).pathname}catch(e){return""}}const Q=e=>t=>{const n=t?.startsWith("/wcms-resources")?"":Z(J.SITE_URL);return t&&!O(t)?U(e)(t,n):t},ee=(e,t)=>e?.media&&t?.media?e.media-t.media:0,te=d((({className:e="",image:t,imageClassName:n=""})=>{const a=R();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(ee).map((({src:e,format:n,media:i},r)=>o("source",{srcSet:Q(a)(e),type:ae(n),media:i?`(max-width: ${i}px)`:"",width:t?.size?.width,height:t?.size?.height},`${r}_${e}`))):null,t?.src?ne({...t,src:Q(a)(t.src)},n):null]})})),ne=(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}),ae=e=>e?`image/${String(e)}`:void 0,ie=d((({className:e="",image:t,imageClassName:n="",...a})=>t?.src||t?.icon?t.icon?o(G,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...a}):o(te,{className:e,imageClassName:n,image:t}):null)),re={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","":""},le="bg-main-divider text-main-disabled",se={primary:le,secondary:le,white:le,link:"",transparent:"",gray:le,"":""},oe="text-center font-sans select-none",ce={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","":""},de=({className:e,rounded:t,version:n})=>[oe,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",n?re[n]:"",t?"rounded-full":"rounded-md",e].join(" "),me=e=>me._impl(e);function ue(e,t){const n=s({});return l((()=>new Proxy({},{get:(a,i)=>(n.current||={},n.current[i]||=n=>e.fire(t,{...n??{},type:i}),n.current[i])})),[e,t])}me._impl=e=>e,me.setup=e=>{me._impl=e};class he{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 pe=new he,ge=()=>ue(pe.emitter,"dialog"),fe="/",ye=["/api"];function xe(){const e=R(),{closeAll:t}=ge();return n=>{const a=U(e)(n.href);return{...n,href:a,"aria-label":n.text,onClick:me((i=>{n.onClick?.(i);const r=Z(J.SITE_URL);be(a,n.target,r)&&(t(),i?.preventDefault(),e.push(((e=fe,t=fe)=>[e,t].some((e=>e===fe))?e:e.replace(t,"")||fe)(a,r)))}))}}}const be=(e,t,n)=>M(e,t)&&![...ye,...J.SUB_PORTALS?.split(",")??[]].some(L(e))&&L(e)(n||"/"),ve=e=>{try{return Array.isArray(e)&&e.length?{"data-aspects":JSON.stringify(e)}:{}}catch(e){return{}}},Ne=d((e=>{const{text:t,aboveText:n,appendLeft:a,appendRight:i,version:r="primary"}=e,l=Ce(e)&&"hidden lg:block";return c("div",{className:u(we(e),"flex gap-xs"),children:[a?o("div",{className:u(l,ce[r]),children:a}):null,Ce(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":"text-l"),children:t})]}):null,i?o("div",{className:u(l,ce[r]),children:i}):null]})})),we=e=>{const{version:t,aboveText:n,rounded:a}=e;if("link"===t)return"";const i=""+(n?"py-2.5 px-9":"py-4 px-9");return u("group/btn items-center justify-center",Ce(e)?i:"h-12 w-12 m-auto",{"rounded-full":a})},Ce=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),Se=({className:e,rounded:t,version:n})=>["inline-block",oe,n?se[n]:"",t?"rounded-full":"rounded-md",e].join(" "),ke=d((({disabled:e,children:t,method:n="LINK",href:a,...i})=>{const l=(({method:e,href:t})=>r((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:a,pathname:i,searchParams:r}=new URL(t||""),l=document.createElement("form");l.setAttribute("method","POST"),l.setAttribute("action",[a,i].join(""));for(const[e,t]of r.entries()){const n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t),l.appendChild(n)}document.body.appendChild(l),l.submit()}),[e,t]))({method:n,href:a}),s=xe()({onClick:l,href:a,...i}),c=t??o(Ne,{...s});return o(e?Te:Ie,{...s,children:c})})),Ie=d((({className:e="",href:t,rel:n,target:a,ariaLabel:i,version:r,rounded:l,onClick:s,type:c,data:d,children:m,text:u})=>o("a",{className:de({className:e,version:r,rounded:l}),href:t,rel:n,target:a,"aria-label":i||`Ссылка на ${u}`,role:t?"link":"button",onClick:s,type:c,...ve(d),children:m}))),Te=d((({className:e,ariaLabel:t,version:n,rounded:a,children:i})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:Se({className:e,rounded:a,version:n}),children:i})));function Pe({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:a=!1}){if(!n)return null;const i="primary"===e?"white":"black",r="primary"===e?"bg-primary-main":"bg-white";return c("div",{className:u(a?"flex":"hidden sm:flex","items-center gap-s"),children:[o("div",{className:u(de({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",rounded:!0}),r),onClick:t,children:o(ie,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:i}})}),o(ke,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const Ee=()=>{const[e,t]=a(false);return i((()=>{const e=globalThis.matchMedia?.("(max-width: 1024px)"),n=()=>{t(Boolean(e?.matches))};return e?.addEventListener("change",n),e?.matches&&t(!0),()=>{e?.removeEventListener("change",n)}}),[]),e},De={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},Re=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&De[n],t),children:e}):null,_e=d((({className:e,version:t="primary",defaultPadding:n,padding:a="",title:i,buttons:l,leftImage:s,rightImage:d,imageAlign:m,insetTitle:h,isImageAlwaysOnRight:p=!1,isImageSecondary:g=!1,backwardButton:f,children:y,...x})=>{const b=Ee(),v=R(),N=r((()=>v.back()),[]),w=x.options?.page?.common?.backwardButton,C=f&&!b;return c("div",{className:u("relative flex flex-col gap-3xl overflow-hidden",a||n,e),children:[C&&Pe({version:t,handleClick:N,text:w}),i?o("div",{className:"relative",children:i}):null,c("div",{className:u("grow relative flex flex-col @xl:flex-row gap-3xl w-full",{"self-start @xl:w-auto":s}),children:[Re(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-auto"),children:[Ae(h,y),Me(D({...x,extraProps:{className:"@container-normal"}})),Re(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[Oe(p)]:l,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),l?o("div",{className:"self-end",children:l}):null]})]})]})})),Ae=(e,t)=>e||t?c("div",{className:"grow space-y-lg w-fit",children:[e,t]}):null,Oe=e=>u(e?"row-span-2":"@xl:row-span-2"),Me=e=>e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,Be=(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(ie,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,Fe=d((({__html:e="",richVersion:t="",itemSize:n="list-m",isDotted:a=!0,children:i})=>e||i?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(t,n,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",a?"":"without-dots"),dangerouslySetInnerHTML:e?{__html:e}:void 0,children:i})}):null)),ze=(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,Le=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),Ve=(e,t)=>e?o(Le,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,$e=(e,t)=>["label"in e?Ve(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:ze(e.description,t)},String(t)):null,"__html"in e?o(Fe,{...e},`rte-${t}`):null],je=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?Be(n.icon,t):null,o("div",{children:$e(n)})]}))),qe=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(je,{benefitsVersion:t,...e},String(n))))}):null)),Ue=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($e)}):null)),We=d((({isTabularBenefits:e,...t})=>o(e?Ue:qe,{...t}))),He=e=>Boolean(e?.src||e?.icon),Ye=(e,{className:t,buttonClassName:n,isVertical:a}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:u("flex",a?"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(Ge(n))}):null,Ge=(e="")=>(t,n)=>{const{text:a,icon:i,iconRight:r,version:l,...s}=t||{},c=Ke(i,l),d=Ke(r,l);return a||i?.icon?o(ke,{className:u("basis-full @lg:basis-auto",e),appendLeft:Xe({...i,iconVersion:c}),appendRight:Xe({...r,iconVersion:d}),version:l,text:a,...s},n?String(n):""):null},Ke=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},Xe=e=>He(e)&&o(ie,{image:e,width:String(e?.size?.width||24),height:String(24)}),Je=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),Ze=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(Qe)}):null)),Qe=({label:e,amount:t,unit:n},a)=>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 rounded-md items-baseline whitespace-pre",role:"listitem",children:[o(Le,{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:[Je(2)(t)," ",n||"₽"]}):null]},String(a)),et=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(tt)}):null)),tt=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(Le,{size:"text-m",font:"font-light",children:e})},String(t)),nt={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},at=d((({className:e,padding:t,defaultPadding:n,title:a,description:i,headlineVersion:r="L",align:l="text-left",benefitsVersion:s,isTabularBenefits:c,isDotted:d=!0,benefits:m,__html:u,richVersion:h,isFullWidthTitle:p,priceList:g=[],tags:f=[],buttons:y,image:x,imageOptions:{imageAlign:b="center",directionRight:v=!0,isImageAlwaysOnRight:N,isImageSecondary:w=!1,className:C}={},backwardButton:k,children:I,...T})=>{const P=x?.src?o(ie,{image:x,imageClassName:C}):null,E=o(S,{title:a,description:i,headlineVersion:r,align:l,isEmbedded:!0}),D=m?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(_e,{className:e,padding:t,defaultPadding:n,...p?{title:E}:{insetTitle:E},...ot(P,v),isImageSecondary:w,imageAlign:b,isImageAlwaysOnRight:N,buttons:Ye(y),backwardButton:k,...T,children:st(it(D,{benefitsVersion:s,isTabularBenefits:c}),rt(u,{richVersion:h,isDotted:d,headlineVersion:r}),I,lt(g),ct(f))})})),it=(e,{benefitsVersion:t,isTabularBenefits:n}={})=>e?.length?o(We,{benefitsVersion:t,isTabularBenefits:n,benefits:e}):null,rt=(e,{richVersion:t,isDotted:n,headlineVersion:a}={})=>e?o(Fe,{__html:e,richVersion:t,isDotted:n,itemSize:nt[a??"L"]}):null,lt=e=>e?.length?o(Ze,{priceList:e}):null,st=(...e)=>{const t=e.filter(Boolean);return t.length?o("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:t.map(((e,t)=>o("div",{children:e},String(t))))}):null},ot=(e,t)=>t?{rightImage:e}:{leftImage:e},ct=e=>e?.length?o(et,{tags:e}):null;class dt{_;constructor(e){this._=e}of(e){return new this.constructor(e instanceof dt?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 mt=()=>!0,ut=(e,t)=>(...n)=>e(...n)&&t(...n),ht=(...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 pt=e=>Boolean(e&&Array.isArray(e)),gt=e=>Boolean(e&&"object"==typeof e&&!pt(e)),ft=e=>e;function yt(e){return e instanceof dt?e._:e}class xt extends dt{from(e){return this.of(e.map(((e=ft)=>([,t])=>e(t))(yt)))}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(pt(this._)?Array.from({length:Math.max(this._.length,Number(e)+1)},((n,a)=>a===e?t:this._[a])):Array.from({length:Number(e)+1},((n,a)=>a===e?t:void 0)))}}class bt extends dt{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 vt extends dt{from(e){return this.of(Object.fromEntries(e.map((([e,t])=>[e,yt(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 Nt extends dt{proto=ht([e=>pt(this._)||"number"==typeof e,()=>xt.prototype],[e=>gt(this._)||"string"==typeof e,()=>vt.prototype],[mt,()=>bt.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 wt=e=>e instanceof dt?e:new Nt(e),Ct=e=>{const t=(t,...n)=>yt(e(wt(t),...n));return t.fn=e,t},St=[],kt=e=>e instanceof Function?e:t=>e===t,It=e=>(t,n,a=St)=>wt(t).entries().reduce(((t,[n,i])=>It(e)(i,t,a.concat(n))),e(n,[a,wt(t)])),Tt=Ct(((e,[t,n])=>{const[a,...i]=t;return e.set(a,i.length?Tt(e.get(a),[i,n]):n)})),Pt=Ct(((e,t)=>t.reduce(Tt.fn,e))),Et=e=>It(((e,[t,n])=>Dt(n)?[...e,[t,yt(n)]]:e))(e,[]),Dt=e=>0===e.size();Ct(((e,t=St)=>t.reduce(((e,t)=>e.get(t)),e)));const Rt=Ct(((e,[t,...n])=>n.length?e.set(t,Rt(e.get(t),n)):e.filter((([e])=>e!==t)))),_t=(At=["$ref"]).map(((e,t)=>n=>kt(e)(n[t+n.length-At.length]))).reduceRight(ut,mt);var At;const Ot=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(Mt,e),Mt=ht([pt,(e,t)=>e[parseInt(t,10)]],[gt,(e,t)=>e[t]],[mt,ft]),Bt=(e,t)=>((e,t={})=>n=>Pt(t,Et(n).map((t=>e(t)))))((([e,n])=>{return _t(e)?[(a=e,a.slice(0,-1)),Ot(t(n),n)]:[e,n];var a}))(e),Ft=e=>Et(e).filter(((e=ft)=>([t])=>e(t))(_t)),zt=e=>{return t=Ft(e).map((([,e])=>e)),[...new Set(t)];var t};async function Lt(e,t){try{return e?await Vt(e,t):null}catch(e){console.error(e)}return null}const Vt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),$t=e=>[...new Set(e)],jt={},qt=["/portal-resources"],Ut=(e,t)=>Bt(e,(e=>t?.[e])),Wt=(e,t)=>{const n=zt(e),[r,l]=a({});return i((()=>{Ht(n).then(l)}),[n.join()]),n.length?Ut(e,{...t,...r}):e},Ht=async(e,t={})=>{if(e.length){const n=await(async e=>Object.fromEntries((await Promise.allSettled($t(e).filter((e=>!qt.some((t=>e.startsWith(t))))).map((async e=>(jt[e]||=await Vt(e),[e,jt[e]]))))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(e),a={...t,...n},i=Object.entries(n).flatMap((([,e])=>zt(e)));return i.length?Ht(i,a):a}return t};function Yt(e,t={}){const n=d((t=>{const n=Wt((({block:e,options:t,className:n,defaultPadding:a,padding:i,isTheme:r,version:l,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...n})}));return Object.assign(n,t),n}const Gt=Yt((({className:e,padding:t,defaultPadding:n,...a})=>o(g,{className:u("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...a,children:o(at,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...a})}))),Kt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=l((()=>Xt(0,t?.length)),[t]),a=t?.[n];return a?o(Gt,{suppressHydrationWarning:!0,...a,...e}):o(g,{...e,children:o(f,{})})})),Xt=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),Jt=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const n=String(e.getDate()).padStart(2,"0"),a=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getFullYear());return t?`${i}-${a}-${n}`:`${n}.${a}.${i}`}},Zt=e=>e?.replace(/[^+\d]/g,""),Qt="/api/v1";const en=e=>e?{phone:Zt(e)}:{},tn=(e,t="birthday")=>e?{[t]:Jt(e)}:{},nn=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),an=(e,t=!0)=>({[t?"email":"mail"]:e}),rn=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:Zt(e)}:{},ln=async({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:a,params:i}of e??[]){const e=t[a??""];e&&await e(n,i)}};function sn(){return sn._impl()}sn._impl=()=>({assign:(e,t)=>{globalThis.open(e,t||"_self")},get origin(){return globalThis.location.origin},get href(){return globalThis.location.href}}),sn.setup=e=>{sn._impl=e};const on="rshb-query-params";function cn(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(on)||"";return e&&globalThis.sessionStorage?.setItem(on,e),e}const dn=async e=>{const t=e.target?.closest("a"),n=sn();if(O(t?.href)&&!t?.href?.startsWith(n.origin)){e.preventDefault(),e.stopPropagation();const a=(e=>{const t=cn();if(!O(e)||!t)return e;const n=new URL(e);for(const[e,a]of new URLSearchParams(t))n.searchParams.set(e,a);return n.toString()})(t?.href)||t?.href;a&&n.assign(a,t?.target)}};function mn(){return mn._impl()}function un(e=!1){const[t,n]=a(e),i=r((()=>n(!0)),[]),l=r((()=>n(!1)),[]),s=r((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:i,setFalse:l,toggle:s}]}mn._impl=()=>({forwardQuery:dn}),mn.setup=e=>{mn._impl=e};const hn=e=>t=>t&&Object.entries(e??{}).flatMap((([e,n])=>n?n(t[e]):[]))||[],pn=e=>!e?.length,gn=e=>t=>n=>e(n)?[]:[t],fn={},yn=[];const xn=(e,t)=>e&&t&&(e===t||Object.keys({...e,...t}).every((n=>e[n]===t[n])));function bn(e,{resetOnSubmit:t,formValidator:n,normalizer:o,onChange:c,onSubmit:d}={}){const[m,u]=function(e,t,n){const[l,s]=a(e),o=r((e=>s((a=>{const i=e instanceof Function?e(a):e,r=t?t(i):i,l=xn(i,r)?i:r;return!xn(a,l)&&n?.(l),l}))),[t,n]);return i((()=>{t&&s(t)}),[t]),[l,o]}(e,o,c),[h,{setTrue:p,setFalse:g}]=un(!1),f=s({}),[y,{isValid:x,errors:b}]=function(e,t){const n=l((()=>t?.(e)??fn),[t,e]),a=l((()=>hn(n)(e)??yn),[n,e]),i=pn(a);return[n,{isValid:i,errors:a}]}(m,n),v=r(((e,t={})=>{const{parse:n,format:a,onChange:i}=t,r=m[e],l=h||f.current?.[String(e)],s=t?.validator??y[e],o=l&&s?s(r):[];return{value:a?a(r):r,isDirty:l,errors:s&&o,error:o[0],onChange:t=>{f.current||={},f.current[String(e)]=!0;const a=n?n(t):t;i?.(a),u((t=>({...t,[e]:a})))}}}),[m,h,y,u]),N=r((e=>{f.current=e,u(e)}),[u]),w=r((()=>{f.current={},g(),u(e)}),[e,u]),C=r((e=>{e.preventDefault(),x?(t&&w(),d?.(m,e)):p()}),[t,m,x,w,d]);return[m,{errors:b,field:v,update:N,reset:w,onSubmit:C}]}const vn=d((e=>{const{className:t,title:n,children:a,...i}=e;return o(g,{className:t,defaultPadding:"p-6xl",...i,children:c("div",{className:"container space-y-lg",children:[n?o(N,{headingType:"h3",title:n,className:"@xl:text-center"}):null,a]})})}));function Nn(e,t={}){const{open:n,close:a,...i}=ge();return{open:r(((i,r={})=>n({dialog:o(e,{...t,...i,onClose:()=>{a(),i.onClose?.()}}),...r})),[e,n,a]),close:a,...i}}const wn=({label:e,errors:t})=>e&&t?`${e}*`:e,Cn=e=>o("div",{className:"h-6",children:e?o(Le,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),Sn="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",kn=e=>e?Sn:"border-error",In=e=>e?o(Le,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,Tn=d((({key:e,className:t,id:n,name:a,type:l="text",label:d,placeholder:m,value:h="",valid:p=!0,pattern:g,autoFocus:f=!1,isTextarea:y=!1,disabled:x=!1,children:b,onChange:v,onFocus:N,onBlur:w})=>{const C=s(null),S=r((e=>{const t=(e.target?.value??"").trimStart();v&&v(t)}),[v]);i((()=>{f&&C.current?.focus()}),[f,C]);const k=b?"pr-3xl":"",I=kn(p),T=d??a??n;return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[In(d),y?o("textarea",{className:u("block resize-y min-h-24",Pn,I),id:u("textarea",n),value:h,name:a||n,placeholder:m,disabled:x,"aria-label":T,onChange:S,onFocus:N,onBlur:w},e):o("input",{ref:C,className:u("h-14",Pn,k,I),id:n,type:l,value:h,name:a||n,placeholder:m,pattern:g,disabled:x,"aria-label":T,onChange:S,onFocus:N,onBlur:w},e)]}),b]})})),Pn="w-full border rounded-md text-primary-text outline-none p-m",En=e=>e?.text||e?.key||"";function Dn(e,t,n,a){i((()=>{if(e&&n)return e.addEventListener(t,n,a),()=>{e.removeEventListener(t,n,a)}}),[e,t,n])}function Rn(e){const t=s(null),n=r((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return Dn(globalThis.document,"click",n),t}const _n=()=>ue(pe.emitter,"popup"),An=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,On=d((({popupRef:e,options:t,value:n,query:a,onChange:i,iconVersion:r})=>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:An(t,a).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(),i&&i(e)},children:[o("span",{className:"min-h-6",children:En(e)}),o(G,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:r,className:u("absolute right-4 pt-3xs",{hidden:e.key!==n?.key})})]},e.key)))}):null));const Mn=d((({className:e,label:t,options:n=[],value:l,valid:d=!0,isBorder:m=!0,placeholder:h="",isSearch:p=!1,disabled:g=!1,iconVersion:f="black",onChange:y})=>{const[x,{setFalse:b,setTrue:v}]=un(),[N,w]=a(""),C=zn(g,n.length),S=x&&!C,k=r((()=>{C||v()}),[C]),I=r((()=>{w(""),b()}),[]),T=function({isOpen:e,options:t,value:n,query:a,onChange:l,onClose:c,iconVersion:d}){const m=_n(),u=r((()=>{m.close(),c&&c()}),[c]),h=r((e=>{u(),l&&l(e)}),[u,l]),p=s(null),g=Rn(u);return i((()=>{if(!e||!p.current)return;const i=p.current,{top:r,left:l,width:s,height:c}=i.getBoundingClientRect();m.open({popup:o(On,{popupRef:g,options:t,value:n,query:a,onChange:h,iconVersion:d}),top:r+window.scrollY+c,left:l,width:s})}),[e,t,n,a,h]),p}({isOpen:x,options:n,value:l,query:N,onChange:y,onClose:I,iconVersion:f});return c("div",{className:u("space-y-xs",e),children:[In(t),c("div",{className:u("relative",S?"z-20":"z-10"),ref:T,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",Fn(m,d,C)),onClick:S?I:k,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:En(l)||h}),Bn(S,f)]}),p&&S?o("div",{className:u("absolute top-0 w-full z-20"),children:o(Tn,{type:"text",value:N,autoFocus:!0,disabled:C,onChange:w})}):null]})]})})),Bn=(e,t)=>o(G,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),Fn=(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,Ln=d((({className:e="",label:t,error:n,errors:a,...i})=>c("div",{className:e,children:[o(Mn,{...i,valid:!n,label:wn({label:t,errors:a})}),Cn(n)]}))),Vn=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"SoftPOS",key:"softpos"},{text:"Все виды эквайринга",key:"all"}],$n=d((({field:e,input:t})=>o(Ln,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:Vn,...e(t?.name??"")}))),jn=(e="")=>Boolean("trade"===e||"all"===e),qn=e=>null!=e,Un=new Map,Wn=(e,t=Un)=>n=>{const a=Yn(n),i=t.get(a);if(a&&qn(i))return i;const r=e(...n);return a&&qn(r)&&t.set(a,Promise.resolve(r)),r},Hn=e=>Boolean(e?.every((e=>Array.isArray(e)?Hn(e):!e||"string"==typeof e))),Yn=e=>Hn(e)?e.toString():"",Gn=e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]);function Kn(e,t,{fallback:n,cache:r}={}){const s=l((()=>Xn(e)),[e]),[o,c]=a(void 0),[d,m]=a(void 0);i((()=>{if(!s.some(qn))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await Wn(t,r)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,r,s]);const u=n&&Gn(s)&&n[s[0]];return{data:!o&&u?u:o,error:d,mutate:()=>Promise.resolve(void 0)}}function Xn(e){return Array.isArray(e)?e:e instanceof Function?Xn(e()):[e]}const Jn=`${Qt}/branches`,Zn=[];const Qn=async e=>await Lt(e,{method:"GET"})||Zn;function ea(e=!1){const{data:t}=Kn(`${Qt}${e?"/premiumBranchesByRegions":"/branchesByRegions"}`,Vt);return Array.isArray(t)?t:[]}const ta=(e="")=>"ULTRASERVICE"===e,na=d((({field:e,input:t,params:n})=>{const a=ta(n?.typeForm),r=e("region"),l=r?.value?.key,s=r?.value?.text,c=a?ea(a)?.find((e=>e?.region===s))?.branches:function(e){const{data:t}=Kn(e?`${Jn}?regionCode=${e}`:null,Qn);return t||Zn}(l)?.filter((e=>e?.address));return i((()=>{""!==r?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[r?.value]),o(Ln,{label:"Отделение",placeholder:"Выберите отделение",options:(c||[]).map((({address:e=""})=>({key:e,text:e}))),...e(t?.name??""),isSearch:!0})})),aa=(e,{normalize:t,format:n})=>{const{value:i,onFocus:l,onBlur:s,onChange:o}=e,[c,d]=a(!1),m=r((e=>{d(!0),l&&l(e)}),[]),u=r((()=>{d(!1),o&&o(t(i)),s&&s()}),[o,i]);return{value:c||!n?i:n(i),onFocus:m,onBlur:u}},ia=(e,t,n)=>Math.max(t,Math.min(e,n));function ra(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function la({list:e=[],min:t,max:n,step:a,value:i=e[0]||t,disabled:r,onChange:l}){const s=e.length?e.indexOf(i):i,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||r?"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:a,value:s,disabled:r,onChange:t=>{const n=ra(t.target?.value),a=e.length?e[n]:n;l&&l(a||0)}})})]})}const sa=1,oa=100,ca=d((e=>{const{className:t,title:n,items:a=[],list:i=[],min:l=(i.length?0:sa),max:s=(i.length?i.length-1:oa),step:d=1,value:m=i[0]||l,disabled:h=!1,onChange:p}=e,g=aa(e,{normalize:(e=0)=>i.length?da(i)(e):ia(e,l,s),format:Je()}),f=r((e=>{p&&p(ra(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(Le,{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 box-border","text-primary-text",Sn,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:f,...g}),la({list:i,min:l,max:s,step:d,disabled:h,value:m,onChange:p})]}),ma(a)]})})),da=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),ma=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(Le,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),ua=["От 1 000 ₽","До 1 000 000 000 ₽"],ha=d((({field:e,input:t})=>o(ca,{title:"Сумма, ₽",items:ua,min:1e3,max:1e9,...e(t?.name??"")}))),pa=()=>{},ga=d((({className:e,label:t,value:n="",error:a,errors:i,type:l,isInteger:s,placeholder:d,maxLength:m,inputRef:h,isOpen:p,onOpen:g,onClose:f,onChange:y=pa,...x})=>{const b=Rn(f),v=r((e=>{const t=m&&e.length>m;!p&&g(),t||y(fa(e,s))}),[p,y]);return c("div",{className:u("shrink-0 w-full",e),ref:b,onBlur:f,onFocus:g,children:[o("div",{ref:h,children:o(Tn,{type:l||"text","aria-label":t,label:wn({label:t,errors:i}),valid:Boolean(!a),onChange:v,placeholder:ya({placeholder:d,errors:i,label:t}),value:n,...x})}),Cn(a)]})})),fa=(e="",t=!1)=>t&&e?e.replace(/[^\d]+/g,""):e,ya=({placeholder:e,errors:t,label:n})=>t&&!n?`${e}*`:e,xa=d((e=>{const[t,{setFalse:n,setTrue:a}]=un();return o(ga,{isOpen:t,onOpen:a,onClose:n,...e})})),ba=d((({field:e,input:t})=>o(xa,{label:"Годовая выручка, ₽",...e(t?.name??"")}))),va=d((({field:e,input:t})=>o(xa,{label:"Дата и время обращения в Банк",...e(t?.name??"")}))),Na="client",wa=[{key:Na,text:"Клиент"},{key:"representative",text:"Представитель клиента"}],Ca=d((({field:e,input:t})=>o(Ln,{label:"Тип обратившегося",...t,options:wa,...e("applierType")}))),Sa=d((({field:e,input:t})=>o(xa,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e(t?.name??"")}))),ka=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:a,currentYear:i,min:r,max:l,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(i,a,d),n=Ia(t,e),c=Ta(t,r,l);u.push(o("td",{children:o("div",{className:Pa(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},Ia=(e,t)=>t&&e.toDateString()===t.toDateString(),Ta=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),Pa=(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"),Ea=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Da=d((({today:e,currentMonth:t,currentYear:n,min:a,max:i,onDateSelect:r=pa})=>{const{firstDayOfWeek:s,totalDays:d}=l((()=>({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:Ea.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:ka({firstDayOfWeek:s,today:e,totalDays:d,currentYear:n,currentMonth:t,min:a,max:i,onDateClick:r})})]})})),Ra=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function _a(e,t){const n=e.replace(/\D/g,"");if(""===n||n.length===t.length)return e;const a=[...t],i=a.findIndex(Aa),r=a.map(((e,t)=>Ma(e)?a.slice(0,t).filter(Ma).length:-1)),l=a.map(((e,t)=>Oa(e)?e:n.charAt(r[t])||e)),s=r.indexOf(n.length-1)+1;return l.slice(0,Math.max(i,s)).join("")}const Aa=e=>"_"===e,Oa=e=>/\d/.test(e),Ma=e=>Aa(e)||Oa(e),Ba=1940,Fa={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},za=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:r,disabled:l,onChange:d,onClick:m})=>{const h=s(null),[p,g]=a(r||"");return i((()=>{g(r||"")}),[r]),i((()=>{Va({inputValue:p,setSelectedMonth:e,setSelectedYear:t,onChange:d})}),[p]),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(_a(t,"__.__.____"))},onBlur:()=>{La(p)?Va({inputValue:p,setSelectedMonth:e,setSelectedYear:t,onChange:d}):g(r||"")},disabled:l}),l?null:o(G,{className:"mr-s",...Fa})]})})),La=e=>{const[t,n,a]=e.split(".");if((e=>Number(e)>=Ba&&Number(e)<=(new Date).getFullYear())(a)&&(e=>Number(e)>0&&Number(e)<13)(n)){const e=new Date(Number(a),Number(n)-1,1);let i=0;for(;e.getMonth()===Number(n)-1;)e.setDate(e.getDate()+1),i++;return Number(t)>0&&Number(t)<=i}return!1},Va=({inputValue:e,setSelectedMonth:t,setSelectedYear:n,onChange:a})=>{if(La(e)){const{day:i,month:r,year:l}=(e=>{const[t,n,a]=e.split(".");return{day:Number(t),month:Number(n)-1,year:Number(a)}})(e);t(r),n(l),a?.(new Date(l,r,i))}},$a=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:a,setSelectedMonth:i,setSelectedYear:r,disabled:l=!1})=>o(za,{onChange:a,disabled:l,onClick:e,value:t&&Jt(t),setSelectedMonth:i,setSelectedYear:r,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")}),ja=Ra.map((e=>({key:e}))),qa=Array.from({length:(new Date).getFullYear()-Ba+1},((e,t)=>Ba+t)).reverse().map((e=>({key:String(e)}))),Ua=(e,t)=>{const n=new Date(e,t,1);let a=0;for(;n.getMonth()===t;)a++,n.setDate(n.getDate()+1);return a},Wa=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:a,onChange:i})=>{a&&i?.(new Date(t,n,Math.min(e,a.getDate())))},Ha={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},Ya={className:"min-w-32",iconVersion:"black",isBorder:!1},Ga=d((({className:e="",label:t="",value:n,valid:l=!0,minDate:s,maxDate:d,disabled:m,onChange:h})=>{const[p,{setValue:g,setFalse:f}]=un(!1),[y,x]=a(n?.getMonth()||(new Date).getMonth()),[b,v]=a(n?.getFullYear()??(new Date).getFullYear()),N=r((e=>{h?.(e),f()}),[h]),{handlePrevMonth:w,handleNextMonth:C,handleSelectMonth:S,handleSelectYear:k,monthsOptions:I,yearsOptions:T,handleChangeVisibleCalendar:P,ref:E}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:a,onYearSelect:i,selectedYear:l,onChange:s,value:o})=>{const c=Rn(r((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:r((()=>e(!t)),[t]),handleNextMonth:r((()=>{n+1<=11?a(n+1):(a(0),i(l+1))}),[n]),handlePrevMonth:r((()=>{n-1>=0?a(n-1):(a(11),i(l-1))}),[n]),handleSelectMonth:r((({key:e})=>{a(Ra.indexOf(e));const t=Ua(l,Ra.indexOf(e));Wa({maxDateOfMonth:t,selectedYear:l,selectedMonth:Ra.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:r((({key:e})=>{i(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:ja,yearsOptions:qa,ref:c}})({onYearSelect:v,onMonthSelect:x,onShowCalendar:g,selectedYear:b,selectedMonth:y,showCalendar:p,onChange:h,value:n}),D=((e,t)=>{const[n,r]=a(!1);return i((()=>{const n=()=>{if(e?.current){const{top:n}=e.current.getBoundingClientRect();r(n>t)}};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}),[e]),n})(E,370);return c("div",{className:u("space-y-xs",e),ref:E,children:[In(t),c("div",{className:"relative",children:[$a({handleChangeVisibleCalendar:P,value:n,valid:l,onChange:h,disabled:m,setSelectedMonth:x,setSelectedYear:v}),p&&!m?c("div",{className:u("absolute bg-white z-20 select-none",{"bottom-full":D}),children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:w,children:o(G,{...Ha,className:"-rotate-90 cursor-pointer"})}),o(Mn,{onChange:S,value:{key:Ra[y]},options:I,...Ya}),o(Mn,{onChange:k,value:{key:String(b)},options:T,...Ya}),o("div",{className:"my-auto",onClick:C,children:o(G,{...Ha,className:"rotate-90 cursor-pointer"})})]}),o(Da,{today:n,currentMonth:y,currentYear:b,min:s,max:d,onDateSelect:N})]}):null]})]})})),Ka=d((({className:e,label:t,error:n,errors:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Ga,{label:wn({label:t,errors:a}),valid:Boolean(!n),...i}),Cn(n)]}))),Xa=d((({field:e,input:t})=>o(Ka,{label:t?.label||"Дата рождения",...e(t?.name??"")}))),Ja=d((({field:e,input:t})=>o(xa,{label:"Количество объектов инкассации",isInteger:!0,...e(t?.name??"")}))),Za=d((({field:e,input:t})=>o(xa,{className:"col-span-2",...e(t?.name??""),placeholder:"Ваше сообщение",isTextarea:!0}))),Qa=d((({field:e,input:t})=>o(Ka,{label:"Желаемая дата встречи",...e(t?.name??"")}))),ei=d((({field:e,input:t})=>o(xa,{label:"Электронная почта",...e(t?.name??""),...t}))),ti=[{key:"ULTRASERVICE",text:"Ультра"}],ni=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],ai=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],ii=d((({field:e,input:t})=>o(Ln,{label:"Способ получения ответа",options:ai,...e(t?.name??"")}))),ri=d((({field:e,input:t})=>o(xa,{label:"ФИО",...e(t?.name??""),...t}))),li=d((({field:e,input:t})=>o(xa,{label:"ИНН",isInteger:!0,maxLength:12,...t,...e(t?.name??"")}))),si=d((({className:e,viewBox:t,fill:n="none",width:a,height:i,paths:r,...l})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:a,height:i,children:r.map((({d:e,fill:t,...n},a)=>{const i={...l,...n};return o("path",{d:e,fill:t||"currentColor",stroke:i.stroke,strokeLinecap:i.strokeLinecap,strokeLinejoin:i.strokeLinejoin,strokeWidth:i.strokeWidth,strokeMiterlimit:i.strokeMiterlimit},a)}))}))),oi=[{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"}],ci=d((({className:e,value:t,text:n,disabled:a,isRadio:i,onChange:l})=>{const s=r((e=>{a||(e.preventDefault(),l&&l(!t))}),[l,a,t]),d=i?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(si,{paths:oi,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",mi(a)),onClick:s,children:[o("div",{className:u("appearance-none w-5 h-5 border-solid flex-none","m-0",i?"rounded-full border-2":hi(t),!a&&t?"border-primary-main":"border-gray",a?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:ui(i),"aria-checked":Boolean(t),"aria-disabled":Boolean(a),"aria-label":n}),t?d:null,di(n)]})})})),di=e=>e?o("div",{className:"ml-s",children:o(Le,{size:"text-l",font:"font-light",children:e})}):null,mi=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",ui=(e=!1)=>e?"radio":"checkbox",hi=(e=!1)=>u("rounded border",{"bg-primary-main":e}),pi=d((({className:e,text:t,value:n,key:a,disabled:i,error:r,onChange:l})=>c("div",{className:u("shrink-0",e),children:[o(ci,{text:t,value:n,disabled:i,onChange:l},a),Cn(r)]}))),gi=d((({field:e,input:t})=>o(pi,{...e(t?.name??""),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),fi=`${Qt}/outservice`,yi=[];async function xi(){const e=await Lt(`${fi}/outserviceregions`);return e&&Array.isArray(e)?e:yi}const bi=d((({field:e,input:t})=>{const n=e("region"),a=n?.value?.key,{data:r}=Kn("outServiceRegions",xi),s=l((()=>r?.find((e=>e.code===a))?.localities?.map((e=>({key:e,text:e})))),[r,a]);return i((()=>{""!==a&&e?.(t?.name??"")?.onChange?.("")}),[a,t?.name??""]),o(Ln,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:s,...e(t?.name??""),isSearch:!0})})),vi=(e,t,n="")=>t?.filledByEsia&&Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t?.name??n).value,Ni=d((({field:e,input:t})=>o(xa,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:vi(e,t),...e(t?.name??""),...t}))),wi=d((({field:e,input:t})=>o(xa,{label:"Имя",maxLength:60,disabled:vi(e,t),...e(t?.name??""),...t}))),Ci=d((({value:e=!1,text:t,type:n="checkbox",onChange:a})=>c("div",{role:n,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>a&&a(!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(Le,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),Si=d((({field:e,input:t})=>jn(e("acquiringType")?.value?.key)?o(Ci,{type:"radio",text:"Хочу онлайн-кассу",...e(t?.name??"")}):null)),ki=d((({field:e,input:t})=>o(xa,{...e(t?.name??""),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...t}))),Ii=e=>"_"===e,Ti=e=>/\d/.test(e),Pi=e=>Ii(e)||Ti(e),Ei=[..."+7 (___) ___-__-__"],Di=Ei.findIndex(Ii),Ri=Ei.map(((e,t)=>Pi(e)?Ei.slice(0,t).filter(Pi).length:-1));function _i(e){const t=e.replace(/\D/g,""),n=Ei.map(((e,n)=>Ti(e)?e:t.charAt(Ri[n])||e)),a=Ri.indexOf(t.length-1)+1;return(a?n.slice(0,Math.max(Di,a)):n).join("")}const Ai=d((({children:e,onChange:t,...n})=>{const a=r((e=>t&&t(_i(e))),[t]),i=r((e=>{"+7 ("===e&&t&&t("")}),[]);return o(Tn,{...n,onChange:a,onFocus:e=>a(e?.target?.value||""),onBlur:e=>i(e?.target?.value||""),children:e})})),Oi=d((({className:e,label:t,disabled:n,error:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Ai,{"aria-label":t,label:wn({label:t,errors:i?.errors}),valid:Boolean(!a),disabled:n,placeholder:"+7 (___) ___-__-__",...i}),Cn(a)]}))),Mi=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(Oi,{label:"Телефон",disabled:vi(e,t,n),...e(n),...t})})),Bi=d((({field:e})=>jn(e("acquiringType")?.value?.key)?o(Ci,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),Fi=Yt((({field:e,input:t,source:n})=>o(Ln,{placeholder:"Выберите продукт",label:"Продукт",options:zi(n?.productList),...e(t?.name??"")}))),zi=e=>(e??[]).map((e=>({key:e,value:e}))),Li=`${Qt}/regions`,Vi=[];function $i(e=Li){const{data:t}=Kn(e,Vt);return Array.isArray(t)?t:Vi}const ji=`${Qt}/outservice/outserviceregions`,qi=d((({field:e,input:t,params:n})=>{var a;const i=$i((a=n?.typeForm,"OUTSERVICE"===a?ji:void 0));return o(Ln,{label:t?.label||"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:l((()=>i?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[i]),...e(t?.name??"")})})),Ui=d((({field:e,input:t})=>{const n=ea(!0),a=l((()=>n?.map((({region:e})=>({key:e,text:e})))),[n]);return o(Ln,{label:"Регион",placeholder:"Выберите регион",options:a,...e(t?.name??"")})})),Wi=d((({field:e,input:t})=>o(xa,{label:"ФИО представителя",...t,...e("representativeName")}))),Hi=(e,t)=>{const{value:n,isDirty:a}=e,i=a?t(n):[];return{...e,errors:i,error:i[0]}},Yi=/^[а-яё-]*$/i,Gi=(e="")=>Yi.test(e),Ki=gn((e=>null!=e&&""!==e)),Xi="Некорректно заполненное поле",Ji=e=>Ki(e??Xi),Zi=e=>gn((e=>e?.key&&""!==e?.key))(e??Xi),Qi=e=>gn((e=>"string"==typeof e&&e.length>1&&Gi(e)))(e??Xi),er=e=>/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(e),tr=e=>gn(er)(e),nr=gn((e=>"boolean"==typeof e&&e))("Согласие обязательно"),ar={fullName:Ji(),addressBranch:Zi(),desiredMeetingDate:Ji(),product:Ji(),localities:Ji(),partnerComments:Ji(),collectionCount:Ji(),acquiringType:Zi(),serviceType:Zi(),annualRevenue:Ji(),feedbackMethod:Zi(),serviceDirection:Zi(),secondaryPhone:tr("Укажите номер телефона"),region:Zi(),situationDescription:Ji(),sufferedFrom:Ji(),applierType:Ji(),surname:Qi("Укажите свою фамилию на кириллице"),name:Qi("Укажите своё имя на кириллице (без сокращений)"),middleName:Qi("Укажите своё отчество на кириллице"),birthday:Ji("Укажите дату рождения"),phone:tr("Укажите номер телефона"),email:(ir="Укажите электронную почту",gn((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(ir)),inn:(e=>gn((e=>"string"==typeof e&&(10===e.length||12===e.length)))(e))("Укажите ИНН"),comment:Ji(),typeForm:Ji(),consentToReceiveMaterials:nr,consentDataProcessing:nr};var ir;const rr=(e,t={})=>{const n=e.filter((e=>Boolean(e?.required&&e?.name))),a={...ar,...t},i=n.some((e=>e.condition?.values)),r=Object.fromEntries(n.filter(lr(a)).map((({name:e})=>[e,a[e??""]])));return e=>i?Object.fromEntries(n.filter(lr(a)).filter(sr(e)).map((({name:e})=>[e,a[e??""]]))):r},lr=(e={})=>({name:t})=>Boolean(e[t??""]),sr=e=>t=>!t?.condition||t.condition.values.find((n=>{const a=e?.[t?.condition?.name??""];return n===(a?.key??a)})),or=d((({field:e})=>{const t=e("secondaryPhone");return o(Oi,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?Hi(t,ar.secondaryPhone):t})})),cr=d((({field:e,input:t})=>o(Ln,{label:"Направление обслуживания",placeholder:"Выберите направление",options:ni,...e(t?.name??"")}))),dr=d((({field:e,input:t})=>o(xa,{label:"Описание ситуации",...t,...e("situationDescription")}))),mr=[{key:"blg",text:"Белгородской области"},{key:"brnsk",text:"Брянской области"},{key:"krsk",text:"Курской области"},{key:"chs",text:"От стихийного бедствия ЧС"}],ur=d((({field:e,input:t})=>o(Ln,{label:"Пострадал в",...t,options:mr,...e("sufferedFrom")}))),hr=d((({field:e,input:t})=>o(xa,{label:"Фамилия",maxLength:60,disabled:vi(e,t),...e(t?.name??""),...t}))),pr=["От 1 мес","До 15 лет"],gr=d((({field:e})=>o(ca,{title:"Срок, месяцев",items:pr,min:1,max:180,...e("term")}))),fr=d((({field:e,input:t})=>o(Ln,{label:"Тип обслуживания",options:ti,...e(t?.name??"")}))),yr={horizontal:"@lg:flex-row",vertical:""},xr=d((({label:e,items:t,value:n,className:a,disabled:i=!1,orientation:r="horizontal",onChange:l})=>c("div",{className:"grid gap-xs whitespace-nowrap",children:[e?o("div",{role:"radiogroup","aria-label":e,children:o(Le,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",yr[r],a),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(ci,{isRadio:!0,text:t,value:n===e,onChange:()=>l?.(e),disabled:i},String(e))))})]}))),br=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],vr=d((({field:e,input:t})=>{const n=r((t=>{"currencyControl"!==t&&(e("inn").onChange?.(""),e("region").onChange?.(""))}),[]);return o("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:o(xr,{className:"whitespace-normal",orientation:"horizontal",items:br,...e(t?.name??"",{onChange:n})})})})),Nr=d((({field:e,input:t})=>o(ci,{text:"Согласен на получение информационных и аналитических материалов по электронной почте",...e(t?.name??"")})));const wr={$ref:"/wcms-resources/outservice-productlist.json"},Cr={fullName:ri,addressBranch:na,desiredMeetingDate:Qa,product:e=>o(Fi,{...e,source:wr}),localities:bi,isClient:gi,partnerComments:ki,collectionCount:Ja,acquiringType:$n,onlineCheckout:Si,posTerminal:Bi,serviceType:fr,term:gr,amount:ha,annualRevenue:ba,vedTypes:vr,feedbackMethod:ii,serviceDirection:cr,bankEmpolee:Sa,secondaryPhone:or,applicationDate:va,region:e=>ta(e?.params?.typeForm)?o(Ui,{...e}):o(qi,{...e}),consentToReceiveMaterials:Nr,sufferedFrom:ur,situationDescription:dr,representativeName:Wi,applierType:Ca,surname:hr,name:wi,middleName:Ni,birthday:Xa,phone:Mi,email:ei,inn:li,comment:Za},Sr=(e,t,n={})=>(a,i)=>{const r={...Cr,...n}[String(a.name)];return function({input:e,field:t}){const{condition:n}=e,{value:a}=t(n?.name||"");return!n||n?.values?.includes(a?.key??a)}({input:a,field:e})&&r?o("div",{children:o(r,{field:e,input:a,params:t})},i):null},kr=e=>2===e?"@xl:grid-cols-2":"",Ir=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(Le,{size:"text-h6",children:e})}):null,Tr={primary:u("text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active","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("text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active","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")},Pr=u("group/btn-embedded","bg-transparent border border-transparent outline-none"),Er=u("bg-main-gray text-main-disabled cursor-not-allowed"),Dr=d((({className:e,type:t="button",version:n="primary",shape:a="default",embedded:i,disabled:s,role:c,ariaLabel:d,data:m,dataTheme:h,children:p,wcmsIgnore:g,onClick:f=pa})=>{const y=r("tab"!==c?me(f):f,[c,f]),x=l((()=>ve(m)),[m]),b="round"===a;return o("button",{className:u("font-sans flex items-center gap-xs",{[Tr[n]]:!s&&!i,[Pr]:i,[Er]:s},i?"justify-between":"justify-center",i||b?"p-0":"px-9 py-4",{"rounded-md":"default"===a,"rounded-full":b},e),type:t,role:c,"aria-label":d,disabled:s,"aria-disabled":s?"true":void 0,"data-theme":h,"data-wcms-ignore":g,...x,onClick:y,children:p})})),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(G,{name:"CloseIcon",width:"20",height:"20",iconVersion:"gray"})}))),_r=d((({className:e,head:t,children:n,onClose:a,onClick:i})=>c("div",{className:u("relative bg-white pt-0 p-lg",e),role:"dialog",title:"Диалог",onClick:i,children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(Rr,{className:"absolute top-0 right-0",onClose:a}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]}))),Ar=d((({ok:e,typeForm:t,onClose:n})=>{const a="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся";return o(_r,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto",onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ie,{image:{icon:e?"ResponseOKIcon":"ResponseFailIcon",iconVersion:"normal"},width:"136",height:"136"}),o(S,{className:"w-full",title:e?"Ваша заявка отправлена":"Не удалось отправить заявку",description:e?a:"Пожалуйста, повторите позднее",headlineVersion:"XS",isEmbedded:!0}),o(Dr,{type:"button",onClick:n,children:"Хорошо"})]})})})),Or=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:a,amount:i,term:r,annualRevenue:l,serviceType:s,vedTypes:o,region:c,inn:d,sufferedFrom:m,situationDescription:u,applierType:h,...p}=e,g=t||l?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:a=!1,term:i,amount:r,annualRevenue:l}=e;return t?`Вид эквайринга=${t?.text||""}${jn(t?.key)?`/Онлайн касса=${n}/POS-терминал=${a}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${r}/Срок=${i}/Выручка=${l}`})(e):null,f={...p,...zr(o),...Fr(c),...d&&{inn:d},...g?{partnerComments:g}:{},...s?{typeForm:s}:{},...Br(m?.text,u),...Mr(h)};return Object.fromEntries(Object.entries(f)?.map((([e,t])=>[e,t?.key||t])))},Mr=e=>e?.key?{isClient:e?.key===Na}:{},Br=(e,t)=>e||t?{comment:`${e||""};${t||""}`}:{},Fr=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},zr=e=>e?{vedTypes:Object.fromEntries(br.map((({id:t})=>[t,t===e])))}:{},Lr={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:Vn[0],serviceType:ti[0],feedbackMethod:ai[0],serviceDirection:ni[0],vedTypes:br[0].id,birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""}},Vr=d((({color:e="text-primary-main",position:t="absolute",blur:n=!0,size:a="big"})=>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","animate-spin rounded-full","border-solid border-current","border-r-transparent","small"===a?"border-4 h-8 w-8":"border-8 h-28 w-28",e),role:"status"})}))),$r=d((({isLoading:e,disabled:t,children:n,className:a,...i})=>c(Dr,{type:"submit",className:u("relative",a),disabled:e||t,...i,children:[e?o(Vr,{blur:!0,size:"small"}):null,n]}))),jr={primary:Tr.primary,secondary:Tr.secondary,white:"text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main",link:"text-primary-main",gray:Tr.secondary,transparent:"","":""},qr=d((e=>{const t=xe(),{className:n,href:a,target:i,text:r,aboveText:l,version:s="link",rel:c,ariaLabel:d,data:m,children:h,onClick:p}=t(e),g="link"!==s;return o("a",{className:u("group/btn inline-flex items-center h-fit","font-sans no-underline select-none","border border-transparent focus:border-primary-text focus:border","cursor-pointer",{[jr[s]]:Boolean(s),[l?"px-9 py-2.5":"px-9 py-4"]:g,"rounded-md":g},n),href:a,target:i,rel:c,"aria-label":d??`Ссылка на ${r}`,role:a?"link":"button",onClick:p,...ve(m),children:h??Ur(r,l)})})),Ur=(e,t)=>e||t?c("div",{className:"whitespace-pre",children:[t?o("div",{className:"font-light text-left text-xs",children:t}):null,o("div",{className:u("text-left",{"text-s -mt-3xs":Boolean(t)}),children:e})]}):null,Wr=d((({text:e,link:t})=>c(w,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(Le,{children:e}):null,t?o(qr,{...t,ariaLabel:"условия передачи данных",children:t.text}):null]}))),Hr=(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(ci,{...e}),o(Wr,{link:t})]}),Cn(Hi(e,nr).error)]}):o(Wr,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),o($r,{className:"w-full @xl:w-auto",children:n?.text?n.text:"Отправить заявку"})]}),Yr={send:async function(e,t=!1){const{typeForm:n,region:a,phone:i="",email:r,birthday:l,desiredMeetingDate:s,inn:o,addressBranch:c,secondaryPhone:d="",bankEmpolee:m,applicationDate:u,serviceDirection:h,...p}=e,g=t&&"Юридическое лицо / ИП"!==h,f=`${Qt}${g?"/lead":"/sendcorporatelead"}`,y={typeForm:n,...nn(a,g),...an(r,g),...en(i),...tn(s,"desiredMeetingDate"),...g?tn(l):{inn:o},..."FEEDBACK"===n?{}:{addressBranch:c,bankEmpolee:m,applicationDate:u,...rn(d)},...p};try{const e=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(y)});return e?.ok?await e.json():null}catch(e){return null}}},Gr=d((({className:e,title:t,typeForm:n="",sections:a=[],button:i,link:s,endpoint:d,additionalParams:m,isContacts:h,data:p,...g})=>{const f=l((()=>a?.flatMap((e=>e?.inputs))||[]),[a]),y=l((()=>((e,t="")=>({...Object.fromEntries(e.map((e=>[e.name,"vedTypes"===e?.name&&e?.defaultValue||Lr[e.name||""]]))),typeForm:{key:t,text:""}}))(f,n)),[f,n]),x=l((()=>rr(f)),[f]),b=Nn(Ar),v=mn(),w=r((async(e,t)=>{const a=Or({...e,...m}),i=Boolean(await Yr.send(a,"lead"===d));b.open({ok:i,typeForm:n}),i&&ln({aspectsAttributes:p,aspects:v,ev:t})}),[n]),[,{field:C,onSubmit:S}]=bn(y,{resetOnSubmit:!0,formValidator:x,onSubmit:w}),k=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(f)?.name;return c(vn,{className:u("container space-y-m",e),title:t,...g,children:[c("form",{onSubmit:S,children:[a.map(((e,t)=>c("div",{className:u(kr(e.columns),"grid gap-x-m"),children:[Ir(e.title),(e?.inputs||[])?.map(Sr(C,{typeForm:n}))]},`section-${t}`))),Hr(k?C("consentDataProcessing"):void 0,s,i)]}),h?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(ie,{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(ie,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]}):null]})})),Kr=d((({attempts:e,onClose:t=pa})=>{const n=sn(),a=e>1,i=r((()=>{n.assign("/natural")}),[]),l=r((()=>{a?i():t()}),[a]);return o(_r,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg px-5xl",onClose:l,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o(w,{align:"text-center",children:"Уважаемый клиент!"}),o(w,{align:"text-center",children:"Для получения кредита Вам необходимо обратиться в офис Банка"}),c("div",{className:"flex flex-col sm:flex-row gap-xl items-center",children:[o(Dr,{type:"button",version:"secondary",onClick:i,children:"Завершить"}),a?null:o(Dr,{type:"button",onClick:t,children:"Продолжить"})]})]})})})),Xr="Некорректно заполненное поле",Jr="Укажите регион, город/населенный пункт, улицу, дом",Zr=/^[\u0400-\u04FF-\s]+$/u,Qr=e=>Boolean(e.region&&(e.city||e.locality)&&e.house),el=()=>gn(Qr)(Jr),tl=e=>gn((e=>"string"==typeof e&&e.length>1&&Zr.test(e)))(e??Xr),nl=e=>gn((e=>"string"==typeof e&&/^[0-9]{1,2}$/g.test(e)))(e??Xr),al=(e,t)=>gn((t=>"string"==typeof t&&t.length>=1&&t.length<=e))(t??Xr),il=e=>gn((({minAge:e,maxAge:t})=>n=>{const a=new Date,i=new Date(a.getFullYear()-e,a.getMonth(),a.getDate()),r=t?new Date(a.getFullYear()-t,a.getMonth(),a.getDate()):null;return!(!n||n>i||r&&n<r)})(e))(e.errorMessage),rl=e=>gn((e=>e?.getTime()<=(new Date).getTime()))(e),ll=e=>gn((e=>"string"==typeof e&&6===e.length))(e),sl=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.slice(9))}return!1},ol={credit:{minAge:23,maxAge:75,errorMessage:"Допустимый возраст заёмщика - от 23 до 75 лет"},creditCard:{minAge:21,errorMessage:"Допустимый возраст заёмщика - от 21 года"},debitCard:{minAge:18,errorMessage:"Допустимый возраст - от 18 лет"}},cl=e=>il(ol[e]),dl={processPersonalDataFlg:nr,consentProviderFlg:nr,consentInformFlg:nr,consentPfrFlg:nr,consentOthersFlg:nr,consentFATCA:nr},ml={addressCourier:el(),paymentSystem:Ji("Укажите тип платежной системы"),currency:Ji("Укажите валюту"),cardCategory:Ji("Укажите категорию карты"),codeWord:(e=>gn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&Gi(e)))(e??Xr))("Необходимо ввести кодовое слово"),confirmationIncome:Zi(),methodObtain:Ji(),deliveryDate:(e=>gn((e=>e?.getTime()>=(new Date).getTime()))(e))("Укажите дату доставки")},ul={organization:Zi("Выберите тип организации"),organizationAddress:gn((e=>Boolean(e.fiasCode&&(e.city||e.locality)&&e.house)))(Jr),organizationPhone:tr("Укажите номер телефона"),organizationName:Ji("Укажите наименование организации"),legalForm:Ji("Укажите ОПФ"),generalSeniority:nl("Укажите количество лет стажа"),lastJobExperience:nl("Укажите стаж на последнем месте работы"),experience5Years:nl("Укажите общий стаж за последние 5 лет"),jobsNumber:nl("Укажите количество мест работы за последние 5 лет"),beginDate:rl("Укажите дату заключения трудового договора"),addressFact:el(),addressRegistration:el(),addressRetail:Zi("Выберите адрес банка"),addressMatch:Ji(),sex:Ji("Укажите свой пол"),birthPlace:Ji("Укажите место рождения"),education:Zi("Выберите ваше образование"),housing:Zi("Выберите тип жилья"),amountWorkers:Zi("Выберите информацию о количестве сотрудников"),employment:Zi("Выберите информацию о трудоустройстве"),employerActivities:Zi("Выберите вид деятельности организации"),employerOrganization:Zi("Выберите вид организации"),positionOrganization:Zi("Выберите вашу должность"),familyStatus:Zi("Выберите семейное положение"),familyMembers:al(2,"Укажите количество членов семьи"),children:al(2,"Укажите количество детей"),dependents:al(2,"Укажите количество иждивенцев"),totalIncome:al(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:al(10,"Укажите сумму обязательных выплат"),snils:(e=>gn(sl)(e))("Некорректный номер СНИЛС"),conscription:Ji(),armyIdFlg:nr,dulSerie:(e=>gn((e=>"string"==typeof e&&4===e.length))(e))("Укажите серию паспорта"),dulNumber:ll("Укажите номер паспорта"),dulSubdivisionCode:ll("Укажите код подразделения"),dulIssuedBy:Ji("Укажите организацию, выдавшую паспорт"),participantDateRegistration:rl("Укажите дату регистрации"),retirementIncome:Ji(),otherIncome:Ji(),wages:Ji(),mandatoryPayments:Ji(),bankruptcyFlg:Ji(),shareholderFlg:Ji(),legalEntityName:Ji(),bankEmployeeCode:Ji(),partInBusiness:Ji(),regionRetail:Zi("Выберите регион"),latinSurname:Ji("Укажите фамилию"),surname:tl("Укажите свою фамилию на кириллице"),name:tl("Укажите своё имя на кириллице"),middleName:tl("Укажите своё отчество на кириллице")},hl={...ul,...ml,...dl},pl={credit:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в ПФР",docId:3}},creditCard:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:19},consentInformMaterialsFlg:{text:"Согласие на получение информационных материалов",docId:18}},debitCard:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:20},consentFATCA:{text:"Форма самосертификации",docId:10}}};var gl;!function(e){e.Success="SUCCESS",e.Error="ERROR",e.Pending="PENDING"}(gl||(gl={}));const fl=async(e,t,n)=>{try{return(await yl(e,t,n)).json()}catch(e){return console.error(e),null}};async function yl(e,t,n){const a=(()=>{const e=new Uint8Array(8);return globalThis.crypto.getRandomValues(e),e.reduce(((e,t)=>`${e}${t.toString(16).padStart(2,"0")}`),"")})();return globalThis?.fetch?.(`/light-api-cash/v1${e}`,{method:t,headers:{"Content-Type":"application/json","X-B3-Sampled":"1","X-B3-Spanid":a,"X-B3-Traceid":a,...xl()},credentials:"include",body:n?JSON.stringify(n):null})}const xl=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},bl=d((({onChangeEsiaStatus:e})=>{const t=sn(),n=r((async()=>{try{const e=await(n={redirectUri:globalThis.location.origin+globalThis.location.pathname},fl("/esia/getLink","POST",n));e?.link&&t.assign(e.link)}catch{e(gl.Error)}var n}),[]);return c("div",{className:"flex gap-lg items-center rounded-md bg-main-gray p-4xl",children:[c("div",{className:"flex flex-col justify-around w-full",children:[o("p",{className:"mb-m text-xl",children:"Заполните данные через Госуслуги"}),c("ul",{className:"list-disc list-inside mb-4xl",children:[o("li",{children:"Вероятность одобрения выше"}),o("li",{children:"Без справок о доходах и трудоустройстве"}),o("li",{children:"С защитой Ваших данных"})]}),o(ie,{className:"block mb-xl self-center @md:hidden",image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"80",width:"80"}),o(Dr,{type:"button",onClick:n,className:"w-full @md:w-fit",children:"Заполнить"})]}),o(ie,{className:"hidden @md:block",image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"164"})]})})),vl=e=>e?.value||"",Nl=e=>{const{url:t,query:n,queryPrefix:a,requestData:i={},responseItemHandler:r=vl}=e,l=(s=r,e=>(e?.suggestions||[]).map((e=>{const t=s(e);return{...e,processedValue:t}})));var s;const o=`${a?`${a}, `:""}${n}`;return globalThis?.fetch?.(`/api/v1/suggestions/${t}`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:10,...i,query:o})}).then((e=>e.json())).then(l)},wl={url:"suggest/address"},Cl={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:wl,addressFact:wl,organizationAddress:wl,addressCourier:wl},Sl=d((({options:e,container:t,onChange:n})=>{const[r,l]=a(-1),s=t=>{const a=e.length-1;"ArrowDown"===t.key?l(r<a?r+1:0):"ArrowUp"===t.key?l(r>0?r-1:a):"Enter"===t.key&&e[r]&&(t.preventDefault(),n(e[r]))};return i((()=>(t.addEventListener("keydown",s),()=>t.removeEventListener("keydown",s))),[r]),o("div",{className:"bg-white text-l overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",children:e?.map(((e,t)=>o("div",{className:u("flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",{"bg-main-divider":r===t}),role:"listitem",onMouseDown:()=>n(e),children:o("span",{className:"min-h-6",children:e.processedValue})},t.toString())))})}));function kl({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),h=s(t),[p,g]=a([]),f=_n(),y=Cl[n],x=r((()=>{h.current=t,f.close()}),[t]),b=r((e=>{x(),h.current=e.processedValue,c?.(e.processedValue),d?.(e)}),[x,c]),v=s(null),N=l((()=>async e=>{if(!y)return;const t=await Nl({url:y.url,responseItemHandler:y.responseItemHandler,requestData:{...y?.requestData},query:e,queryPrefix:m});t?.length&&g(t)}),[m]),w=l((()=>((e,t=600)=>{let n;const a=(...i)=>{a.dispose(),n=setTimeout((()=>{e(...i)}),t)};return a.dispose=()=>{n&&clearTimeout(n)},a})(N,300)),[N]);return i((()=>{if(!e||!v.current||h.current===t)return void x();const n=v.current,{top:a,left:i,width:r,height:l}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.open({popup:o(Sl,{options:p,container:n,value:t,onChange:b}),top:a+globalThis.scrollY+l,left:i,width:r})}),[e,p,t,b]),v}const Il=d((({value:e="",onChange:t=pa,onDaDataChange:n,name:a="",daDataQueryPrefix:i,dadata:r=!1,...l})=>{const[s,{setFalse:c,setTrue:d}]=un(),m=kl({isOpen:s&&r,name:a,value:e,daDataQueryPrefix:i,onChange:t,onDaDataChange:n});return o(ga,{value:e,onChange:t,inputRef:m,isOpen:s,onOpen:d,onClose:c,...l})})),Tl=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",a=e(n).value,i=r((t=>{e?.(n)?.onChange?.(Pl(t))}),[]),l=r((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(Il,{disabled:vi(e,t,n),label:"Адрес",...e(n),value:a?.fullAddress,onChange:l,...t,onDaDataChange:i})})),Pl=e=>({apartment:e?.data?.flat,city:e?.data?.city,district:e?.data?.area_with_type,fullAddress:e?.unrestricted_value,fiasCode:e?.data?.fias_id,house:e?.data?.house,locality:e?.data?.settlement_with_type,okatoRegionCode:e?.data?.okato,postcode:e?.data?.postal_code,region:e?.data?.region,regionCode:e?.data?.region_kladr_id?e?.data?.region_kladr_id.substring(0,2):"",street:e?.data?.street,qc:e?.data?.qc,qcComplete:e?.data?.qc_complete,qcHouse:e?.data?.qc_house}),El=Yt((({field:e,input:t,source:n})=>{const[l,s]=a(""),c=e("addressCourier")?.value,d=c?.locality,m=c?.city;i((()=>{!m&&!d||n?.deliveryCities?.includes(m)?s(""):(e?.("addressCourier")?.onChange?.({...c,house:""}),s("Город недоступен для доставки"))}),[m,d,n]);const u=r((t=>{e?.("addressCourier")?.onChange?.(Pl(t))}),[]),h=r((t=>{e?.("addressCourier")?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(Il,{label:"Адрес",...e("addressCourier"),value:c?.fullAddress,onChange:h,...t,error:l||e("addressCourier")?.error,onDaDataChange:u})})),Dl=d((({field:e,input:t})=>{const n="addressFact",a=e(n).value,{value:l}=e("addressMatch");i((()=>{l&&e("addressFact")?.onChange?.(e("addressRegistration").value)}),[l,e("addressRegistration").value]);const s=r((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=r((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(Il,{label:"Адрес",disabled:l,...e(n),value:a?.fullAddress,onChange:c,...t,onDaDataChange:s})})),Rl=d((({field:e,input:t})=>o(pi,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...e(t?.name??"")}))),_l=d((({value:e,subText:t,children:n,isPhone:a,...i})=>{const r=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[r.length,n,t].every((e=>!e))?null:Al({textItems:r,subText:t,children:n,isPhone:a,...i})})),Al=({label:e,labelSize:t="text-m",textItems:n,subColor:a,subText:i,className:r,children:l,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",r),children:[e?o(Le,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,l||Ol(n,s),i?o(Le,{color:a,size:"text-m",children:i}):null]}),Ol=(e,t)=>e.filter(Boolean).map(((e,n)=>o(Le,{size:"text-l",children:t?o("a",{href:`tel:${Ml(e)}`,children:e.trim()}):e.trim()},String(n)))),Ml=e=>e.replace(/\D/g,""),Bl=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}))),Fl=d((({className:e,children:t})=>o("span",{className:u("inline-flex items-center text-start gap-s group-[]/btn-embedded:text-primary-main",e),children:t}))),zl=d((({isUnfolded:e,...t})=>o(G,{name:e?"ArrowUpIcon":"ArrowDownIcon",size:"small",iconVersion:"",...t}))),Ll=d((({className:e,isUnfolded:t,short:n,label:a=(t?"Скрыть":"Развернуть"),embedded:i,...r})=>c(Dr,{className:u({"w-full":!n},e),embedded:i,shape:n?"default":"square",role:"tab","aria-label":"Кнопка сворачивающейся секции",...r,children:[o(Fl,{children:a}),o(zl,{isUnfolded:t,iconVersion:i?"color":""})]}))),Vl=d((({className:e,role:t="tablist",children:n})=>o("div",{className:u(e),role:t,children:n})));const $l=d((({className:e,isUnfolded:t,isOverflowVisible:n=!1,children:a})=>{const r=s(null),l=function(e,t){const n=s(null);return i((()=>{const t=n?.current;if(!t)return;const a=new ResizeObserver((n=>{e(t,n[0])}));return a.observe(t),()=>{a.disconnect()}}),[e,...t]),n}((e=>{r.current&&(r.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:r,className:u("transition-max-h duration-300",n&&t?"overflow-clip":"overflow-hidden",{"max-h-0":Boolean(r.current||!t)}),role:"tabpanel","aria-label":"Сворачивающаяся секция",children:o("div",{className:e,ref:l,children:a})})})),jl=d((({children:e})=>{const[t,{toggle:n}]=un(!1);return c("div",{children:[o("div",{className:"hidden sm:block",children:e}),c(Vl,{className:"block sm:hidden",children:[o($l,{isUnfolded:t,children:e}),o(Ll,{className:"my-m mr-m border-b border-solid border-main-divider",label:t?"Скрыть":"Подробнее",isUnfolded:t,embedded:!0,onClick:n})]})]})})),ql=e=>{const t=Wl(e);return o(_l,{label:"Режим работы",value:t,className:"max-w-none"})},Ul=({workTime:e="",lunchHour:t="",daysOff:n=""},a=!1)=>e?[`${a?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",Wl=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))),a=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[Ul({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":a}),Ul({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:a},!0)].filter(Boolean)},Hl=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],Yl=e=>Hl.map((([t,n,a])=>({key:t,title:a,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??"")}}))),Gl=e=>{if(!e)return null;const t=Kl(e);return c(Bl,{className:"border-none",children:[o(_l,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(Xl)})}),o(_l,{label:"Режим работы",className:"max-w-none",children:o(Le,{children:e})})]})},Kl=e=>{const t=Hl.map((([,e])=>({short:e,status:!0}))),n=e.split("/")??[],a=n[n.length-1]?.toLowerCase();return a?.includes("выходной")?t.map((e=>({...e,status:!a?.includes(e.short.toLowerCase())}))):t},Xl=({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(Le,{size:"text-xs",children:e})},String(n)),Jl=({currency:e,buyExchangeRate:t,saleExchangeRate:n},a)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(_l,{label:"Валюта",value:e.currency}):null,t?o(_l,{label:"Купить",value:String(t)}):null,n?o(_l,{label:"Продать",value:String(n)}):null]},String(a)),Zl={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"}},Ql=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",Zl[n].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(ie,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(Le,{size:"text-m",color:Zl[n].text,children:t})]}))),es=(new Date).getDay(),ts=e=>{const[t]=e?.slice(es-1)??[];if(!t)return null;const{lunchHour:n,status:a,workTime:i,hasLunch:r}=t;return a?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[i?o(Ql,{color:"green",children:i}):null,n&&r?o(Ql,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(Ql,{color:"red",children:"Выходной"})},ns=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",as=({title:e,status:t,workTime:n,lunchHour:a,hasLunch:i},r)=>o(_l,{label:e,value:t&&n?n:"",subText:ns({lunchHour:a,hasLunch:i,status:t}),subColor:!t||i?"text-error":"text-green-dark"},String(r)),is=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,rs=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,ls=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,ss=(e,t)=>{if(!e.workSchedule)return null;const n=Yl(e.workSchedule);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(Le,{size:"text-h4",children:e.name}),e.address?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(G,{name:"GeolocationIcon",width:"24",height:"24"}),o(Le,{size:"text-l",children:e.address})]}):null]}),ts(n)]}),o(jl,{children:os(e)})]},String(t))},os=({phone:e,fax:t,phoneBusiness:n,phoneNatural:a,phoneCallCentre:i,phoneCurrencyControl:r,workSchedule:l,exchangeRate:s})=>{const d=Yl(l),m=l?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(Bl,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(_l,{label:"Факс",value:t,isPhone:!0}),o(_l,{label:"Телефон филиала",value:e,isPhone:!0}),o(_l,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(_l,{label:"Обслуживание физических лиц",value:a,isPhone:!0}),o(_l,{label:"Для консультаций по валютному контролю",value:r,isPhone:!0}),o(_l,{label:"Контакт-центр",value:i,isPhone:!0})]}),l?.isMatchesPattern?o(Bl,{children:o(_l,{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(as)})})}):c(Bl,{children:[o(_l,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(Xl)})}),ql(d)]}),l?.businessScheduleVisibleTag?Gl(l?.businessScheduleDescription):null,s?.currencies?.length?o(Bl,{className:"flex-wrap",children:s?.currencies?.map(Jl)}):null]})},cs=({name:e="",address:t="",workSchedule:n})=>{const a=(i=e)?`${i?.charAt(0)?.toUpperCase()}${i?.slice(1)}`:"";var i;const r=`${t} ${(e=>{const t=Yl(e),n=e?Wl(t):"",a=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?is(n):ls(n,a):rs(n):""})(n)}`;return{header:a,body:r}},ds={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1,billAcceptorEnable:!1,workAllTime:!1,terminalTypeTerm:!1,terminalTypeAtms:!1},ms={billAcceptorEnable:"Прием наличных",bullionOperations:"Операции со слитками",buyingCoins:"Покупка монет из драгоценных металлов",designDisabledPeople:"Для слабовидящих",locationDisabledPeople:"Для маломобильных",preciousMetalsOperations:"Операции с драгоценными металлами",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",remoteWorkplace:"Удаленное рабочее место",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",sellingCoins:"Продажа монет из драгоценных металлов",safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",serviceDisabledPeople:"Для маломобильных граждан",workAllTime:"Круглосуточно",workingSaturday:"Открыты по субботам"},us={...{terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable),locationDisabledPeople:e=>Boolean(e.locationDisabledPeople),designDisabledPeople:e=>Boolean(e.designDisabledPeople)},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)},hs=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>us[t](e)))))},ps=()=>{},gs=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:a=ps,getBalloonRemoteWorkplaces:i=ps})=>{const[r,s,o,c]=l((()=>{const r=hs(e,n),l=hs(t,n),s=[...r.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:a(e)}))),...l.map((e=>({type:"workplaces",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:i({address:e.address,workScheduleDescription:e.workScheduleDescription})})))].filter((e=>e.coords&&2===e.coords.length));return[r,s,l,r.length+l?.length]}),[e,t,n,a,i]);return{filteredItems:r,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},fs=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),ys=d((({children:e})=>fs?e:null)),xs="/icons/MapMarkerClusterIcon.svg",bs="/icons/MapMarkerClusterYellowIcon.svg";function vs({yandexMaps:e,map:t,points:n,isLoad:a}){if(a||!n)return;if(t.geoObjects.removeAll(),!n.length)return;const i=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),r=Ns("offices",e,i);if(n.length&&n.every((e=>"type"in e))){const a=Ns("workplaces",e,i),l=ws(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=ws(n.filter((e=>"offices"===e.type)),"offices",e);r.add(s),a.add(l),t.geoObjects.add(a),t.geoObjects.add(r)}else{const a=ws(n,"offices",e);r.add(a),t.geoObjects.add(r)}t.setBounds(e.util.bounds.fromPoints(n.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const Ns=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?xs:bs,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),ws=(e,t,n)=>e.map((({coords:e,content:a})=>new n.Placemark(e,{balloonContentHeader:a?.header,balloonContentBody:a?.body,balloonContentFooter:a?.footer,hintContent:a?.hint},{iconLayout:"default#image",iconImageHref:"offices"===t?xs:bs,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),Cs={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},Ss={...Cs,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},ks=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(Ss).join(" ")} ${n}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.current.geoObjects.add(t.geoObjects)}))},children:o(G,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),Is=e=>globalThis[e];function Ts(e,t,n=!0){const[r,l]=a(void 0);return i((()=>{let a=!0;return((e,t,n=!1)=>{const a=globalThis.document.getElementById(t);if(a){const t=Is(e);return t?Promise.resolve(t):new Promise((t=>{a.addEventListener("load",(()=>{t(Is(e))}))}))}return new Promise(((a,i)=>{const r=globalThis.document.createElement("script");r.src=t,r.async=!0,r.id=t,n&&(r.type="module"),r.addEventListener("load",(()=>{a(Is(e))})),r.addEventListener("error",(e=>{i(e)})),globalThis.document.head.appendChild(r)}))})(e,t).then((e=>{a&&l(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(a=!1,n){const e=globalThis.document.getElementById(t);e&&globalThis.document.head.removeChild(e),l(void 0)}}}),[e,t,n]),r}const Ps={...Cs,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},Es=d((({yandexMaps:e,direction:t="in"})=>{const n="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const n=e.current.getZoom(),a="in"===t?n+1:n-1;e.current.setZoom(a,{checkZoomRange:!0})},className:`${Object.values(Ps).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(G,{name:n,width:"20",height:"16"})})})),Ds=[55.753995,37.614069],Rs=d((({points:e,className:t="",zoom:n=5,isLoad:a,selectedAddress:r})=>{const l=s(null),d=s(null),m=Ts("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${A.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1);if(i((()=>{l.current?vs({yandexMaps:m,map:l.current,points:e,isLoad:a}):m?.ready((()=>{l.current||(l.current=new m.Map(d.current,{center:_s(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),vs({yandexMaps:m,map:l.current,points:e,isLoad:a})})),l.current&&r&&m?.geocode(r).then((e=>{const t=e.geoObjects.get(0).geometry.getCoordinates();l.current.setCenter(t),l.current.setZoom(18)}))}),[m,e,n,a,r]),!m)return null;const h="z-10";return c("div",{ref:d,className:u("relative","w-full",t),children:[a?o(Vr,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(Es,{yandexMaps:l}),o(Es,{yandexMaps:l,direction:"out"})]}),ks(l,m,u("right-2 top-80",h))]})})),_s=e=>{const t=[Os(As(e,0)),Os(As(e,1))];return t.every((e=>e))?t:Ds},As=(e,t)=>e.map((e=>e.coords?.[t])),Os=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,Ms=e=>Number(e.toString().replace(",",".")),Bs=e=>{const{data:t,error:n}=Kn(`/light-api-cash/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,Fs);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},Fs=async e=>await Lt(e,{method:"POST"})||[],zs=d((({field:e,input:t})=>{const[n,r]=a([]),{data:l}=Bs("REGION_RF"),s=e("regionRetail")?.value||{},d=e(t?.name??"");i((()=>{(async()=>{const e=await(async e=>{const t=await fl("/public-data/regionOffices","POST",{regionRfCd:{key:e},cashCardFlg:!0});return t?.offices?.map((e=>({...e,gpsLatitude:Ms(e.latitude??Ds[0]),gpsLongitude:Ms(e.longitude??Ds[1])})))||[]})(s?.key??"");r(e)})(),s?.key&&d.onChange?.("")}),[s.key]);const{points:m}=gs({data:n,filtrationState:{},getBalloon:cs});return c("div",{children:[o(Ln,{label:"Адрес отделения",placeholder:"Выберите отделение",options:n.map((({id:e,address:t=""})=>({key:e?.toString()||"",text:t}))),...d,isSearch:!0}),o("div",{className:"h-[600px]",children:o(ys,{children:o(Rs,{points:m,isLoad:!l,className:"h-full",selectedAddress:d?.value?.text})})})]})}));function Ls(e,t){for(const[n,a]of e.entries())null!=a?t.setItem(n,a):t.removeItem(n)}function Vs(e,t){return Ls(e,t),Ls(t,e),e.bus.watch((({type:e,event:n})=>{null!=n?t.setItem(e,n):t.removeItem(e)}))}class $s{storage;bus;get size(){return this.storage?.length??0}constructor(e,t=new he){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)}}class js{bus;store=new Map;get size(){return this.store.size}constructor(e=new he){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)}}const qs={};function Us(e,t=qs){const n=s(null),o=function(){const[,e]=a(0);return r((()=>e((e=>(e+1)%65536))),[])}();return i((()=>e.bus.watch((e=>{n.current?.has(String(e.type))&&o()}))),[e,o]),l((()=>new Proxy(t,{get:(t,a)=>(n.current||=new Set,n.current.add(a),e.getItem(a)),has:(t,a)=>(n.current||=new Set,n.current.add(a),e.hasItem(a)),set:(t,n,a)=>(e.setItem(n,a),!0),deleteProperty:(t,n)=>(e.removeItem(n),!0)})),[e])}const Ws=new js;function Hs(e){return Us(Ws,e)}Vs(Ws,new $s(globalThis?.localStorage));const Ys=()=>Hs(),Gs=Yt((({field:e,source:t,fieldName:n,placeholder:a="Выберите из списка",options:i,...r})=>{const l=t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(Ln,{placeholder:a,options:l,...e(n),...r})})),Ks=d((({field:e,input:t})=>{const{data:n}=Bs("EMPLOYEES_NUMBER"),a=Ys();return i((()=>{n&&(a.amountWorkers=n)}),[n]),o(Gs,{field:e,source:a.amountWorkers??[],label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),Xs=d((({field:e,input:t})=>o(pi,{text:"Наличие военного билета",...e(t?.name??"")}))),Js=d((({field:e,input:t})=>o(Il,{label:"Код представителя Банка",placeholder:"Введите код",isInteger:!0,...e(t?.name??""),...t}))),Zs=d((({field:e,input:t})=>o(pi,{text:"В отношении меня ведётся производство по делу о банкротстве",...e(t?.name??"")}))),Qs=d((({field:e,input:t})=>o(Ka,{label:"Дата начала работы на текущем месте",...e(t?.name??""),...t,disabled:vi(e,t),maxDate:new Date}))),eo=d((({field:e,input:t})=>o(Il,{label:"Место рождения",...e(t?.name??""),...t,disabled:vi(e,t)})));function to(e){const t=globalThis.localStorage?.getItem(e),[n,i]=a(t?(e=>{try{return JSON.parse(String(e))}catch(e){return null}})(t):null);return[n,r((t=>{i((n=>{const a=t instanceof Function?t(n):t;return globalThis.localStorage?.setItem(e,JSON.stringify(a)),a}))}),[e])]}const no=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black"})=>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(G,{name:t,width:"24",height:"24",iconVersion:n})}),o("div",{className:"",children:o(Fe,{__html:e})})]}))),ao=d((({field:e,input:t})=>{const[n,r]=a([]),[s]=to("programId"),{value:d,onChange:m}=e("cardCategory"),u=e("paymentSystem")?.value?.key;i((()=>{u&&s&&(async()=>{const e=await(async(e,t)=>{const n=await fl("/dictionaryFiltered","POST",{type:"CARD_TYPE",presets:{paymentSystemTypeCd:e,creditProgramId:t}});return Array.isArray(n)?n:[]})(u,s);r(e),io(e,d)||m&&m(null)})()}),[u]);const h=l((()=>n?.find((e=>e.key===d?.key))?.description),[n,d]);return c("div",{children:[o(Gs,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t}),h?o(no,{__html:h}):null]})})),io=(e,t)=>e.some((e=>e.key===t?.key)),ro=d((({field:e,input:t})=>o(Il,{label:"Количество детей до 18 лет",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),lo=d((({field:e,input:t})=>o(Il,{label:"Кодовое слово",...e(t?.name??""),...t}))),so=d((({field:e,input:t})=>{const{data:n}=Bs("INCOME_CERT_UNITED"),a=vi(e,t);return c("div",{className:"space-y-xl",children:[a?o(no,{__html:"Для выбора иного способа подтверждения дохода, оформите новую заявку на кредит без авторизации на портале Госуслуги"}):null,o(Gs,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t,disabled:a})]})})),oo=d((({field:e,input:t})=>{const{data:n}=Bs("MILITARY_STATUS");return o(Gs,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),co=()=>Hs(),mo=d((({src:e,onClose:t,onDocumentRead:n})=>{const a=Ee();return c(_r,{className:"my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0 z-[101]",onClose:t,children:[a?o("img",{src:e}):o("iframe",{src:`${e}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"}),o(Dr,{className:"mx-auto mt-m",type:"button",onClick:()=>{n?.(),t?.()},children:"Ознакомиться"})]})})),uo=(e,t)=>{const{open:n}=Nn(mo),a=Ee();return r((async()=>{if(e){const i=URL.createObjectURL(await(async(e,t=!1)=>{const n=await yl(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return n?n.blob():new Blob})(e,a));n({src:i,onDocumentRead:t})}}),[n,e,a])},ho=d((({className:e,error:t,docId:n,...a})=>{const i=uo(n,(()=>a.onChange?.(!0)));return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(ci,{...a}),n?o(Dr,{embedded:!0,onClick:i,children:o(Fl,{children:"Ознакомиться"})}):null]}),Cn(t)]})})),po=d((({field:e,input:t})=>{const{productType:n}=co(),a=pl[n??""];return t&&t.name?o(ho,{text:a?.[t.name]?.text,docId:a?.[t.name]?.docId,...e(t.name)}):null})),go=Math.round(29.5),fo=d((({className:e,title:t,children:n,...a})=>c(g,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...a,children:[t?o(N,{className:"text-center",title:t}):null,n]}))),yo="flex flex-col justify-between lg:flex-row gap-4xl",xo="flex flex-col lg:w-1/2 gap-2xl",bo="flex flex-col gap-y-xl min-w-52",vo=d((({value:e,fractionDigits:t,fixed:n,prefix:a,postfix:i})=>o(Le,{size:"text-h3",children:"number"==typeof e?[a,Je(t,{fixed:n})(e),i].filter(Boolean).join(" "):e}))),No=d((({className:e,title:t,value:n,color:a="text-secondary-text",...i})=>c("div",{className:u("flex justify-between @xl:flex-col",e),children:[t?o(Le,{size:"text-l",font:"font-light",color:a,children:t}):null,n?o(vo,{value:n,...i}):o(Le,{size:"text-h3",children:"-"})]}))),wo=e=>So([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],e),Co=(e=[],t=!1,n=[])=>({...So([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),extraPercent:n.at(-1),extraPercents:n}),So=(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]},ko=(e,t=0)=>e?.sum?e.sum:t,Io=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,To=(e,t)=>e?o(w,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,Po=({min:e=0,max:t=0,availableMonths:n,...a})=>o(ca,{items:[`От ${Eo(e)}`,`До ${Eo(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...a}),Eo=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,Do=({items:e,title:t,orientation:n="horizontal",value:a,onChange:i,...r})=>c("div",{className:"grid gap-s whitespace-nowrap lg:sm:col-span-1 col-span-2",children:[t?o("div",{role:"radiogroup","aria-label":t,children:o(Le,{color:"text-secondary-text",font:"font-light",children:t})}):null,o(xr,{orientation:n,items:e,value:e[a?0:1].id,onChange:t=>i&&i(t===e[0].id),...r})]}),Ro=e=>Do({...e,title:"Тип платежа",orientation:"vertical",className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),_o=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...a})=>o(ca,{items:e?[`От ${Je(1)(a.min||0)} ${n}`,`До ${Je(1)(a.max||0)} ${n}`]:[],step:t,...a}),Ao=({field:e,defParams:t,calcParams:n,map:a,monthsValue:i="maxMonths"})=>{Object.entries(a).forEach((([n,a])=>{e?.(n)?.onChange?.(t?.[a])})),e?.("monthsValue")?.onChange?.(ia(t?.[i],n.minMonths,n.maxMonths))},Oo=(e,t)=>{const{isAnnuity:n,moneyValue:a,monthsValue:i,moneyExtra:r}=t;if(0===e)return 0;if(n){const t=e/1200;return r?(a+r)*(t+t/(Math.pow(1+t,i)-1)):a*(t+t/(Math.pow(1+t,i)-1))}return Math.round(a/i)+a*(e/1200)},Mo=e=>e,Bo=(e=Mo)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),Fo=Bo(),zo=(e=Mo)=>Bo((t=>-e(t))),Lo=zo(),Vo=([e,t],n,a=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:$o([e,t],a),$o=([e,t],n=[])=>({[e]:n.length?Lo(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?Fo(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),jo=(e,[t,n],a)=>e>=a[t]&&e<=a[n],qo={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Uo=e=>Wo({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Wo({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&Wo({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&Wo({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Wo=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],Ho=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,r=t?.rateRows||[qo],l=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Uo({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=Vo(["minSum","maxSum"],l,r),{minMonths:c,maxMonths:d}=Vo(["minMonths","maxMonths"],l,r),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i})=>e?.find((e=>Uo({row:e,userInputParams:t,paramsViewSettings:n})&&jo(a,["minSum","maxSum"],e)&&jo(i,["minMonths","maxMonths"],e)))||qo)({rateRows:r,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i}),{rate:u}=m,h=Oo(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:a,monthsValue:i,monthlyPayment:h}},Yo=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),Go={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},Ko=Yt((({className:e,title:t,calcSource:n,buttons:a,footnote:l,paramsViewSettings:s,defaultParams:d,onChange:m,...h})=>{const p=wo(n?.rateRows),g=r((e=>{const t=Ho(e,n,s);m?.({...e,monthlyPayment:t.monthlyPayment,rate:p?.rate??0})}),[s,n]),[f,{field:y}]=bn({moneyValue:ko(d,2e5),monthsValue:Io(d,go),monthlyPayment:0,rate:0,isAnnuity:Boolean(d?.isAnnuity),isInsurance:Boolean(d?.isEnableInsurance),isSalaryClient:Boolean(d?.isEnableSalaryClient),isPensionClient:Boolean(d?.isEnablePensionClient),isStateEmployee:Boolean(d?.isEnableStateEmployee)},{onChange:g}),x=Ho(f,n,s),b=Ro({...y("isAnnuity")}),{onChange:v}=y("moneyValue"),{onChange:N}=y("monthsValue");return i((()=>{v&&v(ia(f.moneyValue,x.minSum,x.maxSum))}),[x.minSum,x.maxSum]),i((()=>{N&&N(ia(f.monthsValue,x.minMonths,x.maxMonths))}),[x.minMonths,x.maxMonths]),i((()=>{!Yo(d)&&p&&Ao({field:y,defParams:p,calcParams:x,map:Go,monthsValue:"minMonths"})}),[n,d]),o(fo,{className:e,title:t,...h,children:c("section",{className:u(yo,e),children:[c("div",{className:xo,children:[_o({title:"Сумма кредита, ₽",step:500,min:x.minSum,max:x.maxSum,...y("moneyValue"),value:x.moneyValue}),Po({title:"Срок кредита, месяцев",min:x.minMonths,max:x.maxMonths,...y("monthsValue"),value:x.monthsValue}),Xo({...x,...s},y),o("div",{className:"sm:hidden",children:b})]}),c("div",{className:u(bo,"@4xl:w-1/2"),children:[o(No,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(No,{title:"Ставка от",value:p?.rate,fractionDigits:2,postfix:"%"}),o(No,{title:"Ежемесячный платёж",value:x.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:b}),Ye(a,{isVertical:!0}),To(l)]})]})})})),Xo=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(ci,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(ci,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(ci,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(ci,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),Jo="calculator",Zo=d((({field:e,params:t})=>{const n=r((t=>{e(Jo).onChange?.(t)}),[]);return o(Ko,{...t?.calcData,padding:"p-0",defaultParams:ec(e(Jo).value),onChange:n})})),Qo={moneyValue:"sum",monthsValue:"period",isInsurance:"isEnableInsurance",isPensionClient:"isEnablePensionClient",isStateEmployee:"isEnableStateEmployee",isSalaryClient:"isEnableSalaryClient",isAnnuity:"isAnnuity"},ec=(e,t=!1)=>{const n=t?tc(Qo):Qo;return Object.fromEntries(Object.entries(e??{}).map((([e,t])=>[n[e],t])))},tc=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[t,e]))),nc=d((({field:e,input:t})=>{const{data:n}=Bs("CREDIT_IN_RSHB");return o(Gs,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /\n вкладчиком с долей участия более 20% уставного капитала руководителем,\n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t,disabled:!e?.("shareholderFlg")?.value})})),ac={17:"amur_debit_card",16:"owner_debit_card",18:"pansion_debit_card",38:"salary_debit_card",40:"vordi_debit_card",42:"eco_debit_card",43:"junior_debit_card",44:"appetit_debit_card"},ic=d((({className:e,label:t,error:n,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(xr,{label:wn({label:t,errors:a?.errors}),...a}),Cn(n)]}))),rc=[{id:"810",text:"Рубли"}],lc=d((({field:e,input:t})=>{const{data:n}=Bs("CURRENCY"),{programId:a}=co(),i=l((()=>!Object.keys(ac).includes(a||"")||"38"===a),[]),r=l((()=>i?rc:n?.map((e=>({id:e.key??"",text:e.description})))),[n]);return o(ic,{label:"Валюта",orientation:"horizontal",items:r,...e(t?.name??"")})})),sc=(e,t)=>{if(!t)return null;const n=mc(e),a=+t?.split(".")[0],i=+t?.split(".")[1];switch(a){case 1:return n("AGRICULTURE");case 35:return n("FUEL_AND_ENERGY");case 41:case 42:case 43:return n("CONSTRUCTION");case 46:case 47:return n("TRADE");case 55:case 79:return n("TOURISM");case 62:return n("TECHNOLOGY");case 63:return n("CONSULTING_SERVICE");case 64:return n("BANK");case 65:return n("INSURER");case 66:return n("FINANCIAL_INSTITUTIONS");case 72:case 74:return n("SCIENCE");case 80:return n("SECURITY");case 84:return n(i<22?"GOVERNANCE":22===i?"ARMY":"OTHER_SECTORS");case 85:return n("EDUCATION");case 86:return n("HEALTHCARE");case 87:return n("SOCIAL_SPHERE");default:return n(a>=10&&a<=33?"INDUSTRY":a>=5&&a<=9?"FUEL_AND_ENERGY":a>=49&&a<=53?"TRANSPORT":"OTHER_SECTORS")}},oc=(e,t)=>{if(!t)return null;const[n]=[e?.find((e=>t<=Number(e.description)))].map((e=>({key:e?.key??"",text:e?.value??""})));return n},cc=(e,t)=>{const n=mc(e);return[40001,40002,71610].includes(t)?n("FOREIGN"):n("RUSSIAN")},dc=(e,t,n)=>{const a=mc(e);return a("7725114488"===n?"RSHB":50102===t?"SOLE_TRADER":t>=75e3&&t<=75505&&75500!==t?"BUDGETARY":"COMMERCIAL")},mc=e=>t=>e.map((e=>({key:e.key,text:e.value}))).find((e=>e.key===t))??null,uc=(e,t,n)=>{const{okved:a,okopf:i,inn:r,organizationName:l}=hc(n);t?.("legalForm")?.onChange?.(n.data?.opf?.short),t?.("organizationAddress")?.onChange?.(Pl(n.data?.address));const s={amountWorkers:oc(e?.amountWorkers,n.data?.employee_count),employerActivities:sc(e?.employerActivities??[],a),organization:dc(e?.organization??[],i,r),employerOrganization:cc(e?.employerOrganization??[],i),organizationName:l};for(const e in s)s[e]&&t?.(e)?.onChange?.(s[e])},hc=e=>({inn:e.data?.inn??"",okopf:Number(e.data?.opf?.code),okved:e.data?.okved??"",organizationName:e.data?.name?.short_with_opf??""}),pc=d((({field:e,input:t})=>{const n=Ys(),{employerActivities:a,employerOrganization:l,organization:s,amountWorkers:c}=n,d=e?.("esiaAccountTypeCd")?.value,m=e?.("inn")?.value,u=r((t=>{uc(n,e,t)}),[]);return i((()=>{d&&m&&gc(n)&&(async()=>{const t=await(async e=>{const t=await Nl({url:"suggest/party",query:e});return t?.[0]})(m);t&&uc(n,e,t)})()}),[a,l,s,c]),o(Il,{label:"ИНН",isInteger:!0,maxLength:12,...t,...e(t?.name??""),onDaDataChange:u,disabled:vi(e,t)})})),gc=e=>{const{employerActivities:t,employerOrganization:n,organization:a,amountWorkers:i,productType:r}=e;return[n,a,i,"creditCard"!==r||t].every(Boolean)},fc=d((({field:e,input:t})=>o(Ka,{label:"Дата доставки",...e(t?.name??""),minDate:new Date}))),yc=d((({field:e,input:t})=>{const{data:n}=Bs("COURIER_DELIVERY_TIME"),a=l((()=>n?.map((e=>({id:e.key,text:e.value})))??[]),[n]);return o(ic,{label:"Время доставки",className:"flex-row",items:a,...e(t?.name??"")})})),xc=d((({field:e,input:t})=>o(Il,{label:"Количество иных иждивенцев",placeholder:"За исключением детей до 18 лет",isInteger:!0,maxLength:2,...e(t?.name??""),...t}))),bc=d((({field:e,input:t})=>{const n=e("limitedBirthday")?.value,a=l((()=>new Date(n?.getFullYear()+14,n?.getMonth(),n?.getDate())),[n]);return o(Ka,{label:"Дата выдачи",...e(t?.name??""),disabled:vi(e,t),minDate:a})})),vc=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("dulSubdivisionCode"),i=r((e=>{a?.(e?.data?.code?.replace("-",""))}),[]);return o(Il,{disabled:vi(e,t),label:"Кем выдан",...t,...e(t?.name??""),onDaDataChange:i,daDataQueryPrefix:n})})),Nc=d((({field:e,input:t})=>o(Il,{disabled:vi(e,t),label:"Номер документа",isInteger:!0,maxLength:6,...e(t?.name??"")}))),wc=d((({field:e,input:t})=>o(Il,{disabled:vi(e,t),label:"Серия документа",isInteger:!0,maxLength:4,...e(t?.name??"")}))),Cc=d((({field:e,input:t})=>{const n=r((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(Il,{disabled:vi(e,t),label:"Код подразделения",isInteger:!0,maxLength:6,...t,...e(t?.name??""),onDaDataChange:n})})),Sc=d((({field:e,input:t})=>{const{data:n}=Bs("EDUCATION_LEVEL");return o(Gs,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),kc=d((({field:e,input:t})=>o(Il,{label:"Электронная почта",...e(t?.name??""),...t}))),Ic=d((({field:e,input:t})=>{const{data:n}=Bs("ORGANIZATION_ACTIVITY_TYPE"),a=Ys();return i((()=>{n&&(a.employerActivities=n)}),[n]),o(Gs,{field:e,source:a.employerActivities??[],label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),Tc=d((({field:e,input:t})=>{const{data:n}=Bs("ORGANIZATION_KIND"),a=Ys();return i((()=>{n&&(a.employerOrganization=n)}),[n]),o(Gs,{field:e,source:a.employerOrganization??[],label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),Pc=d((({field:e,input:t})=>{const{data:n}=Bs("EMPLOYMENT_INFO_UNITED");return o(Gs,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),Ec=d((({field:e,input:t})=>o(Il,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),Dc=d((({field:e,input:t})=>{const n=r((n=>e(t?.name??"")?.onChange?.(String(ia(Number(n),0,5)))),[]);return o(Il,{label:"Стаж",placeholder:"За последние 5 лет",type:"number",...e(t?.name??""),...t,onChange:n,disabled:vi(e,t)})})),Rc=d((({field:e,input:t})=>{const{value:n,onChange:a}=e(t?.name??""),r=e("familyStatus")?.value?.key,l="MARRIED"===r?2:1,s=Number(e("children")?.value),c=Number(e("dependents")?.value),d=l+s+c;return i((()=>{a?.(d)}),[r,s,c]),o(Il,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:n,onChange:a})})),_c=d((({field:e,input:t})=>{const{data:n}=Bs("MARITAL_STATUS");return o(Gs,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),Ac=d((({field:e,input:t})=>o(Il,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",...e(t?.name??""),...t,disabled:vi(e,t)}))),Oc=d((({field:e,input:t})=>{const{data:n}=Bs("HOUSE_TYPE");return o(Gs,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),Mc=d((({input:e})=>o(no,{__html:e?.label}))),Bc=d((({field:e,input:t})=>o(pi,{text:"Я планирую в ближайшее время инициировать дело о банкротстве в отношении себя",...e(t?.name??"")}))),Fc=d((({field:e,input:t})=>o(Il,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",isInteger:!0,maxLength:2,...e(t?.name??""),...t,disabled:vi(e,t)}))),zc=d((({field:e,input:t})=>o(Il,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,...e(t?.name??""),...t,disabled:vi(e,t)}))),Lc=/^[\u0041-\u005A\u0061-\u007A\s]+$/u,Vc=(e="")=>Lc.test(e),$c=e=>{const t={"А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ё":"E","Ж":"ZH","З":"Z","И":"I","Й":"I","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"KH","Ц":"TS","Ч":"CH","Ш":"SH","Щ":"SHCH","Ъ":"IE","Ы":"Y","Ь":"","Э":"E","Ю":"YU","Я":"YA","":"","а":"A","б":"B","в":"V","г":"G","д":"D","е":"E","ё":"E","ж":"ZH","з":"Z","и":"I","й":"I","к":"K","л":"L","м":"M","н":"N","о":"O","п":"P","р":"R","с":"S","т":"T","у":"U","ф":"F","х":"KH","ц":"TS","ч":"CH","ш":"SH","щ":"SHCH","ъ":"IE","ы":"Y","ь":"","э":"E","ю":"YU","я":"YA",".":".",",":",","-":"-"," ":" "};return e.replace(/[А-ЯЁа-яё,. -]/g,(e=>t[e.toLowerCase()].toUpperCase()||""))},jc=d((({field:e,input:t})=>{const n=e("latinSurname")?.value,a=e("name")?.value,l=e("latinName")?.onChange;i((()=>{l?.($c(a))}),[]);const s=r((e=>{(Vc(e)||0===e.length)&&l?.(e.toUpperCase())}),[]);return o(xa,{label:"Имя",placeholder:"Имя латинскими буквами",maxLength:Math.max(20-n?.length,1),...e(t?.name??""),onChange:s,...t})})),qc=d((({field:e,input:t})=>{const n=e("latinName")?.value,a=e("surname")?.value,l=e("latinSurname")?.onChange;i((()=>{l?.($c(a))}),[]);const s=r((e=>{(Vc(e)||0===e.length)&&l?.(e.toUpperCase())}),[]);return o(xa,{label:"Фамилия",placeholder:"Фамилия латинскими буквами",maxLength:Math.max(20-n?.length,1),...e(t?.name??""),onChange:s,...t})})),Uc=d((({field:e,input:t})=>o(Il,{label:"Наименование юридического лица",...t,...e(t?.name??""),disabled:!e?.("shareholderFlg")?.value}))),Wc=d((({field:e,input:t})=>o(Il,{label:"ОПФ",placeholder:"ООО, ПАО и др.",...e(t?.name??""),...t}))),Hc=d((({field:e,input:t})=>o(Ka,{label:"Дата рождения",...e(t?.name??""),disabled:vi(e,t)}))),Yc=d((({field:e,input:t})=>o(Il,{label:"Обязательные выплаты",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),Gc=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],Kc=d((({field:e,input:t})=>o(ic,{orientation:"horizontal",items:Gc,...e(t?.name??"")}))),Xc=d((({field:e,input:t})=>{const n=r((t=>{(Zr.test(t)||0===t.length)&&e("middleName")?.onChange?.(t)}),[e]);return o(Il,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:vi(e,t),...e(t?.name??""),...t,onChange:n})})),Jc=d((({field:e,input:t})=>{const n=r((t=>{(Zr.test(t)||0===t.length)&&e("name")?.onChange?.(t)}),[e]);return o(Il,{label:"Имя",maxLength:60,disabled:vi(e,t),...e(t?.name??""),...t,onChange:n})})),Zc=d((({field:e,input:t})=>{const{data:n}=Bs("ORGANIZATION_TYPE"),a=Ys();return i((()=>{n&&(a.organization=n)}),[n]),o(Gs,{field:e,source:a.organization??[],label:"Тип организации",fieldName:"organization",input:t})})),Qc=d((({field:e,input:t})=>{const n=Ys(),a=r((t=>{e?.("inn")?.onChange?.(t.data?.inn),uc(n,e,t)}),[]);return o(Il,{label:"Наименование организации",...t,...e(t?.name??""),disabled:vi(e,t),onDaDataChange:a})})),ed=d((({field:e,input:t})=>o(Il,{label:"Иные доходы",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),td=d((({field:e,input:t})=>o(Ka,{label:"Дата регистрации по месту жительства",...e(t?.name??""),maxDate:new Date}))),nd=d((({field:e,input:t})=>{const n=r((n=>e(t?.name??"")?.onChange?.(String(ia(Number(n),0,100)))),[]);return o(Il,{label:"Доля участия в бизнесе",placeholder:"в %",isInteger:!0,maxLength:3,...e(t?.name??""),...t,onChange:n})}));const ad=e=>e.map((e=>({key:e.type,text:e.name}))),id=e=>e?.key,rd=d((({field:e,input:t})=>{const[n,r]=a([]),s=Hs();var c;c=async()=>{const{programId:e}=s;if(e){const t=await(async e=>{const t=await fl("/public-data/creditProgramConditions","POST",{creditProgramId:e});return ad(t?.paymentSystems||[])})(e);r(t??[])}},i((()=>{const e=c();return()=>{e.then((e=>{e instanceof Function&&e()}))}}),[]);const d=l((()=>n?.map((e=>({id:e.key,text:e.text})))??[]),[n]);return o(ic,{label:"Платежная система",orientation:"horizontal",items:d,...e(t?.name??"",{format:id,parse:e=>n?.find((t=>t.key===e))})})})),ld=d((({field:e,input:t})=>{const{data:n}=Bs("POSITION");return o(Gs,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),sd=async()=>await fl("/public-data/regionsCardDelivery","GET")||void 0,od=d((({field:e,input:t})=>{const{programId:n,productType:a}=Ys(),{data:i}=Bs("REGION_RF"),{data:l}=Kn("regionsDelivery",sd),{data:s}=Bs(cd(a)),c="38"===n,d=i?.map((({key:e,value:t})=>({key:e,text:t}))),m="true"===s?.find((e=>"DELIVERY_ACTIVE"===e?.key))?.value,u=e("regionRetail")?.onChange,h=e("regionHasDelivery")?.onChange,p=e("methodObtain")?.onChange,g=r((e=>{const t=m&&l?.find((t=>t.regionCode===e.key))?.deliveryFlg&&!c;h?.(t),p?.(t?"courier":"office"),u?.(e)}),[l,m]);return o(Ln,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,options:d,...e(t?.name??""),onChange:g})})),cd=e=>"debitCard"===e?"DEBIT_CARD_LEAD_PROCESS_SETTINGS":"CREDIT_LEAD_PROCESS_SETTINGS",dd=d((({field:e,input:t})=>o(Il,{label:"Пенсионные доходы",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),md=["male","female"],ud=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],hd=d((({field:e,input:t})=>{const n=e("name")?.value,{value:a,onChange:r}=e("sex");return i((()=>{n&&!a&&(async()=>{const e=await(async e=>{const t=await Nl({url:"suggest/fio",requestData:{parts:["NAME"]},query:e}),n=t[0]?.data?.gender?.toLowerCase()||"";return md.includes(n)?n:""})(n);e&&r?.(e)})()}),[]),o(ic,{label:"Пол",orientation:"horizontal",items:ud,...e(t?.name??"")})})),pd=d((({field:e,input:t})=>o(pi,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...e(t?.name??"")}))),gd=d((({children:e,onChange:t,maxLength:n,...a})=>{const i=r((e=>n?e.length<=n&&t?.(_a(e,"___-___-___ __")):t?.(_a(e,"___-___-___ __"))),[t]),l=r((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(Tn,{...a,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>l(e?.target?.value||""),children:e})})),fd=d((({className:e,label:t,value:n,error:a,onChange:i,onBlur:r,...l})=>c("div",{className:u("shrink-0 w-full",e),children:[o(gd,{"aria-label":t,label:wn({label:t,errors:l?.errors}),valid:Boolean(!a),value:n,onChange:i,onBlur:r,placeholder:"___-___-___ __",...l}),Cn(a)]}))),yd=d((({field:e,input:t})=>o(fd,{label:"СНИЛС",maxLength:14,...e(t?.name??""),...t}))),xd=d((({field:e,input:t})=>{const n=r((t=>{(Zr.test(t)||0===t.length)&&e("surname")?.onChange?.(t)}),[e]);return o(Il,{label:"Фамилия",maxLength:60,disabled:vi(e,t),...e(t?.name??""),...t,onChange:n})})),bd=d((({field:e,input:t})=>o(Il,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),vd=d((({field:e,input:t})=>o(Il,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t,disabled:vi(e,t)}))),Nd={$ref:"/wcms-resources/delivery-cities-data.json"},wd={limitedBirthday:Hc,name:Jc,surname:xd,middleName:Xc,email:kc},Cd={processPersonalDataFlg:po,consentProviderFlg:po,consentOthersFlg:po,consentInformFlg:po,consentPfrFlg:po,consentInformMaterialsFlg:po,consentFATCA:po},Sd={organization:Zc,organizationAddress:Tl,organizationPhone:Mi,organizationName:Qc,legalForm:Wc,generalSeniority:Ac,lastJobExperience:zc,experience5Years:Dc,jobsNumber:Fc,beginDate:Qs,addressFact:Dl,addressRegistration:Tl,addressRetail:zs,addressMatch:Rl,sex:hd,birthPlace:eo,education:Sc,housing:Oc,amountWorkers:Ks,employment:Pc,employerActivities:Ic,employerOrganization:Tc,positionOrganization:ld,familyStatus:_c,familyMembers:Rc,children:ro,dependents:xc,totalIncome:bd,expenses:Ec,snils:yd,conscription:oo,armyIdFlg:Xs,dulSerie:wc,dulNumber:Nc,dulIssueDate:bc,dulSubdivisionCode:Cc,dulIssuedBy:vc,participantDateRegistration:td,retirementIncome:dd,otherIncome:ed,wages:vd,mandatoryPayments:Yc,bankruptcyFlg:Zs,initiateBankruptcyFlg:Bc,shareholderFlg:pd,legalEntityName:Uc,creditInRshbCd:nc,bankEmployeeCode:Js,partInBusiness:nd,regionRetail:od,infoCard:Mc,calculator:Zo,confirmationIncome:so,inn:pc,...wd},kd={addressCourier:e=>o(El,{...e,source:Nd}),paymentSystem:rd,currency:lc,cardCategory:ao,codeWord:lo,methodObtain:Kc,deliveryDate:fc,latinName:jc,latinSurname:qc,deliveryTime:yc},Id="Согласие на все документы",Td=d((({inputs:e=[],field:t,key:n})=>{const a=e.every((e=>Boolean(t(e.name).value))),i=r((n=>{for(const a of e){const e=t(a.name);e.onChange?.(n)}}),[e]),s=l((()=>e?.filter((e=>e.required))?.some((e=>Boolean(Hi(t(e?.name),nr).error)))),[e]),[d,{toggle:m}]=un(!0);return o("div",{className:"w-fit",children:c(Vl,{children:[c("div",{className:"flex items-start",children:[c("div",{children:[o(ci,{text:Id,value:a,onChange:i},n),Cn(s?"Отметьте все обязательные соглашения":"")]}),o(Dr,{embedded:!0,ariaLabel:Id,onClick:m,children:o(zl,{className:"p-2xs",iconVersion:"color",isUnfolded:d})})]}),o($l,{className:"flex flex-col pl-2xl",isUnfolded:d,children:e.map(Sr(t,{},Cd))})]})})})),Pd=({field:e,inputs:t},n)=>{const{consentInputs:a,restInputs:i}=Ed(t||[],n);return a.length>2?c("div",{children:[i.map(Sr(e,{},{...wd})),o(Td,{inputs:a,field:e})]}):(t||[])?.map(Sr(e,{},{...wd}))},Ed=(e,t)=>({consentInputs:e.filter((({name:e})=>Object.keys(pl[t]).includes(String(e)))),restInputs:e.filter((({name:e})=>!Object.keys(pl[t]).includes(String(e))))}),Dd=(e,t=!1)=>o($r,{className:"w-full @xl:w-auto",isLoading:t,children:e?.text?e.text:"Отправить заявку"}),Rd=new js;function _d(){return Us(Rd)}Vs(Rd,new $s(globalThis?.sessionStorage));const Ad=e=>yl("/user-data/updateUserProfile","PUT",e),Od=e=>yl("/user-data/updateUserTask","PUT",e),Md=d((({className:e,seconds:t})=>o("span",{className:e,children:Bd(t)}))),Bd=e=>[Math.floor(e/60),e%60].map((e=>String(e).padStart(2,"0"))).join(":"),Fd=(e,t)=>{const n=s(null),a=r((()=>clearInterval(n.current)),[]),l=r((()=>{a(),n.current=setInterval((()=>e(a)),t)}),[e,t,a]);return i((()=>(l(),a)),[l,a]),{start:l,stop:a}};function zd({seconds:e,period:t=1e3,onTick:n,onEnd:a}){const i=s(e),l=r((e=>{i.current||=0,i.current=Math.max(0,i.current-1);try{n?.(i.current)}finally{i.current<=0&&(e(),a?.())}}),[n,a]),{start:o}=Fd(l,t);return r((e=>{i.current=e,o()}),[])}const Ld={width:"118",height:"24"},Vd={"bg-white":"color",transparent:"white"},$d={"bg-white":"text-primary-main",transparent:"text-white"},jd=(e,t,n)=>o(ie,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:Vd[e]},className:$d[e],width:n?.width,height:n?.height}),qd={"bg-white":"text-primary-text",transparent:"text-white"},Ud=d((({className:e,href:t="/",logo:n,children:a,targetBlank:i,bgColor:r="bg-white",showTitle:l=!0,data:s})=>c("a",{className:u("inline-flex items-center font-sans no-underline",e),href:n?.href??t,target:i?"_blank":"_self","aria-label":n?.title??"Россельхозбанк",...ve(s),children:[jd(r,n?.image,Ld),l?a??o("div",{className:"ml-s",children:o(Le,{font:"font-medium",color:qd[r],size:"",children:n?.title??"Россельхозбанк"})}):null]}))),Wd=d((({phoneNumber:e,sendCode:t,onClose:n})=>{const[l,s]=a(""),[d,m]=a(""),[u,h]=a(!1),[p,{setTrue:g,setFalse:f}]=un(!1),{closeAll:y}=ge(),x=r((async()=>{g();var e;await(e={captchaText:d},yl("/sms/checkCaptcha","POST",e).then((e=>e.text())).then((e=>"ERROR"!==e)))?(n?.(),t?.()):h(!0),f()}),[d,t]),b=r((()=>{(async()=>{s(URL.createObjectURL(await(e=>yl(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET").then((async e=>e?e.blob():new Blob)))(e)))})()}),[]);return i(b,[]),o(_r,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",head:o(Ud,{}),onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center",children:[c("div",{className:"flex",children:[o("img",{className:"grow",src:l}),o(Dr,{className:"w-8",embedded:!0,onClick:b,children:o(G,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(Tn,{className:"w-80",onChange:m,value:d,placeholder:"Введите код с картинки"}),u?o("div",{className:"text-error",children:"Неверный код"}):null,c("div",{className:"flex w-80 justify-between",children:[o(Dr,{version:"secondary",onClick:y,children:"Вернуться"}),o($r,{version:"secondary",disabled:!d,onClick:x,children:"Отправить"})]}),p?o(Vr,{blur:!1}):null]})})})),Hd=d((({values:e,setValues:t,hasError:n,errorText:l})=>{const[d,m]=a(0),u=s([]);i((()=>{u.current?.[d]?.focus()}),[d]);const h=r((n=>a=>{const{value:i}=a.currentTarget,r=i.slice(0,1);t(e.map(((e,t)=>t===n?r:e))),m(n+1)}),[e]),p=r((n=>a=>{const{key:i}=a;if("Backspace"===i&&!e[n]){const a=n>0?n-1:e.length-1,i=e.map(((e,t)=>t===a?"":e));t(i),m(a)}}),[e]),g=r((n=>{n.preventDefault();const a=n.clipboardData.getData("text"),i=e.map(((e,t)=>t<a.length?a[t]:e));t(i),m(i.length-1)}),[e]);return c("div",{className:"flex flex-col gap-2 text-center",children:[o("div",{children:e.map(((t,a)=>o("input",{type:"number",maxLength:1,value:t,onChange:h(a),onPaste:g,ref:e=>{u.current||(u.current=[]),u.current[a]=e},onFocus:e=>e.target.select(),onKeyDown:p(a),className:Yd(a,e,n)},a)))}),n?o("div",{className:"text-error",children:l}):null]})})),Yd=(e,t,n=!1)=>{const a=!t[e];return`w-16 sm:w-20 h-24 text-5xl text-center p-md m-2 border ${kn(!n||!a)} rounded-md caret-transparent outline-none`},Gd=d((({disabled:e=!1,onClick:t,text:n})=>o(Dr,{type:"button",onClick:t,disabled:e,children:o(Le,{font:"font-normal",children:n})}))),Kd=e=>{e?.access_token&&e?.refresh_token&&(globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token))},Xd=({values:e,onSuccess:t})=>{const n=_d(),l=n.smsCode?.attempts||0,s=Math.max(Jd(n.smsCode?.sendTime||Date.now()),0),[o,c]=a(""),[d,{setTrue:m,setFalse:u}]=un(!1),[h,p]=a(s),g=r((()=>c("")),[]),f=Boolean(0===h&&n.smsCode?.sendTime),y=l>2||f||!e.every(Boolean),x=r((async()=>{try{n.smsCode={...n.smsCode,attempts:l+1},m(),await(async e=>fl("/sms/checkCode","POST",e).then(Kd))({smsText:e.join(""),smsCodesSetName:{key:"AUTHENTICATION"}}),p(0),g(),n.smsCode=null,await(t?.(e.join("")))}catch{c(l>1?"Исчерпан лимит ввода смс-кода":"Неверный код")}finally{u()}}),[e,l]);return i((()=>{f?c("Код просрочен"):l>2&&c("Исчерпан лимит ввода смс-кода")}),[f]),{handleSubmit:x,hasError:Boolean(o),errorText:o,isLoading:d,timeNextReq:h,isSubmitButtonDisabled:y,setTimeNextReq:p,setErrorText:c}},Jd=e=>Zd-Math.floor((Date.now()-e)/1e3),Zd=180,Qd=d((({phone:e,withDescription:t=!0,consents:n,onSuccess:l=pa,onClose:s=pa})=>{const[d,m]=a(Array(4).fill("")),u=_d(),{handleSubmit:h,hasError:p,errorText:g,isLoading:f,timeNextReq:y,isSubmitButtonDisabled:x,setTimeNextReq:b,setErrorText:v}=Xd({values:d,onSuccess:l}),N=Nn(Wd),w=Zt(e),C=zd({seconds:y,onTick:b}),k=r((async()=>{var e;await(e={phoneNumber:w,smsCodesSetName:{key:"AUTHENTICATION"}},yl("/sms/sendCode","POST",e).then((e=>e.text())).then((e=>"OK"===e)))?(b(Zd),C(Zd),v(""),u.smsCode={sendTime:Date.now(),attempts:0}):N.open({phoneNumber:w,sendCode:k})}),[w,C,s]);return i((()=>{u.smsCode?.sendTime||k()}),[]),o(_r,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-xl p-m",onClose:s,children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[o(S,{className:"w-full",title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),o(Hd,{values:d,setValues:m,errorText:g,hasError:p}),tm(y,k),t?c(Fe,{itemSize:"list-s",children:[o("span",{children:"Вводя код, я подтверждаю, что ознакомлен и подписываю: "}),o("ul",{children:n?.map(((e,t)=>o("li",{children:e},`${e}-${t}`)))})]}):null,em(x,h),f?o(Vr,{blur:!1}):null]})})})),em=(e,t)=>o(Gd,{text:"Далее",disabled:e,onClick:t}),tm=(e,t)=>e?c("div",{className:"flex flex-row text-l font-light text-base",children:["Получить новый код можно через",o(Md,{className:"pl-2xs",seconds:e})]}):o(Dr,{embedded:!0,onClick:t,children:o(Fl,{children:"Получить новый код"})}),nm={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},am={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},im=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],rm=d((({onSubmit:e=pa,onClose:t=pa})=>{const[n,i]=a(""),[l,s]=a(!1),d=uo(2),m=r((()=>{e(n)}),[e,n]),u=r((e=>{i(e),s("REFUSE"===e)}),[]),h=l?am:nm;return o(_r,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg px-5xl",onClose:t,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o("div",{role:"button",onClick:d,children:o(N,{className:"text-center text-balance",headingType:"h2",title:h.title})}),o(w,{align:"text-center",children:h.description}),o(xr,{className:"whitespace-normal",orientation:"horizontal",items:im,value:n,onChange:u}),o(Dr,{disabled:!n,type:"button",onClick:m,children:"Далее"})]})})})),lm=d((({title:e,icon:t,description:n,onClick:a=pa})=>c("button",{className:"flex gap-lg items-center border border-gray/30 rounded-xl cursor-pointer p-4 hover:border-green",type:"button",onClick:a,children:[o(ie,{image:{icon:t,iconVersion:"normal"},width:"78",height:"78"}),c("div",{className:"flex flex-col items-start gap-xs md:w-72 md:mr-lg",children:[e?o(Le,{font:"font-medium",size:"text-s",children:e}):null,n?o(Le,{color:"text-secondary-text",size:"text-xs",children:n}):null]})]}))),sm={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},om={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK",addressCourier:"DELIVERY"},cm={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},dm=e=>Object.entries(e).reduce(((e,[t,n])=>t in sm?[...e,{contactTypeCd:{key:sm[t]},value:n}]:e),[]),mm=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in om){const a=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:om[t]},...a}]}return e}),[]),um=e=>{const{familyStatus:t,familyMembers:n,dependents:a,children:i,confirmationIncome:r,wages:l,mandatoryPayments:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u,snils:h,armyIdFlg:p,conscription:g,initiateBankruptcyFlg:f}=e;return{maritalStatusCd:t,totalDependents:n,incomeCertificateCd:r,otherDependents:a,childrenDependents:i,militaryStatusCd:g,participantIncomes:(y={wages:l,mandatoryPayments:s,incomeAverage:hm(l,u),additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u},Object.entries(y).reduce(((e,[t,n])=>t in cm?[...e,{incomeTypeCd:{key:cm[t]},value:Number(n||0)}]:e),[])),snils:h?.replace(/[-\s]/g,""),armyIdFlg:p,initiateBankruptcyFlg:f};var y},hm=(e,t)=>(Number(e??0)+Number(t??0)).toString(),pm={WORK:"Работаю",RETIREE:"Пенсионер"},gm={BANK_STATEMENT:"Получаю зарплату на счет/карту в РСХБ",BANK_STATEMENT_PENS:"Получаю пенсию на счет/карту в РСХБ",PFR_CERTIFICATE:"Получаю зарплату на счет/карту в другом банке",OTHER:"Другое"},fm={credit_cash:"10",credit_cash_single_doc:"28",credit_mcx:"39",family_offer_credit:"41",gas_engine_fuel:"33",pension_credit:"12",ref_credit:"11",ref_credit_single_doc:"29",self_employed:"34",summer_cash:"35",summer_cash_pens:"36"},ym={...fm,amur_card:"14",owner_card:"13",travel_card:"15"},xm=e=>{const t=e?.find((e=>"WAGES"===e.incomeTypeCd.key))?.value,n=e?.find((e=>"MANDATORY_PAYMENTS"===e.incomeTypeCd.key))?.value,a=e?.find((e=>"ADDITIONAL_INCOME"===e.incomeTypeCd.key))?.value,i=e?.find((e=>"OTHER_INCOME"===e.incomeTypeCd.key))?.value,r=e?.find((e=>"OTHER_PAYMENTS"===e.incomeTypeCd.key))?.value,l=e?.find((e=>"RENTAL_INCOME"===e.incomeTypeCd.key))?.value,s=e?.find((e=>"RETIREMENT_INCOME"===e.incomeTypeCd.key))?.value;return{wages:t,mandatoryPayments:n,incomeAverage:hm(t,s),additionalIncome:a,otherIncome:i,otherPayments:r,rentalIncome:l,retirementIncome:s}},bm=e=>{const t=e?.find((e=>"REGISTRATION"===e.addressType.key)),n=e?.find((e=>"RESIDENTAL"===e.addressType.key)),a=e?.find((e=>"WORK"===e.addressType.key));return{addressRegistration:t,addressFact:n,organizationAddress:a}},vm=e=>{const t=e?.find((e=>"EMAIL"===e.contactTypeCd.key))?.value,n=e?.find((e=>"MAIN_PHONE"===e.contactTypeCd.key))?.value,a=e?.find((e=>"ORGANIZATION_PHONE"===e.contactTypeCd.key))?.value;return{email:t,phone:n,organizationPhone:a}},Nm=(e,t)=>e?.key?{key:e.key,text:t?t[e.key]:e.value}:void 0,wm=d((function({task:e,isFromLead:t=!1,isDebit:n=!1,sendAspects:a=pa,onClose:i=pa}){const l=Ys(),s=sn(),{participants:d,creditProgram:m,createdDate:u="",id:h}=e,p=ym[m.code],g=Boolean(fm[m.code]),{id:f,profile:y}=d[0],x=r((()=>{const t=(e=>{const t=e.participants[0],{classCard:n,codeWord:a,paymentSystemTypeCd:i,currencyCode:r}=e,{loanAmount:l,creditPeriod:s,paymentTypeCd:o}=e,{birthDate:c,midname:d,name:m,surname:u,birthPlace:h,dulIssueDate:p,dulIssuedBy:g,dulNumber:f,dulSerie:y,dulSubdivisionCode:x,educationLevelCd:b,registrationDate:v,houseTypeCd:N,genderCd:w,participantContacts:C=[],participantAddresses:S=[],employmentContractDate:k,employmentTypeCd:I,organizationName:T,organizationInn:P,organizationActivityTypeCd:E,organizationTypeCd:D,organizationKindCd:R,employeesNumberCd:_,opf:A,seniority:O,generalSeniority:M,jobsNumber:B,lastWorkDuration:F,positionCd:z,maritalStatusCd:L,childrenDependents:V,totalDependents:$,otherDependents:j,militaryStatusCd:q,participantIncomes:U,snils:W,armyIdFlg:H,bankruptcyFlg:Y,shareholderFlg:G,nameLegalEntity:K,creditInRshbCd:X,payrollCardRshbFlg:J,consentInsuranceFlg:Z,incomeCertificateCd:Q,profile:ee}=t;return{currency:r?.key,paymentSystem:Nm(i),cardCategory:Nm(n),codeWord:a,limitedBirthday:c,middleName:d,name:m,surname:u,birthPlace:h,dulIssueDate:p,dulIssuedBy:g,dulNumber:f,dulSerie:y,dulSubdivisionCode:x,education:Nm(b),participantDateRegistration:v,housing:Nm(N),beginDate:k,employment:Nm(I,pm),organizationName:T,inn:P,employerActivities:Nm(E),organization:Nm(D),employerOrganization:Nm(R),amountWorkers:Nm(_),legalForm:A,generalSeniority:O?.toString(),experience5Years:M?.toString(),jobsNumber:B?.toString(),lastJobExperience:F?.toString(),positionOrganization:Nm(z),familyStatus:Nm(L),children:V?.toString(),familyMembers:$?.toString(),dependents:j?.toString(),conscription:Nm(q),confirmationIncome:Nm(Q,gm),snils:W,armyIdFlg:H,bankruptcyFlg:Y,shareholderFlg:G,legalEntityName:K,creditInRshbCd:Nm(X),calculator:{isInsurance:J,isSalaryClient:Z,moneyValue:l,monthsValue:s,isAnnuity:"ANNUITY"===o?.key},esiaAccountTypeCd:ee?.esiaAccountTypeCd,...xm(U),...bm(S),...vm(C),...(te=w,te?.key?{sex:"MAN"===te.key?"male":"female"}:null)};var te})(e);l.participantId=f??null,l.taskId=h,l.profileId=y?.id??null,l.programId=p,l.leadForm=t,y?.id&&a(y.id,h),s.assign(n?"/debit-card-lead":g?"/credit-lead":"/credit-card-lead")}),[]),b=r((()=>{s.assign(g?"/natural/loans/all-goals":"/natural/creditcards/svoya")}),[]);return o(_r,{className:"my-6xl max-w-4xl w-full min-h-fit mx-auto rounded-xl py-0",onClose:i,children:c("div",{className:"flex flex-col gap-lg items-center mt-xs mx-6xl",children:[o(N,{className:"whitespace-pre-wrap text-center",title:"Нашли черновик вашей заявки",headingType:"h5"}),c("div",{className:"flex flex-col gap-m max-w-lg",children:[o(lm,{title:"Продолжить заполнение черновика",icon:"BankColorIcon",description:u?`Черновик от ${Jt(new Date(u))}`:"",onClick:x}),o(lm,{title:t?"Продолжить заполнение текущей заявки":"Создать новую заявку",icon:"NewLoanIcon",description:"На получение кредита",onClick:t?i:b})]})]})})})),Cm=d((function({onClose:e=pa}){const t=sn(),n=r((()=>{t.assign("/natural/loans/all-goals")}),[]),a=r((()=>{t.assign("/")}),[]);return o(_r,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl",onClose:e,children:c("div",{className:"flex flex-col gap-lg",children:[o(N,{className:"text-center",title:"Заявки не найдены",headingType:"h3"}),o(w,{size:"text-l",align:"text-center",children:"По данному номеру не найдено незавершенных заявок. Вы можете заполнить новую заявку или вернуться на главную страницу"}),o(Dr,{type:"button",className:"w-full",onClick:n,children:"Заполнить новую заявку"}),o(Dr,{type:"button",version:"secondary",className:"w-full",onClick:a,children:"Вернуться на главную"})]})})})),Sm=e=>{switch(e){case"referal_sf":return"ReferalSF";case"vse_svoe":return"vseSvoe";default:return globalThis.location.origin}},km=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"snowplowEvent"===e?{...n,eventJSON:t}:n}))),Im=({programId:e,nextStepLink:t,productType:n,data:i})=>{const[l,{setTrue:s,setFalse:o}]=un(!1),[c,d]=a(),m=(()=>{const e=co();return r((({participantId:t,taskId:n,profileId:a,programId:i,formData:r})=>{e.participantId=t,e.taskId=n,e.profileId=a,e.programId=i,e.leadForm=r}),[])})(),u=_d(),h=(({data:e})=>{const t=mn();return r(((n,a)=>{const i=JSON.stringify({ProfileId:n,TaskId:a});ln({aspectsAttributes:km(e,i),aspects:t,ev:{}})}),[e])})({data:i}),p=sn(),g=r((()=>{p.assign(t)}),[]),f=(e=>{const{open:t}=Nn(rm),n=Nn(Qd),a=t=>async n=>{try{t&&await Ad({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()}catch(e){console.log(e)}},i=(t,i)=>async r=>{"SIGNED"===r&&t?n.open({phone:t,consents:["согласие на запрос информации в БКИ"],onSuccess:a(i)}):e()};return{open:(n,a)=>t({onSubmit:i(n,a),onClose:e})}})(g),y=Nn(Qd),x=(()=>{const{open:e}=Nn(wm),{open:t}=Nn(Cm);return{open:({task:n,isFromLead:a,isDebit:i,onClose:r,sendAspects:l})=>{n?e({task:n,isFromLead:a,isDebit:i,onClose:r,sendAspects:l}):t({})}}})();return{isSending:l,ok:c,handleSubmit:r((async t=>{try{s();const i=Dm(t),r=await(a={profile:{phone:Zt(i.phone)}},fl("/public-data/createUserProfile","POST",a).then((e=>e?.profile?.id||null))),l=u.referalData,o=u.marketingInfo;if(!r)throw new Error;const c=async()=>{await Pm({programId:e,profileId:r,formData:i,productType:n,referalData:l,marketingInfo:o,saveUserData:m,sendAspects:h}),y.close(),"debitCard"===n?g():f.open(i.phone,r)},p=async()=>{try{const t=await(async e=>{const t=await fl("/user-data/getLastStatus","POST",e);return"DRAFT"===t?.statusCd?t?.taskId:null})({profileId:r,programId:e});if(t){const e=await(async e=>await fl("/user-data/getTaskById","POST",e)||void 0)({taskId:t});y.close(),x.open({task:e,isFromLead:!0,isDebit:"debitCard"===n,sendAspects:h,onClose:c})}else await c()}catch{d(!1)}},b=Tm(i,n);y.open({phone:i.phone,consents:b,onSuccess:p})}catch{d(!1)}finally{o()}var a}),[])}},Tm=(e,t)=>{const n=pl[t];return Object.keys(n).filter((t=>e[t])).map((e=>n[e]?.text))},Pm=async({programId:e,profileId:t,formData:n,productType:a,referalData:i,marketingInfo:r,saveUserData:l,sendAspects:s})=>{let o,c;const d=Em(n,a);await Ad(((e,t,n)=>{const{name:a="",surname:i="",middleName:r="",limitedBirthday:l="",phone:s="",email:o=""}=t;return{profile:{id:e,name:a,surname:i,midname:r,birthDate:l&&Jt(l,!0),email:o,phone:Zt(s),...n}}})(t,n,d));try{if("debitCard"===a){const t=await(async e=>await fl("/user-data/createUserTaskDebit","PUT",e)||{})(((e,t,n)=>{const{name:a,surname:i,middleName:r,limitedBirthday:l,phone:s,email:o}=e;return{task:{taskSource:Sm(n?.utm_source),creditProgram:{code:ac[t]},participants:[{birthDate:l&&Jt(l,!0),midname:r,name:a,surname:i,participantContacts:dm({phone:s&&Zt(s),email:o})}],marketingInfo:{bannerId:n?.bannerId}}}})(n,e,r));o=t.taskId,c=t.participantId}else{const a=await(async e=>await fl("/user-data/createDraftTask","POST",e)||{})({profileId:t,programId:e});o=a.taskId,c=a.participantId,await Od((({participantId:e,taskId:t,profileId:n,formData:a,marketingInfo:i})=>{const{name:r,surname:l,middleName:s,limitedBirthday:o,phone:c,email:d}=a;return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:Sm(i?.utm_source),id:t,participants:[{birthDate:o&&Jt(o,!0),id:e,midname:s,name:r,surname:l,profile:{id:n},participantContacts:dm({phone:c&&Zt(c),email:d}),roleCd:{key:"BORROWER",value:"Заемщик"}}],marketingInfo:i}}})({participantId:c,taskId:o,profileId:t,formData:n,marketingInfo:r}))}i?.referalCode&&await(m={taskId:o,...i},yl("/referal/saveReferalInfo","POST",m)),s(t,o),l({participantId:c,taskId:o,profileId:t,programId:e,formData:n})}catch(e){console.log(e)}var m},Em=(e,t)=>{const{consentOthersFlg:n,consentPfrFlg:a,processPersonalDataFlg:i,consentInformFlg:r,consentProviderFlg:l,consentInformMaterialsFlg:s,consentFATCA:o}=e;let c;return c="credit"===t?{consentPfrFlg:a,consentInformMaterialsFlg:n,consentPhotoFlg:!1}:"creditCard"===t?{consentInformMaterialsFlg:s,consentPhotoFlg:!1}:{consentFATCA:o,consentPhotoFlg:n},{...c,processPersonalDataFlg:i,consentInformFlg:r,consentProviderFlg:l,consentCollectionFlg:n,consentAssignmentClaimsFlg:n}},Dm=e=>({...e,surname:e.surname?.trim(),name:e.name?.trim(),middleName:e.middleName?.trim()}),Rm={surname:"",name:"",middleName:"",limitedBirthday:void 0,phone:"",email:"",processPersonalDataFlg:!1,consentProviderFlg:!1,consentOthersFlg:!1,consentInformFlg:!1,consentPfrFlg:!1,consentInformMaterialsFlg:!1,consentPhotoFlg:!1,consentFATCA:!1},_m=(e,t,n)=>{if(t)return{...t,limitedBirthday:new Date(t?.limitedBirthday||0),...!n&&{esiaAccountTypeCd:{key:""}}};return{...Object.fromEntries(e.map((e=>[e.name,Rm[e.name||""]])))}},Am=async(e,t,n=!1)=>{const a=new FormData;return a.append("documentCategory",t),a.append("file",e,"file."+(n?"pdf":"xml")),await(globalThis?.fetch?.("/light-api-cash/v1/file",{method:"POST",headers:{...xl()},credentials:"include",body:a}).then((e=>e.json())))},Om=e=>{const{postcode:t,region:n,regionCode:a,locality:i,city:r,street:l,house:s,building:o,block:c,apartment:d}=e,m=[t,n,i||r,l?`ул ${l}`: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:a?.key,fullAddress:m}},Mm=e=>Math.floor(e/12),Bm=async e=>{const t=[],n=[{file:e.pdfFileWorkbook,category:"CONFIRMING_INCOME_DOC",isPDF:!0},{file:e.pdfFilePayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!0},{file:e.pdfFileSigPayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!0},{file:e.xmlFilePayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!1},{file:e.xmlFileSigPayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!1},{file:e.xmlFileWorkbook,category:"CONFIRMING_INCOME_DOC",isPDF:!1}];for(const e of n){const n=e.isPDF?"data:application/pdf;base64":"data:application/xml;base64";await fetch(`${n},${e.file}`).then((e=>e.blob())).then((t=>Am(t,e.category,e.isPDF))).then((e=>t.push(e)))}return t},Fm=e=>{const{profile:t,document:n,addressRegistration:a}=e;if(![t.name,t.surname,t.midname,t.birthDate,t.phone,n.dulIssueDate,n.dulIssuedBy,n.dulNumber,n.dulSerie,n.dulSubdivisionCode,a,t.esiaAccountType].every(Boolean))throw new Error},zm=e=>{const{esiaAdditionalDocument:t}=e;return[t?.inn,t?.averageMonthlyIncome?.toString(),t?.startWorkDate,t?.workLengthInFiveYears?.toString(),t?.workLength?.toString(),t?.workLengthLastJob?.toString(),t?.jobsNumberInFiveYears?.toString(),t?.pdfFilePayout,t?.pdfFileWorkbook,t?.pdfFileSigPayout,t?.xmlFilePayout,t?.xmlFileSigPayout,t?.xmlFileWorkbook].every(Boolean)},Lm=({inputs:e,productType:t,setEsiaStatus:n,esiaAuthSuccess:a})=>{const s=co(),o=r((e=>{const t=e instanceof Function?e(c[d]):e;null!=t?c[d]=t:delete c[d]}),[c=s,d="leadForm"]);var c,d;const m=_d(),u=globalThis.sessionStorage?.getItem(on),h=l((()=>_m(e,s.leadForm,a)),[e,s.leadForm]),p=r((async(e,a)=>{n(gl.Pending);try{const r=await(i={code:e,state:a,redirectUri:globalThis.location?.href,authorize:!0},fl("/esia/requestProfile","POST",i).then((e=>(Kd(e),e))));if(r){const e=await(async(e,t)=>{Fm(e);const n=!t&&zm(e),{profile:a,addInfo:i,document:r,addressRegistration:l,addressFact:s,esiaAdditionalDocument:o}=e;let c=[];return n&&(c=await Bm(o)),{...{name:a.name,surname:a.surname,middleName:a.midname,limitedBirthday:a.birthDate,phone:_i(a.phone),email:a.email,dulIssueDate:r.dulIssueDate,dulIssuedBy:r.dulIssuedBy,dulNumber:r.dulNumber,dulSerie:r.dulSerie,dulSubdivisionCode:r.dulSubdivisionCode,birthPlace:i.birthPlace,addressRegistration:Om(l),esiaAccountTypeCd:t?a.esiaAccountType:{key:""},...s&&{addressFact:Om(s)}},...n&&{snils:i.snils,inn:o.inn,wages:Math.floor(o.averageMonthlyIncome)?.toString(),beginDate:o.startWorkDate,experience5Years:Mm(o.workLengthInFiveYears).toString(),generalSeniority:Mm(o.workLength).toString(),lastJobExperience:Mm(o.workLengthLastJob).toString(),jobsNumber:o.jobsNumberInFiveYears.toString(),esiaAccountTypeCd:a.esiaAccountType,confirmationIncome:{key:"SFR_CERTIFICATE",text:"Запрос Банком доходов из СФР"},employment:{key:"WORK",text:"Работаю"},files:c}}})(r,"debitCard"===t);o((t=>({...t,...e}))),n(gl.Success)}}catch{n(gl.Error)}var i}),[]);return i((()=>{s.productType=t;const{code:e,state:n,referalCode:a,refererCode:i,productId:r,marketingInfo:l}=Vm(u,m);a&&(m.referalData={refererCode:i,referalCode:a,productId:r}),m.marketingInfo=l,e&&n?p(e,n):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[u]),h},Vm=(e,t)=>{const n=t.referalData,a=t.marketingInfo,i=new URLSearchParams(decodeURIComponent(e||"")),r=i.get("code");return{code:r,state:i.get("state"),referalCode:r?n?.referalCode:i.get("referalCode"),refererCode:r?n?.refererCode:i.get("refererCode"),productId:r?n?.productId:i.get("productId"),marketingInfo:r?a:{utm_campaign:i.get("utm_campaign"),utm_medium:i.get("utm_medium"),utm_source:i.get("utm_source"),utm_content:i.get("utm_content"),utm_term:i.get("utm_term"),bannerId:i.get("bannerId")}}},$m=d((({className:e,title:t,programId:n="",nextStepLink:r="/credit-lead",button:d,productType:m="credit",data:h,...p})=>{const[g,f]=a(),[y,x]=a(0),b=s(null),v=l((()=>(e=>{const t=pl[e];return[{columns:2,inputs:[{name:"surname",required:!0,dadata:!0,filledByEsia:!0},{name:"name",required:!0,dadata:!0,filledByEsia:!0},{name:"middleName",dadata:!0,filledByEsia:!0},{name:"limitedBirthday",required:!0,filledByEsia:!0},{name:"phone",required:!0,filledByEsia:!0},{name:"email",required:!0,dadata:!0}]},{inputs:[{name:"processPersonalDataFlg",required:!0},{name:"consentProviderFlg",required:!0},{name:"consentOthersFlg",required:!0},{name:"consentInformFlg"},{name:"consentPfrFlg"},{name:"consentInformMaterialsFlg"},{name:"consentFATCA",required:!0}].filter((e=>e.name&&Object.keys(t).includes(e.name)))}]})(m)),[m]),N=l((()=>jm(v)),[v]),w=Nn(Kr),C=l((()=>qm(m)),[m]),S=l((()=>rr(N,C)),[N,C]),k=Lm({inputs:N,nextStepLink:r,productType:m,setEsiaStatus:f,esiaAuthSuccess:g===gl.Success}),{isSending:I,ok:T,handleSubmit:P}=Im({programId:n,nextStepLink:r,productType:m,data:h}),[,{field:E,onSubmit:D,reset:R}]=bn(k,{formValidator:S,onSubmit:P}),_=Nn(Ar);return i((()=>{void 0!==T&&_.open({ok:T})}),[T]),i((()=>{g&&b?.current&&b.current.scrollIntoView({block:"start"}),g===gl.Success&&R()}),[b?.current,g]),c(vn,{className:u("container space-y-m",e),title:t,...p,children:[g?null:o(bl,{onChangeEsiaStatus:f}),c("form",{onSubmit:e=>{E("processPersonalDataFlg")?.value||(x((e=>e+1)),y>0&&w.open({attempts:y})),D?.(e)},className:"space-y-m relative",ref:b,children:[g===gl.Pending?o(Vr,{blur:!1}):null,v.map(((e,t)=>c("div",{className:u(kr(e.columns),"grid gap-x-m"),children:[Ir(e.title),Pd({field:E,inputs:e?.inputs},m)]},`section-${t}`))),Dd(d,I),g===gl.Error?o(Le,{size:"text-m",font:"font-medium",color:"text-error",children:"Использовать Госуслуги для оформления заявки невозможно, необходимо заполнить поля вручную."}):null]})]})})),jm=e=>e?.flatMap((e=>e?.inputs))||[],qm=e=>({...hl,limitedBirthday:cl(e)}),Um=d((({title:e,description:t})=>{const n=Ee();return c("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[o(ie,{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"})]})})),Wm=e=>e%2!=0,Hm="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",Ym=d((({topItemsCount:e=0,label:t,block:n,blocksToRender:a=[],...i})=>{const[r,l]=e>0?[a.slice(0,e),a.slice(e)]:[a,[]],[s,{toggle:d}]=un(!1);return c("div",{className:u("space-y-2xs",{hidden:!a.length}),children:[c("div",{className:u(Hm),children:[E(r,{...i.options,parent:n}),Wm(r.length)?o(Kt,{className:"col-span-6",...i}):null]}),c(Vl,{children:[c($l,{className:u(Hm),isUnfolded:s,children:[E(l,{...i.options,parent:n}),Wm(l.length)?o(Kt,{className:"col-span-6",...i}):null]}),o(Ll,{className:u("text-h4",{hidden:e<1}),label:t,isUnfolded:s,disabled:!l?.length,dataTheme:i.options?.page?.colorPalette,onClick:d})]})]})})),Gm=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",Km=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`}),Xm=10;function Jm(e,{sensitivity:t,rootRef:n}={}){const a=s(null),r=l((()=>({threshold:Zm(t),root:n?.current})),[t,n?.current]);return i((()=>{if(!a.current)return;const t=new IntersectionObserver(e,r);return t.observe(a.current),()=>{t.disconnect()}}),[e,r]),a}function Zm(e=0){const t=Math.round(e*Xm);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const Qm=d((({className:e,style:t,idx:n,activeIndex:a,observerOptions:i,children:l,onIntersection:s})=>{const c=Jm(r((e=>{e.length&&s&&s(n||0,e[e.length-1])}),[s,n]),i);return o("div",{className:u("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(n===a),ref:c,role:"listitem",children:l})})),eu=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],tu=d((({className:e,itemClassName:t,containerRef:n,activeIndex:a,visibleItemCount:i=0,gap:l=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:p,onVisibleItemsChange:g,onVisibleIndicesChange:f})=>{const y={sensitivity:1,rootRef:n},x=s([]),b=r(((e,t)=>{const n=[...x.current||[]];n[e]=t,x.current=n,g&&g(n),f&&f(au(n))}),[g,f]),v=i>0?l*Number(i)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?nu(c,v):{},...N?Km(h):{},gap:`${l}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(Qm,{className:u(m,i?eu[i-1]:"",{"h-full":N},t),style:w?nu(c/4):{},activeIndex:a,idx:n,observerOptions:y,onIntersection:b,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(S):S(e,0))(p)});var S})),nu=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),au=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),iu={"horizontal-list":"w-6","vertical-list":"h-6"},ru=({activeIndex:e,onClick:t,listType:n="horizontal-list"})=>(a,i)=>o("div",{className:u("cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white",i===e?iu[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(i)},String(i)),lu=({activeIndex:e,onClick:t})=>(n,a)=>{const i=a===e,r=i?"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",l=i?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=i?"text-l":"text-m group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(a),"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",r),children:[o("div",{className:l,children:n?.title}),o("div",{className:u("text-secondary-text font-light",s),children:n?.description})]},String(a))},su=e=>t=>e.scrollWidth/t,ou=e=>(t,n)=>{e.scrollBy({left:n*su(e)(t),behavior:"smooth"})},cu=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[i,l]=a([]),o=r((e=>{l((t=>{return(n=t)===(a=e)||Boolean(n&&a&&n?.length===a?.length&&n.every(((e,t)=>e===a[t])))?t:e;var n,a})),t&&t(e)}),[t]),[c,d]=i.length?[zo()(i),Bo()(i)]:[-1,-1],m=c>0,u=d<e-1,h=r((()=>{var t;n.current&&(m?ou(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=r((()=>{n.current&&(u?ou(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,u]),g=r(((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}]},du={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},mu=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:a="horizontal-list",version:l,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=Ee(),[h,p]=cu({itemCount:s.length}),g=uu(Boolean(s?.length));i((()=>{s?.length&&t>=0&&h?.current&&p.scrollTo(t,g)}),[t]);const f=r((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o(tu,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(lu({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",du[a],l?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":l,children:Array.from({length:n}).fill(null).map(ru({activeIndex:t,onClick:f,listType:a}))}):null})),uu=(e=!1)=>({behavior:e?"auto":"smooth"}),hu=d((({className:e,name:t,...n})=>o(Dr,{className:u("w-12 h-12 min-w-12 min-h-12",e),shape:"round",...n,children:o(G,{name:t,iconVersion:"",size:"small"})}))),pu=d((e=>o(hu,{name:"ArrowLeftIcon",version:"secondary",ariaLabel:"Пролистать влево",...e}))),gu=d((e=>o(hu,{name:"ArrowRightIcon",version:"secondary",ariaLabel:"Пролистать вправо",...e}))),fu="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",yu=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:a,isBottom:i})=>{const{canScrollLeft:r,canScrollRight:l,scrollLeft:s,scrollRight:d}=t,m=a&&!i;return c("div",{className:e,children:[n?xu(t):null,r?o(pu,{wcmsIgnore:!0,className:u(bu(i),m?"left-1":"left-0"),onClick:s}):null,l?o(gu,{wcmsIgnore:!0,className:u(bu(i),m?"right-1":"right-0"),onClick:d}):null]})})),xu=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(fu,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(fu,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),bu=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),vu=d((({className:e,version:t,gap:n=14,padding:a=16,visibleItemCount:i=1,listType:r="horizontal-list",snapAlign:l,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:h,showDots:p,children:g,onVisibleIndicesChange:f,navButtons:y})=>{const x=Array.isArray(g)?g.length:0,[b,v]=cu({itemCount:x,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===r?"relative h-full":""),children:[o(tu,{containerRef:b,activeIndex:N,visibleItemCount:i,gap:n,padding:a,listType:r,snapAlign:l,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(yu,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(y?.length)}),o(mu,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:x,listType:r,version:t,navButtons:y,containerRef:b,containerScroll:v})]})})),Nu=({blocksToRender:e,...t})=>o(vu,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:E(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",Gm(!0)),children:T(e,t)},String(n))})}),wu=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...a})=>{switch(e?.view){case"grid":return c("div",{children:[Cu(n,t),o(Ym,{...e,...a,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[Cu(n,t),Nu({...a,blocksToRender:t})]});default:return null}})),Cu=(e,t)=>e&&!t.length?o(Um,{...e}):null,Su=e=>t=>t.reduce(((t,n,a)=>t.length?t.concat({...e,key:`sep-${a}`},n):[n]),[]),ku=d((({value:e,onChange:t,items:n=[],multiple:a})=>n.map((n=>o(Ci,{text:n?.title,value:[e].flatMap((e=>e)).includes(n.value),onChange:()=>(n=>{if(!t)return;const i=e?.includes(n);t(a?i?(e||[]).filter((e=>e!==n)):[...e||[],n]:i?[]:[n])})(n.value),type:a?"checkbox":"radio"},n.value))))),Iu=d((({children:e,filtrationSchema:t,resetButton:n,field:a,reset:i})=>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,Su(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(Tu(a)).filter(Boolean))]}),n?o("div",{children:o(Dr,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:i,children:n?.text})}):null]}))),Tu=e=>([t,n])=>{const a=n?.type;return"array"===a?Pu(t,e)(n):null},Pu=(e,t)=>n=>{const a=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(Le,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(ku,{items:a,multiple:!n?.single,...t(e)})]},e)},Eu=e=>e;function Du(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const Ru=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,_u=(e,t)=>Object.entries(e).map((([n,a])=>"number"==typeof a?Array.isArray(t[n])?((e,t)=>n=>Ru(t[e])||Ru(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>Ru(t[e])||Ru(n[e])||Au(t[e])<=Au(n[e]))(n,e):"object"==typeof a&&"min"in a&&"max"in a?((e,t)=>n=>Ru(t[e])||Ru(n[e])||Au(t[e]?.min)>=Au(n[e]?.min)&&Au(t[e]?.min)<=Au(n[e]?.max))(n,e):Array.isArray(a)?((e,t)=>n=>Ru(t[e])||Ru(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>Ru(t[e])||Ru(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),Au=e=>Number(e||0),Ou=(e,{block:t,page:n,normalize:a=Eu})=>{const i=t?.blocks||[],[r,s]=bn(e),o=l((()=>Du(i,i.map((e=>Ut(e.content,n?.fallback))))),[i,n?.fallback]),c=r===e?i:((e,t)=>(n=Eu)=>e?.filter((([,e])=>_u(t,n(e)||{}))).map((([e])=>e)))(o,r)(a);return[r,{blocksToRender:c,blocksWithProps:o},s]},Mu={},Bu={},Fu=Yt((({className:e,filtrationSchema:t=Mu,consumerField:n={},resetButton:a,...i})=>{const[,{blocksToRender:r},{field:l,reset:s}]=Ou(Bu,{block:i.block,page:i.options?.page}),d=o(Mn,{className:"w-64",label:n?.title,options:zu(n),...l("consumer",{parse:({key:e})=>[e],format:([e]=[])=>zu(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...i,children:[o(Iu,{filtrationSchema:t,field:l,reset:s,children:c("div",{children:[d,o("div",{children:o(Dr,{type:"reset",className:"mt-lg w-64",onClick:s,version:a?.version,children:a?.text})})]})}),o(wu,{blocksToRender:r,...i})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),zu=e=>Du(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),Lu=(e=!1)=>e?"text-left":"text-center",Vu={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},$u=d((({className:e,iconBgVersion:t="primary",size:n,icon:a,...i})=>{const r=`${n?.width??44}px`;return a?o("div",{className:u("rounded-icon object-fit flex justify-center items-center",Vu[t],e),style:{width:r,height:r},role:"figure",children:o(G,{name:a,width:"54%",...i})}):null})),ju=d((({className:e="",title:t,benefitList:n,...a})=>{const i=Ee();return c(g,{className:e,defaultPadding:"p-6xl",...a,children:[t?o(N,{headingType:"h3",as:"h2",className:Lu(i),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(qu)}):null]})})),qu=({label:e,description:t,__html:n,icon:a,isDotted:i=!1,iconBgVersion:r},l)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-lg",role:"listitem",children:[a?.icon?o($u,{className:"shrink-0",iconBgVersion:r,...a}):null,a?.src?o(ie,{className:"shrink-0",image:a}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(N,{headingType:"h6",children:e}),o(Le,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(Fe,{__html:n,isDotted:i,itemSize:"list-s"}):null]}):null]},String(l)),Uu=e=>({icon:t,title:n,description:a},i)=>c("div",{className:u("flex flex-col gap-1","items-center",{"justify-center":!a&&!n}),children:[n?o(Le,{size:"text-h6",font:"font-normal",align:e,children:n}):null,t?o(ie,{image:t,height:"180",className:"w-auto mx-auto"}):null,a?o(Le,{size:"text-h6",font:"font-normal",align:e,children:a}):null]},String(i)),Wu=(e,t,n)=>o("div",{className:`grid gap-2xs ${Hu(t)}`,children:e.map(Uu(n))}),Hu=e=>{switch(e){case"3":return"grid-cols-3";case"4":return"grid-cols-4";default:return"grid-cols-5"}},Yu=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:a="4",subtitle:i,title:r,...l})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...l,children:[o(S,{defaultPadding:"",title:r,description:i,headlineVersion:"M"}),e?.length?Wu(e,a,t):null]}))),Gu={start:"justify-start",center:"justify-center",end:"justify-end"},Ku=d((({buttons:e,className:t="",align:n,...a})=>{const i=n&&u("flex",Gu[n]);return o(g,{className:u("!bg-transparent",i,t),defaultPadding:"p-0",...a,children:Ye(e)})})),Xu=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:a=2,depositeName:i,isShowDepositeName:r,color:l="text-secondary-text"})=>c("div",{children:[o(Le,{size:"text-l",font:"font-light",color:l,children:t}),c("div",{className:"relative",children:[c("div",{className:"flex @xl:justify-center gradient-color-text gap-xs",children:[o("span",{className:"font-mohave text-title-huge -mt-m tracking-[-15px]",children:Je(a,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),i&&r?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:i}):null]})]}))),Ju=d((({title:e="Ставка"})=>c("div",{className:"space-y-s lg:min-w-96",children:[o(Le,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(G,{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:"Процентная ставка не найдена, выберите другие параметры"})})]}))),Zu=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:a=2,color:i="text-secondary-text",children:r,...l})=>t?c("div",{className:"flex flex-col",children:[o("div",{className:"hidden lg:block min-w-96",children:o(Xu,{title:e,rate:t,unit:n,fractionDigits:a,color:i,...l})}),o(No,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:a,fixed:!0,color:i,...l}),r]}):o(Ju,{title:e,...l}),Qu={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},eh={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},th=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:a}=e,[i,r]=((e,t,n)=>{const{maxBonus:a=5e3,prefMonthsNum:i=Qu.prefMonthsNum,prefTravelBonusRate:r=Qu.prefTravelBonusRate,prefRestBonusRate:l=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(r*t)+Math.round(l*n),a);return[c,c*i+Math.min(Math.round(s*t)+Math.round(o*n),a)*(12-i)]})(t||eh,n,a);return{...t,...e,monthBonus:i,yearBonus:r}},nh=Yt((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,...r})=>{const[l,{field:s}]=bn({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=th(l,n);return o(fo,{className:e,title:t,...r,children:c("section",{className:u(yo,e),children:[c("div",{className:xo,children:[_o({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),_o({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?Zu({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:bo,children:[f>=0?o(No,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,Ye(a,{isVertical:!0}),To(i)]})]})})})),ah=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,ih=e=>Do({...e,title:"Выплата процентов",orientation:"vertical",items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),rh=" (c капитализацией)",lh=({income:e,finalSum:t,postfix:n="₽",buttons:a=[],footnotes:i=[],isCapitalization:r=!1})=>c("div",{className:bo,children:[o(No,{title:`Доход в конце срока${r?rh:""}`,value:e,postfix:n,prefix:"+"}),o(No,{title:`Сумма в конце срока${r?rh:""}`,value:t,postfix:n}),Ye(a,{isVertical:!0}),i?.map(To)]}),sh={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const oh={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},ch=(e,t)=>{const{daysValue:n,moneyValue:a,isPartialWithdrawal:i,isReplenished:r,isMonthlyInterestPayment:l}=e,s=r||i,o=n<90||n>730,c=function(e){const t=e?.rateType?sh[e?.rateType]:"",{data:n}=Kn(t?`${Qt}/depositrates/${t}`:null,Vt);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>l===e.isMonthlyInterestPayment&&dh(s,e)&&jo(a,["minSum","maxSum"],e)&&jo(n,["minDays","maxDays"],e)))||oh,{rate:m}=d,u=mh(m,e),h=a+u,p=c||[oh];return{...d,...$o(["minSum","maxSum"],p),...$o(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},dh=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,mh=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:a,daysValue:i}=t;return n?Math.round(a*Math.pow((1200+e)/1200,i/30)-a):Math.round(a*e*i/365/100)},uh=Yt((({className:e="",title:t,buttons:n,footnote:a,bottomFootnote:i,isShowDepositeName:r,defaultParams:l,rateParams:s,...d})=>{const[m,{field:h}]=bn({moneyValue:ko(l,1e5),daysValue:Io(l,60),isReplenished:Boolean(l?.isReplenished),isPartialWithdrawal:Boolean(l?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(l?.isMonthlyInterestPayment)}),p=ch(m,s),{income:g,finalSum:f,rate:y,depositeName:x}=p;return o(fo,{className:e,title:t,...d,children:c("section",{className:u(yo,e),children:[c("div",{className:xo,children:[_o({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(ca,{items:[`От ${ah(b.min||0)}`,`До ${ah(b.max||0)}`],step:1,...b})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[hh(p,h),ih({...h("isMonthlyInterestPayment")})]})]}),Zu({rate:y,depositeName:x,isShowDepositeName:r}),lh({income:g,finalSum:f,buttons:n,footnotes:[a,i]})]})});var b})),hh=(e,t)=>c("div",{className:"space-y-s",children:[o(Le,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(ci,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(ci,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),ph=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,a]=t[n-1],[i,r]=t[n];a>=i?t.splice(n-1,2,[e,Math.max(a,r)]):n++}return t},gh={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},fh=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,r=t?.[0]?bh(t[0].minMonths,t[0].maxMonths):0,l=!n?.isShowMonthlyInterestPayment,s=!n?.isShowRemoteRegistration,o=!n?.isShowReplenish,c=!n?.isShowWithdrawn,d=!n?.isShowNewClient,m=t?.find((t=>[xh({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),xh({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),xh({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:l}),xh({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,jo(a,["minSum","maxSum"],t),jo(i||r,["minMonths","maxMonths"],t)].every(Boolean)))||gh,{rate:u}=m,h=e?.extraPercent?.key??0,p=Number(u)+Number(h),g=yh(p,e),f=a+g,y=t||[gh];return{...m,...$o(["minSum","maxSum"],y),...$o(["minMonths","maxMonths"],y),availableMonths:ph(y.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,n=1)=>Array.from({length:Math.abs(t-e)/n+1},((a,i)=>t>=e?e+i*n:e-i*n)))(e,t))),...e,defaultMonth:r,income:g,finalSum:f}},yh=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:a,monthsValue:i}=t;return n?Math.round(a*Math.pow((1200+e)/1200,i)-a):Math.round(a*e*30*i/365/100)},xh=({row:e,userInputParams:t,paramKey:n,isExclude:a})=>a||t[n]===e[n],bh=(e,t)=>e+Math.round((t-e)/2),vh=(e="rub")=>"rub"===e,Nh=(e,t)=>{const{minMonths:n,maxMonths:a}=$o(["minMonths","maxMonths"],kh(t,e?.currency)),i=e.monthsValue||Math.round((n+a)/2);return{monthsValue:ia(i,n,a)}},wh=(e,t)=>{const{minSum:n,maxSum:a}=$o(["minSum","maxSum"],kh(t,e?.currency)),i=e.moneyValue||n;return{moneyValue:ia(i,n,a)}},Ch=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),Sh=e=>{const t=vh(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},kh=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},Ih=(e,t=!1)=>t?Do({...e,title:"Оформление",orientation:"vertical",items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]}):null,Th=(e,t,n)=>{const a="rub"!==e?.currency?.key;return c("div",{className:"grid grid-cols-2 gap-lg",children:[Ph(t("isReplenish"),e,a),Eh(t("isWithdrawn"),e,a),Dh(e.isShowReplenish||e.isShowWithdrawn),e.isShowMonthlyInterestPayment?ih(t("isMonthlyInterestPayment")):null,Ih(t("isRemoteRegistration"),e.isShowRemoteRegistration),Rh(t("extraPercent"),n),e.isShowNewClient?o(ci,{text:"Новый сберегатель",...t("isNewClient")}):null]})},Ph=(e,t,n=!1)=>t.isShowReplenish?Do({...e,title:"Пополнение",orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,Eh=(e,t,n=!1)=>t.isShowWithdrawn?Do({...e,title:"Снятие",orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null,Dh=(e=!1)=>e?o("div",{className:"border-b border-main-divider col-span-2 w-full"}):null,Rh=(e,t)=>t?.length?c("div",{className:"w-full space-y-s col-span-2",children:[o(Le,{color:"text-secondary-text",font:"font-light",children:"Надбавка за операции по карте"}),o(Mn,{options:t,...e})]}):null,_h={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum",extraPercent:"extraPercent"},Ah={text:"₽",key:"rub"},Oh={text:"Без учета надбавки",key:"0"},Mh=Yt((({className:e,title:t,calcSource:n,buttons:a=[],footnote:l="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=n??{},p=h?.map((e=>e.currency))??[Ah],g=r((e=>t=>e?{...t,...Sh(t),...wh(t,e),...Nh(t,e),...Ch(t,e)}:t)(h),[h]),[f,{field:y}]=bn({moneyValue:ko(d,2e4),monthsValue:Io(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:Ah,extraPercent:d?.extraPercent??Oh},{normalizer:g}),x=Vh(y),b=Boolean(y?.("isNewClient")?.value),v=h?.find((e=>e?.extraPercents))?.extraPercents,N=kh(h,x),w=fh(f,N,s),{rate:C,income:S,finalSum:k,type:I=""}=w,T=r((()=>{Ao({field:y,defParams:Co(N,b,v),calcParams:w,monthsValue:"minMonths",map:_h})}),[y,h,v]);i((()=>{!Yo(d)&&N&&T()}),[d,h]);const P=y?.("extraPercent")?.value?.key,E=Lh(C,P),D=C===Co(N,b)?.rate&&P===v?.at(-1)?.key;return o(fo,{className:e,title:t,...m,children:c("section",{className:u(yo,e),children:[c("div",{className:xo,children:[c("div",{className:"flex gap-m",children:[_o({className:"w-full",title:`Сумма, ${x?.text}`,min:w.minSum,max:w.maxSum,...y("moneyValue"),value:w.moneyValue,postfix:x?.text,step:Bh(x?.key)}),h&&h?.length>1?o(Ln,{label:"Валюта",options:p,...y("currency")}):null]}),Po({title:"Срок, месяцев",min:w.minMonths,max:w.maxMonths,availableMonths:w.availableMonths,...y("monthsValue"),value:w.monthsValue}),Th({...w,...s},y,v)]}),Zu({rate:E,children:zh(T,D)}),lh({income:S,finalSum:k,buttons:[...a,Fh(n?.buttons,I)],footnotes:[l],postfix:x?.text,isCapitalization:y("isMonthlyInterestPayment").value})]})})})),Bh=(e="")=>vh(e)?1e3:100,Fh=(e=[],t="")=>{const{type:n,...a}=e.find((e=>e.type===t))??{};return a},zh=(e,t=!1)=>t?null:o(Dr,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),Lh=(e,t)=>Number(e)+Number(t??0),Vh=e=>e?.("currency")?.value??Ah,$h=e=>jh({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&jh({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),jh=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],qh={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},Uh=(e,t,n)=>{const{moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l}=e,s=t?.rateRows||[qh],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>$h({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=Vo(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=Vo(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l})=>e?.find((e=>$h({row:e,userInputParams:t,paramsViewSettings:n})&&jo(a+l,["minSum","maxSum"],e)&&jo(r,["minSumOld","maxSumOld"],e)&&jo(l,["minSumExtra","maxSumExtra"],e)&&jo(i,["minMonths","maxMonths"],e)))||qh)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l}),{rate:p}=h,g=Oo(p,e),f=e.oldMonthlyPayment-g;return{...h,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l,monthlyPayment:g,benefit:f}},Wh=Yt((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,paramsViewSettings:r,...s})=>{const[d,{field:m}]=bn({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),h=Uh(d,n,r),p=l((()=>wo(n?.rateRows)?.rate),[n?.rateRows]),g=Ro({...m("isAnnuity")});return o(fo,{className:e,title:t,...s,children:c("section",{className:u(yo,e),children:[c("div",{className:xo,children:[_o({title:"Остаток долга в других банках, ₽ ",step:500,min:h.minSum,max:h.maxSum-h.maxSumExtra,...m("moneyValue"),value:h.moneyValue}),_o({title:"Ежемесячный платёж в других банках, ₽",step:500,min:h.minSumOld,max:h.maxSumOld,...m("oldMonthlyPayment"),value:h.oldMonthlyPayment}),Po({title:"Новый срок кредита, месяцев",min:h.minMonths,max:h.maxMonths,...m("monthsValue"),value:h.monthsValue}),Hh({...h,...r},m),h.isExtraMoney?_o({title:"Дополнительная сумма, ₽ ",step:500,min:h.minSumExtra,max:h.maxSumExtra,...m("moneyExtra"),value:h.moneyExtra}):null,o("div",{className:"sm:hidden pb-m border-b border-main-divider",children:g})]}),c("div",{className:u(bo,"@4xl:w-1/2"),children:[o(No,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(No,{title:"Ставка от",value:p,fractionDigits:2,postfix:"%"}),o(No,{title:"Ежемесячный платёж",value:h.monthlyPayment,postfix:"₽"}),h.benefit>0?o(No,{title:"Выгода в месяц",value:h.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:g}),Ye(a,{isVertical:!0}),To(i)]})]})})})),Hh=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(ci,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(ci,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(ci,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),Yh=d((e=>{const{onChange:t,min:n,max:a,defaultValue:i="0",fractionDigits:l=0,...s}=e,c=aa(e,{normalize:(e=i)=>n&&a?String(ia(Number(Gh(e)),n,a)):Gh(e),format:Je(l)}),d=r((e=>t&&t(Gh(e))),[t]);return o(Tn,{onChange:d,...s,...c})})),Gh=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Kh=d((e=>o(Yh,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Le,{size:"text-xl",font:"font-light",children:"₽"})})}))),Xh={private:"p2p/registerP2P",business:"b2c/registerB2C"},Jh=({onClose:e,errorCode:t,errorMessage:n})=>{const a=t?`Код ошибки - ${t}`:"Пожалуйста, повторите позднее";return o(_r,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto",onClose:e,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ie,{image:{icon:"ResponseFailIcon",iconVersion:"normal"},width:"136",height:"136"}),o(S,{className:"w-full",title:"Ошибка перевода",description:a,headlineVersion:"XS",isEmbedded:!0}),n?c("div",{className:"bg-secondary-dark rounded-xl p-m grid gap-m grid-cols-12",children:[o("div",{className:"col-span-8",children:n}),o("div",{className:"col-span-4",children:o(ie,{image:{icon:"ResponseFailIcon",iconVersion:"normal"}})})]}):null]})})},Zh=e=>{const t=Nn(Jh),n=_d(),a=sn(),i="private"===e?"p2p":"b2c";return r((async({amount:r})=>{const l=await(async(e,t)=>{const n=sn(),a={amount:String(t),currency:"643",returnUrl:`${n.origin}/p2p/success`,failUrl:`${n.origin}/p2p/failed`,language:"ru"},i=`${Qt}/payment/${Xh[e]}`;try{const e=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(a)});return e.ok?await e.json():null}catch(e){return null}})(e,r);(e=>Boolean(e?.formUrl)&&Boolean(e?.orderId))(l)&&(n.transaction={orderId:l.orderId,type:i,url:a.href},a.assign(`${i}/?formUrl=${encodeURIComponent(l.formUrl)}`)),(e=>Boolean(e?.errorMessage)&&0!==e?.errorCode)(l)&&t.open({errorCode:l.errorCode,errorMessage:l.errorMessage})}),[e])},Qh={amount:1500},ep=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:a,formType:i="private",...r})=>{const l=Zh(i),[{amount:s},{field:d,onSubmit:m}]=bn(Qh,{onSubmit:l});return c(g,{className:u("flex flex-col gap-4xl items-center",e),defaultPadding:"p-6xl",...r,children:[t?o(N,{className:"self-start xl:self-center",headingType:"h3",title:t}):null,c("form",{className:"w-full xl:max-w-md space-y-lg",method:"POST",onSubmit:m,children:[o(Kh,{valid:s>0,label:n,max:3e5,min:1,...d("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:s}),a?.text?o($r,{className:"w-full",disabled:s<=0,children:a.text}):null]})]})})),tp=({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(G,{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})]}),np="relative h-full",ap={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},ip=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...a})=>{const{blocks:i}=a.block||{},r=i?.some(sp),l=n?{defaultPadding:"p-6xl pb-m"}:{};return D({...a,renderProps:(n,a,i)=>c("div",{className:rp(n,{someCardsHighlighted:r}),children:[T(n,a,{className:lp(n,{someCardsHighlighted:r,showBorder:!e,cardSize:t}),...l,blockIndex:i}),sp(n)?tp({className:"absolute top-0 -right-4 z-40"}):null]},String(i))})},rp=(e,{someCardsHighlighted:t})=>u(np,t&&(sp(e)?"pt-3xl":"pt-16")),lp=(e,{someCardsHighlighted:t,showBorder:n,cardSize:a="normal"})=>u(np,"min-w-80",ap[a],t&&(sp(e)?"pt-16":"pt-3xl"),Gm(n),n&&"h-full"),sp=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,op=Yt((({className:e,visibleItemCount:t=1,noCardBorder:n,arrowsPadded:a=!0,isGap:i=!0,cardSize:r="normal",isNavButtons:l=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o(vu,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:i?16:0,padding:0,arrowsPadded:a,navButtons:l?cp(s?.block?.blocks):[],hasBlur:!0,children:ip({noCardBorder:n,cardSize:r,isNavButtons:l,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),cp=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],dp={black:"bg-black",white:"bg-white"},mp=d((({className:e="",title:t,description:n,image:a,price:i,button:r,colors:l=[],align:s="text-left",padding:d,...m})=>o(g,{className:u("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(_e,{className:"h-full",padding:d,title:o(S,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s,className:"min-h-24"}),rightImage:a?.src?o(ie,{className:"flex justify-center align-center mb-xl",image:a}):null,buttons:Ye([r],{buttonClassName:"w-full self-end"}),children:[l?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(Le,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),l.map(up)]}):null,i?c(Le,{size:"text-h3",align:"text-left",children:[i," ₽"]}):null]})}))),up=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${dp[e]}`},String(t)),hp=d((({className:e="",href:t,target:n,onClick:a,data:i,children:r})=>{const l=xe()({href:t,target:n,onClick:a});return o(t?"a":"div",{className:u("block",e),...t?l:{},role:t?"link":"none",...ve(i),children:r})})),pp=[{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"}}],gp=d((({className:e="",media:t,showButtonText:n,stretched:i,version:r="white",children:l})=>{if(!t?.length)return null;const[s,d]=a(),m=t?.map((e=>{const{href:t,icon:a,text:i}=e,{iconMapped:l}=(e=>pp.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=He(a)?a:l,c=n?{text:i}:{text:""},m=e?.icon?.iconVersion||"color";return!s&&i&&d(!0),{...e,...c,icon:{...o,iconVersion:m},version:e?.version??r}})),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},fp(i));return c("div",{className:u("flex flex-col gap-m xl:gap-xs",e),"aria-label":"Социальные сети",children:[o("div",{className:"flex gap-xs",children:Ye(m,{className:yp(s??!1,i??!1,n),buttonClassName:h})}),l?o(Le,{size:"text-s",font:"font-light",color:"text-secondary-text",children:l}):null]})})),fp=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",yp=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),xp=d((({className:e,padding:t,description:n,additionalDescription:a,href:i,icon:r,isDotted:l,__html:s,socialMedia:d=[],target:m,title:h,align:p="text-left",benefits:f,imageOptions:{directionRight:y=!0,isImageAlwaysOnRight:x=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(hp,{href:i,target:m,className:"h-full",data:km(v),children:c(_e,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(S,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...ot(He(r)?o(ie,{image:r}):null,y),buttons:d.length?o(gp,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:x,isImageSecondary:b,imageAlign:"center",children:[o(We,{benefits:f}),s?o(Fe,{__html:s,isDotted:l,itemSize:"list-s"}):null,bp(a,p)]})})}))),bp=(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,vp=new he,Np=(e,t)=>{const{title:n,description:a,buttons:i}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[n?o("div",{className:"opacity-80",children:o(Le,{size:"text-m",color:"text-secondary-text",children:n})}):null,a?o("div",{className:"mt-2xs",children:o(Le,{size:"text-xl",color:"text-primary-text",children:a})}):null,i?.length?o("div",{className:"text-primary-main",children:Ye(i)}):null]},String(t))},wp=d((({className:e="",title:t,align:n="text-center",icon:s,button:d,visibleCellsCount:m=1,cardCells:h=[],options:p,data:f,...y})=>{const x=l((()=>h.map(Np)),[h]),[b,v]=l((()=>m>0?[x.slice(0,m),x.slice(m)]:[x,[]]),[m,x]),[w,C]=a(!1);i((()=>vp.subscribe("fold",(e=>{e&&p?.parent&&e.parent===p?.parent&&C(e.isUnfolded)}))),[p?.parent]);const S=r((()=>{vp.fire("fold",{type:"fold",isUnfolded:!w,parent:p?.parent})}),[w,p?.parent]);return c(g,{className:u("flex flex-col",e),defaultPadding:"p-2xl",...y,children:[o(ie,{className:"self-center",image:s}),t?o(N,{className:u("pt-xs",n),headingType:"h5",title:t}):null,d?.text?o(ke,{className:"w-full mt-m mb-lg",...d}):null,v.length?c(Vl,{children:[c("div",{children:[b,o($l,{isUnfolded:w,children:v})]}),h.length>=m?o(Ll,{className:"mt-m",label:w?"Скрыть":"Подробнее о тарифе",isUnfolded:w,embedded:!0,data:f,onClick:S}):null]}):o("div",{children:b})]})})),Cp=d((({className:e,contacts:t,info:n,version:a="secondary",...i})=>c(g,{className:u("flex",e),defaultPadding:"p-6xl",version:a,...i,children:[n?.length?Sp(n):null,t?.length?Sp(t):null]}))),Sp=e=>o("div",{className:"flex gap-5xl grow basis-0",children:e.map(((e,t)=>kp({column:e,i:t})))}),kp=({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:a},i)=>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(a?.text)}),children:Ye([a])})]},String(i))))},`col-${String(t)}`):null,Ip=()=>{const e=globalThis.sessionStorage?.getItem("refreshToken"),t=globalThis.sessionStorage?.getItem("accessToken"),n=globalThis.localStorage.getItem("taskId"),a=sn();if(!t||!e||!n)return a.assign("/"),()=>{};const i=async()=>{const n=await yl("/auth/refresh","POST",{refresh_token:e,access_token:t});if(401===Number(n?.status)&&a.assign("/"),n?.ok){const e=await n.json();globalThis.sessionStorage.setItem("refreshToken",e.refresh_token),globalThis.sessionStorage.setItem("accessToken",e.access_token)}};i();const r=setInterval(i,24e4);return()=>clearInterval(r)},Tp=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 pr-m text-gray",children:t}):null]})]}))),Pp=d((({step:e=1,totalSteps:t=6,stepsTitles:n=[]})=>{const a=l((()=>(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(Tp,{step:a,showPercentage:!1})]})})}));var Ep;!function(e){e.process="IN_PROCESS",e.ok="APPROVED",e.fail="CANCELLED",e.pre_decision="PRE_DECISION",e.approved="APPROVED",e.cancelled="CANCELLED",e.failed="FAILED",e.draft="DRAFT",e.rework="REVISION",e.dboClient="DBO_CLIENT",e.clientNotOk="CLIENT_NOT_OK",e.notFound="NOT_FOUND"}(Ep||(Ep={}));const Dp=e=>fl("/user-data/getTaskStatus","POST",e),Rp=async e=>{const t=await fl("/user-data/sendSignalToProcess","POST",e);return t?.statusCd||null},_p=d((({title:e,interval:t=0,onEnd:n=pa})=>{const[i,r]=a(t);zd({seconds:t,onTick:r,onEnd:n});const l=100-(t-i)/t*100;return c("div",{children:[e?o(S,{title:e,headlineVersion:"S"}):null,c("div",{className:"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) ${l}%, rgb(125, 126, 127) 0deg)`}}),o("div",{className:"z-10 flex items-center justify-center w-20 h-20 rounded-full bg-white text-primary-text text-m",children:o(Md,{seconds:i})})]})]})})),Ap=d((({title:e,description:t,sectionInfoTitle:n,sectionInfo:a,sectionAdditionalTitle:i,sectionInfoAdditional:r,buttonText:l,interval:s,onExpire:d=pa,...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"}),s?o(_p,{interval:s,onEnd:d}):null]}),o(Op,{title:n,items:a}),o(Op,{title:i,items:r,countColumns:!0}),l?o(qr,{href:"/natural",text:l,version:"primary",className:"w-full mt-lg"}):null]}))),Op=({title:e,items:t,countColumns:n=!1})=>{const a=Ee();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(Le,{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",kr(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:Mp(e)},t)))}):null]})]}):null},Mp=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Le,{color:"text-secondary-text",size:"text-l",children:e}),o(Le,{color:"text-primary-text",size:"text-xl",children:t})]}),Bp=d((()=>o(Ap,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Fp=d((({onExpire:e})=>{const{statusInfo:t}=Ys();return o(Ap,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:t?.cardCategory}],onExpire:e})})),zp=d((()=>{const{statusInfo:e}=Ys(),t="courier"===e?.methodObtain;return o(Ap,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:t?"":"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:t?"Адрес доставки":"В отделении Банка",sectionInfoAdditional:t?[{description:e?.deliveryAddress}]:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Lp=d((()=>{const{statusInfo:e}=Ys();return o(Ap,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получить ваш кредит",sectionInfo:Vp(e),buttonText:"Вернуться на главную"})})),Vp=e=>{const t=[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:e?.cardCategory}];return e?.deliveryAddress&&e?.deliveryDate?t.concat([{label:"Адрес доставки",description:e?.deliveryAddress},{label:"Дата доставки",description:Jt(e?.deliveryDate)}]):t},$p=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],jp=d((()=>{const[e,t]=a(Ep.process),{taskId:n}=Ys();i((()=>{(async()=>{for(const e of $p)await Rp({signalType:e,taskId:n})})()}),[n]);const l=r((async e=>{const a=await Dp({taskId:n});a&&a?.statusCd!==Ep.process&&(e(),t(a.statusCd))}),[n]);Fd(l,3e4);const s=r((()=>t(Ep.rework)),[]);return qp(e,s)})),qp=(e,t)=>({IN_PROCESS:o(Fp,{onExpire:t}),CANCELLED:o(Bp,{}),FAILED:o(Bp,{}),DRAFT:o(Bp,{}),APPROVED:o(Lp,{}),PRE_DECISION:o(Lp,{}),REVISION:o(zp,{})}[e]||o(zp,{})),Up=e=>(t,n)=>t.filter((e=>e)).map((t=>[Wp(n,e),Hp(t,e),Yp(t,e),Jp(t,e),Gp(t,e),Kp(t,e),Xp(t,e)].some(Boolean)?{...t,required:!1}:t)),Wp=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Hp=({name:e},t)=>"wages"===e&&"RETIREE"===t("employment")?.key&&!t("inn"),Yp=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Gp=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Kp=({name:e},t)=>"addressFact"===e&&t("addressMatch"),Xp=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const a=t(e?.name);return n!==(a?.key??a)})),Jp=({name:e},t)=>"snils"===e&&Zp(t),Zp=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,Qp={...Sd,...kd},eg=({field:e,inputs:t,params:n})=>t.map(Sr(e,n,Qp)),tg=({sections:e,field:t,step:n,params:a})=>e?.map((({inputs:e=[],columns:i,title:r,condition:l},s)=>{const c=Up(ng(t))(e,n),d=[Xp({condition:l},ng(t))?null:Ir(r),...eg({field:t,inputs:c,params:a})].filter(Boolean).map(((e,t)=>({...e,key:e.key??`elem-${t}`})));return d.length?o("div",{className:u(kr(i),"grid gap-x-m"),children:d},`section-${s}`):null})),ng=e=>t=>e(t)?.value,ag=({formState:e,inputs:t,step:n,productType:a})=>{return rr(Up((t=>e[t]))(t,n),{...hl,limitedBirthday:cl(a),dulIssueDate:(i=e.limitedBirthday,gn((e=>!(!e||!i)&&e.getTime()>=new Date(i?.getFullYear()+14,i?.getMonth(),i?.getDate()).getTime()))("Укажите дату выдачи паспорта"))})(e);var i},ig=d((({step:e,isSending:t,onPrevStep:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Dr,{version:"secondary",disabled:0===e,onClick:n,children:"Назад"}),o($r,{isLoading:t,children:a?"Отправить заявку":"Далее"})]})})),rg=(e,t,n)=>({...n[e],...t,limitedBirthday:lg(t?.limitedBirthday),dulIssueDate:lg(t?.dulIssueDate),participantDateRegistration:lg(t?.participantDateRegistration),beginDate:lg(t?.beginDate),deliveryDate:lg(t?.deliveryDate)}),lg=e=>{try{return e?new Date(e):void 0}catch(e){return}},sg=(e=!1)=>[{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDate: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:""},familyMembers:void 0,dependents:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!!e&&void 0,esiaAccountTypeCd:{key:"",text:""},initiateBankruptcyFlg:!e&&void 0},{bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0}],og=[{paymentSystem:{key:"",text:""},currency:"810",codeWord:""},...sg(),{regionRetail:{key:"",text:""},addressRetail:{key:"",text:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:void 0,deliveryDate:void 0}],cg=e=>{const{currency:t,paymentSystem:n,cardCategory:a,codeWord:i}=e;return{currencyCode:t?{key:t}:void 0,paymentSystemTypeCd:n,classCard:a,codeWord:i}},dg=e=>{const{beginDate:t,employment:n,organizationName:a,inn:i,legalForm:r,organization:l,amountWorkers:s,employerActivities:o,employerOrganization:c,generalSeniority:d,lastJobExperience:m,experience5Years:u,jobsNumber:h,organizationPhone:p,organizationAddress:g,positionOrganization:f,partInBusiness:y}=e;return{employmentContractDate:Jt(t||"",!0),employmentTypeCd:n,organizationName:a,organizationInn:i,organizationActivityTypeCd:o?.key?o:void 0,organizationTypeCd:l,organizationKindCd:c,employeesNumberCd:s,opf:r,seniority:d,generalSeniority:u,jobsNumber:h,lastWorkDuration:m,positionCd:f?.key?f:void 0,participantContacts:dm({organizationPhone:p&&Zt(p)}),participantAddresses:mm({organizationAddress:g}),ownershipShare:"BUSINESS_OWNER"===f?.key?y:void 0}},mg=e=>{const{name:t,surname:n,middleName:a,limitedBirthday:i="",phone:r="",email:l,sex:s,birthPlace:o,dulIssueDate:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g,housing:f,addressRegistration:y,addressFact:x,addressMatch:b}=e;return{birthDate:Jt(i,!0),midname:a,name:t,surname:n,birthPlace:o,dulIssueDate:Jt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:g?Jt(g,!0):void 0,homeMatchFlg:b,houseTypeCd:f,participantContacts:dm({phone:Zt(r),email:l}),participantAddresses:mm({addressRegistration:y,addressFact:x}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}},ug=e=>e?new Date(e).toISOString().split(".")[0]:"",hg=e=>{const{methodObtain:t,deliveryDate:n="",deliveryTime:a}=e,i="courier"===t,r=a?{deliveryTimeCd:{key:a}}:{};return i?{courierDeliveryFlg:i,deliveryDate:ug(n.toString().replace(/(GMT)[+-]\d{4}/,"GMT+0000")),office:{id:"3"},...r}:{}},pg=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{office:{id:t.key}}:{}},gg=(e,t)=>{switch(e){case 0:default:return{};case 1:return mg(t);case 2:return dg(t);case 3:return um(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:a,creditInRshbCd:i}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:a,creditInRshbCd:i}})(t);case 5:return(e=>{const{addressCourier:t,methodObtain:n}=e;return"courier"===n?{participantAddresses:mm({addressCourier:t})}:{}})(t)}},fg=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=un(!1),o=5===e,c=Ys(),d=l((()=>rg(e,c.leadForm,og)),[e,c.leadForm]),m=r((e=>{const{leadForm:t}=c;o&&e.ok&&t&&(c.statusInfo={regionRetail:t?.regionRetail?.text,addressRetail:t?.addressRetail?.text,deliveryAddress:t?.addressCourier?.fullAddress,cardCategory:t?.cardCategory?.text,deliveryDate:t?.deliveryDate},c.leadForm=d)}),[o,d]),u=r((async a=>{i(),c.leadForm=a;try{const{taskId:i,profileId:r,participantId:l}=c;if(i&&r&&l){const t=await Od((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{id:t,...pg(a),authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...gg(i,a)}],...cg(a),...hg(a),files:a?.files}}))({participantId:l,taskId:i,profileId:r,step:e,formData:a}));m(t)}o?n?.():t()}catch(e){}finally{s()}}),[o,m]);return[d,u,a]},yg=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,onFinish:i})=>{const s=l((()=>t?.flatMap((e=>e?.inputs||[]))),[t]),d=r((t=>ag({formState:t,inputs:s,step:e,productType:"creditCard"})),[s]),[m,u,h]=fg({step:e,onNextStep:a,onFinish:i}),[,{field:p,onSubmit:g}]=bn(m,{formValidator:d,onSubmit:u});return c("form",{onSubmit:g,className:"space-y-m",children:[tg({sections:t,field:p,step:e}),o(ig,{isSending:h,step:e,onPrevStep:n})]})})),xg=[{title:"Персональные данные",columns:2,inputs:[{name:"surname",required:!0,dadata:!0,filledByEsia:!0},{name:"name",required:!0,dadata:!0,filledByEsia:!0},{name:"middleName",dadata:!0,filledByEsia:!0},{name:"sex",required:!0},{name:"limitedBirthday",required:!0,filledByEsia:!0},{name:"birthPlace",required:!0,filledByEsia:!0},{name:"phone",disabled:!0,required:!0},{name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{name:"dulSerie",required:!0,filledByEsia:!0},{name:"dulNumber",required:!0,filledByEsia:!0},{name:"dulIssueDate",required:!0,filledByEsia:!0},{name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0}]}],bg=[{title:"Регион обслуживания карты",columns:1,inputs:[]},{inputs:[{name:"regionRetail",required:!0}]},{title:"Способ получения",columns:1,inputs:[],condition:{name:"regionHasDelivery",values:[!0]}},{inputs:[{name:"methodObtain",condition:{name:"regionHasDelivery",values:[!0]}}]},{title:"Выбор офиса",columns:1,inputs:[],condition:{name:"methodObtain",values:["office"]}},{title:"Адрес доставки",columns:1,inputs:[],condition:{name:"methodObtain",values:["courier"]}},{inputs:[{name:"addressCourier",dadata:!0,condition:{name:"methodObtain",values:["courier"]},required:!0}]},{columns:2,inputs:[{name:"deliveryDate",condition:{name:"methodObtain",values:["courier"]},required:!0},{name:"deliveryTime",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{name:"comment",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{name:"addressRetail",required:!0,condition:{name:"methodObtain",values:["office"]}}]}],vg=[[{title:"Параметры карты",inputs:[]},{inputs:[{name:"currency",required:!0},{name:"paymentSystem",required:!0},{name:"cardCategory",required:!0},{name:"codeWord",required:!0}]}],[...xg,{inputs:[{name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{name:"addressMatch"}]},{columns:2,inputs:[{name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{name:"housing",required:!0}]},{inputs:[{name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{name:"infoCard",label:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{name:"employment",required:!0},{name:"organizationName",required:!0,dadata:!0,filledByEsia:!0}]},{columns:2,inputs:[{name:"inn",required:!0,dadata:!0,filledByEsia:!0},{name:"legalForm",required:!0}]},{inputs:[{name:"organization",required:!0},{name:"amountWorkers",required:!0}]},{columns:2,inputs:[{name:"employerActivities",required:!0},{name:"employerOrganization",required:!0},{name:"generalSeniority",required:!0,filledByEsia:!0},{name:"lastJobExperience",required:!0,filledByEsia:!0},{name:"experience5Years",required:!0,filledByEsia:!0},{name:"jobsNumber",required:!0,filledByEsia:!0}]},{inputs:[{name:"organizationPhone",label:"Телефон работодателя",required:!0},{name:"beginDate",required:!0,filledByEsia:!0}]},{columns:2,inputs:[{name:"positionOrganization",required:!0},{name:"partInBusiness",required:!0,condition:{name:"positionOrganization",values:["BUSINESS_OWNER"]}}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{name:"familyStatus",required:!0}]},{columns:1,inputs:[{name:"children",required:!0}]},{columns:2,inputs:[{name:"dependents",required:!0},{name:"familyMembers"}]},{title:"Совокупный доход"},{columns:1,inputs:[{name:"confirmationIncome",required:!0,filledByEsia:!0}]},{inputs:[{name:"infoCard",label:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{name:"wages",required:!0,filledByEsia:!0}]},{columns:1,inputs:[{name:"retirementIncome",required:!0,condition:{name:"employment",values:["RETIREE"]}}]},{columns:1,inputs:[{name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{name:"snils",required:!0}]},{columns:1,inputs:[{name:"conscription",required:!0}]},{columns:2,inputs:[{name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{name:"bankruptcyFlg"}]},{inputs:[{name:"shareholderFlg"}]},{inputs:[{name:"legalEntityName"}]},{inputs:[{name:"creditInRshbCd"}]}],[...bg,{inputs:[{name:"infoCard",label:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код",condition:{name:"methodObtain",values:["office"]}},{name:"bankEmployeeCode",condition:{name:"methodObtain",values:["office"]}}]}]],Ng=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],wg=d((({className:e,...t})=>{const[n,l]=a(0),d=s(null),m=r((()=>d?.current?.scrollIntoView({behavior:"smooth"})),[d]);i(Ip,[]);const u=r((()=>{l((e=>Math.min(e+1,6))),m()}),[]),h=r((()=>{l((e=>Math.max(e-1,0))),m()}),[]),p=vg[n],[f,{setTrue:y}]=un(!1);return o(g,{className:e,...t,children:c("div",{ref:d,className:"container grid grid-cols-12",children:[f?null:o(Pp,{stepsTitles:Ng,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:f?o(jp,{}):o(yg,{step:n,sections:p,onNextStep:u,onPrevStep:h,onFinish:y},String(n))})]})})})),Cg=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const a=l((()=>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(Tp,{step:a,showPercentage:!1})]})})})),Sg=d((()=>o(Ap,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),kg=d((({onExpire:e})=>{const{statusInfo:t}=Ys();return o(Ap,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Цель кредита",description:"На любые цели"},{label:"Сумма",description:`${t?.calculator?.moneyValue?.toLocaleString()??"0"} ₽`},{label:"Срок кредита",description:`${t?.calculator?.monthsValue??"0"} мес`},{label:"Тип платежа",description:t?.calculator?.isAnnuity?"Аннуитетный":"Дифференцированный"}],onExpire:e})})),Ig=d((()=>{const{statusInfo:e}=Ys();return o(Ap,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Tg=d((()=>{const{statusInfo:e}=Ys();return o(Ap,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получить ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:`от ${e?.calculator?.rate??""}%`},{label:"Ежемесячный платеж",description:`${Math.round(e?.calculator?.monthlyPayment??0).toLocaleString()} ₽`},{label:"Срок кредита",description:e?.calculator?.monthsValue+" мес"},{label:"Тип платежа",description:e?.calculator?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),Pg=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],Eg=d((()=>{const[e,t]=a(Ep.process),{taskId:n}=Ys();i((()=>{(async()=>{for(const e of Pg)await Rp({signalType:e,taskId:n})})()}),[n]);const l=r((async e=>{const a=await Dp({taskId:n});a&&a?.statusCd!==Ep.process&&(e(),t(a.statusCd))}),[n]);Fd(l,3e4);const s=r((()=>t(Ep.rework)),[]);return Dg(e,s)})),Dg=(e,t)=>({IN_PROCESS:o(kg,{onExpire:t}),CANCELLED:o(Sg,{}),FAILED:o(Sg,{}),DRAFT:o(Sg,{}),APPROVED:o(Tg,{}),PRE_DECISION:o(Tg,{}),REVISION:o(Ig,{})}[e]||o(Ig,{})),Rg=d((({step:e,onPrevStep:t,isSending:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Dr,{version:"secondary",disabled:0===e,onClick:t,children:"Назад"}),o($r,{isLoading:n,children:a?"Отправить заявку":"Далее"})]})})),_g={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIATED",value:"Дифференцированный "}},Ag=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:a}=e?.calculator??{};return{loanAmount:t,creditPeriod:n,paymentTypeCd:_g[a?"annuity":"differential"]}},Og=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},Mg=(e,t)=>{switch(e){case 0:return(e=>{const{isInsurance:t,isSalaryClient:n}=e?.calculator??{};return{payrollCardRshbFlg:n,consentInsuranceFlg:t}})(t);case 1:return mg(t);case 2:return dg(t);case 3:return um(t);default:return{}}},Bg=[{calculator:{moneyValue:0,monthsValue:0,monthlyPayment:0,rate:0,isAnnuity:!1,isInsurance:!1,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1}},...sg(!0),{regionRetail:{key:"",text:""},addressRetail:void 0,bankEmployeeCode:void 0}],Fg=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=un(!1),o=4===e,c=Ys(),d=l((()=>rg(e,c.leadForm,Bg)),[e,c.leadForm]),m=r((e=>{const{leadForm:t}=c;o&&e.ok&&t&&(c.statusInfo={regionRetail:t?.regionRetail?.text,addressRetail:t?.addressRetail?.text,calculator:{monthsValue:t?.calculator?.monthsValue,moneyValue:t?.calculator?.moneyValue,isAnnuity:t?.calculator?.isAnnuity,monthlyPayment:t?.calculator?.monthlyPayment,rate:t?.calculator?.rate}},c.leadForm=d)}),[o,d]),u=r((async a=>{i(),c.leadForm=a;try{const{taskId:i,profileId:r,participantId:l}=c;if(i&&r&&l){const t=await Od((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{id:t,authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Mg(i,a)}],...Ag(a),...Og(a),esiaAccountTypeCd:{key:a?.esiaAccountTypeCd?.key},files:a?.files}}))({participantId:l,taskId:i,profileId:r,step:e,formData:a}));m(t)}o?n?.():t()}catch(e){}finally{s()}}),[o,m]);return[d,u,a]},zg=d((({step:e,sections:t,programsSource:n,onPrevStep:a,onNextStep:i,onFinish:s})=>{const{programId:d}=Ys(),m=n?.[d??""],u=l((()=>t?.flatMap((e=>e?.inputs??[]))),[t]),h=r((t=>ag({formState:t,inputs:u,step:e,productType:"credit"})),[u]),[p,g,f]=Fg({step:e,onNextStep:i,onFinish:s}),[,{field:y,onSubmit:x}]=bn(p,{formValidator:h,onSubmit:g});return c("form",{onSubmit:x,className:"space-y-m",children:[tg({sections:t,field:y,step:e,params:{calcData:m}}),o(Rg,{step:e,isSending:f,onPrevStep:a})]})})),Lg=[[{columns:1,inputs:[{name:"calculator"}]}],[...xg,{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{name:"addressMatch"}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{inputs:[{name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{name:"infoCard",label:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{name:"employment",required:!0},{name:"organizationName",required:!0,dadata:!0,filledByEsia:!0}]},{columns:2,inputs:[{name:"inn",required:!0,dadata:!0,filledByEsia:!0},{name:"legalForm",required:!0}]},{inputs:[{name:"organization",required:!0},{name:"amountWorkers",required:!0}]},{columns:2,inputs:[{name:"employerOrganization",required:!0},{name:"jobsNumber",required:!0,filledByEsia:!0}]},{inputs:[{name:"organizationPhone",label:"Телефон работодателя",required:!0},{name:"beginDate",required:!0,filledByEsia:!0}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{name:"familyStatus",required:!0}]},{columns:2,inputs:[{name:"children",required:!0},{name:"dependents",required:!0}]},{title:"Совокупный доход"},{columns:1,inputs:[{name:"confirmationIncome",required:!0,filledByEsia:!0}]},{inputs:[{name:"infoCard",label:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{name:"wages",required:!0,filledByEsia:!0}]},{columns:1,inputs:[{name:"retirementIncome",required:!0,condition:{name:"employment",values:["RETIREE"]}}]},{columns:1,inputs:[{name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{name:"snils",required:!0}]},{columns:1,inputs:[{name:"initiateBankruptcyFlg"}]}],[{title:"Отделение Банка",columns:1,inputs:[]},{inputs:[{name:"regionRetail",required:!0}]},{inputs:[{name:"addressRetail",required:!0}]},{title:"Код представителя Банка",columns:1,inputs:[]},{inputs:[{name:"infoCard",label:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код"}]},{inputs:[{name:"bankEmployeeCode"}]}]],Vg=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Отделение Банка"],$g=Yt((({className:e,programsSource:t,...n})=>{const[l,d]=a(0),m=s(null),u=r((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);i(Ip,[]);const h=r((()=>{d((e=>Math.min(e+1,4))),u()}),[]),p=r((()=>{d((e=>Math.max(e-1,0))),u()}),[]),f=Lg[l],y=0===l,[x,{setTrue:b}]=un(!1);return o(g,{className:e,...n,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[y||x?null:o(Cg,{stepsTitles:Vg,step:l,totalSteps:4}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:x?o(Eg,{}):o(zg,{step:l,sections:f,programsSource:t,onNextStep:h,onPrevStep:p,onFinish:b},String(l))})]})})})),jg=d((({step:e=1,totalSteps:t=2,stepsTitles:n=[]})=>{const a=l((()=>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(Tp,{step:a,showPercentage:!1})]})})})),qg=d((({title:e,description:t,sectionInfo:n,buttonText:a,isDboClient:i,...r})=>c(g,{...r,children:[o("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"})}),o(Ug,{items:n}),a?o(ke,{href:"/natural",text:a,version:"primary",className:"w-full mt-lg"}):null,i?c("div",{className:"flex flex-col md:flex-row md:gap-lg",children:[o(ke,{href:"/natural/debetcards",text:"Заполнить заново",version:"primary",className:"w-full mt-lg"}),o(ke,{href:"https://online.rshb.ru/ib6/wf2/retail/ib/loginretaildefault",text:"Перейти в интернет банк",version:"primary",className:"w-full mt-lg"})]}):null]}))),Ug=({title:e,items:t})=>t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(Le,{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 gap-m md:grid-cols-2","md:grid-cols-2"),children:t.map(((e,t)=>o("div",{children:Wg(e)},t)))}):null]})]}):null,Wg=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Le,{color:"text-secondary-text",size:"text-l",children:e}),o(Le,{color:"text-primary-text",size:"text-xl",children:t})]}),Hg=d((()=>{const{leadForm:e}=Ys();return o(qg,{title:`${e?.name} ${e?.middleName},`,description:"Информация о Вас уже есть в системах Банка, обратите внимание на корректность заполнения паспортных данных",sectionInfo:[{label:"Фамилия",description:e?.surname},{label:"Имя",description:e?.name},{label:"Отчество",description:e?.middleName},{label:"Дата рождения",description:Jt(e?.limitedBirthday||"")},{label:"Серия документа",description:e?.dulSerie},{label:"Номер документа",description:e?.dulNumber}],isDboClient:!0})})),Yg=d((()=>o(qg,{title:"Время ожидания превышено",description:"Попробуйте отправить заявку позже",buttonText:"Вернуться на главную"}))),Gg=d((()=>o(qg,{title:"Подождите немного",description:"Банк проверяет вашу заявку"}))),Kg=d((()=>o(qg,{description:"Вы уже являетесь клиентом АО «Россельхозбанк», для Вас оформление зарплатной карты возможно в первый рабочий день",buttonText:"На главную"}))),Xg=d((({isOffice:e})=>o(qg,{title:"Заявка принята",description:e?"Ваша заявка принята, мы сообщим вам в СМС о поступлении карты в офис":"Вам позвонит сотрудник Банка для уточнения времени и даты доставки",buttonText:"Вернуться на главную"}))),Jg=d((()=>{const[e,t]=a(Ep.process),{taskId:n,statusInfo:r,programId:l}=Ys(),s="38"===l,o="office"===r?.methodObtain;return i((()=>{(async()=>{const e=await Rp({signalType:"FIND_PERSON_SIGNAL",taskId:n});o&&await Rp({signalType:"SET_PERSON_SIGNAL",taskId:n}),t(e||Ep.notFound)})()}),[n]),Zg(e,o,s)})),Zg=(e,t,n)=>({IN_PROCESS:o(Gg,{}),NOT_FOUND:o(Yg,{}),CLIENT_NOT_OK:o(Yg,{}),DBO_CLIENT:o(n?Kg:Hg,{}),PRE_DECISION:o(Xg,{isOffice:t})}[e]||o(Xg,{isOffice:t})),Qg=d((({step:e,onPrevStep:t,isSending:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Dr,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o($r,{isLoading:n,children:a?"Отправить заявку":"Далее"})]})})),ef=[{regionRetail:{key:"",text:""},regionHasDelivery:!1,addressRetail:{key:"",text:""},addressCourier:{fullAddress:"",fiasCode:""},methodObtain:void 0,deliveryDate:void 0},{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDate:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},addressFact:{fullAddress:"",fiasCode:""}},{paymentSystem:{key:"",text:""},currency:"810",codeWord:"",latinName:"",latinSurname:""}],tf=e=>{const{methodObtain:t,regionRetail:n,comment:a,deliveryDate:i="",deliveryTime:r}=e,l=r?{deliveryTimeCd:{key:r}}:{};return"courier"===t?{cardServiceRegionCd:n,courierDeliveryFlg:!0,deliveryComment:a,deliveryDate:ug(i.toString().replace(/(GMT)[+-]\d{4}/,"GMT+0000")),office:{id:""},...l}:{}},nf=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{courierDeliveryFlg:!1,office:{id:t.key}}:{}},af=(e,t)=>{switch(e){case 0:return(e=>{const{addressCourier:t,methodObtain:n}=e;return"courier"===n?{participantAddresses:mm({addressCourier:t})}:{}})(t);case 1:return mg(t);case 2:return(e=>{const{latinName:t,latinSurname:n}=e;return{latinFirstname:t,latinSurname:n,latinName:`${t} ${n}`}})(t);default:return{}}},rf=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=un(!1),o=2===e,c=Ys(),d=l((()=>rg(e,c.leadForm,ef)),[e,c.leadForm]),m=r((()=>{const{leadForm:e}=c;c.statusInfo={methodObtain:e?.methodObtain},c.leadForm=d}),[d]),u=r((async a=>{i(),c.leadForm=a;try{const{taskId:i,participantId:l,programId:s}=c;i&&l&&s&&await(r=(({participantId:e,taskId:t,formData:n,programId:a,step:i=0})=>({task:{id:t,creditProgram:{code:ac[a]},...nf(n),participants:[{id:e,...af(i,n)}],...cg(n),...tf(n)}}))({participantId:l,taskId:i,programId:s,step:e,formData:a}),yl("/user-data/updateUserTaskDebit","PUT",r)),o||"courier"===a.methodObtain?(n?.(),m()):t()}catch(e){}finally{s()}var r}),[o]);return[d,u,a]},lf=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,onFinish:i})=>{const s=l((()=>t?.flatMap((e=>e?.inputs??[]))),[t]),d=r((t=>ag({formState:t,inputs:s,step:e,productType:"debitCard"})),[s]),[m,u,h]=rf({step:e,onNextStep:a,onFinish:i}),[,{field:p,onSubmit:g}]=bn(m,{formValidator:d,onSubmit:u});return c("form",{onSubmit:g,className:"space-y-m",children:[tg({sections:t,field:p,step:e}),o(Qg,{step:e,isSending:h,onPrevStep:n})]})})),sf=[bg,[...xg,{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{name:"addressMatch"}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{inputs:[{name:"addressFact",required:!0,dadata:!0}]}],[{title:"Параметры карты",inputs:[]},{inputs:[{name:"currency",required:!0},{name:"paymentSystem",required:!0},{name:"cardCategory",required:!0}]},{title:"Отображение на карте",inputs:[]},{columns:2,inputs:[{name:"latinName"},{name:"latinSurname",required:!0}]},{inputs:[{name:"infoCard",label:"Проверьте корректность заполненных полей, при необходимости внесите изменения."}]},{inputs:[{name:"infoCard",label:"Количество символов ограничивается 20. При этом, если фамилия и имя на карте содержит более 21 символа, то необходимо сократить имя и указывать на карте только первую букву имени и фамилию, если при таком сокращении фамилия и имя не умещается в количество символов – 20, то указывать только фамилию."}]},{inputs:[{name:"codeWord",required:!0}]}]],of=["","Персональные данные","Платежная система"],cf=Yt((({className:e,...t})=>{const[n,l]=a(0),d=s(null),m=r((()=>d?.current?.scrollIntoView({behavior:"smooth"})),[d]);i(Ip,[]);const u=r((()=>{l((e=>Math.min(e+1,2))),m()}),[]),h=r((()=>{l((e=>Math.max(e-1,0))),m()}),[]),p=sf[n],f=0===n,[y,{setTrue:x}]=un(!1);return o(g,{className:e,...t,children:c("div",{ref:d,className:"container grid grid-cols-12",children:[f||y?null:o(jg,{stepsTitles:of,step:n,totalSteps:2}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:y?o(Jg,{}):o(lf,{step:n,sections:p,onNextStep:u,onPrevStep:h,onFinish:x},String(n))})]})})})),df=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,mf=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),uf=1e9,hf={sum:{min:1e4,max:uf},period:3},pf=Yt((({className:e,filtrationSchema:t={},resetButton:n,sumInput:a,periodInput:i,...r})=>{const[,{blocksToRender:l,blocksWithProps:s},{field:d,reset:m}]=Ou(hf,{block:r.block,page:r.options?.page,normalize:e=>({...e,period:gf(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=ff(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...r,children:[o(Iu,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(Kh,{label:a?.title,min:500,max:uf,...d("sum",{parse:e=>({min:Number(e),max:uf}),format:({min:e})=>String(e)})}),o(ca,{title:i?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(wu,{blocksToRender:l,...r})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),gf=e=>$t((e?.paramsSource?.rateRows||[]).filter(df).flatMap((e=>mf(e.minMonths,e.maxMonths)))),ff=e=>$t(e.flatMap((e=>e||[])).filter(df).flatMap((e=>mf(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],yf=e=>"Image"===e?.contentType&&e?.image?o(ie,{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,xf=d((({className:e="",title:t,description:n,error:a,button:i,...r})=>c(g,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...r,children:[o("div",{className:"flex justify-center",children:yf(a)}),o(S,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),i?.text?o(ke,{version:i?.version,text:i?.text,...i}):null]}))),bf=d((({className:e="",items:t})=>{const n=xe();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(vf(n))})})),vf=e=>({dataFooter:t,...n},a)=>{const{text:i,href:r,target:l,onClick:s}=e(n);return i?o("li",{className:"list-none",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:r,target:l||"_self",onClick:s,...ve(t),children:i||null})},String(a)):null},Nf=e=>t=>!t.displayArea||e.includes(t.displayArea.toLowerCase()),wf=["all","footer"],Cf=d((({className:e,navigationItems:t})=>{const n=xe();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(Nf(wf)).map(n).map(Sf)})})),Sf=(e,t)=>{const{text:n,items:a=[],href:i,target:r="_self",onClick:l,dataFooter:s}=e,d=a.filter(Nf(wf));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:i,target:r,onClick:l,...ve(s),children:n}),d?o(bf,{items:d}):null]},String(t))},kf=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(If)}):null)),If=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(Le,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(Tf)})]},String(t)),Tf=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:Pf(e.type,e.text)}),o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),Pf=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Ef(t)}`,children:o(Le,{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})}},Ef=e=>e.replaceAll(/\D/g,""),Df=d((({className:e="",index:t,text:n,...a})=>{const i=xe(),{href:r,target:l,onClick:s}=i(a);return o("a",{className:u("text-secondary-text",e),href:r,target:l,onClick:s,children:n||`Документ ${t}`})})),Rf=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(Le,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(Df,{index:t,className:"text-l font-light lg:max-w-72",...e},String(t))))]}):null}))),_f="w-full lg:w-52";function Af(e,t,n=300){i((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}const Of=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:n,s1Matches:a,s2Matches:i}=function(e,t){const n=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),a=Array.from({length:e.length}),i=Array.from({length:t.length});let r=0;for(let l=0;l<e.length;l++){const s=Math.max(0,l-n),o=Math.min(l+n,t.length-1);for(let n=s;n<=o;n++)a[l]||i[n]||e[l]!==t[n]||(r++,a[l]=!0,i[n]=!0)}return{m:r,s1Matches:a,s2Matches:i}}(e,t);if(0===n)return 0;const r=function(e,t,{s1Matches:n,s2Matches:a}){let i=0;for(let r=0,l=0;r<e.length;r++){if(!n[r])continue;let s=l;for(;s<t.length;s++)if(a[s]){l=s+1;break}e[r]!==t[s]&&i++}return i}(e,t,{s1Matches:a,s2Matches:i}),l=(n/e.length+n/t.length+(n-r/2)/n)/3,s=l>.7?.1*function(e,t){let n=0;for(;e[n]===t[n]&&n<4;)n++;return n}(e,t):0;return l+s*(1-l)};const Mf=(e,t)=>(n,a)=>{for(const[i,r]of a)n.set(i,e(n.get(i)||t,r));return n},Bf=(e=[])=>e.reduce(((e,t)=>e+t),0),Ff=e=>e.toLowerCase().split(/[^0-9a-zа-я-]+/).filter((e=>e.length>=3&&!/[0-9a-z]/.test(e))),zf=e=>t=>e.map((([e,n])=>[Of(t)(e),n])).filter((([e])=>e>=.8)).map((([e,t])=>Vf(t,e))).reduce(Mf(Math.max,0),new Map),Lf=e=>t=>{return Du(t,t.map((({title:e})=>e)).map((e=>t=>{const n=Ff(t||"");return n.length?Bf(e.map((e=>Fo(n.map(Of(e)))))):0})(e))).sort((e=>(t,n)=>-e(t,n))((n=([,e])=>e,(e,t)=>n(e)-n(t)))).map((([e])=>e));var n},Vf=(e,t)=>new Map(e.map((e=>[e,t]))),$f=({basePathList:e,initialQuery:t=""})=>{const[n,r]=a(t||""),l=R();i((()=>{null!=t&&r(t)}),[t]);const{data:s}=Kn(e?.length?e:null,jf(l)),[o,c]=a(null);return Af((()=>{s&&c(s.map((e=>t=>{const{corpus:n,dictionary:a}=t||{};if(!(e&&n?.length&&a&&Object.keys(a).length))return[];const i=Ff(e);if(!i.length)return[];const r=Object.entries(a),l=[...i.map(zf(r)).reduce(Mf(((e,t)=>e+t),0),new Map).entries()].filter((([,e])=>e>=.799*i.length)).map((([e])=>n[e]));return Lf(i)(l)})(n)))}),[s,n]),[o,{value:n,onChange:r}]},jf=e=>async(...t)=>(await Promise.allSettled(t.map((async e=>[e,await Lt(z(e,"search.index.json"))])))).map((e=>"fulfilled"===e.status?e.value:[])).map(qf(e)),qf=e=>([t,n])=>n?{...n,corpus:n.corpus?.map((n=>({...n,uri:"index"===n.uri?t:U(e)(n.uri,t)})))}:{},Uf=d((({className:e,value:t,autoFocus:n,onChange:a,onFocus:i,placeholder:l="Поиск по сайту"})=>{const s=r((e=>{a&&a(e.target?.value||"")}),[a]);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(ie,{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",Sn),value:t,type:"text",name:"search-bar-input",placeholder:l,autoFocus:n,onChange:s,onFocus:i})]})})),Wf=d((({initialQuery:e,navigationItems:t,onClose:n})=>{const a=l((()=>t?.map((e=>e.href||"/"))),[t]),[i,r]=$f({basePathList:a,initialQuery:e}),s=l((()=>Hf(t)(i)),[t,i]);return o(_r,{head:o(Uf,{autoFocus:!0,...r}),onClose:n,children:o(Cf,{navigationItems:s})})})),Hf=e=>t=>e?.length&&t?.length?Du(e,t).map((([e,t])=>({...e,items:t?.map((({title:e,uri:t})=>({text:e,href:z("/",t)})))}))):[],Yf=d((({className:e,search:t,...n})=>{const[i,l]=a(""),s=r((()=>l("")),[]),d=Nn(Wf,n),m=r((e=>{l(e),Gf(e)&&d.open({initialQuery:e,onClose:s})}),[s,d]);return c("div",{className:u("relative",e),role:"search",children:[o(Uf,{value:i,placeholder:t?.placeholder,onChange:m}),o(Rr,{className:"absolute top-0 right-0 sm:hidden",onClose:s})]})})),Gf=e=>e&&e.length>=3,Kf=(e,t)=>{const{logo:n}=e??{},{dataHeader:a,dataFooter:i,...r}=n??{};return c("div",{className:"flex items-stretch gap-3xl",children:[o(Ud,{className:_f,logo:r,data:i,showTitle:!1}),o(Yf,{className:"grow",navigationItems:t,...e})]})},Xf=d((({className:e="",index:t,...n})=>{const a=xe(),{href:i,target:r,text:l,onClick:s}=a(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-72",e),href:i,target:r,onClick:s,children:l||`Документ ${t}`})})),Jf=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(Le,{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(Xf,{index:t,...e},String(t))))}):null]}))),Zf=Yt((({className:e,footer:t,...n})=>{const{navigationItems:a}=n.options?.page?.navigation??{},i=n.options?.page?.common??{},{documents:r,relatedEnterprises:l,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:[Kf(i,a),c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(Cf,{navigationItems:a}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u(_f,"flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(kf,{items:s}),h?o(ke,{className:"w-full",version:"primary",...h}):null,d.map(((e,t)=>o(gp,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),f.map(((e,t)=>o(qr,{className:"text-s font-light",...e},`${e.href}_${t}`)))]})]}),o(Rf,{title:m,links:l}),o(Jf,{links:r,license:p})]})})),Qf=(e=!1)=>e?{}:{padding:"p-0"},ey={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},ty=[1,2,3,4],ny={link:{allOf:[{$ref:"#/definitions/LinkCommonProps"},{type:"object",properties:{data:{type:"array",items:{$ref:"#/definitions/AspectsDef"},title:"Дополнительные атрибуты"}}}],title:"Ссылка (если заполнено, то кнопка скрывается)",required:["href"]}},ay=Yt((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:r=!0,version:s="transparent",isTheme:c=!1,isCardBorder:d=!1,block:m={},...h})=>{const p=(e=>{const[t,n]=a(e.blocks??[]),r=_d(),s=r?.offerIds||[],o=l((()=>{const t=new Map(e.blocks?.map((e=>[e?.__id,e]))??[]);return[...s.map((e=>t.get(e))).filter((e=>Boolean(e))),...e.blocks?.filter((({__id:e=""})=>!s.includes(e)))??[]]}),[e,s]);return i((()=>{o.length&&n(o)}),[e]),t})(m);return o(g,{className:u("grid grid-cols-1 sm:grid-cols-1 lg:grid-cols-4 lg:auto-rows-fr",ey[n],e),padding:t,version:s,isTheme:c,...h,children:D({...h,block:{...m,blocks:p},renderProps:iy({isInnerPadding:r,isCardBorder:d})})})}),{childrenTypes:["ProductBlock"],childSchema:()=>ny,allowRemoveChild:e=>(e?.blocks??[]).length>5}),iy=({isInnerPadding:e,isCardBorder:t})=>(n,a,i)=>T(n,{...a,blockDecorator:ry(a.blockDecorator,i)},{className:u("w-full",Gm(t)),...Qf(e)}),ry=(e,t=0)=>(n,a)=>e?.({...n,render:e=>sy(t)({...n,...e},a)},`wrap_${a}`)??sy(t)(n,a),ly=e=>Number(e)<5?"":"hidden",sy=e=>({blockClassName:t,block:n,render:a},i)=>{const r=((e,t)=>{const n={...e.content};return ty.includes(t)?(delete n.description,delete n.benefits,n.link?.href&&delete n.buttons,n.imageOptions={...n.imageOptions,className:"max-w-max !h-auto"},n.headlineVersion="S"):((n.buttons??[]).length&&delete n.link,n.headlineVersion="L"),{...e,content:n}})(n,e);return o(hp,{...r.content?.link,className:u(ly(e),(l=e,ty.includes(l)?"lg:col-span-1 lg:row-span-1":"lg:col-span-2 lg:row-span-2")),children:a({blockClassName:u(t,"h-full"),block:r})},String(i));var l},oy=Yt((({className:e,title:t,button:n,regionSource:i,data:r,...l})=>{const[s,d]=a({key:""}),m=i?.regions??[],h=m?.find((e=>e.name===s.key))?.href;return o(g,{className:e,defaultPadding:"p-6xl",...l,children:c("div",{className:"container space-y-m",children:[t?o(N,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(Ln,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:m.map((({name:e=""})=>({key:e,text:e}))),value:s,onChange:d}):null,h?o("div",{className:"text-center",children:o(qr,{className:u("w-full @xl:w-auto"),href:h,target:"_blank",version:n?.version??"primary",data:km(r,s?.key),children:n?.text?n.text:"Перейти"})}):null]})})}));function cy(e=[]){const t=R(),n=Array.from(e.entries()).filter((([,e])=>dy(t)(e)));return n.find((([,e])=>dy(t,!0)(e)))??n[n.length-1]??[]}const dy=(e,t=!1)=>({href:n})=>{if(!n)return!1;const a=F(my(e)(n));return t?a===F(n):a.startsWith(F(n))},my=e=>t=>{const n=Z(J.SITE_URL);return O(t)?globalThis?.location?.href:z(n,e.pathname)},uy={default:"w-6 h-6",medium:"w-10 h-10",large:"w-12 h-12"},hy=d((({className:e,isRounded:t,buttonSize:n="default",isGrayBg:a=!1,disabled:i,ariaLabel:r="Меню второго уровня",image:l,data:s,onClick:c,version:d,isLoading:m,dataTestId:h=""})=>o("button",{className:u("group/btn border-0 flex shrink-0 items-center",a?"p-s rounded-full":"p-0 bg-inherit","transparent"===d?"backdrop-opacity-30 bg-white/30":a&&!t?"bg-main-divider":"",t?"w-8 h-8 text-secondary-light hover:text-secondary-hove":`${uy[n]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:i,"aria-label":r,onClick:c,...py(h),...ve(s),children:m?o("div",{className:"w-full h-full rounded-full border-4 border-r-transparent animate-spin text-primary-main"}):o(ie,{image:l,className:u("h-full",{"bg-main-divider/20 rounded-full":t}),imageClassName:"group-hover/btn:text-primary-hover group-hover/btn:invert-0"})}))),py=e=>e?{"data-test-id":e}:null,gy=d((({iconVersion:e,className:t,ariaLabel:n="Чат",version:a,buttonSize:i="large"})=>{const[l,{setTrue:s,setFalse:c}]=un(!1),d=mn(),m=r((e=>{const t=d.openChatBot;t&&(s(),t(e).finally(c))}),[]);return o(hy,{className:t,image:{icon:"ChatBotIcon",iconVersion:e},ariaLabel:n,onClick:m,buttonSize:i,isGrayBg:!0,version:a,isLoading:l,disabled:l,dataTestId:"chat icon"})})),fy=({dropdownRef:e,items:t=[],activeItem:n,ariaLabel:a})=>o("div",{ref:e,className:"absolute flex flex-col rounded-md bg-white p-xl pb-xs w-56 z-40","aria-label":a,children:xy(t,n)}),yy=d((({isActive:e,...t})=>{const n=xe(),{text:a,href:i,target:r,onClick:l}=n(t);return o("a",{className:u("text-l font-light pb-m hover:text-primary-main",{"text-primary-main":e}),href:i,target:r,onClick:l,role:"link",...ve(t?.data),children:a})})),xy=(e,t)=>e?.map(((e,n)=>o(yy,{isActive:e===t,...e},e?.text??String(n))));function by({items:e,activeItem:t,onClose:n,isOpen:a}){const l=_n();i((()=>{a&&l.close()}),[a]);const c=r((()=>{l.close(),n?.()}),[n]),d=s(null),m=Rn(c);return i((()=>{if(!a||!d.current||!e?.length)return;const n=d.current,{top:i,left:r,width:s,height:c}=n.getBoundingClientRect();l.open({popup:o(fy,{dropdownRef:m,items:e,activeItem:t}),top:i+window.scrollY+c,left:r,width:s})}),[a,e,c]),d}const vy=d((({className:e="",items:t,activeItem:n,ariaLabel:a="Меню"})=>{const[r,{setFalse:l,toggle:s}]=un(!1),c=by({items:t,onClose:l,isOpen:r,activeItem:n});return i((()=>(c.current?.addEventListener("mouseleave",l),()=>{c.current?.removeEventListener("mouseleave",l)})),[]),o("div",{className:u(r?"rounded-md shadow-blue-gray":"",e),ref:c,role:"navigation",children:o("button",{type:"button",className:"group/btn flex justify-between items-center h-6","aria-label":a,onClick:s,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))))})})})),Ny=d((({className:e="",active:t,dataItemName:n,children:a,data:i,...r})=>{const l=xe(),{href:s,target:d,text:m,onClick:h}=l(r);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,...ve(i),children:[o("span",{className:wy(t),children:m||a}),t?o("div",{className:"absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-white"}):null]})})),wy=(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"),Cy=d((({observerOptions:e,onVisibilityChange:t,children:n,className:a,items:l,activeItem:s,...c})=>{const[d,{setFalse:m,setTrue:u}]=un(!1),h=Jm(r((e=>{if(!e.length||!t)return;const n=e[e.length-1];t(n.isIntersecting)}),[t]),e),p=by({items:l,onClose:m,isOpen:d,activeItem:s});return i((()=>(p.current?.addEventListener("mouseenter",u),p.current?.addEventListener("mouseleave",m),()=>{p.current?.addEventListener("mouseenter",u),p.current?.removeEventListener("mouseleave",m)})),[]),o("div",{className:"inline-block",ref:p,children:o("span",{ref:h,className:a,role:"menuitem",children:o(Ny,{...c,children:n})})})})),Sy={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"},ky=d((({version:e,text:t,mobileText:n,...a})=>{const i=Ee()?n:t;return i?o(ke,{className:u("py-s px-lg font-light whitespace-nowrap",Sy["transparent"===e?"transparent":"default"]),...a,children:i}):null})),Iy=d((({subItems:e=[],version:t,internetBankButton:n,dropdownMenuAriaLabel:i,chatBotAriaLabel:r})=>{const d="transparent"===t?"white":"black",[,m]=cy(e),[u,h]=a(e.length),p=e.slice(u),g=s(null),f={rootRef:g},y=l((()=>e.map(((e,t)=>e=>{h(e?Ty(t):Py(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(Cy,{className:u-1<t?"invisible":"",active:e===m,activeItem:m,observerOptions:f,onVisibilityChange:y[t],data:e.dataHeader,...e},String(t))))}),p.length?o(vy,{items:p,activeItem:m,ariaLabel:i}):null,A.CHAT_BOT?o(gy,{version:t,iconVersion:d,ariaLabel:r}):null,o(ky,{version:t,...n})]})})),Ty=e=>t=>Math.max(t,e+1),Py=e=>t=>Math.min(t,e),Ey=`${Qt}/region`;function Dy(e="Москва"){return Hs().location??{name:e}}function Ry(e="Москва"){const t=Hs(),n=r((async()=>{if(!t.location){const n=await Lt(Ey);t.location=n??{name:e}}}),[t,e]);return Kn(Ey,n),t}const _y=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(Le,{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(Ay,{...e},String(t))))})]}):null,Ay=d((({icon:e,...t})=>{const n=xe(),{text:a,target:i,href:r,onClick:l}=n(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ie,{image:e}):null,a?o("a",{className:"hover:text-primary-hover",href:r,target:i,onClick:l,children:o(Le,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})}):null]})})),Oy=(e,t)=>n=>n.name?o(hp,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:km(e,n.name),children:o(Le,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,My=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(Sn,"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"})]}))),By=d((({defaultLocation:e})=>{const t=Dy(e),n=xe(),{href:a}=n({href:`/branches/${t.slug}`});return t?o("div",{className:"mb-s",children:c(w,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(hp,{href:a,className:"inline mx-2xs text-primary-main",children:t.name})]})}):null})),Fy=d((({foreignOffices:e,branches:t,onClose:n})=>{const i=Ry(t?.default),[s,d]=a(""),m=$i(),u=l((()=>Ly(m).sort(((e,t)=>e.name.localeCompare(t.name)))),[m]),h=l((()=>((e,t)=>{const n=new Map;for(const a of e){const e=t(a),i=n.get(e)||[];n.set(e,[...i,a])}return n})(u,zy)),[u]),p=r((e=>{i.location=e,n?.()}),[i,n]);return c(_r,{className:"pb-20",head:c("div",{children:[o(Le,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),o(By,{defaultLocation:t?.default}),o(My,{onSearch:d,searchTerm:s})]}),onClose:n,children:[s&&s.length>=3?o("div",{children:u.filter((({name:e})=>e&&Of(e.toLowerCase())(s.toLowerCase())>=.8)).map(Oy(t?.dataSelect,p))}):o("div",{className:"columns-1 sm:columns-3 md:columns-4 lg:columns-5",children:Array.from(h.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(Le,{size:"text-h6",children:e})}),t.map(Oy(f,g))]},e)))}),_y(e)]});var g,f})),zy=e=>e.name?.charAt(0)??"",Ly=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()??""}))),Vy=d((({className:e="",active:t,flat:n,children:a,data:i,...r})=>{const l=xe(),{href:s,target:c,text:d,onClick:m}=l(r);return o("a",{className:u($y(t,n),e),href:s,target:c,onClick:m,rel:"noopener noreferrer","aria-label":`Ссылка на ${d}`,...ve(i),children:o("span",{suppressHydrationWarning:!0,className:jy(t,n),children:d||a})})})),$y=(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}),jy=(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"),qy=d((({className:e,version:t,...n})=>{const a="transparent"===t?"white":"black",i=Dy(n?.branches?.default),l=Nn(Wf,n),s=Nn(Fy,n),d=r((()=>l.open({})),[l]),m=r((()=>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:[i?.name&&n?.branches?.visible?o(Vy,{className:"whitespace-nowrap text-ellipsis overflow-hidden",flat:!0,href:"#",text:i?.name,data:km(n?.branches?.dataClick,i?.name??""),onClick:m}):null,n?.officesAtms?.href?o(Vy,{className:"whitespace-nowrap",flat:!0,...n.officesAtms}):null,o(hy,{image:{icon:"LoupeIcon",iconVersion:a},ariaLabel:n?.search?.ariaLabel??"Поиск",onClick:d,data:n?.search?.data})]})})),Uy=d((({observerOptions:e,onVisibilityChange:t,children:n,className:a,...i})=>{const l=Jm(r((e=>{if(!e.length||!t)return;const n=e[e.length-1];t(n.isIntersecting)}),[t]),e);return o("span",{ref:l,className:a,role:"menuitem",children:o(Vy,{...i,children:n})})})),Wy=d((({navigationItems:e=[],activeTopItem:t,dropdownMenuAriaLabel:n,version:i,headerData:r,search:d,bgColor:m,logo:u})=>{const[h,p]=a(e.length),g=e.slice(h),f=s(null),y={rootRef:f},x=l((()=>e.map(((e,t)=>e=>{p(e?Hy(t):Yy(t))}))),[e]),{dataFooter:b,dataHeader:v,...N}=u??{};return c("div",{className:"flex items-center justify-between",children:[o(Ud,{className:"mr-3xl",bgColor:m,logo:N,data:v,showTitle:!1}),o("div",{ref:f,className:"overflow-hidden min-w-40 pb-xs mt-xs",role:"menu",children:e.map(((e,n)=>o(Uy,{className:h-1<n?"invisible":"",active:e===t,observerOptions:y,onVisibilityChange:x[n],data:e.dataHeader,...e},String(n))))}),g.length?o(vy,{className:"mx-xs rounded-md shadow-blue-gray",items:g,activeItem:t,ariaLabel:n}):null,o(qy,{version:i,className:"ml-auto",search:d,navigationItems:e,...r})]})})),Hy=e=>t=>Math.max(t,e+1),Yy=e=>t=>Math.min(t,e),Gy={"bg-white":"primary",transparent:"transparent"},Ky=["all","header"],Xy=Yt((({className:e,bgColor:t="bg-white",logo:n={},version:a=Gy[t],portal:i,header:r={},...l})=>{const{common:s,navigation:d}=Zy(l?.options?.page),{navigationItems:m}=d,{logo:h={}}=s,[,p]=cy(m),{internetBankButton:f}=i||{},y=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:a,...l,children:c("div",{className:"container",children:[o("div",{className:"whitespace-nowrap",children:o(Wy,{activeTopItem:p,navigationItems:m?.filter(Nf(Ky)),version:a,headerData:{...r,...d},search:s.search,bgColor:t,logo:y})}),o("div",{className:u("mt-s h-px bg-main-divider",Jy(a))}),p?.items?.length&&o(Iy,{subItems:p?.items?.filter(Nf(Ky)),version:a,internetBankButton:f})]})})})),Jy=e=>"transparent"===e?"opacity-30":"",Zy=e=>({navigation:e?.navigation??{},common:e?.common??{}}),Qy=Yt((({className:e="",padding:t="p-0",gap:n="XS",isInnerPadding:a=!0,version:i="transparent",isTheme:r=!1,isCardBorder:l,...s})=>o(g,{className:u("relative","grid grid-cols-12",ey[n],e),padding:t,version:i,isTheme:r,...s,children:D({...s,extraProps:{...Qf(a),className:Gm(l)}})})),{childrenTypes:{exclude:["HorizontalLayout"]}}),ex=d((e=>{const{className:t,align:n,image:a,...i}=e,r=n?u("flex",Gu[n]):"";return o(g,{className:u(r,t),defaultPadding:"p-0",...i,children:o(ie,{image:a})})})),tx=["байт","Кб","Мб","Гб","Тб","Пб"],nx=d((({icon:e,text:t,href:n,target:a,fileFormat:i,data:r,fileSize:l})=>{const s=l&&i?",":"",d=l??"",m=i?String(i):"";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:a,...ve(r),children:[e,t?c(Le,{size:"text-l",font:"font-light",children:[t," ",ax(d,m),o(Le,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),ax=(e,t)=>e||t?o("span",{children:", "}):"",ix=(e,t)=>(n,a)=>{const i=U(e)("Attachment"===n?.docType?n?.attachment?.src:n?.href),r="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))} ${tx[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,l="Attachment"===n?.docType?lx(i):n?.fileFormat;return c("div",{role:"listitem",children:[o(nx,{text:n?.text,target:n?.target,href:i,fileFormat:l,fileSize:r,icon:rx(t),data:n?.data}),o(Fe,{__html:n?.__html})]},String(a))},rx=e=>e?o(ie,{className:"min-w-6 min-h-6",image:e,width:"24",height:"24"}):null,lx=e=>{if(!e)return"";const t=e.lastIndexOf("."),n=new RegExp(/\/(.*)/),a=-1!==t?e.substring(t+1):"";return a.includes("/")?a.replace(n,""):a},sx=d((({href:e,__html:t,target:n,onClose:a})=>c(_r,{className:"my-6xl min-h-fit w-fit mx-auto",onClose:a,children:[t?o(Fe,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(qr,{href:e,target:n,version:"primary",ariaLabel:"Ссылка на согласие",onClick:a,children:"Я согласен"}),o(Dr,{type:"button",version:"secondary",onClick:a,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]}))),ox=d((({text:e,href:t,target:n,__html:a,icon:i})=>{const{open:l}=Nn(sx),s=r((()=>l({__html:a,href:t,target:n})),[a,t,n]);return e?c("button",{className:"flex gap-s text-primary-text no-underline hover:text-primary-main",onClick:s,children:[rx(i),o(Le,{font:"font-light",children:e})]}):null})),cx={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},dx=Yt((({className:e="",title:t,description:n,align:a="text-center",documents:i,icon:r={icon:"DocIcon"},columnsMode:l="double",...s})=>{const d=R();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(S,{title:t,description:n,align:a,headlineVersion:"M",as:"h2",isEmbedded:!0}),i?.length?o("div",{className:u("grid gap-xl","double"===l?"@md:grid-cols-2":"grid-cols-1",cx[l]),role:"list",children:i.map(mx(d,r))}):null]})})),mx=(e,t)=>(n,a)=>{const i=n?.docType;return""===i?null:"reportSource"in n&&n?.reportSource?.__html?ux(t)(n,a):ix(e,t)(n,a)},ux=e=>(t,n)=>{const a={text:t.text,target:t.target,__html:t.reportSource?.__html};return t.reportSource?.__html&&t.text?c("div",{role:"listitem",children:[o(ox,{...a,icon:e,href:hx(t)?t?.href:t?.attachment?.src}),o(Fe,{__html:t?.__html})]},String(n)):null},hx=e=>"href"in e,px=Yt((({className:e,padding:t,align:n="text-left",buttons:a=[],description:i,image:r,__html:l,headingType:s,qr:d,additionalDescription:m="",title:h="Мобильное приложение",version:p="primary",...f})=>{const y="secondary"===p?"p-m min-w-32":"min-w-24",x=r?.src?o(ie,{className:"hidden lg:block",image:r}):null;return o(g,{className:u("min-h-80",e),padding:"p-0",version:p,...f,children:c(_e,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(N,{headingType:s,title:h,className:u("whitespace-pre-wrap",n)}),rightImage:x,buttons:Ye(a,{className:"flex-wrap"}),children:[i?o(Le,{size:"text-xl","font-weight":"font-light",children:i}):null,c("div",{className:u("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[l?o(Fe,{__html:l,itemSize:"list-m"}):null,o(Le,{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",y),children:o(ie,{className:"w-fit",image:d})}):null,r?.src?o(ie,{className:"lg:hidden",image:r}):null]})]})})})),gx="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",fx=d((({filters:e,field:{field:t,reset:n},onlyOffice:a,labels:i})=>{const r=a?5:6,l=(e||[]).map((e=>o(ci,{text:i[e],...t(e)},e))),[s,d]=r>0?[l.slice(0,r),l.slice(r)]:[l,[]],[m,{toggle:u}]=un(!1);return o("div",{children:e?.length?o("div",{children:c(Vl,{children:[c("div",{children:[o("div",{className:gx,children:s}),o($l,{className:gx,isUnfolded:m,children:d})]}),c("div",{className:"flex space-x-lg",children:[a?o(Ll,{label:m?"Меньше фильтров":"Больше фильтров",isUnfolded:m,embedded:!0,short:!0,onClick:u}):null,c(Dr,{embedded:!0,onClick:n,children:[o(Fl,{children:"Очистить фильтр"}),o(G,{name:"CloseIcon",size:"small"})]})]})]})}):null})})),yx=(e,t)=>e&&"underlined"!==t?"primary":"secondary",xx=(e,t,n)=>{const a=yx("all"===t),i=yx("business"===t),r=(e,t,a)=>{const i=e.currentTarget===e.target&&"business"===t?l(a):a;return n(t),i},l=e=>e.filter((e=>e.workSchedule&&e.workSchedule.businessScheduleVisibleTag&&!e.workSchedule.businessScheduleDescription));return c("div",{className:"flex gap-lg flex-col sm:flex-row",children:[o(Dr,{"data-id":"all",onClick:t=>r(t,"all",e),version:a,children:"Для физических лиц"}),o(Dr,{"data-id":"business",onClick:t=>r(t,"business",e),version:i,children:"Для юридических лиц"})]})},bx=({__html:e,list:t,richVersion:n})=>e||t?.length?c("div",{className:"border-b sm:border border-main-divider rounded-md space-y-2xl",children:[e?o(Fe,{__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(vx)}):null]}):null,vx=(e,t)=>c("div",{className:"flex gap-xs items-center",children:[o(ie,{image:e.image}),e?.text?o(Le,{size:"text-m",font:"font-light",children:e.text}):null]},String(t)),Nx=(e,t)=>e?o("div",{className:"flex flex-row gap-xs",children:c(N,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(Le,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}):null,wx=()=>{},Cx=e=>"all"===e?"block":"hidden",Sx=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:i=[],renderCard:r=wx,renderRemoteWorkplaceCard:l=wx,getBalloon:s=wx,initFilterState:d=ds,getBalloonRemoteWorkplaces:m=wx,descriptionData:h,title:p})=>{const g=p?.includes("Офис"),[f,{field:y,reset:x}]=bn(d),{filteredItems:b,points:v,filteredRemoteWorkplaces:N,lengthItems:w}=gs({data:t,remoteWorkplaces:i,filtrationState:f,getBalloon:s,getBalloonRemoteWorkplaces:m}),[C,S]=a("all");return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0 grid gap-xl",children:[Nx(p,w),h?bx(h):null,g&&xx(t,C,S),o("div",{className:u("pb-3xl",Cx(C)),children:o(fx,{filters:kx([...t,...i]),field:{field:y,reset:x},onlyOffice:g,labels:ms})})]}),o("div",{className:"h-[600px]",children:o(ys,{children:o(Rs,{points:v,isLoad:n,className:"h-full"})})})]}),c(ys,{children:[b.map(r),N.map(l)]})]})})),kx=e=>Object.keys(ds).filter((t=>e.filter((e=>us[t](e))).length)),Ix=e=>e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:"",Tx=({location:e,address:t,billAcceptorType:n,terminalType:a,billAcceptorEnable:i,atmCode:r="",atmAccess:l="",workTime:s},d)=>{const m=[{label:"Устройство",value:Ix(a)},{label:"Модуль приема наличных",value:i?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(l)?"Общедоступный":""},{label:"Регистрационный номер",value:r}];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(Le,{size:"text-h4",children:Ix(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(G,{name:"GeolocationIcon",width:"24",height:"24"}),o(Le,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(Ql,{color:"green",children:Ix(s)})})]}),o(jl,{children:o(Bl,{className:"flex-wrap",children:m?.map(((e,t)=>o(_l,{...e},String(t))))})})]},String(d))},Px=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${Ix(t)} №${n}`,body:e.toUpperCase()}),Ex=[];const Dx=async e=>{const t=await Lt(e,{method:"GET"});return Array.isArray(t)?t:Ex},Rx={terminalTypeTerm:!1,terminalTypeAtms:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},_x=d((({descriptionData:e,className:t})=>{const n=Dy(),a=n?.code??"000",{data:i,isLoad:r}=function(e){const{data:t,error:n}=Kn(`${Qt}/atms?regionCode=${e}`,Dx);return{data:t||Ex,isLoad:!t&&!n}}(a);return o(Sx,{className:t,data:i,isLoad:r,initFilterState:Rx,renderCard:Tx,getBalloon:Px,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),Ax=({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(Le,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(G,{name:"GeolocationIcon",width:"24",height:"24"}),o(Le,{size:"text-l",children:e})]}):null]})}),o(jl,{children:Ox(t)})]},String(n)):null,Ox=e=>c("div",{children:[c(Bl,{className:"flex",children:[o(_l,{label:"Операции для физических лиц",children:o(Le,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(_l,{label:"Операции для физических лиц",children:o(Le,{children:"Оформление и обслуживание банковских карт"})}),o(_l,{label:"Операции для физических лиц",children:o(Le,{children:"Инвестиционное и накопительное страхование"})}),o(_l,{label:"Операции для физических лиц",children:o(Le,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(_l,{label:"Режим работы",className:"max-w-none",children:o(Le,{children:e})})]}),Mx=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),Bx={branches:[],remoteWorkplaces:[]};const Fx=async e=>await Lt(e,{method:"GET"})||Bx,zx=d((({className:e})=>{const t=Dy(),n=t?.code??"000",{data:a,isLoad:i}=function(e="000"){const{data:t,error:n}=Kn(`${Qt}/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,Fx);return{data:t||Bx,isLoad:!t&&!n}}(n);return o(Sx,{className:e,data:a?.branches,isLoad:i,remoteWorkplaces:a?.remoteWorkplaces,renderCard:ss,renderRemoteWorkplaceCard:Ax,getBalloon:cs,getBalloonRemoteWorkplaces:Mx,title:`Офисы филиала ${t?.name}`})})),Lx=d((({data:e,className:t,...n})=>{const a=e?.dataType??"offices";return o(g,{version:"transparent",className:u(t),defaultPadding:"p-0",...n,children:"offices"===a?o(zx,{}):o(_x,{descriptionData:e})})})),Vx=d((e=>{const{__html:t,richVersion:n="",...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(Fe,{__html:t,richVersion:n})})})),$x=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",jx=Yt((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,foldButtonVersion:a="default",label:i,version:r,role:l,...s})=>{const d=Ee(),[m,{toggle:h}]=un(t),p=o($l,{className:u("gap-lg",$x(d)),isUnfolded:m,children:D({...s,extraProps:{className:"w-full",padding:"p-0"}})}),f="accordion"===a,y=o(Ll,{className:u(f?"text-h6 my-lg":"text-h4"),label:i,isUnfolded:m,embedded:f,onClick:h});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:l,...s,children:c(Vl,{children:[n?y:p,n?p:y]})})}),{childrenTypes:{exclude:["RollupItem"]}}),qx=e=>e<4?"w-72":"w-52",Ux={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"},Wx=d((({buttons:e,className:t="",description:n,showLines:a=!0,steps:i=[],stepVersion:r="gray",title:l,version:s="primary",...d})=>{const m=i.length>3,h=Ux,p=(e=>e?"":"opacity-0")(a),f=Ee();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:l,description:n,isEmbedded:!0,className:"w-full",align:Lu(f)}),i?.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:Su(o("div",{className:u("h-0.5 w-full bg-secondary-light flex-1",p)}))(i.map(Hx(h,m,r)))}),o("div",{className:u("flex justify-between",m?"gap-x-s":"gap-x-20"),children:i.map((y={styleMap:h,version:s},(e,t,n)=>{const{styleMap:a,version:i}=y,{label:r,description:l,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",qx(n.length)),children:[c("div",{className:"space-y-xs",children:[r?o(Le,{size:"text-h6",align:"text-center",children:r}):null,c("div",{className:"flex flex-col items-center gap-3xs",children:[l?o("div",{className:a.description,children:l}):null,o(Fe,{__html:e.__html,itemSize:"list-s",isDotted:d})]})]}),s?.text?o(ke,{className:"box-border py-s w-full mt-auto",version:i,...s,children:s?.text}):null]},String(t))}))})]}):null,Ye(e)]});var y})),Hx=(e,t,n)=>({icon:a},i)=>{const r="secondary"===n?"white":"color";return o(g,{defaultPadding:"",className:`${Yx(t)} flex justify-center items-center text-center rounded-full box-border z-10`,version:n,children:He(a)?o(ie,{image:{...a,iconVersion:a?.iconVersion||r},width:"48",height:"48"}):o("span",{className:u("text-h4","transparent"===n?e.iconText:(l=n,"secondary"===l?"group-data-primary:text-white":"text-secondary-text")),children:i+1})},String(i));var l},Yx=e=>e?"h-16 w-16":"h-24 w-24",Gx=d((()=>o("div",{className:"hidden",role:"none"}))),Kx={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"}},Jx=d((({count:e,version:t="secondary"})=>{const n=Ee(),a=n?"bg-main-divider":Kx[t],i=Xx[t][n?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",a),role:"status","aria-label":`Количество ${e} доступных программ и сервисов`,children:o(Le,{size:"text-xs",color:i,children:e})})})),Zx=({text:e,description:t,icon:n,isActive:a,type:i})=>{const r=(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"}))(a);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(ie,{className:u("h-6 w-6 min-w-6 min-h-6",r.icon),image:{...n,iconVersion:n?.iconVersion??r.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===i?r.text:r.oldText,children:e}),o("div",{className:"animated"===i?r.desc:r.oldDesc,children:t})]})]})},Qx={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},eb={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},tb={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},nb={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},ab=d((({tag:e="div",item:t={},isActive:n=!1,type:a="default",onClick:i})=>{const r=e,{text:l,description:s,icon:d,count:m,tabName:h,...p}=t;return o(r,{className:u("h-12","block flex-1","cursor-pointer",Qx[a],n?nb[a]:tb[a]),"aria-label":"Список табов",onClick:i,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?eb[a]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${l}`,children:[Zx({text:l,description:s,icon:d,isActive:n,type:a}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o(Jx,{count:m,version:yx(n,a)})}):null]})})})),ib=d((e=>o(e?.item?.href?rb:lb,{...e}))),rb=d((e=>{const t=xe(),n=r((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:a,...i}=t({...e.item,onClick:n});return o(ab,{...e,tag:"a",item:i,onClick:a})})),lb=d((({item:e={},onClick:t,...n})=>{const a=r((n=>{n.target.scrollIntoView({block:"nearest"}),t?.(e)}),[t,e]);return o(ab,{item:e,onClick:a,...n})})),sb="hidden sm:flex absolute z-40",ob={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},cb=d((({className:e,items:t=[],activeItem:n,onChange:a,tabsType:r="default"})=>{const[l,s]=cu({itemCount:t?.length||0});return i((()=>db(l.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(tu,{containerRef:l,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:ob[r].item,gap:ob[r].gap,children:t.map((d=n,m=a,h=r,(e,t)=>o(ib,{isActive:e===d,onClick:m,type:h,item:e},String(t))))}),s.canScrollLeft?o(pu,{wcmsIgnore:!0,className:u("left-6",sb,ob[r].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(gu,{wcmsIgnore:!0,className:u("right-6",sb,ob[r].buttonTop),onClick:s.scrollRight}):null]});var d,m,h})),db=(e,t,n)=>{const a=t.findIndex((e=>e===n));e&&a>0&&e.scrollTo({left:e?.children[a]?.offsetLeft,behavior:"smooth"})},mb={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},ub=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(mb[t].wrapper,e),children:o(cb,{className:mb[t].component,tabsType:t,...n})}):null,hb="sticky top-1 z-20",pb=Yt((({className:e="",tabs:t=[],block:n,tabsType:i,showCounter:l=!1,isSticky:s=!1,...d})=>{const m=fb(n||{}),h=R(),p=t.every((e=>"link"===e?.type)),f=new URLSearchParams(decodeURIComponent(globalThis?.location?.search||"")),y=bb(m),x=l?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,b=x.findIndex((e=>Boolean(e?.selected))),v=x.findIndex(((e,t)=>"group"===e.type&&(e?.tabName??String(t))===y)),N=y?v:b,[w,C]=a(gb(N)),S=x[w],k=xb(x[w],w),I=r((e=>{const t=x.indexOf(e),n=x[t];C(t),"group"===n.type&&((e,t)=>{e.text?f.set(m,e?.tabName??String(t)):f.delete(m),h.replace(`${h.pathname}?${f}`,{scroll:!1})})(e,t)}),[x]);return c(g,{className:u({[hb]:[s,p].every(Boolean)},e),defaultPadding:"p-0",block:n,...d,children:[ub({className:u({"pb-1":[n?.slots,"default"===i].every(Boolean),[hb]:[s,!p].every(Boolean)}),items:yb(t,x),activeItem:S,tabsType:i,onChange:I}),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])=>E(t,{...d?.options,slotName:k,parent:n,extraProps:{className:e===k?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(xb)?.filter(Boolean)||[]}),gb=e=>e&&-1!==e?e:0,fb=({__id:e,anchor:t})=>t??e??"tabs",yb=(e,t)=>t?.length?t:e,xb=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",bb=e=>decodeURIComponent(globalThis?.location?.search.replace("?","").replace("+"," ").split("&").find((t=>t.split("=").find((t=>t===e))))?.split("=")?.[1]??""),vb=({title:e,icon:t})=>c("div",{className:u("flex gap-m items-center","w-80 flex-shrink-0 sticky left-0 bg-white"),role:"cell",children:[t?o(ie,{className:"hidden lg:block max-w-6 shrink-0",image:t,width:"24",height:"24"}):null,e?o(Le,{size:"text-m",font:"font-light",color:"text-primary-text",children:e}):null]}),Nb={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},wb=d((({children:e,version:t="comparison"})=>o("div",{className:"flex flex-1",children:o("div",{className:Nb[t],children:e})}))),Cb=d((({className:e="",isOpen:t,onClick:n})=>o(Ll,{className:e,label:t?"Скрыть":"Показать",isUnfolded:t,version:"secondary",short:!0,onClick:n}))),Sb=e=>e?o("div",{children:o(Le,{size:"text-h6",children:e})}):null,kb=e=>e?o("div",{className:"text-l font-light",children:o(Le,{color:"text-secondary-text",children:e})}):null,Ib=({__html:e,isDotted:t})=>e?o("div",{className:"flex flex-col justify-between items-start text-h6",children:o(Fe,{__html:e,isDotted:t,itemSize:"list-m"})}):null,Tb=d((({cells:e,tableInner:t,onSetTable:n})=>o("div",{className:"w-80 flex-grow flex flex-col gap-lg",role:"cell",children:e?.length?e.map(((e,a)=>e?.tableSource?.tableData?o(Cb,{className:"w-fit",isOpen:Boolean(t),onClick:()=>{n(t?void 0:{tableSource:e.tableSource})}},String(a)):(({label:e,description:t,__html:n,isDotted:a,buttons:i,image:r},l)=>c("div",{className:"grid gap-xs",children:[Sb(e),kb(t),Ib({__html:n,isDotted:a}),Ye(i,{buttonClassName:"basis-0"}),r?.src?o(ie,{image:r}):null]},String(l)))(e,a))):null}))),Pb=({className:e,btnClass:t,canDec:n,canInc:a,dec:i,inc:r})=>n||a?c("div",{children:[n?o(pu,{wcmsIgnore:!0,className:u("absolute z-40",t[0],e),onClick:i}):null,a?o(gu,{wcmsIgnore:!0,className:u("absolute z-40",t[1],e),onClick:r}):null]}):null,Eb=(e,t)=>140*Bf(e.slice(0,t).map((e=>e?.cols?.length??1))),Db=(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(Le,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,Rb=d((({rows:e})=>{const t=e?.[0]?.length??0,[n,i]=((e,t=0)=>{const{itemCount:n,visibleItemCount:i}=e,[l,s]=a(t),o=r((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=r((()=>s((e=>Math.max(e-1,0)))),[n]),d=i?n>i&&l<n-i:l<n-1,m=l>0;return[l,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]})({itemCount:t,visibleItemCount:5});return c("div",{children:[e?.map((l=n,(e,t)=>{if(!e?.length)return null;const[n,...a]=e,i=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 min-w-48 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0",children:o(Le,{size:"text-xl",font:"font-light",children:n.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:i,style:{transform:`translateX(-${Eb(a,l)}px)`},children:a?.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(Le,{size:"text-xl",children:e.data}):null,e?.cols?Db(e.cols,l):null]},`row${t}`)))})})]},String(t))})),Pb({...i,btnClass:["left-3 top-20","right-3 top-20"],className:""})]});var l})),_b=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,n)=>{const a=`activeTabIdx:${e}-tableIdx:${n}`;return c("div",{className:"w-full @container",children:[o("div",{className:"flex py-m px-m bg-white @4xl:bg-gray relative",children:o(Le,{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(Rb,{rows:t.rowsData})})})]},a)}))}))),Ab=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Ob=d((({currencies:e,linkToPDF:t,activeTabIndex:n,setActiveTabIndex:a})=>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:()=>a(t),children:o(Le,{size:"text-xl",font:"font-light",color:Ab(t===n),children:e||t+1})},e)))}):null,t?o(ke,{className:"text-primary-main",href:t,version:"secondary",target:"_blank",appendLeft:o(G,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),Mb=Yt((({tableSource:e})=>{const t=e?.tableData,[n,i]=a(0),l=r((e=>i(e)),[]),s=t?.[n]?.items??[],d=t?.map((e=>e.currency??""));return t?c("div",{className:"bg-white z-10",children:[o(Ob,{currencies:d,activeTabIndex:n,setActiveTabIndex:l}),o(_b,{activeTabIndex:n,items:s})]}):o("div",{className:"space-y-m text-center",children:o(Le,{size:"text-h6",children:"Данных нет"})})})),Bb=d((({children:e,tableInner:t,onClick:n})=>c("div",{className:u("self-start flex flex-col gap-xl","border-main-divider lg:border-b w-full py-s lg:py-xl"),role:"row",children:[o("div",{className:u("flex flex-col lg:flex-row gap-x-5xl gap-y-xs"),children:e}),t?o("div",{className:"origin-top animate-expansion",children:o(Mb,{...t,onClick:n})}):null]}))),Fb=d((({row:{header:e,data:t=[]},...n})=>{const[i,l]=a(void 0),s=r((e=>{l(e)}),[]);return c(Bb,{tableInner:i,...n,children:[vb(e),t?.length?o(wb,{version:"tariff",children:t.map(((e,t)=>o(Tb,{cells:e,onSetTable:s,tableInner:i,...n},String(t))))}):null]})})),zb=d((({children:e})=>o("div",{role:"table",className:"overflow-x-auto w-auto grid relative gap-y-xs",children:e}))),Lb=Yt((({className:e="",title:t,description:n,rowHeaders:a,tariffsColumns:i,hiddenRowsNum:r=0,...l})=>{const s=i?.map((({data:e})=>e))||[],d=a?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),m=(d||[]).map(((e,t)=>o(Fb,{row:e,...l},String(t)))),[h,p]=r>0?[m.slice(0,-r),m.slice(-r)]:[m,[]],[f,{toggle:y}]=un(!1);return c(g,{className:u("relative space-y-xl",e),defaultPadding:"p-6xl",...l,children:[o(S,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:r>0?c(Vl,{children:[c(zb,{children:[h,o($l,{isUnfolded:f,isOverflowVisible:!0,children:p})]}),o(Ll,{className:"text-h4",isUnfolded:f,onClick:y})]}):o(zb,{children:m})})]})})),Vb=d((({className:e="",title:t,description:n,iconVersion:a,__html:i,richVersion:r,...l})=>c(g,{className:u("flex gap-s sm:gap-m group-data-secondary:bg-primary-main/10",e),...l,children:["small"===a?$b():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(Le,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?jb(n):null,i?o(Fe,{richVersion:r,__html:i}):null]})]}))),$b=()=>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"}),jb=e=>o(w,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),qb=Yt((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:a=!0,version:i="transparent",isTheme:r=!1,isCardBorder:l=!1,image:s,...c})=>{const d=R();return o(g,{className:u("relative flex flex-col",ey[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${Q(d)(s?.src)})`}}:{},padding:t,version:i,isTheme:r,...c,children:D({...c,extraProps:{className:u("w-full",Gm(l)),...Qf(a)}})})}),{childrenTypes:[]}),Ub=e=>(e=>{const t="col-span-",n=e?.split(/\s+/).find((e=>e.startsWith(t)));return n?parseInt(n.substring(9),10):12})(e)<10?"py-xl px-6xl":"py-6xl px-32",Wb=d((({className:e,title:t,url:n,previewImg:a,...i})=>{const r=R();return c(g,{className:e,defaultPadding:Ub(e),...i,children:[o(S,{title:t,headlineVersion:"M"}),n?o("video",{className:"m-auto w-full object-fill",preload:"metadata",poster:U(r)(a?.src),style:{maxHeight:524},controls:!0,children:o("source",{src:U(r)(n)})}):null]})})),Hb={AdTile:Kt,ApplicationForm:Gr,BankAccountFiltration:Fu,BenefitsBlock:ju,BonusBenefitsBlock:Yu,ButtonsBlock:Ku,CalculatorBonus:nh,CalculatorBusinessDeposit:uh,CalculatorCredit:Ko,CalculatorDeposit:Mh,CalculatorRefinancing:Wh,CardTransfer:ep,Carousel:op,CarouselCatalogCard:mp,CarouselRecommendationCard:xp,CarouselTariffsCard:wp,ContactsBlock:Cp,DepositFiltration:pf,ErrorBlock:xf,Footer:Zf,GalleryLayout:ay,GrantSupport:oy,Header:Xy,Headline:S,HorizontalLayout:Qy,ImgBlock:ex,LinkDocs:dx,MobileAppTile:px,OfficesAtmsMap:Lx,ProductBlock:Gt,RichTextBlock:Vx,RollupItem:jx,StepsBlock:Wx,StickyBottomMenu:Gx,TabsLayout:pb,TariffsTable:Lb,TextBlock:Vb,VerticalLayout:qb,Video:Wb,ApplicationLeadForm:$m,CreditCardForm:wg,CreditForm:$g,DebitForm:cf},Yb=me((()=>{i((()=>{cn()}),[]);const e=mn();Dn(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const a=JSON.parse(n?.dataset?.aspects??"[]");ln({aspectsAttributes:a,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))})),Gb="cookie",Kb=d((({__html:e})=>{const[t,{setTrue:n,setFalse:a}]=un();Af((()=>{globalThis.localStorage?.getItem(Gb)||n()}),[],3e3);const i=r((()=>{globalThis.localStorage?.setItem(Gb,"true"),a()}),[]);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(Fe,{__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:i})})]})}):null}));function Xb(e){const t=r((({key:t})=>{"Escape"===t&&e()}),[e]);Dn(globalThis.document,"keydown",t)}function Jb(e,t,n){i((()=>e.subscribe(t,(e=>{const t=e?.type;if(t&&"string"==typeof t){const a=n[t];a&&a(e)}}))),[e,t,...Object.values(n)])}const Zb=()=>{const[e,{push:t,pop:n,clear:i}]=function(e=[]){const[t,n]=a(e),i=r((e=>n((t=>[...t,e]))),[]),l=r((()=>n((e=>e.slice(0,-1)))),[]),s=r((e=>n((t=>t.filter((t=>t!==e))))),[]),o=r((()=>n([])),[]);return[t,{setList:n,push:i,pop:l,remove:s,clear:o}]}();return Jb(pe.observable,"dialog",{open:t,close:n,closeAll:i}),[e,{close:n,closeAll:i}]},Qb=d((()=>{const[e,{close:t}]=Zb(),n=Boolean(e.length);return Xb(t),i((()=>{n?globalThis.document?.body.classList.add("no-scrollbar","overflow-hidden"):globalThis.document?.body.classList.remove("no-scrollbar","overflow-hidden")}),[n]),n?o("div",{className:"fixed inset-0 z-50",children:e.map((({dialog:t,id:n},a)=>o("div",{className:u("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar bg-black/50",{hidden:a!==e.length-1}),children:t},String(n||a))))}):null})),ev=d((()=>{const[e,t]=a(null),n=r((()=>{t(null)}),[]);return Jb(pe.observable,"popup",{open:t,close:n}),Xb(n),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",title:"Всплывающее окно",children:e.popup}):null})),tv="header",nv="footer",av="sticky-footer",iv={},rv=d((({className:e,data:t=iv,blocksRegistry:n,blockDecorator:a})=>{const{slots:i,blocks:r,fallback:l,...s}=t,d=Wt(s,l);Yb(),Ry();const m={key:"",page:{slots:i,blocks:r,fallback:l,...d},blocksRegistry:n,blockDecorator:a,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:u("@container relative",t.style,e),children:[i?.[tv]?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:E(i?.[tv],{...m,slotName:tv})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[D({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),E(i?.[nv],{...m,slotName:nv})]})]}),i?.[av]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:E(i?.[av],{...m,slotName:av})}):null,o(Qb,{}),o(ev,{}),o(Kb,{__html:d?.cookieContent?.__html})]})}));Object.assign(rv,{childrenTypes:[],slots:()=>[tv,nv,av]});e.Blocks=Hb,e.ContentPage=rv,e.handlerDecorator=me,e.joinList=Su,e.locationNavigator=sn,e.packageVersion="0.14.875",e.projectSettings=A,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=V,e.useRouter=R,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),a=n("useState"),i=n("useEffect"),r=n("useCallback"),l=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:a,...i}=t||{},r=n?.slots?.default,l=a||r&&r();return e(Object.assign(i,l&&{children:l}),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:a="p-xl",padding:i,block:r,tag:l="section",role:s,children:c,style:d})=>{const m=t&&n;return o(l,{className:u("@container font-sans",{group:m},p[t],i||a,e),...m?{"data-ver":t}:{},...r?.anchor?{id:r.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:y(t)}))),y=(e=3)=>b(100,e).map((e=>Math.floor(e))).map(x),x=(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:a,children:i})=>o(n,{role:"heading",className:u("font-sans m-0",v[t],e),children:a||i}))),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:a,description:i,align:r="text-center",as:l,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:[a?o(N,{className:u("whitespace-normal",r),...h?.title,as:l||h?.title.as,title:a}):null,i?o(w,{size:h.descriptionSize,font:h.descriptionWeight,align:r,...p,children:i}):null]})})),k=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),I=[];function T(e,t,{className:n,...a}={}){const{key:i,blockDecorator:r=k,blocksRegistry:l={},ancestors:s=I}=t,{type:c}=e;c&&c in l||console.warn(`No block with "${c}" is registered`);const d=c&&l[c];return r({blockClassName:u(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:r})=>{const{content:l}=n;return d?o(d,{...l,...a,className:u(r,l?.className),block:e,options:t},i):null}},i)}const D=[],_=(e,{key:t,ancestors:n=D,slotName:a=null,extraProps:i,renderProps:r=T,...l})=>{const s=i?(e,t)=>T(e,t,i):r;return(e||[]).map(((e,i)=>s(e,{...l,key:`${t||e.type}-${i}`,ancestors:l.parent?[...n||D,[l.parent,a]]:n},i)))};function P({block:e,options:t,children:n,extraProps:a,renderProps:i}){return n||(e&&t?_(e.blocks,{...t,parent:e,extraProps:a,renderProps:i}):null)}function E(){return E._impl()}E._impl=()=>({pathname:globalThis.location?.pathname||"/",push:()=>{},replace:()=>{},back:()=>{}}),E.setup=e=>{E._impl=e};const R=["CDN","BASE_PATH"],A=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return R.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),M=e=>Boolean(e?.includes(":")),O=(e,t)=>Boolean(e&&!M(e)&&(!t||"_self"===t)),B=e=>Boolean(e?.startsWith("#")),F=e=>(e??"").replace(/\?.*/,"").replace(/\/$/,""),L=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),z=e=>t=>Boolean(e&&t&&e.startsWith(t)&&("/"===t||e===t||"/"===e[t.length]));var V=Object.freeze({__proto__:null,isURL:M,isLocalURL:O,isHash:B,withoutQuery:F,joinPath:L,hasPrefix:z});const $="/api/",j=`${$}v1/storage`,q=[A.CDN,$],U=e=>(t,n)=>{if(W(t))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`${j}/${t}/attachment`;const a=t?.startsWith("/");return L(z(t)(n)?"":n,a?"/":(i=e.pathname,i?.split("/").slice(0,-1).join("/")),t);var i},W=e=>!e||M(e)||B(e)||q.some(z(e)),H={"":"",normal:"",color:"text-primary-main",black:"text-black",white:"text-black",gray:"text-gray"},Y={small:"16",medium:"24",large:"48",xl:"78"},G=d((({className:e="",imageClassName:t="",name:n="",alt:a=`Иконка ${n}`,title:i=a,iconVersion:r="color",size:l,width:s=l&&Y[l],height:d=s})=>{const m=E(),h="normal"===r?`${n}.svg`:`sprites.svg#${n}`,p=U(m)(L(A.CDN,"/icons/",h));return"normal"===r?o("img",{className:e,style:K(e,d),src:p,alt:a,title:i,"aria-hidden":"true",width:s,height:d}):o(X,{className:e,children:c("svg",{className:u(H[r],{"w-full h-full":!s,invert:"white"===r},t),width:s,height:d,"aria-hidden":"true",children:[i?o("title",{children:i}):null,a?o("desc",{children:a}):null,o("use",{href:p,xlinkHref:p})]})})})),K=(e,t)=>{return e?.includes("h-")?{}:{height:(n=t,n&&!/\D/.test(n)?`${t}px`:t),width:"auto"};var n},X=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),J=new Proxy({_:{},setup(e){this._=e}},{get:(e,t)=>e._[t]||e[t]});function Q(e=""){try{return new URL(e).pathname}catch(e){return""}}const Z=e=>t=>{const n=t?.startsWith("/wcms-resources")?"":Q(J.SITE_URL);return t&&!M(t)?U(e)(t,n):t},ee=(e,t)=>e?.media&&t?.media?e.media-t.media:0,te=d((({className:e="",image:t,imageClassName:n=""})=>{const a=E();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(ee).map((({src:e,format:n,media:i},r)=>o("source",{srcSet:Z(a)(e),type:ae(n),media:i?`(max-width: ${i}px)`:"",width:t?.size?.width,height:t?.size?.height},`${r}_${e}`))):null,t?.src?ne({...t,src:Z(a)(t.src)},n):null]})})),ne=(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}),ae=e=>e?`image/${String(e)}`:void 0,ie=d((({className:e="",image:t,imageClassName:n="",...a})=>t?.src||t?.icon?t.icon?o(G,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...a}):o(te,{className:e,imageClassName:n,image:t}):null)),re={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","":""},le="bg-main-divider text-main-disabled",se={primary:le,secondary:le,white:le,link:"",transparent:"",gray:le,"":""},oe="text-center font-sans select-none",ce={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","":""},de=({className:e,rounded:t,version:n})=>[oe,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",n?re[n]:"",t?"rounded-full":"rounded-md",e].join(" "),me=e=>me._impl(e);function ue(e,t){const n=s({});return l((()=>new Proxy({},{get:(a,i)=>(n.current||={},n.current[i]||=n=>e.fire(t,{...n??{},type:i}),n.current[i])})),[e,t])}me._impl=e=>e,me.setup=e=>{me._impl=e};class he{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 pe=new he,ge=()=>ue(pe.emitter,"dialog"),fe="/",ye=["/api"];function xe(){const e=E(),{closeAll:t}=ge();return n=>{const a=U(e)(n.href);return{...n,href:a,"aria-label":n.text,onClick:me((i=>{n.onClick?.(i);const r=Q(J.SITE_URL);be(a,n.target,r)&&(t(),i?.preventDefault(),e.push(((e=fe,t=fe)=>[e,t].some((e=>e===fe))?e:e.replace(t,"")||fe)(a,r)))}))}}}const be=(e,t,n)=>O(e,t)&&![...ye,...J.SUB_PORTALS?.split(",")??[]].some(z(e))&&z(e)(n||"/"),ve=e=>{try{return Array.isArray(e)&&e.length?{"data-aspects":JSON.stringify(e)}:{}}catch(e){return{}}},Ne=d((e=>{const{text:t,aboveText:n,appendLeft:a,appendRight:i,version:r="primary"}=e,l=Ce(e)&&"hidden lg:block";return c("div",{className:u(we(e),"flex gap-xs"),children:[a?o("div",{className:u(l,ce[r]),children:a}):null,Ce(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":"text-l"),children:t})]}):null,i?o("div",{className:u(l,ce[r]),children:i}):null]})})),we=e=>{const{version:t,aboveText:n,rounded:a}=e;if("link"===t)return"";const i=""+(n?"py-2.5 px-9":"py-4 px-9");return u("group/btn items-center justify-center",Ce(e)?i:"h-12 w-12 m-auto",{"rounded-full":a})},Ce=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),Se=({className:e,rounded:t,version:n})=>["inline-block",oe,n?se[n]:"",t?"rounded-full":"rounded-md",e].join(" "),ke=d((({disabled:e,children:t,method:n="LINK",href:a,...i})=>{const l=(({method:e,href:t})=>r((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:a,pathname:i,searchParams:r}=new URL(t||""),l=document.createElement("form");l.setAttribute("method","POST"),l.setAttribute("action",[a,i].join(""));for(const[e,t]of r.entries()){const n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t),l.appendChild(n)}document.body.appendChild(l),l.submit()}),[e,t]))({method:n,href:a}),s=xe()({onClick:l,href:a,...i}),c=t??o(Ne,{...s});return o(e?Te:Ie,{...s,children:c})})),Ie=d((({className:e="",href:t,rel:n,target:a,ariaLabel:i,version:r,rounded:l,onClick:s,type:c,data:d,children:m,text:u})=>o("a",{className:de({className:e,version:r,rounded:l}),href:t,rel:n,target:a,"aria-label":i||`Ссылка на ${u}`,role:t?"link":"button",onClick:s,type:c,...ve(d),children:m}))),Te=d((({className:e,ariaLabel:t,version:n,rounded:a,children:i})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:Se({className:e,rounded:a,version:n}),children:i})));function De({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:a=!1}){if(!n)return null;const i="primary"===e?"white":"black",r="primary"===e?"bg-primary-main":"bg-white";return c("div",{className:u(a?"flex":"hidden sm:flex","items-center gap-s"),children:[o("div",{className:u(de({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",rounded:!0}),r),onClick:t,children:o(ie,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:i}})}),o(ke,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const _e=()=>{const[e,t]=a(false);return i((()=>{const e=globalThis.matchMedia?.("(max-width: 1024px)"),n=()=>{t(Boolean(e?.matches))};return e?.addEventListener("change",n),e?.matches&&t(!0),()=>{e?.removeEventListener("change",n)}}),[]),e},Pe={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},Ee=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&Pe[n],t),children:e}):null,Re=d((({className:e,version:t="primary",defaultPadding:n,padding:a="",title:i,buttons:l,leftImage:s,rightImage:d,imageAlign:m,insetTitle:h,isImageAlwaysOnRight:p=!1,isImageSecondary:g=!1,backwardButton:f,children:y,...x})=>{const b=_e(),v=E(),N=r((()=>v.back()),[]),w=x.options?.page?.common?.backwardButton,C=f&&!b;return c("div",{className:u("relative flex flex-col gap-3xl overflow-hidden",a||n,e),children:[C&&De({version:t,handleClick:N,text:w}),i?o("div",{className:"relative",children:i}):null,c("div",{className:u("grow relative flex flex-col @xl:flex-row gap-3xl w-full",{"self-start @xl:w-auto":s}),children:[Ee(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-auto"),children:[Ae(h,y),Oe(P({...x,extraProps:{className:"@container-normal"}})),Ee(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[Me(p)]:l,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),l?o("div",{className:"self-end",children:l}):null]})]})]})})),Ae=(e,t)=>e||t?c("div",{className:"grow space-y-lg w-fit",children:[e,t]}):null,Me=e=>u(e?"row-span-2":"@xl:row-span-2"),Oe=e=>e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,Be=(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(ie,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,Fe=d((({__html:e="",richVersion:t="",itemSize:n="list-m",isDotted:a=!0,children:i})=>e||i?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(t,n,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",a?"":"without-dots"),dangerouslySetInnerHTML:e?{__html:e}:void 0,children:i})}):null)),Le=(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,ze=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),Ve=(e,t)=>e?o(ze,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,$e=(e,t)=>["label"in e?Ve(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:Le(e.description,t)},String(t)):null,"__html"in e?o(Fe,{...e},`rte-${t}`):null],je=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?Be(n.icon,t):null,o("div",{children:$e(n)})]}))),qe=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(je,{benefitsVersion:t,...e},String(n))))}):null)),Ue=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($e)}):null)),We=d((({isTabularBenefits:e,...t})=>o(e?Ue:qe,{...t}))),He=e=>Boolean(e?.src||e?.icon),Ye=(e,{className:t,buttonClassName:n,isVertical:a}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:u("flex",a?"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(Ge(n))}):null,Ge=(e="")=>(t,n)=>{const{text:a,icon:i,iconRight:r,version:l,...s}=t||{},c=Ke(i,l),d=Ke(r,l);return a||i?.icon?o(ke,{className:u("basis-full @lg:basis-auto",e),appendLeft:Xe({...i,iconVersion:c}),appendRight:Xe({...r,iconVersion:d}),version:l,text:a,...s},n?String(n):""):null},Ke=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},Xe=e=>He(e)&&o(ie,{image:e,width:String(e?.size?.width||24),height:String(24)}),Je=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),Qe=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(Ze)}):null)),Ze=({label:e,amount:t,unit:n},a)=>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 rounded-md items-baseline whitespace-pre",role:"listitem",children:[o(ze,{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:[Je(2)(t)," ",n||"₽"]}):null]},String(a)),et=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(tt)}):null)),tt=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(ze,{size:"text-m",font:"font-light",children:e})},String(t)),nt={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},at=d((({className:e,padding:t,defaultPadding:n,title:a,description:i,headlineVersion:r="L",align:l="text-left",benefitsVersion:s,isTabularBenefits:c,isDotted:d=!0,benefits:m,__html:u,richVersion:h,isFullWidthTitle:p,priceList:g=[],tags:f=[],buttons:y,image:x,imageOptions:{imageAlign:b="center",directionRight:v=!0,isImageAlwaysOnRight:N,isImageSecondary:w=!1,className:C}={},backwardButton:k,children:I,...T})=>{const D=x?.src?o(ie,{image:x,imageClassName:C}):null,_=o(S,{title:a,description:i,headlineVersion:r,align:l,isEmbedded:!0}),P=m?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Re,{className:e,padding:t,defaultPadding:n,...p?{title:_}:{insetTitle:_},...ot(D,v),isImageSecondary:w,imageAlign:b,isImageAlwaysOnRight:N,buttons:Ye(y),backwardButton:k,...T,children:st(it(P,{benefitsVersion:s,isTabularBenefits:c}),rt(u,{richVersion:h,isDotted:d,headlineVersion:r}),I,lt(g),ct(f))})})),it=(e,{benefitsVersion:t,isTabularBenefits:n}={})=>e?.length?o(We,{benefitsVersion:t,isTabularBenefits:n,benefits:e}):null,rt=(e,{richVersion:t,isDotted:n,headlineVersion:a}={})=>e?o(Fe,{__html:e,richVersion:t,isDotted:n,itemSize:nt[a??"L"]}):null,lt=e=>e?.length?o(Qe,{priceList:e}):null,st=(...e)=>{const t=e.filter(Boolean);return t.length?o("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:t.map(((e,t)=>o("div",{children:e},String(t))))}):null},ot=(e,t)=>t?{rightImage:e}:{leftImage:e},ct=e=>e?.length?o(et,{tags:e}):null;class dt{_;constructor(e){this._=e}of(e){return new this.constructor(e instanceof dt?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 mt=()=>!0,ut=(e,t)=>(...n)=>e(...n)&&t(...n),ht=(...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 pt=e=>Boolean(e&&Array.isArray(e)),gt=e=>Boolean(e&&"object"==typeof e&&!pt(e)),ft=e=>e;function yt(e){return e instanceof dt?e._:e}class xt extends dt{from(e){return this.of(e.map(((e=ft)=>([,t])=>e(t))(yt)))}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(pt(this._)?Array.from({length:Math.max(this._.length,Number(e)+1)},((n,a)=>a===e?t:this._[a])):Array.from({length:Number(e)+1},((n,a)=>a===e?t:void 0)))}}class bt extends dt{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 vt extends dt{from(e){return this.of(Object.fromEntries(e.map((([e,t])=>[e,yt(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 Nt extends dt{proto=ht([e=>pt(this._)||"number"==typeof e,()=>xt.prototype],[e=>gt(this._)||"string"==typeof e,()=>vt.prototype],[mt,()=>bt.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 wt=e=>e instanceof dt?e:new Nt(e),Ct=e=>{const t=(t,...n)=>yt(e(wt(t),...n));return t.fn=e,t},St=[],kt=e=>e instanceof Function?e:t=>e===t,It=e=>(t,n,a=St)=>wt(t).entries().reduce(((t,[n,i])=>It(e)(i,t,a.concat(n))),e(n,[a,wt(t)])),Tt=Ct(((e,[t,n])=>{const[a,...i]=t;return e.set(a,i.length?Tt(e.get(a),[i,n]):n)})),Dt=Ct(((e,t)=>t.reduce(Tt.fn,e))),_t=e=>It(((e,[t,n])=>Pt(n)?[...e,[t,yt(n)]]:e))(e,[]),Pt=e=>0===e.size();Ct(((e,t=St)=>t.reduce(((e,t)=>e.get(t)),e)));const Et=Ct(((e,[t,...n])=>n.length?e.set(t,Et(e.get(t),n)):e.filter((([e])=>e!==t)))),Rt=(At=["$ref"]).map(((e,t)=>n=>kt(e)(n[t+n.length-At.length]))).reduceRight(ut,mt);var At;const Mt=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(Ot,e),Ot=ht([pt,(e,t)=>e[parseInt(t,10)]],[gt,(e,t)=>e[t]],[mt,ft]),Bt=(e,t)=>((e,t={})=>n=>Dt(t,_t(n).map((t=>e(t)))))((([e,n])=>{return Rt(e)?[(a=e,a.slice(0,-1)),Mt(t(n),n)]:[e,n];var a}))(e),Ft=e=>_t(e).filter(((e=ft)=>([t])=>e(t))(Rt)),Lt=e=>{return t=Ft(e).map((([,e])=>e)),[...new Set(t)];var t};async function zt(e,t){try{return e?await Vt(e,t):null}catch(e){console.error(e)}return null}const Vt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),$t=e=>[...new Set(e)],jt={},qt=["/portal-resources"],Ut=(e,t)=>Bt(e,(e=>t?.[e])),Wt=(e,t)=>{const n=Lt(e),[r,l]=a({});return i((()=>{Ht(n).then(l)}),[n.join()]),n.length?Ut(e,{...t,...r}):e},Ht=async(e,t={})=>{if(e.length){const n=await(async e=>Object.fromEntries((await Promise.allSettled($t(e).filter((e=>!qt.some((t=>e.startsWith(t))))).map((async e=>(jt[e]||=await Vt(e),[e,jt[e]]))))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(e),a={...t,...n},i=Object.entries(n).flatMap((([,e])=>Lt(e)));return i.length?Ht(i,a):a}return t};function Yt(e,t={}){const n=d((t=>{const n=Wt((({block:e,options:t,className:n,defaultPadding:a,padding:i,isTheme:r,version:l,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...n})}));return Object.assign(n,t),n}const Gt=Yt((({className:e,padding:t,defaultPadding:n,...a})=>o(g,{className:u("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...a,children:o(at,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...a})}))),Kt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=l((()=>Xt(0,t?.length)),[t]),a=t?.[n];return a?o(Gt,{suppressHydrationWarning:!0,...a,...e}):o(g,{...e,children:o(f,{})})})),Xt=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),Jt=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const n=String(e.getDate()).padStart(2,"0"),a=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getFullYear());return t?`${i}-${a}-${n}`:`${n}.${a}.${i}`}},Qt=e=>e?.replace(/[^+\d]/g,""),Zt="/api/v1";const en=e=>e?{phone:Qt(e)}:{},tn=(e,t="birthday")=>e?{[t]:Jt(e)}:{},nn=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),an=(e,t=!0)=>({[t?"email":"mail"]:e}),rn=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:Qt(e)}:{},ln=(e,t)=>"PF"===e?{inn:t?.innDadata,region:t?.fullRegion,partnerComments:t?.partnerSymbolCode,fullname:t?.companyNameByInn}:{},sn=async({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:a,params:i}of e??[]){const e=t[a??""];e&&await e(n,i)}};function on(){return on._impl()}on._impl=()=>({assign:(e,t)=>{globalThis.open(e,t||"_self")},get origin(){return globalThis.location.origin},get href(){return globalThis.location.href}}),on.setup=e=>{on._impl=e};const cn="rshb-query-params";function dn(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(cn)||"";return e&&globalThis.sessionStorage?.setItem(cn,e),e}const mn=async e=>{const t=e.target?.closest("a"),n=on();if(M(t?.href)&&!t?.href?.startsWith(n.origin)){e.preventDefault(),e.stopPropagation();const a=(e=>{const t=dn();if(!M(e)||!t)return e;const n=new URL(e);for(const[e,a]of new URLSearchParams(t))n.searchParams.set(e,a);return n.toString()})(t?.href)||t?.href;a&&n.assign(a,t?.target)}};function un(){return un._impl()}function hn(e=!1){const[t,n]=a(e),i=r((()=>n(!0)),[]),l=r((()=>n(!1)),[]),s=r((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:i,setFalse:l,toggle:s}]}un._impl=()=>({forwardQuery:mn}),un.setup=e=>{un._impl=e};const pn=e=>t=>t&&Object.entries(e??{}).flatMap((([e,n])=>n?n(t[e]):[]))||[],gn=e=>!e?.length,fn=e=>t=>n=>e(n)?[]:[t],yn={},xn=[];const bn=(e,t)=>e&&t&&(e===t||Object.keys({...e,...t}).every((n=>e[n]===t[n])));function vn(e,{resetOnSubmit:t,formValidator:n,normalizer:o,onChange:c,onSubmit:d}={}){const[m,u]=function(e,t,n){const[l,s]=a(e),o=r((e=>s((a=>{const i=e instanceof Function?e(a):e,r=t?t(i):i,l=bn(i,r)?i:r;return!bn(a,l)&&n?.(l),l}))),[t,n]);return i((()=>{t&&s(t)}),[t]),[l,o]}(e,o,c),[h,{setTrue:p,setFalse:g}]=hn(!1),f=s({}),[y,{isValid:x,errors:b}]=function(e,t){const n=l((()=>t?.(e)??yn),[t,e]),a=l((()=>pn(n)(e)??xn),[n,e]),i=gn(a);return[n,{isValid:i,errors:a}]}(m,n),v=r(((e,t={})=>{const{parse:n,format:a,onChange:i}=t,r=m[e],l=h||f.current?.[String(e)],s=t?.validator??y[e],o=l&&s?s(r):[];return{value:a?a(r):r,isDirty:l,errors:s&&o,error:o[0],onChange:t=>{f.current||={},f.current[String(e)]=!0;const a=n?n(t):t;i?.(a),u((t=>({...t,[e]:a})))}}}),[m,h,y,u]),N=r((e=>{f.current=e,u(e)}),[u]),w=r((()=>{f.current={},g(),u(e)}),[e,u]),C=r((e=>{e.preventDefault(),x?(t&&w(),d?.(m,e)):p()}),[t,m,x,w,d]);return[m,{errors:b,field:v,update:N,reset:w,onSubmit:C}]}const Nn=d((e=>{const{className:t,title:n,children:a,...i}=e;return o(g,{className:t,defaultPadding:"p-6xl",...i,children:c("div",{className:"container space-y-lg",children:[n?o(N,{headingType:"h3",title:n,className:"@xl:text-center"}):null,a]})})}));function wn(e,t={}){const{open:n,close:a,...i}=ge();return{open:r(((i,r={})=>n({dialog:o(e,{...t,...i,onClose:()=>{a(),i.onClose?.()}}),...r})),[e,n,a]),close:a,...i}}const Cn=({label:e,errors:t})=>e&&t?`${e}*`:e,Sn=e=>o("div",{className:"min-h-6",children:e?o(ze,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),kn=(e,t=600)=>{let n;const a=(...i)=>{a.dispose(),n=setTimeout((()=>{e(...i)}),t)};return a.dispose=()=>{n&&clearTimeout(n)},a},In="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",Tn=e=>e?In:"border-error",Dn=e=>e?o(ze,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,_n=d((({key:e,className:t,id:n,name:a,type:l="text",label:d,placeholder:m,value:h="",valid:p=!0,pattern:g,autoFocus:f=!1,isTextarea:y=!1,disabled:x=!1,children:b,onChange:v,onFocus:N,onBlur:w})=>{const C=s(null),S=r((e=>{const t=(e.target?.value??"").trimStart();v&&v(t)}),[v]);i((()=>{f&&C.current?.focus()}),[f,C]);const k=b?"pr-3xl":"",I=Tn(p),T=d??a??n;return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[Dn(d),y?o("textarea",{className:u("block resize-y min-h-24",Pn,I),id:u("textarea",n),value:h,name:a||n,placeholder:m,disabled:x,"aria-label":T,onChange:S,onFocus:N,onBlur:w},e):o("input",{ref:C,className:u("h-14",Pn,k,I),id:n,type:l,value:h,name:a||n,placeholder:m,pattern:g,disabled:x,"aria-label":T,onChange:S,onFocus:N,onBlur:w},e)]}),b]})})),Pn="w-full border rounded-md text-primary-text outline-none p-m",En=e=>e?.text||e?.key||"";function Rn(e,t,n,a){i((()=>{if(e&&n)return e.addEventListener(t,n,a),()=>{e.removeEventListener(t,n,a)}}),[e,t,n])}function An(e){const t=s(null),n=r((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return Rn(globalThis.document,"click",n),t}const Mn=()=>ue(pe.emitter,"popup"),On=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,Bn=d((({popupRef:e,options:t,value:n,query:a,onChange:i,iconVersion:r,onChangeQuery: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:On(t,a).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(),i&&(l?.(""),i(e))},children:[e?.innDaData?c("span",{children:[o(ze,{size:"text-s",children:e?.innDaData?.companyName}),c("div",{className:"space-x-2",children:[o(ze,{size:"text-s",font:"font-light",children:En(e)}),o(ze,{size:"text-s",font:"font-light",children:e?.innDaData?.companyAddress})]})]}):o("span",{className:"min-h-6",children:En(e)}),o(G,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:r,className:u("absolute right-4 pt-3xs",{hidden:e.key!==n?.key})})]},e.key)))}):null));const Fn=d((({className:e,label:t,options:n=[],value:d,valid:m=!0,isBorder:h=!0,placeholder:p="",isSearch:g=!1,isManualInput:f=!1,disabled:y=!1,iconVersion:x="black",onChange:b,onSearchQuery:v})=>{const[N,{setFalse:w,setTrue:C}]=hn(),[S,k]=a(""),I=jn(y,n.length,f),T=Un(f,n),D=N&&!I,_=l((()=>v&&Wn(v)),[v]),P=r((()=>{I||C()}),[I]),E=r((()=>{!f&&k(""),w()}),[]),R=function({isOpen:e,options:t,value:n,query:a,onChange:l,onClose:c,iconVersion:d,onChangeQuery:m}){const u=Mn(),h=r((()=>{u.close(),c&&c()}),[c]),p=r((e=>{h(),l&&l(e),m&&m("")}),[h,l]),g=s(null),f=An(h);return i((()=>{if(!e||!g.current)return;const i=g.current,{top:r,left:l,width:s,height:c}=i.getBoundingClientRect();u.open({popup:o(Bn,{popupRef:f,options:t,value:n,query:a,onChange:p,iconVersion:d,onChangeQuery:m}),top:r+window.scrollY+c,left:l,width:s})}),[e,t,n,a,p]),g}({isOpen:N,options:n,value:d,query:S,onChange:b,onClose:E,iconVersion:x,onChangeQuery:k});return c("div",{className:u("space-y-xs",e),children:[Dn(t),c("div",{className:u("relative",D?"z-20":"z-10"),ref:R,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",$n(h,m,I)),onClick:D?E:P,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:Ln({isManualInput:f,query:S,value:d,placeholder:p})}),T?"":Vn(D,x)]}),g&&D?zn(S,I,(e=>{k(e),qn(e,b),_&&_(e)})):null]})]})})),Ln=e=>l((()=>e.isManualInput&&e.query?e.query:En(e.value)||e.placeholder),[e.isManualInput,e.query,e.value,e.placeholder]),zn=(e,t,n)=>o("div",{className:u("absolute top-0 w-full z-20"),children:o(_n,{type:"text",value:e,autoFocus:!0,disabled:t,onChange:e=>n(e)})}),Vn=(e,t)=>o(G,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),$n=(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"),jn=(e,t,n)=>e||!n&&0===t,qn=(e,t)=>{t&&""!==e.trim()&&t({key:e,text:e,innDaData:{}})},Un=(e,t)=>e&&!t.length,Wn=e=>kn((t=>e(t)),300),Hn=d((({className:e="",label:t,error:n,errors:a,...i})=>c("div",{className:e,children:[o(Fn,{...i,valid:!n,label:Cn({label:t,errors:a})}),Sn(n)]}))),Yn=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"SoftPOS",key:"softpos"},{text:"Все виды эквайринга",key:"all"}],Gn=d((({field:e,input:t})=>o(Hn,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:Yn,...e(t?.name??"")}))),Kn=(e="")=>Boolean("trade"===e||"all"===e),Xn=e=>null!=e,Jn=new Map,Qn=(e,t=Jn)=>n=>{const a=ea(n),i=t.get(a);if(a&&Xn(i))return i;const r=e(...n);return a&&Xn(r)&&t.set(a,Promise.resolve(r)),r},Zn=e=>Boolean(e?.every((e=>Array.isArray(e)?Zn(e):!e||"string"==typeof e))),ea=e=>Zn(e)?e.toString():"",ta=e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]);function na(e,t,{fallback:n,cache:r}={}){const s=l((()=>aa(e)),[e]),[o,c]=a(void 0),[d,m]=a(void 0);i((()=>{if(!s.some(Xn))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await Qn(t,r)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,r,s]);const u=n&&ta(s)&&n[s[0]];return{data:!o&&u?u:o,error:d,mutate:()=>Promise.resolve(void 0)}}function aa(e){return Array.isArray(e)?e:e instanceof Function?aa(e()):[e]}const ia=`${Zt}/branches`,ra=[];const la=async e=>await zt(e,{method:"GET"})||ra;function sa(e=!1){const{data:t}=na(`${Zt}${e?"/premiumBranchesByRegions":"/branchesByRegions"}`,Vt);return Array.isArray(t)?t:[]}const oa=(e="")=>"ULTRASERVICE"===e,ca=d((({field:e,input:t,params:n})=>{const a=oa(n?.typeForm),r=e("region"),l=r?.value?.key,s=r?.value?.text,c=a?sa(a)?.find((e=>e?.region===s))?.branches:function(e){const{data:t}=na(e?`${ia}?regionCode=${e}`:null,la);return t||ra}(l)?.filter((e=>e?.address));return i((()=>{""!==r?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[r?.value]),o(Hn,{label:"Отделение",placeholder:"Выберите отделение",options:(c||[]).map((({address:e=""})=>({key:e,text:e}))),...e(t?.name??""),isSearch:!0})})),da=(e,{normalize:t,format:n})=>{const{value:i,onFocus:l,onBlur:s,onChange:o}=e,[c,d]=a(!1),m=r((e=>{d(!0),l&&l(e)}),[]),u=r((()=>{d(!1),o&&o(t(i)),s&&s()}),[o,i]);return{value:c||!n?i:n(i),onFocus:m,onBlur:u}},ma=(e,t,n)=>Math.max(t,Math.min(e,n));function ua(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function ha({list:e=[],min:t,max:n,step:a,value:i=e[0]||t,disabled:r,onChange:l}){const s=e.length?e.indexOf(i):i,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||r?"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:a,value:s,disabled:r,onChange:t=>{const n=ua(t.target?.value),a=e.length?e[n]:n;l&&l(a||0)}})})]})}const pa=1,ga=100,fa=d((e=>{const{className:t,title:n,items:a=[],list:i=[],min:l=(i.length?0:pa),max:s=(i.length?i.length-1:ga),step:d=1,value:m=i[0]||l,disabled:h=!1,onChange:p}=e,g=da(e,{normalize:(e=0)=>i.length?ya(i)(e):ma(e,l,s),format:Je()}),f=r((e=>{p&&p(ua(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(ze,{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 box-border","text-primary-text",In,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:f,...g}),ha({list:i,min:l,max:s,step:d,disabled:h,value:m,onChange:p})]}),xa(a)]})})),ya=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),xa=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(ze,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),ba=["От 1 000 ₽","До 1 000 000 000 ₽"],va=d((({field:e,input:t})=>o(fa,{title:"Сумма, ₽",items:ba,min:1e3,max:1e9,...e(t?.name??"")}))),Na=()=>{},wa=d((({className:e,label:t,value:n="",error:a,errors:i,type:l,isInteger:s,placeholder:d,maxLength:m,inputRef:h,isOpen:p,onOpen:g,onClose:f,onChange:y=Na,...x})=>{const b=An(f),v=r((e=>{const t=m&&e.length>m;!p&&g(),t||y(Ca(e,s))}),[p,y]);return c("div",{className:u("shrink-0 w-full",e),ref:b,onBlur:f,onFocus:g,children:[o("div",{ref:h,children:o(_n,{type:l||"text","aria-label":t,label:Cn({label:t,errors:i}),valid:Boolean(!a),onChange:v,placeholder:Sa({placeholder:d,errors:i,label:t}),value:n,...x})}),Sn(a)]})})),Ca=(e="",t=!1)=>t&&e?e.replace(/[^\d]+/g,""):e,Sa=({placeholder:e,errors:t,label:n})=>t&&!n?`${e}*`:e,ka=d((e=>{const[t,{setFalse:n,setTrue:a}]=hn();return o(wa,{isOpen:t,onOpen:a,onClose:n,...e})})),Ia=d((({field:e,input:t})=>o(ka,{label:"Годовая выручка, ₽",...e(t?.name??"")}))),Ta=d((({field:e,input:t})=>o(ka,{label:"Дата и время обращения в Банк",...e(t?.name??"")}))),Da="client",_a=[{key:Da,text:"Клиент"},{key:"representative",text:"Представитель клиента"}],Pa=d((({field:e,input:t})=>o(Hn,{label:"Тип обратившегося",...t,options:_a,...e("applierType")}))),Ea=d((({field:e,input:t})=>o(ka,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e(t?.name??"")}))),Ra=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:a,currentYear:i,min:r,max:l,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(i,a,d),n=Aa(t,e),c=Ma(t,r,l);u.push(o("td",{children:o("div",{className:Oa(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},Aa=(e,t)=>t&&e.toDateString()===t.toDateString(),Ma=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),Oa=(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"),Ba=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Fa=d((({today:e,currentMonth:t,currentYear:n,min:a,max:i,onDateSelect:r=Na})=>{const{firstDayOfWeek:s,totalDays:d}=l((()=>({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:Ba.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:Ra({firstDayOfWeek:s,today:e,totalDays:d,currentYear:n,currentMonth:t,min:a,max:i,onDateClick:r})})]})})),La=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function za(e,t){const n=e.replace(/\D/g,"");if(""===n||n.length===t.length)return e;const a=[...t],i=a.findIndex(Va),r=a.map(((e,t)=>ja(e)?a.slice(0,t).filter(ja).length:-1)),l=a.map(((e,t)=>$a(e)?e:n.charAt(r[t])||e)),s=r.indexOf(n.length-1)+1;return l.slice(0,Math.max(i,s)).join("")}const Va=e=>"_"===e,$a=e=>/\d/.test(e),ja=e=>Va(e)||$a(e),qa=1940,Ua={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},Wa=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:r,disabled:l,onChange:d,onClick:m})=>{const h=s(null),[p,g]=a(r||"");return i((()=>{g(r||"")}),[r]),i((()=>{Ya({inputValue:p,setSelectedMonth:e,setSelectedYear:t,onChange:d})}),[p]),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(za(t,"__.__.____"))},onBlur:()=>{Ha(p)?Ya({inputValue:p,setSelectedMonth:e,setSelectedYear:t,onChange:d}):g(r||"")},disabled:l}),l?null:o(G,{className:"mr-s",...Ua})]})})),Ha=e=>{const[t,n,a]=e.split(".");if((e=>Number(e)>=qa&&Number(e)<=(new Date).getFullYear())(a)&&(e=>Number(e)>0&&Number(e)<13)(n)){const e=new Date(Number(a),Number(n)-1,1);let i=0;for(;e.getMonth()===Number(n)-1;)e.setDate(e.getDate()+1),i++;return Number(t)>0&&Number(t)<=i}return!1},Ya=({inputValue:e,setSelectedMonth:t,setSelectedYear:n,onChange:a})=>{if(Ha(e)){const{day:i,month:r,year:l}=(e=>{const[t,n,a]=e.split(".");return{day:Number(t),month:Number(n)-1,year:Number(a)}})(e);t(r),n(l),a?.(new Date(l,r,i))}},Ga=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:a,setSelectedMonth:i,setSelectedYear:r,disabled:l=!1})=>o(Wa,{onChange:a,disabled:l,onClick:e,value:t&&Jt(t),setSelectedMonth:i,setSelectedYear:r,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")}),Ka=La.map((e=>({key:e}))),Xa=Array.from({length:(new Date).getFullYear()-qa+1},((e,t)=>qa+t)).reverse().map((e=>({key:String(e)}))),Ja=(e,t)=>{const n=new Date(e,t,1);let a=0;for(;n.getMonth()===t;)a++,n.setDate(n.getDate()+1);return a},Qa=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:a,onChange:i})=>{a&&i?.(new Date(t,n,Math.min(e,a.getDate())))},Za={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},ei={className:"min-w-32",iconVersion:"black",isBorder:!1},ti=d((({className:e="",label:t="",value:n,valid:l=!0,minDate:s,maxDate:d,disabled:m,onChange:h})=>{const[p,{setValue:g,setFalse:f}]=hn(!1),[y,x]=a(n?.getMonth()||(new Date).getMonth()),[b,v]=a(n?.getFullYear()??(new Date).getFullYear()),N=r((e=>{h?.(e),f()}),[h]),{handlePrevMonth:w,handleNextMonth:C,handleSelectMonth:S,handleSelectYear:k,monthsOptions:I,yearsOptions:T,handleChangeVisibleCalendar:D,ref:_}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:a,onYearSelect:i,selectedYear:l,onChange:s,value:o})=>{const c=An(r((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:r((()=>e(!t)),[t]),handleNextMonth:r((()=>{n+1<=11?a(n+1):(a(0),i(l+1))}),[n]),handlePrevMonth:r((()=>{n-1>=0?a(n-1):(a(11),i(l-1))}),[n]),handleSelectMonth:r((({key:e})=>{a(La.indexOf(e));const t=Ja(l,La.indexOf(e));Qa({maxDateOfMonth:t,selectedYear:l,selectedMonth:La.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:r((({key:e})=>{i(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:Ka,yearsOptions:Xa,ref:c}})({onYearSelect:v,onMonthSelect:x,onShowCalendar:g,selectedYear:b,selectedMonth:y,showCalendar:p,onChange:h,value:n}),P=((e,t)=>{const[n,r]=a(!1);return i((()=>{const n=()=>{if(e?.current){const{top:n}=e.current.getBoundingClientRect();r(n>t)}};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}),[e]),n})(_,370);return c("div",{className:u("space-y-xs",e),ref:_,children:[Dn(t),c("div",{className:"relative",children:[Ga({handleChangeVisibleCalendar:D,value:n,valid:l,onChange:h,disabled:m,setSelectedMonth:x,setSelectedYear:v}),p&&!m?c("div",{className:u("absolute bg-white z-20 select-none",{"bottom-full":P}),children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:w,children:o(G,{...Za,className:"-rotate-90 cursor-pointer"})}),o(Fn,{onChange:S,value:{key:La[y]},options:I,...ei}),o(Fn,{onChange:k,value:{key:String(b)},options:T,...ei}),o("div",{className:"my-auto",onClick:C,children:o(G,{...Za,className:"rotate-90 cursor-pointer"})})]}),o(Fa,{today:n,currentMonth:y,currentYear:b,min:s,max:d,onDateSelect:N})]}):null]})]})})),ni=d((({className:e,label:t,error:n,errors:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(ti,{label:Cn({label:t,errors:a}),valid:Boolean(!n),...i}),Sn(n)]}))),ai=d((({field:e,input:t})=>o(ni,{label:t?.label||"Дата рождения",...e(t?.name??"")}))),ii=d((({field:e,input:t})=>o(ka,{label:"Количество объектов инкассации",isInteger:!0,...e(t?.name??"")}))),ri=d((({field:e,input:t})=>o(ka,{className:"col-span-2",...e(t?.name??""),placeholder:"Ваше сообщение",isTextarea:!0}))),li=d((({field:e,input:t})=>{const n=e("innDadata");return i((()=>{if(""!==n?.value?.key){const t=n?.value?.innDaData?.companyName;t&&e?.("companyNameByInn")?.onChange?.(t)}}),[n?.value]),o(ka,{maxLength:60,label:"Полное наименование",...e(t?.name??""),...t})})),si=d((({field:e,input:t})=>o(ni,{label:"Желаемая дата встречи",...e(t?.name??"")}))),oi=d((({field:e,input:t})=>o(ka,{label:"Электронная почта",...e(t?.name??""),...t}))),ci=[{key:"ULTRASERVICE",text:"Ультра"}],di=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],mi=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],ui=d((({field:e,input:t})=>o(Hn,{label:"Способ получения ответа",options:mi,...e(t?.name??"")}))),hi=d((({field:e,input:t})=>o(ka,{label:"ФИО",...e(t?.name??""),...t}))),pi=d((({field:e,input:t,params:n})=>{const a=n?.isPremium,i=sa(a),r=l((()=>i?.map((({region:e})=>({key:e,text:e})))),[i]);return o(Hn,{label:"Регион",placeholder:"Выберите регион",options:r,...e(t?.name??"")})}));function gi(e,t){i((()=>{const t=e();return()=>{t.then((e=>{e instanceof Function&&e()}))}}),t)}const fi=e=>({value:e?.value||""}),yi=e=>{const{url:t,query:n,queryPrefix:a,requestData:i={},responseItemHandler:r=fi,responseFilter:l}=e,s=((e,t)=>n=>{const a=n?.suggestions||[];return(t?a.filter(t):a).map((t=>{const n=e(t);return{...t,processedValue:n.value,additionalValue:n.additionalValue}}))})(r,l),o=`${a?`${a}, `:""}${n}`;return globalThis?.fetch?.(`/api/v1/suggestions/${t}`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:10,...i,query:o})}).then((e=>e.json())).then(s)},xi=d((({field:e,input:t})=>{const[n,i]=a([]),[r,s]=a("");gi((async()=>{const e=(async e=>(await yi({url:"suggest/party",query:e})).map((e=>({fullName:e?.value,address:e?.data?.address?.value,inn:e?.data?.inn}))))(r);return i(await e),n}),[r]);const c=l((()=>(n||[]).map((e=>({key:e?.inn??"",text:e?.inn,innDaData:{companyName:e?.fullName,companyAddress:e?.address}})))),[n]);return o(Hn,{label:"ИНН",placeholder:"Введите ИНН",options:c,...e(t?.name??""),isSearch:!0,isManualInput:!0,onSearchQuery:s})})),bi=d((({field:e,input:t})=>o(ka,{label:"ИНН",isInteger:!0,maxLength:12,...t,...e(t?.name??"")}))),vi=d((({className:e,viewBox:t,fill:n="none",width:a,height:i,paths:r,...l})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:a,height:i,children:r.map((({d:e,fill:t,...n},a)=>{const i={...l,...n};return o("path",{d:e,fill:t||"currentColor",stroke:i.stroke,strokeLinecap:i.strokeLinecap,strokeLinejoin:i.strokeLinejoin,strokeWidth:i.strokeWidth,strokeMiterlimit:i.strokeMiterlimit},a)}))}))),Ni=[{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"}],wi=d((({className:e,value:t,text:n,disabled:a,isRadio:i,onChange:l})=>{const s=r((e=>{a||(e.preventDefault(),l&&l(!t))}),[l,a,t]),d=i?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(vi,{paths:Ni,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",Si(a)),onClick:s,children:[o("div",{className:u("appearance-none w-5 h-5 border-solid flex-none","m-0",i?"rounded-full border-2":Ii(t),!a&&t?"border-primary-main":"border-gray",a?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:ki(i),"aria-checked":Boolean(t),"aria-disabled":Boolean(a),"aria-label":n}),t?d:null,Ci(n)]})})})),Ci=e=>e?o("div",{className:"ml-s",children:o(ze,{size:"text-l",font:"font-light",children:e})}):null,Si=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",ki=(e=!1)=>e?"radio":"checkbox",Ii=(e=!1)=>u("rounded border",{"bg-primary-main":e}),Ti=d((({className:e,text:t,value:n,key:a,disabled:i,error:r,onChange:l})=>c("div",{className:u("shrink-0",e),children:[o(wi,{text:t,value:n,disabled:i,onChange:l},a),Sn(r)]}))),Di=d((({field:e,input:t})=>o(Ti,{...e(t?.name??""),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),_i=`${Zt}/outservice`,Pi=[];async function Ei(){const e=await zt(`${_i}/outserviceregions`);return e&&Array.isArray(e)?e:Pi}const Ri=d((({field:e,input:t})=>{const n=e("region"),a=n?.value?.key,{data:r}=na("outServiceRegions",Ei),s=l((()=>r?.find((e=>e.code===a))?.localities?.map((e=>({key:e,text:e})))),[r,a]);return i((()=>{""!==a&&e?.(t?.name??"")?.onChange?.("")}),[a,t?.name??""]),o(Hn,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:s,...e(t?.name??""),isSearch:!0})})),Ai=(e,t,n="")=>t?.filledByEsia&&Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t?.name??n).value,Mi=d((({field:e,input:t})=>o(ka,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:Ai(e,t),...e(t?.name??""),...t}))),Oi=d((({field:e,input:t})=>o(ka,{label:"Имя",maxLength:60,disabled:Ai(e,t),...e(t?.name??""),...t}))),Bi=d((({value:e=!1,text:t,type:n="checkbox",onChange:a})=>c("div",{role:n,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>a&&a(!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(ze,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),Fi=d((({field:e,input:t})=>Kn(e("acquiringType")?.value?.key)?o(Bi,{type:"radio",text:"Хочу онлайн-кассу",...e(t?.name??"")}):null)),Li=d((({field:e,input:t})=>o(ka,{...e(t?.name??""),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...t}))),zi=Yt((({field:e,input:t,source:n})=>{const r=n?.agentsList,{value:l}=e("partnerSymbolCode"),[s,c]=a(""),d=r?.some((e=>e?.symbolCode===l));return i((()=>{c(l&&!d?"ID партнера не найден. Обратитесь к своему менеджеру":"")}),[l]),o(ka,{label:"Идентификатор партнера",isInteger:!0,maxLength:12,...t,...e(t?.name??""),error:s||e("partnerSymbolCode")?.error})})),Vi=e=>"_"===e,$i=e=>/\d/.test(e),ji=e=>Vi(e)||$i(e),qi=[..."+7 (___) ___-__-__"],Ui=qi.findIndex(Vi),Wi=qi.map(((e,t)=>ji(e)?qi.slice(0,t).filter(ji).length:-1));function Hi(e){const t=e.replace(/\D/g,""),n=qi.map(((e,n)=>$i(e)?e:t.charAt(Wi[n])||e)),a=Wi.indexOf(t.length-1)+1;return(a?n.slice(0,Math.max(Ui,a)):n).join("")}const Yi=d((({children:e,onChange:t,...n})=>{const a=r((e=>t&&t(Hi(e))),[t]),i=r((e=>{"+7 ("===e&&t&&t("")}),[]);return o(_n,{...n,onChange:a,onFocus:e=>a(e?.target?.value||""),onBlur:e=>i(e?.target?.value||""),children:e})})),Gi=d((({className:e,label:t,disabled:n,error:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Yi,{"aria-label":t,label:Cn({label:t,errors:i?.errors}),valid:Boolean(!a),disabled:n,placeholder:"+7 (___) ___-__-__",...i}),Sn(a)]}))),Ki=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(Gi,{label:"Телефон",disabled:Ai(e,t,n),...e(n),...t})})),Xi=d((({field:e})=>Kn(e("acquiringType")?.value?.key)?o(Bi,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),Ji=Yt((({field:e,input:t,source:n})=>o(Hn,{placeholder:"Выберите продукт",label:"Продукт",options:Qi(n?.productList),...e(t?.name??"")}))),Qi=e=>(e??[]).map((e=>({key:e,value:e}))),Zi=`${Zt}/regions`,er=[];function tr(e=Zi){const{data:t}=na(e,Vt);return Array.isArray(t)?t:er}const nr=`${Zt}/outservice/outserviceregions`,ar=d((({field:e,input:t,params:n})=>{var a;const i=tr((a=n?.typeForm,"OUTSERVICE"===a?nr:void 0));return o(Hn,{label:t?.label||"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:l((()=>i?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[i]),...e(t?.name??"")})})),ir=d((({field:e,input:t})=>o(ka,{label:"ФИО представителя",...t,...e("representativeName")}))),rr=(e,t)=>{const{value:n,isDirty:a}=e,i=a?t(n):[];return{...e,errors:i,error:i[0]}},lr=/^[а-яё-]*$/i,sr=(e="")=>lr.test(e),or=fn((e=>null!=e&&""!==e)),cr="Некорректно заполненное поле",dr=e=>or(e??cr),mr=e=>fn((e=>e?.key&&""!==e?.key))(e??cr),ur=e=>fn((e=>"string"==typeof e&&e.length>1&&sr(e)))(e??cr),hr=e=>/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(e),pr=e=>fn(hr)(e),gr=fn((e=>"boolean"==typeof e&&e))("Согласие обязательно"),fr=e=>"string"==typeof e&&(10===e.length||12===e.length),yr={fullName:dr(),addressBranch:mr(),desiredMeetingDate:dr(),product:dr(),localities:dr(),partnerComments:dr(),collectionCount:dr(),acquiringType:mr(),serviceType:mr(),annualRevenue:dr(),feedbackMethod:mr(),serviceDirection:mr(),secondaryPhone:pr("Укажите номер телефона"),region:mr(),situationDescription:dr(),sufferedFrom:dr(),applierType:dr(),surname:ur("Укажите свою фамилию на кириллице"),name:ur("Укажите своё имя на кириллице (без сокращений)"),middleName:ur("Укажите своё отчество на кириллице"),birthday:dr("Укажите дату рождения"),phone:pr("Укажите номер телефона"),email:(xr="Укажите электронную почту",fn((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(xr)),inn:(e=>fn((e=>fr(e)))(e))("Укажите ИНН"),comment:dr(),typeForm:dr(),consentToReceiveMaterials:gr,consentDataProcessing:gr,partnerSymbolCode:dr(),innDadata:(e=>fn((e=>Boolean(e?.text)&&fr(e.text)))(e))("Укажите ИНН"),companyNameByInn:dr()};var xr;const br=(e,t={})=>{const n=e.filter((e=>Boolean(e?.required&&e?.name))),a={...yr,...t},i=n.some((e=>e.condition?.values)),r=Object.fromEntries(n.filter(vr(a)).map((({name:e})=>[e,a[e??""]])));return e=>i?Object.fromEntries(n.filter(vr(a)).filter(Nr(e)).map((({name:e})=>[e,a[e??""]]))):r},vr=(e={})=>({name:t})=>Boolean(e[t??""]),Nr=e=>t=>!t?.condition||t.condition.values.find((n=>{const a=e?.[t?.condition?.name??""];return n===(a?.key??a)})),wr=d((({field:e})=>{const t=e("secondaryPhone");return o(Gi,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?rr(t,yr.secondaryPhone):t})})),Cr=d((({field:e,input:t})=>o(Hn,{label:"Направление обслуживания",placeholder:"Выберите направление",options:di,...e(t?.name??"")}))),Sr=d((({field:e,input:t})=>o(ka,{label:"Описание ситуации",...t,...e("situationDescription")}))),kr=[{key:"blg",text:"Белгородской области"},{key:"brnsk",text:"Брянской области"},{key:"krsk",text:"Курской области"},{key:"chs",text:"От стихийного бедствия ЧС"}],Ir=d((({field:e,input:t})=>o(Hn,{label:"Пострадал в",...t,options:kr,...e("sufferedFrom")}))),Tr=d((({field:e,input:t})=>o(ka,{label:"Фамилия",maxLength:60,disabled:Ai(e,t),...e(t?.name??""),...t}))),Dr=["От 1 мес","До 15 лет"],_r=d((({field:e})=>o(fa,{title:"Срок, месяцев",items:Dr,min:1,max:180,...e("term")}))),Pr=d((({field:e,input:t})=>o(Hn,{label:"Тип обслуживания",options:ci,...e(t?.name??"")}))),Er={horizontal:"@lg:flex-row",vertical:""},Rr=d((({label:e,items:t,value:n,className:a,disabled:i=!1,orientation:r="horizontal",onChange:l})=>c("div",{className:"grid gap-xs whitespace-nowrap",children:[e?o("div",{role:"radiogroup","aria-label":e,children:o(ze,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",Er[r],a),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(wi,{isRadio:!0,text:t,value:n===e,onChange:()=>l?.(e),disabled:i},String(e))))})]}))),Ar=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],Mr=d((({field:e,input:t})=>{const n=r((t=>{"currencyControl"!==t&&(e("inn").onChange?.(""),e("region").onChange?.(""))}),[]);return o("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:o(Rr,{className:"whitespace-normal",orientation:"horizontal",items:Ar,...e(t?.name??"",{onChange:n})})})})),Or=d((({field:e,input:t})=>o(wi,{text:"Согласен на получение информационных и аналитических материалов по электронной почте",...e(t?.name??"")})));const Br={$ref:"/wcms-resources/outservice-productlist.json"},Fr={$ref:"/wcms-resources/agenty-dlya-rko.json"},Lr={fullName:hi,addressBranch:ca,desiredMeetingDate:si,product:e=>o(Ji,{...e,source:Br}),localities:Ri,isClient:Di,partnerComments:Li,collectionCount:ii,acquiringType:Gn,onlineCheckout:Fi,posTerminal:Xi,serviceType:Pr,term:_r,amount:va,annualRevenue:Ia,vedTypes:Mr,feedbackMethod:ui,serviceDirection:Cr,bankEmpolee:Ea,secondaryPhone:wr,applicationDate:Ta,region:e=>oa(e?.params?.typeForm)?o(pi,{...e}):o(ar,{...e}),consentToReceiveMaterials:Or,sufferedFrom:Ir,situationDescription:Sr,representativeName:ir,applierType:Pa,surname:Tr,name:Oi,middleName:Mi,birthday:ai,phone:Ki,email:oi,inn:bi,comment:ri,fullRegion:pi,partnerSymbolCode:e=>o(zi,{...e,source:Fr}),innDadata:xi,companyNameByInn:li},zr=(e,t,n={})=>(a,i)=>{const r={...Lr,...n}[String(a.name)];return function({input:e,field:t}){const{condition:n}=e,{value:a}=t(n?.name||"");return!n||n?.values?.includes(a?.key??a)}({input:a,field:e})&&r?o("div",{children:o(r,{field:e,input:a,params:t})},i):null},Vr=e=>2===e?"@xl:grid-cols-2":"@xl:grid-cols-1 gap-x-0",$r=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(ze,{size:"text-h6",children:e})}):null,jr={primary:u("text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active","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("text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active","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")},qr=u("group/btn-embedded","bg-transparent border border-transparent outline-none"),Ur=u("bg-main-gray text-main-disabled cursor-not-allowed"),Wr=d((({className:e,type:t="button",version:n="primary",shape:a="default",embedded:i,disabled:s,role:c,ariaLabel:d,data:m,dataTheme:h,children:p,wcmsIgnore:g,onClick:f=Na})=>{const y=r("tab"!==c?me(f):f,[c,f]),x=l((()=>ve(m)),[m]),b="round"===a;return o("button",{className:u("font-sans flex items-center gap-xs",{[jr[n]]:!s&&!i,[qr]:i,[Ur]:s},i?"justify-between":"justify-center",i||b?"p-0":"px-9 py-4",{"rounded-md":"default"===a,"rounded-full":b},e),type:t,role:c,"aria-label":d,disabled:s,"aria-disabled":s?"true":void 0,"data-theme":h,"data-wcms-ignore":g,...x,onClick:y,children:p})})),Hr=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(G,{name:"CloseIcon",width:"20",height:"20",iconVersion:"gray"})}))),Yr=d((({className:e,head:t,children:n,onClose:a,onClick:i})=>c("div",{className:u("relative bg-white pt-0 p-lg",e),role:"dialog",title:"Диалог",onClick:i,children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(Hr,{className:"absolute top-0 right-0",onClose:a}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]}))),Gr=d((({ok:e,typeForm:t,onClose:n})=>{const a="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся";return o(Yr,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto",onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ie,{image:{icon:e?"ResponseOKIcon":"ResponseFailIcon",iconVersion:"normal"},width:"136",height:"136"}),o(S,{className:"w-full",title:e?"Ваша заявка отправлена":"Не удалось отправить заявку",description:e?a:"Пожалуйста, повторите позднее",headlineVersion:"XS",isEmbedded:!0}),o(Wr,{type:"button",onClick:n,children:"Хорошо"})]})})})),Kr=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:a,amount:i,term:r,annualRevenue:l,serviceType:s,vedTypes:o,region:c,inn:d,sufferedFrom:m,situationDescription:u,applierType:h,...p}=e,g=t||l?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:a=!1,term:i,amount:r,annualRevenue:l}=e;return t?`Вид эквайринга=${t?.text||""}${Kn(t?.key)?`/Онлайн касса=${n}/POS-терминал=${a}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${r}/Срок=${i}/Выручка=${l}`})(e):null,f={...p,...Zr(o),...Qr(c),...d&&{inn:d},...g?{partnerComments:g}:{},...s?{typeForm:s}:{},...Jr(m?.text,u),...Xr(h)};return Object.fromEntries(Object.entries(f)?.map((([e,t])=>[e,t?.key||t])))},Xr=e=>e?.key?{isClient:e?.key===Da}:{},Jr=(e,t)=>e||t?{comment:`${e||""};${t||""}`}:{},Qr=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},Zr=e=>e?{vedTypes:Object.fromEntries(Ar.map((({id:t})=>[t,t===e])))}:{},el={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:Yn[0],serviceType:ci[0],feedbackMethod:mi[0],serviceDirection:di[0],vedTypes:Ar[0].id,birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""}},tl=d((({color:e="text-primary-main",position:t="absolute",blur:n=!0,size:a="big"})=>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","animate-spin rounded-full","border-solid border-current","border-r-transparent","small"===a?"border-4 h-8 w-8":"border-8 h-28 w-28",e),role:"status"})}))),nl=d((({isLoading:e,disabled:t,children:n,className:a,...i})=>c(Wr,{type:"submit",className:u("relative",a),disabled:e||t,...i,children:[e?o(tl,{blur:!0,size:"small"}):null,n]}))),al={primary:jr.primary,secondary:jr.secondary,white:"text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main",link:"text-primary-main",gray:jr.secondary,transparent:"","":""},il=d((e=>{const t=xe(),{className:n,href:a,target:i,text:r,aboveText:l,version:s="link",rel:c,ariaLabel:d,data:m,children:h,onClick:p}=t(e),g="link"!==s;return o("a",{className:u("group/btn inline-flex items-center h-fit","font-sans no-underline select-none","border border-transparent focus:border-primary-text focus:border","cursor-pointer",{[al[s]]:Boolean(s),[l?"px-9 py-2.5":"px-9 py-4"]:g,"rounded-md":g},n),href:a,target:i,rel:c,"aria-label":d??`Ссылка на ${r}`,role:a?"link":"button",onClick:p,...ve(m),children:h??rl(r,l)})})),rl=(e,t)=>e||t?c("div",{className:"whitespace-pre",children:[t?o("div",{className:"font-light text-left text-xs",children:t}):null,o("div",{className:u("text-left",{"text-s -mt-3xs":Boolean(t)}),children:e})]}):null,ll=d((({text:e,link:t})=>c(w,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(ze,{children:e}):null,t?o(il,{...t,ariaLabel:"условия передачи данных",children:t.text}):null]}))),sl=(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(wi,{...e}),o(ll,{link:t})]}),Sn(rr(e,gr).error)]}):o(ll,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),o(nl,{className:"w-full @xl:w-auto",children:n?.text?n.text:"Отправить заявку"})]}),ol={send:async function(e,t=!1){const{typeForm:n,region:a,phone:i="",email:r,birthday:l,desiredMeetingDate:s,inn:o,innDadata:c,fullRegion:d,addressBranch:m,secondaryPhone:u="",bankEmpolee:h,applicationDate:p,serviceDirection:g,partnerSymbolCode:f,companyNameByInn:y,...x}=e,b=t&&"Юридическое лицо / ИП"!==g,v=`${Zt}${b?"/lead":"/sendcorporatelead"}`,N={typeForm:n,...nn(a,b),...an(r,b),...en(i),...tn(s,"desiredMeetingDate"),...b?tn(l):{inn:o},..."FEEDBACK"===n?{}:{addressBranch:m,bankEmpolee:h,applicationDate:p,...rn(u)},...ln(n,{innDadata:c,fullRegion:d,partnerSymbolCode:f,companyNameByInn:y}),...x};try{const e=await fetch(v,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(N)});return e?.ok?await e.json():null}catch(e){return null}}},cl=Yt((({className:e,title:t,typeForm:n="",sections:a=[],button:i,link:s,endpoint:d,additionalParams:m,isContacts:h,data:p,...g})=>{const f=l((()=>a?.flatMap((e=>e?.inputs))||[]),[a]),y=l((()=>((e,t="")=>({...Object.fromEntries(e.map((e=>[e.name,"vedTypes"===e?.name&&e?.defaultValue||el[e.name||""]]))),typeForm:{key:t,text:""}}))(f,n)),[f,n]),x=l((()=>br(f)),[f]),b=wn(Gr),v=un(),w=r((async(e,t)=>{const a=Kr({...e,...m}),i=Boolean(await ol.send(a,"lead"===d));b.open({ok:i,typeForm:n}),i&&sn({aspectsAttributes:p,aspects:v,ev:t})}),[n]),[,{field:C,onSubmit:S}]=vn(y,{resetOnSubmit:!0,formValidator:x,onSubmit:w}),k=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(f)?.name;return c(Nn,{className:u("container space-y-m",e),title:t,...g,children:[c("form",{onSubmit:S,children:[dl(a,C,{typeForm:n,additionalParams:m}),sl(k?C("consentDataProcessing"):void 0,s,i)]}),h?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(ie,{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(ie,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]}):null]})})),dl=(e,t,{typeForm:n,additionalParams:a})=>e.map(((e,i)=>c("div",{className:u(Vr(e.columns),"grid gap-x-m"),children:[$r(e.title),(e?.inputs||[])?.map(zr(t,{typeForm:n,...a}))]},`section-${i}`))),ml=d((({attempts:e,onClose:t=Na})=>{const n=on(),a=e>1,i=r((()=>{n.assign("/natural")}),[]),l=r((()=>{a?i():t()}),[a]);return o(Yr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg px-5xl",onClose:l,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o(w,{align:"text-center",children:"Уважаемый клиент!"}),o(w,{align:"text-center",children:"Для получения кредита Вам необходимо обратиться в офис Банка"}),c("div",{className:"flex flex-col sm:flex-row gap-xl items-center",children:[o(Wr,{type:"button",version:"secondary",onClick:i,children:"Завершить"}),a?null:o(Wr,{type:"button",onClick:t,children:"Продолжить"})]})]})})})),ul="Некорректно заполненное поле",hl="Укажите регион, город/населенный пункт, улицу, дом",pl=/^[\u0400-\u04FF-\s]+$/u,gl=e=>Boolean(e.region&&(e.city||e.locality)&&e.house),fl=()=>fn(gl)(hl),yl=e=>fn((e=>"string"==typeof e&&e.length>1&&pl.test(e)))(e??ul),xl=e=>fn((e=>"string"==typeof e&&/^[0-9]{1,2}$/g.test(e)))(e??ul),bl=(e,t,n)=>fn((t=>"string"==typeof t&&t.length>=1&&(n?t.length===e:t.length<=e)))(t??ul),vl=e=>fn((({minAge:e,maxAge:t})=>n=>{const a=new Date,i=new Date(a.getFullYear()-e,a.getMonth(),a.getDate()),r=t?new Date(a.getFullYear()-t,a.getMonth(),a.getDate()):null;return!(!n||n>i||r&&n<r)})(e))(e.errorMessage),Nl=e=>{const t=String(e).replace(/[^0-9]+/g,"");if(11===t.length&&"00000000000"!==t){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.slice(9))}return!1},wl=e=>Sl(18,e)("Укажите дату заключения трудового договора"),Cl=e=>Sl(0,e)("Укажите дату регистрации"),Sl=(e,t)=>fn((n=>{if(n&&t){const a=n.getTime(),i=new Date(t?.getFullYear()+e,t?.getMonth(),t?.getDate()).getTime(),r=(new Date).getTime();return a>=i&&a<=r}return!1})),kl={credit:{minAge:23,maxAge:75,errorMessage:"Допустимый возраст заёмщика - от 23 до 75 лет"},creditCard:{minAge:21,maxAge:73,errorMessage:"Допустимый возраст заёмщика - от 21 до 73 лет"},debitCard:{minAge:18,errorMessage:"Допустимый возраст - от 18 лет"}},Il=e=>vl(kl[e]),Tl={processPersonalDataFlg:gr,consentProviderFlg:gr,consentInformFlg:gr,consentPfrFlg:gr,consentOthersFlg:gr,consentFATCA:gr},Dl={addressCourier:fl(),paymentSystem:dr("Укажите тип платежной системы"),currency:dr("Укажите валюту"),cardCategory:dr("Укажите категорию карты"),codeWord:(e=>fn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&sr(e)))(e??ul))("Необходимо ввести кодовое слово"),confirmationIncome:mr(),methodObtain:dr(),deliveryDate:(e=>fn((e=>e?.getTime()>=(new Date).getTime()))(e))("Укажите дату доставки")},_l={organization:mr("Выберите тип организации"),organizationAddress:fn((e=>Boolean(e.fiasCode&&(e.city||e.locality)&&e.house)))(hl),organizationPhone:pr("Укажите номер телефона"),organizationName:dr("Укажите наименование организации"),legalForm:dr("Укажите ОПФ"),lastJobExperience:xl("Укажите стаж на последнем месте работы"),experience5Years:xl("Укажите общий стаж за последние 5 лет"),jobsNumber:xl("Укажите количество мест работы за последние 5 лет"),addressFact:fl(),addressRegistration:fl(),addressRetail:mr("Выберите адрес банка"),addressMatch:dr(),sex:dr("Укажите свой пол"),birthPlace:dr("Укажите место рождения"),education:mr("Выберите ваше образование"),housing:mr("Выберите тип жилья"),amountWorkers:mr("Выберите информацию о количестве сотрудников"),employment:mr("Выберите информацию о трудоустройстве"),employerActivities:mr("Выберите вид деятельности организации"),employerOrganization:mr("Выберите вид организации"),positionOrganization:mr("Выберите вашу должность"),familyStatus:mr("Выберите семейное положение"),familyMembers:bl(2,"Укажите количество членов семьи"),children:bl(2,"Укажите количество детей"),dependents:bl(2,"Укажите количество иждивенцев"),snils:(e=>fn(Nl)(e))("Некорректный номер СНИЛС"),conscription:dr(),armyIdFlg:gr,dulSerie:bl(4,"Укажите серию паспорта",!0),dulNumber:bl(6,"Укажите номер паспорта",!0),dulSubdivisionCode:bl(7,"Укажите код подразделения",!0),dulIssuedBy:dr("Укажите организацию, выдавшую паспорт"),retirementIncome:dr(),otherIncome:dr(),wages:dr(),mandatoryPayments:bl(10,"Укажите сумму обязательных выплат"),bankruptcyFlg:dr(),shareholderFlg:dr(),legalEntityName:dr(),bankEmployeeCode:dr(),partInBusiness:dr(),regionRetail:mr("Выберите регион"),latinSurname:dr("Укажите фамилию"),surname:yl("Укажите свою фамилию на кириллице"),name:yl("Укажите своё имя на кириллице"),middleName:yl("Укажите своё отчество на кириллице")},Pl={..._l,...Dl,...Tl},El={credit:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в ПФР",docId:3}},creditCard:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:19},consentInformMaterialsFlg:{text:"Согласие на получение информационных материалов",docId:18}},debitCard:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:20},consentFATCA:{text:"Форма самосертификации",docId:10}}};var Rl;!function(e){e.Success="SUCCESS",e.Error="ERROR",e.Pending="PENDING"}(Rl||(Rl={}));const Al=async(e,t,n)=>{try{return(await Ml(e,t,n)).json()}catch(e){return console.error(e),null}};async function Ml(e,t,n){const a=(()=>{const e=new Uint8Array(8);return globalThis.crypto.getRandomValues(e),e.reduce(((e,t)=>`${e}${t.toString(16).padStart(2,"0")}`),"")})();return globalThis?.fetch?.(`/light-api-cash/v1${e}`,{method:t,headers:{"Content-Type":"application/json","X-B3-Sampled":"1","X-B3-Spanid":a,"X-B3-Traceid":a,...Ol()},credentials:"include",body:n?JSON.stringify(n):null})}const Ol=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},Bl=d((({onChangeEsiaStatus:e})=>{const t=on(),n=r((async()=>{try{const e=await(n={redirectUri:globalThis.location.origin+globalThis.location.pathname},Al("/esia/getLink","POST",n));e?.link&&t.assign(e.link)}catch{e(Rl.Error)}var n}),[]);return c("div",{className:"flex gap-lg items-center rounded-md bg-main-gray p-4xl",children:[c("div",{className:"flex flex-col justify-around w-full",children:[o("p",{className:"mb-m text-xl",children:"Заполните данные через Госуслуги"}),c("ul",{className:"list-disc list-inside mb-4xl",children:[o("li",{children:"Вероятность одобрения выше"}),o("li",{children:"Без справок о доходах и трудоустройстве"}),o("li",{children:"С защитой Ваших данных"})]}),o(ie,{className:"block mb-xl self-center @md:hidden",image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"80",width:"80"}),o(Wr,{type:"button",onClick:n,className:"w-full @md:w-fit",children:"Заполнить"})]}),o(ie,{className:"hidden @md:block",image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"164"})]})})),Fl={url:"suggest/address",responseFilter:e=>Boolean(e?.data?.postal_code)},Ll={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=>({value:e?.data?.code||"",additionalValue:e?.data?.name})},dulIssuedBy:{url:"suggest/fms_unit"},organizationName:{url:"suggest/party",responseItemHandler:e=>{const t=e?.data?.inn,n=e?.data?.address?.value||"",a=n?`${t} ${n}`:t;return{value:e?.value||"",additionalValue:a}}},inn:{url:"suggest/party",responseItemHandler:e=>({value:e?.data?.inn||""})},addressRegistration:Fl,addressFact:Fl,organizationAddress:Fl,addressCourier:Fl},zl=d((({options:e,container:t,onChange:n})=>{const[r,l]=a(-1),s=t=>{const a=e.length-1;"ArrowDown"===t.key?l(r<a?r+1:0):"ArrowUp"===t.key?l(r>0?r-1:a):"Enter"===t.key&&e[r]&&(t.preventDefault(),n(e[r]))};return i((()=>(t.addEventListener("keydown",s),()=>t.removeEventListener("keydown",s))),[r]),o("div",{className:"bg-white text-l overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",children:e?.map(((e,t)=>c("div",{className:u("px-m py-xs cursor-pointer hover:bg-main-divider relative",{"bg-main-divider":r===t}),role:"listitem",onMouseDown:()=>n(e),children:[o("p",{children:e.processedValue}),e.additionalValue?o("p",{className:"text-xs text-secondary-text",children:e.additionalValue}):null]},t.toString())))})}));const Vl=d((({value:e="",onChange:t=Na,onDaDataChange:n,name:c="",daDataQueryPrefix:d,dadata:m=!1,type:u,...h})=>{const[p,{setFalse:g,setTrue:f}]=hn(),y=function({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),h=s(t),[p,g]=a([]),f=Mn(),y=Ll[n],x=r((()=>{h.current=t,f.close()}),[t]),b=r((e=>{x(),h.current=e.processedValue,c?.(e.processedValue),d?.(e)}),[x,c]),v=s(null),N=l((()=>async e=>{if(!y)return;const t=await yi({url:y.url,responseItemHandler:y.responseItemHandler,responseFilter:y.responseFilter,requestData:{...y?.requestData},query:e,queryPrefix:m});t?.length&&g(t)}),[m]),w=l((()=>kn(N,300)),[N]);return i((()=>{if(!e||!v.current||h.current===t)return void x();const n=v.current,{top:a,left:i,width:r,height:l}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.open({popup:o(zl,{options:p,container:n,value:t,onChange:b}),top:a+globalThis.scrollY+l,left:i,width:r})}),[e,p,t,b]),v}({isOpen:p&&m,name:c,value:e,daDataQueryPrefix:d,onChange:t,onDaDataChange:n}),x=r((e=>{let n=e??"";"number"===u&&(n=n.replace(/^0+(?=\d)/,"")),t?.(n)}),[t]);return o(wa,{value:e,onChange:x,inputRef:y,isOpen:p,onOpen:f,onClose:g,...h})})),$l=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",a=e(n).value,i=r((t=>{e?.(n)?.onChange?.(jl(t))}),[]),l=r((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(Vl,{disabled:Ai(e,t,n),label:"Адрес",...e(n),value:a?.fullAddress,onChange:l,...t,onDaDataChange:i})})),jl=e=>({apartment:e?.data?.flat,city:e?.data?.city,district:e?.data?.area_with_type,fullAddress:e?.unrestricted_value,fiasCode:e?.data?.fias_id,house:e?.data?.house,locality:e?.data?.settlement_with_type,okatoRegionCode:e?.data?.okato,postcode:e?.data?.postal_code,region:e?.data?.region,regionCode:e?.data?.region_kladr_id?e?.data?.region_kladr_id.substring(0,2):"",street:e?.data?.street,qc:e?.data?.qc,qcComplete:e?.data?.qc_complete,qcHouse:e?.data?.qc_house}),ql=Yt((({field:e,input:t,source:n})=>{const[l,s]=a(""),c=e("addressCourier")?.value,d=c?.locality,m=c?.city;i((()=>{!m&&!d||n?.deliveryCities?.includes(m)?s(""):(e?.("addressCourier")?.onChange?.({...c,house:""}),s("Город недоступен для доставки"))}),[m,d,n]);const u=r((t=>{e?.("addressCourier")?.onChange?.(jl(t))}),[]),h=r((t=>{e?.("addressCourier")?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(Vl,{label:"Адрес",...e("addressCourier"),value:c?.fullAddress,onChange:h,...t,error:l||e("addressCourier")?.error,onDaDataChange:u})})),Ul=d((({field:e,input:t})=>{const n="addressFact",a=e(n).value,{value:l}=e("addressMatch");i((()=>{l&&e("addressFact")?.onChange?.(e("addressRegistration").value)}),[l,e("addressRegistration").value]);const s=r((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=r((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(Vl,{label:"Адрес",disabled:l,...e(n),value:a?.fullAddress,onChange:c,...t,onDaDataChange:s})})),Wl=d((({field:e,input:t})=>o(Ti,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...e(t?.name??"")}))),Hl=d((({value:e,subText:t,children:n,isPhone:a,...i})=>{const r=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[r.length,n,t].every((e=>!e))?null:Yl({textItems:r,subText:t,children:n,isPhone:a,...i})})),Yl=({label:e,labelSize:t="text-m",textItems:n,subColor:a,subText:i,className:r,children:l,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",r),children:[e?o(ze,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,l||Gl(n,s),i?o(ze,{color:a,size:"text-m",children:i}):null]}),Gl=(e,t)=>e.filter(Boolean).map(((e,n)=>o(ze,{size:"text-l",children:t?o("a",{href:`tel:${Kl(e)}`,children:e.trim()}):e.trim()},String(n)))),Kl=e=>e.replace(/\D/g,""),Xl=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}))),Jl=d((({className:e,children:t})=>o("span",{className:u("inline-flex items-center text-start gap-s group-[]/btn-embedded:text-primary-main",e),children:t}))),Ql=d((({isUnfolded:e,...t})=>o(G,{name:e?"ArrowUpIcon":"ArrowDownIcon",size:"small",iconVersion:"",...t}))),Zl=d((({className:e,isUnfolded:t,short:n,label:a=(t?"Скрыть":"Развернуть"),embedded:i,...r})=>c(Wr,{className:u({"w-full":!n},e),embedded:i,shape:n?"default":"square",role:"tab","aria-label":"Кнопка сворачивающейся секции",...r,children:[o(Jl,{children:a}),o(Ql,{isUnfolded:t,iconVersion:i?"color":""})]}))),es=d((({className:e,role:t="tablist",children:n})=>o("div",{className:u(e),role:t,children:n})));const ts=d((({className:e,isUnfolded:t,isOverflowVisible:n=!1,children:a})=>{const r=s(null),l=function(e,t){const n=s(null);return i((()=>{const t=n?.current;if(!t)return;const a=new ResizeObserver((n=>{e(t,n[0])}));return a.observe(t),()=>{a.disconnect()}}),[e,...t]),n}((e=>{r.current&&(r.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:r,className:u("transition-max-h duration-300",n&&t?"overflow-clip":"overflow-hidden",{"max-h-0":Boolean(r.current||!t)}),role:"tabpanel","aria-label":"Сворачивающаяся секция",children:o("div",{className:e,ref:l,children:a})})})),ns=d((({children:e})=>{const[t,{toggle:n}]=hn(!1);return c("div",{children:[o("div",{className:"hidden sm:block",children:e}),c(es,{className:"block sm:hidden",children:[o(ts,{isUnfolded:t,children:e}),o(Zl,{className:"my-m mr-m border-b border-solid border-main-divider",label:t?"Скрыть":"Подробнее",isUnfolded:t,embedded:!0,onClick:n})]})]})})),as=e=>{const t=rs(e);return o(Hl,{label:"Режим работы",value:t,className:"max-w-none"})},is=({workTime:e="",lunchHour:t="",daysOff:n=""},a=!1)=>e?[`${a?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",rs=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))),a=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[is({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":a}),is({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:a},!0)].filter(Boolean)},ls=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],ss=e=>ls.map((([t,n,a])=>({key:t,title:a,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??"")}}))),os=e=>{if(!e)return null;const t=cs(e);return c(Xl,{className:"border-none",children:[o(Hl,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(ds)})}),o(Hl,{label:"Режим работы",className:"max-w-none",children:o(ze,{children:e})})]})},cs=e=>{const t=ls.map((([,e])=>({short:e,status:!0}))),n=e.split("/")??[],a=n[n.length-1]?.toLowerCase();return a?.includes("выходной")?t.map((e=>({...e,status:!a?.includes(e.short.toLowerCase())}))):t},ds=({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(ze,{size:"text-xs",children:e})},String(n)),ms=({currency:e,buyExchangeRate:t,saleExchangeRate:n},a)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(Hl,{label:"Валюта",value:e.currency}):null,t?o(Hl,{label:"Купить",value:String(t)}):null,n?o(Hl,{label:"Продать",value:String(n)}):null]},String(a)),us={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"}},hs=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",us[n].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(ie,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(ze,{size:"text-m",color:us[n].text,children:t})]}))),ps=(new Date).getDay(),gs=e=>{const[t]=e?.slice(ps-1)??[];if(!t)return null;const{lunchHour:n,status:a,workTime:i,hasLunch:r}=t;return a?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[i?o(hs,{color:"green",children:i}):null,n&&r?o(hs,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(hs,{color:"red",children:"Выходной"})},fs=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",ys=({title:e,status:t,workTime:n,lunchHour:a,hasLunch:i},r)=>o(Hl,{label:e,value:t&&n?n:"",subText:fs({lunchHour:a,hasLunch:i,status:t}),subColor:!t||i?"text-error":"text-green-dark"},String(r)),xs=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,bs=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,vs=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,Ns=(e,t)=>{if(!e.workSchedule)return null;const n=ss(e.workSchedule);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(ze,{size:"text-h4",children:e.name}),e.address?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(G,{name:"GeolocationIcon",width:"24",height:"24"}),o(ze,{size:"text-l",children:e.address})]}):null]}),gs(n)]}),o(ns,{children:ws(e)})]},String(t))},ws=({phone:e,fax:t,phoneBusiness:n,phoneNatural:a,phoneCallCentre:i,phoneCurrencyControl:r,workSchedule:l,exchangeRate:s})=>{const d=ss(l),m=l?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(Xl,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(Hl,{label:"Факс",value:t,isPhone:!0}),o(Hl,{label:"Телефон филиала",value:e,isPhone:!0}),o(Hl,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(Hl,{label:"Обслуживание физических лиц",value:a,isPhone:!0}),o(Hl,{label:"Для консультаций по валютному контролю",value:r,isPhone:!0}),o(Hl,{label:"Контакт-центр",value:i,isPhone:!0})]}),l?.isMatchesPattern?o(Xl,{children:o(Hl,{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(ys)})})}):c(Xl,{children:[o(Hl,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(ds)})}),as(d)]}),l?.businessScheduleVisibleTag?os(l?.businessScheduleDescription):null,s?.currencies?.length?o(Xl,{className:"flex-wrap",children:s?.currencies?.map(ms)}):null]})},Cs=({name:e="",address:t="",workSchedule:n})=>{const a=(i=e)?`${i?.charAt(0)?.toUpperCase()}${i?.slice(1)}`:"";var i;const r=`${t} ${(e=>{const t=ss(e),n=e?rs(t):"",a=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?xs(n):vs(n,a):bs(n):""})(n)}`;return{header:a,body:r}},Ss={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1,billAcceptorEnable:!1,workAllTime:!1,terminalTypeTerm:!1,terminalTypeAtms:!1},ks={billAcceptorEnable:"Прием наличных",bullionOperations:"Операции со слитками",buyingCoins:"Покупка монет из драгоценных металлов",designDisabledPeople:"Для слабовидящих",locationDisabledPeople:"Для маломобильных",preciousMetalsOperations:"Операции с драгоценными металлами",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",remoteWorkplace:"Удаленное рабочее место",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",sellingCoins:"Продажа монет из драгоценных металлов",safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",serviceDisabledPeople:"Для маломобильных граждан",workAllTime:"Круглосуточно",workingSaturday:"Открыты по субботам"},Is={...{terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable),locationDisabledPeople:e=>Boolean(e.locationDisabledPeople),designDisabledPeople:e=>Boolean(e.designDisabledPeople)},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)},Ts=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>Is[t](e)))))},Ds=()=>{},_s=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:a=Ds,getBalloonRemoteWorkplaces:i=Ds})=>{const[r,s,o,c]=l((()=>{const r=Ts(e,n),l=Ts(t,n),s=[...r.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:a(e)}))),...l.map((e=>({type:"workplaces",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:i({address:e.address,workScheduleDescription:e.workScheduleDescription})})))].filter((e=>e.coords&&2===e.coords.length));return[r,s,l,r.length+l?.length]}),[e,t,n,a,i]);return{filteredItems:r,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},Ps=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),Es=d((({children:e})=>Ps?e:null)),Rs="/icons/MapMarkerClusterIcon.svg",As="/icons/MapMarkerClusterYellowIcon.svg";function Ms({yandexMaps:e,map:t,points:n,isLoad:a}){if(a||!n)return;if(t.geoObjects.removeAll(),!n.length)return;const i=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),r=Os("offices",e,i);if(n.length&&n.every((e=>"type"in e))){const a=Os("workplaces",e,i),l=Bs(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=Bs(n.filter((e=>"offices"===e.type)),"offices",e);r.add(s),a.add(l),t.geoObjects.add(a),t.geoObjects.add(r)}else{const a=Bs(n,"offices",e);r.add(a),t.geoObjects.add(r)}t.setBounds(e.util.bounds.fromPoints(n.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const Os=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?Rs:As,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),Bs=(e,t,n)=>e.map((({coords:e,content:a})=>new n.Placemark(e,{balloonContentHeader:a?.header,balloonContentBody:a?.body,balloonContentFooter:a?.footer,hintContent:a?.hint},{iconLayout:"default#image",iconImageHref:"offices"===t?Rs:As,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),Fs={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},Ls={...Fs,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},zs=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(Ls).join(" ")} ${n}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.current.geoObjects.add(t.geoObjects)}))},children:o(G,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),Vs=e=>globalThis[e];function $s(e,t,n=!0){const[r,l]=a(void 0);return i((()=>{let a=!0;return((e,t,n=!1)=>{const a=globalThis.document.getElementById(t);if(a){const t=Vs(e);return t?Promise.resolve(t):new Promise((t=>{a.addEventListener("load",(()=>{t(Vs(e))}))}))}return new Promise(((a,i)=>{const r=globalThis.document.createElement("script");r.src=t,r.async=!0,r.id=t,n&&(r.type="module"),r.addEventListener("load",(()=>{a(Vs(e))})),r.addEventListener("error",(e=>{i(e)})),globalThis.document.head.appendChild(r)}))})(e,t).then((e=>{a&&l(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(a=!1,n){const e=globalThis.document.getElementById(t);e&&globalThis.document.head.removeChild(e),l(void 0)}}}),[e,t,n]),r}const js={...Fs,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},qs=d((({yandexMaps:e,direction:t="in"})=>{const n="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const n=e.current.getZoom(),a="in"===t?n+1:n-1;e.current.setZoom(a,{checkZoomRange:!0})},className:`${Object.values(js).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(G,{name:n,width:"20",height:"16"})})})),Us=[55.753995,37.614069],Ws=d((({points:e,className:t="",zoom:n=5,isLoad:a,selectedAddress:r})=>{const l=s(null),d=s(null),m=$s("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${A.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1);if(i((()=>{l.current?Ms({yandexMaps:m,map:l.current,points:e,isLoad:a}):m?.ready((()=>{l.current||(l.current=new m.Map(d.current,{center:Hs(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),Ms({yandexMaps:m,map:l.current,points:e,isLoad:a})})),l.current&&r&&m?.geocode(r).then((e=>{const t=e.geoObjects.get(0).geometry.getCoordinates();l.current.setCenter(t),l.current.setZoom(18)}))}),[m,e,n,a,r]),!m)return null;const h="z-10";return c("div",{ref:d,className:u("relative","w-full",t),children:[a?o(tl,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(qs,{yandexMaps:l}),o(qs,{yandexMaps:l,direction:"out"})]}),zs(l,m,u("right-2 top-80",h))]})})),Hs=e=>{const t=[Gs(Ys(e,0)),Gs(Ys(e,1))];return t.every((e=>e))?t:Us},Ys=(e,t)=>e.map((e=>e.coords?.[t])),Gs=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,Ks=e=>Number(e.toString().replace(",",".")),Xs=e=>{const{data:t,error:n}=na(`/light-api-cash/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,Js);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},Js=async e=>await zt(e,{method:"POST"})||[],Qs=d((({field:e,input:t})=>{const[n,r]=a([]),{data:l}=Xs("REGION_RF"),s=e("regionRetail")?.value||{},d=e(t?.name??"");i((()=>{(async()=>{const e=await(async e=>{const t=await Al("/public-data/regionOffices","POST",{regionRfCd:{key:e},cashCardFlg:!0});return t?.offices?.map((e=>({...e,gpsLatitude:Ks(e.latitude??Us[0]),gpsLongitude:Ks(e.longitude??Us[1])})))||[]})(s?.key??"");r(e)})(),s?.key&&d.onChange?.("")}),[s.key]);const{points:m}=_s({data:n,filtrationState:{},getBalloon:Cs});return c("div",{children:[o(Hn,{label:"Адрес отделения",placeholder:"Выберите отделение",options:n.map((({id:e,address:t=""})=>({key:e?.toString()||"",text:t}))),...d,isSearch:!0}),o("div",{className:"h-[600px]",children:o(Es,{children:o(Ws,{points:m,isLoad:!l,className:"h-full",selectedAddress:d?.value?.text})})})]})}));function Zs(e,t){for(const[n,a]of e.entries())null!=a?t.setItem(n,a):t.removeItem(n)}function eo(e,t){return Zs(e,t),Zs(t,e),e.bus.watch((({type:e,event:n})=>{null!=n?t.setItem(e,n):t.removeItem(e)}))}class to{storage;bus;get size(){return this.storage?.length??0}constructor(e,t=new he){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)}}class no{bus;store=new Map;get size(){return this.store.size}constructor(e=new he){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)}}const ao={};function io(e,t=ao){const n=s(null),o=function(){const[,e]=a(0);return r((()=>e((e=>(e+1)%65536))),[])}();return i((()=>e.bus.watch((e=>{n.current?.has(String(e.type))&&o()}))),[e,o]),l((()=>new Proxy(t,{get:(t,a)=>(n.current||=new Set,n.current.add(a),e.getItem(a)),has:(t,a)=>(n.current||=new Set,n.current.add(a),e.hasItem(a)),set:(t,n,a)=>(e.setItem(n,a),!0),deleteProperty:(t,n)=>(e.removeItem(n),!0)})),[e])}const ro=new no;function lo(e){return io(ro,e)}eo(ro,new to(globalThis?.localStorage));const so=()=>lo(),oo=Yt((({field:e,source:t,fieldName:n,placeholder:a="Выберите из списка",options:i,...r})=>{const l=t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(Hn,{placeholder:a,options:l,...e(n),...r})})),co=d((({field:e,input:t})=>{const{data:n}=Xs("EMPLOYEES_NUMBER"),a=so();return i((()=>{n&&(a.amountWorkers=n)}),[n]),o(oo,{field:e,source:a.amountWorkers??[],label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),mo=d((({field:e,input:t})=>o(Ti,{text:"Наличие военного билета",...e(t?.name??"")}))),uo=d((({field:e,input:t})=>o(Vl,{label:"Код представителя Банка",placeholder:"Введите код",isInteger:!0,...e(t?.name??""),...t}))),ho=d((({field:e,input:t})=>o(Ti,{text:"В отношении меня ведётся производство по делу о банкротстве",...e(t?.name??"")}))),po=d((({field:e,input:t})=>o(ni,{label:"Дата начала работы на текущем месте",...e(t?.name??""),...t,disabled:Ai(e,t),maxDate:new Date}))),go=d((({field:e,input:t})=>o(Vl,{label:"Место рождения",maxLength:100,...e(t?.name??""),...t,disabled:Ai(e,t)})));function fo(e){const t=globalThis.localStorage?.getItem(e),[n,i]=a(t?(e=>{try{return JSON.parse(String(e))}catch(e){return null}})(t):null);return[n,r((t=>{i((n=>{const a=t instanceof Function?t(n):t;return globalThis.localStorage?.setItem(e,JSON.stringify(a)),a}))}),[e])]}const yo=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black"})=>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(G,{name:t,width:"24",height:"24",iconVersion:n})}),o("div",{className:"",children:o(Fe,{__html:e})})]}))),xo=d((({field:e,input:t})=>{const[n,r]=a([]),[s]=fo("programId"),{value:d,onChange:m}=e("cardCategory"),u=e("paymentSystem")?.value?.key;i((()=>{u&&s&&(async()=>{const e=await(async(e,t)=>{const n=await Al("/dictionaryFiltered","POST",{type:"CARD_TYPE",presets:{paymentSystemTypeCd:e,creditProgramId:t}});return Array.isArray(n)?n:[]})(u,s);r(e),bo(e,d)||m&&m(null)})()}),[u]);const h=l((()=>n?.find((e=>e.key===d?.key))?.description),[n,d]);return c("div",{children:[o(oo,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t}),h?o(yo,{__html:h}):null]})})),bo=(e,t)=>e.some((e=>e.key===t?.key)),vo=d((({field:e,input:t})=>o(Vl,{label:"Количество детей до 18 лет",placeholder:"Введите значение",isInteger:!0,type:"number",...e(t?.name??""),...t}))),No=d((({field:e,input:t})=>o(Vl,{label:"Кодовое слово",maxLength:20,...e(t?.name??""),...t}))),wo=d((({field:e,input:t})=>{const{data:n}=Xs("INCOME_CERT_UNITED"),a=Ai(e,t);return c("div",{className:"space-y-xl",children:[a?o(yo,{__html:"Для выбора иного способа подтверждения дохода, оформите новую заявку на кредит без авторизации на портале Госуслуги"}):null,o(oo,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t,disabled:a})]})})),Co=d((({field:e,input:t})=>{const{data:n}=Xs("MILITARY_STATUS");return o(oo,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),So=()=>lo(),ko=d((({src:e,onClose:t,onDocumentRead:n})=>{const a=_e();return c(Yr,{className:"my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0 z-[101]",onClose:t,children:[a?o("img",{src:e}):o("iframe",{src:`${e}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"}),o(Wr,{className:"mx-auto mt-m",type:"button",onClick:()=>{n?.(),t?.()},children:"Ознакомиться"})]})})),Io=(e,t)=>{const{open:n}=wn(ko),a=_e();return r((async()=>{if(e){const i=URL.createObjectURL(await(async(e,t=!1)=>{const n=await Ml(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return n?n.blob():new Blob})(e,a));n({src:i,onDocumentRead:t})}}),[n,e,a])},To=d((({className:e,error:t,docId:n,...a})=>{const i=Io(n,(()=>a.onChange?.(!0)));return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(wi,{...a}),n?o(Wr,{embedded:!0,onClick:i,children:o(Jl,{children:"Ознакомиться"})}):null]}),Sn(t)]})})),Do=d((({field:e,input:t})=>{const{productType:n}=So(),a=El[n??""];return t&&t.name?o(To,{text:a?.[t.name]?.text,docId:a?.[t.name]?.docId,...e(t.name)}):null})),_o=Math.round(29.5),Po=d((({className:e,title:t,children:n,...a})=>c(g,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...a,children:[t?o(N,{className:"text-center",title:t}):null,n]}))),Eo="flex flex-col justify-between lg:flex-row gap-4xl",Ro="flex flex-col lg:w-1/2 gap-2xl",Ao="flex flex-col gap-y-xl min-w-52",Mo=d((({value:e,fractionDigits:t,fixed:n,prefix:a,postfix:i})=>o(ze,{size:"text-h3",children:"number"==typeof e?[a,Je(t,{fixed:n})(e),i].filter(Boolean).join(" "):e}))),Oo=d((({className:e,title:t,value:n,color:a="text-secondary-text",...i})=>c("div",{className:u("flex justify-between @xl:flex-col",e),children:[t?o(ze,{size:"text-l",font:"font-light",color:a,children:t}):null,n?o(Mo,{value:n,...i}):o(ze,{size:"text-h3",children:"-"})]}))),Bo=e=>Lo([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],e),Fo=(e=[],t=!1,n=[])=>({...Lo([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),extraPercent:n.at(-1),extraPercents:n}),Lo=(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]},zo=(e,t=0)=>e?.sum?e.sum:t,Vo=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,$o=(e,t)=>e?o(w,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,jo=({min:e=0,max:t=0,availableMonths:n,...a})=>o(fa,{items:[`От ${qo(e)}`,`До ${qo(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...a}),qo=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,Uo=({items:e,title:t,orientation:n="horizontal",value:a,onChange:i,...r})=>c("div",{className:"grid gap-s whitespace-nowrap lg:sm:col-span-1 col-span-2",children:[t?o("div",{role:"radiogroup","aria-label":t,children:o(ze,{color:"text-secondary-text",font:"font-light",children:t})}):null,o(Rr,{orientation:n,items:e,value:e[a?0:1].id,onChange:t=>i&&i(t===e[0].id),...r})]}),Wo=e=>Uo({...e,title:"Тип платежа",orientation:"vertical",className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),Ho=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...a})=>o(fa,{items:e?[`От ${Je(1)(a.min||0)} ${n}`,`До ${Je(1)(a.max||0)} ${n}`]:[],step:t,...a}),Yo=({field:e,defParams:t,calcParams:n,map:a,monthsValue:i="maxMonths"})=>{Object.entries(a).forEach((([n,a])=>{e?.(n)?.onChange?.(t?.[a])})),e?.("monthsValue")?.onChange?.(ma(t?.[i],n.minMonths,n.maxMonths))},Go=(e,t)=>{const{isAnnuity:n,moneyValue:a,monthsValue:i,moneyExtra:r}=t;if(0===e)return 0;if(n){const t=e/1200;return r?(a+r)*(t+t/(Math.pow(1+t,i)-1)):a*(t+t/(Math.pow(1+t,i)-1))}return Math.round(a/i)+a*(e/1200)},Ko=e=>e,Xo=(e=Ko)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),Jo=Xo(),Qo=(e=Ko)=>Xo((t=>-e(t))),Zo=Qo(),ec=([e,t],n,a=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:tc([e,t],a),tc=([e,t],n=[])=>({[e]:n.length?Zo(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?Jo(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),nc=(e,[t,n],a)=>e>=a[t]&&e<=a[n],ac={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},ic=e=>rc({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&rc({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&rc({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&rc({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),rc=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],lc=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,r=t?.rateRows||[ac],l=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>ic({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=ec(["minSum","maxSum"],l,r),{minMonths:c,maxMonths:d}=ec(["minMonths","maxMonths"],l,r),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i})=>e?.find((e=>ic({row:e,userInputParams:t,paramsViewSettings:n})&&nc(a,["minSum","maxSum"],e)&&nc(i,["minMonths","maxMonths"],e)))||ac)({rateRows:r,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i}),{rate:u}=m,h=Go(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:a,monthsValue:i,monthlyPayment:h}},sc=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),oc={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},cc=Yt((({className:e,title:t,calcSource:n,buttons:a,footnote:l,paramsViewSettings:s,defaultParams:d,onChange:m,...h})=>{const p=Bo(n?.rateRows),g=r((e=>{const t=lc(e,n,s);m?.({...e,monthlyPayment:t.monthlyPayment,rate:p?.rate??0})}),[s,n]),[f,{field:y}]=vn({moneyValue:zo(d,2e5),monthsValue:Vo(d,_o),monthlyPayment:0,rate:0,isAnnuity:Boolean(d?.isAnnuity),isInsurance:Boolean(d?.isEnableInsurance),isSalaryClient:Boolean(d?.isEnableSalaryClient),isPensionClient:Boolean(d?.isEnablePensionClient),isStateEmployee:Boolean(d?.isEnableStateEmployee)},{onChange:g}),x=lc(f,n,s),b=Wo({...y("isAnnuity")}),{onChange:v}=y("moneyValue"),{onChange:N}=y("monthsValue");return i((()=>{v&&v(ma(f.moneyValue,x.minSum,x.maxSum))}),[x.minSum,x.maxSum]),i((()=>{N&&N(ma(f.monthsValue,x.minMonths,x.maxMonths))}),[x.minMonths,x.maxMonths]),i((()=>{!sc(d)&&p&&Yo({field:y,defParams:p,calcParams:x,map:oc,monthsValue:"minMonths"})}),[n,d]),o(Po,{className:e,title:t,...h,children:c("section",{className:u(Eo,e),children:[c("div",{className:Ro,children:[Ho({title:"Сумма кредита, ₽",step:500,min:x.minSum,max:x.maxSum,...y("moneyValue"),value:x.moneyValue}),jo({title:"Срок кредита, месяцев",min:x.minMonths,max:x.maxMonths,...y("monthsValue"),value:x.monthsValue}),dc({...x,...s},y),o("div",{className:"sm:hidden",children:b})]}),c("div",{className:u(Ao,"@4xl:w-1/2"),children:[o(Oo,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(Oo,{title:"Ставка от",value:p?.rate,fractionDigits:2,postfix:"%"}),o(Oo,{title:"Ежемесячный платёж",value:x.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:b}),Ye(a,{isVertical:!0}),$o(l)]})]})})})),dc=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(wi,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(wi,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(wi,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(wi,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),mc="calculator",uc=d((({field:e,params:t})=>{const n=r((t=>{e(mc).onChange?.(t)}),[]);return o(cc,{...t?.calcData,padding:"p-0",defaultParams:pc(e(mc).value),onChange:n})})),hc={moneyValue:"sum",monthsValue:"period",isInsurance:"isEnableInsurance",isPensionClient:"isEnablePensionClient",isStateEmployee:"isEnableStateEmployee",isSalaryClient:"isEnableSalaryClient",isAnnuity:"isAnnuity"},pc=(e,t=!1)=>{const n=t?gc(hc):hc;return Object.fromEntries(Object.entries(e??{}).map((([e,t])=>[n[e],t])))},gc=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[t,e]))),fc=d((({field:e,input:t})=>{const{data:n}=Xs("CREDIT_IN_RSHB");return o(oo,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /\n вкладчиком с долей участия более 20% уставного капитала руководителем,\n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t,disabled:!e?.("shareholderFlg")?.value})})),yc={17:"amur_debit_card",16:"owner_debit_card",18:"pansion_debit_card",38:"salary_debit_card",40:"vordi_debit_card",42:"eco_debit_card",43:"junior_debit_card",44:"appetit_debit_card"},xc=d((({className:e,label:t,error:n,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Rr,{label:Cn({label:t,errors:a?.errors}),...a}),Sn(n)]}))),bc=[{id:"810",text:"Рубли"}],vc=d((({field:e,input:t})=>{const{data:n}=Xs("CURRENCY"),{programId:a}=So(),i=l((()=>!Object.keys(yc).includes(a||"")||"38"===a),[]),r=l((()=>i?bc:n?.map((e=>({id:e.key??"",text:e.description})))),[n]);return o(xc,{label:"Валюта",orientation:"horizontal",items:r,...e(t?.name??"")})})),Nc=(e,t)=>{if(!t)return null;const n=kc(e),a=+t?.split(".")[0],i=+t?.split(".")[1];switch(a){case 1:return n("AGRICULTURE");case 35:return n("FUEL_AND_ENERGY");case 41:case 42:case 43:return n("CONSTRUCTION");case 46:case 47:return n("TRADE");case 55:case 79:return n("TOURISM");case 62:return n("TECHNOLOGY");case 63:return n("CONSULTING_SERVICE");case 64:return n("BANK");case 65:return n("INSURER");case 66:return n("FINANCIAL_INSTITUTIONS");case 72:case 74:return n("SCIENCE");case 80:return n("SECURITY");case 84:return n(i<22?"GOVERNANCE":22===i?"ARMY":"OTHER_SECTORS");case 85:return n("EDUCATION");case 86:return n("HEALTHCARE");case 87:return n("SOCIAL_SPHERE");default:return n(a>=10&&a<=33?"INDUSTRY":a>=5&&a<=9?"FUEL_AND_ENERGY":a>=49&&a<=53?"TRANSPORT":"OTHER_SECTORS")}},wc=(e,t)=>{if(!t)return null;const[n]=[e?.find((e=>t<=Number(e.description)))].map((e=>({key:e?.key??"",text:e?.value??""})));return n},Cc=(e,t)=>{const n=kc(e);return[40001,40002,71610].includes(t)?n("FOREIGN"):n("RUSSIAN")},Sc=(e,t,n)=>{const a=kc(e);return a("7725114488"===n?"RSHB":50102===t?"SOLE_TRADER":t>=75e3&&t<=75505&&75500!==t?"BUDGETARY":"COMMERCIAL")},kc=e=>t=>e.map((e=>({key:e.key,text:e.value}))).find((e=>e.key===t))??null,Ic=(e,t,n)=>{const{okved:a,okopf:i,inn:r,organizationName:l}=Tc(n);t?.("legalForm")?.onChange?.(n.data?.opf?.short),t?.("organizationAddress")?.onChange?.(jl(n.data?.address));const s={amountWorkers:wc(e?.amountWorkers,n.data?.employee_count),employerActivities:Nc(e?.employerActivities??[],a),organization:Sc(e?.organization??[],i,r),employerOrganization:Cc(e?.employerOrganization??[],i),organizationName:l};for(const e in s)t?.(e)?.onChange?.(s[e])},Tc=e=>({inn:e.data?.inn??"",okopf:Number(e.data?.opf?.code),okved:e.data?.okved??"",organizationName:e.data?.name?.short_with_opf??""}),Dc=d((({field:e,input:t})=>{const n=so(),{employerActivities:a,employerOrganization:l,organization:s,amountWorkers:c}=n,d=e?.("esiaAccountTypeCd")?.value,m=e?.("inn")?.value,u=r((t=>{Ic(n,e,t)}),[]);return i((()=>{d&&m&&_c(n)&&(async()=>{const t=await(async e=>{const t=await yi({url:"suggest/party",query:e});return t?.[0]})(m);t&&Ic(n,e,t)})()}),[a,l,s,c]),o(Vl,{label:"ИНН",isInteger:!0,maxLength:12,...t,...e(t?.name??""),onDaDataChange:u,disabled:Ai(e,t)})})),_c=e=>{const{employerActivities:t,employerOrganization:n,organization:a,amountWorkers:i,productType:r}=e;return[n,a,i,"creditCard"!==r||t].every(Boolean)},Pc=d((({field:e,input:t})=>o(ni,{label:"Дата доставки",...e(t?.name??""),minDate:new Date}))),Ec=d((({field:e,input:t})=>{const{data:n}=Xs("COURIER_DELIVERY_TIME"),a=l((()=>n?.map((e=>({id:e.key,text:e.value})))??[]),[n]);return o(xc,{label:"Время доставки",className:"flex-row",items:a,...e(t?.name??"")})})),Rc=d((({field:e,input:t})=>o(Vl,{label:"Количество иных иждивенцев",placeholder:"За исключением детей до 18 лет",isInteger:!0,maxLength:2,type:"number",...e(t?.name??""),...t}))),Ac=d((({field:e,input:t})=>{const n=e("limitedBirthday")?.value,a=l((()=>new Date(n?.getFullYear()+14,n?.getMonth(),n?.getDate())),[n]);return o(ni,{label:"Дата выдачи",...e(t?.name??""),disabled:Ai(e,t),minDate:a,maxDate:new Date})})),Mc=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("dulSubdivisionCode"),i=r((e=>{a?.(e?.data?.code)}),[]);return o(Vl,{disabled:Ai(e,t),label:"Кем выдан",maxLength:200,...t,...e(t?.name??""),onDaDataChange:i,daDataQueryPrefix:n})})),Oc=d((({field:e,input:t})=>o(Vl,{disabled:Ai(e,t),label:"Номер документа",isInteger:!0,maxLength:6,...e(t?.name??"")}))),Bc=d((({field:e,input:t})=>o(Vl,{disabled:Ai(e,t),label:"Серия документа",isInteger:!0,maxLength:4,...e(t?.name??"")}))),Fc=d((({field:e,input:t})=>{const n=r((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]),a=r((t=>{const n=t.replace(/[^\d-]/g,"");n.length<=7&&e?.("dulSubdivisionCode")?.onChange?.(za(n,"___-___"))}),[]);return i((()=>{const t=e?.("dulSubdivisionCode")?.value;t&&a(t)}),[]),o(Vl,{disabled:Ai(e,t),label:"Код подразделения",...t,...e(t?.name??""),placeholder:"___-___",onChange:a,onDaDataChange:n})})),Lc=d((({field:e,input:t})=>{const{data:n}=Xs("EDUCATION_LEVEL");return o(oo,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),zc=d((({field:e,input:t})=>o(Vl,{label:"Электронная почта",maxLength:50,...e(t?.name??""),...t}))),Vc=d((({field:e,input:t})=>{const{data:n}=Xs("ORGANIZATION_ACTIVITY_TYPE"),a=so();return i((()=>{n&&(a.employerActivities=n)}),[n]),o(oo,{field:e,source:a.employerActivities??[],label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),$c=d((({field:e,input:t})=>{const{data:n}=Xs("ORGANIZATION_KIND"),a=so();return i((()=>{n&&(a.employerOrganization=n)}),[n]),o(oo,{field:e,source:a.employerOrganization??[],label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),jc=d((({field:e,input:t})=>{const{data:n}=Xs("EMPLOYMENT_INFO_UNITED");return o(oo,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),qc=d((({field:e,input:t})=>{const n=r((n=>e(t?.name??"")?.onChange?.(String(ma(Number(n),0,5)))),[]);return o(Vl,{label:"Стаж за последние 5 лет",placeholder:"Количество лет",type:"number",...e(t?.name??""),...t,onChange:n,disabled:Ai(e,t)})})),Uc=d((({field:e,input:t})=>{const{value:n,onChange:a}=e(t?.name??""),r=e("familyStatus")?.value?.key,l="MARRIED"===r?2:1,s=Number(e("children")?.value||0),c=Number(e("dependents")?.value||0),d=l+s+c;return i((()=>{a?.(d)}),[r,s,c]),o(Vl,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:n,onChange:a})})),Wc=d((({field:e,input:t})=>{const{data:n}=Xs("MARITAL_STATUS");return o(oo,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),Hc=d((({field:e,input:t})=>{const[n,r]=a(""),l=Number(e("lastJobExperience")?.value),s=Number(e("generalSeniority")?.value);return i((()=>{r(s&&s<l?"Укажите не меньше, чем число в поле «Стаж на последнем рабочем месте»":"")}),[l,s]),o(Vl,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",isInteger:!0,...e(t?.name??""),...t,error:n||e("generalSeniority")?.error,disabled:Ai(e,t)})})),Yc=d((({field:e,input:t})=>{const{data:n}=Xs("HOUSE_TYPE");return o(oo,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),Gc=d((({input:e})=>o(yo,{__html:e?.label}))),Kc=d((({field:e,input:t})=>o(Ti,{text:"Я планирую в ближайшее время инициировать дело о банкротстве в отношении себя",...e(t?.name??"")}))),Xc=d((({field:e,input:t})=>o(Vl,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",type:"number",isInteger:!0,maxLength:2,...e(t?.name??""),...t,disabled:Ai(e,t)}))),Jc=d((({field:e,input:t})=>o(Vl,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,isInteger:!0,...e(t?.name??""),...t,disabled:Ai(e,t)}))),Qc=/^[\u0041-\u005A\u0061-\u007A\s]+$/u,Zc=(e="")=>Qc.test(e),ed=e=>{const t={"А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ё":"E","Ж":"ZH","З":"Z","И":"I","Й":"I","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"KH","Ц":"TS","Ч":"CH","Ш":"SH","Щ":"SHCH","Ъ":"IE","Ы":"Y","Ь":"","Э":"E","Ю":"YU","Я":"YA","":"","а":"A","б":"B","в":"V","г":"G","д":"D","е":"E","ё":"E","ж":"ZH","з":"Z","и":"I","й":"I","к":"K","л":"L","м":"M","н":"N","о":"O","п":"P","р":"R","с":"S","т":"T","у":"U","ф":"F","х":"KH","ц":"TS","ч":"CH","ш":"SH","щ":"SHCH","ъ":"IE","ы":"Y","ь":"","э":"E","ю":"YU","я":"YA",".":".",",":",","-":"-"," ":" "};return e.replace(/[А-ЯЁа-яё,. -]/g,(e=>t[e.toLowerCase()].toUpperCase()||""))},td=d((({field:e,input:t})=>{const n=e("latinSurname")?.value,a=e("name")?.value,l=e("latinName")?.onChange;i((()=>{l?.(ed(a))}),[]);const s=r((e=>{(Zc(e)||0===e.length)&&l?.(e.toUpperCase())}),[]);return o(ka,{label:"Имя",placeholder:"Имя латинскими буквами",maxLength:Math.max(20-n?.length,1),...e(t?.name??""),onChange:s,...t})})),nd=d((({field:e,input:t})=>{const n=e("latinName")?.value,a=e("surname")?.value,l=e("latinSurname")?.onChange;i((()=>{l?.(ed(a))}),[]);const s=r((e=>{(Zc(e)||0===e.length)&&l?.(e.toUpperCase())}),[]);return o(ka,{label:"Фамилия",placeholder:"Фамилия латинскими буквами",maxLength:Math.max(20-n?.length,1),...e(t?.name??""),onChange:s,...t})})),ad=d((({field:e,input:t})=>o(Vl,{label:"Наименование юридического лица",...t,...e(t?.name??""),disabled:!e?.("shareholderFlg")?.value}))),id=d((({field:e,input:t})=>o(Vl,{label:"ОПФ",maxLength:20,placeholder:"ООО, ПАО и др.",...e(t?.name??""),...t}))),rd=d((({field:e,input:t})=>o(ni,{label:"Дата рождения",...e(t?.name??""),disabled:Ai(e,t)}))),ld=d((({field:e,input:t})=>o(Vl,{label:"Обязательные выплаты",placeholder:"Введите значение",isInteger:!0,type:"number",maxLength:10,...e(t?.name??""),...t}))),sd=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],od=d((({field:e,input:t})=>o(xc,{orientation:"horizontal",items:sd,...e(t?.name??"")}))),cd=d((({field:e,input:t})=>{const n=r((t=>{(pl.test(t)||0===t.length)&&e("middleName")?.onChange?.(t)}),[e]);return o(Vl,{label:"Отчество (Обязательно, при наличии)",maxLength:40,disabled:Ai(e,t),...e(t?.name??""),...t,onChange:n})})),dd=d((({field:e,input:t})=>{const n=r((t=>{(pl.test(t)||0===t.length)&&e("name")?.onChange?.(t)}),[e]);return o(Vl,{label:"Имя",maxLength:40,disabled:Ai(e,t),...e(t?.name??""),...t,onChange:n})})),md=d((({field:e,input:t})=>{const{data:n}=Xs("ORGANIZATION_TYPE"),a=so();return i((()=>{n&&(a.organization=n)}),[n]),o(oo,{field:e,source:a.organization??[],label:"Тип организации",fieldName:"organization",input:t})})),ud=d((({field:e,input:t})=>{const n=so(),a=r((t=>{e?.("inn")?.onChange?.(t.data?.inn),Ic(n,e,t)}),[]);return o(Vl,{label:"Наименование организации",...t,...e(t?.name??""),disabled:Ai(e,t),onDaDataChange:a})})),hd=d((({field:e,input:t})=>o(Vl,{label:"Иные доходы",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),pd=d((({field:e,input:t})=>o(ni,{label:"Дата регистрации по месту жительства",...e(t?.name??""),maxDate:new Date}))),gd=d((({field:e,input:t})=>{const n=r((n=>e(t?.name??"")?.onChange?.(String(ma(Number(n),0,100)))),[]);return o(Vl,{label:"Доля участия в бизнесе",placeholder:"в %",isInteger:!0,maxLength:3,...e(t?.name??""),...t,onChange:n})})),fd=e=>e.map((e=>({key:e.type,text:e.name}))),yd=e=>e?.key,xd=d((({field:e,input:t})=>{const[n,i]=a([]),r=lo();gi((async()=>{const{programId:e}=r;if(e){const t=await(async e=>{const t=await Al("/public-data/creditProgramConditions","POST",{creditProgramId:e});return fd(t?.paymentSystems||[])})(e);i(t??[])}}),[]);const s=l((()=>n?.map((e=>({id:e.key,text:e.text})))??[]),[n]);return o(xc,{label:"Платежная система",orientation:"horizontal",items:s,...e(t?.name??"",{format:yd,parse:e=>n?.find((t=>t.key===e))})})})),bd=d((({field:e,input:t})=>{const{data:n}=Xs("POSITION");return o(oo,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),vd=async()=>await Al("/public-data/regionsCardDelivery","GET")||void 0,Nd=d((({field:e,input:t})=>{const{programId:n,productType:a}=so(),{data:i}=Xs("REGION_RF"),{data:l}=na("regionsDelivery",vd),{data:s}=Xs(wd(a)),c="38"===n,d=i?.map((({key:e,value:t})=>({key:e,text:t}))),m="true"===s?.find((e=>"DELIVERY_ACTIVE"===e?.key))?.value,u=e("regionRetail")?.onChange,h=e("regionHasDelivery")?.onChange,p=e("methodObtain")?.onChange,g=r((e=>{const t=m&&l?.find((t=>t.regionCode===e.key))?.deliveryFlg&&!c;h?.(t),p?.(t?"courier":"office"),u?.(e)}),[l,m]);return o(Hn,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,options:d,...e(t?.name??""),onChange:g})})),wd=e=>"debitCard"===e?"DEBIT_CARD_LEAD_PROCESS_SETTINGS":"CREDIT_LEAD_PROCESS_SETTINGS",Cd=d((({field:e,input:t})=>o(Vl,{label:"Пенсионные доходы",placeholder:"Введите значение",isInteger:!0,type:"number",maxLength:10,...e(t?.name??""),...t}))),Sd=["male","female"],kd=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],Id=d((({field:e,input:t})=>{const n=e("name")?.value,{value:a,onChange:r}=e("sex");return i((()=>{n&&!a&&(async()=>{const e=await(async e=>{const t=await yi({url:"suggest/fio",requestData:{parts:["NAME"]},query:e}),n=t[0]?.data?.gender?.toLowerCase()||"";return Sd.includes(n)?n:""})(n);e&&r?.(e)})()}),[]),o(xc,{label:"Пол",orientation:"horizontal",items:kd,...e(t?.name??"")})})),Td=d((({field:e,input:t})=>o(Ti,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...e(t?.name??"")}))),Dd=d((({children:e,onChange:t,maxLength:n,...a})=>{const i=r((e=>n?e.length<=n&&t?.(za(e,"___-___-___ __")):t?.(za(e,"___-___-___ __"))),[t]),l=r((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(_n,{...a,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>l(e?.target?.value||""),children:e})})),_d=d((({className:e,label:t,value:n,error:a,onChange:i,onBlur:r,...l})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Dd,{"aria-label":t,label:Cn({label:t,errors:l?.errors}),valid:Boolean(!a),value:n,onChange:i,onBlur:r,placeholder:"___-___-___ __",...l}),Sn(a)]}))),Pd=d((({field:e,input:t})=>o(_d,{label:"СНИЛС",maxLength:14,...e(t?.name??""),...t}))),Ed=d((({field:e,input:t})=>{const n=r((t=>{(pl.test(t)||0===t.length)&&e("surname")?.onChange?.(t)}),[e]);return o(Vl,{label:"Фамилия",maxLength:40,disabled:Ai(e,t),...e(t?.name??""),...t,onChange:n})})),Rd=d((({field:e,input:t})=>o(Vl,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,type:"number",maxLength:10,...e(t?.name??""),...t,disabled:Ai(e,t)}))),Ad={$ref:"/wcms-resources/delivery-cities-data.json"},Md={limitedBirthday:rd,name:dd,surname:Ed,middleName:cd,email:zc},Od={processPersonalDataFlg:Do,consentProviderFlg:Do,consentOthersFlg:Do,consentInformFlg:Do,consentPfrFlg:Do,consentInformMaterialsFlg:Do,consentFATCA:Do},Bd={organization:md,organizationAddress:$l,organizationPhone:Ki,organizationName:ud,legalForm:id,generalSeniority:Hc,lastJobExperience:Jc,experience5Years:qc,jobsNumber:Xc,beginDate:po,addressFact:Ul,addressRegistration:$l,addressRetail:Qs,addressMatch:Wl,sex:Id,birthPlace:go,education:Lc,housing:Yc,amountWorkers:co,employment:jc,employerActivities:Vc,employerOrganization:$c,positionOrganization:bd,familyStatus:Wc,familyMembers:Uc,children:vo,dependents:Rc,snils:Pd,conscription:Co,armyIdFlg:mo,dulSerie:Bc,dulNumber:Oc,dulIssueDate:Ac,dulSubdivisionCode:Fc,dulIssuedBy:Mc,participantDateRegistration:pd,retirementIncome:Cd,otherIncome:hd,wages:Rd,mandatoryPayments:ld,bankruptcyFlg:ho,initiateBankruptcyFlg:Kc,shareholderFlg:Td,legalEntityName:ad,creditInRshbCd:fc,bankEmployeeCode:uo,partInBusiness:gd,regionRetail:Nd,infoCard:Gc,calculator:uc,confirmationIncome:wo,inn:Dc,...Md},Fd={addressCourier:e=>o(ql,{...e,source:Ad}),paymentSystem:xd,currency:vc,cardCategory:xo,codeWord:No,methodObtain:od,deliveryDate:Pc,latinName:td,latinSurname:nd,deliveryTime:Ec},Ld="Согласие на все документы",zd=d((({inputs:e=[],field:t,key:n})=>{const a=e.every((e=>Boolean(t(e.name).value))),i=r((n=>{for(const a of e){const e=t(a.name);e.onChange?.(n)}}),[e]),s=l((()=>e?.filter((e=>e.required))?.some((e=>Boolean(rr(t(e?.name),gr).error)))),[e]),[d,{toggle:m}]=hn(!0);return o("div",{className:"w-fit",children:c(es,{children:[c("div",{className:"flex items-start",children:[c("div",{children:[o(wi,{text:Ld,value:a,onChange:i},n),Sn(s?"Отметьте все обязательные соглашения":"")]}),o(Wr,{embedded:!0,ariaLabel:Ld,onClick:m,children:o(Ql,{className:"p-2xs",iconVersion:"color",isUnfolded:d})})]}),o(ts,{className:"flex flex-col pl-2xl",isUnfolded:d,children:e.map(zr(t,{},Od))})]})})})),Vd=({field:e,inputs:t},n)=>{const{consentInputs:a,restInputs:i}=$d(t||[],n);return a.length>2?c("div",{children:[i.map(zr(e,{},{...Md})),o(zd,{inputs:a,field:e})]}):(t||[])?.map(zr(e,{},{...Md}))},$d=(e,t)=>({consentInputs:e.filter((({name:e})=>Object.keys(El[t]).includes(String(e)))),restInputs:e.filter((({name:e})=>!Object.keys(El[t]).includes(String(e))))}),jd=(e,t=!1)=>o(nl,{className:"w-full @xl:w-auto",isLoading:t,children:e?.text?e.text:"Отправить заявку"}),qd=new no;function Ud(){return io(qd)}eo(qd,new to(globalThis?.sessionStorage));const Wd=e=>Ml("/user-data/updateUserProfile","PUT",e),Hd=e=>Ml("/user-data/updateUserTask","PUT",e),Yd=d((({className:e,seconds:t})=>o("span",{className:e,children:Gd(t)}))),Gd=e=>[Math.floor(e/60),e%60].map((e=>String(e).padStart(2,"0"))).join(":"),Kd=(e,t)=>{const n=s(null),a=r((()=>clearInterval(n.current)),[]),l=r((()=>{a(),n.current=setInterval((()=>e(a)),t)}),[e,t,a]);return i((()=>(l(),a)),[l,a]),{start:l,stop:a}};function Xd({seconds:e,period:t=1e3,onTick:n,onEnd:a}){const i=s(e),l=r((e=>{i.current||=0,i.current=Math.max(0,i.current-1);try{n?.(i.current)}finally{i.current<=0&&(e(),a?.())}}),[n,a]),{start:o}=Kd(l,t);return r((e=>{i.current=e,o()}),[])}const Jd={width:"118",height:"24"},Qd={"bg-white":"color",transparent:"white"},Zd={"bg-white":"text-primary-main",transparent:"text-white"},em=(e,t,n)=>o(ie,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:Qd[e]},className:Zd[e],width:n?.width,height:n?.height}),tm={"bg-white":"text-primary-text",transparent:"text-white"},nm=d((({className:e,href:t="/",logo:n,children:a,targetBlank:i,bgColor:r="bg-white",showTitle:l=!0,data:s})=>c("a",{className:u("inline-flex items-center font-sans no-underline",e),href:n?.href??t,target:i?"_blank":"_self","aria-label":n?.title??"Россельхозбанк",...ve(s),children:[em(r,n?.image,Jd),l?a??o("div",{className:"ml-s",children:o(ze,{font:"font-medium",color:tm[r],size:"",children:n?.title??"Россельхозбанк"})}):null]}))),am=d((({phoneNumber:e,sendCode:t,onClose:n})=>{const[l,s]=a(""),[d,m]=a(""),[u,h]=a(!1),[p,{setTrue:g,setFalse:f}]=hn(!1),{closeAll:y}=ge(),x=r((async()=>{g();var e;await(e={captchaText:d},Ml("/sms/checkCaptcha","POST",e).then((e=>e.text())).then((e=>"ERROR"!==e)))?(n?.(),t?.()):h(!0),f()}),[d,t]),b=r((()=>{(async()=>{s(URL.createObjectURL(await(e=>Ml(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET").then((async e=>e?e.blob():new Blob)))(e)))})()}),[]);return i(b,[]),o(Yr,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",head:o(nm,{}),onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center",children:[c("div",{className:"flex",children:[o("img",{className:"grow",src:l}),o(Wr,{className:"w-8",embedded:!0,onClick:b,children:o(G,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(_n,{className:"w-80",onChange:m,value:d,placeholder:"Введите код с картинки"}),u?o("div",{className:"text-error",children:"Неверный код"}):null,c("div",{className:"flex w-80 justify-between",children:[o(Wr,{version:"secondary",onClick:y,children:"Вернуться"}),o(nl,{version:"secondary",disabled:!d,onClick:x,children:"Отправить"})]}),p?o(tl,{blur:!1}):null]})})})),im=d((({values:e,setValues:t,hasError:n,errorText:l})=>{const[d,m]=a(0),u=s([]);i((()=>{u.current?.[d]?.focus()}),[d]);const h=r((n=>a=>{const{value:i}=a.currentTarget,r=i.slice(0,1);t(e.map(((e,t)=>t===n?r:e))),m(n+1)}),[e]),p=r((n=>a=>{const{key:i}=a;if("Backspace"===i&&!e[n]){const a=n>0?n-1:e.length-1,i=e.map(((e,t)=>t===a?"":e));t(i),m(a)}}),[e]),g=r((n=>{n.preventDefault();const a=n.clipboardData.getData("text"),i=e.map(((e,t)=>t<a.length?a[t]:e));t(i),m(i.length-1)}),[e]);return c("div",{className:"flex flex-col gap-2 text-center",children:[o("div",{children:e.map(((t,a)=>o("input",{type:"number",maxLength:1,value:t,onChange:h(a),onPaste:g,ref:e=>{u.current||(u.current=[]),u.current[a]=e},onFocus:e=>e.target.select(),onKeyDown:p(a),className:rm(a,e,n)},a)))}),n?o("div",{className:"text-error",children:l}):null]})})),rm=(e,t,n=!1)=>{const a=!t[e];return`w-16 sm:w-20 h-24 text-5xl text-center p-md m-2 border ${Tn(!n||!a)} rounded-md caret-transparent outline-none`},lm=d((({disabled:e=!1,onClick:t,text:n})=>o(Wr,{type:"button",onClick:t,disabled:e,children:o(ze,{font:"font-normal",children:n})}))),sm=e=>{e?.access_token&&e?.refresh_token&&(globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token))},om=({values:e,onSuccess:t})=>{const n=Ud(),l=n.smsCode?.attempts||0,s=Math.max(cm(n.smsCode?.sendTime||Date.now()),0),[o,c]=a(""),[d,{setTrue:m,setFalse:u}]=hn(!1),[h,p]=a(s),g=r((()=>c("")),[]),f=Boolean(0===h&&n.smsCode?.sendTime),y=l>2||f||!e.every(Boolean),x=r((async()=>{try{n.smsCode={...n.smsCode,attempts:l+1},m(),await(async e=>Al("/sms/checkCode","POST",e).then(sm))({smsText:e.join(""),smsCodesSetName:{key:"AUTHENTICATION"}}),p(0),g(),n.smsCode=null,await(t?.(e.join("")))}catch{c(l>1?"Исчерпан лимит ввода смс-кода":"Неверный код")}finally{u()}}),[e,l]);return i((()=>{f?c("Код просрочен"):l>2&&c("Исчерпан лимит ввода смс-кода")}),[f]),{handleSubmit:x,hasError:Boolean(o),errorText:o,isLoading:d,timeNextReq:h,isSubmitButtonDisabled:y,setTimeNextReq:p,setErrorText:c}},cm=e=>180-Math.floor((Date.now()-e)/1e3),dm=d((({phone:e,withDescription:t=!0,consents:n,onSuccess:l=Na,onClose:s=Na})=>{const[d,m]=a(Array(4).fill("")),u=Ud(),{handleSubmit:h,hasError:p,errorText:g,isLoading:f,timeNextReq:y,isSubmitButtonDisabled:x,setTimeNextReq:b,setErrorText:v}=om({values:d,onSuccess:l}),N=wn(am),w=Qt(e),C=Xd({seconds:y,onTick:b}),k=r((async()=>{var e;await(e={phoneNumber:w,smsCodesSetName:{key:"AUTHENTICATION"}},Ml("/sms/sendCode","POST",e).then((e=>e.text())).then((e=>"OK"===e)))?(b(180),C(180),v(""),u.smsCode={sendTime:Date.now(),attempts:0}):N.open({phoneNumber:w,sendCode:k})}),[w,C,s]);return i((()=>{u.smsCode?.sendTime||k()}),[]),o(Yr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-xl p-m",onClose:s,children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[o(S,{className:"w-full",title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),o(im,{values:d,setValues:m,errorText:g,hasError:p}),um(y,k),t?c(Fe,{itemSize:"list-s",children:[o("span",{children:"Вводя код, я подтверждаю, что ознакомлен и подписываю: "}),o("ul",{children:n?.map(((e,t)=>o("li",{children:e},`${e}-${t}`)))})]}):null,mm(x,h),f?o(tl,{blur:!1}):null]})})})),mm=(e,t)=>o(lm,{text:"Далее",disabled:e,onClick:t}),um=(e,t)=>e?c("div",{className:"flex flex-row text-l font-light text-base",children:["Получить новый код можно через",o(Yd,{className:"pl-2xs",seconds:e})]}):o(Wr,{embedded:!0,onClick:t,children:o(Jl,{children:"Получить новый код"})}),hm={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},pm={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},gm=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],fm=d((({onSubmit:e=Na,onClose:t=Na})=>{const[n,i]=a(""),[l,s]=a(!1),d=Io(2),m=r((()=>{e(n)}),[e,n]),u=r((e=>{i(e),s("REFUSE"===e)}),[]),h=l?pm:hm;return o(Yr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg px-5xl",onClose:t,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o("div",{role:"button",onClick:d,children:o(N,{className:"text-center text-balance",headingType:"h2",title:h.title})}),o(w,{align:"text-center",children:h.description}),o(Rr,{className:"whitespace-normal",orientation:"horizontal",items:gm,value:n,onChange:u}),o(Wr,{disabled:!n,type:"button",onClick:m,children:"Далее"})]})})})),ym=d((({title:e,icon:t,description:n,onClick:a=Na})=>c("button",{className:"flex gap-lg items-center border border-gray/30 rounded-xl cursor-pointer p-4 hover:border-green",type:"button",onClick:a,children:[o(ie,{image:{icon:t,iconVersion:"normal"},width:"78",height:"78"}),c("div",{className:"flex flex-col items-start gap-xs md:w-72 md:mr-lg",children:[e?o(ze,{font:"font-medium",size:"text-s",children:e}):null,n?o(ze,{color:"text-secondary-text",size:"text-xs",children:n}):null]})]}))),xm={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},bm={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK",addressCourier:"DELIVERY"},vm={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},Nm=e=>Object.entries(e).reduce(((e,[t,n])=>t in xm?[...e,{contactTypeCd:{key:xm[t]},value:n}]:e),[]),wm=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in bm){const a=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:bm[t]},...a}]}return e}),[]),Cm=e=>{const{familyStatus:t,familyMembers:n,dependents:a,children:i,confirmationIncome:r,wages:l,mandatoryPayments:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u,snils:h,armyIdFlg:p,conscription:g,initiateBankruptcyFlg:f}=e;return{maritalStatusCd:t,totalDependents:n,incomeCertificateCd:r,otherDependents:a,childrenDependents:i,militaryStatusCd:g,participantIncomes:(y={wages:l,mandatoryPayments:s,incomeAverage:Sm(l,u),additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u},Object.entries(y).reduce(((e,[t,n])=>t in vm?[...e,{incomeTypeCd:{key:vm[t]},value:Number(n||0)}]:e),[])),snils:h?.replace(/[-\s]/g,""),armyIdFlg:p,initiateBankruptcyFlg:f};var y},Sm=(e,t)=>(Number(e??0)+Number(t??0)).toString(),km={WORK:"Работаю",RETIREE:"Пенсионер"},Im={BANK_STATEMENT:"Получаю зарплату на счет/карту в РСХБ",BANK_STATEMENT_PENS:"Получаю пенсию на счет/карту в РСХБ",PFR_CERTIFICATE:"Получаю зарплату на счет/карту в другом банке",OTHER:"Другое"},Tm={credit_cash:"10",credit_cash_single_doc:"28",credit_mcx:"39",family_offer_credit:"41",gas_engine_fuel:"33",pension_credit:"12",ref_credit:"11",ref_credit_single_doc:"29",self_employed:"34",summer_cash:"35",summer_cash_pens:"36"},Dm={...Tm,amur_card:"14",owner_card:"13",travel_card:"15"},_m=e=>{const t=e?.find((e=>"WAGES"===e.incomeTypeCd.key))?.value,n=e?.find((e=>"MANDATORY_PAYMENTS"===e.incomeTypeCd.key))?.value,a=e?.find((e=>"ADDITIONAL_INCOME"===e.incomeTypeCd.key))?.value,i=e?.find((e=>"OTHER_INCOME"===e.incomeTypeCd.key))?.value,r=e?.find((e=>"OTHER_PAYMENTS"===e.incomeTypeCd.key))?.value,l=e?.find((e=>"RENTAL_INCOME"===e.incomeTypeCd.key))?.value,s=e?.find((e=>"RETIREMENT_INCOME"===e.incomeTypeCd.key))?.value;return{wages:t,mandatoryPayments:n,incomeAverage:Sm(t,s),additionalIncome:a,otherIncome:i,otherPayments:r,rentalIncome:l,retirementIncome:s}},Pm=e=>{const t=e?.find((e=>"REGISTRATION"===e.addressType.key)),n=e?.find((e=>"RESIDENTAL"===e.addressType.key)),a=e?.find((e=>"WORK"===e.addressType.key));return{addressRegistration:t,addressFact:n,organizationAddress:a}},Em=e=>{const t=e?.find((e=>"EMAIL"===e.contactTypeCd.key))?.value,n=e?.find((e=>"MAIN_PHONE"===e.contactTypeCd.key))?.value,a=e?.find((e=>"ORGANIZATION_PHONE"===e.contactTypeCd.key))?.value;return{email:t,phone:n,organizationPhone:a}},Rm=(e,t)=>e?.key?{key:e.key,text:t?t[e.key]:e.value}:void 0,Am=d((function({task:e,isFromLead:t=!1,isDebit:n=!1,sendAspects:a=Na,onClose:i=Na}){const l=so(),s=on(),{participants:d,creditProgram:m,createdDate:u="",id:h}=e,p=Dm[m.code],g=Boolean(Tm[m.code]),{id:f,profile:y}=d[0],x=r((()=>{const t=(e=>{const t=e.participants[0],{classCard:n,codeWord:a,paymentSystemTypeCd:i,currencyCode:r}=e,{loanAmount:l,creditPeriod:s,paymentTypeCd:o}=e,{birthDate:c,midname:d,name:m,surname:u,birthPlace:h,dulIssueDate:p,dulIssuedBy:g,dulNumber:f,dulSerie:y,dulSubdivisionCode:x,educationLevelCd:b,registrationDate:v,houseTypeCd:N,genderCd:w,participantContacts:C=[],participantAddresses:S=[],employmentContractDate:k,employmentTypeCd:I,organizationName:T,organizationInn:D,organizationActivityTypeCd:_,organizationTypeCd:P,organizationKindCd:E,employeesNumberCd:R,opf:A,seniority:M,generalSeniority:O,jobsNumber:B,lastWorkDuration:F,positionCd:L,maritalStatusCd:z,childrenDependents:V,totalDependents:$,otherDependents:j,militaryStatusCd:q,participantIncomes:U,snils:W,armyIdFlg:H,bankruptcyFlg:Y,shareholderFlg:G,nameLegalEntity:K,creditInRshbCd:X,payrollCardRshbFlg:J,consentInsuranceFlg:Q,incomeCertificateCd:Z,profile:ee}=t;return{currency:r?.key,paymentSystem:Rm(i),cardCategory:Rm(n),codeWord:a,limitedBirthday:c,middleName:d,name:m,surname:u,birthPlace:h,dulIssueDate:p,dulIssuedBy:g,dulNumber:f,dulSerie:y,dulSubdivisionCode:x,education:Rm(b),participantDateRegistration:v,housing:Rm(N),beginDate:k,employment:Rm(I,km),organizationName:T,inn:D,employerActivities:Rm(_),organization:Rm(P),employerOrganization:Rm(E),amountWorkers:Rm(R),legalForm:A,generalSeniority:M?.toString(),experience5Years:O?.toString(),jobsNumber:B?.toString(),lastJobExperience:F?.toString(),positionOrganization:Rm(L),familyStatus:Rm(z),children:V?.toString(),familyMembers:$?.toString(),dependents:j?.toString(),conscription:Rm(q),confirmationIncome:Rm(Z,Im),snils:W,armyIdFlg:H,bankruptcyFlg:Y,shareholderFlg:G,legalEntityName:K,creditInRshbCd:Rm(X),calculator:{isInsurance:J,isSalaryClient:Q,moneyValue:l,monthsValue:s,isAnnuity:"ANNUITY"===o?.key},esiaAccountTypeCd:ee?.esiaAccountTypeCd,..._m(U),...Pm(S),...Em(C),...(te=w,te?.key?{sex:"MAN"===te.key?"male":"female"}:null)};var te})(e);l.participantId=f??null,l.taskId=h,l.profileId=y?.id??null,l.programId=p,l.leadForm=t,y?.id&&a(y.id,h),s.assign(n?"/debit-card-lead":g?"/credit-lead":"/credit-card-lead")}),[]),b=r((()=>{s.assign(g?"/natural/loans/all-goals":"/natural/creditcards/svoya")}),[]);return o(Yr,{className:"my-6xl max-w-4xl w-full min-h-fit mx-auto rounded-xl py-0",onClose:i,children:c("div",{className:"flex flex-col gap-lg items-center mt-xs mx-6xl",children:[o(N,{className:"whitespace-pre-wrap text-center",title:"Нашли черновик вашей заявки",headingType:"h5"}),c("div",{className:"flex flex-col gap-m max-w-lg",children:[o(ym,{title:"Продолжить заполнение черновика",icon:"BankColorIcon",description:u?`Черновик от ${Jt(new Date(u))}`:"",onClick:x}),o(ym,{title:t?"Продолжить заполнение текущей заявки":"Создать новую заявку",icon:"NewLoanIcon",description:"На получение кредита",onClick:t?i:b})]})]})})})),Mm=d((function({onClose:e=Na}){const t=on(),n=r((()=>{t.assign("/natural/loans/all-goals")}),[]),a=r((()=>{t.assign("/")}),[]);return o(Yr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl",onClose:e,children:c("div",{className:"flex flex-col gap-lg",children:[o(N,{className:"text-center",title:"Заявки не найдены",headingType:"h3"}),o(w,{size:"text-l",align:"text-center",children:"По данному номеру не найдено незавершенных заявок. Вы можете заполнить новую заявку или вернуться на главную страницу"}),o(Wr,{type:"button",className:"w-full",onClick:n,children:"Заполнить новую заявку"}),o(Wr,{type:"button",version:"secondary",className:"w-full",onClick:a,children:"Вернуться на главную"})]})})})),Om=e=>{switch(e){case"referal_sf":return"ReferalSF";case"vse_svoe":return"vseSvoe";default:return globalThis.location.origin}},Bm=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"snowplowEvent"===e?{...n,eventJSON:t}:n}))),Fm=({programId:e,nextStepLink:t,productType:n,data:i})=>{const[l,{setTrue:s,setFalse:o}]=hn(!1),[c,d]=a(),m=(()=>{const e=So();return r((({participantId:t,taskId:n,profileId:a,programId:i,formData:r})=>{e.participantId=t,e.taskId=n,e.profileId=a,e.programId=i,e.leadForm=r}),[])})(),u=Ud(),h=(({data:e})=>{const t=un();return r(((n,a)=>{const i=JSON.stringify({ProfileId:n,TaskId:a});sn({aspectsAttributes:Bm(e,i),aspects:t,ev:{}})}),[e])})({data:i}),p=on(),g=r((()=>{p.assign(t)}),[]),f=(e=>{const{open:t}=wn(fm),n=wn(dm),a=t=>async n=>{try{t&&await Wd({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()}catch(e){console.log(e)}},i=(t,i)=>async r=>{"SIGNED"===r&&t?n.open({phone:t,consents:["согласие на запрос информации в БКИ"],onSuccess:a(i)}):e()};return{open:(n,a)=>t({onSubmit:i(n,a),onClose:e})}})(g),y=wn(dm),x=(()=>{const{open:e}=wn(Am),{open:t}=wn(Mm);return{open:({task:n,isFromLead:a,isDebit:i,onClose:r,sendAspects:l})=>{n?e({task:n,isFromLead:a,isDebit:i,onClose:r,sendAspects:l}):t({})}}})();return{isSending:l,ok:c,handleSubmit:r((async t=>{try{s();const i=$m(t),r=await(a={profile:{phone:Qt(i.phone)}},Al("/public-data/createUserProfile","POST",a).then((e=>e?.profile?.id||null))),l=u.referalData,o=u.marketingInfo;if(!r)throw new Error;const c=async()=>{await zm({programId:e,profileId:r,formData:i,productType:n,referalData:l,marketingInfo:o,saveUserData:m,sendAspects:h}),y.close(),"debitCard"===n?g():f.open(i.phone,r)},p=async()=>{try{const t=await(async e=>{const t=await Al("/user-data/getLastStatus","POST",e);return"DRAFT"===t?.statusCd?t?.taskId:null})({profileId:r,programId:e});if(t){const e=await(async e=>await Al("/user-data/getTaskById","POST",e)||void 0)({taskId:t});y.close(),x.open({task:e,isFromLead:!0,isDebit:"debitCard"===n,sendAspects:h,onClose:c})}else await c()}catch{d(!1)}},b=Lm(i,n);y.open({phone:i.phone,consents:b,onSuccess:p})}catch{d(!1)}finally{o()}var a}),[])}},Lm=(e,t)=>{const n=El[t];return Object.keys(n).filter((t=>e[t])).map((e=>n[e]?.text))},zm=async({programId:e,profileId:t,formData:n,productType:a,referalData:i,marketingInfo:r,saveUserData:l,sendAspects:s})=>{let o,c;const d=Vm(n,a);await Wd(((e,t,n)=>{const{name:a="",surname:i="",middleName:r="",limitedBirthday:l="",phone:s="",email:o=""}=t;return{profile:{id:e,name:a,surname:i,midname:r,birthDate:l&&Jt(l,!0),email:o,phone:Qt(s),...n}}})(t,n,d));try{if("debitCard"===a){const t=await(async e=>await Al("/user-data/createUserTaskDebit","PUT",e)||{})(((e,t,n)=>{const{name:a,surname:i,middleName:r,limitedBirthday:l,phone:s,email:o}=e;return{task:{taskSource:Om(n?.utm_source),creditProgram:{code:yc[t]},participants:[{birthDate:l&&Jt(l,!0),midname:r,name:a,surname:i,participantContacts:Nm({phone:s&&Qt(s),email:o})}],marketingInfo:{bannerId:n?.bannerId}}}})(n,e,r));o=t.taskId,c=t.participantId}else{const a=await(async e=>await Al("/user-data/createDraftTask","POST",e)||{})({profileId:t,programId:e});o=a.taskId,c=a.participantId,await Hd((({participantId:e,taskId:t,profileId:n,formData:a,marketingInfo:i})=>{const{name:r,surname:l,middleName:s,limitedBirthday:o,phone:c,email:d}=a;return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:Om(i?.utm_source),id:t,participants:[{birthDate:o&&Jt(o,!0),id:e,midname:s,name:r,surname:l,profile:{id:n},participantContacts:Nm({phone:c&&Qt(c),email:d}),roleCd:{key:"BORROWER",value:"Заемщик"}}],marketingInfo:i}}})({participantId:c,taskId:o,profileId:t,formData:n,marketingInfo:r}))}i?.referalCode&&await(m={taskId:o,...i},Ml("/referal/saveReferalInfo","POST",m)),s(t,o),l({participantId:c,taskId:o,profileId:t,programId:e,formData:n})}catch(e){console.log(e)}var m},Vm=(e,t)=>{const{consentOthersFlg:n,consentPfrFlg:a,processPersonalDataFlg:i,consentInformFlg:r,consentProviderFlg:l,consentInformMaterialsFlg:s,consentFATCA:o}=e;let c;return c="credit"===t?{consentPfrFlg:a,consentInformMaterialsFlg:n,consentPhotoFlg:!1}:"creditCard"===t?{consentInformMaterialsFlg:s,consentPhotoFlg:!1}:{consentFATCA:o,consentPhotoFlg:n},{...c,processPersonalDataFlg:i,consentInformFlg:r,consentProviderFlg:l,consentCollectionFlg:n,consentAssignmentClaimsFlg:n}},$m=e=>({...e,surname:e.surname?.trim(),name:e.name?.trim(),middleName:e.middleName?.trim()}),jm={surname:"",name:"",middleName:"",limitedBirthday:void 0,phone:"",email:"",processPersonalDataFlg:!1,consentProviderFlg:!1,consentOthersFlg:!1,consentInformFlg:!1,consentPfrFlg:!1,consentInformMaterialsFlg:!1,consentPhotoFlg:!1,consentFATCA:!1},qm=(e,t,n)=>{if(t)return{...t,limitedBirthday:new Date(t?.limitedBirthday||0),...!n&&{esiaAccountTypeCd:{key:""}}};return{...Object.fromEntries(e.map((e=>[e.name,jm[e.name||""]])))}},Um=async(e,t,n=!1)=>{const a=new FormData;return a.append("documentCategory",t),a.append("file",e,"file."+(n?"pdf":"xml")),await(globalThis?.fetch?.("/light-api-cash/v1/file",{method:"POST",headers:{...Ol()},credentials:"include",body:a}).then((e=>e.json())))},Wm=e=>{const{postcode:t,region:n,regionCode:a,locality:i,city:r,street:l,house:s,building:o,block:c,apartment:d}=e,m=[t,n,i||r,l?`ул ${l}`: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:a?.key,fullAddress:m}},Hm=e=>Math.floor(e/12),Ym=async e=>{const t=[],n=[{file:e.pdfFileWorkbook,category:"CONFIRMING_INCOME_DOC",isPDF:!0},{file:e.pdfFilePayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!0},{file:e.pdfFileSigPayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!0},{file:e.xmlFilePayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!1},{file:e.xmlFileSigPayout,category:"CONFIRMING_EMPLOYMENT_DOC",isPDF:!1},{file:e.xmlFileWorkbook,category:"CONFIRMING_INCOME_DOC",isPDF:!1}];for(const e of n){const n=e.isPDF?"data:application/pdf;base64":"data:application/xml;base64";await fetch(`${n},${e.file}`).then((e=>e.blob())).then((t=>Um(t,e.category,e.isPDF))).then((e=>t.push(e)))}return t},Gm=e=>{const{profile:t,document:n,addressRegistration:a}=e;if(![t.name,t.surname,t.midname,t.birthDate,t.phone,n.dulIssueDate,n.dulIssuedBy,n.dulNumber,n.dulSerie,n.dulSubdivisionCode,a,t.esiaAccountType].every(Boolean))throw new Error},Km=e=>{const{esiaAdditionalDocument:t}=e;return[t?.inn,t?.averageMonthlyIncome?.toString(),t?.startWorkDate,t?.workLengthInFiveYears?.toString(),t?.workLength?.toString(),t?.workLengthLastJob?.toString(),t?.jobsNumberInFiveYears?.toString(),t?.pdfFilePayout,t?.pdfFileWorkbook,t?.pdfFileSigPayout,t?.xmlFilePayout,t?.xmlFileSigPayout,t?.xmlFileWorkbook].every(Boolean)},Xm=({inputs:e,productType:t,setEsiaStatus:n,esiaAuthSuccess:a})=>{const s=So(),o=r((e=>{const t=e instanceof Function?e(c[d]):e;null!=t?c[d]=t:delete c[d]}),[c=s,d="leadForm"]);var c,d;const m=Ud(),u=globalThis.sessionStorage?.getItem(cn),h=l((()=>qm(e,s.leadForm,a)),[e,s.leadForm]),p=r((async(e,a)=>{n(Rl.Pending);try{const r=await(i={code:e,state:a,redirectUri:globalThis.location?.href,authorize:!0},Al("/esia/requestProfile","POST",i).then((e=>(sm(e),e))));if(r){const e=await(async(e,t)=>{Gm(e);const n=!t&&Km(e),{profile:a,addInfo:i,document:r,addressRegistration:l,addressFact:s,esiaAdditionalDocument:o}=e;let c=[];return n&&(c=await Ym(o)),{...{name:a.name,surname:a.surname,middleName:a.midname,limitedBirthday:a.birthDate,phone:Hi(a.phone),email:a.email,dulIssueDate:r.dulIssueDate,dulIssuedBy:r.dulIssuedBy,dulNumber:r.dulNumber,dulSerie:r.dulSerie,dulSubdivisionCode:r.dulSubdivisionCode,birthPlace:i.birthPlace,addressRegistration:Wm(l),esiaAccountTypeCd:t?a.esiaAccountType:{key:""},...s&&{addressFact:Wm(s)}},...n&&{snils:i.snils,inn:o.inn,wages:Math.floor(o.averageMonthlyIncome)?.toString(),beginDate:o.startWorkDate,experience5Years:Hm(o.workLengthInFiveYears).toString(),generalSeniority:Hm(o.workLength).toString(),lastJobExperience:Hm(o.workLengthLastJob).toString(),jobsNumber:o.jobsNumberInFiveYears.toString(),esiaAccountTypeCd:a.esiaAccountType,confirmationIncome:{key:"SFR_CERTIFICATE",text:"Запрос Банком доходов из СФР"},employment:{key:"WORK",text:"Работаю"},files:c}}})(r,"debitCard"===t);o((t=>({...t,...e}))),n(Rl.Success)}}catch{n(Rl.Error)}var i}),[]);return i((()=>{s.productType=t;const{code:e,state:n,referalCode:a,refererCode:i,productId:r,marketingInfo:l}=Jm(u,m);a&&(m.referalData={refererCode:i,referalCode:a,productId:r}),m.marketingInfo=l,e&&n?p(e,n):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[u]),h},Jm=(e,t)=>{const n=t.referalData,a=t.marketingInfo,i=new URLSearchParams(decodeURIComponent(e||"")),r=i.get("code");return{code:r,state:i.get("state"),referalCode:r?n?.referalCode:i.get("referalCode"),refererCode:r?n?.refererCode:i.get("refererCode"),productId:r?n?.productId:i.get("productId"),marketingInfo:r?a:{utm_campaign:i.get("utm_campaign"),utm_medium:i.get("utm_medium"),utm_source:i.get("utm_source"),utm_content:i.get("utm_content"),utm_term:i.get("utm_term"),bannerId:i.get("bannerId")}}},Qm=d((({className:e,title:t,programId:n="",nextStepLink:r="/credit-lead",button:d,productType:m="credit",data:h,...p})=>{const[g,f]=a(),[y,x]=a(0),b=s(null),v=l((()=>(e=>{const t=El[e];return[{columns:2,inputs:[{name:"surname",required:!0,dadata:!0,filledByEsia:!0},{name:"name",required:!0,dadata:!0,filledByEsia:!0},{name:"middleName",dadata:!0,filledByEsia:!0},{name:"limitedBirthday",required:!0,filledByEsia:!0},{name:"phone",required:!0,filledByEsia:!0},{name:"email",required:!0,dadata:!0}]},{inputs:[{name:"processPersonalDataFlg",required:!0},{name:"consentProviderFlg",required:!0},{name:"consentOthersFlg",required:!0},{name:"consentInformFlg"},{name:"consentPfrFlg"},{name:"consentInformMaterialsFlg"},{name:"consentFATCA",required:!0}].filter((e=>e.name&&Object.keys(t).includes(e.name)))}]})(m)),[m]),N=l((()=>Zm(v)),[v]),w=wn(ml),C=l((()=>eu(m)),[m]),S=l((()=>br(N,C)),[N,C]),k=Xm({inputs:N,nextStepLink:r,productType:m,setEsiaStatus:f,esiaAuthSuccess:g===Rl.Success}),{isSending:I,ok:T,handleSubmit:D}=Fm({programId:n,nextStepLink:r,productType:m,data:h}),[,{field:_,onSubmit:P,reset:E}]=vn(k,{formValidator:S,onSubmit:D}),R=wn(Gr);return i((()=>{void 0!==T&&R.open({ok:T})}),[T]),i((()=>{g&&b?.current&&b.current.scrollIntoView({block:"start"}),g===Rl.Success&&E()}),[b?.current,g]),c(Nn,{className:u("container space-y-m",e),title:t,...p,children:[g?null:o(Bl,{onChangeEsiaStatus:f}),c("form",{onSubmit:e=>{_("processPersonalDataFlg")?.value||(x((e=>e+1)),y>0&&w.open({attempts:y})),P?.(e)},className:"space-y-m relative",ref:b,children:[g===Rl.Pending?o(tl,{blur:!1}):null,v.map(((e,t)=>c("div",{className:u(Vr(e.columns),"grid gap-x-m"),children:[$r(e.title),Vd({field:_,inputs:e?.inputs},m)]},`section-${t}`))),jd(d,I),g===Rl.Error?o(ze,{size:"text-m",font:"font-medium",color:"text-error",children:"Использовать Госуслуги для оформления заявки невозможно, необходимо заполнить поля вручную."}):null]})]})})),Zm=e=>e?.flatMap((e=>e?.inputs))||[],eu=e=>({...Pl,limitedBirthday:Il(e)}),tu=d((({title:e,description:t})=>{const n=_e();return c("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[o(ie,{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"})]})})),nu=e=>e%2!=0,au="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",iu=d((({topItemsCount:e=0,label:t,block:n,blocksToRender:a=[],...i})=>{const[r,l]=e>0?[a.slice(0,e),a.slice(e)]:[a,[]],[s,{toggle:d}]=hn(!1);return c("div",{className:u("space-y-2xs",{hidden:!a.length}),children:[c("div",{className:u(au),children:[_(r,{...i.options,parent:n}),nu(r.length)?o(Kt,{className:"col-span-6",...i}):null]}),c(es,{children:[c(ts,{className:u(au),isUnfolded:s,children:[_(l,{...i.options,parent:n}),nu(l.length)?o(Kt,{className:"col-span-6",...i}):null]}),o(Zl,{className:u("text-h4",{hidden:e<1}),label:t,isUnfolded:s,disabled:!l?.length,dataTheme:i.options?.page?.colorPalette,onClick:d})]})]})})),ru=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",lu=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`}),su=10;function ou(e,{sensitivity:t,rootRef:n}={}){const a=s(null),r=l((()=>({threshold:cu(t),root:n?.current})),[t,n?.current]);return i((()=>{if(!a.current)return;const t=new IntersectionObserver(e,r);return t.observe(a.current),()=>{t.disconnect()}}),[e,r]),a}function cu(e=0){const t=Math.round(e*su);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const du=d((({className:e,style:t,idx:n,activeIndex:a,observerOptions:i,children:l,onIntersection:s})=>{const c=ou(r((e=>{e.length&&s&&s(n||0,e[e.length-1])}),[s,n]),i);return o("div",{className:u("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(n===a),ref:c,role:"listitem",children:l})})),mu=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],uu=d((({className:e,itemClassName:t,containerRef:n,activeIndex:a,visibleItemCount:i=0,gap:l=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:p,onVisibleItemsChange:g,onVisibleIndicesChange:f})=>{const y={sensitivity:1,rootRef:n},x=s([]),b=r(((e,t)=>{const n=[...x.current||[]];n[e]=t,x.current=n,g&&g(n),f&&f(pu(n))}),[g,f]),v=i>0?l*Number(i)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?hu(c,v):{},...N?lu(h):{},gap:`${l}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(du,{className:u(m,i?mu[i-1]:"",{"h-full":N},t),style:w?hu(c/4):{},activeIndex:a,idx:n,observerOptions:y,onIntersection:b,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(S):S(e,0))(p)});var S})),hu=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),pu=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),gu={"horizontal-list":"w-6","vertical-list":"h-6"},fu=({activeIndex:e,onClick:t,listType:n="horizontal-list"})=>(a,i)=>o("div",{className:u("cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white",i===e?gu[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(i)},String(i)),yu=({activeIndex:e,onClick:t})=>(n,a)=>{const i=a===e,r=i?"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",l=i?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=i?"text-l":"text-m group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(a),"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",r),children:[o("div",{className:l,children:n?.title}),o("div",{className:u("text-secondary-text font-light",s),children:n?.description})]},String(a))},xu=e=>t=>e.scrollWidth/t,bu=e=>(t,n)=>{e.scrollBy({left:n*xu(e)(t),behavior:"smooth"})},vu=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[i,l]=a([]),o=r((e=>{l((t=>{return(n=t)===(a=e)||Boolean(n&&a&&n?.length===a?.length&&n.every(((e,t)=>e===a[t])))?t:e;var n,a})),t&&t(e)}),[t]),[c,d]=i.length?[Qo()(i),Xo()(i)]:[-1,-1],m=c>0,u=d<e-1,h=r((()=>{var t;n.current&&(m?bu(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=r((()=>{n.current&&(u?bu(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,u]),g=r(((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}]},Nu={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},wu=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:a="horizontal-list",version:l,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=_e(),[h,p]=vu({itemCount:s.length}),g=Cu(Boolean(s?.length));i((()=>{s?.length&&t>=0&&h?.current&&p.scrollTo(t,g)}),[t]);const f=r((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o(uu,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(yu({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",Nu[a],l?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":l,children:Array.from({length:n}).fill(null).map(fu({activeIndex:t,onClick:f,listType:a}))}):null})),Cu=(e=!1)=>({behavior:e?"auto":"smooth"}),Su=d((({className:e,name:t,...n})=>o(Wr,{className:u("w-12 h-12 min-w-12 min-h-12",e),shape:"round",...n,children:o(G,{name:t,iconVersion:"",size:"small"})}))),ku=d((e=>o(Su,{name:"ArrowLeftIcon",version:"secondary",ariaLabel:"Пролистать влево",...e}))),Iu=d((e=>o(Su,{name:"ArrowRightIcon",version:"secondary",ariaLabel:"Пролистать вправо",...e}))),Tu="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",Du=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:a,isBottom:i})=>{const{canScrollLeft:r,canScrollRight:l,scrollLeft:s,scrollRight:d}=t,m=a&&!i;return c("div",{className:e,children:[n?_u(t):null,r?o(ku,{wcmsIgnore:!0,className:u(Pu(i),m?"left-1":"left-0"),onClick:s}):null,l?o(Iu,{wcmsIgnore:!0,className:u(Pu(i),m?"right-1":"right-0"),onClick:d}):null]})})),_u=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(Tu,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(Tu,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),Pu=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),Eu=d((({className:e,version:t,gap:n=14,padding:a=16,visibleItemCount:i=1,listType:r="horizontal-list",snapAlign:l,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:h,showDots:p,children:g,onVisibleIndicesChange:f,navButtons:y})=>{const x=Array.isArray(g)?g.length:0,[b,v]=vu({itemCount:x,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===r?"relative h-full":""),children:[o(uu,{containerRef:b,activeIndex:N,visibleItemCount:i,gap:n,padding:a,listType:r,snapAlign:l,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(Du,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(y?.length)}),o(wu,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:x,listType:r,version:t,navButtons:y,containerRef:b,containerScroll:v})]})})),Ru=({blocksToRender:e,...t})=>o(Eu,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:_(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",ru(!0)),children:T(e,t)},String(n))})}),Au=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...a})=>{switch(e?.view){case"grid":return c("div",{children:[Mu(n,t),o(iu,{...e,...a,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[Mu(n,t),Ru({...a,blocksToRender:t})]});default:return null}})),Mu=(e,t)=>e&&!t.length?o(tu,{...e}):null,Ou=e=>t=>t.reduce(((t,n,a)=>t.length?t.concat({...e,key:`sep-${a}`},n):[n]),[]),Bu=d((({value:e,onChange:t,items:n=[],multiple:a})=>n.map((n=>o(Bi,{text:n?.title,value:[e].flatMap((e=>e)).includes(n.value),onChange:()=>(n=>{if(!t)return;const i=e?.includes(n);t(a?i?(e||[]).filter((e=>e!==n)):[...e||[],n]:i?[]:[n])})(n.value),type:a?"checkbox":"radio"},n.value))))),Fu=d((({children:e,filtrationSchema:t,resetButton:n,field:a,reset:i})=>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,Ou(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(Lu(a)).filter(Boolean))]}),n?o("div",{children:o(Wr,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:i,children:n?.text})}):null]}))),Lu=e=>([t,n])=>{const a=n?.type;return"array"===a?zu(t,e)(n):null},zu=(e,t)=>n=>{const a=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(ze,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(Bu,{items:a,multiple:!n?.single,...t(e)})]},e)},Vu=e=>e;function $u(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const ju=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,qu=(e,t)=>Object.entries(e).map((([n,a])=>"number"==typeof a?Array.isArray(t[n])?((e,t)=>n=>ju(t[e])||ju(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>ju(t[e])||ju(n[e])||Uu(t[e])<=Uu(n[e]))(n,e):"object"==typeof a&&"min"in a&&"max"in a?((e,t)=>n=>ju(t[e])||ju(n[e])||Uu(t[e]?.min)>=Uu(n[e]?.min)&&Uu(t[e]?.min)<=Uu(n[e]?.max))(n,e):Array.isArray(a)?((e,t)=>n=>ju(t[e])||ju(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>ju(t[e])||ju(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),Uu=e=>Number(e||0),Wu=(e,{block:t,page:n,normalize:a=Vu})=>{const i=t?.blocks||[],[r,s]=vn(e),o=l((()=>$u(i,i.map((e=>Ut(e.content,n?.fallback))))),[i,n?.fallback]),c=r===e?i:((e,t)=>(n=Vu)=>e?.filter((([,e])=>qu(t,n(e)||{}))).map((([e])=>e)))(o,r)(a);return[r,{blocksToRender:c,blocksWithProps:o},s]},Hu={},Yu={},Gu=Yt((({className:e,filtrationSchema:t=Hu,consumerField:n={},resetButton:a,...i})=>{const[,{blocksToRender:r},{field:l,reset:s}]=Wu(Yu,{block:i.block,page:i.options?.page}),d=o(Fn,{className:"w-64",label:n?.title,options:Ku(n),...l("consumer",{parse:({key:e})=>[e],format:([e]=[])=>Ku(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...i,children:[o(Fu,{filtrationSchema:t,field:l,reset:s,children:c("div",{children:[d,o("div",{children:o(Wr,{type:"reset",className:"mt-lg w-64",onClick:s,version:a?.version,children:a?.text})})]})}),o(Au,{blocksToRender:r,...i})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),Ku=e=>$u(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),Xu=(e=!1)=>e?"text-left":"text-center",Ju={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},Qu=d((({className:e,iconBgVersion:t="primary",size:n,icon:a,...i})=>{const r=`${n?.width??44}px`;return a?o("div",{className:u("rounded-icon object-fit flex justify-center items-center",Ju[t],e),style:{width:r,height:r},role:"figure",children:o(G,{name:a,width:"54%",...i})}):null})),Zu=d((({className:e="",title:t,benefitList:n,...a})=>{const i=_e();return c(g,{className:e,defaultPadding:"p-6xl",...a,children:[t?o(N,{headingType:"h3",as:"h2",className:Xu(i),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(eh)}):null]})})),eh=({label:e,description:t,__html:n,icon:a,isDotted:i=!1,iconBgVersion:r},l)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-lg",role:"listitem",children:[a?.icon?o(Qu,{className:"shrink-0",iconBgVersion:r,...a}):null,a?.src?o(ie,{className:"shrink-0",image:a}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(N,{headingType:"h6",children:e}),o(ze,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(Fe,{__html:n,isDotted:i,itemSize:"list-s"}):null]}):null]},String(l)),th=e=>({icon:t,title:n,description:a},i)=>c("div",{className:u("flex flex-col gap-1","items-center",{"justify-center":!a&&!n}),children:[n?o(ze,{size:"text-h6",font:"font-normal",align:e,children:n}):null,t?o(ie,{image:t,height:"180",className:"w-auto mx-auto"}):null,a?o(ze,{size:"text-h6",font:"font-normal",align:e,children:a}):null]},String(i)),nh=(e,t,n)=>o("div",{className:`grid gap-2xs ${ah(t)}`,children:e.map(th(n))}),ah=e=>{switch(e){case"3":return"grid-cols-3";case"4":return"grid-cols-4";default:return"grid-cols-5"}},ih=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:a="4",subtitle:i,title:r,...l})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...l,children:[o(S,{defaultPadding:"",title:r,description:i,headlineVersion:"M"}),e?.length?nh(e,a,t):null]}))),rh={start:"justify-start",center:"justify-center",end:"justify-end"},lh=d((({buttons:e,className:t="",align:n,...a})=>{const i=n&&u("flex",rh[n]);return o(g,{className:u("!bg-transparent",i,t),defaultPadding:"p-0",...a,children:Ye(e)})})),sh=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:a=2,depositeName:i,isShowDepositeName:r,color:l="text-secondary-text"})=>c("div",{children:[o(ze,{size:"text-l",font:"font-light",color:l,children:t}),c("div",{className:"relative",children:[c("div",{className:"flex @xl:justify-center gradient-color-text gap-xs",children:[o("span",{className:"font-mohave text-title-huge -mt-m tracking-[-15px]",children:Je(a,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),i&&r?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:i}):null]})]}))),oh=d((({title:e="Ставка"})=>c("div",{className:"space-y-s lg:min-w-96",children:[o(ze,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(G,{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:"Процентная ставка не найдена, выберите другие параметры"})})]}))),ch=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:a=2,color:i="text-secondary-text",children:r,...l})=>t?c("div",{className:"flex flex-col",children:[o("div",{className:"hidden lg:block min-w-96",children:o(sh,{title:e,rate:t,unit:n,fractionDigits:a,color:i,...l})}),o(Oo,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:a,fixed:!0,color:i,...l}),r]}):o(oh,{title:e,...l}),dh={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},mh={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},uh=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:a}=e,[i,r]=((e,t,n)=>{const{maxBonus:a=5e3,prefMonthsNum:i=dh.prefMonthsNum,prefTravelBonusRate:r=dh.prefTravelBonusRate,prefRestBonusRate:l=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(r*t)+Math.round(l*n),a);return[c,c*i+Math.min(Math.round(s*t)+Math.round(o*n),a)*(12-i)]})(t||mh,n,a);return{...t,...e,monthBonus:i,yearBonus:r}},hh=Yt((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,...r})=>{const[l,{field:s}]=vn({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=uh(l,n);return o(Po,{className:e,title:t,...r,children:c("section",{className:u(Eo,e),children:[c("div",{className:Ro,children:[Ho({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),Ho({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?ch({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:Ao,children:[f>=0?o(Oo,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,Ye(a,{isVertical:!0}),$o(i)]})]})})})),ph=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,gh=e=>Uo({...e,title:"Выплата процентов",orientation:"vertical",items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),fh=" (c капитализацией)",yh=({income:e,finalSum:t,postfix:n="₽",buttons:a=[],footnotes:i=[],isCapitalization:r=!1})=>c("div",{className:Ao,children:[o(Oo,{title:`Доход в конце срока${r?fh:""}`,value:e,postfix:n,prefix:"+"}),o(Oo,{title:`Сумма в конце срока${r?fh:""}`,value:t,postfix:n}),Ye(a,{isVertical:!0}),i?.map($o)]}),xh={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const bh={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},vh=(e,t)=>{const{daysValue:n,moneyValue:a,isPartialWithdrawal:i,isReplenished:r,isMonthlyInterestPayment:l}=e,s=r||i,o=n<90||n>730,c=function(e){const t=e?.rateType?xh[e?.rateType]:"",{data:n}=na(t?`${Zt}/depositrates/${t}`:null,Vt);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>l===e.isMonthlyInterestPayment&&Nh(s,e)&&nc(a,["minSum","maxSum"],e)&&nc(n,["minDays","maxDays"],e)))||bh,{rate:m}=d,u=wh(m,e),h=a+u,p=c||[bh];return{...d,...tc(["minSum","maxSum"],p),...tc(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},Nh=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,wh=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:a,daysValue:i}=t;return n?Math.round(a*Math.pow((1200+e)/1200,i/30)-a):Math.round(a*e*i/365/100)},Ch=Yt((({className:e="",title:t,buttons:n,footnote:a,bottomFootnote:i,isShowDepositeName:r,defaultParams:l,rateParams:s,...d})=>{const[m,{field:h}]=vn({moneyValue:zo(l,1e5),daysValue:Vo(l,60),isReplenished:Boolean(l?.isReplenished),isPartialWithdrawal:Boolean(l?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(l?.isMonthlyInterestPayment)}),p=vh(m,s),{income:g,finalSum:f,rate:y,depositeName:x}=p;return o(Po,{className:e,title:t,...d,children:c("section",{className:u(Eo,e),children:[c("div",{className:Ro,children:[Ho({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(fa,{items:[`От ${ph(b.min||0)}`,`До ${ph(b.max||0)}`],step:1,...b})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[Sh(p,h),gh({...h("isMonthlyInterestPayment")})]})]}),ch({rate:y,depositeName:x,isShowDepositeName:r}),yh({income:g,finalSum:f,buttons:n,footnotes:[a,i]})]})});var b})),Sh=(e,t)=>c("div",{className:"space-y-s",children:[o(ze,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(wi,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(wi,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),kh=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,a]=t[n-1],[i,r]=t[n];a>=i?t.splice(n-1,2,[e,Math.max(a,r)]):n++}return t},Ih={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},Th=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,r=t?.[0]?Ph(t[0].minMonths,t[0].maxMonths):0,l=!n?.isShowMonthlyInterestPayment,s=!n?.isShowRemoteRegistration,o=!n?.isShowReplenish,c=!n?.isShowWithdrawn,d=!n?.isShowNewClient,m=t?.find((t=>[_h({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),_h({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),_h({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:l}),_h({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,nc(a,["minSum","maxSum"],t),nc(i||r,["minMonths","maxMonths"],t)].every(Boolean)))||Ih,{rate:u}=m,h=e?.extraPercent?.key??0,p=Number(u)+Number(h),g=Dh(p,e),f=a+g,y=t||[Ih];return{...m,...tc(["minSum","maxSum"],y),...tc(["minMonths","maxMonths"],y),availableMonths:kh(y.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,n=1)=>Array.from({length:Math.abs(t-e)/n+1},((a,i)=>t>=e?e+i*n:e-i*n)))(e,t))),...e,defaultMonth:r,income:g,finalSum:f}},Dh=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:a,monthsValue:i}=t;return n?Math.round(a*Math.pow((1200+e)/1200,i)-a):Math.round(a*e*30*i/365/100)},_h=({row:e,userInputParams:t,paramKey:n,isExclude:a})=>a||t[n]===e[n],Ph=(e,t)=>e+Math.round((t-e)/2),Eh=(e="rub")=>"rub"===e,Rh=(e,t)=>{const{minMonths:n,maxMonths:a}=tc(["minMonths","maxMonths"],Bh(t,e?.currency)),i=e.monthsValue||Math.round((n+a)/2);return{monthsValue:ma(i,n,a)}},Ah=(e,t)=>{const{minSum:n,maxSum:a}=tc(["minSum","maxSum"],Bh(t,e?.currency)),i=e.moneyValue||n;return{moneyValue:ma(i,n,a)}},Mh=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),Oh=e=>{const t=Eh(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},Bh=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},Fh=(e,t=!1)=>t?Uo({...e,title:"Оформление",orientation:"vertical",items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]}):null,Lh=(e,t,n)=>{const a="rub"!==e?.currency?.key;return c("div",{className:"grid grid-cols-2 gap-lg",children:[zh(t("isReplenish"),e,a),Vh(t("isWithdrawn"),e,a),$h(e.isShowReplenish||e.isShowWithdrawn),e.isShowMonthlyInterestPayment?gh(t("isMonthlyInterestPayment")):null,Fh(t("isRemoteRegistration"),e.isShowRemoteRegistration),jh(t("extraPercent"),n),e.isShowNewClient?o(wi,{text:"Новый сберегатель",...t("isNewClient")}):null]})},zh=(e,t,n=!1)=>t.isShowReplenish?Uo({...e,title:"Пополнение",orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,Vh=(e,t,n=!1)=>t.isShowWithdrawn?Uo({...e,title:"Снятие",orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null,$h=(e=!1)=>e?o("div",{className:"border-b border-main-divider col-span-2 w-full"}):null,jh=(e,t)=>t?.length?c("div",{className:"w-full space-y-s col-span-2",children:[o(ze,{color:"text-secondary-text",font:"font-light",children:"Надбавка за операции по карте"}),o(Fn,{options:t,...e})]}):null,qh={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum",extraPercent:"extraPercent"},Uh={text:"₽",key:"rub"},Wh={text:"Без учета надбавки",key:"0"},Hh=Yt((({className:e,title:t,calcSource:n,buttons:a=[],footnote:l="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=n??{},p=h?.map((e=>e.currency))??[Uh],g=r((e=>t=>e?{...t,...Oh(t),...Ah(t,e),...Rh(t,e),...Mh(t,e)}:t)(h),[h]),[f,{field:y}]=vn({moneyValue:zo(d,2e4),monthsValue:Vo(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:Uh,extraPercent:d?.extraPercent??Wh},{normalizer:g}),x=Jh(y),b=Boolean(y?.("isNewClient")?.value),v=h?.find((e=>e?.extraPercents))?.extraPercents,N=Bh(h,x),w=Th(f,N,s),{rate:C,income:S,finalSum:k,type:I=""}=w,T=r((()=>{Yo({field:y,defParams:Fo(N,b,v),calcParams:w,monthsValue:"minMonths",map:qh})}),[y,h,v]);i((()=>{!sc(d)&&N&&T()}),[d,h]);const D=y?.("extraPercent")?.value?.key,_=Xh(C,D),P=C===Fo(N,b)?.rate&&D===v?.at(-1)?.key;return o(Po,{className:e,title:t,...m,children:c("section",{className:u(Eo,e),children:[c("div",{className:Ro,children:[c("div",{className:"flex gap-m",children:[Ho({className:"w-full",title:`Сумма, ${x?.text}`,min:w.minSum,max:w.maxSum,...y("moneyValue"),value:w.moneyValue,postfix:x?.text,step:Yh(x?.key)}),h&&h?.length>1?o(Hn,{label:"Валюта",options:p,...y("currency")}):null]}),jo({title:"Срок, месяцев",min:w.minMonths,max:w.maxMonths,availableMonths:w.availableMonths,...y("monthsValue"),value:w.monthsValue}),Lh({...w,...s},y,v)]}),ch({rate:_,children:Kh(T,P)}),yh({income:S,finalSum:k,buttons:[...a,Gh(n?.buttons,I)],footnotes:[l],postfix:x?.text,isCapitalization:y("isMonthlyInterestPayment").value})]})})})),Yh=(e="")=>Eh(e)?1e3:100,Gh=(e=[],t="")=>{const{type:n,...a}=e.find((e=>e.type===t))??{};return a},Kh=(e,t=!1)=>t?null:o(Wr,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),Xh=(e,t)=>Number(e)+Number(t??0),Jh=e=>e?.("currency")?.value??Uh,Qh=e=>Zh({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Zh({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Zh=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],ep={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},tp=(e,t,n)=>{const{moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l}=e,s=t?.rateRows||[ep],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Qh({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=ec(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=ec(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l})=>e?.find((e=>Qh({row:e,userInputParams:t,paramsViewSettings:n})&&nc(a+l,["minSum","maxSum"],e)&&nc(r,["minSumOld","maxSumOld"],e)&&nc(l,["minSumExtra","maxSumExtra"],e)&&nc(i,["minMonths","maxMonths"],e)))||ep)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l}),{rate:p}=h,g=Go(p,e),f=e.oldMonthlyPayment-g;return{...h,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:a,monthsValue:i,oldMonthlyPayment:r,moneyExtra:l,monthlyPayment:g,benefit:f}},np=Yt((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,paramsViewSettings:r,...s})=>{const[d,{field:m}]=vn({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),h=tp(d,n,r),p=l((()=>Bo(n?.rateRows)?.rate),[n?.rateRows]),g=Wo({...m("isAnnuity")});return o(Po,{className:e,title:t,...s,children:c("section",{className:u(Eo,e),children:[c("div",{className:Ro,children:[Ho({title:"Остаток долга в других банках, ₽ ",step:500,min:h.minSum,max:h.maxSum-h.maxSumExtra,...m("moneyValue"),value:h.moneyValue}),Ho({title:"Ежемесячный платёж в других банках, ₽",step:500,min:h.minSumOld,max:h.maxSumOld,...m("oldMonthlyPayment"),value:h.oldMonthlyPayment}),jo({title:"Новый срок кредита, месяцев",min:h.minMonths,max:h.maxMonths,...m("monthsValue"),value:h.monthsValue}),ap({...h,...r},m),h.isExtraMoney?Ho({title:"Дополнительная сумма, ₽ ",step:500,min:h.minSumExtra,max:h.maxSumExtra,...m("moneyExtra"),value:h.moneyExtra}):null,o("div",{className:"sm:hidden pb-m border-b border-main-divider",children:g})]}),c("div",{className:u(Ao,"@4xl:w-1/2"),children:[o(Oo,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(Oo,{title:"Ставка от",value:p,fractionDigits:2,postfix:"%"}),o(Oo,{title:"Ежемесячный платёж",value:h.monthlyPayment,postfix:"₽"}),h.benefit>0?o(Oo,{title:"Выгода в месяц",value:h.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:g}),Ye(a,{isVertical:!0}),$o(i)]})]})})})),ap=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(wi,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(wi,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(wi,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),ip=d((e=>{const{onChange:t,min:n,max:a,defaultValue:i="0",fractionDigits:l=0,...s}=e,c=da(e,{normalize:(e=i)=>n&&a?String(ma(Number(rp(e)),n,a)):rp(e),format:Je(l)}),d=r((e=>t&&t(rp(e))),[t]);return o(_n,{onChange:d,...s,...c})})),rp=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),lp=d((e=>o(ip,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(ze,{size:"text-xl",font:"font-light",children:"₽"})})}))),sp={private:"p2p/registerP2P",business:"b2c/registerB2C"},op=({onClose:e,errorCode:t,errorMessage:n})=>{const a=t?`Код ошибки - ${t}`:"Пожалуйста, повторите позднее";return o(Yr,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto",onClose:e,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ie,{image:{icon:"ResponseFailIcon",iconVersion:"normal"},width:"136",height:"136"}),o(S,{className:"w-full",title:"Ошибка перевода",description:a,headlineVersion:"XS",isEmbedded:!0}),n?c("div",{className:"bg-secondary-dark rounded-xl p-m grid gap-m grid-cols-12",children:[o("div",{className:"col-span-8",children:n}),o("div",{className:"col-span-4",children:o(ie,{image:{icon:"ResponseFailIcon",iconVersion:"normal"}})})]}):null]})})},cp=e=>{const t=wn(op),n=Ud(),a=on(),i="private"===e?"p2p":"b2c";return r((async({amount:r})=>{const l=await(async(e,t)=>{const n=on(),a={amount:String(t),currency:"643",returnUrl:`${n.origin}/p2p/success`,failUrl:`${n.origin}/p2p/failed`,language:"ru"},i=`${Zt}/payment/${sp[e]}`;try{const e=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(a)});return e.ok?await e.json():null}catch(e){return null}})(e,r);(e=>Boolean(e?.formUrl)&&Boolean(e?.orderId))(l)&&(n.transaction={orderId:l.orderId,type:i,url:a.href},a.assign(`${i}/?formUrl=${encodeURIComponent(l.formUrl)}`)),(e=>Boolean(e?.errorMessage)&&0!==e?.errorCode)(l)&&t.open({errorCode:l.errorCode,errorMessage:l.errorMessage})}),[e])},dp={amount:1500},mp=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:a,formType:i="private",...r})=>{const l=cp(i),[{amount:s},{field:d,onSubmit:m}]=vn(dp,{onSubmit:l});return c(g,{className:u("flex flex-col gap-4xl items-center",e),defaultPadding:"p-6xl",...r,children:[t?o(N,{className:"self-start xl:self-center",headingType:"h3",title:t}):null,c("form",{className:"w-full xl:max-w-md space-y-lg",method:"POST",onSubmit:m,children:[o(lp,{valid:s>0,label:n,max:3e5,min:1,...d("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:s}),a?.text?o(nl,{className:"w-full",disabled:s<=0,children:a.text}):null]})]})})),up=({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(G,{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})]}),hp="relative h-full",pp={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},gp=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...a})=>{const{blocks:i}=a.block||{},r=i?.some(xp),l=n?{defaultPadding:"p-6xl pb-m"}:{};return P({...a,renderProps:(n,a,i)=>c("div",{className:fp(n,{someCardsHighlighted:r}),children:[T(n,a,{className:yp(n,{someCardsHighlighted:r,showBorder:!e,cardSize:t}),...l,blockIndex:i}),xp(n)?up({className:"absolute top-0 -right-4 z-40"}):null]},String(i))})},fp=(e,{someCardsHighlighted:t})=>u(hp,t&&(xp(e)?"pt-3xl":"pt-16")),yp=(e,{someCardsHighlighted:t,showBorder:n,cardSize:a="normal"})=>u(hp,"min-w-80",pp[a],t&&(xp(e)?"pt-16":"pt-3xl"),ru(n),n&&"h-full"),xp=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,bp=Yt((({className:e,visibleItemCount:t=1,noCardBorder:n,arrowsPadded:a=!0,isGap:i=!0,cardSize:r="normal",isNavButtons:l=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o(Eu,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:i?16:0,padding:0,arrowsPadded:a,navButtons:l?vp(s?.block?.blocks):[],hasBlur:!0,children:gp({noCardBorder:n,cardSize:r,isNavButtons:l,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),vp=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],Np={black:"bg-black",white:"bg-white"},wp=d((({className:e="",title:t,description:n,image:a,price:i,button:r,colors:l=[],align:s="text-left",padding:d,...m})=>o(g,{className:u("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(Re,{className:"h-full",padding:d,title:o(S,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s,className:"min-h-24"}),rightImage:a?.src?o(ie,{className:"flex justify-center align-center mb-xl",image:a}):null,buttons:Ye([r],{buttonClassName:"w-full self-end"}),children:[l?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(ze,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),l.map(Cp)]}):null,i?c(ze,{size:"text-h3",align:"text-left",children:[i," ₽"]}):null]})}))),Cp=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${Np[e]}`},String(t)),Sp=d((({className:e="",href:t,target:n,onClick:a,data:i,children:r})=>{const l=xe()({href:t,target:n,onClick:a});return o(t?"a":"div",{className:u("block",e),...t?l:{},role:t?"link":"none",...ve(i),children:r})})),kp=[{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"}}],Ip=d((({className:e="",media:t,showButtonText:n,stretched:i,version:r="white",children:l})=>{if(!t?.length)return null;const[s,d]=a(),m=t?.map((e=>{const{href:t,icon:a,text:i}=e,{iconMapped:l}=(e=>kp.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=He(a)?a:l,c=n?{text:i}:{text:""},m=e?.icon?.iconVersion||"color";return!s&&i&&d(!0),{...e,...c,icon:{...o,iconVersion:m},version:e?.version??r}})),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},Tp(i));return c("div",{className:u("flex flex-col gap-m xl:gap-xs",e),"aria-label":"Социальные сети",children:[o("div",{className:"flex gap-xs",children:Ye(m,{className:Dp(s??!1,i??!1,n),buttonClassName:h})}),l?o(ze,{size:"text-s",font:"font-light",color:"text-secondary-text",children:l}):null]})})),Tp=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",Dp=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),_p=d((({className:e,padding:t,description:n,additionalDescription:a,href:i,icon:r,isDotted:l,__html:s,socialMedia:d=[],target:m,title:h,align:p="text-left",benefits:f,imageOptions:{directionRight:y=!0,isImageAlwaysOnRight:x=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(Sp,{href:i,target:m,className:"h-full",data:Bm(v),children:c(Re,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(S,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...ot(He(r)?o(ie,{image:r}):null,y),buttons:d.length?o(Ip,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:x,isImageSecondary:b,imageAlign:"center",children:[o(We,{benefits:f}),s?o(Fe,{__html:s,isDotted:l,itemSize:"list-s"}):null,Pp(a,p)]})})}))),Pp=(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,Ep=new he,Rp=(e,t)=>{const{title:n,description:a,buttons:i}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[n?o("div",{className:"opacity-80",children:o(ze,{size:"text-m",color:"text-secondary-text",children:n})}):null,a?o("div",{className:"mt-2xs",children:o(ze,{size:"text-xl",color:"text-primary-text",children:a})}):null,i?.length?o("div",{className:"text-primary-main",children:Ye(i)}):null]},String(t))},Ap=d((({className:e="",title:t,align:n="text-center",icon:s,button:d,visibleCellsCount:m=1,cardCells:h=[],options:p,data:f,...y})=>{const x=l((()=>h.map(Rp)),[h]),[b,v]=l((()=>m>0?[x.slice(0,m),x.slice(m)]:[x,[]]),[m,x]),[w,C]=a(!1);i((()=>Ep.subscribe("fold",(e=>{e&&p?.parent&&e.parent===p?.parent&&C(e.isUnfolded)}))),[p?.parent]);const S=r((()=>{Ep.fire("fold",{type:"fold",isUnfolded:!w,parent:p?.parent})}),[w,p?.parent]);return c(g,{className:u("flex flex-col",e),defaultPadding:"p-2xl",...y,children:[o(ie,{className:"self-center",image:s}),t?o(N,{className:u("pt-xs",n),headingType:"h5",title:t}):null,d?.text?o(ke,{className:"w-full mt-m mb-lg",...d}):null,v.length?c(es,{children:[c("div",{children:[b,o(ts,{isUnfolded:w,children:v})]}),h.length>=m?o(Zl,{className:"mt-m",label:w?"Скрыть":"Подробнее о тарифе",isUnfolded:w,embedded:!0,data:f,onClick:S}):null]}):o("div",{children:b})]})})),Mp=d((({className:e,contacts:t,info:n,version:a="secondary",...i})=>c(g,{className:u("flex",e),defaultPadding:"p-6xl",version:a,...i,children:[n?.length?Op(n):null,t?.length?Op(t):null]}))),Op=e=>o("div",{className:"flex gap-5xl grow basis-0",children:e.map(((e,t)=>Bp({column:e,i:t})))}),Bp=({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:a},i)=>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(a?.text)}),children:Ye([a])})]},String(i))))},`col-${String(t)}`):null,Fp=()=>{const e=globalThis.sessionStorage?.getItem("refreshToken"),t=globalThis.sessionStorage?.getItem("accessToken"),n=globalThis.localStorage.getItem("taskId"),a=on();if(!t||!e||!n)return a.assign("/"),()=>{};const i=async()=>{const n=await Ml("/auth/refresh","POST",{refresh_token:e,access_token:t});if(401===Number(n?.status)&&a.assign("/"),n?.ok){const e=await n.json();globalThis.sessionStorage.setItem("refreshToken",e.refresh_token),globalThis.sessionStorage.setItem("accessToken",e.access_token)}};i();const r=setInterval(i,24e4);return()=>clearInterval(r)},Lp=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 pr-m text-gray",children:t}):null]})]}))),zp=d((({step:e=1,totalSteps:t=6,stepsTitles:n=[]})=>{const a=l((()=>(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(Lp,{step:a,showPercentage:!1})]})})}));var Vp;!function(e){e.process="IN_PROCESS",e.ok="APPROVED",e.fail="CANCELLED",e.pre_decision="PRE_DECISION",e.approved="APPROVED",e.cancelled="CANCELLED",e.failed="FAILED",e.draft="DRAFT",e.rework="REVISION",e.dboClient="DBO_CLIENT",e.clientNotOk="CLIENT_NOT_OK",e.notFound="NOT_FOUND"}(Vp||(Vp={}));const $p=e=>Al("/user-data/getTaskStatus","POST",e),jp=async e=>{const t=await Al("/user-data/sendSignalToProcess","POST",e);return t?.statusCd||null},qp=d((({title:e,interval:t=0,onEnd:n=Na})=>{const[i,r]=a(t);Xd({seconds:t,onTick:r,onEnd:n});const l=100-(t-i)/t*100;return c("div",{children:[e?o(S,{title:e,headlineVersion:"S"}):null,c("div",{className:"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) ${l}%, rgb(125, 126, 127) 0deg)`}}),o("div",{className:"z-10 flex items-center justify-center w-20 h-20 rounded-full bg-white text-primary-text text-m",children:o(Yd,{seconds:i})})]})]})})),Up=d((({title:e,description:t,sectionInfoTitle:n,sectionInfo:a,sectionAdditionalTitle:i,sectionInfoAdditional:r,buttonText:l,interval:s,onExpire:d=Na,...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"}),s?o(qp,{interval:s,onEnd:d}):null]}),o(Wp,{title:n,items:a}),o(Wp,{title:i,items:r,countColumns:!0}),l?o(il,{href:"/natural",text:l,version:"primary",className:"w-full mt-lg"}):null]}))),Wp=({title:e,items:t,countColumns:n=!1})=>{const a=_e();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(ze,{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",Vr(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:Hp(e)},t)))}):null]})]}):null},Hp=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(ze,{color:"text-secondary-text",size:"text-l",children:e}),o(ze,{color:"text-primary-text",size:"text-xl",children:t})]}),Yp=d((()=>o(Up,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Gp=d((({onExpire:e})=>{const{statusInfo:t}=so();return o(Up,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:t?.cardCategory}],onExpire:e})})),Kp=d((()=>{const{statusInfo:e}=so(),t="courier"===e?.methodObtain;return o(Up,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:t?"":"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:t?"Адрес доставки":"В отделении Банка",sectionInfoAdditional:t?[{description:e?.deliveryAddress}]:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Xp=d((()=>{const{statusInfo:e}=so();return o(Up,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получить ваш кредит",sectionInfo:Jp(e),buttonText:"Вернуться на главную"})})),Jp=e=>{const t=[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:e?.cardCategory}];return e?.deliveryAddress&&e?.deliveryDate?t.concat([{label:"Адрес доставки",description:e?.deliveryAddress},{label:"Дата доставки",description:Jt(e?.deliveryDate)}]):t},Qp=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],Zp=d((()=>{const[e,t]=a(Vp.process),{taskId:n}=so();i((()=>{(async()=>{for(const e of Qp)await jp({signalType:e,taskId:n})})()}),[n]);const l=r((async e=>{const a=await $p({taskId:n});a&&a?.statusCd!==Vp.process&&(e(),t(a.statusCd))}),[n]);Kd(l,3e4);const s=r((()=>t(Vp.rework)),[]);return eg(e,s)})),eg=(e,t)=>({IN_PROCESS:o(Gp,{onExpire:t}),CANCELLED:o(Yp,{}),FAILED:o(Yp,{}),DRAFT:o(Yp,{}),APPROVED:o(Xp,{}),PRE_DECISION:o(Xp,{}),REVISION:o(Kp,{})}[e]||o(Kp,{})),tg=e=>(t,n)=>t.filter((e=>e)).map((t=>[ng(n,e),ag(t,e),ig(t,e),og(t,e),rg(t,e),lg(t,e),sg(t,e)].some(Boolean)?{...t,required:!1}:t)),ng=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,ag=({name:e},t)=>"wages"===e&&"RETIREE"===t("employment")?.key&&!t("inn"),ig=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,rg=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,lg=({name:e},t)=>"addressFact"===e&&t("addressMatch"),sg=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const a=t(e?.name);return n!==(a?.key??a)})),og=({name:e},t)=>"snils"===e&&!t("snils")&&cg(t),cg=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,dg={...Bd,...Fd},mg=({field:e,inputs:t,params:n})=>t.map(zr(e,n,dg)),ug=({sections:e,field:t,step:n,params:a})=>e?.map((({inputs:e=[],columns:i,title:r,condition:l},s)=>{const c=tg(hg(t))(e,n),d=[sg({condition:l},hg(t))?null:$r(r),...mg({field:t,inputs:c,params:a})].filter(Boolean).map(((e,t)=>({...e,key:e.key??`elem-${t}`})));return d.length?o("div",{className:u(Vr(i),"grid gap-x-m"),children:d},`section-${s}`):null})),hg=e=>t=>e(t)?.value,pg=({formState:e,inputs:t,step:n,productType:a})=>{return br(tg((t=>e[t]))(t,n),{...Pl,limitedBirthday:Il(a),dulIssueDate:(r=e.limitedBirthday,Sl(14,r)("Укажите дату выдачи паспорта")),generalSeniority:(i=e.lastJobExperience,fn((e=>"string"==typeof e&&/^[0-9]{1,2}$/g.test(e)&&(!i||Number(e)>=Number(i))))("Укажите количество лет стажа")),beginDate:wl(e.limitedBirthday),participantDateRegistration:Cl(e.limitedBirthday)})(e);var i,r},gg=d((({step:e,isSending:t,onPrevStep:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Wr,{version:"secondary",disabled:0===e,onClick:n,children:"Назад"}),o(nl,{isLoading:t,children:a?"Отправить заявку":"Далее"})]})})),fg=(e,t,n)=>({...n[e],...t,limitedBirthday:yg(t?.limitedBirthday),dulIssueDate:yg(t?.dulIssueDate),participantDateRegistration:yg(t?.participantDateRegistration),beginDate:yg(t?.beginDate),deliveryDate:yg(t?.deliveryDate)}),yg=e=>{try{return e?new Date(e):void 0}catch(e){return}},xg=(e=!1)=>[{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDate: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:""},familyMembers:void 0,dependents:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!!e&&void 0,esiaAccountTypeCd:{key:"",text:""},initiateBankruptcyFlg:!e&&void 0},{bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0}],bg=[{paymentSystem:{key:"",text:""},currency:"810",codeWord:""},...xg(),{regionRetail:{key:"",text:""},addressRetail:{key:"",text:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:void 0,deliveryDate:void 0}],vg=e=>{const{currency:t,paymentSystem:n,cardCategory:a,codeWord:i}=e;return{currencyCode:t?{key:t}:void 0,paymentSystemTypeCd:n,classCard:a,codeWord:i}},Ng=e=>{const{beginDate:t,employment:n,organizationName:a,inn:i,legalForm:r,organization:l,amountWorkers:s,employerActivities:o,employerOrganization:c,generalSeniority:d,lastJobExperience:m,experience5Years:u,jobsNumber:h,organizationPhone:p,organizationAddress:g,positionOrganization:f,partInBusiness:y}=e;return{employmentContractDate:Jt(t||"",!0),employmentTypeCd:n,organizationName:a,organizationInn:i,organizationActivityTypeCd:o?.key?o:void 0,organizationTypeCd:l,organizationKindCd:c,employeesNumberCd:s,opf:r,seniority:d,generalSeniority:u,jobsNumber:h,lastWorkDuration:m,positionCd:f?.key?f:void 0,participantContacts:Nm({organizationPhone:p&&Qt(p)}),participantAddresses:wm({organizationAddress:g}),ownershipShare:"BUSINESS_OWNER"===f?.key?y:void 0}},wg=e=>{const{name:t,surname:n,middleName:a,limitedBirthday:i="",phone:r="",email:l,sex:s,birthPlace:o,dulIssueDate:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g,housing:f,addressRegistration:y,addressFact:x,addressMatch:b}=e;return{birthDate:Jt(i,!0),midname:a,name:t,surname:n,birthPlace:o,dulIssueDate:Jt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h?.replace("-",""),educationLevelCd:p,registrationDate:g?Jt(g,!0):void 0,homeMatchFlg:b,houseTypeCd:f,participantContacts:Nm({phone:Qt(r),email:l}),participantAddresses:wm({addressRegistration:y,addressFact:x}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}},Cg=e=>e?new Date(e).toISOString().split(".")[0]:"",Sg=e=>{const{methodObtain:t,deliveryDate:n="",deliveryTime:a}=e,i="courier"===t,r=a?{deliveryTimeCd:{key:a}}:{};return i?{courierDeliveryFlg:i,deliveryDate:Cg(n.toString().replace(/(GMT)[+-]\d{4}/,"GMT+0000")),office:{id:"3"},...r}:{}},kg=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{office:{id:t.key}}:{}},Ig=(e,t)=>{switch(e){case 0:default:return{};case 1:return wg(t);case 2:return Ng(t);case 3:return Cm(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:a,creditInRshbCd:i}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:a,creditInRshbCd:i}})(t);case 5:return(e=>{const{addressCourier:t,methodObtain:n}=e;return"courier"===n?{participantAddresses:wm({addressCourier:t})}:{}})(t)}},Tg=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=hn(!1),o=5===e,c=so(),d=l((()=>fg(e,c.leadForm,bg)),[e,c.leadForm]),m=r((e=>{const{leadForm:t}=c;o&&e.ok&&t&&(c.statusInfo={regionRetail:t?.regionRetail?.text,addressRetail:t?.addressRetail?.text,deliveryAddress:t?.addressCourier?.fullAddress,cardCategory:t?.cardCategory?.text,deliveryDate:t?.deliveryDate},c.leadForm=d)}),[o,d]),u=r((async a=>{i(),c.leadForm=a;try{const{taskId:i,profileId:r,participantId:l}=c;if(i&&r&&l){const t=await Hd((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{id:t,...kg(a),authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Ig(i,a)}],...vg(a),...Sg(a),files:a?.files}}))({participantId:l,taskId:i,profileId:r,step:e,formData:a}));m(t)}o?n?.():t()}catch(e){}finally{s()}}),[o,m]);return[d,u,a]},Dg=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,onFinish:i})=>{const s=l((()=>t?.flatMap((e=>e?.inputs||[]))),[t]),d=r((t=>pg({formState:t,inputs:s,step:e,productType:"creditCard"})),[s]),[m,u,h]=Tg({step:e,onNextStep:a,onFinish:i}),[,{field:p,onSubmit:g}]=vn(m,{formValidator:d,onSubmit:u});return c("form",{onSubmit:g,className:"space-y-m",children:[ug({sections:t,field:p,step:e}),o(gg,{isSending:h,step:e,onPrevStep:n})]})})),_g=[{title:"Персональные данные",columns:2,inputs:[{name:"surname",required:!0,dadata:!0,filledByEsia:!0},{name:"name",required:!0,dadata:!0,filledByEsia:!0},{name:"middleName",dadata:!0,filledByEsia:!0},{name:"sex",required:!0},{name:"limitedBirthday",required:!0,filledByEsia:!0},{name:"birthPlace",required:!0,filledByEsia:!0},{name:"phone",disabled:!0,required:!0},{name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{name:"dulSerie",required:!0,filledByEsia:!0},{name:"dulNumber",required:!0,filledByEsia:!0},{name:"dulIssueDate",required:!0,filledByEsia:!0},{name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0}]}],Pg=[{title:"Регион обслуживания карты",columns:1,inputs:[]},{inputs:[{name:"regionRetail",required:!0}]},{title:"Способ получения",columns:1,inputs:[],condition:{name:"regionHasDelivery",values:[!0]}},{inputs:[{name:"methodObtain",condition:{name:"regionHasDelivery",values:[!0]}}]},{title:"Выбор офиса",columns:1,inputs:[],condition:{name:"methodObtain",values:["office"]}},{title:"Адрес доставки",columns:1,inputs:[],condition:{name:"methodObtain",values:["courier"]}},{inputs:[{name:"addressCourier",dadata:!0,condition:{name:"methodObtain",values:["courier"]},required:!0}]},{columns:2,inputs:[{name:"deliveryDate",condition:{name:"methodObtain",values:["courier"]},required:!0},{name:"deliveryTime",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{name:"comment",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{name:"addressRetail",required:!0,condition:{name:"methodObtain",values:["office"]}}]}],Eg=[[{title:"Параметры карты",inputs:[]},{inputs:[{name:"currency",required:!0},{name:"paymentSystem",required:!0},{name:"cardCategory",required:!0},{name:"codeWord",required:!0}]}],[..._g,{inputs:[{name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{name:"addressMatch"}]},{columns:2,inputs:[{name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{name:"housing",required:!0}]},{inputs:[{name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{name:"infoCard",label:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{name:"employment",required:!0},{name:"organizationName",required:!0,dadata:!0,filledByEsia:!0}]},{columns:2,inputs:[{name:"inn",required:!0,dadata:!0,filledByEsia:!0},{name:"legalForm",required:!0}]},{inputs:[{name:"organization",required:!0},{name:"amountWorkers",required:!0}]},{columns:2,inputs:[{name:"employerActivities",required:!0},{name:"employerOrganization",required:!0},{name:"generalSeniority",required:!0,filledByEsia:!0},{name:"lastJobExperience",required:!0,filledByEsia:!0},{name:"experience5Years",required:!0,filledByEsia:!0},{name:"jobsNumber",required:!0,filledByEsia:!0}]},{inputs:[{name:"organizationPhone",label:"Телефон работодателя",required:!0},{name:"beginDate",required:!0,filledByEsia:!0}]},{columns:2,inputs:[{name:"positionOrganization",required:!0},{name:"partInBusiness",required:!0,condition:{name:"positionOrganization",values:["BUSINESS_OWNER"]}}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{name:"familyStatus",required:!0}]},{columns:1,inputs:[{name:"children",required:!0}]},{columns:2,inputs:[{name:"dependents",required:!0},{name:"familyMembers"}]},{title:"Совокупный доход"},{columns:1,inputs:[{name:"confirmationIncome",required:!0,filledByEsia:!0}]},{inputs:[{name:"infoCard",label:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{name:"wages",required:!0,filledByEsia:!0}]},{columns:1,inputs:[{name:"retirementIncome",required:!0,condition:{name:"employment",values:["RETIREE"]}}]},{columns:1,inputs:[{name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{name:"snils",required:!0}]},{columns:1,inputs:[{name:"conscription",required:!0}]},{columns:2,inputs:[{name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{name:"bankruptcyFlg"}]},{inputs:[{name:"shareholderFlg"}]},{inputs:[{name:"legalEntityName"}]},{inputs:[{name:"creditInRshbCd"}]}],[...Pg,{inputs:[{name:"infoCard",label:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код",condition:{name:"methodObtain",values:["office"]}},{name:"bankEmployeeCode",condition:{name:"methodObtain",values:["office"]}}]}]],Rg=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],Ag=d((({className:e,...t})=>{const[n,l]=a(0),d=s(null),m=r((()=>d?.current?.scrollIntoView({behavior:"smooth"})),[d]);i(Fp,[]);const u=r((()=>{l((e=>Math.min(e+1,6))),m()}),[]),h=r((()=>{l((e=>Math.max(e-1,0))),m()}),[]),p=Eg[n],[f,{setTrue:y}]=hn(!1);return o(g,{className:e,...t,children:c("div",{ref:d,className:"container grid grid-cols-12",children:[f?null:o(zp,{stepsTitles:Rg,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:f?o(Zp,{}):o(Dg,{step:n,sections:p,onNextStep:u,onPrevStep:h,onFinish:y},String(n))})]})})})),Mg=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const a=l((()=>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(Lp,{step:a,showPercentage:!1})]})})})),Og=d((()=>o(Up,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Bg=d((({onExpire:e})=>{const{statusInfo:t}=so();return o(Up,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Цель кредита",description:"На любые цели"},{label:"Сумма",description:`${t?.calculator?.moneyValue?.toLocaleString()??"0"} ₽`},{label:"Срок кредита",description:`${t?.calculator?.monthsValue??"0"} мес`},{label:"Тип платежа",description:t?.calculator?.isAnnuity?"Аннуитетный":"Дифференцированный"}],onExpire:e})})),Fg=d((()=>{const{statusInfo:e}=so();return o(Up,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Lg=d((()=>{const{statusInfo:e}=so();return o(Up,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получить ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:`от ${e?.calculator?.rate??""}%`},{label:"Ежемесячный платеж",description:`${Math.round(e?.calculator?.monthlyPayment??0).toLocaleString()} ₽`},{label:"Срок кредита",description:e?.calculator?.monthsValue+" мес"},{label:"Тип платежа",description:e?.calculator?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),zg=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],Vg=d((()=>{const[e,t]=a(Vp.process),{taskId:n}=so();i((()=>{(async()=>{for(const e of zg)await jp({signalType:e,taskId:n})})()}),[n]);const l=r((async e=>{const a=await $p({taskId:n});a&&a?.statusCd!==Vp.process&&(e(),t(a.statusCd))}),[n]);Kd(l,3e4);const s=r((()=>t(Vp.rework)),[]);return $g(e,s)})),$g=(e,t)=>({IN_PROCESS:o(Bg,{onExpire:t}),CANCELLED:o(Og,{}),FAILED:o(Og,{}),DRAFT:o(Og,{}),APPROVED:o(Lg,{}),PRE_DECISION:o(Lg,{}),REVISION:o(Fg,{})}[e]||o(Fg,{})),jg=d((({step:e,onPrevStep:t,isSending:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Wr,{version:"secondary",disabled:0===e,onClick:t,children:"Назад"}),o(nl,{isLoading:n,children:a?"Отправить заявку":"Далее"})]})})),qg={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIATED",value:"Дифференцированный "}},Ug=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:a}=e?.calculator??{};return{loanAmount:t,creditPeriod:n,paymentTypeCd:qg[a?"annuity":"differential"]}},Wg=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},Hg=(e,t)=>{switch(e){case 0:return(e=>{const{isInsurance:t,isSalaryClient:n}=e?.calculator??{};return{payrollCardRshbFlg:n,consentInsuranceFlg:t}})(t);case 1:return wg(t);case 2:return Ng(t);case 3:return Cm(t);default:return{}}},Yg=[{calculator:{moneyValue:0,monthsValue:0,monthlyPayment:0,rate:0,isAnnuity:!1,isInsurance:!1,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1}},...xg(!0),{regionRetail:{key:"",text:""},addressRetail:void 0,bankEmployeeCode:void 0}],Gg=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=hn(!1),o=4===e,c=so(),d=l((()=>fg(e,c.leadForm,Yg)),[e,c.leadForm]),m=r((e=>{const{leadForm:t}=c;o&&e.ok&&t&&(c.statusInfo={regionRetail:t?.regionRetail?.text,addressRetail:t?.addressRetail?.text,calculator:{monthsValue:t?.calculator?.monthsValue,moneyValue:t?.calculator?.moneyValue,isAnnuity:t?.calculator?.isAnnuity,monthlyPayment:t?.calculator?.monthlyPayment,rate:t?.calculator?.rate}},c.leadForm=d)}),[o,d]),u=r((async a=>{i(),c.leadForm=a;try{const{taskId:i,profileId:r,participantId:l}=c;if(i&&r&&l){const t=await Hd((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{id:t,authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Hg(i,a)}],...Ug(a),...Wg(a),esiaAccountTypeCd:{key:a?.esiaAccountTypeCd?.key},files:a?.files}}))({participantId:l,taskId:i,profileId:r,step:e,formData:a}));m(t)}o?n?.():t()}catch(e){}finally{s()}}),[o,m]);return[d,u,a]},Kg=d((({step:e,sections:t,programsSource:n,onPrevStep:a,onNextStep:i,onFinish:s})=>{const{programId:d}=so(),m=n?.[d??""],u=l((()=>t?.flatMap((e=>e?.inputs??[]))),[t]),h=r((t=>pg({formState:t,inputs:u,step:e,productType:"credit"})),[u]),[p,g,f]=Gg({step:e,onNextStep:i,onFinish:s}),[,{field:y,onSubmit:x}]=vn(p,{formValidator:h,onSubmit:g});return c("form",{onSubmit:x,className:"space-y-m",children:[ug({sections:t,field:y,step:e,params:{calcData:m}}),o(jg,{step:e,isSending:f,onPrevStep:a})]})})),Xg=[[{columns:1,inputs:[{name:"calculator"}]}],[..._g,{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{name:"addressMatch"}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{inputs:[{name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{name:"infoCard",label:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{name:"employment",required:!0},{name:"organizationName",required:!0,dadata:!0,filledByEsia:!0}]},{columns:2,inputs:[{name:"inn",required:!0,dadata:!0,filledByEsia:!0},{name:"legalForm",required:!0}]},{inputs:[{name:"organization",required:!0},{name:"amountWorkers",required:!0}]},{columns:2,inputs:[{name:"employerOrganization",required:!0},{name:"jobsNumber",required:!0,filledByEsia:!0}]},{inputs:[{name:"organizationPhone",label:"Телефон работодателя",required:!0},{name:"beginDate",required:!0,filledByEsia:!0}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{name:"familyStatus",required:!0}]},{columns:2,inputs:[{name:"children",required:!0},{name:"dependents",required:!0}]},{title:"Совокупный доход"},{columns:1,inputs:[{name:"confirmationIncome",required:!0,filledByEsia:!0}]},{inputs:[{name:"infoCard",label:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{name:"wages",required:!0,filledByEsia:!0}]},{columns:1,inputs:[{name:"retirementIncome",required:!0,condition:{name:"employment",values:["RETIREE"]}}]},{columns:1,inputs:[{name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{name:"snils",required:!0}]},{columns:1,inputs:[{name:"initiateBankruptcyFlg"}]}],[{title:"Отделение Банка",columns:1,inputs:[]},{inputs:[{name:"regionRetail",required:!0}]},{inputs:[{name:"addressRetail",required:!0}]},{title:"Код представителя Банка",columns:1,inputs:[]},{inputs:[{name:"infoCard",label:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код"}]},{inputs:[{name:"bankEmployeeCode"}]}]],Jg=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Отделение Банка"],Qg=Yt((({className:e,programsSource:t,...n})=>{const[l,d]=a(0),m=s(null),u=r((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);i(Fp,[]);const h=r((()=>{d((e=>Math.min(e+1,4))),u()}),[]),p=r((()=>{d((e=>Math.max(e-1,0))),u()}),[]),f=Xg[l],y=0===l,[x,{setTrue:b}]=hn(!1);return o(g,{className:e,...n,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[y||x?null:o(Mg,{stepsTitles:Jg,step:l,totalSteps:4}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:x?o(Vg,{}):o(Kg,{step:l,sections:f,programsSource:t,onNextStep:h,onPrevStep:p,onFinish:b},String(l))})]})})})),Zg=d((({step:e=1,totalSteps:t=2,stepsTitles:n=[]})=>{const a=l((()=>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(Lp,{step:a,showPercentage:!1})]})})})),ef=d((({title:e,description:t,sectionInfo:n,buttonText:a,isDboClient:i,...r})=>c(g,{...r,children:[o("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"})}),o(tf,{items:n}),a?o(ke,{href:"/natural",text:a,version:"primary",className:"w-full mt-lg"}):null,i?c("div",{className:"flex flex-col md:flex-row md:gap-lg",children:[o(ke,{href:"/natural/debetcards",text:"Заполнить заново",version:"primary",className:"w-full mt-lg"}),o(ke,{href:"https://online.rshb.ru/ib6/wf2/retail/ib/loginretaildefault",text:"Перейти в интернет банк",version:"primary",className:"w-full mt-lg"})]}):null]}))),tf=({title:e,items:t})=>t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(ze,{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 gap-m md:grid-cols-2","md:grid-cols-2"),children:t.map(((e,t)=>o("div",{children:nf(e)},t)))}):null]})]}):null,nf=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(ze,{color:"text-secondary-text",size:"text-l",children:e}),o(ze,{color:"text-primary-text",size:"text-xl",children:t})]}),af=d((()=>{const{leadForm:e}=so();return o(ef,{title:`${e?.name} ${e?.middleName},`,description:"Информация о Вас уже есть в системах Банка, обратите внимание на корректность заполнения паспортных данных",sectionInfo:[{label:"Фамилия",description:e?.surname},{label:"Имя",description:e?.name},{label:"Отчество",description:e?.middleName},{label:"Дата рождения",description:Jt(e?.limitedBirthday||"")},{label:"Серия документа",description:e?.dulSerie},{label:"Номер документа",description:e?.dulNumber}],isDboClient:!0})})),rf=d((()=>o(ef,{title:"Время ожидания превышено",description:"Попробуйте отправить заявку позже",buttonText:"Вернуться на главную"}))),lf=d((()=>o(ef,{title:"Подождите немного",description:"Банк проверяет вашу заявку"}))),sf=d((()=>o(ef,{description:"Вы уже являетесь клиентом АО «Россельхозбанк», для Вас оформление зарплатной карты возможно в первый рабочий день",buttonText:"На главную"}))),of=d((({isOffice:e})=>o(ef,{title:"Заявка принята",description:e?"Ваша заявка принята, мы сообщим вам в СМС о поступлении карты в офис":"Вам позвонит сотрудник Банка для уточнения времени и даты доставки",buttonText:"Вернуться на главную"}))),cf=d((()=>{const[e,t]=a(Vp.process),{taskId:n,statusInfo:r,programId:l}=so(),s="38"===l,o="office"===r?.methodObtain;return i((()=>{(async()=>{const e=await jp({signalType:"FIND_PERSON_SIGNAL",taskId:n});o&&await jp({signalType:"SET_PERSON_SIGNAL",taskId:n}),t(e||Vp.notFound)})()}),[n]),df(e,o,s)})),df=(e,t,n)=>({IN_PROCESS:o(lf,{}),NOT_FOUND:o(rf,{}),CLIENT_NOT_OK:o(rf,{}),DBO_CLIENT:o(n?sf:af,{}),PRE_DECISION:o(of,{isOffice:t})}[e]||o(of,{isOffice:t})),mf=d((({step:e,onPrevStep:t,isSending:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Wr,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(nl,{isLoading:n,children:a?"Отправить заявку":"Далее"})]})})),uf=[{regionRetail:{key:"",text:""},regionHasDelivery:!1,addressRetail:{key:"",text:""},addressCourier:{fullAddress:"",fiasCode:""},methodObtain:void 0,deliveryDate:void 0},{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDate:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},addressFact:{fullAddress:"",fiasCode:""}},{paymentSystem:{key:"",text:""},currency:"810",codeWord:"",latinName:"",latinSurname:""}],hf=e=>{const{methodObtain:t,regionRetail:n,comment:a,deliveryDate:i="",deliveryTime:r}=e,l=r?{deliveryTimeCd:{key:r}}:{};return"courier"===t?{cardServiceRegionCd:n,courierDeliveryFlg:!0,deliveryComment:a,deliveryDate:Cg(i.toString().replace(/(GMT)[+-]\d{4}/,"GMT+0000")),office:{id:""},...l}:{}},pf=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{courierDeliveryFlg:!1,office:{id:t.key}}:{}},gf=(e,t)=>{switch(e){case 0:return(e=>{const{addressCourier:t,methodObtain:n}=e;return"courier"===n?{participantAddresses:wm({addressCourier:t})}:{}})(t);case 1:return wg(t);case 2:return(e=>{const{latinName:t,latinSurname:n}=e;return{latinFirstname:t,latinSurname:n,latinName:`${t} ${n}`}})(t);default:return{}}},ff=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=hn(!1),o=2===e,c=so(),d=l((()=>fg(e,c.leadForm,uf)),[e,c.leadForm]),m=r((()=>{const{leadForm:e}=c;c.statusInfo={methodObtain:e?.methodObtain},c.leadForm=d}),[d]),u=r((async a=>{i(),c.leadForm=a;try{const{taskId:i,participantId:l,programId:s}=c;i&&l&&s&&await(r=(({participantId:e,taskId:t,formData:n,programId:a,step:i=0})=>({task:{id:t,creditProgram:{code:yc[a]},...pf(n),participants:[{id:e,...gf(i,n)}],...vg(n),...hf(n)}}))({participantId:l,taskId:i,programId:s,step:e,formData:a}),Ml("/user-data/updateUserTaskDebit","PUT",r)),o||"courier"===a.methodObtain?(n?.(),m()):t()}catch(e){}finally{s()}var r}),[o]);return[d,u,a]},yf=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,onFinish:i})=>{const s=l((()=>t?.flatMap((e=>e?.inputs??[]))),[t]),d=r((t=>pg({formState:t,inputs:s,step:e,productType:"debitCard"})),[s]),[m,u,h]=ff({step:e,onNextStep:a,onFinish:i}),[,{field:p,onSubmit:g}]=vn(m,{formValidator:d,onSubmit:u});return c("form",{onSubmit:g,className:"space-y-m",children:[ug({sections:t,field:p,step:e}),o(mf,{step:e,isSending:h,onPrevStep:n})]})})),xf=[Pg,[..._g,{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{name:"addressMatch"}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{inputs:[{name:"addressFact",required:!0,dadata:!0}]}],[{title:"Параметры карты",inputs:[]},{inputs:[{name:"currency",required:!0},{name:"paymentSystem",required:!0},{name:"cardCategory",required:!0}]},{title:"Отображение на карте",inputs:[]},{columns:2,inputs:[{name:"latinName"},{name:"latinSurname",required:!0}]},{inputs:[{name:"infoCard",label:"Проверьте корректность заполненных полей, при необходимости внесите изменения."}]},{inputs:[{name:"infoCard",label:"Количество символов ограничивается 20. При этом, если фамилия и имя на карте содержит более 21 символа, то необходимо сократить имя и указывать на карте только первую букву имени и фамилию, если при таком сокращении фамилия и имя не умещается в количество символов – 20, то указывать только фамилию."}]},{inputs:[{name:"codeWord",required:!0}]}]],bf=["","Персональные данные","Платежная система"],vf=Yt((({className:e,...t})=>{const[n,l]=a(0),d=s(null),m=r((()=>d?.current?.scrollIntoView({behavior:"smooth"})),[d]);i(Fp,[]);const u=r((()=>{l((e=>Math.min(e+1,2))),m()}),[]),h=r((()=>{l((e=>Math.max(e-1,0))),m()}),[]),p=xf[n],f=0===n,[y,{setTrue:x}]=hn(!1);return o(g,{className:e,...t,children:c("div",{ref:d,className:"container grid grid-cols-12",children:[f||y?null:o(Zg,{stepsTitles:bf,step:n,totalSteps:2}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:y?o(cf,{}):o(yf,{step:n,sections:p,onNextStep:u,onPrevStep:h,onFinish:x},String(n))})]})})})),Nf=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,wf=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),Cf=1e9,Sf={sum:{min:1e4,max:Cf},period:3},kf=Yt((({className:e,filtrationSchema:t={},resetButton:n,sumInput:a,periodInput:i,...r})=>{const[,{blocksToRender:l,blocksWithProps:s},{field:d,reset:m}]=Wu(Sf,{block:r.block,page:r.options?.page,normalize:e=>({...e,period:If(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=Tf(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...r,children:[o(Fu,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(lp,{label:a?.title,min:500,max:Cf,...d("sum",{parse:e=>({min:Number(e),max:Cf}),format:({min:e})=>String(e)})}),o(fa,{title:i?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(Au,{blocksToRender:l,...r})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),If=e=>$t((e?.paramsSource?.rateRows||[]).filter(Nf).flatMap((e=>wf(e.minMonths,e.maxMonths)))),Tf=e=>$t(e.flatMap((e=>e||[])).filter(Nf).flatMap((e=>wf(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],Df=e=>"Image"===e?.contentType&&e?.image?o(ie,{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,_f=d((({className:e="",title:t,description:n,error:a,button:i,...r})=>c(g,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...r,children:[o("div",{className:"flex justify-center",children:Df(a)}),o(S,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),i?.text?o(ke,{version:i?.version,text:i?.text,...i}):null]}))),Pf=d((({className:e="",items:t})=>{const n=xe();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(Ef(n))})})),Ef=e=>({dataFooter:t,...n},a)=>{const{text:i,href:r,target:l,onClick:s}=e(n);return i?o("li",{className:"list-none",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:r,target:l||"_self",onClick:s,...ve(t),children:i||null})},String(a)):null},Rf=e=>t=>!t.displayArea||e.includes(t.displayArea.toLowerCase()),Af=["all","footer"],Mf=d((({className:e,navigationItems:t})=>{const n=xe();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(Rf(Af)).map(n).map(Of)})})),Of=(e,t)=>{const{text:n,items:a=[],href:i,target:r="_self",onClick:l,dataFooter:s}=e,d=a.filter(Rf(Af));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:i,target:r,onClick:l,...ve(s),children:n}),d?o(Pf,{items:d}):null]},String(t))},Bf=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(Ff)}):null)),Ff=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(ze,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(Lf)})]},String(t)),Lf=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:zf(e.type,e.text)}),o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),zf=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Vf(t)}`,children:o(ze,{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})}},Vf=e=>e.replaceAll(/\D/g,""),$f=d((({className:e="",index:t,text:n,...a})=>{const i=xe(),{href:r,target:l,onClick:s}=i(a);return o("a",{className:u("text-secondary-text",e),href:r,target:l,onClick:s,children:n||`Документ ${t}`})})),jf=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(ze,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o($f,{index:t,className:"text-l font-light lg:max-w-72",...e},String(t))))]}):null}))),qf="w-full lg:w-52";function Uf(e,t,n=300){i((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}const Wf=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:n,s1Matches:a,s2Matches:i}=function(e,t){const n=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),a=Array.from({length:e.length}),i=Array.from({length:t.length});let r=0;for(let l=0;l<e.length;l++){const s=Math.max(0,l-n),o=Math.min(l+n,t.length-1);for(let n=s;n<=o;n++)a[l]||i[n]||e[l]!==t[n]||(r++,a[l]=!0,i[n]=!0)}return{m:r,s1Matches:a,s2Matches:i}}(e,t);if(0===n)return 0;const r=function(e,t,{s1Matches:n,s2Matches:a}){let i=0;for(let r=0,l=0;r<e.length;r++){if(!n[r])continue;let s=l;for(;s<t.length;s++)if(a[s]){l=s+1;break}e[r]!==t[s]&&i++}return i}(e,t,{s1Matches:a,s2Matches:i}),l=(n/e.length+n/t.length+(n-r/2)/n)/3,s=l>.7?.1*function(e,t){let n=0;for(;e[n]===t[n]&&n<4;)n++;return n}(e,t):0;return l+s*(1-l)};const Hf=(e,t)=>(n,a)=>{for(const[i,r]of a)n.set(i,e(n.get(i)||t,r));return n},Yf=(e=[])=>e.reduce(((e,t)=>e+t),0),Gf=e=>e.toLowerCase().split(/[^0-9a-zа-я-]+/).filter((e=>e.length>=3&&!/[0-9a-z]/.test(e))),Kf=e=>t=>e.map((([e,n])=>[Wf(t)(e),n])).filter((([e])=>e>=.8)).map((([e,t])=>Jf(t,e))).reduce(Hf(Math.max,0),new Map),Xf=e=>t=>{return $u(t,t.map((({title:e})=>e)).map((e=>t=>{const n=Gf(t||"");return n.length?Yf(e.map((e=>Jo(n.map(Wf(e)))))):0})(e))).sort((e=>(t,n)=>-e(t,n))((n=([,e])=>e,(e,t)=>n(e)-n(t)))).map((([e])=>e));var n},Jf=(e,t)=>new Map(e.map((e=>[e,t]))),Qf=({basePathList:e,initialQuery:t=""})=>{const[n,r]=a(t||""),l=E();i((()=>{null!=t&&r(t)}),[t]);const{data:s}=na(e?.length?e:null,Zf(l)),[o,c]=a(null);return Uf((()=>{s&&c(s.map((e=>t=>{const{corpus:n,dictionary:a}=t||{};if(!(e&&n?.length&&a&&Object.keys(a).length))return[];const i=Gf(e);if(!i.length)return[];const r=Object.entries(a),l=[...i.map(Kf(r)).reduce(Hf(((e,t)=>e+t),0),new Map).entries()].filter((([,e])=>e>=.799*i.length)).map((([e])=>n[e]));return Xf(i)(l)})(n)))}),[s,n]),[o,{value:n,onChange:r}]},Zf=e=>async(...t)=>(await Promise.allSettled(t.map((async e=>[e,await zt(L(e,"search.index.json"))])))).map((e=>"fulfilled"===e.status?e.value:[])).map(ey(e)),ey=e=>([t,n])=>n?{...n,corpus:n.corpus?.map((n=>({...n,uri:"index"===n.uri?t:U(e)(n.uri,t)})))}:{},ty=d((({className:e,value:t,autoFocus:n,onChange:a,onFocus:i,placeholder:l="Поиск по сайту"})=>{const s=r((e=>{a&&a(e.target?.value||"")}),[a]);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(ie,{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",In),value:t,type:"text",name:"search-bar-input",placeholder:l,autoFocus:n,onChange:s,onFocus:i})]})})),ny=d((({initialQuery:e,navigationItems:t,onClose:n})=>{const a=l((()=>t?.map((e=>e.href||"/"))),[t]),[i,r]=Qf({basePathList:a,initialQuery:e}),s=l((()=>ay(t)(i)),[t,i]);return o(Yr,{head:o(ty,{autoFocus:!0,...r}),onClose:n,children:o(Mf,{navigationItems:s})})})),ay=e=>t=>e?.length&&t?.length?$u(e,t).map((([e,t])=>({...e,items:t?.map((({title:e,uri:t})=>({text:e,href:L("/",t)})))}))):[],iy=d((({className:e,search:t,...n})=>{const[i,l]=a(""),s=r((()=>l("")),[]),d=wn(ny,n),m=r((e=>{l(e),ry(e)&&d.open({initialQuery:e,onClose:s})}),[s,d]);return c("div",{className:u("relative",e),role:"search",children:[o(ty,{value:i,placeholder:t?.placeholder,onChange:m}),o(Hr,{className:"absolute top-0 right-0 sm:hidden",onClose:s})]})})),ry=e=>e&&e.length>=3,ly=(e,t)=>{const{logo:n}=e??{},{dataHeader:a,dataFooter:i,...r}=n??{};return c("div",{className:"flex items-stretch gap-3xl",children:[o(nm,{className:qf,logo:r,data:i,showTitle:!1}),o(iy,{className:"grow",navigationItems:t,...e})]})},sy=d((({className:e="",index:t,...n})=>{const a=xe(),{href:i,target:r,text:l,onClick:s}=a(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-72",e),href:i,target:r,onClick:s,children:l||`Документ ${t}`})})),oy=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(ze,{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(sy,{index:t,...e},String(t))))}):null]}))),cy=Yt((({className:e,footer:t,...n})=>{const{navigationItems:a}=n.options?.page?.navigation??{},i=n.options?.page?.common??{},{documents:r,relatedEnterprises:l,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:[ly(i,a),c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(Mf,{navigationItems:a}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u(qf,"flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(Bf,{items:s}),h?o(ke,{className:"w-full",version:"primary",...h}):null,d.map(((e,t)=>o(Ip,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),f.map(((e,t)=>o(il,{className:"text-s font-light",...e},`${e.href}_${t}`)))]})]}),o(jf,{title:m,links:l}),o(oy,{links:r,license:p})]})})),dy=(e=!1)=>e?{}:{padding:"p-0"},my={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},uy=[1,2,3,4],hy={link:{allOf:[{$ref:"#/definitions/LinkCommonProps"},{type:"object",properties:{data:{type:"array",items:{$ref:"#/definitions/AspectsDef"},title:"Дополнительные атрибуты"}}}],title:"Ссылка (если заполнено, то кнопка скрывается)",required:["href"]}},py=Yt((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:r=!0,version:s="transparent",isTheme:c=!1,isCardBorder:d=!1,block:m={},...h})=>{const p=(e=>{const[t,n]=a(e.blocks??[]),r=Ud(),s=r?.offerIds||[],o=l((()=>{const t=new Map(e.blocks?.map((e=>[e?.__id,e]))??[]);return[...s.map((e=>t.get(e))).filter((e=>Boolean(e))),...e.blocks?.filter((({__id:e=""})=>!s.includes(e)))??[]]}),[e,s]);return i((()=>{o.length&&n(o)}),[e]),t})(m);return o(g,{className:u("grid grid-cols-1 sm:grid-cols-1 lg:grid-cols-4 lg:auto-rows-fr",my[n],e),padding:t,version:s,isTheme:c,...h,children:P({...h,block:{...m,blocks:p},renderProps:gy({isInnerPadding:r,isCardBorder:d})})})}),{childrenTypes:["ProductBlock"],childSchema:()=>hy,allowRemoveChild:e=>(e?.blocks??[]).length>5}),gy=({isInnerPadding:e,isCardBorder:t})=>(n,a,i)=>T(n,{...a,blockDecorator:fy(a.blockDecorator,i)},{className:u("w-full",ru(t)),...dy(e)}),fy=(e,t=0)=>(n,a)=>e?.({...n,render:e=>xy(t)({...n,...e},a)},`wrap_${a}`)??xy(t)(n,a),yy=e=>Number(e)<5?"":"hidden",xy=e=>({blockClassName:t,block:n,render:a},i)=>{const r=((e,t)=>{const n={...e.content};return uy.includes(t)?(delete n.description,delete n.benefits,n.link?.href&&delete n.buttons,n.imageOptions={...n.imageOptions,className:"max-w-max !h-auto"},n.headlineVersion="S"):((n.buttons??[]).length&&delete n.link,n.headlineVersion="L"),{...e,content:n}})(n,e);return o(Sp,{...r.content?.link,className:u(yy(e),(l=e,uy.includes(l)?"lg:col-span-1 lg:row-span-1":"lg:col-span-2 lg:row-span-2")),children:a({blockClassName:u(t,"h-full"),block:r})},String(i));var l},by=Yt((({className:e,title:t,button:n,regionSource:i,data:r,...l})=>{const[s,d]=a({key:""}),m=i?.regions??[],h=m?.find((e=>e.name===s.key))?.href;return o(g,{className:e,defaultPadding:"p-6xl",...l,children:c("div",{className:"container space-y-m",children:[t?o(N,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(Hn,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:m.map((({name:e=""})=>({key:e,text:e}))),value:s,onChange:d}):null,h?o("div",{className:"text-center",children:o(il,{className:u("w-full @xl:w-auto"),href:h,target:"_blank",version:n?.version??"primary",data:Bm(r,s?.key),children:n?.text?n.text:"Перейти"})}):null]})})}));function vy(e=[]){const t=E(),n=Array.from(e.entries()).filter((([,e])=>Ny(t)(e)));return n.find((([,e])=>Ny(t,!0)(e)))??n[n.length-1]??[]}const Ny=(e,t=!1)=>({href:n})=>{if(!n)return!1;const a=F(wy(e)(n));return t?a===F(n):a.startsWith(F(n))},wy=e=>t=>{const n=Q(J.SITE_URL);return M(t)?globalThis?.location?.href:L(n,e.pathname)},Cy={default:"w-6 h-6",medium:"w-10 h-10",large:"w-12 h-12"},Sy=d((({className:e,isRounded:t,buttonSize:n="default",isGrayBg:a=!1,disabled:i,ariaLabel:r="Меню второго уровня",image:l,data:s,onClick:c,version:d,isLoading:m,dataTestId:h=""})=>o("button",{className:u("group/btn border-0 flex shrink-0 items-center",a?"p-s rounded-full":"p-0 bg-inherit","transparent"===d?"backdrop-opacity-30 bg-white/30":a&&!t?"bg-main-divider":"",t?"w-8 h-8 text-secondary-light hover:text-secondary-hove":`${Cy[n]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:i,"aria-label":r,onClick:c,...ky(h),...ve(s),children:m?o("div",{className:"w-full h-full rounded-full border-4 border-r-transparent animate-spin text-primary-main"}):o(ie,{image:l,className:u("h-full",{"bg-main-divider/20 rounded-full":t}),imageClassName:"group-hover/btn:text-primary-hover group-hover/btn:invert-0"})}))),ky=e=>e?{"data-test-id":e}:null,Iy=d((({iconVersion:e,className:t,ariaLabel:n="Чат",version:a,buttonSize:i="large"})=>{const[l,{setTrue:s,setFalse:c}]=hn(!1),d=un(),m=r((e=>{const t=d.openChatBot;t&&(s(),t(e).finally(c))}),[]);return o(Sy,{className:t,image:{icon:"ChatBotIcon",iconVersion:e},ariaLabel:n,onClick:m,buttonSize:i,isGrayBg:!0,version:a,isLoading:l,disabled:l,dataTestId:"chat icon"})})),Ty=({dropdownRef:e,items:t=[],activeItem:n,ariaLabel:a})=>o("div",{ref:e,className:"absolute flex flex-col rounded-md bg-white p-xl pb-xs w-56 z-40","aria-label":a,children:_y(t,n)}),Dy=d((({isActive:e,...t})=>{const n=xe(),{text:a,href:i,target:r,onClick:l}=n(t);return o("a",{className:u("text-l font-light pb-m hover:text-primary-main",{"text-primary-main":e}),href:i,target:r,onClick:l,role:"link",...ve(t?.data),children:a})})),_y=(e,t)=>e?.map(((e,n)=>o(Dy,{isActive:e===t,...e},e?.text??String(n))));function Py({items:e,activeItem:t,onClose:n,isOpen:a}){const l=Mn();i((()=>{a&&l.close()}),[a]);const c=r((()=>{l.close(),n?.()}),[n]),d=s(null),m=An(c);return i((()=>{if(!a||!d.current||!e?.length)return;const n=d.current,{top:i,left:r,width:s,height:c}=n.getBoundingClientRect();l.open({popup:o(Ty,{dropdownRef:m,items:e,activeItem:t}),top:i+window.scrollY+c,left:r,width:s})}),[a,e,c]),d}const Ey=d((({className:e="",items:t,activeItem:n,ariaLabel:a="Меню"})=>{const[r,{setFalse:l,toggle:s}]=hn(!1),c=Py({items:t,onClose:l,isOpen:r,activeItem:n});return i((()=>(c.current?.addEventListener("mouseleave",l),()=>{c.current?.removeEventListener("mouseleave",l)})),[]),o("div",{className:u(r?"rounded-md shadow-blue-gray":"",e),ref:c,role:"navigation",children:o("button",{type:"button",className:"group/btn flex justify-between items-center h-6","aria-label":a,onClick:s,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))))})})})),Ry=d((({className:e="",active:t,dataItemName:n,children:a,data:i,...r})=>{const l=xe(),{href:s,target:d,text:m,onClick:h}=l(r);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,...ve(i),children:[o("span",{className:Ay(t),children:m||a}),t?o("div",{className:"absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-white"}):null]})})),Ay=(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"),My=d((({observerOptions:e,onVisibilityChange:t,children:n,className:a,items:l,activeItem:s,...c})=>{const[d,{setFalse:m,setTrue:u}]=hn(!1),h=ou(r((e=>{if(!e.length||!t)return;const n=e[e.length-1];t(n.isIntersecting)}),[t]),e),p=Py({items:l,onClose:m,isOpen:d,activeItem:s});return i((()=>(p.current?.addEventListener("mouseenter",u),p.current?.addEventListener("mouseleave",m),()=>{p.current?.addEventListener("mouseenter",u),p.current?.removeEventListener("mouseleave",m)})),[]),o("div",{className:"inline-block",ref:p,children:o("span",{ref:h,className:a,role:"menuitem",children:o(Ry,{...c,children:n})})})})),Oy={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"},By=d((({version:e,text:t,mobileText:n,...a})=>{const i=_e()?n:t;return i?o(ke,{className:u("py-s px-lg font-light whitespace-nowrap",Oy["transparent"===e?"transparent":"default"]),...a,children:i}):null})),Fy=d((({subItems:e=[],version:t,internetBankButton:n,dropdownMenuAriaLabel:i,chatBotAriaLabel:r})=>{const d="transparent"===t?"white":"black",[,m]=vy(e),[u,h]=a(e.length),p=e.slice(u),g=s(null),f={rootRef:g},y=l((()=>e.map(((e,t)=>e=>{h(e?Ly(t):zy(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(My,{className:u-1<t?"invisible":"",active:e===m,activeItem:m,observerOptions:f,onVisibilityChange:y[t],data:e.dataHeader,...e},String(t))))}),p.length?o(Ey,{items:p,activeItem:m,ariaLabel:i}):null,A.CHAT_BOT?o(Iy,{version:t,iconVersion:d,ariaLabel:r}):null,o(By,{version:t,...n})]})})),Ly=e=>t=>Math.max(t,e+1),zy=e=>t=>Math.min(t,e),Vy=`${Zt}/region`;function $y(e="Москва"){return lo().location??{name:e}}function jy(e="Москва"){const t=lo(),n=r((async()=>{if(!t.location){const n=await zt(Vy);t.location=n??{name:e}}}),[t,e]);return na(Vy,n),t}const qy=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(ze,{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(Uy,{...e},String(t))))})]}):null,Uy=d((({icon:e,...t})=>{const n=xe(),{text:a,target:i,href:r,onClick:l}=n(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ie,{image:e}):null,a?o("a",{className:"hover:text-primary-hover",href:r,target:i,onClick:l,children:o(ze,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})}):null]})})),Wy=(e,t)=>n=>n.name?o(Sp,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:Bm(e,n.name),children:o(ze,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,Hy=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(In,"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"})]}))),Yy=d((({defaultLocation:e})=>{const t=$y(e),n=xe(),{href:a}=n({href:`/branches/${t.slug}`});return t?o("div",{className:"mb-s",children:c(w,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(Sp,{href:a,className:"inline mx-2xs text-primary-main",children:t.name})]})}):null})),Gy=d((({foreignOffices:e,branches:t,onClose:n})=>{const i=jy(t?.default),[s,d]=a(""),m=tr(),u=l((()=>Xy(m).sort(((e,t)=>e.name.localeCompare(t.name)))),[m]),h=l((()=>((e,t)=>{const n=new Map;for(const a of e){const e=t(a),i=n.get(e)||[];n.set(e,[...i,a])}return n})(u,Ky)),[u]),p=r((e=>{i.location=e,n?.()}),[i,n]);return c(Yr,{className:"pb-20",head:c("div",{children:[o(ze,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),o(Yy,{defaultLocation:t?.default}),o(Hy,{onSearch:d,searchTerm:s})]}),onClose:n,children:[s&&s.length>=3?o("div",{children:u.filter((({name:e})=>e&&Wf(e.toLowerCase())(s.toLowerCase())>=.8)).map(Wy(t?.dataSelect,p))}):o("div",{className:"columns-1 sm:columns-3 md:columns-4 lg:columns-5",children:Array.from(h.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(ze,{size:"text-h6",children:e})}),t.map(Wy(f,g))]},e)))}),qy(e)]});var g,f})),Ky=e=>e.name?.charAt(0)??"",Xy=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()??""}))),Jy=d((({className:e="",active:t,flat:n,children:a,data:i,...r})=>{const l=xe(),{href:s,target:c,text:d,onClick:m}=l(r);return o("a",{className:u(Qy(t,n),e),href:s,target:c,onClick:m,rel:"noopener noreferrer","aria-label":`Ссылка на ${d}`,...ve(i),children:o("span",{suppressHydrationWarning:!0,className:Zy(t,n),children:d||a})})})),Qy=(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}),Zy=(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"),ex=d((({className:e,version:t,...n})=>{const a="transparent"===t?"white":"black",i=$y(n?.branches?.default),l=wn(ny,n),s=wn(Gy,n),d=r((()=>l.open({})),[l]),m=r((()=>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:[i?.name&&n?.branches?.visible?o(Jy,{className:"whitespace-nowrap text-ellipsis overflow-hidden",flat:!0,href:"#",text:i?.name,data:Bm(n?.branches?.dataClick,i?.name??""),onClick:m}):null,n?.officesAtms?.href?o(Jy,{className:"whitespace-nowrap",flat:!0,...n.officesAtms}):null,o(Sy,{image:{icon:"LoupeIcon",iconVersion:a},ariaLabel:n?.search?.ariaLabel??"Поиск",onClick:d,data:n?.search?.data})]})})),tx=d((({observerOptions:e,onVisibilityChange:t,children:n,className:a,...i})=>{const l=ou(r((e=>{if(!e.length||!t)return;const n=e[e.length-1];t(n.isIntersecting)}),[t]),e);return o("span",{ref:l,className:a,role:"menuitem",children:o(Jy,{...i,children:n})})})),nx=d((({navigationItems:e=[],activeTopItem:t,dropdownMenuAriaLabel:n,version:i,headerData:r,search:d,bgColor:m,logo:u})=>{const[h,p]=a(e.length),g=e.slice(h),f=s(null),y={rootRef:f},x=l((()=>e.map(((e,t)=>e=>{p(e?ax(t):ix(t))}))),[e]),{dataFooter:b,dataHeader:v,...N}=u??{};return c("div",{className:"flex items-center justify-between",children:[o(nm,{className:"mr-3xl",bgColor:m,logo:N,data:v,showTitle:!1}),o("div",{ref:f,className:"overflow-hidden min-w-40 pb-xs mt-xs",role:"menu",children:e.map(((e,n)=>o(tx,{className:h-1<n?"invisible":"",active:e===t,observerOptions:y,onVisibilityChange:x[n],data:e.dataHeader,...e},String(n))))}),g.length?o(Ey,{className:"mx-xs rounded-md shadow-blue-gray",items:g,activeItem:t,ariaLabel:n}):null,o(ex,{version:i,className:"ml-auto",search:d,navigationItems:e,...r})]})})),ax=e=>t=>Math.max(t,e+1),ix=e=>t=>Math.min(t,e),rx={"bg-white":"primary",transparent:"transparent"},lx=["all","header"],sx=Yt((({className:e,bgColor:t="bg-white",logo:n={},version:a=rx[t],portal:i,header:r={},...l})=>{const{common:s,navigation:d}=cx(l?.options?.page),{navigationItems:m}=d,{logo:h={}}=s,[,p]=vy(m),{internetBankButton:f}=i||{},y=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:a,...l,children:c("div",{className:"container",children:[o("div",{className:"whitespace-nowrap",children:o(nx,{activeTopItem:p,navigationItems:m?.filter(Rf(lx)),version:a,headerData:{...r,...d},search:s.search,bgColor:t,logo:y})}),o("div",{className:u("mt-s h-px bg-main-divider",ox(a))}),p?.items?.length&&o(Fy,{subItems:p?.items?.filter(Rf(lx)),version:a,internetBankButton:f})]})})})),ox=e=>"transparent"===e?"opacity-30":"",cx=e=>({navigation:e?.navigation??{},common:e?.common??{}}),dx=Yt((({className:e="",padding:t="p-0",gap:n="XS",isInnerPadding:a=!0,version:i="transparent",isTheme:r=!1,isCardBorder:l,...s})=>o(g,{className:u("relative","grid grid-cols-12",my[n],e),padding:t,version:i,isTheme:r,...s,children:P({...s,extraProps:{...dy(a),className:ru(l)}})})),{childrenTypes:{exclude:["HorizontalLayout"]}}),mx=d((e=>{const{className:t,align:n,image:a,...i}=e,r=n?u("flex",rh[n]):"";return o(g,{className:u(r,t),defaultPadding:"p-0",...i,children:o(ie,{image:a})})})),ux=["байт","Кб","Мб","Гб","Тб","Пб"],hx=d((({icon:e,text:t,href:n,target:a,fileFormat:i,data:r,fileSize:l})=>{const s=l&&i?",":"",d=l??"",m=i?String(i):"";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:a,...ve(r),children:[e,t?c(ze,{size:"text-l",font:"font-light",children:[t," ",px(d,m),o(ze,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),px=(e,t)=>e||t?o("span",{children:", "}):"",gx=(e,t)=>(n,a)=>{const i=U(e)("Attachment"===n?.docType?n?.attachment?.src:n?.href),r="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))} ${ux[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,l="Attachment"===n?.docType?yx(i):n?.fileFormat;return c("div",{role:"listitem",children:[o(hx,{text:n?.text,target:n?.target,href:i,fileFormat:l,fileSize:r,icon:fx(t),data:n?.data}),o(Fe,{__html:n?.__html})]},String(a))},fx=e=>e?o(ie,{className:"min-w-6 min-h-6",image:e,width:"24",height:"24"}):null,yx=e=>{if(!e)return"";const t=e.lastIndexOf("."),n=new RegExp(/\/(.*)/),a=-1!==t?e.substring(t+1):"";return a.includes("/")?a.replace(n,""):a},xx=d((({href:e,__html:t,target:n,onClose:a})=>c(Yr,{className:"my-6xl min-h-fit w-fit mx-auto",onClose:a,children:[t?o(Fe,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(il,{href:e,target:n,version:"primary",ariaLabel:"Ссылка на согласие",onClick:a,children:"Я согласен"}),o(Wr,{type:"button",version:"secondary",onClick:a,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]}))),bx=d((({text:e,href:t,target:n,__html:a,icon:i})=>{const{open:l}=wn(xx),s=r((()=>l({__html:a,href:t,target:n})),[a,t,n]);return e?c("button",{className:"flex gap-s text-primary-text no-underline hover:text-primary-main",onClick:s,children:[fx(i),o(ze,{font:"font-light",children:e})]}):null})),vx={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},Nx=Yt((({className:e="",title:t,description:n,align:a="text-center",documents:i,icon:r={icon:"DocIcon"},columnsMode:l="double",...s})=>{const d=E();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(S,{title:t,description:n,align:a,headlineVersion:"M",as:"h2",isEmbedded:!0}),i?.length?o("div",{className:u("grid gap-xl","double"===l?"@md:grid-cols-2":"grid-cols-1",vx[l]),role:"list",children:i.map(wx(d,r))}):null]})})),wx=(e,t)=>(n,a)=>{const i=n?.docType;return""===i?null:"reportSource"in n&&n?.reportSource?.__html?Cx(t)(n,a):gx(e,t)(n,a)},Cx=e=>(t,n)=>{const a={text:t.text,target:t.target,__html:t.reportSource?.__html};return t.reportSource?.__html&&t.text?c("div",{role:"listitem",children:[o(bx,{...a,icon:e,href:Sx(t)?t?.href:t?.attachment?.src}),o(Fe,{__html:t?.__html})]},String(n)):null},Sx=e=>"href"in e,kx=Yt((({className:e,padding:t,align:n="text-left",buttons:a=[],description:i,image:r,__html:l,headingType:s,qr:d,additionalDescription:m="",title:h="Мобильное приложение",version:p="primary",...f})=>{const y="secondary"===p?"p-m min-w-32":"min-w-24",x=r?.src?o(ie,{className:"hidden lg:block",image:r}):null;return o(g,{className:u("min-h-80",e),padding:"p-0",version:p,...f,children:c(Re,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(N,{headingType:s,title:h,className:u("whitespace-pre-wrap",n)}),rightImage:x,buttons:Ye(a,{className:"flex-wrap"}),children:[i?o(ze,{size:"text-xl","font-weight":"font-light",children:i}):null,c("div",{className:u("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[l?o(Fe,{__html:l,itemSize:"list-m"}):null,o(ze,{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",y),children:o(ie,{className:"w-fit",image:d})}):null,r?.src?o(ie,{className:"lg:hidden",image:r}):null]})]})})})),Ix="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",Tx=d((({filters:e,field:{field:t,reset:n},onlyOffice:a,labels:i})=>{const r=a?5:6,l=(e||[]).map((e=>o(wi,{text:i[e],...t(e)},e))),[s,d]=r>0?[l.slice(0,r),l.slice(r)]:[l,[]],[m,{toggle:u}]=hn(!1);return o("div",{children:e?.length?o("div",{children:c(es,{children:[c("div",{children:[o("div",{className:Ix,children:s}),o(ts,{className:Ix,isUnfolded:m,children:d})]}),c("div",{className:"flex space-x-lg",children:[a?o(Zl,{label:m?"Меньше фильтров":"Больше фильтров",isUnfolded:m,embedded:!0,short:!0,onClick:u}):null,c(Wr,{embedded:!0,onClick:n,children:[o(Jl,{children:"Очистить фильтр"}),o(G,{name:"CloseIcon",size:"small"})]})]})]})}):null})})),Dx=(e,t)=>e&&"underlined"!==t?"primary":"secondary",_x=(e,t,n)=>{const a=Dx("all"===t),i=Dx("business"===t),r=(e,t,a)=>{const i=e.currentTarget===e.target&&"business"===t?l(a):a;return n(t),i},l=e=>e.filter((e=>e.workSchedule&&e.workSchedule.businessScheduleVisibleTag&&!e.workSchedule.businessScheduleDescription));return c("div",{className:"flex gap-lg flex-col sm:flex-row",children:[o(Wr,{"data-id":"all",onClick:t=>r(t,"all",e),version:a,children:"Для физических лиц"}),o(Wr,{"data-id":"business",onClick:t=>r(t,"business",e),version:i,children:"Для юридических лиц"})]})},Px=({__html:e,list:t,richVersion:n})=>e||t?.length?c("div",{className:"border-b sm:border border-main-divider rounded-md space-y-2xl",children:[e?o(Fe,{__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(Ex)}):null]}):null,Ex=(e,t)=>c("div",{className:"flex gap-xs items-center",children:[o(ie,{image:e.image}),e?.text?o(ze,{size:"text-m",font:"font-light",children:e.text}):null]},String(t)),Rx=(e,t)=>e?o("div",{className:"flex flex-row gap-xs",children:c(N,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(ze,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}):null,Ax=()=>{},Mx=e=>"all"===e?"block":"hidden",Ox=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:i=[],renderCard:r=Ax,renderRemoteWorkplaceCard:l=Ax,getBalloon:s=Ax,initFilterState:d=Ss,getBalloonRemoteWorkplaces:m=Ax,descriptionData:h,title:p})=>{const g=p?.includes("Офис"),[f,{field:y,reset:x}]=vn(d),{filteredItems:b,points:v,filteredRemoteWorkplaces:N,lengthItems:w}=_s({data:t,remoteWorkplaces:i,filtrationState:f,getBalloon:s,getBalloonRemoteWorkplaces:m}),[C,S]=a("all");return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0 grid gap-xl",children:[Rx(p,w),h?Px(h):null,g&&_x(t,C,S),o("div",{className:u("pb-3xl",Mx(C)),children:o(Tx,{filters:Bx([...t,...i]),field:{field:y,reset:x},onlyOffice:g,labels:ks})})]}),o("div",{className:"h-[600px]",children:o(Es,{children:o(Ws,{points:v,isLoad:n,className:"h-full"})})})]}),c(Es,{children:[b.map(r),N.map(l)]})]})})),Bx=e=>Object.keys(Ss).filter((t=>e.filter((e=>Is[t](e))).length)),Fx=e=>e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:"",Lx=({location:e,address:t,billAcceptorType:n,terminalType:a,billAcceptorEnable:i,atmCode:r="",atmAccess:l="",workTime:s},d)=>{const m=[{label:"Устройство",value:Fx(a)},{label:"Модуль приема наличных",value:i?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(l)?"Общедоступный":""},{label:"Регистрационный номер",value:r}];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(ze,{size:"text-h4",children:Fx(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(G,{name:"GeolocationIcon",width:"24",height:"24"}),o(ze,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(hs,{color:"green",children:Fx(s)})})]}),o(ns,{children:o(Xl,{className:"flex-wrap",children:m?.map(((e,t)=>o(Hl,{...e},String(t))))})})]},String(d))},zx=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${Fx(t)} №${n}`,body:e.toUpperCase()}),Vx=[];const $x=async e=>{const t=await zt(e,{method:"GET"});return Array.isArray(t)?t:Vx},jx={terminalTypeTerm:!1,terminalTypeAtms:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},qx=d((({descriptionData:e,className:t})=>{const n=$y(),a=n?.code??"000",{data:i,isLoad:r}=function(e){const{data:t,error:n}=na(`${Zt}/atms?regionCode=${e}`,$x);return{data:t||Vx,isLoad:!t&&!n}}(a);return o(Ox,{className:t,data:i,isLoad:r,initFilterState:jx,renderCard:Lx,getBalloon:zx,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),Ux=({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(ze,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(G,{name:"GeolocationIcon",width:"24",height:"24"}),o(ze,{size:"text-l",children:e})]}):null]})}),o(ns,{children:Wx(t)})]},String(n)):null,Wx=e=>c("div",{children:[c(Xl,{className:"flex",children:[o(Hl,{label:"Операции для физических лиц",children:o(ze,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(Hl,{label:"Операции для физических лиц",children:o(ze,{children:"Оформление и обслуживание банковских карт"})}),o(Hl,{label:"Операции для физических лиц",children:o(ze,{children:"Инвестиционное и накопительное страхование"})}),o(Hl,{label:"Операции для физических лиц",children:o(ze,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(Hl,{label:"Режим работы",className:"max-w-none",children:o(ze,{children:e})})]}),Hx=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),Yx={branches:[],remoteWorkplaces:[]};const Gx=async e=>await zt(e,{method:"GET"})||Yx,Kx=d((({className:e})=>{const t=$y(),n=t?.code??"000",{data:a,isLoad:i}=function(e="000"){const{data:t,error:n}=na(`${Zt}/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,Gx);return{data:t||Yx,isLoad:!t&&!n}}(n);return o(Ox,{className:e,data:a?.branches,isLoad:i,remoteWorkplaces:a?.remoteWorkplaces,renderCard:Ns,renderRemoteWorkplaceCard:Ux,getBalloon:Cs,getBalloonRemoteWorkplaces:Hx,title:`Офисы филиала ${t?.name}`})})),Xx=d((({data:e,className:t,...n})=>{const a=e?.dataType??"offices";return o(g,{version:"transparent",className:u(t),defaultPadding:"p-0",...n,children:"offices"===a?o(Kx,{}):o(qx,{descriptionData:e})})})),Jx=d((e=>{const{__html:t,richVersion:n="",...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(Fe,{__html:t,richVersion:n})})})),Qx=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",Zx=Yt((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,foldButtonVersion:a="default",label:i,version:r,role:l,...s})=>{const d=_e(),[m,{toggle:h}]=hn(t),p=o(ts,{className:u("gap-lg",Qx(d)),isUnfolded:m,children:P({...s,extraProps:{className:"w-full",padding:"p-0"}})}),f="accordion"===a,y=o(Zl,{className:u(f?"text-h6 my-lg":"text-h4"),label:i,isUnfolded:m,embedded:f,onClick:h});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:l,...s,children:c(es,{children:[n?y:p,n?p:y]})})}),{childrenTypes:{exclude:["RollupItem"]}}),eb=e=>e<4?"w-72":"w-52",tb={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"},nb=d((({buttons:e,className:t="",description:n,showLines:a=!0,steps:i=[],stepVersion:r="gray",title:l,version:s="primary",...d})=>{const m=i.length>3,h=tb,p=(e=>e?"":"opacity-0")(a),f=_e();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:l,description:n,isEmbedded:!0,className:"w-full",align:Xu(f)}),i?.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:Ou(o("div",{className:u("h-0.5 w-full bg-secondary-light flex-1",p)}))(i.map(ab(h,m,r)))}),o("div",{className:u("flex justify-between",m?"gap-x-s":"gap-x-20"),children:i.map((y={styleMap:h,version:s},(e,t,n)=>{const{styleMap:a,version:i}=y,{label:r,description:l,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",eb(n.length)),children:[c("div",{className:"space-y-xs",children:[r?o(ze,{size:"text-h6",align:"text-center",children:r}):null,c("div",{className:"flex flex-col items-center gap-3xs",children:[l?o("div",{className:a.description,children:l}):null,o(Fe,{__html:e.__html,itemSize:"list-s",isDotted:d})]})]}),s?.text?o(ke,{className:"box-border py-s w-full mt-auto",version:i,...s,children:s?.text}):null]},String(t))}))})]}):null,Ye(e)]});var y})),ab=(e,t,n)=>({icon:a},i)=>{const r="secondary"===n?"white":"color";return o(g,{defaultPadding:"",className:`${ib(t)} flex justify-center items-center text-center rounded-full box-border z-10`,version:n,children:He(a)?o(ie,{image:{...a,iconVersion:a?.iconVersion||r},width:"48",height:"48"}):o("span",{className:u("text-h4","transparent"===n?e.iconText:(l=n,"secondary"===l?"group-data-primary:text-white":"text-secondary-text")),children:i+1})},String(i));var l},ib=e=>e?"h-16 w-16":"h-24 w-24",rb=d((()=>o("div",{className:"hidden",role:"none"}))),lb={primary:"bg-white/30",secondary:"bg-main-divider"},sb={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},ob=d((({count:e,version:t="secondary"})=>{const n=_e(),a=n?"bg-main-divider":lb[t],i=sb[t][n?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",a),role:"status","aria-label":`Количество ${e} доступных программ и сервисов`,children:o(ze,{size:"text-xs",color:i,children:e})})})),cb=({text:e,description:t,icon:n,isActive:a,type:i})=>{const r=(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"}))(a);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(ie,{className:u("h-6 w-6 min-w-6 min-h-6",r.icon),image:{...n,iconVersion:n?.iconVersion??r.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===i?r.text:r.oldText,children:e}),o("div",{className:"animated"===i?r.desc:r.oldDesc,children:t})]})]})},db={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},mb={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},ub={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},hb={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},pb=d((({tag:e="div",item:t={},isActive:n=!1,type:a="default",onClick:i})=>{const r=e,{text:l,description:s,icon:d,count:m,tabName:h,...p}=t;return o(r,{className:u("h-12","block flex-1","cursor-pointer",db[a],n?hb[a]:ub[a]),"aria-label":"Список табов",onClick:i,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?mb[a]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${l}`,children:[cb({text:l,description:s,icon:d,isActive:n,type:a}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o(ob,{count:m,version:Dx(n,a)})}):null]})})})),gb=d((e=>o(e?.item?.href?fb:yb,{...e}))),fb=d((e=>{const t=xe(),n=r((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:a,...i}=t({...e.item,onClick:n});return o(pb,{...e,tag:"a",item:i,onClick:a})})),yb=d((({item:e={},onClick:t,...n})=>{const a=r((n=>{n.target.scrollIntoView({block:"nearest"}),t?.(e)}),[t,e]);return o(pb,{item:e,onClick:a,...n})})),xb="hidden sm:flex absolute z-40",bb={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},vb=d((({className:e,items:t=[],activeItem:n,onChange:a,tabsType:r="default"})=>{const[l,s]=vu({itemCount:t?.length||0});return i((()=>Nb(l.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(uu,{containerRef:l,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:bb[r].item,gap:bb[r].gap,children:t.map((d=n,m=a,h=r,(e,t)=>o(gb,{isActive:e===d,onClick:m,type:h,item:e},String(t))))}),s.canScrollLeft?o(ku,{wcmsIgnore:!0,className:u("left-6",xb,bb[r].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(Iu,{wcmsIgnore:!0,className:u("right-6",xb,bb[r].buttonTop),onClick:s.scrollRight}):null]});var d,m,h})),Nb=(e,t,n)=>{const a=t.findIndex((e=>e===n));e&&a>0&&e.scrollTo({left:e?.children[a]?.offsetLeft,behavior:"smooth"})},wb={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},Cb=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(wb[t].wrapper,e),children:o(vb,{className:wb[t].component,tabsType:t,...n})}):null,Sb="sticky top-1 z-20",kb=Yt((({className:e="",tabs:t=[],block:n,tabsType:i,showCounter:l=!1,isSticky:s=!1,...d})=>{const m=Tb(n||{}),h=E(),p=t.every((e=>"link"===e?.type)),f=new URLSearchParams(decodeURIComponent(globalThis?.location?.search||"")),y=Pb(m),x=l?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,b=x.findIndex((e=>Boolean(e?.selected))),v=x.findIndex(((e,t)=>"group"===e.type&&(e?.tabName??String(t))===y)),N=y?v:b,[w,C]=a(Ib(N)),S=x[w],k=_b(x[w],w),I=r((e=>{const t=x.indexOf(e),n=x[t];C(t),"group"===n.type&&((e,t)=>{e.text?f.set(m,e?.tabName??String(t)):f.delete(m),h.replace(`${h.pathname}?${f}`,{scroll:!1})})(e,t)}),[x]);return c(g,{className:u({[Sb]:[s,p].every(Boolean)},e),defaultPadding:"p-0",block:n,...d,children:[Cb({className:u({"pb-1":[n?.slots,"default"===i].every(Boolean),[Sb]:[s,!p].every(Boolean)}),items:Db(t,x),activeItem:S,tabsType:i,onChange:I}),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])=>_(t,{...d?.options,slotName:k,parent:n,extraProps:{className:e===k?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(_b)?.filter(Boolean)||[]}),Ib=e=>e&&-1!==e?e:0,Tb=({__id:e,anchor:t})=>t??e??"tabs",Db=(e,t)=>t?.length?t:e,_b=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",Pb=e=>decodeURIComponent(globalThis?.location?.search.replace("?","").replace("+"," ").split("&").find((t=>t.split("=").find((t=>t===e))))?.split("=")?.[1]??""),Eb=({title:e,icon:t})=>c("div",{className:u("flex gap-m items-center","w-80 flex-shrink-0 sticky left-0 bg-white"),role:"cell",children:[t?o(ie,{className:"hidden lg:block max-w-6 shrink-0",image:t,width:"24",height:"24"}):null,e?o(ze,{size:"text-m",font:"font-light",color:"text-primary-text",children:e}):null]}),Rb={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},Ab=d((({children:e,version:t="comparison"})=>o("div",{className:"flex flex-1",children:o("div",{className:Rb[t],children:e})}))),Mb=d((({className:e="",isOpen:t,onClick:n})=>o(Zl,{className:e,label:t?"Скрыть":"Показать",isUnfolded:t,version:"secondary",short:!0,onClick:n}))),Ob=e=>e?o("div",{children:o(ze,{size:"text-h6",children:e})}):null,Bb=e=>e?o("div",{className:"text-l font-light",children:o(ze,{color:"text-secondary-text",children:e})}):null,Fb=({__html:e,isDotted:t})=>e?o("div",{className:"flex flex-col justify-between items-start text-h6",children:o(Fe,{__html:e,isDotted:t,itemSize:"list-m"})}):null,Lb=d((({cells:e,tableInner:t,onSetTable:n})=>o("div",{className:"w-80 flex-grow flex flex-col gap-lg",role:"cell",children:e?.length?e.map(((e,a)=>e?.tableSource?.tableData?o(Mb,{className:"w-fit",isOpen:Boolean(t),onClick:()=>{n(t?void 0:{tableSource:e.tableSource})}},String(a)):(({label:e,description:t,__html:n,isDotted:a,buttons:i,image:r},l)=>c("div",{className:"grid gap-xs",children:[Ob(e),Bb(t),Fb({__html:n,isDotted:a}),Ye(i,{buttonClassName:"basis-0"}),r?.src?o(ie,{image:r}):null]},String(l)))(e,a))):null}))),zb=({className:e,btnClass:t,canDec:n,canInc:a,dec:i,inc:r})=>n||a?c("div",{children:[n?o(ku,{wcmsIgnore:!0,className:u("absolute z-40",t[0],e),onClick:i}):null,a?o(Iu,{wcmsIgnore:!0,className:u("absolute z-40",t[1],e),onClick:r}):null]}):null,Vb=(e,t)=>140*Yf(e.slice(0,t).map((e=>e?.cols?.length??1))),$b=(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(ze,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,jb=d((({rows:e})=>{const t=e?.[0]?.length??0,[n,i]=((e,t=0)=>{const{itemCount:n,visibleItemCount:i}=e,[l,s]=a(t),o=r((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=r((()=>s((e=>Math.max(e-1,0)))),[n]),d=i?n>i&&l<n-i:l<n-1,m=l>0;return[l,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]})({itemCount:t,visibleItemCount:5});return c("div",{children:[e?.map((l=n,(e,t)=>{if(!e?.length)return null;const[n,...a]=e,i=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 min-w-48 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0",children:o(ze,{size:"text-xl",font:"font-light",children:n.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:i,style:{transform:`translateX(-${Vb(a,l)}px)`},children:a?.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(ze,{size:"text-xl",children:e.data}):null,e?.cols?$b(e.cols,l):null]},`row${t}`)))})})]},String(t))})),zb({...i,btnClass:["left-3 top-20","right-3 top-20"],className:""})]});var l})),qb=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,n)=>{const a=`activeTabIdx:${e}-tableIdx:${n}`;return c("div",{className:"w-full @container",children:[o("div",{className:"flex py-m px-m bg-white @4xl:bg-gray relative",children:o(ze,{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(jb,{rows:t.rowsData})})})]},a)}))}))),Ub=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Wb=d((({currencies:e,linkToPDF:t,activeTabIndex:n,setActiveTabIndex:a})=>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:()=>a(t),children:o(ze,{size:"text-xl",font:"font-light",color:Ub(t===n),children:e||t+1})},e)))}):null,t?o(ke,{className:"text-primary-main",href:t,version:"secondary",target:"_blank",appendLeft:o(G,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),Hb=Yt((({tableSource:e})=>{const t=e?.tableData,[n,i]=a(0),l=r((e=>i(e)),[]),s=t?.[n]?.items??[],d=t?.map((e=>e.currency??""));return t?c("div",{className:"bg-white z-10",children:[o(Wb,{currencies:d,activeTabIndex:n,setActiveTabIndex:l}),o(qb,{activeTabIndex:n,items:s})]}):o("div",{className:"space-y-m text-center",children:o(ze,{size:"text-h6",children:"Данных нет"})})})),Yb=d((({children:e,tableInner:t,onClick:n})=>c("div",{className:u("self-start flex flex-col gap-xl","border-main-divider lg:border-b w-full py-s lg:py-xl"),role:"row",children:[o("div",{className:u("flex flex-col lg:flex-row gap-x-5xl gap-y-xs"),children:e}),t?o("div",{className:"origin-top animate-expansion",children:o(Hb,{...t,onClick:n})}):null]}))),Gb=d((({row:{header:e,data:t=[]},...n})=>{const[i,l]=a(void 0),s=r((e=>{l(e)}),[]);return c(Yb,{tableInner:i,...n,children:[Eb(e),t?.length?o(Ab,{version:"tariff",children:t.map(((e,t)=>o(Lb,{cells:e,onSetTable:s,tableInner:i,...n},String(t))))}):null]})})),Kb=d((({children:e})=>o("div",{role:"table",className:"overflow-x-auto w-auto grid relative gap-y-xs",children:e}))),Xb=Yt((({className:e="",title:t,description:n,rowHeaders:a,tariffsColumns:i,hiddenRowsNum:r=0,...l})=>{const s=i?.map((({data:e})=>e))||[],d=a?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),m=(d||[]).map(((e,t)=>o(Gb,{row:e,...l},String(t)))),[h,p]=r>0?[m.slice(0,-r),m.slice(-r)]:[m,[]],[f,{toggle:y}]=hn(!1);return c(g,{className:u("relative space-y-xl",e),defaultPadding:"p-6xl",...l,children:[o(S,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:r>0?c(es,{children:[c(Kb,{children:[h,o(ts,{isUnfolded:f,isOverflowVisible:!0,children:p})]}),o(Zl,{className:"text-h4",isUnfolded:f,onClick:y})]}):o(Kb,{children:m})})]})})),Jb=d((({className:e="",title:t,description:n,iconVersion:a,__html:i,richVersion:r,...l})=>c(g,{className:u("flex gap-s sm:gap-m group-data-secondary:bg-primary-main/10",e),...l,children:["small"===a?Qb():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(ze,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?Zb(n):null,i?o(Fe,{richVersion:r,__html:i}):null]})]}))),Qb=()=>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"}),Zb=e=>o(w,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),ev=Yt((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:a=!0,version:i="transparent",isTheme:r=!1,isCardBorder:l=!1,image:s,...c})=>{const d=E();return o(g,{className:u("relative flex flex-col",my[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${Z(d)(s?.src)})`}}:{},padding:t,version:i,isTheme:r,...c,children:P({...c,extraProps:{className:u("w-full",ru(l)),...dy(a)}})})}),{childrenTypes:[]}),tv=e=>(e=>{const t="col-span-",n=e?.split(/\s+/).find((e=>e.startsWith(t)));return n?parseInt(n.substring(9),10):12})(e)<10?"py-xl px-6xl":"py-6xl px-32",nv=d((({className:e,title:t,url:n,previewImg:a,...i})=>{const r=E();return c(g,{className:e,defaultPadding:tv(e),...i,children:[o(S,{title:t,headlineVersion:"M"}),n?o("video",{className:"m-auto w-full object-fill",preload:"metadata",poster:U(r)(a?.src),style:{maxHeight:524},controls:!0,children:o("source",{src:U(r)(n)})}):null]})})),av={AdTile:Kt,ApplicationForm:cl,BankAccountFiltration:Gu,BenefitsBlock:Zu,BonusBenefitsBlock:ih,ButtonsBlock:lh,CalculatorBonus:hh,CalculatorBusinessDeposit:Ch,CalculatorCredit:cc,CalculatorDeposit:Hh,CalculatorRefinancing:np,CardTransfer:mp,Carousel:bp,CarouselCatalogCard:wp,CarouselRecommendationCard:_p,CarouselTariffsCard:Ap,ContactsBlock:Mp,DepositFiltration:kf,ErrorBlock:_f,Footer:cy,GalleryLayout:py,GrantSupport:by,Header:sx,Headline:S,HorizontalLayout:dx,ImgBlock:mx,LinkDocs:Nx,MobileAppTile:kx,OfficesAtmsMap:Xx,ProductBlock:Gt,RichTextBlock:Jx,RollupItem:Zx,StepsBlock:nb,StickyBottomMenu:rb,TabsLayout:kb,TariffsTable:Xb,TextBlock:Jb,VerticalLayout:ev,Video:nv,ApplicationLeadForm:Qm,CreditCardForm:Ag,CreditForm:Qg,DebitForm:vf},iv=me((()=>{i((()=>{dn()}),[]);const e=un();Rn(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const a=JSON.parse(n?.dataset?.aspects??"[]");sn({aspectsAttributes:a,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))})),rv="cookie",lv=d((({__html:e})=>{const[t,{setTrue:n,setFalse:a}]=hn();Uf((()=>{globalThis.localStorage?.getItem(rv)||n()}),[],3e3);const i=r((()=>{globalThis.localStorage?.setItem(rv,"true"),a()}),[]);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(Fe,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(Hr,{className:"bg-main-gray rounded-md w-11 h-11",onClose:i})})]})}):null}));function sv(e){const t=r((({key:t})=>{"Escape"===t&&e()}),[e]);Rn(globalThis.document,"keydown",t)}function ov(e,t,n){i((()=>e.subscribe(t,(e=>{const t=e?.type;if(t&&"string"==typeof t){const a=n[t];a&&a(e)}}))),[e,t,...Object.values(n)])}const cv=()=>{const[e,{push:t,pop:n,clear:i}]=function(e=[]){const[t,n]=a(e),i=r((e=>n((t=>[...t,e]))),[]),l=r((()=>n((e=>e.slice(0,-1)))),[]),s=r((e=>n((t=>t.filter((t=>t!==e))))),[]),o=r((()=>n([])),[]);return[t,{setList:n,push:i,pop:l,remove:s,clear:o}]}();return ov(pe.observable,"dialog",{open:t,close:n,closeAll:i}),[e,{close:n,closeAll:i}]},dv=d((()=>{const[e,{close:t}]=cv(),n=Boolean(e.length);return sv(t),i((()=>{n?globalThis.document?.body.classList.add("no-scrollbar","overflow-hidden"):globalThis.document?.body.classList.remove("no-scrollbar","overflow-hidden")}),[n]),n?o("div",{className:"fixed inset-0 z-50",children:e.map((({dialog:t,id:n},a)=>o("div",{className:u("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar bg-black/50",{hidden:a!==e.length-1}),children:t},String(n||a))))}):null})),mv=d((()=>{const[e,t]=a(null),n=r((()=>{t(null)}),[]);return ov(pe.observable,"popup",{open:t,close:n}),sv(n),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",title:"Всплывающее окно",children:e.popup}):null})),uv="header",hv="footer",pv="sticky-footer",gv={},fv=d((({className:e,data:t=gv,blocksRegistry:n,blockDecorator:a})=>{const{slots:i,blocks:r,fallback:l,...s}=t,d=Wt(s,l);iv(),jy();const m={key:"",page:{slots:i,blocks:r,fallback:l,...d},blocksRegistry:n,blockDecorator:a,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:u("@container relative",t.style,e),children:[i?.[uv]?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:_(i?.[uv],{...m,slotName:uv})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[P({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),_(i?.[hv],{...m,slotName:hv})]})]}),i?.[pv]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:_(i?.[pv],{...m,slotName:pv})}):null,o(dv,{}),o(mv,{}),o(lv,{__html:d?.cookieContent?.__html})]})}));Object.assign(fv,{childrenTypes:[],slots:()=>[uv,hv,pv]});e.Blocks=av,e.ContentPage=fv,e.handlerDecorator=me,e.joinList=Ou,e.locationNavigator=on,e.packageVersion="0.14.877",e.projectSettings=A,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=V,e.useRouter=E,Object.defineProperty(e,"__esModule",{value:!0})}));