@redneckz/wildless-cms-uni-blocks 0.14.824 → 0.14.826

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 (475) hide show
  1. package/bundle/bundle.umd.js +233 -254
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  4. package/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  5. package/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  6. package/bundle/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  7. package/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  8. package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  9. package/bundle/retail/api/checkCode.d.ts +0 -1
  10. package/{dist/retail/api/esiaRequestProfile.d.ts → bundle/retail/api/updateProfileEsia.d.ts} +4 -11
  11. package/bundle/retail/api/updateUserTask.d.ts +0 -1
  12. package/bundle/retail/api/uploadFile.d.ts +1 -1
  13. package/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  14. package/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  15. package/bundle/retail/inputs.d.ts +5 -1
  16. package/bundle/retail/model/NameFieldDef.d.ts +1 -1
  17. package/bundle/retail/validator/getRetailFormValidator.d.ts +11 -0
  18. package/bundle/retail/validator/validators.d.ts +2 -0
  19. package/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  20. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  21. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +8 -26
  22. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  23. package/dist/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  24. package/dist/components/ApplicationLeadForm/applicationFormData.js +31 -6
  25. package/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  26. package/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  27. package/dist/components/ApplicationLeadForm/getInitialFormState.js +2 -8
  28. package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  29. package/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  30. package/dist/components/ApplicationLeadForm/parseEsiaProfile.js +53 -83
  31. package/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  32. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  33. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +22 -12
  34. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  35. package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  36. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +24 -16
  37. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  38. package/dist/components/CreditCardForm/CreditCardFormStep.js +7 -11
  39. package/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
  40. package/dist/components/CreditForm/CreditFormStep.js +7 -11
  41. package/dist/components/CreditForm/CreditFormStep.js.map +1 -1
  42. package/dist/components/DebitForm/DebitFormStep.js +7 -11
  43. package/dist/components/DebitForm/DebitFormStep.js.map +1 -1
  44. package/dist/retail/api/checkCode.d.ts +0 -1
  45. package/dist/retail/api/checkCode.js +2 -3
  46. package/dist/retail/api/checkCode.js.map +1 -1
  47. package/{bundle/retail/api/esiaRequestProfile.d.ts → dist/retail/api/updateProfileEsia.d.ts} +4 -11
  48. package/dist/retail/api/updateProfileEsia.js +6 -0
  49. package/dist/retail/api/updateProfileEsia.js.map +1 -0
  50. package/dist/retail/api/updateUserTask.d.ts +0 -1
  51. package/dist/retail/api/updateUserTask.js.map +1 -1
  52. package/dist/retail/api/uploadFile.d.ts +1 -1
  53. package/dist/retail/api/uploadFile.js +3 -2
  54. package/dist/retail/api/uploadFile.js.map +1 -1
  55. package/dist/retail/components/DraftDialog/parseDraftTask.js +1 -2
  56. package/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  57. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  58. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +34 -0
  59. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
  60. package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  61. package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +15 -0
  62. package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
  63. package/dist/retail/components/Fields/BeginDateField.js +1 -2
  64. package/dist/retail/components/Fields/BeginDateField.js.map +1 -1
  65. package/dist/retail/components/Fields/ConfirmationIncomeField.js +1 -4
  66. package/dist/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  67. package/dist/retail/components/Fields/DaDataInnField.js +1 -2
  68. package/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
  69. package/dist/retail/components/Fields/DulIssueDateField.js +1 -1
  70. package/dist/retail/components/Fields/DulIssueDateField.js.map +1 -1
  71. package/dist/retail/components/Fields/Experience5YearsField.js +1 -2
  72. package/dist/retail/components/Fields/Experience5YearsField.js.map +1 -1
  73. package/dist/retail/components/Fields/GeneralSeniorityField.js +1 -2
  74. package/dist/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  75. package/dist/retail/components/Fields/JobsNumberField.js +1 -2
  76. package/dist/retail/components/Fields/JobsNumberField.js.map +1 -1
  77. package/dist/retail/components/Fields/LastJobExperienceField.js +1 -2
  78. package/dist/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  79. package/dist/retail/components/Fields/OrganizationNameField.js +1 -2
  80. package/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
  81. package/dist/retail/components/Fields/WagesField.js +1 -2
  82. package/dist/retail/components/Fields/WagesField.js.map +1 -1
  83. package/dist/retail/content.js +5 -11
  84. package/dist/retail/content.js.map +1 -1
  85. package/dist/retail/inputs.d.ts +5 -1
  86. package/dist/retail/inputs.js +1 -1
  87. package/dist/retail/inputs.js.map +1 -1
  88. package/dist/retail/model/NameFieldDef.d.ts +1 -1
  89. package/dist/retail/utils/mainFormStateMap.js +0 -1
  90. package/dist/retail/utils/mainFormStateMap.js.map +1 -1
  91. package/dist/retail/validator/getRetailFormValidator.d.ts +11 -0
  92. package/dist/retail/validator/getRetailFormValidator.js +14 -0
  93. package/dist/retail/validator/getRetailFormValidator.js.map +1 -0
  94. package/dist/retail/validator/validatorObj.js +1 -2
  95. package/dist/retail/validator/validatorObj.js.map +1 -1
  96. package/dist/retail/validator/validators.d.ts +2 -0
  97. package/dist/retail/validator/validators.js +11 -1
  98. package/dist/retail/validator/validators.js.map +1 -1
  99. package/dist/ui-kit/FormField/Fields/PhoneField.js +1 -2
  100. package/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  101. package/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  102. package/dist/ui-kit/FormField/shouldRenderField.js +1 -1
  103. package/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
  104. package/lib/common.css +1 -1
  105. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  106. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +8 -26
  107. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  108. package/lib/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  109. package/lib/components/ApplicationLeadForm/applicationFormData.js +30 -5
  110. package/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  111. package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  112. package/lib/components/ApplicationLeadForm/getInitialFormState.js +2 -8
  113. package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  114. package/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  115. package/lib/components/ApplicationLeadForm/parseEsiaProfile.js +53 -83
  116. package/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  117. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  118. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +22 -12
  119. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  120. package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  121. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +24 -16
  122. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  123. package/lib/components/CreditCardForm/CreditCardFormStep.js +7 -11
  124. package/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
  125. package/lib/components/CreditForm/CreditFormStep.js +7 -11
  126. package/lib/components/CreditForm/CreditFormStep.js.map +1 -1
  127. package/lib/components/DebitForm/DebitFormStep.js +7 -11
  128. package/lib/components/DebitForm/DebitFormStep.js.map +1 -1
  129. package/lib/retail/api/checkCode.d.ts +0 -1
  130. package/lib/retail/api/checkCode.js +1 -1
  131. package/lib/retail/api/checkCode.js.map +1 -1
  132. package/lib/retail/api/{esiaRequestProfile.d.ts → updateProfileEsia.d.ts} +4 -11
  133. package/lib/retail/api/updateProfileEsia.js +3 -0
  134. package/lib/retail/api/updateProfileEsia.js.map +1 -0
  135. package/lib/retail/api/updateUserTask.d.ts +0 -1
  136. package/lib/retail/api/updateUserTask.js.map +1 -1
  137. package/lib/retail/api/uploadFile.d.ts +1 -1
  138. package/lib/retail/api/uploadFile.js +3 -2
  139. package/lib/retail/api/uploadFile.js.map +1 -1
  140. package/lib/retail/components/DraftDialog/parseDraftTask.js +1 -2
  141. package/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  142. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  143. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.d.ts +5 -0
  144. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +32 -0
  145. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
  146. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  147. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +12 -0
  148. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
  149. package/lib/retail/components/Fields/BeginDateField.js +1 -2
  150. package/lib/retail/components/Fields/BeginDateField.js.map +1 -1
  151. package/lib/retail/components/Fields/ConfirmationIncomeField.js +2 -5
  152. package/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  153. package/lib/retail/components/Fields/DaDataInnField.js +1 -2
  154. package/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
  155. package/lib/retail/components/Fields/DulIssueDateField.js +1 -1
  156. package/lib/retail/components/Fields/DulIssueDateField.js.map +1 -1
  157. package/lib/retail/components/Fields/Experience5YearsField.js +1 -2
  158. package/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
  159. package/lib/retail/components/Fields/GeneralSeniorityField.js +1 -2
  160. package/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  161. package/lib/retail/components/Fields/JobsNumberField.js +1 -2
  162. package/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
  163. package/lib/retail/components/Fields/LastJobExperienceField.js +1 -2
  164. package/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  165. package/lib/retail/components/Fields/OrganizationNameField.js +1 -2
  166. package/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
  167. package/lib/retail/components/Fields/WagesField.js +1 -2
  168. package/lib/retail/components/Fields/WagesField.js.map +1 -1
  169. package/lib/retail/content.js +5 -11
  170. package/lib/retail/content.js.map +1 -1
  171. package/lib/retail/inputs.d.ts +5 -1
  172. package/lib/retail/inputs.js +1 -1
  173. package/lib/retail/inputs.js.map +1 -1
  174. package/lib/retail/model/NameFieldDef.d.ts +1 -1
  175. package/lib/retail/utils/mainFormStateMap.js +0 -1
  176. package/lib/retail/utils/mainFormStateMap.js.map +1 -1
  177. package/lib/retail/validator/getRetailFormValidator.d.ts +11 -0
  178. package/lib/retail/validator/getRetailFormValidator.js +11 -0
  179. package/lib/retail/validator/getRetailFormValidator.js.map +1 -0
  180. package/lib/retail/validator/validatorObj.js +2 -3
  181. package/lib/retail/validator/validatorObj.js.map +1 -1
  182. package/lib/retail/validator/validators.d.ts +2 -0
  183. package/lib/retail/validator/validators.js +8 -0
  184. package/lib/retail/validator/validators.js.map +1 -1
  185. package/lib/ui-kit/FormField/Fields/PhoneField.js +1 -2
  186. package/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  187. package/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  188. package/lib/ui-kit/FormField/shouldRenderField.js +1 -1
  189. package/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
  190. package/mobile/bundle/bundle.umd.js +227 -247
  191. package/mobile/bundle/bundle.umd.min.js +1 -1
  192. package/mobile/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  193. package/mobile/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  194. package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  195. package/mobile/bundle/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  196. package/mobile/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  197. package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  198. package/mobile/bundle/retail/api/checkCode.d.ts +0 -1
  199. package/mobile/bundle/retail/api/{esiaRequestProfile.d.ts → updateProfileEsia.d.ts} +4 -11
  200. package/mobile/bundle/retail/api/updateUserTask.d.ts +0 -1
  201. package/mobile/bundle/retail/api/uploadFile.d.ts +1 -1
  202. package/mobile/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  203. package/mobile/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  204. package/mobile/bundle/retail/inputs.d.ts +5 -1
  205. package/mobile/bundle/retail/model/NameFieldDef.d.ts +1 -1
  206. package/mobile/bundle/retail/validator/getRetailFormValidator.d.ts +11 -0
  207. package/mobile/bundle/retail/validator/validators.d.ts +2 -0
  208. package/mobile/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  209. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  210. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +8 -26
  211. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  212. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  213. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js +31 -6
  214. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  215. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  216. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js +2 -8
  217. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  218. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  219. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js +53 -83
  220. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  221. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  222. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +22 -12
  223. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  224. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  225. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +24 -16
  226. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  227. package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js +7 -11
  228. package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
  229. package/mobile/dist/components/CreditForm/CreditFormStep.js +7 -11
  230. package/mobile/dist/components/CreditForm/CreditFormStep.js.map +1 -1
  231. package/mobile/dist/components/DebitForm/DebitFormStep.js +7 -11
  232. package/mobile/dist/components/DebitForm/DebitFormStep.js.map +1 -1
  233. package/mobile/dist/retail/api/checkCode.d.ts +0 -1
  234. package/mobile/dist/retail/api/checkCode.js +2 -3
  235. package/mobile/dist/retail/api/checkCode.js.map +1 -1
  236. package/mobile/dist/retail/api/updateProfileEsia.d.ts +77 -0
  237. package/mobile/dist/retail/api/updateProfileEsia.js +6 -0
  238. package/mobile/dist/retail/api/updateProfileEsia.js.map +1 -0
  239. package/mobile/dist/retail/api/updateUserTask.d.ts +0 -1
  240. package/mobile/dist/retail/api/updateUserTask.js.map +1 -1
  241. package/mobile/dist/retail/api/uploadFile.d.ts +1 -1
  242. package/mobile/dist/retail/api/uploadFile.js +3 -2
  243. package/mobile/dist/retail/api/uploadFile.js.map +1 -1
  244. package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js +1 -2
  245. package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  246. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  247. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +34 -0
  248. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
  249. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  250. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +15 -0
  251. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
  252. package/mobile/dist/retail/components/Fields/BeginDateField.js +1 -2
  253. package/mobile/dist/retail/components/Fields/BeginDateField.js.map +1 -1
  254. package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js +1 -4
  255. package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  256. package/mobile/dist/retail/components/Fields/DaDataInnField.js +1 -2
  257. package/mobile/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
  258. package/mobile/dist/retail/components/Fields/DulIssueDateField.js +1 -1
  259. package/mobile/dist/retail/components/Fields/DulIssueDateField.js.map +1 -1
  260. package/mobile/dist/retail/components/Fields/Experience5YearsField.js +1 -2
  261. package/mobile/dist/retail/components/Fields/Experience5YearsField.js.map +1 -1
  262. package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js +1 -2
  263. package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  264. package/mobile/dist/retail/components/Fields/JobsNumberField.js +1 -2
  265. package/mobile/dist/retail/components/Fields/JobsNumberField.js.map +1 -1
  266. package/mobile/dist/retail/components/Fields/LastJobExperienceField.js +1 -2
  267. package/mobile/dist/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  268. package/mobile/dist/retail/components/Fields/OrganizationNameField.js +1 -2
  269. package/mobile/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
  270. package/mobile/dist/retail/components/Fields/WagesField.js +1 -2
  271. package/mobile/dist/retail/components/Fields/WagesField.js.map +1 -1
  272. package/mobile/dist/retail/content.js +5 -11
  273. package/mobile/dist/retail/content.js.map +1 -1
  274. package/mobile/dist/retail/inputs.d.ts +5 -1
  275. package/mobile/dist/retail/inputs.js +1 -1
  276. package/mobile/dist/retail/inputs.js.map +1 -1
  277. package/mobile/dist/retail/model/NameFieldDef.d.ts +1 -1
  278. package/mobile/dist/retail/utils/mainFormStateMap.js +0 -1
  279. package/mobile/dist/retail/utils/mainFormStateMap.js.map +1 -1
  280. package/mobile/dist/retail/validator/getRetailFormValidator.d.ts +11 -0
  281. package/mobile/dist/retail/validator/getRetailFormValidator.js +14 -0
  282. package/mobile/dist/retail/validator/getRetailFormValidator.js.map +1 -0
  283. package/mobile/dist/retail/validator/validatorObj.js +1 -2
  284. package/mobile/dist/retail/validator/validatorObj.js.map +1 -1
  285. package/mobile/dist/retail/validator/validators.d.ts +2 -0
  286. package/mobile/dist/retail/validator/validators.js +11 -1
  287. package/mobile/dist/retail/validator/validators.js.map +1 -1
  288. package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js +1 -2
  289. package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  290. package/mobile/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  291. package/mobile/dist/ui-kit/FormField/shouldRenderField.js +1 -1
  292. package/mobile/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
  293. package/mobile/lib/common.css +1 -1
  294. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +0 -5
  295. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +8 -26
  296. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  297. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.d.ts +1 -0
  298. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js +30 -5
  299. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  300. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  301. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js +2 -8
  302. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  303. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  304. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js +53 -83
  305. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  306. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +2 -1
  307. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +22 -12
  308. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  309. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  310. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +24 -16
  311. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  312. package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js +7 -11
  313. package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
  314. package/mobile/lib/components/CreditForm/CreditFormStep.js +7 -11
  315. package/mobile/lib/components/CreditForm/CreditFormStep.js.map +1 -1
  316. package/mobile/lib/components/DebitForm/DebitFormStep.js +7 -11
  317. package/mobile/lib/components/DebitForm/DebitFormStep.js.map +1 -1
  318. package/mobile/lib/retail/api/checkCode.d.ts +0 -1
  319. package/mobile/lib/retail/api/checkCode.js +1 -1
  320. package/mobile/lib/retail/api/checkCode.js.map +1 -1
  321. package/mobile/lib/retail/api/updateProfileEsia.d.ts +77 -0
  322. package/mobile/lib/retail/api/updateProfileEsia.js +3 -0
  323. package/mobile/lib/retail/api/updateProfileEsia.js.map +1 -0
  324. package/mobile/lib/retail/api/updateUserTask.d.ts +0 -1
  325. package/mobile/lib/retail/api/updateUserTask.js.map +1 -1
  326. package/mobile/lib/retail/api/uploadFile.d.ts +1 -1
  327. package/mobile/lib/retail/api/uploadFile.js +3 -2
  328. package/mobile/lib/retail/api/uploadFile.js.map +1 -1
  329. package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js +1 -2
  330. package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  331. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +4 -0
  332. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +32 -0
  333. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -0
  334. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +1 -0
  335. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +12 -0
  336. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +1 -0
  337. package/mobile/lib/retail/components/Fields/BeginDateField.js +1 -2
  338. package/mobile/lib/retail/components/Fields/BeginDateField.js.map +1 -1
  339. package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js +2 -5
  340. package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  341. package/mobile/lib/retail/components/Fields/DaDataInnField.js +1 -2
  342. package/mobile/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
  343. package/mobile/lib/retail/components/Fields/DulIssueDateField.js +1 -1
  344. package/mobile/lib/retail/components/Fields/DulIssueDateField.js.map +1 -1
  345. package/mobile/lib/retail/components/Fields/Experience5YearsField.js +1 -2
  346. package/mobile/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
  347. package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js +1 -2
  348. package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  349. package/mobile/lib/retail/components/Fields/JobsNumberField.js +1 -2
  350. package/mobile/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
  351. package/mobile/lib/retail/components/Fields/LastJobExperienceField.js +1 -2
  352. package/mobile/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  353. package/mobile/lib/retail/components/Fields/OrganizationNameField.js +1 -2
  354. package/mobile/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
  355. package/mobile/lib/retail/components/Fields/WagesField.js +1 -2
  356. package/mobile/lib/retail/components/Fields/WagesField.js.map +1 -1
  357. package/mobile/lib/retail/content.js +5 -11
  358. package/mobile/lib/retail/content.js.map +1 -1
  359. package/mobile/lib/retail/inputs.d.ts +5 -1
  360. package/mobile/lib/retail/inputs.js +1 -1
  361. package/mobile/lib/retail/inputs.js.map +1 -1
  362. package/mobile/lib/retail/model/NameFieldDef.d.ts +1 -1
  363. package/mobile/lib/retail/utils/mainFormStateMap.js +0 -1
  364. package/mobile/lib/retail/utils/mainFormStateMap.js.map +1 -1
  365. package/mobile/lib/retail/validator/getRetailFormValidator.d.ts +11 -0
  366. package/mobile/lib/retail/validator/getRetailFormValidator.js +11 -0
  367. package/mobile/lib/retail/validator/getRetailFormValidator.js.map +1 -0
  368. package/mobile/lib/retail/validator/validatorObj.js +2 -3
  369. package/mobile/lib/retail/validator/validatorObj.js.map +1 -1
  370. package/mobile/lib/retail/validator/validators.d.ts +2 -0
  371. package/mobile/lib/retail/validator/validators.js +8 -0
  372. package/mobile/lib/retail/validator/validators.js.map +1 -1
  373. package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js +1 -2
  374. package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  375. package/mobile/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  376. package/mobile/lib/ui-kit/FormField/shouldRenderField.js +1 -1
  377. package/mobile/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
  378. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +10 -31
  379. package/mobile/src/components/ApplicationLeadForm/applicationFormData.tsx +31 -5
  380. package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -8
  381. package/mobile/src/components/ApplicationLeadForm/parseEsiaProfile.ts +66 -91
  382. package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +73 -57
  383. package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +48 -32
  384. package/mobile/src/components/CreditCardForm/CreditCardFormStep.tsx +7 -14
  385. package/mobile/src/components/CreditForm/CreditFormStep.tsx +7 -14
  386. package/mobile/src/components/DebitForm/DebitFormStep.tsx +7 -14
  387. package/mobile/src/retail/api/checkCode.ts +1 -1
  388. package/mobile/src/retail/api/{esiaRequestProfile.ts → updateProfileEsia.ts} +5 -16
  389. package/mobile/src/retail/api/updateUserTask.ts +0 -1
  390. package/mobile/src/retail/api/uploadFile.ts +3 -2
  391. package/mobile/src/retail/components/DraftDialog/parseDraftTask.ts +0 -2
  392. package/mobile/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +65 -0
  393. package/mobile/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +13 -0
  394. package/mobile/src/retail/components/Fields/BeginDateField.tsx +0 -2
  395. package/mobile/src/retail/components/Fields/ConfirmationIncomeField.tsx +7 -18
  396. package/mobile/src/retail/components/Fields/DaDataInnField.tsx +0 -2
  397. package/mobile/src/retail/components/Fields/DulIssueDateField.tsx +1 -1
  398. package/mobile/src/retail/components/Fields/Experience5YearsField.tsx +0 -2
  399. package/mobile/src/retail/components/Fields/GeneralSeniorityField.tsx +0 -2
  400. package/mobile/src/retail/components/Fields/JobsNumberField.tsx +0 -2
  401. package/mobile/src/retail/components/Fields/LastJobExperienceField.tsx +0 -2
  402. package/mobile/src/retail/components/Fields/OrganizationNameField.tsx +0 -2
  403. package/mobile/src/retail/components/Fields/WagesField.tsx +0 -2
  404. package/mobile/src/retail/content.tsx +5 -11
  405. package/mobile/src/retail/inputs.tsx +1 -1
  406. package/mobile/src/retail/model/NameFieldDef.ts +0 -1
  407. package/mobile/src/retail/utils/mainFormStateMap.ts +0 -1
  408. package/mobile/src/retail/validator/getRetailFormValidator.ts +27 -0
  409. package/mobile/src/retail/validator/validatorObj.ts +2 -2
  410. package/mobile/src/retail/validator/validators.ts +19 -0
  411. package/mobile/src/ui-kit/FormField/Fields/PhoneField.tsx +1 -9
  412. package/mobile/src/ui-kit/FormField/shouldRenderField.tsx +1 -2
  413. package/package.json +1 -1
  414. package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +10 -31
  415. package/src/components/ApplicationLeadForm/applicationFormData.tsx +31 -5
  416. package/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -8
  417. package/src/components/ApplicationLeadForm/parseEsiaProfile.ts +66 -91
  418. package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +73 -57
  419. package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +48 -32
  420. package/src/components/CreditCardForm/CreditCardFormStep.tsx +7 -14
  421. package/src/components/CreditForm/CreditFormStep.tsx +7 -14
  422. package/src/components/DebitForm/DebitFormStep.tsx +7 -14
  423. package/src/retail/api/checkCode.ts +1 -1
  424. package/src/retail/api/{esiaRequestProfile.ts → updateProfileEsia.ts} +5 -16
  425. package/src/retail/api/updateUserTask.ts +0 -1
  426. package/src/retail/api/uploadFile.ts +3 -2
  427. package/src/retail/components/DraftDialog/parseDraftTask.ts +0 -2
  428. package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.tsx +7 -0
  429. package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +65 -0
  430. package/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +13 -0
  431. package/src/retail/components/Fields/BeginDateField.tsx +0 -2
  432. package/src/retail/components/Fields/ConfirmationIncomeField.tsx +7 -18
  433. package/src/retail/components/Fields/DaDataInnField.tsx +0 -2
  434. package/src/retail/components/Fields/DulIssueDateField.tsx +1 -1
  435. package/src/retail/components/Fields/Experience5YearsField.tsx +0 -2
  436. package/src/retail/components/Fields/GeneralSeniorityField.tsx +0 -2
  437. package/src/retail/components/Fields/JobsNumberField.tsx +0 -2
  438. package/src/retail/components/Fields/LastJobExperienceField.tsx +0 -2
  439. package/src/retail/components/Fields/OrganizationNameField.tsx +0 -2
  440. package/src/retail/components/Fields/WagesField.tsx +0 -2
  441. package/src/retail/content.tsx +5 -11
  442. package/src/retail/inputs.tsx +1 -1
  443. package/src/retail/model/NameFieldDef.ts +0 -1
  444. package/src/retail/utils/mainFormStateMap.ts +0 -1
  445. package/src/retail/validator/getRetailFormValidator.ts +27 -0
  446. package/src/retail/validator/validatorObj.ts +2 -2
  447. package/src/retail/validator/validators.ts +19 -0
  448. package/src/ui-kit/FormField/Fields/PhoneField.tsx +1 -9
  449. package/src/ui-kit/FormField/shouldRenderField.tsx +1 -2
  450. package/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  451. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  452. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -22
  453. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
  454. package/dist/retail/api/esiaRequestProfile.js +0 -10
  455. package/dist/retail/api/esiaRequestProfile.js.map +0 -1
  456. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  457. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -20
  458. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
  459. package/lib/retail/api/esiaRequestProfile.js +0 -7
  460. package/lib/retail/api/esiaRequestProfile.js.map +0 -1
  461. package/mobile/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  462. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  463. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -22
  464. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
  465. package/mobile/dist/retail/api/esiaRequestProfile.d.ts +0 -84
  466. package/mobile/dist/retail/api/esiaRequestProfile.js +0 -10
  467. package/mobile/dist/retail/api/esiaRequestProfile.js.map +0 -1
  468. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +0 -4
  469. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +0 -20
  470. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +0 -1
  471. package/mobile/lib/retail/api/esiaRequestProfile.d.ts +0 -84
  472. package/mobile/lib/retail/api/esiaRequestProfile.js +0 -7
  473. package/mobile/lib/retail/api/esiaRequestProfile.js.map +0 -1
  474. package/mobile/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +0 -51
  475. package/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +0 -51
