@redneckz/wildless-cms-uni-blocks 0.14.264 → 0.14.266

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 (430) hide show
  1. package/bin/migration-scripts/0.14.265.js +100 -0
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +264 -291
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +7 -9
  6. package/bundle/components/ApplicationFormCustom/FeedbackMethodField.d.ts +2 -0
  7. package/bundle/components/ApplicationFormCustom/FeedbackTypeField.d.ts +2 -0
  8. package/bundle/components/ApplicationFormCustom/IsClientField.d.ts +2 -0
  9. package/bundle/components/ApplicationFormCustom/PartnerCommentsField.d.ts +2 -0
  10. package/bundle/components/ApplicationFormCustom/ServiceDirectionField.d.ts +2 -0
  11. package/bundle/components/ApplicationFormCustom/UltraPremiumField.d.ts +0 -2
  12. package/bundle/components/ApplicationFormCustom/contants.d.ts +3 -0
  13. package/bundle/components/ApplicationFormCustom/getInitialFormState.d.ts +1 -0
  14. package/bundle/components/ApplicationFormCustom/renderAgreementSubmit.d.ts +1 -1
  15. package/bundle/components/ApplicationFormCustom/renderSubmitButton.d.ts +1 -1
  16. package/bundle/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.d.ts +1 -1
  17. package/bundle/hooks/useNormalizedInput.d.ts +2 -1
  18. package/bundle/ui-kit/Input/InputProps.d.ts +3 -2
  19. package/bundle/ui-kit/PreventableEvent.d.ts +3 -0
  20. package/dist/api/LeadServiceAPI.js +18 -10
  21. package/dist/api/LeadServiceAPI.js.map +1 -1
  22. package/dist/components/ApplicationFormCustom/AddressBranchField.js +5 -4
  23. package/dist/components/ApplicationFormCustom/AddressBranchField.js.map +1 -1
  24. package/dist/components/ApplicationFormCustom/ApplicationFormCustom.js +12 -2
  25. package/dist/components/ApplicationFormCustom/ApplicationFormCustom.js.map +1 -1
  26. package/dist/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +7 -9
  27. package/dist/components/ApplicationFormCustom/FeedbackMethodField.d.ts +2 -0
  28. package/dist/components/ApplicationFormCustom/FeedbackMethodField.js +10 -0
  29. package/dist/components/ApplicationFormCustom/FeedbackMethodField.js.map +1 -0
  30. package/dist/components/ApplicationFormCustom/FeedbackTypeField.d.ts +2 -0
  31. package/dist/components/ApplicationFormCustom/FeedbackTypeField.js +19 -0
  32. package/dist/components/ApplicationFormCustom/FeedbackTypeField.js.map +1 -0
  33. package/dist/components/ApplicationFormCustom/IsClientField.d.ts +2 -0
  34. package/dist/components/ApplicationFormCustom/IsClientField.js +7 -0
  35. package/dist/components/ApplicationFormCustom/IsClientField.js.map +1 -0
  36. package/dist/components/ApplicationFormCustom/PartnerCommentsField.d.ts +2 -0
  37. package/dist/components/ApplicationFormCustom/PartnerCommentsField.js +14 -0
  38. package/dist/components/ApplicationFormCustom/PartnerCommentsField.js.map +1 -0
  39. package/dist/components/ApplicationFormCustom/ServiceDirectionField.d.ts +2 -0
  40. package/dist/components/ApplicationFormCustom/ServiceDirectionField.js +10 -0
  41. package/dist/components/ApplicationFormCustom/ServiceDirectionField.js.map +1 -0
  42. package/dist/components/ApplicationFormCustom/UltraPremiumField.d.ts +0 -2
  43. package/dist/components/ApplicationFormCustom/UltraPremiumField.js +4 -7
  44. package/dist/components/ApplicationFormCustom/UltraPremiumField.js.map +1 -1
  45. package/dist/components/ApplicationFormCustom/contants.d.ts +3 -0
  46. package/dist/components/ApplicationFormCustom/contants.js +19 -1
  47. package/dist/components/ApplicationFormCustom/contants.js.map +1 -1
  48. package/dist/components/ApplicationFormCustom/getField.js +13 -2
  49. package/dist/components/ApplicationFormCustom/getField.js.map +1 -1
  50. package/dist/components/ApplicationFormCustom/getFormatData.js +2 -1
  51. package/dist/components/ApplicationFormCustom/getFormatData.js.map +1 -1
  52. package/dist/components/ApplicationFormCustom/getInitialFormState.d.ts +1 -0
  53. package/dist/components/ApplicationFormCustom/getInitialFormState.js +7 -4
  54. package/dist/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
  55. package/dist/components/ApplicationFormCustom/getObjectValidator.js +4 -0
  56. package/dist/components/ApplicationFormCustom/getObjectValidator.js.map +1 -1
  57. package/dist/components/ApplicationFormCustom/renderAgreementSubmit.d.ts +1 -1
  58. package/dist/components/ApplicationFormCustom/renderSubmitButton.d.ts +1 -1
  59. package/dist/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.d.ts +1 -1
  60. package/dist/components/Blocks.js +0 -2
  61. package/dist/components/Blocks.js.map +1 -1
  62. package/dist/components/Blocks.mobile.js +0 -2
  63. package/dist/components/Blocks.mobile.js.map +1 -1
  64. package/dist/components/StickyBottomMenu/StickyBottomMenu.mobile.js +4 -1
  65. package/dist/components/StickyBottomMenu/StickyBottomMenu.mobile.js.map +1 -1
  66. package/dist/components/StickyBottomMenu/useBottomMenuItemDialog.js +5 -1
  67. package/dist/components/StickyBottomMenu/useBottomMenuItemDialog.js.map +1 -1
  68. package/dist/hooks/useNormalizedInput.d.ts +2 -1
  69. package/dist/hooks/useNormalizedInput.js +2 -2
  70. package/dist/hooks/useNormalizedInput.js.map +1 -1
  71. package/dist/ui-kit/Input/InputProps.d.ts +3 -2
  72. package/dist/ui-kit/PhoneInput/PhoneInput.js +5 -2
  73. package/dist/ui-kit/PhoneInput/PhoneInput.js.map +1 -1
  74. package/dist/ui-kit/PreventableEvent.d.ts +3 -0
  75. package/lib/api/LeadServiceAPI.js +18 -10
  76. package/lib/api/LeadServiceAPI.js.map +1 -1
  77. package/lib/common.css +1 -1
  78. package/lib/components/ApplicationFormCustom/AddressBranchField.js +5 -4
  79. package/lib/components/ApplicationFormCustom/AddressBranchField.js.map +1 -1
  80. package/lib/components/ApplicationFormCustom/ApplicationFormCustom.fixture.d.ts +1 -0
  81. package/lib/components/ApplicationFormCustom/ApplicationFormCustom.js +13 -3
  82. package/lib/components/ApplicationFormCustom/ApplicationFormCustom.js.map +1 -1
  83. package/lib/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +7 -9
  84. package/lib/components/ApplicationFormCustom/FeedbackMethodField.d.ts +2 -0
  85. package/lib/components/ApplicationFormCustom/FeedbackMethodField.js +8 -0
  86. package/lib/components/ApplicationFormCustom/FeedbackMethodField.js.map +1 -0
  87. package/lib/components/ApplicationFormCustom/FeedbackTypeField.d.ts +2 -0
  88. package/lib/components/ApplicationFormCustom/FeedbackTypeField.js +17 -0
  89. package/lib/components/ApplicationFormCustom/FeedbackTypeField.js.map +1 -0
  90. package/lib/components/ApplicationFormCustom/IsClientField.d.ts +2 -0
  91. package/lib/components/ApplicationFormCustom/IsClientField.js +5 -0
  92. package/lib/components/ApplicationFormCustom/IsClientField.js.map +1 -0
  93. package/lib/components/ApplicationFormCustom/PartnerCommentsField.d.ts +2 -0
  94. package/lib/components/ApplicationFormCustom/PartnerCommentsField.js +12 -0
  95. package/lib/components/ApplicationFormCustom/PartnerCommentsField.js.map +1 -0
  96. package/lib/components/ApplicationFormCustom/ServiceDirectionField.d.ts +2 -0
  97. package/lib/components/ApplicationFormCustom/ServiceDirectionField.js +8 -0
  98. package/lib/components/ApplicationFormCustom/ServiceDirectionField.js.map +1 -0
  99. package/lib/components/ApplicationFormCustom/UltraPremiumField.d.ts +0 -2
  100. package/lib/components/ApplicationFormCustom/UltraPremiumField.js +3 -6
  101. package/lib/components/ApplicationFormCustom/UltraPremiumField.js.map +1 -1
  102. package/lib/components/ApplicationFormCustom/contants.d.ts +3 -0
  103. package/lib/components/ApplicationFormCustom/contants.js +18 -0
  104. package/lib/components/ApplicationFormCustom/contants.js.map +1 -1
  105. package/lib/components/ApplicationFormCustom/getField.js +13 -2
  106. package/lib/components/ApplicationFormCustom/getField.js.map +1 -1
  107. package/lib/components/ApplicationFormCustom/getFormatData.js +2 -1
  108. package/lib/components/ApplicationFormCustom/getFormatData.js.map +1 -1
  109. package/lib/components/ApplicationFormCustom/getInitialFormState.d.ts +1 -0
  110. package/lib/components/ApplicationFormCustom/getInitialFormState.js +5 -2
  111. package/lib/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
  112. package/lib/components/ApplicationFormCustom/getObjectValidator.js +4 -0
  113. package/lib/components/ApplicationFormCustom/getObjectValidator.js.map +1 -1
  114. package/lib/components/ApplicationFormCustom/renderAgreementSubmit.d.ts +1 -1
  115. package/lib/components/ApplicationFormCustom/renderSubmitButton.d.ts +1 -1
  116. package/lib/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.d.ts +1 -1
  117. package/lib/components/Blocks.js +0 -2
  118. package/lib/components/Blocks.js.map +1 -1
  119. package/lib/components/Blocks.mobile.js +0 -2
  120. package/lib/components/Blocks.mobile.js.map +1 -1
  121. package/lib/components/StickyBottomMenu/StickyBottomMenu.mobile.js +4 -1
  122. package/lib/components/StickyBottomMenu/StickyBottomMenu.mobile.js.map +1 -1
  123. package/lib/components/StickyBottomMenu/useBottomMenuItemDialog.js +5 -1
  124. package/lib/components/StickyBottomMenu/useBottomMenuItemDialog.js.map +1 -1
  125. package/lib/hooks/useNormalizedInput.d.ts +2 -1
  126. package/lib/hooks/useNormalizedInput.js +2 -2
  127. package/lib/hooks/useNormalizedInput.js.map +1 -1
  128. package/lib/ui-kit/Input/InputProps.d.ts +3 -2
  129. package/lib/ui-kit/PhoneInput/PhoneInput.js +5 -2
  130. package/lib/ui-kit/PhoneInput/PhoneInput.js.map +1 -1
  131. package/lib/ui-kit/PreventableEvent.d.ts +3 -0
  132. package/mobile/bundle/bundle.umd.js +273 -293
  133. package/mobile/bundle/bundle.umd.min.js +1 -1
  134. package/mobile/bundle/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +7 -9
  135. package/mobile/bundle/components/ApplicationFormCustom/FeedbackMethodField.d.ts +2 -0
  136. package/mobile/bundle/components/ApplicationFormCustom/FeedbackTypeField.d.ts +2 -0
  137. package/mobile/bundle/components/ApplicationFormCustom/IsClientField.d.ts +2 -0
  138. package/mobile/bundle/components/ApplicationFormCustom/PartnerCommentsField.d.ts +2 -0
  139. package/mobile/bundle/components/ApplicationFormCustom/ServiceDirectionField.d.ts +2 -0
  140. package/mobile/bundle/components/ApplicationFormCustom/UltraPremiumField.d.ts +0 -2
  141. package/mobile/bundle/components/ApplicationFormCustom/contants.d.ts +3 -0
  142. package/mobile/bundle/components/ApplicationFormCustom/getInitialFormState.d.ts +1 -0
  143. package/mobile/bundle/components/ApplicationFormCustom/renderAgreementSubmit.d.ts +1 -1
  144. package/mobile/bundle/components/ApplicationFormCustom/renderSubmitButton.d.ts +1 -1
  145. package/mobile/bundle/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.d.ts +1 -1
  146. package/mobile/bundle/hooks/useNormalizedInput.d.ts +2 -1
  147. package/mobile/bundle/ui-kit/Input/InputProps.d.ts +3 -2
  148. package/mobile/bundle/ui-kit/PreventableEvent.d.ts +3 -0
  149. package/mobile/dist/api/LeadServiceAPI.js +18 -10
  150. package/mobile/dist/api/LeadServiceAPI.js.map +1 -1
  151. package/mobile/dist/components/ApplicationFormCustom/AddressBranchField.js +5 -4
  152. package/mobile/dist/components/ApplicationFormCustom/AddressBranchField.js.map +1 -1
  153. package/mobile/dist/components/ApplicationFormCustom/ApplicationFormCustom.js +12 -2
  154. package/mobile/dist/components/ApplicationFormCustom/ApplicationFormCustom.js.map +1 -1
  155. package/mobile/dist/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +7 -9
  156. package/mobile/dist/components/ApplicationFormCustom/FeedbackMethodField.d.ts +2 -0
  157. package/mobile/dist/components/ApplicationFormCustom/FeedbackMethodField.js +10 -0
  158. package/mobile/dist/components/ApplicationFormCustom/FeedbackMethodField.js.map +1 -0
  159. package/mobile/dist/components/ApplicationFormCustom/FeedbackTypeField.d.ts +2 -0
  160. package/mobile/dist/components/ApplicationFormCustom/FeedbackTypeField.js +19 -0
  161. package/mobile/dist/components/ApplicationFormCustom/FeedbackTypeField.js.map +1 -0
  162. package/mobile/dist/components/ApplicationFormCustom/IsClientField.d.ts +2 -0
  163. package/mobile/dist/components/ApplicationFormCustom/IsClientField.js +7 -0
  164. package/mobile/dist/components/ApplicationFormCustom/IsClientField.js.map +1 -0
  165. package/mobile/dist/components/ApplicationFormCustom/PartnerCommentsField.d.ts +2 -0
  166. package/mobile/dist/components/ApplicationFormCustom/PartnerCommentsField.js +14 -0
  167. package/mobile/dist/components/ApplicationFormCustom/PartnerCommentsField.js.map +1 -0
  168. package/mobile/dist/components/ApplicationFormCustom/ServiceDirectionField.d.ts +2 -0
  169. package/mobile/dist/components/ApplicationFormCustom/ServiceDirectionField.js +10 -0
  170. package/mobile/dist/components/ApplicationFormCustom/ServiceDirectionField.js.map +1 -0
  171. package/mobile/dist/components/ApplicationFormCustom/UltraPremiumField.d.ts +0 -2
  172. package/mobile/dist/components/ApplicationFormCustom/UltraPremiumField.js +4 -7
  173. package/mobile/dist/components/ApplicationFormCustom/UltraPremiumField.js.map +1 -1
  174. package/mobile/dist/components/ApplicationFormCustom/contants.d.ts +3 -0
  175. package/mobile/dist/components/ApplicationFormCustom/contants.js +19 -1
  176. package/mobile/dist/components/ApplicationFormCustom/contants.js.map +1 -1
  177. package/mobile/dist/components/ApplicationFormCustom/getField.js +13 -2
  178. package/mobile/dist/components/ApplicationFormCustom/getField.js.map +1 -1
  179. package/mobile/dist/components/ApplicationFormCustom/getFormatData.js +2 -1
  180. package/mobile/dist/components/ApplicationFormCustom/getFormatData.js.map +1 -1
  181. package/mobile/dist/components/ApplicationFormCustom/getInitialFormState.d.ts +1 -0
  182. package/mobile/dist/components/ApplicationFormCustom/getInitialFormState.js +7 -4
  183. package/mobile/dist/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
  184. package/mobile/dist/components/ApplicationFormCustom/getObjectValidator.js +4 -0
  185. package/mobile/dist/components/ApplicationFormCustom/getObjectValidator.js.map +1 -1
  186. package/mobile/dist/components/ApplicationFormCustom/renderAgreementSubmit.d.ts +1 -1
  187. package/mobile/dist/components/ApplicationFormCustom/renderSubmitButton.d.ts +1 -1
  188. package/mobile/dist/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.d.ts +1 -1
  189. package/mobile/dist/components/Blocks.js +0 -2
  190. package/mobile/dist/components/Blocks.js.map +1 -1
  191. package/mobile/dist/components/StickyBottomMenu/StickyBottomMenu.js +4 -1
  192. package/mobile/dist/components/StickyBottomMenu/StickyBottomMenu.js.map +1 -1
  193. package/mobile/dist/components/StickyBottomMenu/useBottomMenuItemDialog.js +5 -1
  194. package/mobile/dist/components/StickyBottomMenu/useBottomMenuItemDialog.js.map +1 -1
  195. package/mobile/dist/hooks/useNormalizedInput.d.ts +2 -1
  196. package/mobile/dist/hooks/useNormalizedInput.js +2 -2
  197. package/mobile/dist/hooks/useNormalizedInput.js.map +1 -1
  198. package/mobile/dist/ui-kit/Input/InputProps.d.ts +3 -2
  199. package/mobile/dist/ui-kit/PhoneInput/PhoneInput.js +5 -2
  200. package/mobile/dist/ui-kit/PhoneInput/PhoneInput.js.map +1 -1
  201. package/mobile/dist/ui-kit/PreventableEvent.d.ts +3 -0
  202. package/mobile/lib/api/LeadServiceAPI.js +18 -10
  203. package/mobile/lib/api/LeadServiceAPI.js.map +1 -1
  204. package/mobile/lib/common.css +1 -1
  205. package/mobile/lib/components/ApplicationFormCustom/AddressBranchField.js +5 -4
  206. package/mobile/lib/components/ApplicationFormCustom/AddressBranchField.js.map +1 -1
  207. package/mobile/lib/components/ApplicationFormCustom/ApplicationFormCustom.js +13 -3
  208. package/mobile/lib/components/ApplicationFormCustom/ApplicationFormCustom.js.map +1 -1
  209. package/mobile/lib/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +7 -9
  210. package/mobile/lib/components/ApplicationFormCustom/FeedbackMethodField.d.ts +2 -0
  211. package/mobile/lib/components/ApplicationFormCustom/FeedbackMethodField.js +8 -0
  212. package/mobile/lib/components/ApplicationFormCustom/FeedbackMethodField.js.map +1 -0
  213. package/mobile/lib/components/ApplicationFormCustom/FeedbackTypeField.d.ts +2 -0
  214. package/mobile/lib/components/ApplicationFormCustom/FeedbackTypeField.js +17 -0
  215. package/mobile/lib/components/ApplicationFormCustom/FeedbackTypeField.js.map +1 -0
  216. package/mobile/lib/components/ApplicationFormCustom/IsClientField.d.ts +2 -0
  217. package/mobile/lib/components/ApplicationFormCustom/IsClientField.js +5 -0
  218. package/mobile/lib/components/ApplicationFormCustom/IsClientField.js.map +1 -0
  219. package/mobile/lib/components/ApplicationFormCustom/PartnerCommentsField.d.ts +2 -0
  220. package/mobile/lib/components/ApplicationFormCustom/PartnerCommentsField.js +12 -0
  221. package/mobile/lib/components/ApplicationFormCustom/PartnerCommentsField.js.map +1 -0
  222. package/mobile/lib/components/ApplicationFormCustom/ServiceDirectionField.d.ts +2 -0
  223. package/mobile/lib/components/ApplicationFormCustom/ServiceDirectionField.js +8 -0
  224. package/mobile/lib/components/ApplicationFormCustom/ServiceDirectionField.js.map +1 -0
  225. package/mobile/lib/components/ApplicationFormCustom/UltraPremiumField.d.ts +0 -2
  226. package/mobile/lib/components/ApplicationFormCustom/UltraPremiumField.js +3 -6
  227. package/mobile/lib/components/ApplicationFormCustom/UltraPremiumField.js.map +1 -1
  228. package/mobile/lib/components/ApplicationFormCustom/contants.d.ts +3 -0
  229. package/mobile/lib/components/ApplicationFormCustom/contants.js +18 -0
  230. package/mobile/lib/components/ApplicationFormCustom/contants.js.map +1 -1
  231. package/mobile/lib/components/ApplicationFormCustom/getField.js +13 -2
  232. package/mobile/lib/components/ApplicationFormCustom/getField.js.map +1 -1
  233. package/mobile/lib/components/ApplicationFormCustom/getFormatData.js +2 -1
  234. package/mobile/lib/components/ApplicationFormCustom/getFormatData.js.map +1 -1
  235. package/mobile/lib/components/ApplicationFormCustom/getInitialFormState.d.ts +1 -0
  236. package/mobile/lib/components/ApplicationFormCustom/getInitialFormState.js +5 -2
  237. package/mobile/lib/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
  238. package/mobile/lib/components/ApplicationFormCustom/getObjectValidator.js +4 -0
  239. package/mobile/lib/components/ApplicationFormCustom/getObjectValidator.js.map +1 -1
  240. package/mobile/lib/components/ApplicationFormCustom/renderAgreementSubmit.d.ts +1 -1
  241. package/mobile/lib/components/ApplicationFormCustom/renderSubmitButton.d.ts +1 -1
  242. package/mobile/lib/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.d.ts +1 -1
  243. package/mobile/lib/components/Blocks.js +0 -2
  244. package/mobile/lib/components/Blocks.js.map +1 -1
  245. package/mobile/lib/components/StickyBottomMenu/StickyBottomMenu.js +4 -1
  246. package/mobile/lib/components/StickyBottomMenu/StickyBottomMenu.js.map +1 -1
  247. package/mobile/lib/components/StickyBottomMenu/useBottomMenuItemDialog.js +5 -1
  248. package/mobile/lib/components/StickyBottomMenu/useBottomMenuItemDialog.js.map +1 -1
  249. package/mobile/lib/hooks/useNormalizedInput.d.ts +2 -1
  250. package/mobile/lib/hooks/useNormalizedInput.js +2 -2
  251. package/mobile/lib/hooks/useNormalizedInput.js.map +1 -1
  252. package/mobile/lib/ui-kit/Input/InputProps.d.ts +3 -2
  253. package/mobile/lib/ui-kit/PhoneInput/PhoneInput.js +5 -2
  254. package/mobile/lib/ui-kit/PhoneInput/PhoneInput.js.map +1 -1
  255. package/mobile/lib/ui-kit/PreventableEvent.d.ts +3 -0
  256. package/mobile/src/api/LeadServiceAPI.ts +18 -9
  257. package/mobile/src/components/ApplicationFormCustom/AddressBranchField.tsx +5 -4
  258. package/mobile/src/components/ApplicationFormCustom/ApplicationFormCustom.example.json +90 -0
  259. package/mobile/src/components/ApplicationFormCustom/ApplicationFormCustom.tsx +18 -6
  260. package/mobile/src/components/ApplicationFormCustom/ApplicationFormCustomContent.ts +13 -8
  261. package/mobile/src/components/ApplicationFormCustom/FeedbackMethodField.tsx +14 -0
  262. package/mobile/src/components/ApplicationFormCustom/FeedbackTypeField.tsx +25 -0
  263. package/mobile/src/components/ApplicationFormCustom/IsClientField.tsx +7 -0
  264. package/mobile/src/components/ApplicationFormCustom/PartnerCommentsField.tsx +18 -0
  265. package/mobile/src/components/ApplicationFormCustom/ServiceDirectionField.tsx +15 -0
  266. package/mobile/src/components/ApplicationFormCustom/UltraPremiumField.tsx +3 -9
  267. package/mobile/src/components/ApplicationFormCustom/contants.tsx +21 -0
  268. package/mobile/src/components/ApplicationFormCustom/getField.tsx +20 -7
  269. package/mobile/src/components/ApplicationFormCustom/getFormatData.tsx +2 -0
  270. package/mobile/src/components/ApplicationFormCustom/getInitialFormState.tsx +6 -2
  271. package/mobile/src/components/ApplicationFormCustom/getObjectValidator.tsx +4 -0
  272. package/mobile/src/components/ApplicationFormCustom/renderAgreementSubmit.tsx +1 -1
  273. package/mobile/src/components/ApplicationFormCustom/renderSubmitButton.tsx +1 -1
  274. package/mobile/src/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.ts +1 -1
  275. package/mobile/src/components/Blocks.ts +0 -2
  276. package/mobile/src/components/StickyBottomMenu/StickyBottomMenu.tsx +8 -1
  277. package/mobile/src/components/StickyBottomMenu/useBottomMenuItemDialog.tsx +8 -1
  278. package/mobile/src/hooks/useNormalizedInput.ts +3 -2
  279. package/mobile/src/ui-kit/Input/InputProps.ts +3 -2
  280. package/mobile/src/ui-kit/PhoneInput/PhoneInput.tsx +7 -3
  281. package/mobile/src/ui-kit/PreventableEvent.ts +2 -0
  282. package/package.json +1 -1
  283. package/src/api/LeadServiceAPI.ts +18 -9
  284. package/src/components/ApplicationFormCustom/AddressBranchField.tsx +5 -4
  285. package/src/components/ApplicationFormCustom/ApplicationFormCustom.example.json +90 -0
  286. package/src/components/ApplicationFormCustom/ApplicationFormCustom.fixture.tsx +86 -0
  287. package/src/components/ApplicationFormCustom/ApplicationFormCustom.tsx +18 -6
  288. package/src/components/ApplicationFormCustom/ApplicationFormCustomContent.ts +13 -8
  289. package/src/components/ApplicationFormCustom/FeedbackMethodField.tsx +14 -0
  290. package/src/components/ApplicationFormCustom/FeedbackTypeField.tsx +25 -0
  291. package/src/components/ApplicationFormCustom/IsClientField.tsx +7 -0
  292. package/src/components/ApplicationFormCustom/PartnerCommentsField.tsx +18 -0
  293. package/src/components/ApplicationFormCustom/ServiceDirectionField.tsx +15 -0
  294. package/src/components/ApplicationFormCustom/UltraPremiumField.tsx +3 -9
  295. package/src/components/ApplicationFormCustom/contants.tsx +21 -0
  296. package/src/components/ApplicationFormCustom/getField.tsx +20 -7
  297. package/src/components/ApplicationFormCustom/getFormatData.tsx +2 -0
  298. package/src/components/ApplicationFormCustom/getInitialFormState.tsx +6 -2
  299. package/src/components/ApplicationFormCustom/getObjectValidator.tsx +4 -0
  300. package/src/components/ApplicationFormCustom/renderAgreementSubmit.tsx +1 -1
  301. package/src/components/ApplicationFormCustom/renderSubmitButton.tsx +1 -1
  302. package/src/components/ApplicationFormGrantSupport/ApplicationFormGrantSupportContent.ts +1 -1
  303. package/src/components/Blocks.mobile.ts +0 -2
  304. package/src/components/Blocks.ts +0 -2
  305. package/src/components/StickyBottomMenu/StickyBottomMenu.mobile.tsx +8 -1
  306. package/src/components/StickyBottomMenu/useBottomMenuItemDialog.tsx +8 -1
  307. package/src/hooks/useNormalizedInput.ts +3 -2
  308. package/src/ui-kit/Input/InputProps.ts +3 -2
  309. package/src/ui-kit/PhoneInput/PhoneInput.tsx +7 -3
  310. package/src/ui-kit/PreventableEvent.ts +2 -0
  311. package/bundle/components/ApplicationForm/ApplicationFieldsetLayout.d.ts +0 -5
  312. package/bundle/components/ApplicationForm/ApplicationForm.d.ts +0 -5
  313. package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +0 -35
  314. package/bundle/components/ApplicationForm/ApplicationFormFeedback.d.ts +0 -37
  315. package/bundle/components/ApplicationForm/ApplicationFormsProps.d.ts +0 -7
  316. package/bundle/components/ApplicationForm/EmbeddableForms.d.ts +0 -3
  317. package/bundle/components/ApplicationForm/feedbackTypes.d.ts +0 -4
  318. package/dist/components/ApplicationForm/ApplicationFieldsetLayout.d.ts +0 -5
  319. package/dist/components/ApplicationForm/ApplicationFieldsetLayout.js +0 -8
  320. package/dist/components/ApplicationForm/ApplicationFieldsetLayout.js.map +0 -1
  321. package/dist/components/ApplicationForm/ApplicationForm.d.ts +0 -5
  322. package/dist/components/ApplicationForm/ApplicationForm.js +0 -31
  323. package/dist/components/ApplicationForm/ApplicationForm.js.map +0 -1
  324. package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +0 -35
  325. package/dist/components/ApplicationForm/ApplicationFormContent.js +0 -2
  326. package/dist/components/ApplicationForm/ApplicationFormContent.js.map +0 -1
  327. package/dist/components/ApplicationForm/ApplicationFormFeedback.d.ts +0 -37
  328. package/dist/components/ApplicationForm/ApplicationFormFeedback.js +0 -80
  329. package/dist/components/ApplicationForm/ApplicationFormFeedback.js.map +0 -1
  330. package/dist/components/ApplicationForm/ApplicationFormsProps.d.ts +0 -7
  331. package/dist/components/ApplicationForm/ApplicationFormsProps.js +0 -2
  332. package/dist/components/ApplicationForm/ApplicationFormsProps.js.map +0 -1
  333. package/dist/components/ApplicationForm/EmbeddableForms.d.ts +0 -3
  334. package/dist/components/ApplicationForm/EmbeddableForms.js +0 -7
  335. package/dist/components/ApplicationForm/EmbeddableForms.js.map +0 -1
  336. package/dist/components/ApplicationForm/feedbackTypes.d.ts +0 -4
  337. package/dist/components/ApplicationForm/feedbackTypes.js +0 -21
  338. package/dist/components/ApplicationForm/feedbackTypes.js.map +0 -1
  339. package/lib/components/ApplicationForm/ApplicationFieldsetLayout.d.ts +0 -5
  340. package/lib/components/ApplicationForm/ApplicationFieldsetLayout.js +0 -6
  341. package/lib/components/ApplicationForm/ApplicationFieldsetLayout.js.map +0 -1
  342. package/lib/components/ApplicationForm/ApplicationForm.d.ts +0 -5
  343. package/lib/components/ApplicationForm/ApplicationForm.fixture.d.ts +0 -6
  344. package/lib/components/ApplicationForm/ApplicationForm.fixture.mobile.d.ts +0 -6
  345. package/lib/components/ApplicationForm/ApplicationForm.js +0 -29
  346. package/lib/components/ApplicationForm/ApplicationForm.js.map +0 -1
  347. package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +0 -35
  348. package/lib/components/ApplicationForm/ApplicationFormContent.js +0 -2
  349. package/lib/components/ApplicationForm/ApplicationFormContent.js.map +0 -1
  350. package/lib/components/ApplicationForm/ApplicationFormFeedback.d.ts +0 -37
  351. package/lib/components/ApplicationForm/ApplicationFormFeedback.js +0 -76
  352. package/lib/components/ApplicationForm/ApplicationFormFeedback.js.map +0 -1
  353. package/lib/components/ApplicationForm/ApplicationFormsProps.d.ts +0 -7
  354. package/lib/components/ApplicationForm/ApplicationFormsProps.js +0 -2
  355. package/lib/components/ApplicationForm/ApplicationFormsProps.js.map +0 -1
  356. package/lib/components/ApplicationForm/EmbeddableForms.d.ts +0 -3
  357. package/lib/components/ApplicationForm/EmbeddableForms.js +0 -5
  358. package/lib/components/ApplicationForm/EmbeddableForms.js.map +0 -1
  359. package/lib/components/ApplicationForm/feedbackTypes.d.ts +0 -4
  360. package/lib/components/ApplicationForm/feedbackTypes.js +0 -19
  361. package/lib/components/ApplicationForm/feedbackTypes.js.map +0 -1
  362. package/mobile/bundle/components/ApplicationForm/ApplicationFieldsetLayout.d.ts +0 -5
  363. package/mobile/bundle/components/ApplicationForm/ApplicationForm.d.ts +0 -5
  364. package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +0 -35
  365. package/mobile/bundle/components/ApplicationForm/ApplicationFormFeedback.d.ts +0 -37
  366. package/mobile/bundle/components/ApplicationForm/ApplicationFormsProps.d.ts +0 -7
  367. package/mobile/bundle/components/ApplicationForm/EmbeddableForms.d.ts +0 -3
  368. package/mobile/bundle/components/ApplicationForm/feedbackTypes.d.ts +0 -4
  369. package/mobile/dist/components/ApplicationForm/ApplicationFieldsetLayout.d.ts +0 -5
  370. package/mobile/dist/components/ApplicationForm/ApplicationFieldsetLayout.js +0 -8
  371. package/mobile/dist/components/ApplicationForm/ApplicationFieldsetLayout.js.map +0 -1
  372. package/mobile/dist/components/ApplicationForm/ApplicationForm.d.ts +0 -5
  373. package/mobile/dist/components/ApplicationForm/ApplicationForm.js +0 -31
  374. package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +0 -1
  375. package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +0 -35
  376. package/mobile/dist/components/ApplicationForm/ApplicationFormContent.js +0 -2
  377. package/mobile/dist/components/ApplicationForm/ApplicationFormContent.js.map +0 -1
  378. package/mobile/dist/components/ApplicationForm/ApplicationFormFeedback.d.ts +0 -37
  379. package/mobile/dist/components/ApplicationForm/ApplicationFormFeedback.js +0 -80
  380. package/mobile/dist/components/ApplicationForm/ApplicationFormFeedback.js.map +0 -1
  381. package/mobile/dist/components/ApplicationForm/ApplicationFormsProps.d.ts +0 -7
  382. package/mobile/dist/components/ApplicationForm/ApplicationFormsProps.js +0 -2
  383. package/mobile/dist/components/ApplicationForm/ApplicationFormsProps.js.map +0 -1
  384. package/mobile/dist/components/ApplicationForm/EmbeddableForms.d.ts +0 -3
  385. package/mobile/dist/components/ApplicationForm/EmbeddableForms.js +0 -7
  386. package/mobile/dist/components/ApplicationForm/EmbeddableForms.js.map +0 -1
  387. package/mobile/dist/components/ApplicationForm/feedbackTypes.d.ts +0 -4
  388. package/mobile/dist/components/ApplicationForm/feedbackTypes.js +0 -21
  389. package/mobile/dist/components/ApplicationForm/feedbackTypes.js.map +0 -1
  390. package/mobile/lib/components/ApplicationForm/ApplicationFieldsetLayout.d.ts +0 -5
  391. package/mobile/lib/components/ApplicationForm/ApplicationFieldsetLayout.js +0 -6
  392. package/mobile/lib/components/ApplicationForm/ApplicationFieldsetLayout.js.map +0 -1
  393. package/mobile/lib/components/ApplicationForm/ApplicationForm.d.ts +0 -5
  394. package/mobile/lib/components/ApplicationForm/ApplicationForm.js +0 -29
  395. package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +0 -1
  396. package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +0 -35
  397. package/mobile/lib/components/ApplicationForm/ApplicationFormContent.js +0 -2
  398. package/mobile/lib/components/ApplicationForm/ApplicationFormContent.js.map +0 -1
  399. package/mobile/lib/components/ApplicationForm/ApplicationFormFeedback.d.ts +0 -37
  400. package/mobile/lib/components/ApplicationForm/ApplicationFormFeedback.js +0 -76
  401. package/mobile/lib/components/ApplicationForm/ApplicationFormFeedback.js.map +0 -1
  402. package/mobile/lib/components/ApplicationForm/ApplicationFormsProps.d.ts +0 -7
  403. package/mobile/lib/components/ApplicationForm/ApplicationFormsProps.js +0 -2
  404. package/mobile/lib/components/ApplicationForm/ApplicationFormsProps.js.map +0 -1
  405. package/mobile/lib/components/ApplicationForm/EmbeddableForms.d.ts +0 -3
  406. package/mobile/lib/components/ApplicationForm/EmbeddableForms.js +0 -5
  407. package/mobile/lib/components/ApplicationForm/EmbeddableForms.js.map +0 -1
  408. package/mobile/lib/components/ApplicationForm/feedbackTypes.d.ts +0 -4
  409. package/mobile/lib/components/ApplicationForm/feedbackTypes.js +0 -19
  410. package/mobile/lib/components/ApplicationForm/feedbackTypes.js.map +0 -1
  411. package/mobile/src/components/ApplicationForm/ApplicationFieldsetLayout.tsx +0 -21
  412. package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +0 -13
  413. package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +0 -66
  414. package/mobile/src/components/ApplicationForm/ApplicationForm.ui.json +0 -9
  415. package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +0 -41
  416. package/mobile/src/components/ApplicationForm/ApplicationFormFeedback.tsx +0 -205
  417. package/mobile/src/components/ApplicationForm/ApplicationFormsProps.ts +0 -8
  418. package/mobile/src/components/ApplicationForm/EmbeddableForms.tsx +0 -5
  419. package/mobile/src/components/ApplicationForm/feedbackTypes.ts +0 -22
  420. package/src/components/ApplicationForm/ApplicationFieldsetLayout.tsx +0 -21
  421. package/src/components/ApplicationForm/ApplicationForm.example.json +0 -13
  422. package/src/components/ApplicationForm/ApplicationForm.fixture.mobile.tsx +0 -29
  423. package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +0 -29
  424. package/src/components/ApplicationForm/ApplicationForm.tsx +0 -66
  425. package/src/components/ApplicationForm/ApplicationForm.ui.json +0 -9
  426. package/src/components/ApplicationForm/ApplicationFormContent.ts +0 -41
  427. package/src/components/ApplicationForm/ApplicationFormFeedback.tsx +0 -205
  428. package/src/components/ApplicationForm/ApplicationFormsProps.ts +0 -8
  429. package/src/components/ApplicationForm/EmbeddableForms.tsx +0 -5
  430. package/src/components/ApplicationForm/feedbackTypes.ts +0 -22
