@redneckz/wildless-cms-uni-blocks 0.14.138 → 0.14.140

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 (196) hide show
  1. package/bin/migration-scripts/0.14.138.js +69 -0
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +102 -91
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +2 -4
  6. package/bundle/components/ApplicationForm/formStyle.d.ts +1 -0
  7. package/bundle/components/ApplicationForm/validators.d.ts +1 -1
  8. package/bundle/ui-kit/BaseTile/BaseTile.d.ts +2 -2
  9. package/bundle/ui-kit/Checkbox/CheckboxWithError.d.ts +2 -0
  10. package/dist/components/ApplicationForm/ApplicationFormAntiFraud.js +7 -3
  11. package/dist/components/ApplicationForm/ApplicationFormAntiFraud.js.map +1 -1
  12. package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +2 -4
  13. package/dist/components/ApplicationForm/ApplicationFormDeposit.js +1 -1
  14. package/dist/components/ApplicationForm/ApplicationFormDeposit.js.map +1 -1
  15. package/dist/components/ApplicationForm/ApplicationFormFeedback.js +2 -2
  16. package/dist/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
  17. package/dist/components/ApplicationForm/formStyle.d.ts +1 -0
  18. package/dist/components/ApplicationForm/formStyle.js +2 -1
  19. package/dist/components/ApplicationForm/formStyle.js.map +1 -1
  20. package/dist/components/ApplicationForm/handleSubmit.js +35 -17
  21. package/dist/components/ApplicationForm/handleSubmit.js.map +1 -1
  22. package/dist/components/ApplicationForm/renderAgreementWithSubmit.js +1 -1
  23. package/dist/components/ApplicationForm/renderAgreementWithSubmit.js.map +1 -1
  24. package/dist/components/ApplicationForm/validators.d.ts +1 -1
  25. package/dist/components/ApplicationForm/validators.js +2 -2
  26. package/dist/components/ApplicationForm/validators.js.map +1 -1
  27. package/dist/components/Blocks.js +0 -2
  28. package/dist/components/Blocks.js.map +1 -1
  29. package/dist/components/Blocks.mobile.js +0 -2
  30. package/dist/components/Blocks.mobile.js.map +1 -1
  31. package/dist/ui-kit/BaseTile/BaseTile.d.ts +2 -2
  32. package/dist/ui-kit/BaseTile/BaseTile.js +5 -2
  33. package/dist/ui-kit/BaseTile/BaseTile.js.map +1 -1
  34. package/dist/ui-kit/Checkbox/CheckboxWithError.d.ts +2 -0
  35. package/dist/ui-kit/Checkbox/CheckboxWithError.js +9 -0
  36. package/dist/ui-kit/Checkbox/CheckboxWithError.js.map +1 -0
  37. package/dist/ui-kit/Unit/Unit.js +1 -1
  38. package/dist/ui-kit/Unit/Unit.js.map +1 -1
  39. package/lib/common.css +1 -1
  40. package/lib/components/ApplicationForm/ApplicationFormAntiFraud.js +9 -5
  41. package/lib/components/ApplicationForm/ApplicationFormAntiFraud.js.map +1 -1
  42. package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +2 -4
  43. package/lib/components/ApplicationForm/ApplicationFormDeposit.js +2 -2
  44. package/lib/components/ApplicationForm/ApplicationFormDeposit.js.map +1 -1
  45. package/lib/components/ApplicationForm/ApplicationFormFeedback.js +3 -3
  46. package/lib/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
  47. package/lib/components/ApplicationForm/formStyle.d.ts +1 -0
  48. package/lib/components/ApplicationForm/formStyle.js +1 -0
  49. package/lib/components/ApplicationForm/formStyle.js.map +1 -1
  50. package/lib/components/ApplicationForm/handleSubmit.js +36 -18
  51. package/lib/components/ApplicationForm/handleSubmit.js.map +1 -1
  52. package/lib/components/ApplicationForm/renderAgreementWithSubmit.js +2 -2
  53. package/lib/components/ApplicationForm/renderAgreementWithSubmit.js.map +1 -1
  54. package/lib/components/ApplicationForm/validators.d.ts +1 -1
  55. package/lib/components/ApplicationForm/validators.js +1 -1
  56. package/lib/components/ApplicationForm/validators.js.map +1 -1
  57. package/lib/components/Blocks.js +0 -2
  58. package/lib/components/Blocks.js.map +1 -1
  59. package/lib/components/Blocks.mobile.js +0 -2
  60. package/lib/components/Blocks.mobile.js.map +1 -1
  61. package/lib/ui-kit/BaseTile/BaseTile.d.ts +2 -2
  62. package/lib/ui-kit/BaseTile/BaseTile.js +5 -2
  63. package/lib/ui-kit/BaseTile/BaseTile.js.map +1 -1
  64. package/lib/ui-kit/Checkbox/CheckboxWithError.d.ts +2 -0
  65. package/lib/ui-kit/Checkbox/CheckboxWithError.js +7 -0
  66. package/lib/ui-kit/Checkbox/CheckboxWithError.js.map +1 -0
  67. package/lib/ui-kit/Unit/Unit.js +1 -1
  68. package/lib/ui-kit/Unit/Unit.js.map +1 -1
  69. package/mobile/bundle/bundle.umd.js +102 -91
  70. package/mobile/bundle/bundle.umd.min.js +1 -1
  71. package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +2 -4
  72. package/mobile/bundle/components/ApplicationForm/formStyle.d.ts +1 -0
  73. package/mobile/bundle/components/ApplicationForm/validators.d.ts +1 -1
  74. package/mobile/bundle/ui-kit/BaseTile/BaseTile.d.ts +2 -2
  75. package/mobile/bundle/ui-kit/Checkbox/CheckboxWithError.d.ts +2 -0
  76. package/mobile/dist/components/ApplicationForm/ApplicationFormAntiFraud.js +7 -3
  77. package/mobile/dist/components/ApplicationForm/ApplicationFormAntiFraud.js.map +1 -1
  78. package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +2 -4
  79. package/mobile/dist/components/ApplicationForm/ApplicationFormDeposit.js +1 -1
  80. package/mobile/dist/components/ApplicationForm/ApplicationFormDeposit.js.map +1 -1
  81. package/mobile/dist/components/ApplicationForm/ApplicationFormFeedback.js +2 -2
  82. package/mobile/dist/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
  83. package/mobile/dist/components/ApplicationForm/formStyle.d.ts +1 -0
  84. package/mobile/dist/components/ApplicationForm/formStyle.js +2 -1
  85. package/mobile/dist/components/ApplicationForm/formStyle.js.map +1 -1
  86. package/mobile/dist/components/ApplicationForm/handleSubmit.js +35 -17
  87. package/mobile/dist/components/ApplicationForm/handleSubmit.js.map +1 -1
  88. package/mobile/dist/components/ApplicationForm/renderAgreementWithSubmit.js +1 -1
  89. package/mobile/dist/components/ApplicationForm/renderAgreementWithSubmit.js.map +1 -1
  90. package/mobile/dist/components/ApplicationForm/validators.d.ts +1 -1
  91. package/mobile/dist/components/ApplicationForm/validators.js +2 -2
  92. package/mobile/dist/components/ApplicationForm/validators.js.map +1 -1
  93. package/mobile/dist/components/Blocks.js +0 -2
  94. package/mobile/dist/components/Blocks.js.map +1 -1
  95. package/mobile/dist/ui-kit/BaseTile/BaseTile.d.ts +2 -2
  96. package/mobile/dist/ui-kit/BaseTile/BaseTile.js +5 -2
  97. package/mobile/dist/ui-kit/BaseTile/BaseTile.js.map +1 -1
  98. package/mobile/dist/ui-kit/Checkbox/CheckboxWithError.d.ts +2 -0
  99. package/mobile/dist/ui-kit/Checkbox/CheckboxWithError.js +9 -0
  100. package/mobile/dist/ui-kit/Checkbox/CheckboxWithError.js.map +1 -0
  101. package/mobile/dist/ui-kit/Unit/Unit.js +1 -1
  102. package/mobile/dist/ui-kit/Unit/Unit.js.map +1 -1
  103. package/mobile/lib/common.css +1 -1
  104. package/mobile/lib/components/ApplicationForm/ApplicationFormAntiFraud.js +9 -5
  105. package/mobile/lib/components/ApplicationForm/ApplicationFormAntiFraud.js.map +1 -1
  106. package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +2 -4
  107. package/mobile/lib/components/ApplicationForm/ApplicationFormDeposit.js +2 -2
  108. package/mobile/lib/components/ApplicationForm/ApplicationFormDeposit.js.map +1 -1
  109. package/mobile/lib/components/ApplicationForm/ApplicationFormFeedback.js +3 -3
  110. package/mobile/lib/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
  111. package/mobile/lib/components/ApplicationForm/formStyle.d.ts +1 -0
  112. package/mobile/lib/components/ApplicationForm/formStyle.js +1 -0
  113. package/mobile/lib/components/ApplicationForm/formStyle.js.map +1 -1
  114. package/mobile/lib/components/ApplicationForm/handleSubmit.js +36 -18
  115. package/mobile/lib/components/ApplicationForm/handleSubmit.js.map +1 -1
  116. package/mobile/lib/components/ApplicationForm/renderAgreementWithSubmit.js +2 -2
  117. package/mobile/lib/components/ApplicationForm/renderAgreementWithSubmit.js.map +1 -1
  118. package/mobile/lib/components/ApplicationForm/validators.d.ts +1 -1
  119. package/mobile/lib/components/ApplicationForm/validators.js +1 -1
  120. package/mobile/lib/components/ApplicationForm/validators.js.map +1 -1
  121. package/mobile/lib/components/Blocks.js +0 -2
  122. package/mobile/lib/components/Blocks.js.map +1 -1
  123. package/mobile/lib/ui-kit/BaseTile/BaseTile.d.ts +2 -2
  124. package/mobile/lib/ui-kit/BaseTile/BaseTile.js +5 -2
  125. package/mobile/lib/ui-kit/BaseTile/BaseTile.js.map +1 -1
  126. package/mobile/lib/ui-kit/Checkbox/CheckboxWithError.d.ts +2 -0
  127. package/mobile/lib/ui-kit/Checkbox/CheckboxWithError.js +7 -0
  128. package/mobile/lib/ui-kit/Checkbox/CheckboxWithError.js.map +1 -0
  129. package/mobile/lib/ui-kit/Unit/Unit.js +1 -1
  130. package/mobile/lib/ui-kit/Unit/Unit.js.map +1 -1
  131. package/mobile/src/components/ApplicationForm/ApplicationFormAntiFraud.tsx +18 -10
  132. package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +14 -14
  133. package/mobile/src/components/ApplicationForm/ApplicationFormDeposit.tsx +2 -2
  134. package/mobile/src/components/ApplicationForm/ApplicationFormFeedback.tsx +3 -3
  135. package/mobile/src/components/ApplicationForm/formStyle.ts +2 -0
  136. package/mobile/src/components/ApplicationForm/handleSubmit.tsx +36 -18
  137. package/mobile/src/components/ApplicationForm/renderAgreementWithSubmit.tsx +2 -2
  138. package/mobile/src/components/ApplicationForm/validators.ts +1 -3
  139. package/mobile/src/components/Blocks.ts +0 -2
  140. package/mobile/src/ui-kit/BaseTile/BaseTile.tsx +14 -2
  141. package/mobile/src/ui-kit/Checkbox/CheckboxWithError.tsx +14 -0
  142. package/mobile/src/ui-kit/Unit/Unit.tsx +1 -1
  143. package/package.json +1 -1
  144. package/src/components/ApplicationForm/ApplicationFormAntiFraud.tsx +18 -10
  145. package/src/components/ApplicationForm/ApplicationFormContent.ts +14 -14
  146. package/src/components/ApplicationForm/ApplicationFormDeposit.tsx +2 -2
  147. package/src/components/ApplicationForm/ApplicationFormFeedback.tsx +3 -3
  148. package/src/components/ApplicationForm/formStyle.ts +2 -0
  149. package/src/components/ApplicationForm/handleSubmit.tsx +36 -18
  150. package/src/components/ApplicationForm/renderAgreementWithSubmit.tsx +2 -2
  151. package/src/components/ApplicationForm/validators.ts +1 -3
  152. package/src/components/Blocks.mobile.ts +0 -2
  153. package/src/components/Blocks.ts +0 -2
  154. package/src/ui-kit/BaseTile/BaseTile.tsx +14 -2
  155. package/src/ui-kit/Checkbox/CheckboxWithError.tsx +14 -0
  156. package/src/ui-kit/Unit/Unit.tsx +1 -1
  157. package/bundle/components/Bonus/Bonus.d.ts +0 -5
  158. package/bundle/components/Bonus/BonusContent.d.ts +0 -47
  159. package/dist/components/Bonus/Bonus.d.ts +0 -5
  160. package/dist/components/Bonus/Bonus.js +0 -23
  161. package/dist/components/Bonus/Bonus.js.map +0 -1
  162. package/dist/components/Bonus/BonusContent.d.ts +0 -47
  163. package/dist/components/Bonus/BonusContent.js +0 -2
  164. package/dist/components/Bonus/BonusContent.js.map +0 -1
  165. package/lib/components/Bonus/Bonus.d.ts +0 -5
  166. package/lib/components/Bonus/Bonus.fixture.d.ts +0 -8
  167. package/lib/components/Bonus/Bonus.fixture.mobile.d.ts +0 -8
  168. package/lib/components/Bonus/Bonus.js +0 -21
  169. package/lib/components/Bonus/Bonus.js.map +0 -1
  170. package/lib/components/Bonus/BonusContent.d.ts +0 -47
  171. package/lib/components/Bonus/BonusContent.js +0 -2
  172. package/lib/components/Bonus/BonusContent.js.map +0 -1
  173. package/mobile/bundle/components/Bonus/Bonus.d.ts +0 -5
  174. package/mobile/bundle/components/Bonus/BonusContent.d.ts +0 -47
  175. package/mobile/dist/components/Bonus/Bonus.d.ts +0 -5
  176. package/mobile/dist/components/Bonus/Bonus.js +0 -23
  177. package/mobile/dist/components/Bonus/Bonus.js.map +0 -1
  178. package/mobile/dist/components/Bonus/BonusContent.d.ts +0 -47
  179. package/mobile/dist/components/Bonus/BonusContent.js +0 -2
  180. package/mobile/dist/components/Bonus/BonusContent.js.map +0 -1
  181. package/mobile/lib/components/Bonus/Bonus.d.ts +0 -5
  182. package/mobile/lib/components/Bonus/Bonus.js +0 -21
  183. package/mobile/lib/components/Bonus/Bonus.js.map +0 -1
  184. package/mobile/lib/components/Bonus/BonusContent.d.ts +0 -47
  185. package/mobile/lib/components/Bonus/BonusContent.js +0 -2
  186. package/mobile/lib/components/Bonus/BonusContent.js.map +0 -1
  187. package/mobile/src/components/Bonus/Bonus.example.json +0 -13
  188. package/mobile/src/components/Bonus/Bonus.tsx +0 -80
  189. package/mobile/src/components/Bonus/Bonus.ui.json +0 -29
  190. package/mobile/src/components/Bonus/BonusContent.ts +0 -55
  191. package/src/components/Bonus/Bonus.example.json +0 -13
  192. package/src/components/Bonus/Bonus.fixture.mobile.tsx +0 -72
  193. package/src/components/Bonus/Bonus.fixture.tsx +0 -72
  194. package/src/components/Bonus/Bonus.tsx +0 -80
  195. package/src/components/Bonus/Bonus.ui.json +0 -29
  196. package/src/components/Bonus/BonusContent.ts +0 -55