@@ -2022,7 +2022,7 @@
2022
2022
 
2023
2023
  const PhoneField = JSX(({ field, input }) => {
2024
2024
  const fieldName = input?.name || 'phone';
2025
- return (jsx(InputPhoneControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", disabled: input?.filledByEsia && isEsiaAuthorize(field, input.name ?? ''), ...field(fieldName), ...input }));
2025
+ return jsx(InputPhoneControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...field(fieldName), ...input });
2026
2026
  });
2027
2027
 
2028
2028
  const PosTerminalField = JSX(({ field }) => isAcquiringTrade(field('acquiringType')?.value?.key) ? (jsx(SlideCheckbox, { type: "radio", text: "\u0425\u043E\u0447\u0443 POS-\u0442\u0435\u0440\u043C\u0438\u043D\u0430\u043B", ...field('posTerminal') })) : null);
@@ -2202,7 +2202,7 @@
2202
2202
  function shouldRenderField({ input, field, }) {
2203
2203
  const { condition } = input;
2204
2204
  const { value } = field(condition?.name || '');
2205
- return !condition || condition?.values?.includes(value?.key ?? value);
2205
+ return !condition || condition?.values?.find((_) => _ === (value?.key ?? value));
2206
2206
  }
2207
2207
 
2208
2208
  const PRODUCT_REF = {
@@ -2452,6 +2452,14 @@
2452
2452
  return true;
2453
2453
  };
2454
2454
  const limitedBirthdayValidator = (params) => validator(limitedBirthdayValidate(params))(params.errorMessage);
2455
+ const passportValidator = (birthDate) => validator((_) => {
2456
+ if (_ && birthDate) {
2457
+ return (_.getTime() >=
2458
+ new Date(birthDate?.getFullYear() + 14, birthDate?.getMonth(), birthDate?.getDate()).getTime());
2459
+ }
2460
+ return false;
2461
+ })('Укажите дату выдачи паспорта');
2462
+ const deliveryDateValidator = (errorMsg) => validator((_) => _?.getTime() >= new Date().getTime())(errorMsg);
2455
2463
  const numberValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length === 6)(errorMsg);
