@redneckz/wildless-cms-uni-blocks 0.14.608 → 0.14.609

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 (133) hide show
  1. package/bundle/api/RetailAPI/updateUserProfile.d.ts +2 -0
  2. package/bundle/bundle.umd.js +100 -28
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/ui-kit/ConsentBkiDialog/ConsentBkiDialog.d.ts +5 -0
  5. package/bundle/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +3 -0
  6. package/bundle/ui-kit/DialogManager/openDocument.d.ts +2 -0
  7. package/bundle/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -1
  8. package/bundle/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.d.ts +2 -3
  9. package/bundle/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -1
  10. package/dist/api/RetailAPI/updateUserProfile.d.ts +2 -0
  11. package/dist/api/RetailAPI/updateUserProfile.js +1 -1
  12. package/dist/api/RetailAPI/updateUserProfile.js.map +1 -1
  13. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -7
  14. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  15. package/dist/ui-kit/Checkbox/CheckboxWithDoc.js +2 -7
  16. package/dist/ui-kit/Checkbox/CheckboxWithDoc.js.map +1 -1
  17. package/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.d.ts +5 -0
  18. package/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +44 -0
  19. package/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -0
  20. package/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +3 -0
  21. package/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +49 -0
  22. package/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -0
  23. package/dist/ui-kit/DialogManager/openDocument.d.ts +2 -0
  24. package/dist/ui-kit/DialogManager/openDocument.js +11 -0
  25. package/dist/ui-kit/DialogManager/openDocument.js.map +1 -0
  26. package/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -1
  27. package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.d.ts +2 -3
  28. package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js +2 -2
  29. package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js.map +1 -1
  30. package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -1
  31. package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +1 -1
  32. package/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
  33. package/lib/api/RetailAPI/updateUserProfile.d.ts +2 -0
  34. package/lib/api/RetailAPI/updateUserProfile.js +1 -1
  35. package/lib/api/RetailAPI/updateUserProfile.js.map +1 -1
  36. package/lib/common.css +1 -1
  37. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -7
  38. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  39. package/lib/ui-kit/Checkbox/CheckboxWithDoc.js +2 -7
  40. package/lib/ui-kit/Checkbox/CheckboxWithDoc.js.map +1 -1
  41. package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.d.ts +5 -0
  42. package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.fixture.d.ts +6 -0
  43. package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +42 -0
  44. package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -0
  45. package/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +3 -0
  46. package/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +46 -0
  47. package/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -0
  48. package/lib/ui-kit/DialogManager/openDocument.d.ts +2 -0
  49. package/lib/ui-kit/DialogManager/openDocument.js +8 -0
  50. package/lib/ui-kit/DialogManager/openDocument.js.map +1 -0
  51. package/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -1
  52. package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.d.ts +2 -3
  53. package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js +2 -2
  54. package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js.map +1 -1
  55. package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -1
  56. package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +1 -1
  57. package/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
  58. package/mobile/bundle/api/RetailAPI/updateUserProfile.d.ts +2 -0
  59. package/mobile/bundle/bundle.umd.js +100 -28
  60. package/mobile/bundle/bundle.umd.min.js +1 -1
  61. package/mobile/bundle/ui-kit/ConsentBkiDialog/ConsentBkiDialog.d.ts +5 -0
  62. package/mobile/bundle/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +3 -0
  63. package/mobile/bundle/ui-kit/DialogManager/openDocument.d.ts +2 -0
  64. package/mobile/bundle/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -1
  65. package/mobile/bundle/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.d.ts +2 -3
  66. package/mobile/bundle/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -1
  67. package/mobile/dist/api/RetailAPI/updateUserProfile.d.ts +2 -0
  68. package/mobile/dist/api/RetailAPI/updateUserProfile.js +1 -1
  69. package/mobile/dist/api/RetailAPI/updateUserProfile.js.map +1 -1
  70. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -7
  71. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  72. package/mobile/dist/ui-kit/Checkbox/CheckboxWithDoc.js +2 -7
  73. package/mobile/dist/ui-kit/Checkbox/CheckboxWithDoc.js.map +1 -1
  74. package/mobile/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.d.ts +5 -0
  75. package/mobile/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +44 -0
  76. package/mobile/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -0
  77. package/mobile/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +3 -0
  78. package/mobile/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +49 -0
  79. package/mobile/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -0
  80. package/mobile/dist/ui-kit/DialogManager/openDocument.d.ts +2 -0
  81. package/mobile/dist/ui-kit/DialogManager/openDocument.js +11 -0
  82. package/mobile/dist/ui-kit/DialogManager/openDocument.js.map +1 -0
  83. package/mobile/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -1
  84. package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.d.ts +2 -3
  85. package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js +2 -2
  86. package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js.map +1 -1
  87. package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -1
  88. package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +1 -1
  89. package/mobile/dist/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
  90. package/mobile/lib/api/RetailAPI/updateUserProfile.d.ts +2 -0
  91. package/mobile/lib/api/RetailAPI/updateUserProfile.js +1 -1
  92. package/mobile/lib/api/RetailAPI/updateUserProfile.js.map +1 -1
  93. package/mobile/lib/common.css +1 -1
  94. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +8 -7
  95. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  96. package/mobile/lib/ui-kit/Checkbox/CheckboxWithDoc.js +2 -7
  97. package/mobile/lib/ui-kit/Checkbox/CheckboxWithDoc.js.map +1 -1
  98. package/mobile/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.d.ts +5 -0
  99. package/mobile/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +42 -0
  100. package/mobile/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -0
  101. package/mobile/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.d.ts +3 -0
  102. package/mobile/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +46 -0
  103. package/mobile/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -0
  104. package/mobile/lib/ui-kit/DialogManager/openDocument.d.ts +2 -0
  105. package/mobile/lib/ui-kit/DialogManager/openDocument.js +8 -0
  106. package/mobile/lib/ui-kit/DialogManager/openDocument.js.map +1 -0
  107. package/mobile/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +1 -1
  108. package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.d.ts +2 -3
  109. package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js +2 -2
  110. package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.js.map +1 -1
  111. package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -1
  112. package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +1 -1
  113. package/mobile/lib/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
  114. package/mobile/src/api/RetailAPI/updateUserProfile.ts +3 -1
  115. package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.ts +12 -7
  116. package/mobile/src/ui-kit/Checkbox/CheckboxWithDoc.tsx +2 -16
  117. package/mobile/src/ui-kit/ConsentBkiDialog/ConsentBkiDialog.tsx +73 -0
  118. package/mobile/src/ui-kit/ConsentBkiDialog/useConsentBkiDialog.tsx +58 -0
  119. package/mobile/src/ui-kit/DialogManager/openDocument.tsx +13 -0
  120. package/mobile/src/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.tsx +1 -1
  121. package/mobile/src/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.tsx +4 -4
  122. package/mobile/src/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.tsx +2 -2
  123. package/package.json +1 -1
  124. package/src/api/RetailAPI/updateUserProfile.ts +3 -1
  125. package/src/components/ApplicationLeadForm/useApplicationLeadApi.ts +12 -7
  126. package/src/ui-kit/Checkbox/CheckboxWithDoc.tsx +2 -16
  127. package/src/ui-kit/ConsentBkiDialog/ConsentBkiDialog.fixture.tsx +7 -0
  128. package/src/ui-kit/ConsentBkiDialog/ConsentBkiDialog.tsx +73 -0
  129. package/src/ui-kit/ConsentBkiDialog/useConsentBkiDialog.tsx +58 -0
  130. package/src/ui-kit/DialogManager/openDocument.tsx +13 -0
  131. package/src/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.tsx +1 -1
  132. package/src/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialog.tsx +4 -4
  133. package/src/ui-kit/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.tsx +2 -2
