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

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 (377) hide show
  1. package/bundle/bundle.umd.js +229 -198
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
  4. package/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  5. package/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  6. package/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  7. package/bundle/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  8. package/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -2
  9. package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  10. package/bundle/retail/api/checkCode.d.ts +1 -0
  11. package/bundle/retail/api/{updateProfileEsia.d.ts → esiaRequestProfile.d.ts} +11 -4
  12. package/bundle/retail/api/updateUserTask.d.ts +1 -0
  13. package/bundle/retail/api/uploadFile.d.ts +1 -1
  14. package/bundle/retail/model/NameFieldDef.d.ts +1 -1
  15. package/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  16. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
  17. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +26 -8
  18. package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  19. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  20. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +22 -0
  21. package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
  22. package/dist/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  23. package/dist/components/ApplicationLeadForm/applicationFormData.js +6 -31
  24. package/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  25. package/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  26. package/dist/components/ApplicationLeadForm/getInitialFormState.js +8 -2
  27. package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  28. package/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  29. package/dist/components/ApplicationLeadForm/parseEsiaProfile.js +83 -53
  30. package/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  31. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -2
  32. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +12 -22
  33. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  34. package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  35. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +16 -24
  36. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  37. package/dist/retail/api/checkCode.d.ts +1 -0
  38. package/dist/retail/api/checkCode.js +3 -2
  39. package/dist/retail/api/checkCode.js.map +1 -1
  40. package/{lib/retail/api/updateProfileEsia.d.ts → dist/retail/api/esiaRequestProfile.d.ts} +11 -4
  41. package/dist/retail/api/esiaRequestProfile.js +10 -0
  42. package/dist/retail/api/esiaRequestProfile.js.map +1 -0
  43. package/dist/retail/api/updateUserTask.d.ts +1 -0
  44. package/dist/retail/api/updateUserTask.js.map +1 -1
  45. package/dist/retail/api/uploadFile.d.ts +1 -1
  46. package/dist/retail/api/uploadFile.js +2 -3
  47. package/dist/retail/api/uploadFile.js.map +1 -1
  48. package/dist/retail/components/DraftDialog/parseDraftTask.js +2 -1
  49. package/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  50. package/dist/retail/components/Fields/BeginDateField.js +2 -1
  51. package/dist/retail/components/Fields/BeginDateField.js.map +1 -1
  52. package/dist/retail/components/Fields/ConfirmationIncomeField.js +4 -1
  53. package/dist/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  54. package/dist/retail/components/Fields/DaDataInnField.js +2 -1
  55. package/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
  56. package/dist/retail/components/Fields/Experience5YearsField.js +2 -1
  57. package/dist/retail/components/Fields/Experience5YearsField.js.map +1 -1
  58. package/dist/retail/components/Fields/GeneralSeniorityField.js +2 -1
  59. package/dist/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  60. package/dist/retail/components/Fields/JobsNumberField.js +2 -1
  61. package/dist/retail/components/Fields/JobsNumberField.js.map +1 -1
  62. package/dist/retail/components/Fields/LastJobExperienceField.js +2 -1
  63. package/dist/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  64. package/dist/retail/components/Fields/OrganizationNameField.js +2 -1
  65. package/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
  66. package/dist/retail/components/Fields/WagesField.js +2 -1
  67. package/dist/retail/components/Fields/WagesField.js.map +1 -1
  68. package/dist/retail/content.js +11 -5
  69. package/dist/retail/content.js.map +1 -1
  70. package/dist/retail/model/NameFieldDef.d.ts +1 -1
  71. package/dist/retail/utils/mainFormStateMap.js +1 -0
  72. package/dist/retail/utils/mainFormStateMap.js.map +1 -1
  73. package/dist/ui-kit/FormField/Fields/PhoneField.js +2 -1
  74. package/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  75. package/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  76. package/dist/ui-kit/FormField/shouldRenderField.js +1 -1
  77. package/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
  78. package/lib/common.css +1 -1
  79. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
  80. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +26 -8
  81. package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  82. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  83. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +20 -0
  84. package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
  85. package/lib/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  86. package/lib/components/ApplicationLeadForm/applicationFormData.js +5 -30
  87. package/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  88. package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  89. package/lib/components/ApplicationLeadForm/getInitialFormState.js +8 -2
  90. package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  91. package/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  92. package/lib/components/ApplicationLeadForm/parseEsiaProfile.js +83 -53
  93. package/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  94. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -2
  95. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +12 -22
  96. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  97. package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  98. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +16 -24
  99. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  100. package/lib/retail/api/checkCode.d.ts +1 -0
  101. package/lib/retail/api/checkCode.js +1 -1
  102. package/lib/retail/api/checkCode.js.map +1 -1
  103. package/{mobile/bundle/retail/api/updateProfileEsia.d.ts → lib/retail/api/esiaRequestProfile.d.ts} +11 -4
  104. package/lib/retail/api/esiaRequestProfile.js +7 -0
  105. package/lib/retail/api/esiaRequestProfile.js.map +1 -0
  106. package/lib/retail/api/updateUserTask.d.ts +1 -0
  107. package/lib/retail/api/updateUserTask.js.map +1 -1
  108. package/lib/retail/api/uploadFile.d.ts +1 -1
  109. package/lib/retail/api/uploadFile.js +2 -3
  110. package/lib/retail/api/uploadFile.js.map +1 -1
  111. package/lib/retail/components/DraftDialog/parseDraftTask.js +2 -1
  112. package/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  113. package/lib/retail/components/Fields/BeginDateField.js +2 -1
  114. package/lib/retail/components/Fields/BeginDateField.js.map +1 -1
  115. package/lib/retail/components/Fields/ConfirmationIncomeField.js +5 -2
  116. package/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  117. package/lib/retail/components/Fields/DaDataInnField.js +2 -1
  118. package/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
  119. package/lib/retail/components/Fields/Experience5YearsField.js +2 -1
  120. package/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
  121. package/lib/retail/components/Fields/GeneralSeniorityField.js +2 -1
  122. package/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  123. package/lib/retail/components/Fields/JobsNumberField.js +2 -1
  124. package/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
  125. package/lib/retail/components/Fields/LastJobExperienceField.js +2 -1
  126. package/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  127. package/lib/retail/components/Fields/OrganizationNameField.js +2 -1
  128. package/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
  129. package/lib/retail/components/Fields/WagesField.js +2 -1
  130. package/lib/retail/components/Fields/WagesField.js.map +1 -1
  131. package/lib/retail/content.js +11 -5
  132. package/lib/retail/content.js.map +1 -1
  133. package/lib/retail/model/NameFieldDef.d.ts +1 -1
  134. package/lib/retail/utils/mainFormStateMap.js +1 -0
  135. package/lib/retail/utils/mainFormStateMap.js.map +1 -1
  136. package/lib/ui-kit/FormField/Fields/PhoneField.js +2 -1
  137. package/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  138. package/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  139. package/lib/ui-kit/FormField/shouldRenderField.js +1 -1
  140. package/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
  141. package/mobile/bundle/bundle.umd.js +229 -198
  142. package/mobile/bundle/bundle.umd.min.js +1 -1
  143. package/mobile/bundle/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
  144. package/mobile/bundle/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  145. package/mobile/bundle/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  146. package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  147. package/mobile/bundle/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  148. package/mobile/bundle/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -2
  149. package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  150. package/mobile/bundle/retail/api/checkCode.d.ts +1 -0
  151. package/{dist/retail/api/updateProfileEsia.d.ts → mobile/bundle/retail/api/esiaRequestProfile.d.ts} +11 -4
  152. package/mobile/bundle/retail/api/updateUserTask.d.ts +1 -0
  153. package/mobile/bundle/retail/api/uploadFile.d.ts +1 -1
  154. package/mobile/bundle/retail/model/NameFieldDef.d.ts +1 -1
  155. package/mobile/bundle/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  156. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
  157. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +26 -8
  158. package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  159. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  160. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +22 -0
  161. package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
  162. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  163. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js +6 -31
  164. package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  165. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  166. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js +8 -2
  167. package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  168. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  169. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js +83 -53
  170. package/mobile/dist/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  171. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -2
  172. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +12 -22
  173. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  174. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  175. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +16 -24
  176. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  177. package/mobile/dist/retail/api/checkCode.d.ts +1 -0
  178. package/mobile/dist/retail/api/checkCode.js +3 -2
  179. package/mobile/dist/retail/api/checkCode.js.map +1 -1
  180. package/mobile/dist/retail/api/esiaRequestProfile.d.ts +84 -0
  181. package/mobile/dist/retail/api/esiaRequestProfile.js +10 -0
  182. package/mobile/dist/retail/api/esiaRequestProfile.js.map +1 -0
  183. package/mobile/dist/retail/api/updateUserTask.d.ts +1 -0
  184. package/mobile/dist/retail/api/updateUserTask.js.map +1 -1
  185. package/mobile/dist/retail/api/uploadFile.d.ts +1 -1
  186. package/mobile/dist/retail/api/uploadFile.js +2 -3
  187. package/mobile/dist/retail/api/uploadFile.js.map +1 -1
  188. package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js +2 -1
  189. package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  190. package/mobile/dist/retail/components/Fields/BeginDateField.js +2 -1
  191. package/mobile/dist/retail/components/Fields/BeginDateField.js.map +1 -1
  192. package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js +4 -1
  193. package/mobile/dist/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  194. package/mobile/dist/retail/components/Fields/DaDataInnField.js +2 -1
  195. package/mobile/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
  196. package/mobile/dist/retail/components/Fields/Experience5YearsField.js +2 -1
  197. package/mobile/dist/retail/components/Fields/Experience5YearsField.js.map +1 -1
  198. package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js +2 -1
  199. package/mobile/dist/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  200. package/mobile/dist/retail/components/Fields/JobsNumberField.js +2 -1
  201. package/mobile/dist/retail/components/Fields/JobsNumberField.js.map +1 -1
  202. package/mobile/dist/retail/components/Fields/LastJobExperienceField.js +2 -1
  203. package/mobile/dist/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  204. package/mobile/dist/retail/components/Fields/OrganizationNameField.js +2 -1
  205. package/mobile/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
  206. package/mobile/dist/retail/components/Fields/WagesField.js +2 -1
  207. package/mobile/dist/retail/components/Fields/WagesField.js.map +1 -1
  208. package/mobile/dist/retail/content.js +11 -5
  209. package/mobile/dist/retail/content.js.map +1 -1
  210. package/mobile/dist/retail/model/NameFieldDef.d.ts +1 -1
  211. package/mobile/dist/retail/utils/mainFormStateMap.js +1 -0
  212. package/mobile/dist/retail/utils/mainFormStateMap.js.map +1 -1
  213. package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js +2 -1
  214. package/mobile/dist/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  215. package/mobile/dist/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  216. package/mobile/dist/ui-kit/FormField/shouldRenderField.js +1 -1
  217. package/mobile/dist/ui-kit/FormField/shouldRenderField.js.map +1 -1
  218. package/mobile/lib/common.css +1 -1
  219. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.d.ts +5 -0
  220. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +26 -8
  221. package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
  222. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.d.ts +4 -0
  223. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +20 -0
  224. package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -0
  225. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.d.ts +0 -1
  226. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js +5 -30
  227. package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
  228. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -1
  229. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js +8 -2
  230. package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
  231. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.d.ts +2 -2
  232. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js +83 -53
  233. package/mobile/lib/components/ApplicationLeadForm/parseEsiaProfile.js.map +1 -1
  234. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.d.ts +1 -2
  235. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +12 -22
  236. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  237. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +4 -4
  238. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +16 -24
  239. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  240. package/mobile/lib/retail/api/checkCode.d.ts +1 -0
  241. package/mobile/lib/retail/api/checkCode.js +1 -1
  242. package/mobile/lib/retail/api/checkCode.js.map +1 -1
  243. package/mobile/lib/retail/api/esiaRequestProfile.d.ts +84 -0
  244. package/mobile/lib/retail/api/esiaRequestProfile.js +7 -0
  245. package/mobile/lib/retail/api/esiaRequestProfile.js.map +1 -0
  246. package/mobile/lib/retail/api/updateUserTask.d.ts +1 -0
  247. package/mobile/lib/retail/api/updateUserTask.js.map +1 -1
  248. package/mobile/lib/retail/api/uploadFile.d.ts +1 -1
  249. package/mobile/lib/retail/api/uploadFile.js +2 -3
  250. package/mobile/lib/retail/api/uploadFile.js.map +1 -1
  251. package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js +2 -1
  252. package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
  253. package/mobile/lib/retail/components/Fields/BeginDateField.js +2 -1
  254. package/mobile/lib/retail/components/Fields/BeginDateField.js.map +1 -1
  255. package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js +5 -2
  256. package/mobile/lib/retail/components/Fields/ConfirmationIncomeField.js.map +1 -1
  257. package/mobile/lib/retail/components/Fields/DaDataInnField.js +2 -1
  258. package/mobile/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
  259. package/mobile/lib/retail/components/Fields/Experience5YearsField.js +2 -1
  260. package/mobile/lib/retail/components/Fields/Experience5YearsField.js.map +1 -1
  261. package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js +2 -1
  262. package/mobile/lib/retail/components/Fields/GeneralSeniorityField.js.map +1 -1
  263. package/mobile/lib/retail/components/Fields/JobsNumberField.js +2 -1
  264. package/mobile/lib/retail/components/Fields/JobsNumberField.js.map +1 -1
  265. package/mobile/lib/retail/components/Fields/LastJobExperienceField.js +2 -1
  266. package/mobile/lib/retail/components/Fields/LastJobExperienceField.js.map +1 -1
  267. package/mobile/lib/retail/components/Fields/OrganizationNameField.js +2 -1
  268. package/mobile/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
  269. package/mobile/lib/retail/components/Fields/WagesField.js +2 -1
  270. package/mobile/lib/retail/components/Fields/WagesField.js.map +1 -1
  271. package/mobile/lib/retail/content.js +11 -5
  272. package/mobile/lib/retail/content.js.map +1 -1
  273. package/mobile/lib/retail/model/NameFieldDef.d.ts +1 -1
  274. package/mobile/lib/retail/utils/mainFormStateMap.js +1 -0
  275. package/mobile/lib/retail/utils/mainFormStateMap.js.map +1 -1
  276. package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js +2 -1
  277. package/mobile/lib/ui-kit/FormField/Fields/PhoneField.js.map +1 -1
  278. package/mobile/lib/ui-kit/FormField/shouldRenderField.d.ts +1 -1
  279. package/mobile/lib/ui-kit/FormField/shouldRenderField.js +1 -1
  280. package/mobile/lib/ui-kit/FormField/shouldRenderField.js.map +1 -1
  281. package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +31 -10
  282. package/mobile/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +51 -0
  283. package/mobile/src/components/ApplicationLeadForm/applicationFormData.tsx +5 -31
  284. package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +8 -1
  285. package/mobile/src/components/ApplicationLeadForm/parseEsiaProfile.ts +91 -66
  286. package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +57 -73
  287. package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +32 -48
  288. package/mobile/src/retail/api/checkCode.ts +1 -1
  289. package/mobile/src/retail/api/{updateProfileEsia.ts → esiaRequestProfile.ts} +16 -5
  290. package/mobile/src/retail/api/updateUserTask.ts +1 -0
  291. package/mobile/src/retail/api/uploadFile.ts +2 -3
  292. package/mobile/src/retail/components/DraftDialog/parseDraftTask.ts +2 -0
  293. package/mobile/src/retail/components/Fields/BeginDateField.tsx +2 -0
  294. package/mobile/src/retail/components/Fields/ConfirmationIncomeField.tsx +18 -7
  295. package/mobile/src/retail/components/Fields/DaDataInnField.tsx +2 -0
  296. package/mobile/src/retail/components/Fields/Experience5YearsField.tsx +2 -0
  297. package/mobile/src/retail/components/Fields/GeneralSeniorityField.tsx +2 -0
  298. package/mobile/src/retail/components/Fields/JobsNumberField.tsx +2 -0
  299. package/mobile/src/retail/components/Fields/LastJobExperienceField.tsx +2 -0
  300. package/mobile/src/retail/components/Fields/OrganizationNameField.tsx +2 -0
  301. package/mobile/src/retail/components/Fields/WagesField.tsx +2 -0
  302. package/mobile/src/retail/content.tsx +11 -5
  303. package/mobile/src/retail/model/NameFieldDef.ts +1 -0
  304. package/mobile/src/retail/utils/mainFormStateMap.ts +1 -0
  305. package/mobile/src/ui-kit/FormField/Fields/PhoneField.tsx +9 -1
  306. package/mobile/src/ui-kit/FormField/shouldRenderField.tsx +2 -1
  307. package/package.json +1 -1
  308. package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +31 -10
  309. package/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +51 -0
  310. package/src/components/ApplicationLeadForm/applicationFormData.tsx +5 -31
  311. package/src/components/ApplicationLeadForm/getInitialFormState.tsx +8 -1
  312. package/src/components/ApplicationLeadForm/parseEsiaProfile.ts +91 -66
  313. package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +57 -73
  314. package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +32 -48
  315. package/src/retail/api/checkCode.ts +1 -1
  316. package/src/retail/api/{updateProfileEsia.ts → esiaRequestProfile.ts} +16 -5
  317. package/src/retail/api/updateUserTask.ts +1 -0
  318. package/src/retail/api/uploadFile.ts +2 -3
  319. package/src/retail/components/DraftDialog/parseDraftTask.ts +2 -0
  320. package/src/retail/components/Fields/BeginDateField.tsx +2 -0
  321. package/src/retail/components/Fields/ConfirmationIncomeField.tsx +18 -7
  322. package/src/retail/components/Fields/DaDataInnField.tsx +2 -0
  323. package/src/retail/components/Fields/Experience5YearsField.tsx +2 -0
  324. package/src/retail/components/Fields/GeneralSeniorityField.tsx +2 -0
  325. package/src/retail/components/Fields/JobsNumberField.tsx +2 -0
  326. package/src/retail/components/Fields/LastJobExperienceField.tsx +2 -0
  327. package/src/retail/components/Fields/OrganizationNameField.tsx +2 -0
  328. package/src/retail/components/Fields/WagesField.tsx +2 -0
  329. package/src/retail/content.tsx +11 -5
  330. package/src/retail/model/NameFieldDef.ts +1 -0
  331. package/src/retail/utils/mainFormStateMap.ts +1 -0
  332. package/src/ui-kit/FormField/Fields/PhoneField.tsx +9 -1
  333. package/src/ui-kit/FormField/shouldRenderField.tsx +2 -1
  334. package/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  335. package/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  336. package/dist/retail/api/updateProfileEsia.js +0 -6
  337. package/dist/retail/api/updateProfileEsia.js.map +0 -1
  338. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  339. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -34
  340. package/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
  341. package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  342. package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -15
  343. package/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
  344. package/lib/retail/api/updateProfileEsia.js +0 -3
  345. package/lib/retail/api/updateProfileEsia.js.map +0 -1
  346. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  347. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.d.ts +0 -5
  348. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -32
  349. package/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
  350. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  351. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -12
  352. package/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
  353. package/mobile/bundle/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  354. package/mobile/bundle/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  355. package/mobile/dist/retail/api/updateProfileEsia.d.ts +0 -77
  356. package/mobile/dist/retail/api/updateProfileEsia.js +0 -6
  357. package/mobile/dist/retail/api/updateProfileEsia.js.map +0 -1
  358. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  359. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -34
  360. package/mobile/dist/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
  361. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  362. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -15
  363. package/mobile/dist/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
  364. package/mobile/lib/retail/api/updateProfileEsia.d.ts +0 -77
  365. package/mobile/lib/retail/api/updateProfileEsia.js +0 -3
  366. package/mobile/lib/retail/api/updateProfileEsia.js.map +0 -1
  367. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.d.ts +0 -4
  368. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js +0 -32
  369. package/mobile/lib/retail/components/EsiaLoginDialog/EsiaLoginDialog.js.map +0 -1
  370. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.d.ts +0 -1
  371. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js +0 -12
  372. package/mobile/lib/retail/components/EsiaLoginDialog/useEsiaLoginDialog.js.map +0 -1
  373. package/mobile/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +0 -65
  374. package/mobile/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +0 -13
  375. package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.fixture.tsx +0 -7
  376. package/src/retail/components/EsiaLoginDialog/EsiaLoginDialog.tsx +0 -65
  377. package/src/retail/components/EsiaLoginDialog/useEsiaLoginDialog.tsx +0 -13