2456
2464
  const serieValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length === 4)(errorMsg);
2457
2465
  const snilsValidate = (snils) => {
@@ -2506,7 +2514,7 @@
2506
2514
  codeWord: codeWordValidator('Необходимо ввести кодовое слово'),
2507
2515
  confirmationIncome: defaultSelectValidator(),
2508
2516
  methodObtain: defaultValidator(),
2509
- deliveryDate: defaultValidator('Укажите дату доставки'),
2517
+ deliveryDate: deliveryDateValidator('Укажите дату доставки'),
2510
2518
  };
2511
2519
  const validatorRetailObj = {
2512
2520
  organization: defaultSelectValidator('Выберите тип организации'),
@@ -2543,7 +2551,6 @@
2543
2551
  armyIdFlg: agreementValidator,
2544
2552
  dulSerie: serieValidator('Укажите серию паспорта'),
2545
2553
  dulNumber: numberValidator('Укажите номер паспорта'),
2546
- dulIssueDate: defaultValidator('Укажите дату выдачи паспорта'),
2547
2554
  dulSubdivisionCode: numberValidator('Укажите код подразделения'),
2548
2555
  dulIssuedBy: defaultValidator('Укажите организацию, выдавшую паспорт'),
2549
2556
  participantDateRegistration: defaultValidator('Укажите дату регистрации'),
@@ -2660,11 +2667,11 @@
2660
2667
  {
2661
2668
  columns: 2,
2662
2669
  inputs: [
2663
- { name: 'surname', required: true, dadata: true, filledByEsia: true },
2664
- { name: 'name', required: true, dadata: true, filledByEsia: true },
2665
- { name: 'middleName', dadata: true, filledByEsia: true },
2666
- { name: 'limitedBirthday', required: true, filledByEsia: true },
2667
- { name: 'phone', required: true, filledByEsia: true },
2670
+ { name: 'surname', required: true, dadata: true },
2671
+ { name: 'name', required: true, dadata: true },
2672
+ { name: 'middleName', dadata: true },
2673
+ { name: 'limitedBirthday', required: true },
2674
+ { name: 'phone', required: true },
2668
2675
  { name: 'email', required: true, dadata: true },
2669
2676
  ],
2670
2677
  },
@@ -2674,57 +2681,6 @@
2674
2681
  ];
2675
2682
  };
2676
2683
 