@@ -818,16 +818,16 @@
818
818
  const formatPhone = (phone) => phone?.replace(/[^+\d]/g, '');
819
819
 
820
820
  function LeadServiceAPI() {
821
- // eslint-disable-next-line complexity
822
821
  async function send(body, isIndividualType = false) {
823
- const url = isIndividualType ? '/api/v1/lead' : '/api/v1/sendcorporatelead';
824
- const { typeForm, region, phone = '', email, birthday, inn, fullName, addressBranch, secondaryPhone = '', bankEmpolee, applicationDate, ...staticBody } = body;
822
+ const { typeForm, region, phone = '', email, birthday, inn, fullName, addressBranch, secondaryPhone = '', bankEmpolee, applicationDate, serviceDirection, ...staticBody } = body;
823
+ const isNaturalPerson = isIndividualType && serviceDirection !== 'Юридическое лицо / ИП';
824
+ const url = isNaturalPerson ? '/api/v1/lead' : '/api/v1/sendcorporatelead';
825
825
  const submitBody = {
826
826
  typeForm,
827
- [isIndividualType ? 'regionBranch' : 'region']: region,
828
- [isIndividualType ? 'email' : 'mail']: email,
827
+ ...getRegion$1(region, isNaturalPerson),
828
+ ...getEmail(email, isNaturalPerson),
829
829
  ...getPhone(phone),
830
- ...(isIndividualType ? { birthday: birthday?.toLocaleString() } : { inn, fullName }),
830
+ ...(isNaturalPerson ? { birthday: birthday?.toLocaleString() } : { inn, fullName }),
831
831
  ...(typeForm === 'FEEDBACK'
832
832
  ? {}
833
833
  : {
@@ -859,17 +859,18 @@
859
859
  send,
860
860
  };
861
861
  }
862
- const getPhone = (phone, isIndividual) => phone ? { [isIndividual ? 'phoneNumber' : 'phone']: formatPhone(phone) } : {};
863
- const getSecondaryPhone = (secondaryPhone) => !secondaryPhone || secondaryPhone === '+7 ('
864
- ? {}
865
- : { secondaryPhoneNumber: formatPhone(secondaryPhone) };
866
-
867
- const ResponseNotification = JSX(({ responseType }) => {
868
- const responseOK = responseType === 'OK';
869
- const backgroundColor = responseOK ? 'bg-ok' : 'bg-fail';
870
- const statusIcon = responseOK ? 'ResponseOKIcon' : 'ResponseFailIcon';
871
- return (jsxs("div", { className: style('flex items-center p-lg rounded-md space-x-m', backgroundColor), children: [jsx(Img, { image: { icon: statusIcon, iconVersion: 'normal' }, width: "42", height: "42" }), jsxs("div", { children: [jsx(Heading, { headingType: "h6", title: responseOK ? 'Ваша заявка отправлена' : 'Не удалось отправить заявку', className: "mb-2xs" }), jsx(Text, { size: "text-l", font: "font-light", color: "text-secondary-text", children: responseOK ? 'Совсем скоро мы с вами свяжемся' : 'Пожалуйста, повторите позднее' })] })] }));
862
+ const getPhone = (phone) => (phone ? { phone: formatPhone(phone) } : {});
863
+ const getRegion$1 = (region, isNaturalPerson = true) => ({
864
+ [isNaturalPerson ? 'regionBranch' : 'region']: region,
865
+ });
866
+ const getEmail = (email, isNaturalPerson = true) => ({
867
+ [isNaturalPerson ? 'email' : 'mail']: email,
872
868
  });
869
+ const getSecondaryPhone = (secondaryPhone = '') => {
870
+ return !secondaryPhone || secondaryPhone === '+7 ('
871
+ ? {}
872
+ : { secondaryPhoneNumber: formatPhone(secondaryPhone) };
873
+ };
873
874
 
874
875
  const identity = (_) => _;
875
876
 
@@ -919,8 +920,58 @@
919
920
  ];
920
921
  };
921
922
 
923
+ const ResponseNotification = JSX(({ responseType }) => {
924
+ const responseOK = responseType === 'OK';
925
+ const backgroundColor = responseOK ? 'bg-ok' : 'bg-fail';
926
+ const statusIcon = responseOK ? 'ResponseOKIcon' : 'ResponseFailIcon';
927
+ return (jsxs("div", { className: style('flex items-center p-lg rounded-md space-x-m', backgroundColor), children: [jsx(Img, { image: { icon: statusIcon, iconVersion: 'normal' }, width: "42", height: "42" }), jsxs("div", { children: [jsx(Heading, { headingType: "h6", title: responseOK ? 'Ваша заявка отправлена' : 'Не удалось отправить заявку', className: "mb-2xs" }), jsx(Text, { size: "text-l", font: "font-light", color: "text-secondary-text", children: responseOK ? 'Совсем скоро мы с вами свяжемся' : 'Пожалуйста, повторите позднее' })] })] }));
928
+ });
929
+
930
+ const ApplicationFormLayout = JSX((props) => {
931
+ const { className, title, responseType, children, ...rest } = props;
932
+ return (jsx(BlockWrapper, { className: className, defaultPadding: "p-6xl", ...rest, children: jsxs("div", { className: "container max-w-[978px] space-y-lg", children: [title ? jsx(Heading, { headingType: "h3", title: title, className: "@xl:text-center" }) : null, children, responseType ? jsx(ResponseNotification, { responseType: responseType }) : null] }) }));
933
+ });
934
+
935
+ const objectValidator = (validatorsMap) => (o) => (o &&
936
+ Object.entries(validatorsMap).flatMap(([key, validator]) => validator(o[key]))) ||
937
+ [];
938
+
939
+ const isValidationSuccess = (info) => !info?.length;
940
+ const validator = (predicate) => (message) => (_) => predicate(_) ? [] : [message];
941
+
922
942
  const renderErrorText = (error) => (jsx("div", { className: "h-6", children: error ? (jsx(Text, { size: "text-xs", font: "font-light", color: "text-error", children: error })) : null }));
923
943
 
944
+ const SVG = JSX(({ className, viewBox, fill = 'none', width, height, paths, ...commonOptions }) => {
945
+ return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: className, viewBox: viewBox, fill: fill, width: width, height: height, children: paths.map(({ d, fill: pathFill, ...options }, i) => {
946
+ const resultOptions = { ...commonOptions, ...options };
947
+ return (jsx("path", { d: d, fill: pathFill || 'currentColor', stroke: resultOptions.stroke, strokeLinecap: resultOptions.strokeLinecap, strokeLinejoin: resultOptions.strokeLinejoin, strokeWidth: resultOptions.strokeWidth, strokeMiterlimit: resultOptions.strokeMiterlimit }, i));
948
+ }) }));
949
+ });
950
+
951
+ const CHECK_PATHS = [
952
+ {
953
+ d: 'M10.207.793a1 1 0 0 1 0 1.414l-6 6a1 1 0 0 1-1.414 0l-2.5-2.5a1 1 0 0 1 1.414-1.414L3.5 6.086 8.793.793a1 1 0 0 1 1.414 0Z',
954
+ fillRule: 'evenodd',
955
+ clipRule: 'evenodd',
956
+ fill: 'white',
957
+ },
958
+ ];
959
+ const Checkbox = JSX(({ className, value, text, disabled, isRadio, onChange }) => {
960
+ const handleChange = useCallback((e) => {
961
+ if (disabled) {
962
+ return;
963
+ }
964
+ e.preventDefault();
965
+ onChange && onChange(!value);
966
+ }, [onChange, disabled, value]);
967
+ const icon = isRadio ? (jsx("div", { className: "absolute left-1 w-3 h-3 rounded-full bg-primary-main" })) : (jsx(SVG, { paths: CHECK_PATHS, className: "absolute left-1 ml-px block", width: "11", height: "9", fill: "white", viewBox: "0 0 11 9" }));
968
+ return (jsx("div", { className: className, children: jsxs("label", { className: "flex items-center relative cursor-pointer group/box", onClick: handleChange, children: [jsx("div", { className: style('appearance-none w-5 h-5 border-solid cursor-pointer m-0', isRadio ? 'rounded-full border-2' : checkboxStyle(value), value ? 'border-primary-main' : 'border-gray', disabled ? 'bg-main-disabled' : 'group-hover/box:border-primary-hover'), role: role(isRadio), "aria-checked": Boolean(value), "aria-disabled": Boolean(disabled) }), value ? icon : null, text ? (jsx("div", { className: "ml-s", children: jsx(Text, { size: "text-l", font: "font-light", children: text }) })) : null] }) }));
969
+ });
970
+ const role = (isRadio) => (isRadio ? 'radio' : 'checkbox');
971
+ const checkboxStyle = (value) => style('rounded border', value ? 'bg-primary-main' : '');
972
+
973
+ const CheckboxWithError = JSX(({ className, text, value, key, disabled, error, onChange }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(Checkbox, { text: text, value: value, disabled: disabled, onChange: onChange }, key), renderErrorText(error)] })));
974
+
924
975
  function useBool(defaultValue = false) {
925
976
  const [value, setValue] = useState(defaultValue);
926
977
  const setTrue = useCallback(() => setValue(true), []);
@@ -1219,20 +1270,58 @@
1219
1270
  }