@@ -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", ...field(fieldName), ...input });
2025
+ return (jsx(InputPhoneControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", disabled: input?.filledByEsia && isEsiaAuthorize(field, input.name ?? ''), ...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?.find((_) => _ === (value?.key ?? value));
2205
+ return !condition || condition?.values?.includes(value?.key ?? value);
2206
2206
  }
2207
2207
 
2208
2208
  const PRODUCT_REF = {
@@ -2660,11 +2660,11 @@
2660
2660
  {
2661
2661
  columns: 2,
2662
2662
  inputs: [
2663
- { name: 'surname', required: true, dadata: true },
2664
- { name: 'name', required: true, dadata: true },
2665
- { name: 'middleName', dadata: true },
2666
- { name: 'limitedBirthday', required: true },
2667
- { name: 'phone', required: true },
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 },
2668
2668
  { name: 'email', required: true, dadata: true },
2669
2669
  ],
2670
2670
  },
@@ -2674,6 +2674,57 @@
2674
2674
  ];
2675
2675
  };
2676
2676
 
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
+
2677
2728
  const debounce = (fn, delay = 600) => {
2678
2729
  let timerId;
2679
2730
  const debouncedCallback = (...args) => {
@@ -3560,42 +3611,6 @@
3560
3611
  const mapByIndex = (points, index) => points.map((_) => _.coords?.[index]);
3561
3612
  const getArraySumAndAverage = (arr) => arr.length && arr.reduce((a, b) => a + b) / arr.length;
3562
3613
 
3563
- const getTraceId = () => {
3564
- const result = new Uint8Array(8);
3565
- globalThis.crypto.getRandomValues(result);
3566
- return result.reduce((acc, _) => `${acc}${_.toString(16).padStart(2, '0')}`, '');
3567
- };
3568
-
3569
- const fetchRetailJSON = async (url, method, body) => {
3570
- try {
3571
- const response = await doRequest(url, method, body);
3572
- return response.json();
3573
- }
3574
- catch (err) {
3575
- console.error(err);
3576
- return null;
3577
- }
3578
- };
3579
- async function doRequest(url, method, body) {
3580
- const traceId = getTraceId();
3581
- return globalThis?.fetch?.(`${RETAIL_API_BASE_URI}${url}`, {
3582
- method,
3583
- headers: {
3584
- 'Content-Type': 'application/json',
3585
- 'X-B3-Sampled': '1',
3586
- 'X-B3-Spanid': traceId,
3587
- 'X-B3-Traceid': traceId,
3588
- ...getAuthorizationHeaders(),
3589
- },
3590
- credentials: 'include',
3591
- body: body ? JSON.stringify(body) : null,
3592
- });
3593
- }
3594
- const getAuthorizationHeaders = () => {
3595
- const token = sessionStorage.getItem('accessToken');
3596
- return token ? { Authorization: `Bearer ${token}` } : null;
3597
- };
3598
-
3599
3614
  const fetchRegionOffices = async (regionKey) => {
3600
3615
  const response = await fetchRetailJSON('/public-data/regionOffices', 'POST', {
3601
3616
  regionRfCd: {
@@ -3825,7 +3840,7 @@
3825
3840
 
3826
3841
  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 ?? '') })));
3827
3842
 
3828
- 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 })));
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 ?? '') })));
3829
3844
 