2677
- const getTraceId = () => {
2678
- const result = new Uint8Array(8);
2679
- globalThis.crypto.getRandomValues(result);
2680
- return result.reduce((acc, _) => `${acc}${_.toString(16).padStart(2, '0')}`, '');
2681
- };
2682
-
2683
- const fetchRetailJSON = async (url, method, body) => {
2684
- try {
2685
- const response = await doRequest(url, method, body);
2686
- return response.json();
2687
- }
2688
- catch (err) {
2689
- console.error(err);
2690
- return null;
2691
- }
2692
- };
2693
- async function doRequest(url, method, body) {
2694
- const traceId = getTraceId();
2695
- return globalThis?.fetch?.(`${RETAIL_API_BASE_URI}${url}`, {
2696
- method,
2697
- headers: {
2698
- 'Content-Type': 'application/json',
2699
- 'X-B3-Sampled': '1',
2700
- 'X-B3-Spanid': traceId,
2701
- 'X-B3-Traceid': traceId,
2702
- ...getAuthorizationHeaders(),
2703
- },
2704
- credentials: 'include',
2705
- body: body ? JSON.stringify(body) : null,
2706
- });
2707
- }
2708
- const getAuthorizationHeaders = () => {
2709
- const token = sessionStorage.getItem('accessToken');
2710
- return token ? { Authorization: `Bearer ${token}` } : null;
2711
- };
2712
-
2713
- const getLink = (body) => fetchRetailJSON('/esia/getLink', 'POST', body);
2714
-
2715
- const EsiaLoginBanner = JSX(() => {
2716
- const navigator = locationNavigator();
2717
- const handleAuth = useCallback(async () => {
2718
- const resp = await getLink({
2719
- redirectUri: globalThis.location.origin + globalThis.location.pathname,
2720
- });
2721
- if (resp?.link) {
2722
- navigator.assign(resp.link);
2723
- }
2724
- }, []);
2725
- return (jsxs("div", { className: "flex gap-lg items-center rounded-md bg-main-gray px-4 py-6 @md:p-9", children: [jsxs("div", { className: "flex flex-col justify-around w-full", children: [jsx("p", { className: "mb-4 text-xl @md:text-2xl @md:mb-6", children: "\u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u0435 \u0434\u0430\u043D\u043D\u044B\u0435 \u0447\u0435\u0440\u0435\u0437 \u0413\u043E\u0441\u0443\u0441\u043B\u0443\u0433\u0438" }), jsxs("ul", { className: "list-disc list-inside mb-9", children: [jsx("li", { children: "\u0412\u0435\u0440\u043E\u044F\u0442\u043D\u043E\u0441\u0442\u044C \u043E\u0434\u043E\u0431\u0440\u0435\u043D\u0438\u044F \u0432\u044B\u0448\u0435" }), jsx("li", { children: "\u0411\u0435\u0437 \u0441\u043F\u0440\u0430\u0432\u043E\u043A \u043E \u0434\u043E\u0445\u043E\u0434\u0430\u0445 \u0438 \u0442\u0440\u0443\u0434\u043E\u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u0435" }), jsx("li", { children: "\u0421 \u0437\u0430\u0449\u0438\u0442\u043E\u0439 \u0412\u0430\u0448\u0438\u0445 \u0434\u0430\u043D\u043D\u044B\u0445" })] }), jsx(Img, { className: "block mb-6 self-center @md:hidden", image: { icon: 'GosUslugiIcon', iconVersion: 'normal' }, height: "80", width: "80" }), jsx(Button, { type: "button", onClick: handleAuth, className: "w-full @md:w-fit", children: "\u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C" })] }), jsx(Img, { className: "hidden @md:block", image: { icon: 'GosUslugiIcon', iconVersion: 'normal' }, height: "164" })] }));
2726
- });
2727
-
2728
2684
  const debounce = (fn, delay = 600) => {
2729
2685
  let timerId;
2730
2686
  const debouncedCallback = (...args) => {
@@ -3611,6 +3567,42 @@
3611
3567
  const mapByIndex = (points, index) => points.map((_) => _.coords?.[index]);
3612
3568
  const getArraySumAndAverage = (arr) => arr.length && arr.reduce((a, b) => a + b) / arr.length;
3613
3569
 
3570
+ const getTraceId = () => {
3571
+ const result = new Uint8Array(8);
3572
+ globalThis.crypto.getRandomValues(result);
3573
+ return result.reduce((acc, _) => `${acc}${_.toString(16).padStart(2, '0')}`, '');
3574
+ };
3575
+
3576
+ const fetchRetailJSON = async (url, method, body) => {
3577
+ try {
3578
+ const response = await doRequest(url, method, body);
3579
+ return response.json();
3580
+ }
3581
+ catch (err) {
3582
+ console.error(err);
3583
+ return null;
3584
+ }
3585
+ };
3586
+ async function doRequest(url, method, body) {
3587
+ const traceId = getTraceId();
3588
+ return globalThis?.fetch?.(`${RETAIL_API_BASE_URI}${url}`, {
3589
+ method,
3590
+ headers: {
3591
+ 'Content-Type': 'application/json',
3592
+ 'X-B3-Sampled': '1',
3593
+ 'X-B3-Spanid': traceId,
3594
+ 'X-B3-Traceid': traceId,
3595
+ ...getAuthorizationHeaders(),
3596
+ },
3597
+ credentials: 'include',
3598
+ body: body ? JSON.stringify(body) : null,
3599
+ });
3600
+ }
3601
+ const getAuthorizationHeaders = () => {
3602
+ const token = sessionStorage.getItem('accessToken');
3603
+ return token ? { Authorization: `Bearer ${token}` } : null;
3604
+ };
3605
+
3614
3606
  const fetchRegionOffices = async (regionKey) => {
3615
3607
  const response = await fetchRetailJSON('/public-data/regionOffices', 'POST', {
3616
3608
  regionRfCd: {
@@ -3840,7 +3832,7 @@
3840
3832
 
3841
3833
  const BankruptcyFlgField = JSX(({ field, input }) => (jsx(CheckboxWithError, { text: "\u0412 \u043E\u0442\u043D\u043E\u0448\u0435\u043D\u0438\u0438 \u043C\u0435\u043D\u044F \u0432\u0435\u0434\u0451\u0442\u0441\u044F \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0441\u0442\u0432\u043E \u043F\u043E \u0434\u0435\u043B\u0443 \u043E \u0431\u0430\u043D\u043A\u0440\u043E\u0442\u0441\u0442\u0432\u0435", ...field(input?.name ?? '') })));
3842
3834
 
3843
- const BeginDateField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u043D\u0430\u0447\u0430\u043B\u0430 \u0440\u0430\u0431\u043E\u0442\u044B \u043D\u0430 \u0442\u0435\u043A\u0443\u0449\u0435\u043C \u043C\u0435\u0441\u0442\u0435", ...field(input?.name ?? ''), ...input, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '') })));
3835
+ const BeginDateField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u043D\u0430\u0447\u0430\u043B\u0430 \u0440\u0430\u0431\u043E\u0442\u044B \u043D\u0430 \u0442\u0435\u043A\u0443\u0449\u0435\u043C \u043C\u0435\u0441\u0442\u0435", ...field(input?.name ?? ''), ...input })));
3844
3836
 
3845
3837
  const FIELD_NAME$2 = 'birthPlace';
3846
3838
  const BirthPlaceField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u041C\u0435\u0441\u0442\u043E \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F", ...field(input?.name ?? ''), ...input, disabled: input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME$2) })));
@@ -3904,8 +3896,7 @@
3904
3896
 
3905
3897
  const ConfirmationIncomeField = JSX(({ field, input }) => {
3906
3898
  const { data: confirmationIncome } = useLeadFormData('INCOME_CERT_UNITED');
3907
- const filledByEsia = input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '');
3908
- return (jsxs("div", { children: [filledByEsia ? (jsx("div", { className: "mb-6", children: jsx(InfoCard, { __html: "\u0414\u043B\u044F \u0432\u044B\u0431\u043E\u0440\u0430 \u0438\u043D\u043E\u0433\u043E \u0441\u043F\u043E\u0441\u043E\u0431\u0430 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u044F \u0434\u043E\u0445\u043E\u0434\u0430, \u043E\u0444\u043E\u0440\u043C\u0438\u0442\u0435 \u043D\u043E\u0432\u0443\u044E \u0437\u0430\u044F\u0432\u043A\u0443 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442 \u0431\u0435\u0437 \u0430\u0432\u0442\u043E\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043D\u0430 \u043F\u043E\u0440\u0442\u0430\u043B\u0435 \u0413\u043E\u0441\u0443\u0441\u043B\u0443\u0433\u0438" }) })) : null, jsx(SelectField, { field: field, source: confirmationIncome, label: "\u0421\u043F\u043E\u0441\u043E\u0431 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u044F \u0434\u043E\u0445\u043E\u0434\u0430", fieldName: "confirmationIncome", input: input, disabled: filledByEsia })] }));
3899
+ return (jsx(SelectField, { field: field, source: confirmationIncome, label: "\u0421\u043F\u043E\u0441\u043E\u0431 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u044F \u0434\u043E\u0445\u043E\u0434\u0430", fieldName: "confirmationIncome", input: input }));
3909
3900
  });
3910
3901
 
3911
3902
  const ConscriptionField = JSX(({ field, input }) => {
@@ -4449,7 +4440,7 @@
4449
4440
  }
4450
4441
  })();
4451
4442
  }, [employerActivities, employerOrganization, organization, amountWorkers]);
4452
- return (jsx(DaDataInputControl, { label: "\u0418\u041D\u041D", isInteger: true, maxLength: 12, ...input, ...field(input?.name ?? ''), onDaDataChange: onDaDataChange, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '') }));
4443
+ return (jsx(DaDataInputControl, { label: "\u0418\u041D\u041D", isInteger: true, maxLength: 12, ...input, ...field(input?.name ?? ''), onDaDataChange: onDaDataChange }));
4453
4444
  });
4454
4445
 
4455
4446
  const DeliveryDateFiels = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438", ...field(input?.name ?? ''), minDate: new Date() })));
@@ -4467,7 +4458,7 @@
4467
4458
 
4468
4459
  const DulIssueDateField = JSX(({ field, input }) => {
4469
4460
  const birthDate = field('limitedBirthday')?.value;
4470
- const startDulIssueDate = useMemo(() => new Date(birthDate.getFullYear() + 14, birthDate.getMonth(), birthDate.getDate()), [birthDate]);
4461
+ const startDulIssueDate = useMemo(() => new Date(birthDate?.getFullYear() + 14, birthDate?.getMonth(), birthDate?.getDate()), [birthDate]);
4471
4462
  return (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0432\u044B\u0434\u0430\u0447\u0438", ...field(input?.name ?? ''), disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? ''), minDate: startDulIssueDate }));
4472
4463
  });
4473
4464
 
@@ -4532,7 +4523,7 @@
4532
4523
  const MIN_YEARS = 0;
4533
4524
  const Experience5YearsField = JSX(({ field, input }) => {
4534
4525
  const onChange = useCallback((value) => field(input?.name ?? '')?.onChange?.(String(clamp(Number(value), MIN_YEARS, MAX_YEARS))), []);
4535
- return (jsx(DaDataInputControl, { label: "\u0421\u0442\u0430\u0436", placeholder: "\u0417\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 5 \u043B\u0435\u0442", type: "number", ...field(input?.name ?? ''), ...input, onChange: onChange, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '') }));
4526
+ return (jsx(DaDataInputControl, { label: "\u0421\u0442\u0430\u0436", placeholder: "\u0417\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 5 \u043B\u0435\u0442", type: "number", ...field(input?.name ?? ''), ...input, onChange: onChange }));
4536
4527
  });
4537
4528
 
4538
4529
  const FamilyMembersField = JSX(({ field, input }) => {
@@ -4553,7 +4544,7 @@
4553
4544
  return (jsx(SelectField, { field: field, source: familyStatus, label: "\u0421\u0435\u043C\u0435\u0439\u043D\u043E\u0435 \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435", fieldName: "familyStatus", input: input }));
4554
4545
  });