@@ -365,6 +365,54 @@
365
365
  return (jsxs(BlockWrapper, { className: style(isEmbedded ? '@container-normal' : '', className), defaultPadding: isEmbedded ? '' : 'p-6xl', version: version, isTheme: isTheme, ...rest, children: [title ? (jsx(Heading, { className: style('whitespace-pre-wrap', align), ...versionStyle?.title, as: as || versionStyle?.title.as, title: title })) : null, description ? (jsx(Paragraph, { size: versionStyle.descriptionSize, font: versionStyle.descriptionWeight, align: align, ...descriptionStyle, children: description })) : null] }));
366
366
  });
367
367
 
368
+ const DEFAULT_SLOT_NAME = null;
369
+
370
+ const defaultBlockDecorator = ({ blockClassName, block, render }) => render({ blockClassName, block });
371
+
372
+ const DEFAULT_ANCESTORS = [];
373
+ const defaultStyle = 'col-span-12';
374
+ function renderBlock$1(block, options, { className, ...extraProps } = {}) {
375
+ const { key, blockDecorator = defaultBlockDecorator, blocksRegistry = {}, ancestors = DEFAULT_ANCESTORS, } = options;
376
+ const { type } = block;
377
+ if (!(type && type in blocksRegistry)) {
378
+ console.warn(`No block with "${type}" is registered`);
379
+ }
380
+ const BlockComponent = type && blocksRegistry[type];
381
+ return blockDecorator({
382
+ blockClassName: style(block.style?.length ? block.style : defaultStyle, className),
383
+ block,
384
+ ancestors,
385
+ // Adjusted by decorator block and blockClassName
386
+ render: ({ block: adjustedBlock, blockClassName: adjustedBlockClassName }) => {
387
+ const { content } = adjustedBlock;
388
+ return BlockComponent ? (jsx(BlockComponent, { className: adjustedBlockClassName, block: block, options: options, ...content, ...extraProps }, key)) : null;
389
+ },
390
+ }, key);
391
+ }
392
+
393
+ const EMPTY_ANCESTORS = [];
394
+ const renderBlocksList = (blocks, { key, ancestors = EMPTY_ANCESTORS, slotName = DEFAULT_SLOT_NAME, extraProps, renderProps = renderBlock$1, ...options }) => {
395
+ const renderChildBlock = extraProps
396
+ ? (childBlock, childOptions) => renderBlock$1(childBlock, childOptions, extraProps)
397
+ : renderProps;
398
+ return (blocks || []).map((_, i) => renderChildBlock(_, {
399
+ ...options,
400
+ key: `${key ? key : _.type}-${i}`,
401
+ ancestors: options.parent
402
+ ? [...(ancestors || EMPTY_ANCESTORS), [options.parent, slotName]]
403
+ : ancestors,
404
+ }, i));
405
+ };
406
+
407
+ function renderChildren({ block, options, children, extraProps, renderProps, }) {
408
+ if (children) {
409
+ return children;
410
+ }
411
+ return block && options
412
+ ? renderBlocksList(block.blocks, { ...options, parent: block, extraProps, renderProps })
413
+ : null;
414
+ }
415
+
368
416
  function useRouter() {
369
417
  return useRouter._impl();
370
418
  }