3830
3845
  const FIELD_NAME$2 = 'birthPlace';
3831
3846
  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) })));
@@ -3889,7 +3904,8 @@
3889
3904
 
3890
3905
  const ConfirmationIncomeField = JSX(({ field, input }) => {
3891
3906
  const { data: confirmationIncome } = useLeadFormData('INCOME_CERT_UNITED');
3892
- 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 }));
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 })] }));
3893
3909
  });
3894
3910
 
3895
3911
  const ConscriptionField = JSX(({ field, input }) => {
@@ -4433,7 +4449,7 @@
4433
4449
  }
4434
4450
  })();
4435
4451
  }, [employerActivities, employerOrganization, organization, amountWorkers]);
4436
- return (jsx(DaDataInputControl, { label: "\u0418\u041D\u041D", isInteger: true, maxLength: 12, ...input, ...field(input?.name ?? ''), onDaDataChange: onDaDataChange }));
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 ?? '') }));
4437
4453
  });
4438
4454
 
4439
4455
  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() })));
@@ -4516,7 +4532,7 @@
4516
4532
  const MIN_YEARS = 0;
4517
4533
  const Experience5YearsField = JSX(({ field, input }) => {
4518
4534
  const onChange = useCallback((value) => field(input?.name ?? '')?.onChange?.(String(clamp(Number(value), MIN_YEARS, MAX_YEARS))), []);
4519
- 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 }));
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 ?? '') }));
4520
4536
  });