1220
1271
 
1221
1272
  const PhoneInput = JSX(({ children, onChange, ...inputProps }) => {
1222
- const handleChange = useCallback((value) => onChange && onChange(normalizePhone(value)), [onChange]);
1223
- return (jsx(Input, { onChange: handleChange, onFocus: (event) => handleChange(event?.target?.value || ''), ...inputProps, children: children }));
1273
+ const handleChange = useCallback((v) => onChange && onChange(normalizePhone(v)), [onChange]);
1274
+ const handleBlur = useCallback((v) => {
1275
+ v === '+7 (' ? onChange && onChange('') : null;
1276
+ }, []);
1277
+ return (jsx(Input, { ...inputProps, onChange: handleChange, onFocus: (e) => handleChange(e?.target?.value || ''), onBlur: (e) => handleBlur(e?.target?.value || ''), children: children }));
1224
1278
  });
1225
1279
 
1226
1280
  const InputPhoneControl = JSX(({ className, label, value, error, onChange, onBlur, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(PhoneInput, { "aria-label": label, label: rest?.errors ? `${label}*` : label, valid: Boolean(!error), value: value, onChange: onChange, onBlur: onBlur, placeholder: "+7 (___) ___-__-__" }), renderErrorText(error)] })));
1227
1281
 
1228
1282
  const SelectControl = JSX(({ className = '', label, error, ...rest }) => (jsxs("div", { className: className, children: [jsx(Select, { ...rest, valid: !error, label: rest?.errors ? `${label}*` : label }), renderErrorText(error)] })));