@@ -15,6 +15,8 @@ export declare type UpdateUserProfileBody = {
15
15
  consentAssignmentClaimsFlg?: boolean;
16
16
  consentCollectionFlg?: boolean;
17
17
  consentInformFlg?: boolean;
18
+ consentBkiFlg?: boolean;
19
+ smsConsentBki?: string;
18
20
  };
19
21
  };
20
22
  export declare const updateUserProfile: (body: UpdateUserProfileBody) => Promise<CreateUserProfileResponse>;
@@ -1991,17 +1991,6 @@
1991
1991
  },
1992
1992
  };
1993
1993
 
1994
- const CloseButton = JSX(({ className, onClose }) => (jsx("button", { className: style('flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none', className), onClick: onClose, title: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C", type: "button", children: jsx(Icon, { name: "CloseIcon", width: "20", height: "20", iconVersion: "gray" }) })));
1995
-
1996
- const Dialog = JSX(({ className, head, children, onClose, onClick }) => {
1997
- const { close } = useDialogManager();
1998
- const handleClose = useCallback(() => {
1999
- close();
2000
- onClose && onClose();
2001
- }, [onClose]);
2002
- return (jsxs("div", { onClick: onClick, className: style('relative min-h-full bg-white pt-0 p-lg', className), role: "dialog", children: [jsxs("div", { className: "sticky py-xl top-0 bg-white z-10", children: [jsx(CloseButton, { className: "absolute top-0 right-0", onClose: handleClose }), jsx("div", { className: "container", children: head })] }), jsx("div", { className: "container pb-6xl", children: children })] }));
2003
- });
2004
-
2005
1994
  async function doRequest(url, method, body) {
2006
1995
  const response = await fetch(`${API_BASE_URI}${url}`, {
2007
1996
  method,
@@ -2031,16 +2020,28 @@
2031
2020
  return URL.createObjectURL(response);
2032
2021
  };
2033
2022
 
2034
- const OPEN_DOC_BUTTON_TEXT = 'Ознакомиться';
2035
- const CheckboxWithDoc = JSX(({ className, error, docId, ...props }) => {
2036
- const { open } = useDialogManager();
2037
- return (jsxs("div", { className: className, children: [jsxs("div", { className: "flex flex-wrap gap-x-m", children: [jsx(Checkbox, { ...props }), docId ? (jsx(LinkButton, { className: "text-primary-main", onClick: () => handleOpenDocument(docId, open), children: jsx(Text, { children: OPEN_DOC_BUTTON_TEXT }) })) : null] }), renderErrorText(error)] }));
2023
+ const CloseButton = JSX(({ className, onClose }) => (jsx("button", { className: style('flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none', className), onClick: onClose, title: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C", type: "button", children: jsx(Icon, { name: "CloseIcon", width: "20", height: "20", iconVersion: "gray" }) })));
2024
+
2025
+ const Dialog = JSX(({ className, head, children, onClose, onClick }) => {
2026
+ const { close } = useDialogManager();
2027
+ const handleClose = useCallback(() => {
2028
+ close();
2029
+ onClose && onClose();
2030
+ }, [onClose]);
2031
+ return (jsxs("div", { onClick: onClick, className: style('relative min-h-full bg-white pt-0 p-lg', className), role: "dialog", children: [jsxs("div", { className: "sticky py-xl top-0 bg-white z-10", children: [jsx(CloseButton, { className: "absolute top-0 right-0", onClose: handleClose }), jsx("div", { className: "container", children: head })] }), jsx("div", { className: "container pb-6xl", children: children })] }));
2038
2032
  });
2039
- const handleOpenDocument = async (id, open) => {
2033
+
2034
+ const openDocument = async (id, open) => {
2040
2035
  const document = await getDocument(id);
2041
2036
  open(jsx(Dialog, { className: "my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0", children: jsx("iframe", { src: `${document}#toolbar=0`, className: "w-full h-[80vh]", id: "iframe-dialog" }) }));
2042
2037
  };
2043
2038
 
2039
+ const OPEN_DOC_BUTTON_TEXT = 'Ознакомиться';
2040
+ const CheckboxWithDoc = JSX(({ className, error, docId, ...props }) => {
2041
+ const { open } = useDialogManager();
2042
+ return (jsxs("div", { className: className, children: [jsxs("div", { className: "flex flex-wrap gap-x-m", children: [jsx(Checkbox, { ...props }), docId ? (jsx(LinkButton, { className: "text-primary-main", onClick: () => openDocument(docId, open), children: jsx(Text, { children: OPEN_DOC_BUTTON_TEXT }) })) : null] }), renderErrorText(error)] }));
2043
+ });
2044
+
2044
2045
  const ConsentField = JSX(({ field, input }) => input && input.name ? (jsx(CheckboxWithDoc, { text: CONSENTS[input.name]?.text, docId: CONSENTS[input.name]?.docId, ...getValidation(field(input.name), validatorObj[input.name], input?.required) })) : null);
2045
2046
 
2046
2047
  const LABEL_TEXT =
@@ -2777,7 +2778,7 @@
2777
2778
 
2778
2779
  const createUserProfile = (body) => doRequest('/public-data/createUserProfile', 'POST', body);
2779
2780
 
2780
- const updateUserProfile = (body) => doRequest('/user-data/updateUserProfile', 'POST', body);
2781
+ const updateUserProfile = (body) => doRequest('/user-data/updateUserProfile', 'PUT', body);
2781
2782
 
2782
2783
  const updateUserTask = (body) => doRequest('/user-data/updateUserTask', 'PUT', body);
2783
2784
 
@@ -3028,7 +3029,7 @@
3028
3029
  smsCodesSetName: { key: 'AUTHENTICATION' },
3029
3030
  });
3030
3031
  resetError();
3031
- close && close();
3032
+ close && close(values.join(''));
3032
3033
  }
3033
3034
  catch {
3034
3035
  setIsLoading(false);
@@ -3079,19 +3080,92 @@
3079
3080
  const renderTextButton = (textButton, isDisabled, handleSubmit) => textButton ? (jsx(SubmitButton, { isDisabled: isDisabled, onClick: handleSubmit, text: textButton })) : null;
3080
3081
  const renderText$1 = (timeNextReq, setTimeNextReq, sendCode) => timeNextReq ? (jsxs("div", { className: "flex flex-row text-l font-light text-primary-main", children: ["\u041F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u043D\u043E\u0432\u044B\u0439 \u043A\u043E\u0434 \u043C\u043E\u0436\u043D\u043E \u0447\u0435\u0440\u0435\u0437", jsx(Timer, { className: "text-primary-main ml-1", time: timeNextReq, setTime: setTimeNextReq })] })) : (jsx(LinkButton, { onClick: sendCode, className: "text-primary-main", children: "\u041F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u043D\u043E\u0432\u044B\u0439 \u043A\u043E\u0434" }));
3081
3082
 
3082
- const useVerifyPhoneDialog = (props) => {
3083
+ const useVerifyPhoneDialog = () => {
3083
3084
  const { open, close } = useDialogManager();
3084
3085
  return {
3085
- open: (options = {}) => open(jsx(VerifyPhoneDialog, { onClose: close, ...props }), options),
3086
+ open: (handleClose, props) => open(jsx(VerifyPhoneDialog, { onClose: close, close: handleClose, ...props })),
3086
3087
  close,
3087
3088
  };
3088
3089
  };
3089
3090
 
3091
+ const defaultConsentText = {
3092
+ title: 'Подпишите согласие на запрос в БКИ',
3093
+ description: 'Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту',
3094
+ };
3095
+ const refuseConsentText = {
3096
+ title: 'Вы уверены, что хотите отказаться от запроса в БКИ',
3097
+ description: 'Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения',
3098
+ };
3099
+ const ConsentBkiDialog = JSX(function ({ handleSubmit = noop, onClose = noop, }) {
3100
+ const [confirmStatus, setConfirmStatus] = useState('');
3101
+ const [showRefuceContent, setShowRefuceContent] = useState(false);
3102
+ const { open, close } = useDialogManager();
3103
+ const handleClose = useCallback(() => {
3104
+ close();
3105
+ handleSubmit(confirmStatus);
3106
+ }, [confirmStatus]);
3107
+ const handleConfirmChange = useCallback((value) => {
3108
+ setConfirmStatus(value);
3109
+ if (value === 'REFUSE') {
3110
+ setShowRefuceContent(true);
3111
+ }
3112
+ }, []);
3113
+ const consentText = showRefuceContent ? refuseConsentText : defaultConsentText;
3114
+ return (jsx(Dialog, { className: "my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg", onClose: onClose, children: jsxs("div", { className: "flex flex-col gap-lg items-center", children: [jsx("div", { role: "button", onClick: () => openDocument(CONSENT_BKI_ID, open), children: jsx(Heading, { className: "text-center text-balance", title: consentText.title }) }), jsx(Paragraph, { align: "text-center", children: consentText.description }), jsx(RadioButtonGroup, { className: "whitespace-normal", orientation: "horizontal", items: ITEMS$1, value: confirmStatus, onChange: handleConfirmChange }), jsx(Button, { disabled: !confirmStatus, type: "button", onClick: handleClose, children: "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C" })] }) }));
3115
+ });
3116
+ const ITEMS$1 = [
3117
+ { id: 'SIGNED', text: 'Подписать' },
3118
+ { id: 'REFUSE', text: 'Отказаться' },
3119
+ ];
3120
+ const CONSENT_BKI_ID = 2;
3121
+
3122
+ const useConsentBkiDialog = () => {
3123
+ const { open, closeAll } = useDialogManager();
3124
+ const verifyPhoneDialog = useVerifyPhoneDialog();
3125
+ const redirectToCreditForm = () => {
3126
+ globalThis.location.href = '/credit-lead';
3127
+ };
3128
+ const handleSuccessVerify = (profileId) => async (smsCode) => {
3129
+ if (profileId) {
3130
+ await updateUserProfile({
3131
+ profile: {
3132
+ id: profileId,
3133
+ consentBkiFlg: true,
3134
+ smsConsentBki: smsCode,
3135
+ },
3136
+ });
3137
+ }
3138
+ redirectToCreditForm();
3139
+ };
3140
+ const handleSubmitBkiConstent = (phone, profileId) => async (confirmStatus) => {
3141
+ await closeAll();
3142
+ if (confirmStatus === 'SIGNED' && phone) {
3143
+ verifyPhoneDialog.open(handleSuccessVerify(profileId), verifyPhoneContent$1(phone));
3144
+ }
3145
+ else {
3146
+ redirectToCreditForm();
3147
+ }
3148
+ };
3149
+ return {
3150
+ open: (phone, profileId) => open(jsx(ConsentBkiDialog, { handleSubmit: handleSubmitBkiConstent(phone, profileId), onClose: redirectToCreditForm })),
3151
+ };
3152
+ };
3153
+ const verifyPhoneContent$1 = (phone) => ({
3154
+ title: 'Подтвердите номер телефона',
3155
+ description: `Мы отправили код на ${phone}`,
3156
+ phoneNumber: formatPhone(phone),
3157
+ textButton: 'Отправить',
3158
+ __html: `<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>
3159
+ <ul><li>согласие на запрос информации в БКИ</li></ul>`,
3160
+ });
3161
+
3090
3162
  const useApplicationLeadApi = ({ inputs, programId, saveForm }) => {
3091
3163
  const [responseStatus, setResponseStatus] = useState('');
3092
3164
  const [, setTaskId] = useLocalStorage('taskId');
3093
3165
  const [, setProfileId] = useLocalStorage('profileId');
3094
3166
  const [, setParticipantId] = useLocalStorage('participantId');
3167
+ const consentBkiDialog = useConsentBkiDialog();
3168
+ const verifyPhoneDialog = useVerifyPhoneDialog();
3095
3169
  const saveUserData = useCallback((participantId, taskId, profileId) => {
3096
3170
  setParticipantId(participantId);
3097
3171
  setTaskId(taskId);
@@ -3125,21 +3199,19 @@
3125
3199
  }));
3126
3200
  saveUserData(participantId, taskId, profileId);
3127
3201
  saveForm(JSON.stringify(formData));
3128
- globalThis.location.href = '/credit-lead';
3129
3202
  }
3130
3203
  catch {
3131
3204
  setResponseStatus('Fail');
3132
3205
  }
3133
3206
  };
3207
+ const handleCloseVerify = async () => {
3208
+ await handleSuccessVerify();
3209
+ consentBkiDialog.open(formData.phone, profileId);
3210
+ };
3134
3211
  const acceptedConsents = Object.keys(CONSENTS)
3135
3212
  .filter((_) => formData[_])
3136
3213
  .map((_) => CONSENTS[_]?.text);
3137
- // eslint-disable-next-line react-hooks/rules-of-hooks
3138
- const verifyPhoneDialog = useVerifyPhoneDialog({
3139
- close: handleSuccessVerify,
3140
- ...verifyPhoneContent(formData?.phone, acceptedConsents),
3141
- });
3142
- verifyPhoneDialog.open();
3214
+ verifyPhoneDialog.open(handleCloseVerify, verifyPhoneContent(formData?.phone, acceptedConsents));
3143
3215
  }
3144
3216
  }
3145
3217
  catch {
@@ -7889,7 +7961,7 @@
7889
7961
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
7890
7962
  });
7891
7963
 
7892
- const packageVersion = "0.14.607";
7964
+ const packageVersion = "0.14.608";
7893
7965
 
7894
7966
  exports.Blocks = Blocks;
7895
7967
  exports.ContentPage = ContentPage;