4521
4537
 
4522
4538
  const FamilyMembersField = JSX(({ field, input }) => {
@@ -4537,7 +4553,7 @@
4537
4553
  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 }));
4538
4554
  });
4539
4555
 
4540
- 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 })));
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 ?? '') })));
4541
4557
 
4542
4558
  const HousingField = JSX(({ field, input }) => {
4543
4559
  const { data: housing } = useLeadFormData('HOUSE_TYPE');
@@ -4546,9 +4562,9 @@
4546
4562
 
4547
4563
  const InfoCardField = JSX(({ input }) => (jsx(InfoCard, { __html: input?.label })));
4548
4564
 
4549
- 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 })));
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 ?? '') })));
4550
4566
 
4551
- 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 })));
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 ?? '') })));
4552
4568
 
4553
4569
  const latinPattern = /^[\u0041-\u005A\u0061-\u007A\s]+$/u;
4554
4570
  const isLatin = (_ = '') => latinPattern.test(_);
@@ -4714,7 +4730,7 @@
4714
4730
  field?.('inn')?.onChange?.(item.data?.inn);
4715
4731
  updateOrganizationFields(store, field, item);
4716
4732
  }, []);
4717
- 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 }));
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 }));
4718
4734
  });
4719
4735
 
4720
4736
  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 })));