1229
1283
 
1230
- const objectValidator = (validatorsMap) => (o) => (o &&
1231
- Object.entries(validatorsMap).flatMap(([key, validator]) => validator(o[key]))) ||
1232
- [];
1284
+ const getNamesFromInput = (inputs) => Object.values(inputs.filter((_) => _))?.map((_) => _.name);
1233
1285
 
1234
- const isValidationSuccess = (info) => !info?.length;
1235
- const validator = (predicate) => (message) => (_) => predicate(_) ? [] : [message];
1286
+ const pattern = (regexp) => validator((_) => typeof _ === 'string' && regexp.test(_));
1287
+
1288
+ const required = validator((_) => _ !== null && _ !== undefined && _ !== '');
1289
+
1290
+ const ERROR_MESSAGE = 'Некорректно заполненное поле';
1291
+ const defaultValidator = required(ERROR_MESSAGE);
1292
+ const defaultSelectValidator = validator((_) => _?.key && _?.key !== '')(ERROR_MESSAGE);
1293
+ const nameValidator = validator((_) => typeof _ === 'string' && _.length > 1)(ERROR_MESSAGE);
1294
+ const innValidator = validator((_) => typeof _ === 'string' && (_.length === 10 || _.length === 12))(ERROR_MESSAGE);
1295
+ const phoneValidator = pattern(/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/)(ERROR_MESSAGE);
1296
+ const agreementValidator = validator((_) => typeof _ === 'boolean' && _)('Согласие обязательно');
1297
+
1298
+ const validatorObj = {
1299
+ typeForm: defaultValidator,
1300
+ surname: nameValidator,
1301
+ name: nameValidator,
1302
+ region: defaultSelectValidator,
1303
+ addressBranch: defaultSelectValidator,
1304
+ phone: phoneValidator,
1305
+ secondaryPhone: phoneValidator,
1306
+ birthday: defaultValidator,
1307
+ email: defaultValidator,
1308
+ fullName: nameValidator,
1309
+ inn: innValidator,
1310
+ partnerComments: defaultValidator,
1311
+ collectionCount: defaultValidator,
1312
+ comment: defaultValidator,
1313
+ acquiringType: defaultSelectValidator,
1314
+ feedbackType: defaultSelectValidator,
1315
+ feedbackMethod: defaultSelectValidator,
1316
+ serviceType: defaultSelectValidator,
1317
+ serviceDirection: defaultSelectValidator,
1318
+ consentDataProcessing: agreementValidator,
1319
+ annualRevenue: defaultValidator,
1320
+ };
1321
+ const getObjectValidator = (inputs) => {
1322
+ const requiredInputs = getNamesFromInput(inputs.filter((_) => ('required' in _ ? _.required : false)));
1323
+ return Object.fromEntries(requiredInputs.map((_) => [_, validatorObj?.[_]]));
1324
+ };
1236
1325
 