@@ -631,22 +679,24 @@
631
679
  center: '@xl:self-center',
632
680
  end: '@xl:self-end',
633
681
  };
634
- const BaseTile = JSX(({ className, version = 'primary', defaultPadding, padding = '', title = '', insetTitle = '', buttons, leftImage, rightImage, imageAlign, isImageAlwaysOnRight = false, isImageSecondary = false, backwardButton, children, }) => {
682
+ const BaseTile = JSX(({ className, version = 'primary', defaultPadding, padding = '', title = '', insetTitle = '', buttons, leftImage, rightImage, imageAlign, isImageAlwaysOnRight = false, isImageSecondary = false, backwardButton, children, ...rest }) => {
635
683
  const router = useRouter();
636
684
  const handleClick = useCallback((ev) => {
637
685
  ev?.preventDefault();
638
686
  router.back();
639
687
  }, []);
640
688
  return (jsxs("div", { className: getStyle(padding, defaultPadding, className), children: [backwardButton ? renderBackwardButton(version, handleClick) : null, title ? jsx("div", { className: "relative h-full", children: title }) : null, jsxs("div", { className: style('grow relative flex flex-col @xl:flex-row gap-3xl w-full', leftImage ? 'self-start @xl:w-auto' : ''), children: [renderImageContainer(leftImage, { imageAlign, className: 'mx-auto' }), jsxs("div", { className: style('grid gap-3xl', rightImage ? '@xl:grid-cols-2' : '', leftImage ? '' : 'grow', 'h-full', //? fix issue https://github.com/redneckz/temp_wcms/issues/1254
641
- 'auto-rows-[max-content_1fr]'), children: [jsxs("div", { className: "grow space-y-lg min-w-fit", children: [insetTitle, children] }), renderImageContainer(rightImage, {
689
+ 'auto-rows-[max-content_1fr]'), children: [jsxs("div", { className: "grow space-y-lg min-w-fit", children: [insetTitle, children] }), renderUnitBlock(renderChildren({ ...rest, extraProps: { className: '@container-normal' } })), renderImageContainer(rightImage, {
642
690
  className: style('@xl:justify-self-end @xl:col-start-2', buttons ? rowSpanStyle(isImageAlwaysOnRight) : '', positionStyle(isImageAlwaysOnRight), imageSecondaryStyle(isImageSecondary)),
643
691
  imageAlign,
644
692
  }), renderButtons(buttons)] })] })] }));
645
693
  });
694
+ BaseTile.childrenTypes = ['UnitBlock'];
646
695
  const getStyle = (padding = '', defaultPadding = '', className = '') => style('relative flex flex-col gap-3xl overflow-hidden', padding || defaultPadding, className);
647
696
  const rowSpanStyle = (isImageAlwaysOnRight) => isImageAlwaysOnRight ? 'row-span-2' : '@xl:row-span-2';
648
697
  const positionStyle = (isImageAlwaysOnRight) => isImageAlwaysOnRight ? 'col-start-2 self-center' : '';
649
698
  const renderButtons = (buttons) => buttons ? jsx("div", { className: "self-end", children: buttons }) : null;
699
+ const renderUnitBlock = (unitBlock) => unitBlock && unitBlock?.length ? (jsx("div", { className: "flex items-start justify-end", children: unitBlock })) : null;
650
700
  const renderImageContainer = (image, { className, imageAlign }) => image ? (jsx("div", { className: style('shrink-1/2 justify-self-center', imageAlign && imageAlignmentMap[imageAlign], className), children: image })) : null;
651
701
  const imageSecondaryStyle = (isImageSecondary) => isImageSecondary ? 'hidden @xl:block' : '';
652
702
 
@@ -967,6 +1017,7 @@
967
1017
  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] })));