@@ -4861,7 +4877,7 @@
4861
4877
 
4862
4878
  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 })));
4863
4879
 
4864
- 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 })));
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 ?? '') })));
4865
4881
 
4866
4882
  const DELIVERY_CITIES_REF = {
4867
4883
  $ref: '/wcms-resources/delivery-cities-data.json',
@@ -5491,7 +5507,7 @@
5491
5507
  const participant = task.participants[0];
5492
5508
  const { classCard: cardCategory, codeWord, paymentSystemTypeCd: paymentSystem, currencyCode: currency, } = task;
5493
5509
  const { loanAmount: moneyValue, creditPeriod: monthsValue, paymentTypeCd } = task;
5494
- 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;
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;
5495
5511
  return {
5496
5512
  currency: currency?.key,
5497
5513
  paymentSystem: getSelectValue(paymentSystem),
@@ -5543,6 +5559,7 @@
5543
5559
  monthsValue,
5544
5560
  isAnnuity: paymentTypeCd?.key === 'ANNUITY',
5545
5561
  },
5562
+ esiaAccountTypeCd: profile?.esiaAccountTypeCd,
5546
5563
  ...getParticipantIncomes(participantIncomes),
5547
5564
  ...getParticipantAddresses(participantAddresses),
5548
5565
  ...getParticipantContacts(participantContacts),
@@ -5597,39 +5614,6 @@
5597
5614
  };
5598
5615
  };
5599
5616
 
5600
- const getLink = (body) => fetchRetailJSON('/esia/getLink', 'POST', body);
5601
-
5602
- const EsiaLoginDialog = JSX(({ onClose }) => {
5603
- const navigator = locationNavigator();
5604
- const retailFormStore = useRetailFormStore();
5605
- const handleAuth = useCallback(async () => {
5606
- const resp = await getLink({
5607
- redirectUri: globalThis.location.origin + globalThis.location.pathname,
5608
- });
5609
- if (resp?.link) {
5610
- navigator.assign(resp.link);
5611
- globalThis.location.href = resp.link;
5612
- }
5613
- }, []);
5614
- const handleClose = useCallback(() => {
5615
- if (retailFormStore.leadForm) {
5616
- const leadForm = { ...retailFormStore.leadForm };
5617
- delete leadForm.esiaAccountTypeCd;
5618
- retailFormStore.leadForm = leadForm;
5619
- }
5620
- onClose?.();
5621
- }, []);
5622
- 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" })] })] }) }));
5623
- });
5624
-
5625
- const useEsiaLoginDialog = (nextStepLink) => {
5626
- const { open } = useDialog(EsiaLoginDialog);
5627
- const navigator = locationNavigator();
5628
- return useCallback(() => {
5629
- open({ onClose: () => navigator.assign(nextStepLink) });
5630
- }, [open, nextStepLink]);
5631
- };
5632
-
5633
5617
  // TODO Не должно быть импортов из бизнес-слоя в API слой. Только наоборот.