1237
1326
  const withValidator = (props, validator) => {
1238
1327
  const { value, isDirty } = props;
@@ -1244,6 +1333,29 @@
1244
1333
  };
1245
1334
  };
1246
1335
 
1336
+ const getValidation = (field, validator, required = false) => required ? withValidator(field, validator) : field;
1337
+
1338
+ const ACQUIRING_TYPES = [
1339
+ {
1340
+ text: 'Торговый эквайринг',
1341
+ key: 'trade',
1342
+ },
1343
+ {
1344
+ text: 'СБП-эквайринг',
1345
+ key: 'sbp',
1346
+ },
1347
+ {
1348
+ text: 'Интернет-эквайринг',
1349
+ key: 'internet',
1350
+ },
1351
+ {
1352
+ text: 'Все виды эквайринга',
1353
+ key: 'all',
1354
+ },
1355
+ ];
1356
+ const AcquiringField = JSX(({ field, input }) => (jsx(SelectControl, { label: "\u0412\u0438\u0434 \u044D\u043A\u0432\u0430\u0439\u0440\u0438\u043D\u0433\u0430", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u044D\u043A\u0432\u0430\u0439\u0440\u0438\u043D\u0433", options: ACQUIRING_TYPES, ...getValidation(field('acquiringType'), validatorObj.acquiringType, input?.required) })));
1357
+ const isAcquiringTrade = (key = '') => Boolean(key === 'trade' || key === 'all');
1358
+
1247
1359
  const isFilled = (_) => _ !== null && _ !== undefined;
1248
1360
 
1249
1361
  const defaultCache = new Map();
@@ -1327,278 +1439,30 @@
1327
1439
  return Array.isArray(data) ? data : [];
1328
1440
  }
1329
1441
 
1330
- const getNamesFromInput = (inputs) => Object.values(inputs.filter((_) => _))?.map((_) => _.name);
1331
-
1332
- const pattern = (regexp) => validator((_) => typeof _ === 'string' && regexp.test(_));
1333
-
1334
- const required = validator((_) => _ !== null && _ !== undefined && _ !== '');
1335
-
1336
- const ERROR_MESSAGE = 'Некорректно заполненное поле';
1337
- const defaultValidator = required(ERROR_MESSAGE);
1338
- const defaultSelectValidator = validator((_) => _?.key && _?.key !== '')(ERROR_MESSAGE);
1339
- const nameValidator = validator((_) => typeof _ === 'string' && _.length > 1)(ERROR_MESSAGE);
1340
- const innValidator = validator((_) => typeof _ === 'string' && (_.length === 10 || _.length === 12))(ERROR_MESSAGE);
1341
- const phoneValidator = pattern(/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/)(ERROR_MESSAGE);
1342
- const agreementValidator = validator((_) => typeof _ === 'boolean' && _)('Согласие обязательно');
1343
-
1344
- const validatorObj = {
1345
- typeForm: defaultValidator,
1346
- surname: nameValidator,
1347
- name: nameValidator,
1348
- region: defaultSelectValidator,
1349
- addressBranch: defaultSelectValidator,
1350
- phone: phoneValidator,
1351
- birthday: defaultValidator,
1352
- email: defaultValidator,
1353
- fullName: nameValidator,
1354
- inn: innValidator,
1355
- partnerComments: defaultValidator,
1356
- collectionCount: defaultValidator,
1357
- comment: defaultValidator,
1358
- acquiringType: defaultSelectValidator,
1359
- serviceType: defaultSelectValidator,
1360
- consentDataProcessing: agreementValidator,
1361
- annualRevenue: defaultValidator,
1362
- };
1363
- const getObjectValidator = (inputs) => {
1364
- const requiredInputs = getNamesFromInput(inputs.filter((_) => ('required' in _ ? _.required : false)));
1365
- return Object.fromEntries(requiredInputs.map((_) => [_, validatorObj?.[_]]));
1366
- };
1367
-
1368
- const getValidation = (field, validator, required = false) => required ? withValidator(field, validator) : field;
1369
-
1370
1442
  const AddressBranchField = JSX(({ field, input, isPremium = false }) => {
1371
- const regionKey = field('region')?.value?.key;
1372
- const regionText = field('region')?.value?.text;
1443
+ const fieldRegion = field('region');
1444
+ const regionKey = fieldRegion?.value?.key;
1445
+ const regionText = fieldRegion?.value?.text;
1373
1446
  const addressBranch = isPremium
1374
1447
  ? useBranchesByRegions()?.find((_) => _?.region === regionText)?.branches
1375
1448
  : useBranches(regionKey)?.filter((branch) => branch?.address);
1376
1449
  useEffect(() => {
1377
- if (field('region')?.value?.key !== '') {
1450
+ if (fieldRegion?.value?.key !== '') {
1378
1451
  field?.('addressBranch')?.onChange?.('');
1379
1452
  }
1380
- }, [field('region')?.value]);
1453
+ }, [fieldRegion?.value]);
1381
1454
  return (jsx(SelectControl, { label: "\u0410\u0434\u0440\u0435\u0441", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441", options: (addressBranch || []).map(({ address = '' }) => ({
1382
1455
  key: address,
1383
1456
  text: address,
1384
1457
  })), ...getValidation(field('addressBranch'), validatorObj.addressBranch, input?.required) }));
1385
1458
  });
1386
1459
 