4555
4546
 
4556
- const GeneralSeniorityField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u041E\u0431\u0449\u0438\u0439 \u0441\u0442\u0430\u0436", type: "number", maxLength: 2, placeholder: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043B\u0435\u0442", ...field(input?.name ?? ''), ...input, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '') })));
4547
+ const GeneralSeniorityField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u041E\u0431\u0449\u0438\u0439 \u0441\u0442\u0430\u0436", type: "number", maxLength: 2, placeholder: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043B\u0435\u0442", ...field(input?.name ?? ''), ...input })));
4557
4548
 
4558
4549
  const HousingField = JSX(({ field, input }) => {
4559
4550
  const { data: housing } = useLeadFormData('HOUSE_TYPE');
@@ -4562,9 +4553,9 @@
4562
4553
 
4563
4554
  const InfoCardField = JSX(({ input }) => (jsx(InfoCard, { __html: input?.label })));
4564
4555
 
4565
- const JobsNumberField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043C\u0435\u0441\u0442 \u0440\u0430\u0431\u043E\u0442\u044B \u0437\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 5 \u043B\u0435\u0442", placeholder: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043C\u0435\u0441\u0442", isInteger: true, maxLength: 2, ...field(input?.name ?? ''), ...input, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '') })));
4556
+ const JobsNumberField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043C\u0435\u0441\u0442 \u0440\u0430\u0431\u043E\u0442\u044B \u0437\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 5 \u043B\u0435\u0442", placeholder: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043C\u0435\u0441\u0442", isInteger: true, maxLength: 2, ...field(input?.name ?? ''), ...input })));
4566
4557
 
4567
- const LastJobExperienceField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u0421\u0442\u0430\u0436 \u043D\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u043C \u0440\u0430\u0431\u043E\u0447\u0435\u043C \u043C\u0435\u0441\u0442\u0435", placeholder: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043B\u0435\u0442", type: "number", maxLength: 2, ...field(input?.name ?? ''), ...input, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '') })));
4558
+ const LastJobExperienceField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u0421\u0442\u0430\u0436 \u043D\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u043C \u0440\u0430\u0431\u043E\u0447\u0435\u043C \u043C\u0435\u0441\u0442\u0435", placeholder: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043B\u0435\u0442", type: "number", maxLength: 2, ...field(input?.name ?? ''), ...input })));
4568
4559
 
4569
4560
  const latinPattern = /^[\u0041-\u005A\u0061-\u007A\s]+$/u;
4570
4561
  const isLatin = (_ = '') => latinPattern.test(_);
@@ -4730,7 +4721,7 @@
4730
4721
  field?.('inn')?.onChange?.(item.data?.inn);
4731
4722
  updateOrganizationFields(store, field, item);
4732
4723
  }, []);
4733
- return (jsx(DaDataInputControl, { label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...input, ...field(input?.name ?? ''), disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? ''), onDaDataChange: onDaDataChange }));
4724
+ return (jsx(DaDataInputControl, { label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...input, ...field(input?.name ?? ''), onDaDataChange: onDaDataChange }));
4734
4725
  });
4735
4726
 
4736
4727
  const OtherIncomeField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u0418\u043D\u044B\u0435 \u0434\u043E\u0445\u043E\u0434\u044B", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", isInteger: true, ...field(input?.name ?? ''), ...input })));
@@ -4877,7 +4868,7 @@
4877
4868
 
4878
4869
  const TotalIncomeField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u0421\u043E\u0432\u043E\u043A\u0443\u043F\u043D\u044B\u0439 \u043E\u0444\u0438\u0446\u0438\u0430\u043B\u044C\u043D\u044B\u0439 \u0434\u043E\u0445\u043E\u0434 \u0432 \u043C\u0435\u0441\u044F\u0446 \u043F\u043E\u0441\u043B\u0435 \u0432\u044B\u0447\u0435\u0442\u0430 \u043D\u0430\u043B\u043E\u0433\u043E\u0432 (\u0437\u0430\u0440\u043F\u043B\u0430\u0442\u0430, \u043F\u0440\u0435\u043C\u0438\u0438)", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", isInteger: true, ...field(input?.name ?? ''), ...input })));
4879
4870
 
4880
- const WagesField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u0421\u043E\u0432\u043E\u043A\u0443\u043F\u043D\u044B\u0439 \u0434\u043E\u0445\u043E\u0434 \u0432 \u043C\u0435\u0441\u044F\u0446 \u043F\u043E\u0441\u043B\u0435 \u0432\u044B\u0447\u0435\u0442\u0430 \u043D\u0430\u043B\u043E\u0433\u043E\u0432 (\u0437\u0430\u0440\u043F\u043B\u0430\u0442\u0430, \u043F\u0440\u0435\u043C\u0438\u0438)", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", isInteger: true, ...field(input?.name ?? ''), ...input, disabled: input?.filledByEsia && isEsiaAuthorize(field, input?.name ?? '') })));
4871
+ const WagesField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u0421\u043E\u0432\u043E\u043A\u0443\u043F\u043D\u044B\u0439 \u0434\u043E\u0445\u043E\u0434 \u0432 \u043C\u0435\u0441\u044F\u0446 \u043F\u043E\u0441\u043B\u0435 \u0432\u044B\u0447\u0435\u0442\u0430 \u043D\u0430\u043B\u043E\u0433\u043E\u0432 (\u0437\u0430\u0440\u043F\u043B\u0430\u0442\u0430, \u043F\u0440\u0435\u043C\u0438\u0438)", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", isInteger: true, ...field(input?.name ?? ''), ...input })));
4881
4872
 
4882
4873
  const DELIVERY_CITIES_REF = {
4883
4874
  $ref: '/wcms-resources/delivery-cities-data.json',
@@ -4915,7 +4906,6 @@
4915
4906
  addressRetail: AddressRetailField,
4916
4907
  addressMatch: AddressMatchField,
4917
4908
  sex: SexField,
4918
- limitedBirthday: LimitedBirthdayField,
4919
4909
  birthPlace: BirthPlaceField,
4920
4910
  education: EducationField,
4921
4911
  housing: HousingField,
@@ -4954,6 +4944,7 @@
4954
4944
  calculator: CreditCalcField,
4955
4945
  confirmationIncome: ConfirmationIncomeField,
4956
4946
  inn: DaDataInnField,
4947
+ ...InputsApplicationLeadMap,
4957
4948
  };
4958
4949
  const InputRetailCardMap = {
4959
4950
  addressCourier: (props) => (jsx(AddressCourierField, { ...props, source: DELIVERY_CITIES_REF })),
@@ -5507,7 +5498,7 @@
5507
5498
  const participant = task.participants[0];
5508
5499
  const { classCard: cardCategory, codeWord, paymentSystemTypeCd: paymentSystem, currencyCode: currency, } = task;
5509
5500
  const { loanAmount: moneyValue, creditPeriod: monthsValue, paymentTypeCd } = task;
5510
- const { birthDate: limitedBirthday, midname: middleName, name, surname, birthPlace, dulIssueDate: dulIssueDate, dulIssuedBy, dulNumber, dulSerie, dulSubdivisionCode, educationLevelCd: education, registrationDate: participantDateRegistration, houseTypeCd: housing, genderCd, participantContacts = [], participantAddresses = [], employmentContractDate: beginDate, employmentTypeCd: employment, organizationName, organizationInn: inn, organizationActivityTypeCd: employerActivities, organizationTypeCd: organization, organizationKindCd: employerOrganization, employeesNumberCd: amountWorkers, opf: legalForm, seniority: generalSeniority, generalSeniority: experience5Years, jobsNumber, lastWorkDuration: lastJobExperience, positionCd: positionOrganization, maritalStatusCd: familyStatus, childrenDependents: children, totalDependents: familyMembers, otherDependents: dependents, militaryStatusCd: conscription, participantIncomes, snils, armyIdFlg, bankruptcyFlg, shareholderFlg, nameLegalEntity: legalEntityName, creditInRshbCd, payrollCardRshbFlg: isInsurance, consentInsuranceFlg: isSalaryClient, incomeCertificateCd, profile, } = participant;
5501
+ const { birthDate: limitedBirthday, midname: middleName, name, surname, birthPlace, dulIssueDate: dulIssueDate, dulIssuedBy, dulNumber, dulSerie, dulSubdivisionCode, educationLevelCd: education, registrationDate: participantDateRegistration, houseTypeCd: housing, genderCd, participantContacts = [], participantAddresses = [], employmentContractDate: beginDate, employmentTypeCd: employment, organizationName, organizationInn: inn, organizationActivityTypeCd: employerActivities, organizationTypeCd: organization, organizationKindCd: employerOrganization, employeesNumberCd: amountWorkers, opf: legalForm, seniority: generalSeniority, generalSeniority: experience5Years, jobsNumber, lastWorkDuration: lastJobExperience, positionCd: positionOrganization, maritalStatusCd: familyStatus, childrenDependents: children, totalDependents: familyMembers, otherDependents: dependents, militaryStatusCd: conscription, participantIncomes, snils, armyIdFlg, bankruptcyFlg, shareholderFlg, nameLegalEntity: legalEntityName, creditInRshbCd, payrollCardRshbFlg: isInsurance, consentInsuranceFlg: isSalaryClient, incomeCertificateCd, } = participant;
5511
5502
  return {
5512
5503
  currency: currency?.key,
5513
5504
  paymentSystem: getSelectValue(paymentSystem),
@@ -5559,7 +5550,6 @@
5559
5550
  monthsValue,
5560
5551
  isAnnuity: paymentTypeCd?.key === 'ANNUITY',
5561
5552
  },
5562
- esiaAccountTypeCd: profile?.esiaAccountTypeCd,
5563
5553
  ...getParticipantIncomes(participantIncomes),
5564
5554
  ...getParticipantAddresses(participantAddresses),
5565
5555
  ...getParticipantContacts(participantContacts),
@@ -5614,6 +5604,39 @@
5614
5604
  };
5615
5605
  };
5616
5606
 