5634
5618
  const getUpdateUserProfileData = (profileId, formData, consents) => {
5635
5619
  const { name = '', surname = '', middleName = '', limitedBirthday = '', phone = '', email = '', } = formData;
@@ -5751,43 +5735,40 @@
5751
5735
 
5752
5736
  /* eslint-disable max-lines */
5753
5737
  // eslint-disable-next-line max-lines-per-function
5754
- const useApplicationLeadApi = ({ programId, nextStepLink, productType, esiaError, data, }) => {
5738
+ const useApplicationLeadApi = ({ programId, nextStepLink, productType, data, }) => {
5755
5739
  const [isSending, { setTrue: startSending, setFalse: endSending }] = useBool(false);
5756
5740
  const [ok, setOK] = useState();
5757
5741
  const saveUserData = useSaveUserData();
5758
5742
  const sendAspects = useSendLeadFormAspects({ data });
5759
5743
  const navigator = locationNavigator();
5760
- const openEsiaLoginDialog = useEsiaLoginDialog(nextStepLink);
5761
- const consentBkiDialog = useConsentBkiDialog(openEsiaLoginDialog);
5744
+ const goToNextStep = useCallback(() => {
5745
+ navigator.assign(nextStepLink);
5746
+ }, []);
5747
+ const consentBkiDialog = useConsentBkiDialog(goToNextStep);
5762
5748
  const verifyPhoneDialog = useDialog(VerifyPhoneDialog);
5763
5749
  const draftDialog = useDraftDialog();
5764
5750
  const handleSubmit = useCallback(async (formData) => {
5765
- if (esiaError) {
5766
- navigator.assign(nextStepLink);
5767
- return;
5768
- }
5769
5751
  try {
5770
5752
  startSending();
5771
- const transformedFormData = transformFormData(formData);
5772
5753
  const profileId = await createUserProfile({
5773
- profile: { phone: formatPhone(transformedFormData.phone) },
5754
+ profile: { phone: formatPhone(formData.phone) },
5774
5755
  });
5775
- if (profileId && transformedFormData?.phone) {
5756
+ if (profileId && formData?.phone) {
5776
5757
  const sendCurrentTask = async () => {
5777
5758
  await updateUserData({
5778
5759
  programId,
5779
5760
  profileId,
5780
- formData: transformedFormData,
5761
+ formData,
5781
5762
  productType,
5782
5763
  saveUserData,
5783
5764
  sendAspects,
5784
5765
  });
5785
5766
  verifyPhoneDialog.close();
5786
5767
  if (productType === 'debitCard') {
5787
- openEsiaLoginDialog();
5768
+ goToNextStep();
5788
5769
  }
5789
5770
  else {
5790
- consentBkiDialog.open(transformedFormData.phone, profileId);
5771
+ consentBkiDialog.open(formData.phone, profileId);
5791
5772
  }
5792
5773
  };
5793
5774
  const handleSuccessVerify = async () => {
@@ -5813,7 +5794,7 @@
5813
5794
  };
5814
5795
  const acceptedConsents = getAcceptedConsents(formData, productType);
5815
5796
  verifyPhoneDialog.open({
5816
- phone: transformedFormData?.phone,
5797
+ phone: formData?.phone,
5817
5798
  consents: acceptedConsents,
5818
5799
  onSuccess: handleSuccessVerify,
5819
5800
  });
@@ -5823,7 +5804,7 @@
5823
5804
  catch {
5824
5805
  setOK(false);
5825
5806
  }
5826
- }, [esiaError]);
5807
+ }, []);
5827
5808
  return { isSending, ok, handleSubmit };
5828
5809
  };
5829
5810
  const getAcceptedConsents = (formData, productType) => {
@@ -5895,12 +5876,6 @@
5895
5876
  consentAssignmentClaimsFlg: consentOthersFlg,
5896
5877
  };
5897
5878
  };
5898
- const transformFormData = (formData) => ({
5899
- ...formData,
5900
- surname: formData.surname?.trim(),
5901
- name: formData.name?.trim(),
5902
- middleName: formData.middleName?.trim(),
5903
- });
5904
5879
 
5905
5880
  const useSetter = (target, key) => useCallback((value) => {
5906
5881
  const newValue = value instanceof Function ? value(target[key]) : value;
@@ -5912,7 +5887,10 @@
5912
5887
  }
5913
5888
  }, [target, key]);
5914
5889
 
5915
- const updateProfileEsia = (body) => fetchRetailJSON('/esia/updateProfileEsia', 'POST', body);
5890
+ const esiaRequestProfile = (body) => fetchRetailJSON('/esia/requestProfile', 'POST', body).then((res) => {
5891
+ saveToken(res);
5892
+ return res;
5893
+ });
5916
5894
 
5917
5895
  const initialFormState = {
5918
5896
  surname: '',
@@ -5930,19 +5908,24 @@
5930
5908
  consentPhotoFlg: false,
5931
5909
  consentFATCA: false,
5932
5910
  };
5933
- const getInitialFormState$1 = (inputs, savedForm) => {
5911
+ const getInitialFormState$1 = (inputs, savedForm, esiaAuthSuccess) => {
5934
5912
  if (savedForm) {
5935
- return { ...savedForm, limitedBirthday: new Date(savedForm?.limitedBirthday || 0) };
5913
+ return {
5914
+ ...savedForm,
5915
+ limitedBirthday: new Date(savedForm?.limitedBirthday || 0),
5916
+ ...(!esiaAuthSuccess && {
5917
+ esiaAccountTypeCd: { key: '' },
5918
+ }),
5919
+ };
5936
5920
  }
5937
5921
  const formState = Object.fromEntries(inputs.map((_) => [_.name, initialFormState[_.name || '']]));
5938
5922
  return { ...formState };
5939
5923
  };
5940
5924
 
5941
- const uploadFile = async (file, taskId, documentCategory) => {
5925
+ const uploadFile = async (file, documentCategory, isPDF = false) => {
5942
5926
  const fd = new FormData();
5943
- fd.append('taskId', taskId);
5944
5927
  fd.append('documentCategory', documentCategory);
5945
- fd.append('file', file, 'file.pdf');
5928
+ fd.append('file', file, `file.${isPDF ? 'pdf' : 'xml'}`);
5946
5929
  const res = await globalThis
5947
5930
  ?.fetch?.(`/light-api-cash/v1/file`, {
5948
5931
  method: 'POST',
@@ -5956,23 +5939,13 @@
5956
5939
  return res;
5957
5940
  };
5958
5941
 
5959
- const parseEsiaProfile = async (esiaProfile, taskId, isDebit) => {
5960
- isDebit ? checkEsiaDataForDebit(esiaProfile) : checkEsiaDataForCredit(esiaProfile);
5942
+ const parseEsiaProfile = async (esiaProfile, isDebit) => {
5943
+ checkEsiaData(esiaProfile);
5944
+ const isFullEsiaData = !isDebit && checkEsiaAdditionalDocument(esiaProfile);
5961
5945
  const { profile, addInfo, document, addressRegistration, addressFact, esiaAdditionalDocument } = esiaProfile;
5962
- const files = [];
5963
- if (!isDebit) {
5964
- await saveDocument({
5965
- document: esiaAdditionalDocument.pdfFileWorkbook,
5966
- taskId,
5967
- category: 'CONFIRMING_INCOME_DOC',
5968
- files,
5969
- });
5970
- await saveDocument({
5971
- document: esiaAdditionalDocument.pdfFilePayout,
5972
- taskId,
5973
- category: 'CONFIRMING_EMPLOYMENT_DOC',
5974
- files,
5975
- });
5946
+ let files = [];
5947
+ if (isFullEsiaData) {
5948
+ files = await saveDocuments(esiaAdditionalDocument);
5976
5949
  }
5977
5950
  const mainData = {
5978
5951
  name: profile.name,
@@ -5989,11 +5962,11 @@
5989
5962
  birthPlace: addInfo.birthPlace,
5990
5963
  addressRegistration: buildAddress(addressRegistration),
5991
5964
  addressFact: buildAddress(addressFact),
5992
- esiaAccountTypeCd: profile.esiaAccountType,
5965
+ esiaAccountTypeCd: isDebit ? profile.esiaAccountType : { key: '' },
5993
5966
  };
5994
5967
  return {
5995
5968
  ...mainData,
5996
- ...(!isDebit && {
5969
+ ...(isFullEsiaData && {
5997
5970
  snils: addInfo.snils,
5998
5971
  inn: esiaAdditionalDocument.inn,
5999
5972
  wages: Math.floor(esiaAdditionalDocument.averageMonthlyIncome)?.toString(),
@@ -6002,6 +5975,9 @@
6002
5975
  generalSeniority: getYearFromMonth(esiaAdditionalDocument.workLength).toString(),
6003
5976
  lastJobExperience: getYearFromMonth(esiaAdditionalDocument.workLengthLastJob).toString(),
6004
5977
  jobsNumber: esiaAdditionalDocument.jobsNumberInFiveYears.toString(),
5978
+ esiaAccountTypeCd: profile.esiaAccountType,
5979
+ confirmationIncome: { key: 'SFR_CERTIFICATE', text: 'Запрос Банком доходов из СФР' },
5980
+ employment: { key: 'WORK', text: 'Работаю' },
6005
5981
  files,
6006
5982
  }),
6007
5983
  };
@@ -6034,43 +6010,60 @@
6034
6010
  };
6035
6011
  };
6036
6012
  const getYearFromMonth = (month) => Math.floor(month / 12);
6037
- const saveDocument = async ({ document, taskId, category, files, }) => {
6038
- await fetch(`data:application/pdf;base64,${document}`)
6039
- .then((res) => res.blob())
6040
- .then((value) => uploadFile(value, taskId, category))
6041
- .then((file) => files.push(file));
6042
- };
6043
- const checkEsiaDataForCredit = (esiaProfile) => {
6044
- const { profile, document, addressRegistration, esiaAdditionalDocument } = esiaProfile;
6045
- const data = [
6046
- profile.name,
6047
- profile.surname,
6048
- profile.midname,
6049
- profile.birthDate,
6050
- profile.phone,
6051
- profile.email,
6052
- document.dulIssueDate,
6053
- document.dulIssuedBy,
6054
- document.dulNumber,
6055
- document.dulSerie,
6056
- document.dulSubdivisionCode,
6057
- addressRegistration,
6058
- profile.esiaAccountType,
6059
- esiaAdditionalDocument.inn,
6060
- esiaAdditionalDocument.averageMonthlyIncome.toString(),
6061
- esiaAdditionalDocument.startWorkDate,
6062
- esiaAdditionalDocument.workLengthInFiveYears.toString(),
6063
- esiaAdditionalDocument.workLength.toString(),
6064
- esiaAdditionalDocument.workLengthLastJob.toString(),
6065
- esiaAdditionalDocument.jobsNumberInFiveYears.toString(),
6066
- esiaAdditionalDocument.pdfFilePayout,
6067
- esiaAdditionalDocument.pdfFileWorkbook,
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
+ },
6068
6056
  ];
6069
- if (!data.every((_) => Boolean(_))) {
6070
- throw new Error();
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));
6071
6063
  }
6064
+ return files;
6072
6065
  };
6073
- const checkEsiaDataForDebit = (esiaProfile) => {
6066
+ const checkEsiaData = (esiaProfile) => {
6074
6067
  const { profile, document, addressRegistration } = esiaProfile;
6075
6068
  const data = [
6076
6069
  profile.name,
@@ -6078,7 +6071,6 @@
6078
6071
  profile.midname,
6079
6072
  profile.birthDate,
6080
6073
  profile.phone,
6081
- profile.email,
6082
6074
  document.dulIssueDate,
6083
6075
  document.dulIssuedBy,
6084
6076
  document.dulNumber,
@@ -6091,75 +6083,97 @@
6091
6083
  throw new Error();
6092
6084
  }
6093
6085
  };
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
+ };
6094
6107
 
6095
- const useInitApplicationLead = ({ inputs, nextStepLink, productType, setEsiaError, }) => {
6096
- const navigator = locationNavigator();
6097
- const [isLoading, { setTrue: startLoading, setFalse: endLoading }] = useBool(false);
6108
+ const useInitApplicationLead = ({ inputs, productType, setEsiaStatus, esiaAuthSuccess, }) => {
6098
6109
  const leadFormStore = useLeadFormStore();
6099
6110
  const saveForm = useSetter(leadFormStore, 'leadForm');
6100
- const initialFormState = useMemo(() => getInitialFormState$1(inputs, leadFormStore.leadForm), [inputs, leadFormStore.leadForm]);
6101
- const updateEsiaProfile = useCallback(async (profileId, code, state) => {
6102
- startLoading();
6111
+ const initialFormState = useMemo(() => getInitialFormState$1(inputs, leadFormStore.leadForm, esiaAuthSuccess), [inputs, leadFormStore.leadForm]);
6112
+ const requestEsiaProfile = useCallback(async (code, state) => {
6113
+ setEsiaStatus(EsiaStatuses.Pending);
6103
6114
  try {
6104
- const data = await updateProfileEsia({
6105
- profileId,
6115
+ const data = await esiaRequestProfile({
6106
6116
  code,
6107
6117
  state,
6108
6118
  redirectUri: globalThis.location?.href,
6119
+ authorize: true,
6109
6120
  });
6110
- if (data && leadFormStore?.taskId) {
6111
- const parsedData = await parseEsiaProfile(data, leadFormStore.taskId.toString(), productType === 'debitCard');
6121
+ if (data) {
6122
+ const parsedData = await parseEsiaProfile(data, productType === 'debitCard');
6112
6123
  saveForm((_) => ({
6113
6124
  ..._,
6114
6125
  ...parsedData,
6115
6126
  }));
6127
+ setEsiaStatus(EsiaStatuses.Success);
6116
6128
  }
6117
- navigator.assign(nextStepLink);
6118
6129
  }
6119
6130
  catch {
6120
- setEsiaError();
6121
- }
6122
- finally {
6123
- endLoading();
6131
+ setEsiaStatus(EsiaStatuses.Error);
6124
6132
  }
6125
- }, [nextStepLink]);
6133
+ }, []);
6126
6134
  useEffect(() => {
6127
6135
  leadFormStore.productType = productType;
6128
- const profileId = (safeJsonParse(globalThis.localStorage?.getItem('profileId') ?? ''));
6129
6136
  const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
6130
6137
  const code = params.get('code');
6131
6138
  const state = params.get('state');
6132
- if (profileId && code && state) {
6133
- updateEsiaProfile(profileId, code, state);
6139
+ if (code && state) {
6140
+ requestEsiaProfile(code, state);
6134
6141
  }
6135
6142
  else {
6136
6143
  sessionStorage.removeItem('accessToken');
6137
6144
  sessionStorage.removeItem('refreshToken');
6138
6145
  }
6139
6146
  }, []);
6140
- return [initialFormState, { isLoading }];
6147
+ return initialFormState;
6141
6148
  };
6142
6149
 
6150
+ var EsiaStatuses;
6151
+ (function (EsiaStatuses) {
6152
+ EsiaStatuses["Success"] = "SUCCESS";
6153
+ EsiaStatuses["Error"] = "ERROR";
6154
+ EsiaStatuses["Pending"] = "PENDING";
6155
+ })(EsiaStatuses || (EsiaStatuses = {}));
6143
6156
  const ApplicationLeadForm = JSX(({ className, title, programId = '', nextStepLink = '/credit-lead', button, productType = 'credit', data, ...rest }) => {
6144
- const [esiaError, { setTrue: setEsiaError }] = useBool(false);
6157
+ const [esiaStatus, setEsiaStatus] = useState();
6158
+ const leadForm = useRef(null);
6145
6159
  const applicationFormData = useMemo(() => getApplicationFormData(productType), [productType]);
6146
6160
  const inputs = useMemo(() => getInputs(applicationFormData), [applicationFormData]);
6147
6161
  const extendedValidatorObj = useMemo(() => getExtendedValidatorObj(productType), [productType]);
6148
6162
  const formValidator = useMemo(() => getFormValidator(inputs, extendedValidatorObj), [inputs, extendedValidatorObj]);
6149
- const [initialFormState, { isLoading }] = useInitApplicationLead({
6163
+ const initialFormState = useInitApplicationLead({
6150
6164
  inputs,
6151
6165
  nextStepLink,
6152
6166
  productType,
6153
- setEsiaError,
6167
+ setEsiaStatus,
6168
+ esiaAuthSuccess: esiaStatus === EsiaStatuses.Success,
6154
6169
  });
6155
6170
  const { isSending, ok, handleSubmit } = useApplicationLeadApi({
6156
6171
  programId,
6157
6172
  nextStepLink,
6158
6173
  productType,
6159
- esiaError,
6160
6174
  data,
6161
6175
  });
6162
- const [, { field, onSubmit }] = useForm(initialFormState, {
6176
+ const [, { field, onSubmit, reset }] = useForm(initialFormState, {
6163
6177
  formValidator,
6164
6178
  onSubmit: handleSubmit,
6165
6179
  });
@@ -6169,7 +6183,17 @@
6169
6183
  responseTypeDialog.open({ ok });
6170
6184
  }
6171
6185
  }, [ok]);
6172
- 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] }) }));
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] })] }));
6173
6197
  });