1387
- const REGIONS_URL = '/api/v1/regions';
1388
- function useRegions() {
1389
- const { data } = useAsyncData(REGIONS_URL, fetchJSONUnsafe);
1390
- return Array.isArray(data) ? data : [];
1391
- }
1392
-
1393
- const RegionField = JSX(({ field, input }) => {
1394
- const regions = useRegions();
1395
- return (jsx(SelectControl, { label: "\u0424\u0438\u043B\u0438\u0430\u043B", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0438\u043B\u0438\u0430\u043B", isSearch: true, options: useMemo(() => regions?.map(({ code = '', name = '' }) => ({ key: code, text: name })), [regions]), ...getValidation(field('region'), validatorObj.region, input?.required) }));
1396
- });
1397
-
1398
- const SVG = JSX(({ className, viewBox, fill = 'none', width, height, paths, ...commonOptions }) => {
1399
- return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: className, viewBox: viewBox, fill: fill, width: width, height: height, children: paths.map(({ d, fill: pathFill, ...options }, i) => {
1400
- const resultOptions = { ...commonOptions, ...options };
1401
- return (jsx("path", { d: d, fill: pathFill || 'currentColor', stroke: resultOptions.stroke, strokeLinecap: resultOptions.strokeLinecap, strokeLinejoin: resultOptions.strokeLinejoin, strokeWidth: resultOptions.strokeWidth, strokeMiterlimit: resultOptions.strokeMiterlimit }, i));
1402
- }) }));
1403
- });
1404
-
1405
- const CHECK_PATHS = [
1406
- {
1407
- d: 'M10.207.793a1 1 0 0 1 0 1.414l-6 6a1 1 0 0 1-1.414 0l-2.5-2.5a1 1 0 0 1 1.414-1.414L3.5 6.086 8.793.793a1 1 0 0 1 1.414 0Z',
1408
- fillRule: 'evenodd',
1409
- clipRule: 'evenodd',
1410
- fill: 'white',
1411
- },
1412
- ];
1413
- const Checkbox = JSX(({ className, value, text, disabled, isRadio, onChange }) => {
1414
- const handleChange = useCallback((e) => {
1415
- if (disabled) {
1416
- return;
1417
- }
1418
- e.preventDefault();
1419
- onChange && onChange(!value);
1420
- }, [onChange, disabled, value]);
1421
- const icon = isRadio ? (jsx("div", { className: "absolute left-1 w-3 h-3 rounded-full bg-primary-main" })) : (jsx(SVG, { paths: CHECK_PATHS, className: "absolute left-1 ml-px block", width: "11", height: "9", fill: "white", viewBox: "0 0 11 9" }));
1422
- return (jsx("div", { className: className, children: jsxs("label", { className: "flex items-center relative cursor-pointer group/box", onClick: handleChange, children: [jsx("div", { className: style('appearance-none w-5 h-5 border-solid cursor-pointer m-0', isRadio ? 'rounded-full border-2' : checkboxStyle(value), value ? 'border-primary-main' : 'border-gray', disabled ? 'bg-main-disabled' : 'group-hover/box:border-primary-hover'), role: role(isRadio), "aria-checked": Boolean(value), "aria-disabled": Boolean(disabled) }), value ? icon : null, text ? (jsx("div", { className: "ml-s", children: jsx(Text, { size: "text-l", font: "font-light", children: text }) })) : null] }) }));
1423
- });
1424
- const role = (isRadio) => (isRadio ? 'radio' : 'checkbox');
1425
- const checkboxStyle = (value) => style('rounded border', value ? 'bg-primary-main' : '');
1426
-
1427
- const Footnote = JSX(({ text, link }) => (jsxs(Paragraph, { size: "text-s", font: "font-light", color: "text-secondary-text", children: [jsx(Text, { children: text }), link ? (jsx(LinkButton, { href: link.href, ariaLabel: "\u0443\u0441\u043B\u043E\u0432\u0438\u044F \u043F\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043D\u043D\u044B\u0445", target: link.target || '', className: "text-primary-main", children: jsx(Text, { children: link.text }) })) : null] })));
1428
-
1429
- function useButton() {
1430
- return (props) => ({
1431
- ...props,
1432
- onClick: handlerDecorator(handleClick(props)),
1433
- });
1434
- }
1435
- function handleClick({ disabled, onClick }) {
1436
- return (ev) => {
1437
- !disabled && onClick && onClick(ev);
1438
- };
1439
- }
1440
-
1441
- const activeButtonStyleMap = 'text-white bg-primary-active';
1442
- const disabledButtonStyle = 'bg-main-gray text-main-disabled cursor-not-allowed';
1443
- const buttonStyleMap = {
1444
- primary: 'text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active',
1445
- secondary: 'text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active',
1446
- };
1447
- const secondaryButtonStyleMap = {
1448
- primary: style('group-data-secondary:text-primary-main group-data-secondary:bg-white', 'group-data-secondary:hover:text-white group-data-secondary:hover:bg-primary-hover', 'group-data-secondary:active:bg-primary-active'),
1449
- secondary: style('group-data-secondary:text-white group-data-secondary:bg-white/20', 'group-data-secondary:hover:bg-primary-hover', 'group-data-secondary:active:bg-primary-active'),
1450
- };
1451
- const Button = JSX(({ children, ...props }) => {
1452
- const button = useButton();
1453
- const { className, version = 'primary', active, disabled, type = 'button', rounded = true, role, onClick, } = button(props);
1454
- return (jsx("button", { className: style('font-sans px-9 py-4', 'flex justify-center items-center gap-xs', active ? activeButtonStyleMap : '', disabled ? disabledButtonStyle : '', !active && !disabled
1455
- ? style(buttonStyleMap[version], secondaryButtonStyleMap[version])
1456
- : '', rounded ? 'rounded-md' : '', className), type: type, role: role, onClick: onClick, children: children }));
1457
- });
1458
-
1459
- const renderSubmitButton = (button, className) => (jsx(Button, { className: style('w-full @xl:w-auto', className), type: "submit", children: button?.text ? button.text : 'Отправить заявку' }));
1460
-
1461
- const agreementText = 'Нажимая кнопку, вы подтверждаете согласие с ';
1462
- const renderAgreementSubmit = (consentDataProcessing, link, button) => (jsxs("div", { className: "flex col-span-2 gap-m flex-col lg:flex-row w-full justify-between items-baseline", children: [consentDataProcessing ? (jsxs("div", { children: [jsxs("div", { className: "flex gap-3", children: [jsx(Checkbox, { ...consentDataProcessing }), jsx(Footnote, { link: link })] }), renderErrorText(withValidator(consentDataProcessing, agreementValidator).error)] })) : (jsx(Footnote, { text: agreementText, link: link })), renderSubmitButton(button)] }));
1463
-
1464
- const ApplicationFieldsetLayout = JSX(({ title, children }) => (jsxs("fieldset", { className: "grid @xl:flex @xl:justify-between gap-m border-b border-b-main-divider @xl:border-none", children: [title ? (jsx("legend", { className: "w-full", children: jsx(Heading, { title: title, headingType: "h6", className: "@xl:text-center" }) })) : null, children] })));
1465
-
1466
- const FEEDBACK_TYPES = [
1467
- {
1468
- text: 'Задать вопрос по продуктам и услугам',
1469
- key: 'FEEDBACK',
1470
- },
1471
- {
1472
- text: 'Качество обслуживания',
1473
- key: 'FEEDBACK_QS',
1474
- },
1475
- ];
1476
- const FEEDBACK_METHOD = [
1477
- { key: 'phone', text: 'Телефонный звонок' },
1478
- { key: 'email', text: 'Электронное сообщение' },
1479
- ];
1480
- const SERVICE_DIRECTIONS = [
1481
- { key: 'Физическое лицо' },
1482
- { key: 'Юридическое лицо / ИП' },
1483
- ];
1484
-
1485
- const initialFormState$1 = {
1486
- surname: '',
1487
- name: '',
1488
- middleName: '',
1489
- typeForm: { key: 'FEEDBACK', text: 'Задать вопрос по продуктам и услугам' },
1490
- serviceDirection: { key: 'Физическое лицо' },
1491
- birthday: undefined,
1492
- feedbackMethod: { key: 'Телефонный звонок' },
1493
- phone: '',
1494
- email: '',
1495
- comment: '',
1496
- consentDataProcessing: false,
1497
- };
1498
- const feedbackValidatorDefaultObject = {
1499
- typeForm: defaultValidator,
1500
- region: defaultValidator,
1501
- surname: defaultValidator,
1502
- name: nameValidator,
1503
- feedbackMethod: defaultValidator,
1504
- phone: phoneValidator,
1505
- email: defaultValidator,
1506
- comment: defaultValidator,
1507
- consentDataProcessing: agreementValidator,
1508
- };
1509
- const ApplicationFormFeedback = JSX(({ button, link, onSubmit }) => {
1510
- const handleSubmit = useCallback((feedbackFormState) => {
1511
- handleSubmitFeedback(feedbackFormState, onSubmit);
1512
- }, [onSubmit]);
1513
- const [, { field, ...formProps }] = useForm(initialFormState$1, {
1514
- onSubmit: handleSubmit,
1515
- });
1516
- const isQualityService = field('typeForm').value?.key === 'FEEDBACK_QS';
1517
- const isLegalEntity = getLegalEntity(field('typeForm').value?.key, field('serviceDirection').value?.key);
1518
- return (jsx("form", { className: "container space-y-m", onSubmit: formProps.onSubmit, children: jsx(ApplicationFieldsetLayout, { children: jsxs("div", { className: "w-full max-w-xl space-y-s m-auto", children: [jsx(SelectControl, { label: "\u0422\u0435\u043C\u0430", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0442\u0435\u043C\u0443", options: FEEDBACK_TYPES, ...withValidator(field('typeForm'), defaultValidator) }), isQualityService ? (jsx(SelectControl, { label: "\u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u043D\u0438\u044F", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435", options: SERVICE_DIRECTIONS, ...withValidator(field('serviceDirection'), defaultValidator) })) : null, jsx(RegionField, { field: field }), isQualityService ? jsx(AddressBranchField, { field: field }) : null, jsxs("div", { className: "space-y-s", children: [jsx(InputControl, { label: "\u0424\u0430\u043C\u0438\u043B\u0438\u044F", ...withValidator(field('surname'), nameValidator) }), jsx(InputControl, { label: "\u0418\u043C\u044F", ...withValidator(field('name'), nameValidator) }), jsx(InputControl, { label: "\u041E\u0442\u0447\u0435\u0441\u0442\u0432\u043E (\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E, \u043F\u0440\u0438 \u043D\u0430\u043B\u0438\u0447\u0438\u0438)", ...field('middleName') }), jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F", ...withValidator(field('birthday'), defaultValidator) })] }), isLegalEntity ? (jsxs("div", { children: [jsx(InputControl, { label: "\u0418\u041D\u041D", ...withValidator(field('inn'), innValidator) }), jsx(InputControl, { label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...field('fullName') })] })) : null, jsx(SelectControl, { label: "\u0421\u043F\u043E\u0441\u043E\u0431 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u044F \u043E\u0442\u0432\u0435\u0442\u0430", options: FEEDBACK_METHOD, ...withValidator(field('feedbackMethod'), defaultValidator) }), jsx(InputPhoneControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) }), isQualityService ? (jsxs("div", { children: [jsx(InputPhoneControl, { label: "\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0439 \u0442\u0435\u043B\u0435\u0444\u043E\u043D", ...(!field('secondaryPhone').value || field('secondaryPhone').value === '+7 ('
1519
- ? field('secondaryPhone')
1520
- : withValidator(field('secondaryPhone'), phoneValidator)) }), jsx(InputControl, { label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...withValidator(field('email'), defaultValidator) }), jsx(InputControl, { label: "\u0424\u0418\u041E \u0438\u043B\u0438 \u0434\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u0432\u0448\u0435\u0433\u043E \u0412\u0430\u0441 \u0441\u043E\u0442\u0440\u0443\u0434\u043D\u0438\u043A\u0430 \u0411\u0430\u043D\u043A\u0430", ...field('bankEmpolee') }), jsx(InputControl, { label: "\u0414\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u044F \u0432 \u0411\u0430\u043D\u043A", ...field('applicationDate') })] })) : (jsx(InputControl, { label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...withValidator(field('email'), defaultValidator) })), jsx(InputControl, { ...withValidator(field('comment'), defaultValidator), placeholder: "\u0412\u0430\u0448\u0435 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435", isTextarea: true }), renderAgreementSubmit(field('consentDataProcessing'), link, button)] }) }) }));
1521
- });
1522
- const handleSubmitFeedback = (formState, onSubmit) => {
1523
- const isLegal = getLegalEntity(formState?.typeForm.key, formState?.serviceDirection?.key);
1524
- const feedbackValidator = objectValidator({
1525
- ...feedbackValidatorDefaultObject,
1526
- ...getFeedbackValidationObject(formState, isLegal),
1527
- });
1528
- isValidationSuccess(feedbackValidator(formState)) && onSubmit(formState, !isLegal);
1529
- };
1530
- const getFeedbackValidationObject = (formState, isLegal) => {
1531
- if (isLegal) {
1532
- return { addressBranch: defaultValidator, inn: innValidator };
1533
- }
1534
- else if (formState.typeForm.key === 'FEEDBACK') {
1535
- return { birthday: defaultValidator };
1536
- }
1537
- else {
1538
- return { addressBranch: defaultValidator };
1539
- }
1540
- };
1541
- const getLegalEntity = (typeFormKey = '', serviceDirectionKey = '') => typeFormKey === 'FEEDBACK_QS' && serviceDirectionKey === 'Юридическое лицо / ИП';
1542
-
1543
- const EmbeddableForms = {
1544
- ApplicationFormFeedback,
1545
- };
1546
-
1547
- const API$1 = LeadServiceAPI();
1548
- const ApplicationForm = UniBlock(({ className, formBlock, ...rest }) => {
1549
- const [responseType, setResponseType] = useState('');
1550
- const handleSubmit = useCallback(async (data, isIndividualType = false) => {
1551
- const formatData = getFormatData$1(data);
1552
- const status = (await API$1.send(formatData, isIndividualType)) ? 'OK' : 'Fail';
1553
- setResponseType(status);
1554
- return status;
1555
- }, []);
1556
- return (jsx(BlockWrapper, { className: className, defaultPadding: "p-6xl", ...rest, children: jsxs("div", { className: "container max-w-[978px] space-y-m", children: [formBlock?.title ? (jsx(Heading, { headingType: "h3", title: formBlock.title, className: "@xl:text-center" })) : null, formBlock ? renderEmbeddedForm(formBlock, handleSubmit) : null, responseType ? jsx(ResponseNotification, { responseType: responseType }) : null] }) }));
1557
- });
1558
- const renderEmbeddedForm = (formBlock, handleSubmit) => {
1559
- const type = formBlock?.formType;
1560
- if (!type || !(type in EmbeddableForms)) {
1561
- return null;
1562
- }
1563
- const EmbeddedForm = EmbeddableForms[type];
1564
- return jsx(EmbeddedForm, { ...formBlock, onSubmit: handleSubmit });
1565
- };
1566
- const getFormatData$1 = (data) => Object.fromEntries(Object.entries(data).map(([k, v]) => [k, (v?.region ? v?.text : v?.key) || v]));
1567
-
1568
- const ApplicationFormLayout = JSX((props) => {
1569
- const { className, title, responseType, children, ...rest } = props;
1570
- return (jsx(BlockWrapper, { className: className, defaultPadding: "p-6xl", ...rest, children: jsxs("div", { className: "container max-w-[978px] space-y-lg", children: [title ? jsx(Heading, { headingType: "h3", title: title, className: "@xl:text-center" }) : null, children, responseType ? jsx(ResponseNotification, { responseType: responseType }) : null] }) }));
1571
- });
1572
-
1573
- const CheckboxWithError = JSX(({ className, text, value, key, disabled, error, onChange }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(Checkbox, { text: text, value: value, disabled: disabled, onChange: onChange }, key), renderErrorText(error)] })));
1574
-
1575
- const ACQUIRING_TYPES = [
1576
- {
1577
- text: 'Торговый эквайринг',
1578
- key: 'trade',
1579
- },
1580
- {
1581
- text: 'СБП-эквайринг',
1582
- key: 'sbp',
1583
- },
1584
- {
1585
- text: 'Интернет-эквайринг',
1586
- key: 'internet',
1587
- },
1588
- {
1589
- text: 'Все виды эквайринга',
1590
- key: 'all',
1591
- },
1592
- ];
1593
- const AcquiringField = JSX(({ field, input }) => (jsx(SelectControl, { label: "\u0412\u0438\u0434 \u044D\u043A\u0432\u0430\u0439\u0440\u0438\u043D\u0433\u0430", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u044D\u043A\u0432\u0430\u0439\u0440\u0438\u043D\u0433", options: ACQUIRING_TYPES, ...getValidation(field('acquiringType'), validatorObj.acquiringType, input?.required) })));
1594
- const isAcquiringTrade = (key = '') => Boolean(key === 'trade' || key === 'all');
1595
-
1596
1460
  const useNormalizedInput = (props, { normalize, format }) => {
1597
1461
  const { value, onFocus, onBlur, onChange } = props;
1598
1462
  const [isFocused, setIsFocused] = useState(false);
1599
- const handleFocus = useCallback((e) => {
1463
+ const handleFocus = useCallback((ev) => {
1600
1464
  setIsFocused(true);
1601
- onFocus && onFocus(e);
1465
+ onFocus && onFocus(ev);
1602
1466
  }, []);
1603
1467
  const handleBlur = useCallback(() => {
1604
1468
  setIsFocused(false);
@@ -1658,12 +1522,67 @@
1658
1522
 
1659
1523
  const CommentField = JSX(({ field, input }) => (jsx(InputControl, { className: "col-span-2", ...getValidation(field('comment'), validatorObj.comment, input?.required), placeholder: "\u0412\u0430\u0448\u0435 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435", isTextarea: true })));
1660
1524
 
1525
+ const SERVICE_TYPES = [
1526
+ { key: 'ULTRASERVICE', text: 'Ультра' },
1527
+ { key: 'PREMIUMSERVICE', text: 'Премиум' },
1528
+ ];
1529
+ const SERVICE_DIRECTIONS = [
1530
+ { key: 'Физическое лицо' },
1531
+ { key: 'Юридическое лицо / ИП' },
1532
+ ];
1533
+ const FEEDBACK_TYPES = [
1534
+ {
1535
+ text: 'Задать вопрос по продуктам и услугам',
1536
+ key: 'FEEDBACK',
1537
+ },
1538
+ {
1539
+ text: 'Качество обслуживания',
1540
+ key: 'FEEDBACK_QS',
1541
+ },
1542
+ ];
1543
+ const FEEDBACK_METHOD = [
1544
+ { key: 'phone', text: 'Телефонный звонок' },
1545
+ { key: 'email', text: 'Электронное сообщение' },
1546
+ ];
1547
+
1548
+ const FeedbackMethodField = JSX(({ field }) => (jsx(SelectControl, { label: "\u0421\u043F\u043E\u0441\u043E\u0431 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u044F \u043E\u0442\u0432\u0435\u0442\u0430", options: FEEDBACK_METHOD, ...withValidator(field('feedbackMethod'), validatorObj.feedbackMethod) })));
1549
+
1550
+ const FeedbackTypeField = JSX(({ field }) => {
1551
+ const feedbackType = field('feedbackType');
1552
+ useEffect(() => {
1553
+ if (feedbackType?.value?.key === 'FEEDBACK') {
1554
+ field('serviceDirection')?.onChange?.(SERVICE_DIRECTIONS[0]);
1555
+ }
1556
+ }, [feedbackType?.value]);
1557
+ return (jsx(SelectControl, { label: "\u0422\u0435\u043C\u0430", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0442\u0435\u043C\u0443", options: FEEDBACK_TYPES, ...withValidator(feedbackType, validatorObj.feedbackType) }));
1558
+ });
1559
+
1560
+ const IsClientField = JSX(({ field }) => (jsx(CheckboxWithError, { ...field('isClient'), text: '\u042F\u0432\u043B\u044F\u044E\u0441\u044C \u043A\u043B\u0438\u0435\u043D\u0442\u043E\u043C \u0431\u0430\u043D\u043A\u0430 \u0410\u041E "\u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A"' })));
1561
+
1661
1562
  const SlideCheckbox = JSX(({ value = false, text, type = 'checkbox', onChange }) => (jsxs("div", { role: type, "aria-checked": value, className: "flex justify-start items-center w-full cursor-pointer mb-s", onClick: () => onChange && onChange(!value), children: [jsx("div", { className: style('relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl', value ? 'bg-primary-main' : 'bg-main-divider'), children: jsx("div", { className: style('absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full', value ? 'left-1/2' : 'left-[5%]') }) }), text ? (jsx(Text, { size: "text-l", font: "font-light", color: "text-primary-text", children: text })) : null] })));
1662
1563
 
1663
1564
  const OnlineCheckoutField = JSX(({ field }) => isAcquiringTrade(field('acquiringType')?.value?.key) ? (jsx(SlideCheckbox, { type: "radio", text: "\u0425\u043E\u0447\u0443 \u043E\u043D\u043B\u0430\u0439\u043D-\u043A\u0430\u0441\u0441\u0443", ...field('onlineCheckout') })) : null);
1664
1565
 
1566
+ const SecondaryPhoneField = JSX(({ field }) => {
1567
+ const fieldPhone = field('secondaryPhone');
1568
+ return (jsx(InputPhoneControl, { label: "\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0439 \u0442\u0435\u043B\u0435\u0444\u043E\u043D", ...(!fieldPhone.value || fieldPhone.value === '+7 ('
1569
+ ? fieldPhone
1570
+ : withValidator(fieldPhone, validatorObj.secondaryPhone)) }));
1571
+ });
1572
+
1665
1573
  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);
1666
1574
 
1575
+ const REGIONS_URL = '/api/v1/regions';
1576
+ function useRegions() {
1577
+ const { data } = useAsyncData(REGIONS_URL, fetchJSONUnsafe);
1578
+ return Array.isArray(data) ? data : [];
1579
+ }
1580
+
1581
+ const RegionField = JSX(({ field, input }) => {
1582
+ const regions = useRegions();
1583
+ return (jsx(SelectControl, { label: "\u0424\u0438\u043B\u0438\u0430\u043B", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0438\u043B\u0438\u0430\u043B", isSearch: true, options: useMemo(() => regions?.map(({ code = '', name = '' }) => ({ key: code, text: name })), [regions]), ...getValidation(field('region'), validatorObj.region, input?.required) }));
1584
+ });
1585
+
1667
1586
  const RegionPremiumField = JSX(({ field, input }) => {
1668
1587
  const branchByRegions = useBranchesByRegions();
1669
1588
  const regions = useMemo(() => branchByRegions?.map(({ region }) => ({
@@ -1673,16 +1592,14 @@
1673
1592
  return (jsx(SelectControl, { label: "\u0420\u0435\u0433\u0438\u043E\u043D", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0435\u0433\u0438\u043E\u043D", options: regions, ...getValidation(field('region'), validatorObj.region, input?.required) }));
1674
1593
  });
1675
1594
 
1595
+ const ServiceDirectionField = JSX(({ field }) => (jsx(SelectControl, { label: "\u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u043D\u0438\u044F", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435", options: SERVICE_DIRECTIONS, ...withValidator(field('serviceDirection'), validatorObj.serviceDirection) })));
1596
+
1676
1597
  const MIN_CREDIT_TERM = 1;
1677
1598
  const MAX_CREDIT_TERM = 180;
1678
1599
  const ITEMS_CREDIT_TERM = ['От 1 мес', 'До 15 лет'];
1679
1600
  const TermField = JSX(({ field }) => (jsx(InputRange, { title: "\u0421\u0440\u043E\u043A, \u043C\u0435\u0441\u044F\u0446\u0435\u0432", items: ITEMS_CREDIT_TERM, min: MIN_CREDIT_TERM, max: MAX_CREDIT_TERM, ...field('term') })));
1680
1601
 
1681
- const SERVICE_TYPES = [
1682
- { key: 'ULTRASERVICE', text: 'Ультра' },
1683
- { key: 'PREMIUMSERVICE', text: 'Премиум' },
1684
- ];
1685
- const UltraPremiumField = JSX(({ field }) => (jsx(SelectControl, { label: "\u0422\u0438\u043F \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u043D\u0438\u044F", options: SERVICE_TYPES, ...withValidator(field('serviceType'), defaultValidator) })));
1602
+ const UltraPremiumField = JSX(({ field }) => (jsx(SelectControl, { label: "\u0422\u0438\u043F \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u043D\u0438\u044F", options: SERVICE_TYPES, ...withValidator(field('serviceType'), validatorObj.serviceType) })));
1686
1603
 
1687
1604
  const Radio = JSX(({ name, text, value, checked, onChange, className }) => (jsx("div", { className: className, children: jsxs("label", { className: "font-sans flex gap-s items-center relative cursor-pointer", children: [jsx("input", { className: "appearance-none flex justify-center items-center shrink-0 w-5 h-5 border border-gray hover:border-primary-hover\n checked:border-2 checked:!border-primary-main focus:checked:border-primary-main focus:border-primary-text active:border-primary-text\n after:block after:w-2.5 after:h-2.5 after:rounded-full checked:after:bg-primary-main outline-none rounded-full cursor-pointer", type: "radio", value: value, name: name, checked: checked, onChange: (_) => onChange?.(_.target.value), role: "radio" }), text ? jsx(Text, { color: "text-primary-text", children: text }) : null] }) })));
1688
1605
 
@@ -1720,7 +1637,7 @@
1720
1637
  region: isPremium ? (jsx(RegionPremiumField, { field: field })) : (jsx(RegionField, { field: field, input: input })),
1721
1638
  addressBranch: jsx(AddressBranchField, { field: field, input: input, isPremium: isPremium }),
1722
1639
  birthday: (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F", ...getValidation(field('birthday'), validatorObj.birthday, required) })),
1723
- isClient: (jsx(CheckboxWithError, { ...field('isClient'), text: '\u042F\u0432\u043B\u044F\u044E\u0441\u044C \u043A\u043B\u0438\u0435\u043D\u0442\u043E\u043C \u0431\u0430\u043D\u043A\u0430 \u0410\u041E "\u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A"' })),
1640
+ isClient: jsx(IsClientField, { field: field }),
1724
1641
  consentToReceiveMaterials: (jsx(CheckboxWithError, { ...field('consentToReceiveMaterials'), text: "\u0421\u043E\u0433\u043B\u0430\u0441\u0435\u043D \u043D\u0430 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u0435 \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0445 \u0438 \u0430\u043D\u0430\u043B\u0438\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u043E\u0432 \u043F\u043E \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u0435" })),
1725
1642
  partnerComments: (jsx(InputControl, { ...getValidation(field('partnerComments'), validatorObj.partnerComments, required), placeholder: "\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0438\u043D\u0442\u0435\u0440\u0435\u0441\u0443\u044E\u0449\u0438\u0439 \u0432\u0430\u0441 \u0432\u043E\u043F\u0440\u043E\u0441", isTextarea: true, ...rest })),
1726
1643
  collectionCount: (jsx(InputControl, { label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043E\u0431\u044A\u0435\u043A\u0442\u043E\u0432 \u0438\u043D\u043A\u0430\u0441\u0441\u0430\u0446\u0438\u0438", type: "number", ...getValidation(field('collectionCount'), validatorObj.collectionCount, required) })),
@@ -1732,13 +1649,19 @@
1732
1649
  amount: jsx(AmountField, { field: field }),
1733
1650
  annualRevenue: (jsx(InputControl, { label: "\u0413\u043E\u0434\u043E\u0432\u0430\u044F \u0432\u044B\u0440\u0443\u0447\u043A\u0430, \u20BD", ...getValidation(field('annualRevenue'), validatorObj.annualRevenue, required) })),
1734
1651
  vedTypes: jsx(VedField, { field: field }),
1652
+ feedbackType: jsx(FeedbackTypeField, { field: field }),
1653
+ feedbackMethod: jsx(FeedbackMethodField, { field: field }),
1654
+ serviceDirection: jsx(ServiceDirectionField, { field: field }),
1655
+ bankEmpolee: (jsx(InputControl, { label: "\u0424\u0418\u041E \u0438\u043B\u0438 \u0434\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u0432\u0448\u0435\u0433\u043E \u0412\u0430\u0441 \u0441\u043E\u0442\u0440\u0443\u0434\u043D\u0438\u043A\u0430 \u0411\u0430\u043D\u043A\u0430", ...field('bankEmpolee') })),
1656
+ applicationDate: (jsx(InputControl, { label: "\u0414\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u044F \u0432 \u0411\u0430\u043D\u043A", ...field('applicationDate') })),
1657
+ secondaryPhone: jsx(SecondaryPhoneField, { field: field }),
1735
1658
  };
1736
1659
  return isRenderField({ input, field }) ? (jsx("div", { children: InputsMap[input?.name] }, String(index))) : null;
1737
1660
  };
1738
1661
  function isRenderField({ input, field, }) {
1739
1662
  const { condition } = input;
1740
1663
  const { value } = field(condition?.name || '');
1741
- return !condition || condition?.values?.find((_) => _ === value);
1664
+ return !condition || condition?.values?.find((_) => _ === (value?.key ?? value));
1742
1665
  }
1743
1666
 
1744
1667
  const getPartnerComments = (data) => {
@@ -1755,13 +1678,14 @@
1755
1678
 
1756
1679
  /* eslint-disable @typescript-eslint/no-unused-vars */
1757
1680
  const getFormatData = (data) => {
1758
- const { acquiringType, onlineCheckout, posTerminal, amount, term, annualRevenue, serviceType, vedTypes, region, ...usedData } = data;
1681
+ const { acquiringType, onlineCheckout, posTerminal, amount, term, annualRevenue, serviceType, feedbackType, vedTypes, region, ...usedData } = data;
1759
1682
  const partnerComments = acquiringType || annualRevenue ? getPartnerComments(data) : null;
1760
1683
  const formatData = {
1761
1684
  ...usedData,
1762
1685
  ...getVedTypes(vedTypes),
1763
1686
  ...getRegion(region),
1764
1687
  ...(partnerComments ? { partnerComments } : {}),
1688
+ ...(feedbackType ? { typeForm: feedbackType } : {}),
1765
1689
  };
1766
1690
  return Object.fromEntries(Object.entries(formatData)?.map(([k, v]) => [k, v?.key || v]));
1767
1691
  };
@@ -1778,8 +1702,8 @@
1778
1702
  addressBranch: { key: '', text: '' },
1779
1703
  surname: '',
1780
1704
  name: '',
1781
- middleName: '',
1782
1705
  phone: '',
1706
+ secondaryPhone: '',
1783
1707
  comment: '',
1784
1708
  product: '',
1785
1709
  partnerComments: '',
@@ -1788,6 +1712,9 @@
1788
1712
  amount: 1000,
1789
1713
  acquiringType: ACQUIRING_TYPES[0],
1790
1714
  serviceType: SERVICE_TYPES[0],
1715
+ feedbackType: FEEDBACK_TYPES[0],
1716
+ feedbackMethod: FEEDBACK_METHOD[0],
1717
+ serviceDirection: SERVICE_DIRECTIONS[0],
1791
1718
  vedTypes: VED_TYPES[0],
1792
1719
  birthday: undefined,
1793
1720
  isClient: false,
@@ -1804,6 +1731,43 @@
1804
1731
  return { ...formState, typeForm: { key: typeForm, text: '' } };
1805
1732
  };
1806
1733
 
1734
+ const Footnote = JSX(({ text, link }) => (jsxs(Paragraph, { size: "text-s", font: "font-light", color: "text-secondary-text", children: [jsx(Text, { children: text }), link ? (jsx(LinkButton, { href: link.href, ariaLabel: "\u0443\u0441\u043B\u043E\u0432\u0438\u044F \u043F\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043D\u043D\u044B\u0445", target: link.target || '', className: "text-primary-main", children: jsx(Text, { children: link.text }) })) : null] })));
1735
+
1736
+ function useButton() {
1737
+ return (props) => ({
1738
+ ...props,
1739
+ onClick: handlerDecorator(handleClick(props)),
1740
+ });
1741
+ }
1742
+ function handleClick({ disabled, onClick }) {
1743
+ return (ev) => {
1744
+ !disabled && onClick && onClick(ev);
1745
+ };
1746
+ }
1747
+
1748
+ const activeButtonStyleMap = 'text-white bg-primary-active';
1749
+ const disabledButtonStyle = 'bg-main-gray text-main-disabled cursor-not-allowed';
1750
+ const buttonStyleMap = {
1751
+ primary: 'text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active',
1752
+ secondary: 'text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active',
1753
+ };
1754
+ const secondaryButtonStyleMap = {
1755
+ primary: style('group-data-secondary:text-primary-main group-data-secondary:bg-white', 'group-data-secondary:hover:text-white group-data-secondary:hover:bg-primary-hover', 'group-data-secondary:active:bg-primary-active'),
1756
+ secondary: style('group-data-secondary:text-white group-data-secondary:bg-white/20', 'group-data-secondary:hover:bg-primary-hover', 'group-data-secondary:active:bg-primary-active'),
1757
+ };
1758
+ const Button = JSX(({ children, ...props }) => {
1759
+ const button = useButton();
1760
+ const { className, version = 'primary', active, disabled, type = 'button', rounded = true, role, onClick, } = button(props);
1761
+ return (jsx("button", { className: style('font-sans px-9 py-4', 'flex justify-center items-center gap-xs', active ? activeButtonStyleMap : '', disabled ? disabledButtonStyle : '', !active && !disabled
1762
+ ? style(buttonStyleMap[version], secondaryButtonStyleMap[version])
1763
+ : '', rounded ? 'rounded-md' : '', className), type: type, role: role, onClick: onClick, children: children }));
1764
+ });
1765
+
1766
+ const renderSubmitButton = (button, className) => (jsx(Button, { className: style('w-full @xl:w-auto', className), type: "submit", children: button?.text ? button.text : 'Отправить заявку' }));
1767
+
1768
+ const agreementText = 'Нажимая кнопку, вы подтверждаете согласие с ';
1769
+ const renderAgreementSubmit = (consentDataProcessing, link, button) => (jsxs("div", { className: "flex col-span-2 gap-m flex-col lg:flex-row w-full justify-between items-baseline", children: [consentDataProcessing ? (jsxs("div", { children: [jsxs("div", { className: "flex gap-3", children: [jsx(Checkbox, { ...consentDataProcessing }), jsx(Footnote, { link: link })] }), renderErrorText(withValidator(consentDataProcessing, agreementValidator).error)] })) : (jsx(Footnote, { text: agreementText, link: link })), renderSubmitButton(button)] }));
1770
+
1807
1771
  const renderContacts = () => (jsxs("div", { className: "space-y-m", children: [jsx(Heading, { headingType: "h6", title: "\u0418\u043B\u0438 \u0441\u0432\u044F\u0436\u0438\u0442\u0435\u0441\u044C \u0441 \u043D\u0430\u043C\u0438 \u0443\u0434\u043E\u0431\u043D\u044B\u043C \u0441\u043F\u043E\u0441\u043E\u0431\u043E\u043C", className: "@xl:text-center" }), jsxs("div", { className: "flex gap-xl", children: [jsxs("a", { className: "flex gap-s items-center text-primary-text no-underline", href: `tel:8 (800) 200-78-70`, "aria-label": "8 (800) 200-78-70", children: [jsx(Img, { image: { icon: 'PhoneIcon' }, width: "24", height: "24" }), jsx("span", { children: "8 (800) 200-78-70" })] }), jsxs("a", { className: "flex gap-s items-center text-primary-text no-underline", "aria-label": "ved@rshb.ru", href: `mailto:ved@rshb.ru`, children: [jsx(Img, { image: { icon: 'MailIcon' }, width: "24", height: "24" }), jsx("span", { children: "ved@rshb.ru" })] })] })] }));
1808
1772
 
1809
1773
  const API = LeadServiceAPI();
@@ -1822,8 +1786,13 @@
1822
1786
  setResponseType(status);
1823
1787
  return status;
1824
1788
  }, []);
1825
- const [, { field, onSubmit }] = useForm(initialFormState, { onSubmit: handleSubmit });
1789
+ const [, { field, onSubmit, reset }] = useForm(initialFormState, { onSubmit: handleSubmit });
1826
1790
  const fieldName = getConsentDataProcessing(inputs)?.name;
1791
+ useEffect(() => {
1792
+ if (responseType === 'OK') {
1793
+ reset();
1794
+ }
1795
+ }, [responseType]);
1827
1796
  return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, responseType: responseType, ...rest, children: [jsxs("form", { onSubmit: onSubmit, children: [sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [_?.title ? jsx("div", { className: "@xl:text-center @xl:col-span-2", children: _.title }) : null, (_?.inputs || [])?.map(getField(field, typeForm))] }, `section-${i}`))), renderAgreementSubmit(fieldName ? field('consentDataProcessing') : undefined, link, button)] }), isContacts ? renderContacts() : null] }));
1828
1797
  });
1829
1798
  const inputColumnStyles = (column) => column === 2 ? '@xl:grid-cols-2' : '';
@@ -1831,7 +1800,12 @@
1831
1800
  const getFilteredInputs = (inputs, data) => inputs
1832
1801
  .filter((_) => _)
1833
1802
  .filter((input) => !input?.condition ||
1834
- input?.condition.values.find((_) => _ === data?.[input?.condition?.name]));
1803
+ input?.condition.values.find((_) => {
1804
+ const dataValue = data?.[input?.condition?.name ?? ''];
1805
+ return input.name === 'secondaryPhone'
1806
+ ? Boolean(data.secondaryPhone)
1807
+ : _ === (dataValue?.key ?? dataValue);
1808
+ }));
1835
1809
 
1836
1810
  const ApplicationFormGrantSupport = UniBlock(({ className, title, button, regionSource, ...rest }) => {
1837
1811
  const [region, setRegion] = useState({ key: '' });
@@ -5862,7 +5836,6 @@
5862
5836
 
5863
5837
  const Blocks = {
5864
5838
  AdTile,
5865
- ApplicationForm,
5866
5839
  ApplicationFormCustom,
5867
5840
  ApplicationFormGrantSupport,
5868
5841
  BankAccountFiltration,
@@ -6137,7 +6110,7 @@
6137
6110
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
6138
6111
  });
6139
6112
 
6140
- const packageVersion = "0.14.263";
6113
+ const packageVersion = "0.14.265";
6141
6114
 
6142
6115
  exports.Blocks = Blocks;
6143
6116
  exports.ContentPage = ContentPage;