5607
+ const getLink = (body) => fetchRetailJSON('/esia/getLink', 'POST', body);
5608
+
5609
+ const EsiaLoginDialog = JSX(({ onClose }) => {
5610
+ const navigator = locationNavigator();
5611
+ const retailFormStore = useRetailFormStore();
5612
+ const handleAuth = useCallback(async () => {
5613
+ const resp = await getLink({
5614
+ redirectUri: globalThis.location.origin + globalThis.location.pathname,
5615
+ });
5616
+ if (resp?.link) {
5617
+ navigator.assign(resp.link);
5618
+ globalThis.location.href = resp.link;
5619
+ }
5620
+ }, []);
5621
+ const handleClose = useCallback(() => {
5622
+ if (retailFormStore.leadForm) {
5623
+ const leadForm = { ...retailFormStore.leadForm };
5624
+ delete leadForm.esiaAccountTypeCd;
5625
+ retailFormStore.leadForm = leadForm;
5626
+ }
5627
+ onClose?.();
5628
+ }, []);
5629
+ return (jsx(Dialog, { className: "my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg", onClose: handleClose, children: jsxs("div", { className: "flex flex-col gap-lg items-center rounded-md", children: [jsxs("div", { className: "flex items-center justify-around w-full px-m", children: [jsxs("ul", { className: "list-disc", children: [jsx("li", { children: "\u0412\u0435\u0440\u043E\u044F\u0442\u043D\u043E\u0441\u0442\u044C \u043E\u0434\u043E\u0431\u0440\u0435\u043D\u0438\u044F \u0432\u044B\u0448\u0435" }), jsx("li", { children: "\u0411\u0435\u0437 \u0441\u043F\u0440\u0430\u0432\u043E\u043A \u043E \u0434\u043E\u0445\u043E\u0434\u0430\u0445 \u0438 \u0442\u0440\u0443\u0434\u043E\u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u0435" }), jsx("li", { children: "\u0421 \u0437\u0430\u0449\u0438\u0442\u043E\u0439 \u0412\u0430\u0448\u0438\u0445 \u0434\u0430\u043D\u043D\u044B\u0445" })] }), jsx(Img, { image: { icon: 'GosUslugiIcon', iconVersion: 'normal' }, height: "70" })] }), jsxs("div", { className: "@container flex flex-wrap gap-lg w-full", children: [jsx(Button, { type: "button", onClick: handleAuth, className: "w-full md:w-auto", children: "\u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u0447\u0435\u0440\u0435\u0437 \u0413\u043E\u0441\u0443\u0441\u043B\u0443\u0433\u0438" }), jsx(Button, { type: "button", version: "secondary", onClick: handleClose, className: "w-full md:w-auto", children: "\u041F\u0440\u043E\u043F\u0443\u0441\u0442\u0438\u0442\u044C" })] })] }) }));
5630
+ });
5631
+
5632
+ const useEsiaLoginDialog = (nextStepLink) => {
5633
+ const { open } = useDialog(EsiaLoginDialog);
5634
+ const navigator = locationNavigator();
5635
+ return useCallback(() => {
5636
+ open({ onClose: () => navigator.assign(nextStepLink) });
5637
+ }, [open, nextStepLink]);
5638
+ };
5639
+
5617
5640
  // TODO Не должно быть импортов из бизнес-слоя в API слой. Только наоборот.