6174
6198
  const getInputs = (applicationFormData) => (applicationFormData?.flatMap((_) => _?.inputs) || []);
6175
6199
  const getExtendedValidatorObj = (productType) => ({
@@ -7883,6 +7907,7 @@
7883
7907
  mandatoryPayments: undefined,
7884
7908
  snils: '',
7885
7909
  armyIdFlg: false,
7910
+ esiaAccountTypeCd: { key: '', text: '' },
7886
7911
  },
7887
7912
  {
7888
7913
  bankruptcyFlg: false,
@@ -8278,7 +8303,7 @@
8278
8303
  label: 'Телефон работодателя',
8279
8304
  required: true,
8280
8305
  },
8281
- { name: 'beginDate', required: true },
8306
+ { name: 'beginDate', required: true, filledByEsia: true },
8282
8307
  ],
8283
8308
  },
8284
8309
  {
@@ -8320,16 +8345,22 @@
8320
8345
  title: 'Совокупный доход',
8321
8346
  },
8322
8347
  {
8348
+ columns: 1,
8323
8349
  inputs: [
8324
8350
  {
8325
- name: 'infoCard',
8326
- label: 'Сумма основного и дополнительных доходов после вычета налога',
8351
+ name: 'confirmationIncome',
8352
+ required: true,
8353
+ filledByEsia: true,
8327
8354
  },
8328
8355
  ],
8329
8356
  },
8330
8357
  {
8331
- columns: 1,
8332
- inputs: [{ name: 'confirmationIncome', required: true }],
8358
+ inputs: [
8359
+ {
8360
+ name: 'infoCard',
8361
+ label: 'Сумма основного и дополнительных доходов после вычета налога',
8362
+ },
8363
+ ],
8333
8364
  },
8334
8365
  {
8335
8366
  columns: 1,
@@ -11630,7 +11661,7 @@
11630
11661
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
11631
11662
  });
11632
11663
 
11633
- const packageVersion = "0.14.822";
11664
+ const packageVersion = "0.14.823";
11634
11665
 
11635
11666
  exports.Blocks = Blocks;
11636
11667
  exports.ContentPage = ContentPage;