968
1018
 
969
1019
  const formStyle$1 = 'container space-y-lg';
1020
+ const oneColumnFormStyle = 'w-full max-w-xl space-y-s m-auto';
970
1021
 
971
1022
  const withValidator = (props, validator) => {
972
1023
  const { value, isDirty } = props;
@@ -1035,7 +1086,7 @@
1035
1086
  const nameValidator = validator((_) => typeof _ === 'string' && _.length > 1)(ERROR_MESSAGE);
1036
1087
  const innValidator = validator((_) => typeof _ === 'string' && (_.length === 10 || _.length === 12))(ERROR_MESSAGE);
1037
1088
  const phoneValidator = pattern(/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/)(ERROR_MESSAGE);
1038
- const consentDataProcessingValidator = validator((_) => typeof _ === 'boolean' && _)(ERROR_MESSAGE);
1089
+ const checkboxValidator = validator((_) => typeof _ === 'boolean' && _)(ERROR_MESSAGE);
1039
1090
 
1040
1091
  const renderAcquiringDataOrganization = (field, title) => (jsx(ApplicationFieldsetLayout, { title: title, firstChildren: jsxs("div", { className: formChildrenStyle, children: [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", ...withValidator(field('fullName'), defaultValidator) }), jsx(InputControl, { label: "\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0435 \u043B\u0438\u0446\u043E", ...withValidator(field('name'), nameValidator) })] }), secondChildren: jsxs("div", { className: formChildrenStyle, children: [jsx(InputControl, { label: "\u0418\u041D\u041D", ...withValidator(field('inn'), innValidator) }), jsx(PhoneInputControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) })] }) }));
1041
1092
 
@@ -1264,7 +1315,9 @@
1264
1315
  });
1265
1316
  const checkboxStyle = (value) => style('rounded border', value ? 'bg-primary-main' : '');
1266
1317
 
1267
- const renderAgreementWithSubmit = (consentDataProcessing, link, button) => (jsxs("div", { className: "flex flex-col lg:flex-row w-full justify-between items-baseline", children: [jsxs("div", { children: [jsxs("div", { className: "flex gap-3", children: [jsx(Checkbox, { ...consentDataProcessing }), jsx(Footnote, { text: "\u0421\u043E\u0433\u043B\u0430\u0441\u0435\u043D \u0441 ", link: link })] }), renderErrorText(withValidator(consentDataProcessing, consentDataProcessingValidator).error)] }), renderSubmitButton(button)] }));
1318
+ 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)] })));
1319
+
1320
+ const renderAgreementWithSubmit = (consentDataProcessing, link, button) => (jsxs("div", { className: "flex flex-col lg:flex-row w-full justify-between items-baseline", children: [jsxs("div", { children: [jsxs("div", { className: "flex gap-3", children: [jsx(Checkbox, { ...consentDataProcessing }), jsx(Footnote, { text: "\u0421\u043E\u0433\u043B\u0430\u0441\u0435\u043D \u0441 ", link: link })] }), renderErrorText(withValidator(consentDataProcessing, checkboxValidator).error)] }), renderSubmitButton(button)] }));
1268
1321
 