5618
5641
  const getUpdateUserProfileData = (profileId, formData, consents) => {
5619
5642
  const { name = '', surname = '', middleName = '', limitedBirthday = '', phone = '', email = '', } = formData;
@@ -5735,40 +5758,43 @@
5735
5758
 
5736
5759
  /* eslint-disable max-lines */
5737
5760
  // eslint-disable-next-line max-lines-per-function
5738
- const useApplicationLeadApi = ({ programId, nextStepLink, productType, data, }) => {
5761
+ const useApplicationLeadApi = ({ programId, nextStepLink, productType, esiaError, data, }) => {
5739
5762
  const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
5740
5763
  const [ok, setOK] = useState();
5741
5764
  const saveUserData = useSaveUserData();
5742
5765
  const sendAspects = useSendLeadFormAspects({ data });
5743
5766
  const navigator = locationNavigator();
5744
- const goToNextStep = useCallback(() => {
5745
- navigator.assign(nextStepLink);
5746
- }, []);
5747
- const consentBkiDialog = useConsentBkiDialog(goToNextStep);
5767
+ const openEsiaLoginDialog = useEsiaLoginDialog(nextStepLink);
5768
+ const consentBkiDialog = useConsentBkiDialog(openEsiaLoginDialog);
5748
5769
  const verifyPhoneDialog = useDialog(VerifyPhoneDialog);
5749
5770
  const draftDialog = useDraftDialog();
5750
5771
  const handleSubmit = useCallback(async (formData) => {
5772
+ if (esiaError) {
5773
+ navigator.assign(nextStepLink);
5774
+ return;
5775
+ }
5751
5776
  try {
5752
5777
  startSending();
5778
+ const transformedFormData = transformFormData(formData);
5753
5779
  const profileId = await createUserProfile({
5754
- profile: { phone: formatPhone(formData.phone) },
5780
+ profile: { phone: formatPhone(transformedFormData.phone) },
5755
5781
  });
5756
- if (profileId && formData?.phone) {
5782
+ if (profileId && transformedFormData?.phone) {
5757
5783
  const sendCurrentTask = async () => {
5758
5784
  await updateUserData({
5759
5785
  programId,
5760
5786
  profileId,
5761
- formData,
5787
+ formData: transformedFormData,
5762
5788
  productType,
5763
5789
  saveUserData,
5764
5790
  sendAspects,
5765
5791
  });
5766
5792
  verifyPhoneDialog.close();
5767
5793
  if (productType === 'debitCard') {
5768
- goToNextStep();
5794
+ openEsiaLoginDialog();
5769
5795
  }
5770
5796
  else {
5771
- consentBkiDialog.open(formData.phone, profileId);
5797
+ consentBkiDialog.open(transformedFormData.phone, profileId);
5772
5798
  }
5773
5799
  };
5774
5800
  const handleSuccessVerify = async () => {
@@ -5794,7 +5820,7 @@
5794
5820
  };
5795
5821
  const acceptedConsents = getAcceptedConsents(formData, productType);
5796
5822
  verifyPhoneDialog.open({
5797
- phone: formData?.phone,
5823
+ phone: transformedFormData?.phone,
5798
5824
  consents: acceptedConsents,
5799
5825
  onSuccess: handleSuccessVerify,
5800
5826
  });
@@ -5804,7 +5830,7 @@
5804
5830
  catch {
5805
5831
  setOK(false);
5806
5832
  }
5807
- }, []);
5833
+ }, [esiaError]);
5808
5834
  return { isSending, ok, handleSubmit };
5809
5835
  };
5810
5836
  const getAcceptedConsents = (formData, productType) => {
@@ -5876,6 +5902,12 @@
5876
5902
  consentAssignmentClaimsFlg: consentOthersFlg,
5877
5903
  };
5878
5904
  };
5905
+ const transformFormData = (formData) => ({
5906
+ ...formData,
5907
+ surname: formData.surname?.trim(),
5908
+ name: formData.name?.trim(),
5909
+ middleName: formData.middleName?.trim(),
5910
+ });
5879
5911
 
5880
5912
  const useSetter = (target, key) => useCallback((value) => {
5881
5913
  const newValue = value instanceof Function ? value(target[key]) : value;
@@ -5887,10 +5919,7 @@
5887
5919
  }
5888
5920
  }, [target, key]);
5889
5921
 
5890
- const esiaRequestProfile = (body) => fetchRetailJSON('/esia/requestProfile', 'POST', body).then((res) => {
5891
- saveToken(res);
5892
- return res;
5893
- });
5922
+ const updateProfileEsia = (body) => fetchRetailJSON('/esia/updateProfileEsia', 'POST', body);
5894
5923
 
5895
5924
  const initialFormState = {
5896
5925
  surname: '',
@@ -5908,24 +5937,19 @@
5908
5937
  consentPhotoFlg: false,
5909
5938
  consentFATCA: false,
5910
5939
  };
5911
- const getInitialFormState$1 = (inputs, savedForm, esiaAuthSuccess) => {
5940
+ const getInitialFormState$1 = (inputs, savedForm) => {
5912
5941
  if (savedForm) {
5913
- return {
5914
- ...savedForm,
5915
- limitedBirthday: new Date(savedForm?.limitedBirthday || 0),
5916
- ...(!esiaAuthSuccess && {
5917
- esiaAccountTypeCd: { key: '' },
5918
- }),
5919
- };
5942
+ return { ...savedForm, limitedBirthday: new Date(savedForm?.limitedBirthday || 0) };
5920
5943
  }
5921
5944
  const formState = Object.fromEntries(inputs.map((_) => [_.name, initialFormState[_.name || '']]));
5922
5945
  return { ...formState };
5923
5946
  };
5924
5947
 
5925
- const uploadFile = async (file, documentCategory, isPDF = false) => {
5948
+ const uploadFile = async (file, taskId, documentCategory) => {
5926
5949
  const fd = new FormData();
5950
+ fd.append('taskId', taskId);
5927
5951
  fd.append('documentCategory', documentCategory);
5928
- fd.append('file', file, `file.${isPDF ? 'pdf' : 'xml'}`);
5952
+ fd.append('file', file, 'file.pdf');
5929
5953
  const res = await globalThis
5930
5954
  ?.fetch?.(`/light-api-cash/v1/file`, {
5931
5955
  method: 'POST',
@@ -5939,13 +5963,23 @@
5939
5963
  return res;
5940
5964
  };
5941
5965
 
5942
- const parseEsiaProfile = async (esiaProfile, isDebit) => {
5943
- checkEsiaData(esiaProfile);
5944
- const isFullEsiaData = !isDebit && checkEsiaAdditionalDocument(esiaProfile);
5966
+ const parseEsiaProfile = async (esiaProfile, taskId, isDebit) => {
5967
+ isDebit ? checkEsiaDataForDebit(esiaProfile) : checkEsiaDataForCredit(esiaProfile);
5945
5968
  const { profile, addInfo, document, addressRegistration, addressFact, esiaAdditionalDocument } = esiaProfile;
5946
- let files = [];
5947
- if (isFullEsiaData) {
5948
- files = await saveDocuments(esiaAdditionalDocument);
5969
+ const files = [];
5970
+ if (!isDebit) {
5971
+ await saveDocument({
5972
+ document: esiaAdditionalDocument.pdfFileWorkbook,
5973
+ taskId,
5974
+ category: 'CONFIRMING_INCOME_DOC',
5975
+ files,
5976
+ });
5977
+ await saveDocument({
5978
+ document: esiaAdditionalDocument.pdfFilePayout,
5979
+ taskId,
5980
+ category: 'CONFIRMING_EMPLOYMENT_DOC',
5981
+ files,
5982
+ });
5949
5983
  }
5950
5984
  const mainData = {
5951
5985
  name: profile.name,
@@ -5962,11 +5996,11 @@
5962
5996
  birthPlace: addInfo.birthPlace,
5963
5997
  addressRegistration: buildAddress(addressRegistration),
5964
5998
  addressFact: buildAddress(addressFact),
5965
- esiaAccountTypeCd: isDebit ? profile.esiaAccountType : { key: '' },
5999
+ esiaAccountTypeCd: profile.esiaAccountType,
5966
6000
  };
5967
6001
  return {
5968
6002
  ...mainData,
5969
- ...(isFullEsiaData && {
6003
+ ...(!isDebit && {
5970
6004
  snils: addInfo.snils,
5971
6005
  inn: esiaAdditionalDocument.inn,
5972
6006
  wages: Math.floor(esiaAdditionalDocument.averageMonthlyIncome)?.toString(),
@@ -5975,9 +6009,6 @@
5975
6009
  generalSeniority: getYearFromMonth(esiaAdditionalDocument.workLength).toString(),
5976
6010
  lastJobExperience: getYearFromMonth(esiaAdditionalDocument.workLengthLastJob).toString(),
5977
6011
  jobsNumber: esiaAdditionalDocument.jobsNumberInFiveYears.toString(),
5978
- esiaAccountTypeCd: profile.esiaAccountType,
5979
- confirmationIncome: { key: 'SFR_CERTIFICATE', text: 'Запрос Банком доходов из СФР' },
5980
- employment: { key: 'WORK', text: 'Работаю' },
5981
6012
  files,
5982
6013
  }),
5983
6014
  };
@@ -6010,60 +6041,43 @@
6010
6041
  };
6011
6042
  };
6012
6043
  const getYearFromMonth = (month) => Math.floor(month / 12);
6013
- const saveDocuments = async (esiaAdditionalDocument) => {
6014
- const files = [];
6015
- const documents = [
6016
- {
6017
- file: esiaAdditionalDocument.pdfFileWorkbook,
6018
- category: 'CONFIRMING_INCOME_DOC',
6019
- isPDF: true,
6020
- },
6021
- {
6022
- file: esiaAdditionalDocument.pdfFilePayout,
6023
- category: 'CONFIRMING_EMPLOYMENT_DOC',
6024
- isPDF: true,
6025
- },
6026
- {
6027
- file: esiaAdditionalDocument.pdfFileSigPayout,
6028
- category: 'CONFIRMING_EMPLOYMENT_DOC',
6029
- isPDF: true,
6030
- },
6031
- {
6032
- file: esiaAdditionalDocument.xmlFilePayout,
6033
- category: 'CONFIRMING_EMPLOYMENT_DOC',
6034
- isPDF: false,
6035
- },
6036
- {
6037
- file: esiaAdditionalDocument.xmlFileSigPayout,
6038
- category: 'CONFIRMING_EMPLOYMENT_DOC',
6039
- isPDF: false,
6040
- },
6041
- {
6042
- file: esiaAdditionalDocument.xmlFileWorkbook,
6043
- category: 'CONFIRMING_INCOME_DOC',
6044
- isPDF: false,
6045
- },
6046
- {
6047
- file: esiaAdditionalDocument.pdfFileSigWorkbook,
6048
- category: 'CONFIRMING_INCOME_DOC',
6049
- isPDF: true,
6050
- },
6051
- {
6052
- file: esiaAdditionalDocument.xmlFileSigWorkbook,
6053
- category: 'CONFIRMING_INCOME_DOC',
6054
- isPDF: false,
6055
- },
6044
+ const saveDocument = async ({ document, taskId, category, files, }) => {
6045
+ await fetch(`data:application/pdf;base64,${document}`)
6046
+ .then((res) => res.blob())
6047
+ .then((value) => uploadFile(value, taskId, category))
6048
+ .then((file) => files.push(file));
6049
+ };
6050
+ const checkEsiaDataForCredit = (esiaProfile) => {
6051
+ const { profile, document, addressRegistration, esiaAdditionalDocument } = esiaProfile;
6052
+ const data = [
6053
+ profile.name,
6054
+ profile.surname,
6055
+ profile.midname,
6056
+ profile.birthDate,
6057
+ profile.phone,
6058
+ profile.email,
6059
+ document.dulIssueDate,
6060
+ document.dulIssuedBy,
6061
+ document.dulNumber,
6062
+ document.dulSerie,
6063
+ document.dulSubdivisionCode,
6064
+ addressRegistration,
6065
+ profile.esiaAccountType,
6066
+ esiaAdditionalDocument.inn,
6067
+ esiaAdditionalDocument.averageMonthlyIncome.toString(),
6068
+ esiaAdditionalDocument.startWorkDate,
6069
+ esiaAdditionalDocument.workLengthInFiveYears.toString(),
6070
+ esiaAdditionalDocument.workLength.toString(),
6071
+ esiaAdditionalDocument.workLengthLastJob.toString(),
6072
+ esiaAdditionalDocument.jobsNumberInFiveYears.toString(),
6073
+ esiaAdditionalDocument.pdfFilePayout,
6074
+ esiaAdditionalDocument.pdfFileWorkbook,
6056
6075
  ];
6057
- for (const doc of documents) {
6058
- const contentType = doc.isPDF ? 'data:application/pdf;base64' : 'data:application/xml;base64';
6059
- await fetch(`${contentType},${doc.file}`)
6060
- .then((res) => res.blob())
6061
- .then((value) => uploadFile(value, doc.category, doc.isPDF))
6062
- .then((file) => files.push(file));
6076
+ if (!data.every((_) => Boolean(_))) {
6077
+ throw new Error();
6063
6078
  }
6064
- return files;
6065
6079
  };
6066
- const checkEsiaData = (esiaProfile) => {
6080
+ const checkEsiaDataForDebit = (esiaProfile) => {
6067
6081
  const { profile, document, addressRegistration } = esiaProfile;
6068
6082
  const data = [
6069
6083
  profile.name,
@@ -6071,6 +6085,7 @@
6071
6085
  profile.midname,
6072
6086
  profile.birthDate,
6073
6087
  profile.phone,
6088
+ profile.email,
6074
6089
  document.dulIssueDate,
6075
6090
  document.dulIssuedBy,
6076
6091
  document.dulNumber,
@@ -6083,97 +6098,75 @@
6083
6098
  throw new Error();
6084
6099
  }
6085
6100
  };
6086
- const checkEsiaAdditionalDocument = (esiaProfile) => {
6087
- const { esiaAdditionalDocument } = esiaProfile;
6088
- const data = [
6089
- esiaAdditionalDocument?.inn,
6090
- esiaAdditionalDocument?.averageMonthlyIncome?.toString(),
6091
- esiaAdditionalDocument?.startWorkDate,
6092
- esiaAdditionalDocument?.workLengthInFiveYears?.toString(),
6093
- esiaAdditionalDocument?.workLength?.toString(),
6094
- esiaAdditionalDocument?.workLengthLastJob?.toString(),
6095
- esiaAdditionalDocument?.jobsNumberInFiveYears?.toString(),
6096
- esiaAdditionalDocument?.pdfFilePayout,
6097
- esiaAdditionalDocument?.pdfFileWorkbook,
6098
- esiaAdditionalDocument?.pdfFileSigPayout,
6099
- esiaAdditionalDocument?.xmlFilePayout,
6100
- esiaAdditionalDocument?.xmlFileSigPayout,
6101
- esiaAdditionalDocument?.xmlFileWorkbook,
6102
- esiaAdditionalDocument?.pdfFileSigWorkbook,
6103
- esiaAdditionalDocument?.xmlFileSigWorkbook,
6104
- ];
6105
- return data.every((_) => Boolean(_));
6106
- };
6107
6101
 
6108
- const useInitApplicationLead = ({ inputs, productType, setEsiaStatus, esiaAuthSuccess, }) => {
6102
+ const useInitApplicationLead = ({ inputs, nextStepLink, productType, setEsiaError, }) => {
6103
+ const navigator = locationNavigator();
6104
+ const [isLoading, { setTrue: startLoading, setFalse: endLoading }] = useBool(false);
6109
6105
  const leadFormStore = useLeadFormStore();
6110
6106
  const saveForm = useSetter(leadFormStore, 'leadForm');
6111
- const initialFormState = useMemo(() => getInitialFormState$1(inputs, leadFormStore.leadForm, esiaAuthSuccess), [inputs, leadFormStore.leadForm]);
6112
- const requestEsiaProfile = useCallback(async (code, state) => {
6113
- setEsiaStatus(EsiaStatuses.Pending);
6107
+ const initialFormState = useMemo(() => getInitialFormState$1(inputs, leadFormStore.leadForm), [inputs, leadFormStore.leadForm]);
6108
+ const updateEsiaProfile = useCallback(async (profileId, code, state) => {
6109
+ startLoading();
6114
6110
  try {
6115
- const data = await esiaRequestProfile({
6111
+ const data = await updateProfileEsia({
6112
+ profileId,
6116
6113
  code,
6117
6114
  state,
6118
6115
  redirectUri: globalThis.location?.href,
6119
- authorize: true,
6120
6116
  });
6121
- if (data) {
6122
- const parsedData = await parseEsiaProfile(data, productType === 'debitCard');
6117
+ if (data && leadFormStore?.taskId) {
6118
+ const parsedData = await parseEsiaProfile(data, leadFormStore.taskId.toString(), productType === 'debitCard');
6123
6119
  saveForm((_) => ({
6124
6120
  ..._,
6125
6121
  ...parsedData,
6126
6122
  }));
6127
- setEsiaStatus(EsiaStatuses.Success);
6128
6123
  }
6124
+ navigator.assign(nextStepLink);
6129
6125
  }
6130
6126
  catch {
6131
- setEsiaStatus(EsiaStatuses.Error);
6127
+ setEsiaError();
6132
6128
  }
6133
- }, []);
6129
+ finally {
6130
+ endLoading();
6131
+ }
6132
+ }, [nextStepLink]);
6134
6133
  useEffect(() => {
6135
6134
  leadFormStore.productType = productType;
6135
+ const profileId = (safeJsonParse(globalThis.localStorage?.getItem('profileId') ?? ''));
6136
6136
  const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
6137
6137
  const code = params.get('code');
6138
6138
  const state = params.get('state');
6139
- if (code && state) {
6140
- requestEsiaProfile(code, state);
6139
+ if (profileId && code && state) {
6140
+ updateEsiaProfile(profileId, code, state);
6141
6141
  }
6142
6142
  else {
6143
6143
  sessionStorage.removeItem('accessToken');
6144
6144
  sessionStorage.removeItem('refreshToken');
6145
6145
  }
6146
6146
  }, []);
6147
- return initialFormState;
6147
+ return [initialFormState, { isLoading }];
6148
6148
  };
6149
6149
 
6150
- var EsiaStatuses;
6151
- (function (EsiaStatuses) {
6152
- EsiaStatuses["Success"] = "SUCCESS";
6153
- EsiaStatuses["Error"] = "ERROR";
6154
- EsiaStatuses["Pending"] = "PENDING";
6155
- })(EsiaStatuses || (EsiaStatuses = {}));
6156
6150
  const ApplicationLeadForm = JSX(({ className, title, programId = '', nextStepLink = '/credit-lead', button, productType = 'credit', data, ...rest }) => {
6157
- const [esiaStatus, setEsiaStatus] = useState();
6158
- const leadForm = useRef(null);
6151
+ const [esiaError, { setTrue: setEsiaError }] = useBool(false);
6159
6152
  const applicationFormData = useMemo(() => getApplicationFormData(productType), [productType]);
6160
6153
  const inputs = useMemo(() => getInputs(applicationFormData), [applicationFormData]);
6161
6154
  const extendedValidatorObj = useMemo(() => getExtendedValidatorObj(productType), [productType]);
6162
6155
  const formValidator = useMemo(() => getFormValidator(inputs, extendedValidatorObj), [inputs, extendedValidatorObj]);
6163
- const initialFormState = useInitApplicationLead({
6156
+ const [initialFormState, { isLoading }] = useInitApplicationLead({
6164
6157
  inputs,
6165
6158
  nextStepLink,
6166
6159
  productType,
6167
- setEsiaStatus,
6168
- esiaAuthSuccess: esiaStatus === EsiaStatuses.Success,
6160
+ setEsiaError,
6169
6161
  });
6170
6162
  const { isSending, ok, handleSubmit } = useApplicationLeadApi({
6171
6163
  programId,
6172
6164
  nextStepLink,
6173
6165
  productType,
6166
+ esiaError,
6174
6167
  data,
6175
6168
  });
6176
- const [, { field, onSubmit, reset }] = useForm(initialFormState, {
6169
+ const [, { field, onSubmit }] = useForm(initialFormState, {
6177
6170
  formValidator,
6178
6171
  onSubmit: handleSubmit,
6179
6172
  });
@@ -6183,17 +6176,7 @@
6183
6176
  responseTypeDialog.open({ ok });
6184
6177
  }
6185
6178
  }, [ok]);
6186
- useEffect(() => {
6187
- if (esiaStatus && leadForm?.current) {
6188
- leadForm.current.scrollIntoView({
6189
- block: 'start',
6190
- });
6191
- }
6192
- if (esiaStatus === EsiaStatuses.Success) {
6193
- reset();
6194
- }
6195
- }, [leadForm?.current, esiaStatus]);
6196
- return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: [!esiaStatus ? jsx(EsiaLoginBanner, {}) : null, jsxs("form", { onSubmit: onSubmit, className: "space-y-m relative", ref: leadForm, children: [esiaStatus === EsiaStatuses.Pending ? jsx(Loader, { blur: false }) : null, applicationFormData.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), renderInputs$1({ field, inputs: _?.inputs }, productType)] }, `section-${i}`))), renderSubmitButton(button, isSending), esiaStatus === EsiaStatuses.Error ? (jsx(Text, { size: "text-m", font: "font-medium", color: "text-error", children: "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0413\u043E\u0441\u0443\u0441\u043B\u0443\u0433\u0438 \u0434\u043B\u044F \u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u044F \u0437\u0430\u044F\u0432\u043A\u0438 \u043D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E, \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u0437\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u043F\u043E\u043B\u044F \u0432\u0440\u0443\u0447\u043D\u0443\u044E." })) : null] })] }));
6179
+ return (jsx(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: jsxs("form", { onSubmit: onSubmit, className: "space-y-m relative", children: [isLoading ? jsx(Loader, { blur: false }) : null, applicationFormData.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), renderInputs$1({ field, inputs: _?.inputs }, productType)] }, `section-${i}`))), renderSubmitButton(button, isSending), esiaError ? (jsx(Text, { size: "text-m", font: "font-medium", color: "text-error", children: "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0413\u043E\u0441\u0443\u0441\u043B\u0443\u0433\u0438 \u0434\u043B\u044F \u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u044F \u0437\u0430\u044F\u0432\u043A\u0438 \u043D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E, \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u0437\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u043F\u043E\u043B\u044F \u0432\u0440\u0443\u0447\u043D\u0443\u044E." })) : null] }) }));
6197
6180
  });
6198
6181
  const getInputs = (applicationFormData) => (applicationFormData?.flatMap((_) => _?.inputs) || []);
6199
6182
  const getExtendedValidatorObj = (productType) => ({
@@ -7827,6 +7810,12 @@
7827
7810
  });
7828
7811
  const getValue = (field) => (name) => field(name)?.value;
7829
7812
 
7813
+ const getRetailFormValidator = ({ formState, inputs, step, productType, }) => getFormValidator(calculateInputs((_) => formState[_])(inputs, step), {
7814
+ ...validatorObj,
7815
+ limitedBirthday: getLimitedBirthdayValidation(productType),
7816
+ dulIssueDate: passportValidator(formState.limitedBirthday),
7817
+ })(formState);
7818
+
7830
7819
  const StepsNavigationButtons$2 = JSX(({ step, isSending, onPrevStep }) => {
7831
7820
  const isFirstStep = step === 0;
7832
7821
  const isFinalStep = step === 5;
@@ -7907,7 +7896,6 @@
7907
7896
  mandatoryPayments: undefined,
7908
7897
  snils: '',
7909
7898
  armyIdFlg: false,
7910
- esiaAccountTypeCd: { key: '', text: '' },
7911
7899
  },
7912
7900
  {
7913
7901
  bankruptcyFlg: false,
@@ -8146,15 +8134,14 @@
8146
8134
  };
8147
8135
 
8148
8136
  const PRODUCT_TYPE$2 = 'creditCard';
8149
- const extendedValidatorObj$2 = {
8150
- ...validatorObj,
8151
- limitedBirthday: getLimitedBirthdayValidation(PRODUCT_TYPE$2),
8152
- };
8153
8137
  const CreditCardFormStep = JSX(({ step, sections, onPrevStep, onNextStep, onFinish }) => {
8154
8138
  const inputs = useMemo(() => sections?.flatMap((_) => _?.inputs || []), [sections]);
8155
- const formValidator = useCallback((formState) =>
8156
- // TODO Слишком сложно
8157
- getFormValidator(calculateInputs((_) => formState[_])(inputs, step), extendedValidatorObj$2)(formState), [inputs]);
8139
+ const formValidator = useCallback((formState) => getRetailFormValidator({
8140
+ formState,
8141
+ inputs,
8142
+ step,
8143
+ productType: PRODUCT_TYPE$2,
8144
+ }), [inputs]);
8158
8145
  const [initialState, onSubmit, isSending] = useCreditCardFormAPI({
8159
8146
  step,
8160
8147
  onNextStep,
@@ -8303,7 +8290,7 @@
8303
8290
  label: 'Телефон работодателя',
8304
8291
  required: true,
8305
8292
  },
8306
- { name: 'beginDate', required: true, filledByEsia: true },
8293
+ { name: 'beginDate', required: true },
8307
8294
  ],
8308
8295
  },
8309
8296
  {
@@ -8344,16 +8331,6 @@
8344
8331
  {
8345
8332
  title: 'Совокупный доход',
8346
8333
  },
8347
- {
8348
- columns: 1,
8349
- inputs: [
8350
- {
8351
- name: 'confirmationIncome',
8352
- required: true,
8353
- filledByEsia: true,
8354
- },
8355
- ],
8356
- },
8357
8334
  {
8358
8335
  inputs: [
8359
8336
  {
@@ -8362,6 +8339,10 @@
8362
8339
  },
8363
8340
  ],
8364
8341
  },
8342
+ {
8343
+ columns: 1,
8344
+ inputs: [{ name: 'confirmationIncome', required: true }],
8345
+ },
8365
8346
  {
8366
8347
  columns: 1,
8367
8348
  inputs: [{ name: 'wages', required: true, filledByEsia: true }],
@@ -8975,17 +8956,16 @@
8975
8956
  };
8976
8957
 
8977
8958
  const PRODUCT_TYPE$1 = 'credit';
8978
- const extendedValidatorObj$1 = {
8979
- ...validatorObj,
8980
- limitedBirthday: getLimitedBirthdayValidation(PRODUCT_TYPE$1),
8981
- };
8982
8959
  const CreditFormStep = JSX(({ step, sections, programsSource, onPrevStep, onNextStep, onFinish }) => {
8983
8960
  const { programId } = useRetailFormStore();
8984
8961
  const calcData = programsSource?.[programId ?? '']; // Need normalizator useForm, to be save defaultParams
8985
8962
  const inputs = useMemo(() => sections?.flatMap((_) => _?.inputs ?? []), [sections]);
8986
- const formValidator = useCallback((formState) =>
8987
- // TODO Слишком сложно
8988
- getFormValidator(calculateInputs((_) => formState[_])(inputs, step), extendedValidatorObj$1)(formState), [inputs]);
8963
+ const formValidator = useCallback((formState) => getRetailFormValidator({
8964
+ formState,
8965
+ inputs,
8966
+ step,
8967
+ productType: PRODUCT_TYPE$1,
8968
+ }), [inputs]);
8989
8969
  const [initialState, onSubmit, isSending] = useCreditFormAPI({
8990
8970
  step,
8991
8971
  onNextStep,
@@ -9296,15 +9276,14 @@
9296
9276
  };
9297
9277
 
9298
9278
  const PRODUCT_TYPE = 'debitCard';
9299
- const extendedValidatorObj = {
9300
- ...validatorObj,
9301
- limitedBirthday: getLimitedBirthdayValidation(PRODUCT_TYPE),
9302
- };
9303
9279
  const DebitFormStep = JSX(({ step, sections, onPrevStep, onNextStep, onFinish }) => {
9304
9280
  const inputs = useMemo(() => sections?.flatMap((_) => _?.inputs ?? []), [sections]);
9305
- const formValidator = useCallback((formState) =>
9306
- // TODO Слишком сложно
9307
- getFormValidator(calculateInputs((_) => formState[_])(inputs, step), extendedValidatorObj)(formState), [inputs]);
9281
+ const formValidator = useCallback((formState) => getRetailFormValidator({
9282
+ formState,
9283
+ inputs,
9284
+ step,
9285
+ productType: PRODUCT_TYPE,
9286
+ }), [inputs]);
9308
9287
  const [initialState, onSubmit, isSending] = useDebitFormAPI({
9309
9288
  step,
9310
9289
  onNextStep,
@@ -11661,7 +11640,7 @@
11661
11640
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
11662
11641
  });
11663
11642
 
11664
- const packageVersion = "0.14.823";
11643
+ const packageVersion = "0.14.825";
11665
11644
 
11666
11645
  exports.Blocks = Blocks;
11667
11646
  exports.ContentPage = ContentPage;