1269
1322
  const formatDate = (date, toTimeStamp = false) => {
1270
1323
  if (typeof date === 'string') {
@@ -1440,7 +1493,9 @@
1440
1493
  name: nameValidator,
1441
1494
  birthday: defaultValidator,
1442
1495
  phone: phoneValidator,
1443
- consentDataProcessing: consentDataProcessingValidator,
1496
+ isClient: checkboxValidator,
1497
+ comment: defaultValidator,
1498
+ consentDataProcessing: checkboxValidator,
1444
1499
  });
1445
1500
  const ApplicationFormAntiFraud = JSX(({ button, link, onSubmit }) => {
1446
1501
  const handleSubmit = useCallback((formState) => {
@@ -1450,10 +1505,10 @@
1450
1505
  typeForm: typeForm.key,
1451
1506
  phone: phone.replace(/[^+\d]/g, ''),
1452
1507
  };
1453
- isValidationSuccess(feedbackValidator(formState)) && onSubmit(submitData);
1508
+ isValidationSuccess(feedbackValidator(formState)) && onSubmit(submitData, true);
1454
1509
  }, [onSubmit]);
1455
1510
  const [, { field, ...formProps }] = useForm(initialFormState$6, handleSubmit);
1456
- return (jsx("form", { className: formStyle$1, onSubmit: formProps.onSubmit, children: jsx(ApplicationFieldsetLayout, { firstChildren: jsxs("div", { className: "w-full max-w-xl space-y-s m-auto", children: [renderUserData(field), jsx(PhoneInputControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D*", ...withValidator(field('phone'), phoneValidator) }), renderAgreementWithSubmit(field('consentDataProcessing'), link, button)] }) }) }));
1511
+ return (jsx("form", { className: formStyle$1, onSubmit: formProps.onSubmit, children: jsx(ApplicationFieldsetLayout, { firstChildren: jsxs("div", { className: oneColumnFormStyle, children: [renderUserData(field), jsx(PhoneInputControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D*", ...withValidator(field('phone'), phoneValidator) }), jsx(CheckboxWithError, { ...withValidator(field('isClient'), checkboxValidator), 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"' }), jsx(InputControl, { ...withValidator(field('comment'), defaultValidator), placeholder: "\u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439*", isTextarea: true }), renderAgreementWithSubmit(field('consentDataProcessing'), link, button)] }) }) }));
1457
1512
  });
1458
1513
 
1459
1514
  const renderBusinessCardDataOrganization = (field) => (jsx(ApplicationFieldsetLayout, { firstChildren: jsxs("div", { className: formChildrenStyle, children: [jsx(InputControl, { label: "\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0435 \u043B\u0438\u0446\u043E", ...withValidator(field('name'), nameValidator) }), jsx(InputControl, { label: "\u0418\u041D\u041D", ...withValidator(field('inn'), innValidator) })] }), secondChildren: jsxs("div", { className: formChildrenStyle, children: [jsx(PhoneInputControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) }), jsx(InputControl, { label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...withValidator(field('mail'), defaultValidator) })] }) }));
@@ -1637,7 +1692,7 @@
1637
1692
  });
1638
1693
  }, [onSubmit]);
1639
1694
  const [, { field, ...formProps }] = useForm(initialFormState$3, handleSubmit);
1640
- return (jsx("form", { className: formStyle$1, onSubmit: formProps.onSubmit, children: jsx(ApplicationFieldsetLayout, { title: "\u041E\u0441\u0442\u0430\u0432\u044C\u0442\u0435 \u0437\u0430\u044F\u0432\u043A\u0443 \u0438 \u043C\u044B \u043E\u0442\u0432\u0435\u0442\u0438\u043C \u043D\u0430 \u043B\u044E\u0431\u044B\u0435 \u0432\u043E\u043F\u0440\u043E\u0441\u044B \u043F\u043E \u0434\u0435\u043F\u043E\u0437\u0438\u0442\u0430\u043C", firstChildren: jsxs("div", { className: "w-full max-w-xl space-y-s m-auto", children: [jsx(InputControl, { label: "\u0418\u043C\u044F", ...withValidator(field('name'), nameValidator) }), jsx(PhoneInputControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) }), renderSubmitButton(button), jsx(Footnote, { link: link })] }) }) }));
1695
+ return (jsx("form", { className: formStyle$1, onSubmit: formProps.onSubmit, children: jsx(ApplicationFieldsetLayout, { title: "\u041E\u0441\u0442\u0430\u0432\u044C\u0442\u0435 \u0437\u0430\u044F\u0432\u043A\u0443 \u0438 \u043C\u044B \u043E\u0442\u0432\u0435\u0442\u0438\u043C \u043D\u0430 \u043B\u044E\u0431\u044B\u0435 \u0432\u043E\u043F\u0440\u043E\u0441\u044B \u043F\u043E \u0434\u0435\u043F\u043E\u0437\u0438\u0442\u0430\u043C", firstChildren: jsxs("div", { className: oneColumnFormStyle, children: [jsx(InputControl, { label: "\u0418\u043C\u044F", ...withValidator(field('name'), nameValidator) }), jsx(PhoneInputControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) }), renderSubmitButton(button), jsx(Footnote, { link: link })] }) }) }));
1641
1696
  });
1642
1697
 
1643
1698
  const FEEDBACK_TYPES = [
@@ -1668,24 +1723,30 @@
1668
1723
  phone: phoneValidator,
1669
1724
  email: defaultValidator,
1670
1725
  comment: defaultValidator,
1671
- consentDataProcessing: consentDataProcessingValidator,
1726
+ consentDataProcessing: checkboxValidator,
1672
1727
  };
1673
1728
  const handleSubmitIndividual = (formState, onSubmit) => {
1674
1729
  const feedbackValidator = objectValidator({
1675
1730
  ...feedbackValidatorDefaultObject,
1676
1731
  addressBranch: defaultValidator,
1677
1732
  });
1678
- const { region, phone, secondaryPhone } = formState;
1679
1733
  const submitData = {
1680
- ...formState,
1681
1734
  typeForm: formState.typeForm.key,
1735
+ regionBranch: formState?.region?.text,
1682
1736
  addressBranch: formState.addressBranch?.text || '',
1737
+ surname: formState.surname,
1738
+ name: formState.name,
1739
+ middleName: formState.middleName,
1683
1740
  feedbackMethod: formState.feedbackMethod.text,
1684
- regionBranch: region?.text,
1685
- phoneNumber: phone.replace(/[^+\d]/g, ''),
1686
- secondaryPhoneNumber: secondaryPhone,
1741
+ phoneNumber: formState.phone.replace(/[^+\d]/g, ''),
1742
+ secondaryPhoneNumber: formState.secondaryPhone?.replace(/[^+\d]/g, ''),
1743
+ email: formState.email,
1744
+ bankEmpolee: formState.bankEmpolee,
1745
+ applicationDate: formState.applicationDate,
1746
+ comment: formState.comment,
1747
+ consentDataProcessing: formState.consentDataProcessing,
1687
1748
  };
1688
- isValidationSuccess(feedbackValidator(formState)) && onSubmit(submitData);
1749
+ isValidationSuccess(feedbackValidator(formState)) && onSubmit(submitData, true);
1689
1750
  };
1690
1751
  const handleSubmitLegal = (formState, onSubmit) => {
1691
1752
  const feedbackValidator = objectValidator({
@@ -1693,33 +1754,45 @@
1693
1754
  addressBranch: defaultValidator,
1694
1755
  inn: innValidator,
1695
1756
  });
1696
- const { secondaryPhone, email } = formState;
1697
1757
  const submitData = {
1698
- ...formState,
1699
1758
  typeForm: formState.typeForm.key,
1700
1759
  region: formState.region?.text,
1701
1760
  addressBranch: formState.addressBranch?.text || '',
1761
+ surname: formState.surname,
1762
+ name: formState.name,
1763
+ middleName: formState.middleName,
1764
+ inn: formState.inn,
1765
+ fullName: formState.fullName,
1702
1766
  feedbackMethod: formState.feedbackMethod.text,
1703
1767
  phone: formState.phone.replace(/[^+\d]/g, ''),
1704
- secondaryPhoneNumber: secondaryPhone,
1705
- mail: email,
1768
+ secondaryPhoneNumber: formState?.secondaryPhone,
1769
+ mail: formState.email,
1770
+ bankEmpolee: formState.bankEmpolee,
1771
+ applicationDate: formState.applicationDate,
1772
+ comment: formState.comment,
1773
+ consentDataProcessing: formState.consentDataProcessing,
1706
1774
  };
1707
- isValidationSuccess(feedbackValidator(formState)) && onSubmit(submitData, true);
1775
+ isValidationSuccess(feedbackValidator(formState)) && onSubmit(submitData, false);
1708
1776
  };
1709
1777
  const handleSubmitQuestion = (formState, onSubmit) => {
1710
1778
  const feedbackValidator = objectValidator({
1711
1779
  ...feedbackValidatorDefaultObject,
1712
1780
  birthday: defaultValidator,
1713
1781
  });
1714
- const { region, phone } = formState;
1715
1782
  const submitData = {
1716
- ...formState,
1717
1783
  typeForm: formState.typeForm.key,
1784
+ regionBranch: formState.region?.text,
1785
+ surname: formState.surname,
1786
+ name: formState.name,
1787
+ middleName: formState.middleName,
1788
+ birthday: formState.birthday,
1718
1789
  feedbackMethod: formState.feedbackMethod.text,
1719
- regionBranch: region?.text,
1720
- phoneNumber: phone.replace(/[^+\d]/g, ''),
1790
+ phoneNumber: formState.phone.replace(/[^+\d]/g, ''),
1791
+ email: formState.email,
1792
+ comment: formState.comment,
1793
+ consentDataProcessing: formState.consentDataProcessing,
1721
1794
  };
1722
- isValidationSuccess(feedbackValidator(formState)) && onSubmit(submitData);
1795
+ isValidationSuccess(feedbackValidator(formState)) && onSubmit(submitData, true);
1723
1796
  };
1724
1797
 
1725
1798
  const initialFormState$2 = {
@@ -1753,10 +1826,10 @@
1753
1826
  const regions = useBranches(formState?.region?.key).filter((region) => region?.address);
1754
1827
  const isQualityService = field('typeForm').value?.key === 'FEEDBACK_QS';
1755
1828
  const isLegalEntity = getLegalEntity(field('typeForm').value?.key, field('serviceDirection').value?.key);
1756
- return (jsx("form", { className: formStyle$1, onSubmit: formProps.onSubmit, children: jsx(ApplicationFieldsetLayout, { firstChildren: 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(SelectControl, { label: "\u0424\u0438\u043B\u0438\u0430\u043B \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u043D\u0438\u044F*", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0438\u043B\u0438\u0430\u043B", isSearch: true, options: branch.map(({ code = '', name = '' }) => ({ key: code, text: name })), ...withValidator(field('region'), defaultValidator) }), isQualityService ? (jsx(SelectControl, { label: "\u0410\u0434\u0440\u0435\u0441*", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441", options: regions.map(({ branchCode = '', address = '' }) => ({
1829
+ return (jsx("form", { className: formStyle$1, onSubmit: formProps.onSubmit, children: jsx(ApplicationFieldsetLayout, { firstChildren: jsxs("div", { className: oneColumnFormStyle, 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(SelectControl, { label: "\u0424\u0438\u043B\u0438\u0430\u043B \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u043D\u0438\u044F*", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0438\u043B\u0438\u0430\u043B", isSearch: true, options: branch.map(({ code = '', name = '' }) => ({ key: code, text: name })), ...withValidator(field('region'), defaultValidator) }), isQualityService ? (jsx(SelectControl, { label: "\u0410\u0434\u0440\u0435\u0441*", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441", options: regions.map(({ branchCode = '', address = '' }) => ({
1757
1830
  key: branchCode,
1758
1831
  text: address,
1759
- })), ...withValidator(field('addressBranch'), defaultValidator) })) : null, renderUserData(field), 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(PhoneInputControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D*", ...withValidator(field('phone'), phoneValidator) }), isQualityService ? (jsxs("div", { children: [jsx(InputControl, { label: "\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0439 \u0442\u0435\u043B\u0435\u0444\u043E\u043D", ...field('secondaryPhone') }), 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 }), renderAgreementWithSubmit(field('consentDataProcessing'), link, button)] }) }) }));
1832
+ })), ...withValidator(field('addressBranch'), defaultValidator) })) : null, renderUserData(field), 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(PhoneInputControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D*", ...withValidator(field('phone'), phoneValidator) }), isQualityService ? (jsxs("div", { children: [jsx(PhoneInputControl, { label: "\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0439 \u0442\u0435\u043B\u0435\u0444\u043E\u043D", ...field('secondaryPhone') }), 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 }), renderAgreementWithSubmit(field('consentDataProcessing'), link, button)] }) }) }));
1760
1833
  });
1761
1834
  const getLegalEntity = (typeFormKey = '', serviceDirectionKey = '') => typeFormKey === 'FEEDBACK_QS' && serviceDirectionKey === 'Юридическое лицо / ИП';
1762
1835
 
@@ -1943,19 +2016,6 @@
1943
2016
  const BenefitsBlock = JSX(({ className = '', title, benefitList, ...rest }) => (jsxs(BlockWrapper, { className: className, defaultPadding: "p-6xl", ...rest, children: [title ? jsx(Heading, { headingType: "h3", as: "h2", className: AlignStyles, title: title }) : null, benefitList?.length ? (jsx("div", { className: "flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl", role: "list", children: benefitList.map(renderBenefit) })) : null] })));
1944
2017
  const renderBenefit = ({ label, description, items, icon, iconBgVersion, isDotted = false }, i) => (jsxs("div", { className: "flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]", role: "listitem", children: [icon?.icon ? (jsx(RoundedIcon, { className: "shrink-0", defaultIconSize: defaultIconSize, iconBgVersion: iconBgVersion || '', ...icon })) : null, icon?.src ? jsx(Img, { className: "shrink-0", image: icon }) : null, label ? (jsxs("div", { className: "@sm:h-full space-y-xs", children: [jsx(Heading, { headingType: "h6", children: label }), jsx(Text, { size: "text-l", color: "text-secondary-text group-data-secondary:text-white/80", font: "font-light", children: description }), jsx(List, { dotClassName: "bg-secondary-text", listItemSize: "S", items: items, isDotted: isDotted })] })) : null] }, String(i)));
1945
2018
 
1946
- const Bonus = JSX(({ className = '', title, description, bonusItems = [], align = AlignStyles, ...rest }) => (jsx(BlockWrapper, { className: className, defaultPadding: "p-6xl", ...rest, children: jsxs("div", { className: "container", children: [jsx(Headline, { className: "mb-xl", isEmbedded: true, title: title, description: description, headlineVersion: "M", align: align }), jsx("div", { className: "flex flex-wrap gap-3xl gap-x-m w-full", children: bonusItems.length > 0
1947
- ? bonusItems.map((_, i) => (jsxs("div", { className: "w-full @xl:w-[48%] sm:space-y-xs flex flex-col grow p-xl sm:p-m border border-gray", children: [jsx("div", { className: "grow", children: jsx(Headline, { title: _?.title, description: _?.description, headlineVersion: "S", isEmbedded: true, align: "text-left" }) }), jsxs("div", { className: "flex justify-center sm:justify-between sm:items-end", children: [jsx("div", { className: "hidden sm:block", children: renderButtonsSection(_?.buttons) }), _.bonusItemContent?.bonusType
1948
- ? renderBonusItemContent(_.bonusItemContent)
1949
- : null] })] }, String(i))))
1950
- : null })] }) })));
1951
- const renderBonusItemContent = (bonusItemContent) => bonusItemContent.bonusType === 'count'
1952
- ? renderBonusCount(bonusItemContent)
1953
- : renderBonusImage(bonusItemContent);
1954
- const renderBonusCount = (_) => (jsxs("div", { className: "w-full pt-default @xl:mt-s @xl:mb-4 flex justify-center sm:justify-end items-end", children: [_.bonusCount ? (
1955
- // -mb-10 добавлен для выравнивания bonusCount относительно bonusName, тк шрифт font-mohave неправильно высчитывает line-height
1956
- jsx("div", { className: "shrink-0 -mb-6 @xl:-mb-4", children: jsx("span", { className: "font-mohave text-title-large sm:text-title-extra gradient-color-text", children: _.bonusCount }) })) : null, _.bonusName ? (jsx("div", { className: "shrink-0 gradient-color-text", children: jsx(Text, { size: "text-h2", children: _.bonusName }) })) : null] }));
1957
- const renderBonusImage = (_) => _.image ? jsx(Img, { className: "min-w-12 p-xs rounded-icon shrink-0", image: _.image }) : null;
1958
-
1959
2019
  const bonusBenefitStyles = 'items-center';
1960
2020
 
1961
2021
  const renderBonusBenefit = (cardTextAlign) => ({ icon, title, description }, i) => (jsxs("div", { className: style('flex flex-col gap-1', bonusBenefitStyles, !description && !title ? 'justify-center' : ''), children: [title ? (jsx(Text, { size: "text-h6", font: "font-normal", align: cardTextAlign, children: title })) : null, icon ? jsx(Img, { image: icon, height: "180", className: "w-auto mx-auto" }) : null, description ? (jsx(Text, { size: "text-h6", font: "font-normal", align: cardTextAlign, children: description })) : null] }, String(i)));
@@ -3050,54 +3110,6 @@
3050
3110
 
3051
3111
  const ITEMS_GAP = 16;
3052
3112
 
3053
- const defaultBlockDecorator = ({ blockClassName, block, render }) => render({ blockClassName, block });
3054
-
3055
- const DEFAULT_ANCESTORS = [];
3056
- const defaultStyle = 'col-span-12';
3057
- function renderBlock$1(block, options, { className, ...extraProps } = {}) {
3058
- const { key, blockDecorator = defaultBlockDecorator, blocksRegistry = {}, ancestors = DEFAULT_ANCESTORS, } = options;
3059
- const { type } = block;
3060
- if (!(type && type in blocksRegistry)) {
3061
- console.warn(`No block with "${type}" is registered`);
3062
- }
3063
- const BlockComponent = type && blocksRegistry[type];
3064
- return blockDecorator({
3065
- blockClassName: style(block.style?.length ? block.style : defaultStyle, className),
3066
- block,
3067
- ancestors,
3068
- // Adjusted by decorator block and blockClassName
3069
- render: ({ block: adjustedBlock, blockClassName: adjustedBlockClassName }) => {
3070
- const { content } = adjustedBlock;
3071
- return BlockComponent ? (jsx(BlockComponent, { className: adjustedBlockClassName, block: block, options: options, ...content, ...extraProps }, key)) : null;
3072
- },
3073
- }, key);
3074
- }
3075
-
3076
- const DEFAULT_SLOT_NAME = null;
3077
-
3078
- const EMPTY_ANCESTORS = [];
3079
- const renderBlocksList = (blocks, { key, ancestors = EMPTY_ANCESTORS, slotName = DEFAULT_SLOT_NAME, extraProps, renderProps = renderBlock$1, ...options }) => {
3080
- const renderChildBlock = extraProps
3081
- ? (childBlock, childOptions) => renderBlock$1(childBlock, childOptions, extraProps)
3082
- : renderProps;
3083
- return (blocks || []).map((_, i) => renderChildBlock(_, {
3084
- ...options,
3085
- key: `${key ? key : _.type}-${i}`,
3086
- ancestors: options.parent
3087
- ? [...(ancestors || EMPTY_ANCESTORS), [options.parent, slotName]]
3088
- : ancestors,
3089
- }, i));
3090
- };
3091
-
3092
- function renderChildren({ block, options, children, extraProps, renderProps, }) {
3093
- if (children) {
3094
- return children;
3095
- }
3096
- return block && options
3097
- ? renderBlocksList(block.blocks, { ...options, parent: block, extraProps, renderProps })
3098
- : null;
3099
- }
3100
-
3101
3113
  const getBorderStyle = (showBorder = false) => showBorder
3102
3114
  ? 'border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider'
3103
3115
  : '';
@@ -5723,7 +5735,7 @@
5723
5735
  const renderIcon = () => (jsx("div", { className: `rounded-full h-4 w-4 text-center text-xs font-light bg-primary-main text-white group-data-secondary:bg-white group-data-secondary:text-primary-main`, children: "i" }));
5724
5736
  const renderDescription = (description) => (jsx(Paragraph, { size: "text-s", font: "font-light", color: "text-secondary-text group-data-secondary:text-white", children: description }));
5725
5737
 
5726
- const Unit = JSX(({ prefix, unit, suffix }) => (jsxs("div", { className: "w-full pt-default flex items-end", children: [prefix ? (jsx("div", { className: "gradient-color-text", children: jsx(Text, { size: "text-h2", children: prefix }) })) : null, unit ? (
5738
+ const Unit = JSX(({ prefix, unit, suffix }) => (jsxs("div", { className: "w-full flex items-end", children: [prefix ? (jsx("div", { className: "gradient-color-text", children: jsx(Text, { size: "text-h2", children: prefix }) })) : null, unit ? (
5727
5739
  // -mb-n добавлен для выравнивания unit относительно prefix и suffix, тк шрифт font-mohave неправильно высчитывает line-height
5728
5740
  jsx("div", { className: "-mb-6 @xl:-mb-4", children: jsx("span", { className: "font-mohave text-title-large sm:text-title-extra gradient-color-text", children: unit }) })) : null, suffix ? (jsx("div", { className: "gradient-color-text", children: jsx(Text, { size: "text-h2", children: suffix }) })) : null] })));
5729
5741
 
@@ -5764,7 +5776,6 @@
5764
5776
  AdTile,
5765
5777
  ApplicationForm,
5766
5778
  BenefitsBlock,
5767
- Bonus,
5768
5779
  BonusBenefitsBlock,
5769
5780
  ButtonsBlock,
5770
5781
  Calculator,
@@ -5989,7 +6000,7 @@
5989
6000
  return (jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: jsx(LikeControl, { className: "rounded-tl-3xl sticky bottom-0 pointer-events-auto" }) }));
5990
6001
  }
5991
6002
 
5992
- const packageVersion = "0.14.137";
6003
+ const packageVersion = "0.14.139";
5993
6004
 
5994
6005
  exports.Blocks = Blocks;
5995
6006
  exports.ContentPage = ContentPage;