@meduza/ui-kit-2 0.8.5 → 0.8.7

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 (140) hide show
  1. package/dist/AnnouncementInText/AnnouncementInText.types.d.ts +4 -0
  2. package/dist/AnnouncementInText/index.d.ts +3 -0
  3. package/dist/BookmarkButton/BookmarkButton.types.d.ts +6 -0
  4. package/dist/BookmarkButton/index.d.ts +3 -0
  5. package/dist/Button/Button.types.d.ts +16 -0
  6. package/dist/Button/ButtonLoader.d.ts +2 -0
  7. package/dist/Button/index.d.ts +2 -0
  8. package/dist/CardTitle/CardTitle.types.d.ts +11 -0
  9. package/dist/CardTitle/index.d.ts +3 -0
  10. package/dist/ChapterBlock/ChapterBlock.types.d.ts +8 -0
  11. package/dist/ChapterBlock/index.d.ts +3 -0
  12. package/dist/Cover/Cover.types.d.ts +24 -0
  13. package/dist/Cover/index.d.ts +3 -0
  14. package/dist/DocumentItemsCount/DocumentItemsCount.types.d.ts +6 -0
  15. package/dist/DocumentItemsCount/index.d.ts +3 -0
  16. package/dist/DonatesTeaser/DonatesTeaser.types.d.ts +4 -0
  17. package/dist/DonatesTeaser/index.d.ts +3 -0
  18. package/dist/DotsOnImage/DotsOnImage.types.d.ts +46 -0
  19. package/dist/DotsOnImage/index.d.ts +3 -0
  20. package/dist/Dropdown/Dropdown.types.d.ts +5 -0
  21. package/dist/Dropdown/index.d.ts +4 -0
  22. package/dist/EmbedBlock/EmbedBlock.d.ts +3 -0
  23. package/dist/EmbedBlock/EmbedBlock.types.d.ts +12 -0
  24. package/dist/EmbedBlock/EmbedGif.d.ts +3 -0
  25. package/dist/EmbedBlock/IframeBlock.d.ts +3 -0
  26. package/dist/EmbedBlock/index.d.ts +3 -0
  27. package/dist/Footnote/Footnote.types.d.ts +5 -0
  28. package/dist/Footnote/index.d.ts +3 -0
  29. package/dist/GroupedBlock/GroupedBlock.types.d.ts +4 -0
  30. package/dist/GroupedBlock/index.d.ts +3 -0
  31. package/dist/HalfBlock/HalfBlock.types.d.ts +4 -0
  32. package/dist/HalfBlock/index.d.ts +3 -0
  33. package/dist/Image/Image.types.d.ts +35 -0
  34. package/dist/Image/RenderPicture.d.ts +4 -0
  35. package/dist/ImportantLead/ImportantLead.types.d.ts +4 -0
  36. package/dist/ImportantLead/index.d.ts +3 -0
  37. package/dist/Lazy/Lazy.types.d.ts +4 -0
  38. package/dist/ListBlock/ListBlock.types.d.ts +9 -0
  39. package/dist/ListBlock/index.d.ts +3 -0
  40. package/dist/ListViewSwitcher/ListViewSwitcher.types.d.ts +6 -0
  41. package/dist/ListViewSwitcher/index.d.ts +3 -0
  42. package/dist/MaterialNote/MaterialNote.types.d.ts +13 -0
  43. package/dist/MaterialNote/index.d.ts +3 -0
  44. package/dist/MaterialTitle/MaterialTitle.types.d.ts +4 -0
  45. package/dist/MaterialTitle/index.d.ts +5 -0
  46. package/dist/MediaCaption/MediaCaption.types.d.ts +5 -0
  47. package/dist/MediaCaption/index.d.ts +3 -0
  48. package/dist/Meta/Meta.mock.d.ts +12 -0
  49. package/dist/Meta/Meta.types.d.ts +19 -0
  50. package/dist/Meta/MetaContainer.d.ts +3 -0
  51. package/dist/Meta/index.d.ts +3 -0
  52. package/dist/MetaItem/MetaItem.types.d.ts +7 -0
  53. package/dist/MetaItem/index.d.ts +3 -0
  54. package/dist/MetaItemLive/MetaItemLive.types.d.ts +3 -0
  55. package/dist/MetaItemLive/index.d.ts +3 -0
  56. package/dist/Popover/Popover.types.d.ts +5 -0
  57. package/dist/Popover/index.d.ts +3 -0
  58. package/dist/QuoteBlock/QuoteBlock.types.d.ts +6 -0
  59. package/dist/QuoteBlock/index.d.ts +3 -0
  60. package/dist/RawHtmlBlock/RawHtmlBlock.types.d.ts +17 -0
  61. package/dist/RawHtmlBlock/index.d.ts +3 -0
  62. package/dist/RelatedBlock/RelatedBlock.types.d.ts +17 -0
  63. package/dist/RelatedBlock/index.d.ts +3 -0
  64. package/dist/RelatedBook/RelatedBook.mock.d.ts +65 -0
  65. package/dist/RelatedBook/RelatedBook.types.d.ts +4 -0
  66. package/dist/RelatedBook/index.d.ts +3 -0
  67. package/dist/RelatedRichBlock/RelatedRichBlock.types.d.ts +4 -0
  68. package/dist/RelatedRichBlock/index.d.ts +3 -0
  69. package/dist/RenderBlocks/RenderBlocks.types.d.ts +11 -0
  70. package/dist/RenderBlocks/index.d.ts +3 -0
  71. package/dist/RichTitle/RichTitle.types.d.ts +12 -0
  72. package/dist/RichTitle/index.d.ts +3 -0
  73. package/dist/SensitiveBlock/SensitiveBlock.types.d.ts +15 -0
  74. package/dist/SensitiveBlock/index.d.ts +3 -0
  75. package/dist/ShopRelatedBlock/ShopRelatedBlock.types.d.ts +4 -0
  76. package/dist/ShopRelatedBlock/index.d.ts +3 -0
  77. package/dist/SimpleBlock/SimpleBlock.types.d.ts +5 -0
  78. package/dist/SimpleBlock/index.d.ts +3 -0
  79. package/dist/SimpleTitle/SimpleTitle.types.d.ts +9 -0
  80. package/dist/SimpleTitle/index.d.ts +3 -0
  81. package/dist/SourceBlock/SourceBlock.types.d.ts +15 -0
  82. package/dist/SourceBlock/index.d.ts +3 -0
  83. package/dist/Spoiler/Spoiler.types.d.ts +4 -0
  84. package/dist/Spoiler/index.d.ts +3 -0
  85. package/dist/SvgSymbol/SvgSymbol.types.d.ts +8 -0
  86. package/dist/SvgSymbol/icons.d.ts +167 -0
  87. package/dist/Switcher/Switcher.types.d.ts +11 -0
  88. package/dist/Table/Table.types.d.ts +25 -0
  89. package/dist/Table/index.d.ts +3 -0
  90. package/dist/Tag/Tag.types.d.ts +12 -0
  91. package/dist/Tag/index.d.ts +3 -0
  92. package/dist/Timestamp/Timestamp.types.d.ts +5 -0
  93. package/dist/Timestamp/index.d.ts +4 -0
  94. package/dist/Toolbar/Toolbar.d.ts +3 -0
  95. package/dist/Toolbar/Toolbar.types.d.ts +7 -0
  96. package/dist/Toolbar/ToolbarItem.d.ts +3 -0
  97. package/dist/Toolbar/index.d.ts +2 -0
  98. package/dist/ToolbarButton/ToolbarButton.types.d.ts +10 -0
  99. package/dist/ToolbarButton/index.d.ts +3 -0
  100. package/dist/Tooltip/Tooltip.d.ts +3 -0
  101. package/dist/Tooltip/Tooltip.types.d.ts +8 -0
  102. package/dist/Tooltip/TooltipFooter.d.ts +3 -0
  103. package/dist/Tooltip/index.d.ts +2 -0
  104. package/dist/VersesBlock/VersesBlock.types.d.ts +9 -0
  105. package/dist/VersesBlock/index.d.ts +3 -0
  106. package/dist/constants.d.ts +41 -0
  107. package/dist/index.d.ts +46 -0
  108. package/dist/types.d.ts +20 -0
  109. package/dist/ui-kit-2.cjs.development.js +2833 -0
  110. package/dist/ui-kit-2.cjs.development.js.map +1 -0
  111. package/dist/ui-kit-2.cjs.production.min.js +2 -0
  112. package/dist/ui-kit-2.cjs.production.min.js.map +1 -0
  113. package/dist/ui-kit-2.esm.js +2778 -0
  114. package/dist/ui-kit-2.esm.js.map +1 -0
  115. package/dist/ui-kit-game.css +7161 -0
  116. package/dist/ui-kit.css +7161 -0
  117. package/dist/utils/BlockContext.d.ts +8 -0
  118. package/dist/utils/DangerousHtml.d.ts +8 -0
  119. package/dist/utils/capitalizeFirstLetter.d.ts +1 -0
  120. package/dist/utils/converCase.d.ts +2 -0
  121. package/dist/utils/generateGradient.d.ts +2 -0
  122. package/dist/utils/getElementPositionRelativeToViewport.d.ts +2 -0
  123. package/dist/utils/makeStyleContext.d.ts +3 -0
  124. package/dist/utils/pluralize.d.ts +2 -0
  125. package/dist/utils/postMessage.d.ts +2 -0
  126. package/dist/utils/viewportSize.d.ts +6 -0
  127. package/package.json +1 -1
  128. package/src/ListViewSwitcher/ListViewSwitcher.module.css +109 -0
  129. package/src/ListViewSwitcher/ListViewSwitcher.stories.module.css +6 -0
  130. package/src/ListViewSwitcher/ListViewSwitcher.stories.tsx +38 -0
  131. package/src/ListViewSwitcher/ListViewSwitcher.test.tsx +35 -0
  132. package/src/ListViewSwitcher/ListViewSwitcher.types.ts +7 -0
  133. package/src/ListViewSwitcher/index.tsx +30 -0
  134. package/src/Switcher/Switcher.module.css +4 -21
  135. package/src/Switcher/Switcher.stories.module.css +3 -21
  136. package/src/Switcher/Switcher.stories.tsx +13 -31
  137. package/src/Switcher/Switcher.types.ts +2 -4
  138. package/src/Switcher/index.tsx +7 -7
  139. package/src/_storybook/PreviewWrapper/index.tsx +0 -1
  140. package/src/index.tsx +1 -0
@@ -0,0 +1,2833 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var reactIntersectionObserver = require('react-intersection-observer');
7
+ var dayjs = require('dayjs');
8
+ require('dayjs/locale/ru');
9
+ var relativeTime = require('dayjs/plugin/relativeTime');
10
+ var reactRouterDom = require('react-router-dom');
11
+
12
+ const makeClassName = list => {
13
+ return list.filter(([, active]) => active).map(([className]) => className).join(' ');
14
+ };
15
+
16
+ const ButtonLoader = () => ( /*#__PURE__*/React.createElement("svg", {
17
+ width: "30px",
18
+ height: "30px",
19
+ viewBox: "0 0 30 30",
20
+ xmlns: "http://www.w3.org/2000/svg"
21
+ }, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
22
+ d: "M15 0C6.716 0 0 6.716 0 15c0 8.284 6.716 15 15 15 8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15zm0 2c7.18 0 13 5.82 13 13s-5.82 13-13 13S2 22.18 2 15 7.82 2 15 2z",
23
+ opacity: "0.3"
24
+ })), /*#__PURE__*/React.createElement("g", {
25
+ fillRule: "evenodd"
26
+ }, /*#__PURE__*/React.createElement("animateTransform", {
27
+ attributeName: "transform",
28
+ type: "rotate",
29
+ from: "0 15 15",
30
+ to: "360 15 15",
31
+ dur: "1000ms",
32
+ repeatCount: "indefinite"
33
+ }), /*#__PURE__*/React.createElement("path", {
34
+ d: "M15 0c8.18 0 14.83 6.547 14.997 14.686L30 15h-2c0-7.077-5.655-12.833-12.693-12.996L15 2V0z"
35
+ }))));
36
+
37
+ var styles$J = {"root":"Button-module_root__9OQ5b","gold":"Button-module_gold__q-XBP","isLoading":"Button-module_isLoading__Z53G4","gray":"Button-module_gray__fypDq","sand":"Button-module_sand__e5v-k","dark":"Button-module_dark__qv4NQ","light":"Button-module_light__TLYLT","black":"Button-module_black__GIsbk","red":"Button-module_red__kybni","default":"Button-module_default__utLb-","isInSpoiler":"Button-module_isInSpoiler__pGp-w","ghost":"Button-module_ghost__1s5-r","isInDropdown":"Button-module_isInDropdown__gN7TI","loader":"Button-module_loader__r0Mjs","isFancy":"Button-module_isFancy__gTRmu"};
38
+
39
+ const Button = ({
40
+ theme = 'gold',
41
+ size = 'default',
42
+ state = 'isDefault',
43
+ styleContext = 'isInToolbar',
44
+ appearance,
45
+ disabled = false,
46
+ onClick,
47
+ children
48
+ }) => {
49
+ const handleClick = () => {
50
+ if (disabled || !onClick) {
51
+ return;
52
+ }
53
+ onClick();
54
+ };
55
+ return /*#__PURE__*/React.createElement("button", {
56
+ "data-testid": "button",
57
+ className: makeClassName([[styles$J.root, true], [styles$J[size], !!size], [styles$J[theme], !!theme], [styles$J[appearance], !!appearance], [styles$J[state], !!state && !!styles$J[state]], [styles$J[styleContext], !!styleContext]]),
58
+ disabled: disabled,
59
+ onClick: handleClick,
60
+ type: "button"
61
+ }, state === 'isLoading' ? ( /*#__PURE__*/React.createElement("span", {
62
+ className: styles$J.loader
63
+ }, /*#__PURE__*/React.createElement(ButtonLoader, null))) : children);
64
+ };
65
+
66
+ const icons = {
67
+ meduzaLogo: {
68
+ width: 544,
69
+ height: 115,
70
+ content: '<path d="M59.1008614,49.65632 L59.1008614,106.01472 L84.9480411,114.24 L84.9480411,49.65632 L101.574882,49.65632 L101.574882,106.01472 L127.270909,114.24 L144.048902,91.392 L127.422062,91.392 L127.422062,35.7952 L101.726035,26.80832 L84.9480411,46.60992 L84.9480411,35.7952 L59.2520145,26.80832 L42.4740206,46.60992 L42.4740206,35.7952 L16.7779939,26.80832 L0,49.65632 L16.6268408,49.65632 L16.6268408,106.01472 L42.4740206,114.24 L42.4740206,49.65632 L59.1008614,49.65632 L59.1008614,49.65632 Z M336.61795,91.392 L336.61795,35.0336 L310.770769,26.80832 L310.770769,105.25312 L336.466796,114.24 L353.24479,94.4384 L353.24479,105.25312 L378.940817,114.24 L395.71881,91.392 L379.091969,91.392 L379.091969,35.0336 L353.24479,26.80832 L353.24479,91.392 L336.61795,91.392 L336.61795,91.392 Z M527.373159,38.08 L502.130592,26.80832 L472.202278,41.1264 L502.130592,52.39808 L461.016949,72.352 L461.016949,104.94848 L486.86413,114.24 L502.130592,94.28608 L502.130592,105.25312 L527.977771,114.24 L544,91.23968 L527.373159,91.23968 L527.373159,38.08 L527.373159,38.08 Z M177.453737,114.24 L207.079744,102.35904 L177.453737,91.23968 L177.453737,75.24608 L216.300083,56.3584 L194.231731,26.80832 L151.606557,47.37152 L151.606557,103.12064 L177.453737,114.24 L177.453737,114.24 Z M455.424284,89.56416 L423.984441,79.968 L453.459295,42.19264 L416.577937,26.80832 L397.230341,51.48416 L428.821339,61.23264 L398.741873,98.85568 L436.076687,114.24 L455.424284,89.56416 L455.424284,89.56416 Z M486.86413,91.392 L486.86413,68.84864 L502.130592,61.53728 L502.130592,91.392 L486.86413,91.392 L486.86413,91.392 Z M177.453737,41.58336 L190.452904,59.55712 L177.453737,65.80224 L177.453737,41.58336 L177.453737,41.58336 Z M222.95082,103.12064 L248.797999,114.24 L291.27202,97.18016 L291.27202,29.7024 L222.95082,0 L222.95082,26.30784 L265.424841,43.21536 L265.424841,97.33248 L248.797999,91.23968 L248.797999,43.71584 L222.95082,51.94112 L222.95082,103.12064 L222.95082,103.12064 Z" />'
71
+ },
72
+ menu: {
73
+ width: 24,
74
+ height: 24,
75
+ content: '<path d="M2 21h20M2 12h20M2 3h20" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke" />'
76
+ },
77
+ fb: {
78
+ width: 16,
79
+ height: 18,
80
+ content: '<path d="M15.117 1H.883A.883.883 0 0 0 0 1.883v14.234A.883.883 0 0 0 .883 17h7.663v-6.196H6.461V8.389h2.085V6.61a2.91 2.91 0 0 1 3.106-3.192c.622-.003 1.244.03 1.863.095v2.16h-1.279c-1.002 0-1.196.476-1.196 1.176v1.541h2.39l-.31 2.415h-2.08V17h4.077a.883.883 0 0 0 .883-.883V1.883A.883.883 0 0 0 15.117 1" />'
81
+ },
82
+ tw: {
83
+ width: 20,
84
+ height: 18,
85
+ content: '<path d="M20 3.1c-.7.3-1.5.6-2.4.7.8-.5 1.5-1.4 1.8-2.4-.8.5-1.7.8-2.6 1-.7-.8-1.8-1.4-3-1.4-2.3 0-4.1 1.9-4.1 4.3 0 .3 0 .7.1 1-3.3-.1-6.4-1.8-8.4-4.4-.3.6-.5 1.4-.5 2.2 0 1.5.7 2.8 1.8 3.6-.7 0-1.3-.2-1.9-.5v.1c0 2.1 1.4 3.8 3.3 4.2-.3.1-.7.2-1.1.2-.3 0-.5 0-.8-.1.5 1.7 2 2.9 3.8 3-1.3 1-3.1 1.6-5 1.6-.3 0-.7 0-1-.1C1.8 17.3 4 18 6.3 18 13.8 18 18 11.5 18 5.8v-.6c.8-.5 1.5-1.2 2-2.1" fill-rule="nonzero"/>'
86
+ },
87
+ vk: {
88
+ width: 20,
89
+ height: 18,
90
+ content: '<path d="M16.517 9.851s2.587-3.768 2.886-5.058c.1-.396-.1-.694-.498-.694h-2.288c-.498 0-.697.199-.896.595 0 0-1.194 2.678-2.686 4.364-.498.496-.697.694-.995.694-.2 0-.299-.198-.299-.694V4.793c0-.595-.1-.793-.597-.793H7.463c-.2 0-.398.198-.398.397 0 .595.796.694.796 2.28v3.174c0 .595 0 .893-.299.893-.796 0-2.686-2.777-3.681-5.851-.2-.595-.398-.794-.995-.794H.597C.299 4.1 0 4.298 0 4.694c0 .595.697 3.471 3.483 7.34C5.373 14.611 7.86 16 10.05 16c1.393 0 1.691-.198 1.691-.793v-1.984c0-.496.2-.694.498-.694s.895.1 2.189 1.388C15.92 15.405 16.02 16 16.915 16h2.587c.299 0 .498-.1.498-.595 0-.595-.796-1.587-1.89-2.876-.498-.595-1.195-1.29-1.493-1.686-.398-.397-.299-.595-.1-.992" fill-rule="nonzero"/>'
91
+ },
92
+ ok: {
93
+ width: 9,
94
+ height: 18,
95
+ content: '<path d="M4.5 2c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4m0 5.7c-.9 0-1.6-.8-1.6-1.7 0-.9.7-1.6 1.6-1.6.9 0 1.7.7 1.7 1.7 0 .8-.8 1.6-1.7 1.6" fill-rule="nonzero"/> <path d="M6.127 12.982a9.194 9.194 0 0 0 2.307-.904c.602-.301.703-1.004.402-1.507-.301-.502-1.104-.703-1.605-.401-1.605 1.004-3.812 1.004-5.417 0-.502-.302-1.304-.201-1.605.3-.401.604-.2 1.206.401 1.608a9.194 9.194 0 0 0 2.307.904L.61 15.092c-.502.401-.502 1.104 0 1.607a1.357 1.357 0 0 0 1.705 0l2.207-2.11L6.73 16.7a1.357 1.357 0 0 0 1.705 0c.502-.402.502-1.105 0-1.608l-2.307-2.109" fill-rule="nonzero"/>'
96
+ },
97
+ tg: {
98
+ width: 18,
99
+ height: 18,
100
+ content: '<path d="M9 18c-5 0-9-4-9-9s4-9 9-9 9 4 9 9-4 9-9 9zm-1.5-7.4c1.1 1 2 3.3 2 3.3.4.2.7.1.8-.4l2.1-7.4c.1-.6-.2-.8-.6-.7L4 8.3c-.6.2-.6.5-.1.7 0 .1 2.4.6 3.6 1.6z" fill-rule="nonzero"/>'
101
+ },
102
+ meduzaSymbol: {
103
+ width: 24,
104
+ height: 18,
105
+ content: '<path d="M10.026233,17.0968697 L13.9737671,18.3530831 L13.9737671,10.9855851 L13.9737671,8.48948164 L16.5131165,8.48948164 L16.5131165,17.0968697 L20.4375656,18.3530831 L23,14.8636014 L20.4606507,14.8636014 L20.4606507,6.37252945 L16.5362015,5 L13.9737671,8.02421743 L13.9737671,6.37252945 L10.049318,5 L7.48688354,8.02421743 L7.48688354,6.37252945 L3.56243443,5 L1,8.48948164 L3.53934943,8.48948164 L3.53934943,17.0968697 L7.48688354,18.3530831 L7.48688354,8.48948164 L10.026233,8.48948164 L10.026233,17.0968697 Z" />'
106
+ },
107
+ backward: {
108
+ width: 25,
109
+ height: 27,
110
+ content: '<path d="M13 0v2.01c6.672.263 12 5.754 12 12.49C25 21.404 19.404 27 12.5 27S0 21.404 0 14.5c0-3.493 1.441-6.758 3.936-9.105a.75.75 0 111.028 1.092A10.965 10.965 0 001.5 14.5c0 6.075 4.925 11 11 11s11-4.925 11-11c0-5.907-4.656-10.727-10.499-10.989L13 6 8 3l5-3zm3.295 11.33v1.25h-3.16v1.63c.32-.32.86-.56 1.47-.56 1.13 0 2.14.81 2.14 2.16 0 1.42-1.06 2.31-2.67 2.31-1.16 0-2-.38-2.57-1l.79-.99c.45.47 1.07.73 1.77.73.79 0 1.24-.45 1.24-.99 0-.59-.44-.99-1.2-.99-.55 0-1 .16-1.4.54l-.99-.26v-3.83h4.58zm-5.94 0V18h-1.42v-4.84l-1.11 1.13-.81-.85 2.1-2.11h1.24z" fill-rule="nonzero"/>'
111
+ },
112
+ forward: {
113
+ width: 25,
114
+ height: 27,
115
+ content: '<path d="M12 0l5 3-5 3V3.511C6.157 3.773 1.5 8.592 1.5 14.5c0 6.075 4.925 11 11 11s11-4.925 11-11c0-3.075-1.267-5.946-3.464-8.013a.75.75 0 011.028-1.092A12.465 12.465 0 0125 14.5C25 21.404 19.404 27 12.5 27S0 21.404 0 14.5C0 7.764 5.328 2.272 12 2.01V0zm4.295 11.33v1.25h-3.16v1.63c.32-.32.86-.56 1.47-.56 1.13 0 2.14.81 2.14 2.16 0 1.42-1.06 2.31-2.67 2.31-1.16 0-2-.38-2.57-1l.79-.99c.45.47 1.07.73 1.77.73.79 0 1.24-.45 1.24-.99 0-.59-.44-.99-1.2-.99-.55 0-1 .16-1.4.54l-.99-.26v-3.83h4.58zm-5.94 0V18h-1.42v-4.84l-1.11 1.13-.81-.85 2.1-2.11h1.24z" fill-rule="nonzero"/>'
116
+ },
117
+ download: {
118
+ width: 25,
119
+ height: 27,
120
+ content: '<path d="M12.5 2C19.404 2 25 7.596 25 14.5S19.404 27 12.5 27 0 21.404 0 14.5 5.596 2 12.5 2zm0 1.5c-6.075 0-11 4.925-11 11s4.925 11 11 11 11-4.925 11-11-4.925-11-11-11zm6 15.75a.75.75 0 01.102 1.493l-.102.007h-12a.75.75 0 01-.102-1.493l.102-.007h12zm-6-12a.75.75 0 01.743.648L13.25 8v7.598l1.834-1.222a.75.75 0 11.832 1.248l-3 2a.75.75 0 01-.832 0l-3-2a.75.75 0 11.832-1.248l1.834 1.223V8a.75.75 0 01.648-.743l.102-.007z" fill-rule="nonzero" fill="currentColor" />'
121
+ },
122
+ play: {
123
+ width: 62,
124
+ height: 62,
125
+ content: '<path d="M24.35 41.772a.5.5 0 0 1-.739-.439V20.667a.5.5 0 0 1 .74-.44l18.944 10.334a.5.5 0 0 1 0 .878L24.351 41.772z" fill-rule="nonzero"/>'
126
+ },
127
+ pause: {
128
+ width: 22,
129
+ height: 22,
130
+ content: '<path d="M12.832 4h2.8c.276 0 .5.224.5.5v12.394c0 .277-.224.5-.5.5h-2.8c-.276 0-.5-.223-.5-.5V4.5c0-.276.224-.5.5-.5zM6.5 4h2.8c.277 0 .5.224.5.5v12.394c0 .277-.223.5-.5.5H6.5c-.276 0-.5-.223-.5-.5V4.5c0-.276.224-.5.5-.5z" />'
131
+ },
132
+ speedHalf: {
133
+ width: 25,
134
+ height: 27,
135
+ content: '<path d="M7.212 15.198V12.29l-.676.724L6 12.406 7.35 11h.825v4.198h-.963zM8.056 18H7.3l4.23-7h.765l-4.24 7zm2.99 0v-.735c1.717-1.27 2.134-1.679 2.134-2.14 0-.389-.288-.578-.665-.578-.467 0-.884.263-1.083.525l-.496-.64c.417-.493 1.053-.693 1.599-.693.913 0 1.599.462 1.599 1.312 0 .682-.556 1.28-1.708 2.14h1.737V18h-3.118zm5.998-2.918l-1.39 1.48-.567-.577 1.4-1.49-1.4-1.48.566-.588 1.39 1.49 1.4-1.49.557.588-1.4 1.48 1.4 1.49-.556.577-1.4-1.48z" /><path d="M12.5 27C19.404 27 25 21.404 25 14.5S19.404 2 12.5 2 0 7.596 0 14.5 5.596 27 12.5 27zm0-1.5c-6.075 0-11-4.925-11-11s4.925-11 11-11 11 4.925 11 11-4.925 11-11 11z" />'
136
+ },
137
+ speedOne: {
138
+ width: 25,
139
+ height: 27,
140
+ content: '<path d="M9.955 18v-4.84l-1.11 1.13-.81-.85 2.1-2.11h1.24V18h-1.42zm4.6-2.78l-1.4 1.41-.57-.55 1.41-1.42-1.41-1.41.57-.56 1.4 1.42 1.41-1.42.56.56-1.41 1.41 1.41 1.42-.56.55-1.41-1.41z" fill-rule="nonzero"/><path d="M12.5 27C19.404 27 25 21.404 25 14.5S19.404 2 12.5 2 0 7.596 0 14.5 5.596 27 12.5 27zm0-1.5c-6.075 0-11-4.925-11-11s4.925-11 11-11 11 4.925 11 11-4.925 11-11 11z" fill-rule="nonzero"/>'
141
+ },
142
+ speedOneHalf: {
143
+ width: 25,
144
+ height: 27,
145
+ content: '<path d="M5.62 18v-4.84l-1.11 1.13-.81-.85 2.1-2.11h1.24V18H5.62zm3.37-2.67v-2.77l-.68.69-.54-.58 1.36-1.34h.83v4h-.97zM9.84 18h-.76l4.26-6.67h.77L9.84 18zm3.01 0v-.7c1.73-1.21 2.15-1.6 2.15-2.04 0-.37-.29-.55-.67-.55-.47 0-.89.25-1.09.5l-.5-.61c.42-.47 1.06-.66 1.61-.66.92 0 1.61.44 1.61 1.25 0 .65-.56 1.22-1.72 2.04h1.75V18h-3.14zm6.04-2.78l-1.4 1.41-.57-.55 1.41-1.42-1.41-1.41.57-.56 1.4 1.42 1.41-1.42.56.56-1.41 1.41 1.41 1.42-.56.55-1.41-1.41z" fill-rule="nonzero"/><path d="M12.5 27C19.404 27 25 21.404 25 14.5S19.404 2 12.5 2 0 7.596 0 14.5 5.596 27 12.5 27zm0-1.5c-6.075 0-11-4.925-11-11s4.925-11 11-11 11 4.925 11 11-4.925 11-11 11z" fill-rule="nonzero"/>'
146
+ },
147
+ speedTwo: {
148
+ width: 25,
149
+ height: 27,
150
+ content: '<path d="M7.147 18v-1.158c2.685-2.078 3.471-2.792 3.471-3.64 0-.6-.52-.9-1.061-.9-.748 0-1.318.311-1.76.797L7 12.127C7.64 11.352 8.613 11 9.527 11c1.396 0 2.507.827 2.507 2.202 0 1.18-.924 2.203-2.625 3.506h2.675V18H7.147zm7.916-2.874l-1.377 1.457-.56-.568 1.386-1.468-1.386-1.458.56-.58 1.377 1.469 1.386-1.468.551.579-1.386 1.458L17 16.015l-.55.568-1.387-1.457z" fill-rule="nonzero"/><path d="M12.5 27C19.404 27 25 21.404 25 14.5S19.404 2 12.5 2 0 7.596 0 14.5 5.596 27 12.5 27zm0-1.5c-6.075 0-11-4.925-11-11s4.925-11 11-11 11 4.925 11 11-4.925 11-11 11z" fill-rule="nonzero"/>'
151
+ },
152
+ podcastBookmark: {
153
+ width: 25,
154
+ height: 27,
155
+ content: '<path d="M12.5 27C19.404 27 25 21.404 25 14.5S19.404 2 12.5 2 0 7.596 0 14.5 5.596 27 12.5 27zm0-1.5c-6.075 0-11-4.925-11-11s4.925-11 11-11 11 4.925 11 11-4.925 11-11 11z" /> <path d="M17.071 8.25H8a.75.75 0 00-.75.75v11.545l.007.104a.75.75 0 001.228.468l4.05-3.437 4.051 3.437a.75.75 0 001.235-.572V9a.75.75 0 00-.75-.75zm-.75 1.499v9.176l-3.3-2.8-.098-.07a.75.75 0 00-.873.07l-3.3 2.799V9.749h7.571z" data-stroke="true" /> <path d="M17.071 8.25H8a.75.75 0 00-.75.75v11.545l.007.104a.75.75 0 001.228.468l4.05-3.437 4.051 3.437a.75.75 0 001.235-.572V9a.75.75 0 00-.75-.75z" data-fill="true" />'
156
+ },
157
+ reaction: {
158
+ width: 16,
159
+ height: 16,
160
+ content: '<path data-theme="light" fill="#D09959" d="M1 2h14v12H1z"/> <path d="M0 1.778C0 .8.8 0 1.778 0h12.444C15.2 0 16 .8 16 1.778v12.444C16 15.2 15.2 16 14.222 16H1.778C.8 16 0 15.2 0 14.222V1.778zM6.8 11.7l2.5.8V6.2h1.6v5.5l2.5.8 1.6-2.3h-1.6V4.8L10.9 4 9.3 5.9V4.8L6.8 4 5.1 5.9V4.8L2.6 4 1 6.2h1.6v5.5l2.5.8V6.2h1.7v5.5z" />'
161
+ },
162
+ cross: {
163
+ width: 18,
164
+ height: 18,
165
+ content: '<path fill="none" fill-rule="evenodd" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" vector-effect="non-scaling-stroke" d="M2 2l14 14M16 2L2 16" />'
166
+ },
167
+ link: {
168
+ width: 24,
169
+ height: 24,
170
+ content: '<path d="M9.158 18.928c-1.065 0-2.13-.405-2.94-1.215-1.624-1.623-1.624-4.262 0-5.884l.643-.645c.327-.326.854-.326 1.18 0 .325.326.325.853 0 1.178l-.645.645c-.972.972-.972 2.554 0 3.526.973.972 2.554.973 3.526 0l2.842-2.84c.97-.972.97-2.555 0-3.527-.325-.325-.325-.854 0-1.18.325-.324.853-.324 1.178 0 1.623 1.625 1.623 4.264 0 5.885l-2.84 2.84c-.81.81-1.877 1.216-2.942 1.216" /> <path d="M10.578 14.184c-.213 0-.426-.082-.59-.244-.784-.785-1.217-1.83-1.217-2.94 0-1.113.433-2.158 1.22-2.944l2.84-2.84c1.622-1.62 4.26-1.62 5.883 0 1.622 1.623 1.622 4.262 0 5.883l-.645.643c-.325.326-.852.326-1.178 0-.325-.325-.325-.852 0-1.178l.645-.644c.972-.97.972-2.554 0-3.526s-2.556-.972-3.527 0l-2.84 2.842c-.47.47-.73 1.096-.73 1.762 0 .667.26 1.293.73 1.763.325.327.325.854 0 1.18-.163.162-.376.244-.59.244" />'
171
+ },
172
+ search: {
173
+ width: 16,
174
+ height: 16,
175
+ content: '<g transform="translate(2 1)" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" vector-effect="non-scaling-stroke"><circle cx="5.5" cy="5.5" r="5.5"/><path d="M11.37 13.442l-.995-1.272"/></g>'
176
+ },
177
+ card: {
178
+ width: 15,
179
+ height: 15,
180
+ content: '<path d="M9 5.5a.5.5 0 0 1 .5.5v5a.5.5 0 0 1-.5.5H4a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5h5zm-.5 1h-4v4h4v-4zm2.5-3a.5.5 0 0 1 .5.5v5a.5.5 0 1 1-1 0V4.5H6a.5.5 0 0 1 0-1h5z" fill-rule="nonzero"/>'
181
+ },
182
+ podcast: {
183
+ width: 15,
184
+ height: 15,
185
+ content: '<path d="M5.252 11.432A.5.5 0 0 1 4.5 11V4a.5.5 0 0 1 .752-.432l6 3.5a.5.5 0 0 1 0 .864l-6 3.5zm.248-1.303L10.008 7.5 5.5 4.87v5.26z" fill-rule="nonzero" />'
186
+ },
187
+ arrow: {
188
+ width: 12,
189
+ height: 12,
190
+ content: '<path d="M3 7l3 3.5L9 7M6 10V1" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.2" vector-effect="non-scaling-stroke" />'
191
+ },
192
+ brent: {
193
+ width: 9,
194
+ height: 12,
195
+ content: '<g fill="#999" fill-rule="nonzero"><path d="M4.332 0l.528.606c2.528 2.902 3.804 5.07 3.804 6.634A4.332 4.332 0 110 7.24C0 5.676 1.276 3.508 3.804.606L4.332 0zm0 2.143l-.176.212C2.313 4.589 1.4 6.248 1.4 7.24a2.932 2.932 0 105.864 0c0-.992-.914-2.651-2.756-4.885l-.176-.212z"/><path d="M2.973 7.475c0 .415.417.863.835.924l.097.008v.7c-.79 0-1.548-.716-1.626-1.5l-.006-.132h.7z"/></g> '
196
+ },
197
+ user: {
198
+ width: 16,
199
+ height: 16,
200
+ content: '<path fill="currentColor" fill-rule="nonzero" d="M8 1a4.25 4.25 0 012.676 7.552 6.751 6.751 0 014.074 6.198.75.75 0 11-1.5 0 5.25 5.25 0 00-10.5 0 .75.75 0 11-1.5 0 6.752 6.752 0 014.074-6.199A4.25 4.25 0 018 1zm0 1.5A2.75 2.75 0 108 8a2.75 2.75 0 000-5.5z" />'
201
+ },
202
+ bookmark: {
203
+ width: 17,
204
+ height: 21,
205
+ content: '<path d="M16 20l-7.5-6.333L1 20V1h15z" stroke="currentColor" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"/>'
206
+ },
207
+ shareBookmark: {
208
+ width: 11,
209
+ height: 15,
210
+ content: '<path clip-rule="evenodd" d="M10 14 5.5 9.667 1 14V1h9v13Z" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>'
211
+ },
212
+ receipt: {
213
+ width: 10,
214
+ height: 13,
215
+ content: '<g fill="currentColor" fill-rule="nonzero"><path d="M10 0H0v13l2-1.74 1.5 1.305L5 11.26l1.5 1.305L8 11.26 10 13V0zM9 .997v9.81l-1-.87-1.5 1.304L5 9.937 3.5 11.24 2 9.937l-1 .87V.996h8z"/><path d="M7 3v1H3V3zM7 6v1H3V6z"/></g>'
216
+ },
217
+ read: {
218
+ width: 15,
219
+ height: 15,
220
+ content: '<g fill="none" fill-rule="evenodd"><path opacity=".98" d="M0 0h15v15H0z"/><path d="M13.085 1.694a.513.513 0 01.855.56l-.051.077-3.163 3.975a.514.514 0 01-.73.075l-.068-.069-1.812-2.208a.512.512 0 01.729-.716l.065.066 1.409 1.718 2.766-3.478z" fill="#6EAC65" fill-rule="nonzero"/><path d="M6.454 12.997l-.06-.01-.078-.023a.49.49 0 01-.266-.24l.011.015a2.349 2.349 0 00-.535-.607c-.89-.745-2.117-.917-3.813-.12a.5.5 0 01-.706-.37L1 11.558V4.568a.5.5 0 01.287-.453c2.053-.963 3.695-.733 4.88.26.327.272.556.548.698.77l.084.144.018.04.022.076.01.071L7 11.233l.126-.09c.95-.656 2.16-.857 3.608-.417l.266.087v-2.81a.5.5 0 01.41-.491l.09-.008a.5.5 0 01.492.41l.008.09v3.555a.5.5 0 01-.713.452c-1.696-.796-2.922-.624-3.813.12a2.533 2.533 0 00-.497.544l-.038.064a.486.486 0 01-.485.258zm-4.29-8.17L2 4.892v5.92c1.637-.572 2.977-.348 4 .42l.002-5.58a2.605 2.605 0 00-.476-.513c-.81-.677-1.897-.88-3.362-.314z" fill="currentColor" fill-rule="nonzero"/></g>'
221
+ },
222
+ listened: {
223
+ width: 15,
224
+ height: 15,
225
+ content: '<g fill-rule="nonzero"><path d="M4.978 4.354a.5.5 0 01-.332.624c-1.197.367-2.064 1.527-2.14 2.897l-.005.167a.749.749 0 01.999.708v3a.75.75 0 01-1.458.248L2 12a1 1 0 01-1-1v-1a1 1 0 01.5-.866V8.072c0-1.886 1.172-3.535 2.854-4.05a.5.5 0 01.624.332zM10 7a.5.5 0 01.492.41l.008.09.001 1.634a1 1 0 01.492.745L11 10v1a1 1 0 01-.883.993L10 12l-.042-.002a.75.75 0 01-1.451-.146L8.5 11.75v-3a.75.75 0 011.001-.707L9.5 7.5l.008-.09A.5.5 0 0110 7z" fill="currentColor" /><path d="M11.585 1.194a.513.513 0 01.855.56l-.051.077-3.163 3.975a.514.514 0 01-.73.075l-.068-.069-1.812-2.208a.512.512 0 01.729-.716l.065.066 1.409 1.718 2.766-3.478z" fill="#6EAC65" /></g>'
226
+ },
227
+ magic: {
228
+ width: 15,
229
+ height: 15,
230
+ content: '<g fill-rule="evenodd" clip-rule="evenodd"> <path d="M7.804.4a.6.6 0 0 1 .6.6v2.035a.6.6 0 0 1-1.2 0V1a.6.6 0 0 1 .6-.6ZM7.804 10.577a.6.6 0 0 1 .6.6v2.035a.6.6 0 1 1-1.2 0v-2.035a.6.6 0 0 1 .6-.6ZM14.636 7.106a.6.6 0 0 1-.6.6h-2.078a.6.6 0 1 1 0-1.2h2.078a.6.6 0 0 1 .6.6ZM4.25 7.106a.6.6 0 0 1-.6.6H1.573a.6.6 0 0 1 0-1.2H3.65a.6.6 0 0 1 .6.6ZM12.639 2.37a.585.585 0 0 1 0 .84l-1.442 1.412a.615.615 0 0 1-.857 0 .585.585 0 0 1 0-.84l1.442-1.412a.615.615 0 0 1 .857 0ZM12.639 11.843a.615.615 0 0 1-.857 0L10.34 10.43a.585.585 0 0 1 0-.84.615.615 0 0 1 .857 0l1.442 1.413a.585.585 0 0 1 0 .84ZM5.269 4.621a.615.615 0 0 1-.858 0L2.97 3.208a.585.585 0 0 1 0-.84.615.615 0 0 1 .858 0l1.442 1.413a.585.585 0 0 1 0 .84ZM8.926 6.074a.6.6 0 0 1 0 .849l-.863.863-.849-.849.863-.863a.6.6 0 0 1 .849 0ZM7.348 8.5l-5.924 5.924a.6.6 0 1 1-.848-.848L6.5 7.652l.848.848Z"/> </g>'
231
+ }
232
+ };
233
+
234
+ var styles$I = {"root":"SvgSymbol-module_root__WctNR","small":"SvgSymbol-module_small__h9V-w","normal":"SvgSymbol-module_normal__gFAVe","medium":"SvgSymbol-module_medium__QaYjY","large":"SvgSymbol-module_large__o6A4o","adaptive":"SvgSymbol-module_adaptive__gL9qn","fb":"SvgSymbol-module_fb__HZqcB","vk":"SvgSymbol-module_vk__XctB2","ok":"SvgSymbol-module_ok__IM6Z9","tw":"SvgSymbol-module_tw__fio-Q","tg":"SvgSymbol-module_tg__GRhd-","magic":"SvgSymbol-module_magic__N-jKk","reaction":"SvgSymbol-module_reaction__xSbgo","card":"SvgSymbol-module_card__2nVFu","podcast":"SvgSymbol-module_podcast__Yp05r","read":"SvgSymbol-module_read__Bu653","listened":"SvgSymbol-module_listened__AOn7j","menu":"SvgSymbol-module_menu__z-dLm","cross":"SvgSymbol-module_cross__3Xej1","isInFeature":"SvgSymbol-module_isInFeature__BmyI-","isInCard":"SvgSymbol-module_isInCard__USxBS","isInTopicBlockItem":"SvgSymbol-module_isInTopicBlockItem__cnCgw","isInPageStatic":"SvgSymbol-module_isInPageStatic__7kMP-","isInMaterialMeta":"SvgSymbol-module_isInMaterialMeta__lIKJO","isInAudioPlayer":"SvgSymbol-module_isInAudioPlayer__mamWa","isInEpisodeBlock":"SvgSymbol-module_isInEpisodeBlock__oZ6JG","isInButtonPlaybackRate":"SvgSymbol-module_isInButtonPlaybackRate__NnADm","isInButtonBackward":"SvgSymbol-module_isInButtonBackward__x8L9a","isInButtonForward":"SvgSymbol-module_isInButtonForward__TtixK","isInToolbar":"SvgSymbol-module_isInToolbar__RzbaX","play":"SvgSymbol-module_play__dAES0","meduzaLogo":"SvgSymbol-module_meduzaLogo__aVKzZ","arrow":"SvgSymbol-module_arrow__lWTSJ","oil":"SvgSymbol-module_oil__VFGTp","search":"SvgSymbol-module_search__h06cc","user":"SvgSymbol-module_user__ORMm-","bookmark":"SvgSymbol-module_bookmark__JPKyG","shareBookmark":"SvgSymbol-module_shareBookmark__7w9X9","receipt":"SvgSymbol-module_receipt__o3V8u","isInHeader":"SvgSymbol-module_isInHeader__M5Tzw"};
235
+
236
+ const SvgSymbol = ({
237
+ icon,
238
+ size,
239
+ styleContext
240
+ }) => {
241
+ const data = icons[icon];
242
+ return /*#__PURE__*/React.createElement("svg", {
243
+ "data-testid": "svg-symbol",
244
+ xmlns: "http://www.w3.org/2000/svg",
245
+ xmlnsXlink: "http://www.w3.org/1999/xlink",
246
+ className: makeClassName([[styles$I.root, true], [styles$I[size], !!styles$I[size]], [styles$I[icon], !!styles$I[icon]], [styles$I[styleContext], !!styles$I[styleContext]]]),
247
+ width: data.width,
248
+ height: data.height,
249
+ viewBox: `0 0 ${data.width} ${data.height}`,
250
+ dangerouslySetInnerHTML: {
251
+ __html: data.content
252
+ }
253
+ });
254
+ };
255
+
256
+ var styles$H = {"root":"Switcher-module_root__cBsJB","dark":"Switcher-module_dark__1QQsH","control":"Switcher-module_control__60WMX","input":"Switcher-module_input__5UDnv","knob":"Switcher-module_knob__PwA1A","isInMenu":"Switcher-module_isInMenu__RQVhp","isInLive":"Switcher-module_isInLive__ZyMCT","children":"Switcher-module_children__uLapU"};
257
+
258
+ const Switcher = ({
259
+ enabled,
260
+ onChange,
261
+ styleContext,
262
+ theme = 'light',
263
+ childrenLeft,
264
+ childrenRight
265
+ }) => ( /*#__PURE__*/React.createElement("label", {
266
+ "data-testid": "switcher",
267
+ className: makeClassName([[styles$H.root, true], [styles$H[theme], !!styles$H[theme]], [styles$H[styleContext], !!styles$H[styleContext]]])
268
+ }, childrenLeft && ( /*#__PURE__*/React.createElement("div", {
269
+ className: makeClassName([[styles$H.children, true], [styles$H.left, true]])
270
+ }, childrenLeft)), /*#__PURE__*/React.createElement("input", {
271
+ className: styles$H.input,
272
+ type: "checkbox",
273
+ checked: enabled,
274
+ onChange: onChange
275
+ }), /*#__PURE__*/React.createElement("span", {
276
+ className: styles$H.control
277
+ }, /*#__PURE__*/React.createElement("span", {
278
+ className: styles$H.knob
279
+ })), childrenRight && ( /*#__PURE__*/React.createElement("div", {
280
+ className: makeClassName([[styles$H.children, true], [styles$H.right, true]])
281
+ }, childrenRight))));
282
+
283
+ const makeStyleContext = (classNames, styleContext, styles) => {
284
+ const context = Array.isArray(styleContext) ? styleContext.filter(ctx => styles[ctx]).map(ctx => [[styles[ctx]], true]) : [[styles[styleContext], !!styleContext && !!styles[styleContext]]];
285
+ return classNames.concat(context);
286
+ };
287
+
288
+ const BlockContext = /*#__PURE__*/React.createContext({
289
+ lightBox: null
290
+ });
291
+ const BlockProvider = BlockContext.Provider;
292
+
293
+ const POST_MESSAGE_PREFIX = 'mdzKitMsg';
294
+ const postMessage = (category, element, action) => {
295
+ const target = window.top;
296
+ const msg = `${POST_MESSAGE_PREFIX}=${JSON.stringify({
297
+ category,
298
+ element,
299
+ action
300
+ })}`;
301
+ if (typeof target !== 'undefined') {
302
+ target.postMessage(msg, '*');
303
+ }
304
+ };
305
+
306
+ var styles$G = {"root":"Lazy-module_root__DWw8D"};
307
+
308
+ const Lazy = ({
309
+ children,
310
+ threshold
311
+ }) => {
312
+ const [ref, inView, entry] = reactIntersectionObserver.useInView({
313
+ threshold: threshold || 0
314
+ });
315
+ const [visible, setVisible] = React.useState(false);
316
+ React.useEffect(() => {
317
+ if (entry && entry.boundingClientRect && entry.boundingClientRect.y < 0) {
318
+ setVisible(true);
319
+ }
320
+ }, [entry]);
321
+ React.useEffect(() => {
322
+ if (inView) {
323
+ setVisible(true);
324
+ }
325
+ }, [inView]);
326
+ return /*#__PURE__*/React.createElement("div", {
327
+ className: makeClassName([[styles$G.root, true], [styles$G.visible, visible]]),
328
+ ref: ref,
329
+ "data-testid": "lazy"
330
+ }, visible && children);
331
+ };
332
+
333
+ const MediaQuerySizes = {
334
+ MOBILE: 512,
335
+ PORTRAIT_TABLET: 768,
336
+ LANDSCAPE_TABLET: 1024,
337
+ DESKTOP: 1010,
338
+ WIDE_DESKTOP: 1200
339
+ };
340
+ const imageBreakpoints = {
341
+ 325: '(min-width: 0)',
342
+ 520: '(min-width: 325px)',
343
+ 600: '(min-width: 600px)',
344
+ 650: '(min-width: 650px)',
345
+ 980: '(min-width: 1000px)',
346
+ 1335: '(min-width: 1000px)'
347
+ };
348
+ const imageConditionalKeys = {
349
+ xs: [325],
350
+ superFull: [1335, 650, 520, 325],
351
+ full: [980, 650, 520, 325],
352
+ default: [650, 520, 325],
353
+ narrow: [600, 325]
354
+ };
355
+ const SocialLabels = {
356
+ ru: {
357
+ tg: 'Телеграм',
358
+ fb: 'Фейсбук',
359
+ tw: 'Твиттер',
360
+ pdf: 'PDF',
361
+ unblock: 'Magic link',
362
+ bookmark: 'В закладки',
363
+ reaction: 'Напишите нам'
364
+ },
365
+ en: {
366
+ tg: 'Telegram',
367
+ fb: 'Fb',
368
+ tw: 'Twitter',
369
+ pdf: 'PDF',
370
+ unblock: 'Magic link',
371
+ bookmark: 'Add to bookmarks'
372
+ }
373
+ };
374
+
375
+ const toCamel = s => s.replace(/([_][a-z])/gi, str => str.toUpperCase().replace('_', ''));
376
+ const toCapitalize = s => s[0].toUpperCase() + s.slice(1);
377
+
378
+ const RenderPicture = ({
379
+ source,
380
+ fallbackSource,
381
+ optimized,
382
+ alt,
383
+ display,
384
+ onLoad
385
+ }) => {
386
+ const [fallback, setFallback] = React.useState(false);
387
+ React.useEffect(() => {
388
+ setFallback(!window.HTMLPictureElement);
389
+ }, []);
390
+ const keys = imageConditionalKeys[toCamel(display)] || imageConditionalKeys.default;
391
+ return /*#__PURE__*/React.createElement("picture", null, source && ( /*#__PURE__*/React.createElement("source", {
392
+ media: "(min-width: 325px)",
393
+ srcSet: `${source[1]} 2x`
394
+ })), optimized && !optimized.w325 && ( /*#__PURE__*/React.createElement("source", {
395
+ media: "(min-width: 0)",
396
+ srcSet: `${optimized.original}`
397
+ })), optimized && keys.map(key => {
398
+ const breakpoint = optimized[`w${key}`];
399
+ if (!breakpoint) {
400
+ return null;
401
+ }
402
+ return /*#__PURE__*/React.createElement(React.Fragment, {
403
+ key: key
404
+ }, /*#__PURE__*/React.createElement("source", {
405
+ type: "image/webp",
406
+ media: imageBreakpoints[key],
407
+ srcSet: `${breakpoint['2x_webp']} 2x, ${breakpoint['1x_webp']} 1x `
408
+ }), /*#__PURE__*/React.createElement("source", {
409
+ type: "image/png",
410
+ media: imageBreakpoints[key],
411
+ srcSet: `${breakpoint['2x']} 2x, ${breakpoint['1x']} 1x `
412
+ }));
413
+ }), /*#__PURE__*/React.createElement("img", {
414
+ src: fallback ? fallbackSource : 'data:image/gif;base64,R0lGODlhAQABAPAAAPLy8gAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==',
415
+ alt: alt,
416
+ onLoad: () => onLoad(true)
417
+ }));
418
+ };
419
+
420
+ var styles$F = {"root":"Image-module_root__H5wAh","isStatic":"Image-module_isStatic__TmQ1V","isLoaded":"Image-module_isLoaded__keFnD","wrapper":"Image-module_wrapper__gJtbB","fullscreen":"Image-module_fullscreen__4PU9c","dark":"Image-module_dark__qjo5O"};
421
+
422
+ const Image = ({
423
+ alt,
424
+ display,
425
+ optimized,
426
+ width,
427
+ height,
428
+ source,
429
+ lazy,
430
+ ratio,
431
+ styleContext,
432
+ fullscreen = true
433
+ }) => {
434
+ const {
435
+ lightBox
436
+ } = React.useContext(BlockContext);
437
+ const [isLoaded, setIsLoaded] = React.useState(lazy ? false : true);
438
+ const handleClick = () => {
439
+ if (!lightBox || !fullscreen || optimized && !optimized.original) {
440
+ return;
441
+ }
442
+ postMessage('', 'fullscreen_click', 'click');
443
+ lightBox.show(optimized, width, height, alt);
444
+ };
445
+ const blockStyles = {
446
+ maxWidth: width <= 649 ? width : '100%'
447
+ };
448
+ const pictureStyles = {
449
+ paddingBottom: `${100 / (ratio || width / height)}%`
450
+ };
451
+ /* fallback w325 url until w6 was released */
452
+ const fallbackSource = source && source[0] || optimized.w325 && optimized.w325['1x'] || optimized.original;
453
+ let classNames = [[styles$F.root, true], [styles$F.isLoaded, isLoaded], [styles$F.fullscreen, lightBox && optimized && optimized.original && fullscreen]];
454
+ if (styleContext) {
455
+ classNames = makeStyleContext(classNames, styleContext, styles$F);
456
+ }
457
+ return /*#__PURE__*/React.createElement("div", {
458
+ className: makeClassName(classNames),
459
+ style: blockStyles,
460
+ "data-testid": "image"
461
+ }, /*#__PURE__*/React.createElement("div", {
462
+ className: styles$F.wrapper,
463
+ style: pictureStyles,
464
+ onClick: () => handleClick(),
465
+ onKeyPress: () => handleClick(),
466
+ role: "button",
467
+ tabIndex: 0
468
+ }, lazy ? ( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Lazy, {
469
+ threshold: 0.25
470
+ }, /*#__PURE__*/React.createElement(RenderPicture, {
471
+ fallbackSource: fallbackSource,
472
+ source: source,
473
+ optimized: optimized,
474
+ alt: alt,
475
+ display: display,
476
+ onLoad: setIsLoaded
477
+ })), /*#__PURE__*/React.createElement("noscript", null, /*#__PURE__*/React.createElement("img", {
478
+ src: fallbackSource,
479
+ alt: alt
480
+ })))) : ( /*#__PURE__*/React.createElement(RenderPicture, {
481
+ fallbackSource: fallbackSource,
482
+ source: source,
483
+ optimized: optimized,
484
+ alt: alt,
485
+ display: display,
486
+ onLoad: setIsLoaded
487
+ }))));
488
+ };
489
+
490
+ var styles$E = {"root":"Popover-module_root__nBiV4","fadeOut":"Popover-module_fadeOut__Y88V7","visible":"Popover-module_visible__XVQLW","fadeIn":"Popover-module_fadeIn__FK1gd","overlay":"Popover-module_overlay__NAPar","container":"Popover-module_container__y4SB1","disappear":"Popover-module_disappear__uUn2b","dismiss":"Popover-module_dismiss__W8KFF","background":"Popover-module_background__apiio","appear":"Popover-module_appear__b-CZ2","body":"Popover-module_body__UJEZf"};
491
+
492
+ const Popover = ({
493
+ children,
494
+ onClose
495
+ }) => {
496
+ const [visible, setVisible] = React.useState(true);
497
+ const handleClose = () => {
498
+ setVisible(false);
499
+ setTimeout(onClose, 350);
500
+ };
501
+ const handleScroll = () => {
502
+ handleClose();
503
+ };
504
+ const escFunction = event => {
505
+ if (event.key === 'Escape') {
506
+ handleClose();
507
+ }
508
+ };
509
+ React.useEffect(() => {
510
+ document.body.dataset.popover = 'true';
511
+ window.addEventListener('keydown', escFunction, false);
512
+ window.addEventListener('scroll', handleScroll, false);
513
+ return () => {
514
+ document.body.removeAttribute('data-popover');
515
+ window.removeEventListener('keydown', escFunction, false);
516
+ window.removeEventListener('scroll', handleScroll, false);
517
+ };
518
+ }, [visible]);
519
+ /* eslint-disable jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */
520
+ return /*#__PURE__*/React.createElement("div", {
521
+ "data-testid": "popover",
522
+ className: makeClassName([[styles$E.root, true], [styles$E.visible, visible]])
523
+ }, /*#__PURE__*/React.createElement("div", {
524
+ className: styles$E.overlay,
525
+ onClick: () => handleClose()
526
+ }), /*#__PURE__*/React.createElement("div", {
527
+ className: styles$E.container
528
+ }, /*#__PURE__*/React.createElement("button", {
529
+ type: "button",
530
+ className: styles$E.dismiss,
531
+ onClick: () => handleClose(),
532
+ "aria-label": "dismiss"
533
+ }), /*#__PURE__*/React.createElement("svg", {
534
+ width: "100%",
535
+ className: styles$E.background
536
+ }, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("mask", {
537
+ id: "myMask",
538
+ x: "0",
539
+ y: "0",
540
+ width: "100%",
541
+ height: "100%"
542
+ }, /*#__PURE__*/React.createElement("rect", {
543
+ fill: "white",
544
+ y: "0",
545
+ width: "100%",
546
+ height: "100%",
547
+ x: "0"
548
+ }), /*#__PURE__*/React.createElement("svg", {
549
+ x: "50%",
550
+ overflow: "visible"
551
+ }, /*#__PURE__*/React.createElement("g", {
552
+ transform: "translate(-12 0)"
553
+ }, /*#__PURE__*/React.createElement("path", {
554
+ d: "M4.61852778e-14,9.76996262e-15 L9.84597532,5.80270273 C11.0992017,6.54128882 12.6546044,6.54128882 13.9078308,5.80270273 L23.7538061,9.76996262e-15 L4.61852778e-14,9.76996262e-15 Z"
555
+ }))))), /*#__PURE__*/React.createElement("rect", {
556
+ fill: "#F7F7F7",
557
+ id: "base-mask",
558
+ mask: "url(#myMask)",
559
+ x: "0",
560
+ y: "0",
561
+ width: "100%",
562
+ height: "100%"
563
+ })), /*#__PURE__*/React.createElement("div", {
564
+ className: styles$E.body
565
+ }, children)));
566
+ };
567
+
568
+ var styles$D = {"root":"Footnote-module_root__W5D8G","body":"Footnote-module_body__C-ZC-","dismiss":"Footnote-module_dismiss__Q2hAX"};
569
+
570
+ const Footnote = ({
571
+ children,
572
+ onClose
573
+ }) => {
574
+ return /*#__PURE__*/React.createElement("div", {
575
+ "data-testid": "footnote",
576
+ className: makeClassName([[styles$D.root, true]])
577
+ }, /*#__PURE__*/React.createElement("button", {
578
+ className: styles$D.dismiss,
579
+ type: "button",
580
+ onClick: () => onClose()
581
+ }, /*#__PURE__*/React.createElement(SvgSymbol, {
582
+ icon: "cross",
583
+ size: "unset"
584
+ })), /*#__PURE__*/React.createElement("div", {
585
+ className: styles$D.body
586
+ }, children));
587
+ };
588
+
589
+ var viewportSize = () => ({
590
+ width: window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
591
+ height: window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
592
+ });
593
+
594
+ var styles$C = {"root":"DotsOnImage-module_root__8UQf2","isVisible":"DotsOnImage-module_isVisible__rA5x9","marker":"DotsOnImage-module_marker__pLdQT","show":"DotsOnImage-module_show__Ec0lG","dot":"DotsOnImage-module_dot__e2MWx","isActive":"DotsOnImage-module_isActive__Bhb58","popover":"DotsOnImage-module_popover__zHSbU","isRight":"DotsOnImage-module_isRight__IaUbc","isTop":"DotsOnImage-module_isTop__RMK49","isLeft":"DotsOnImage-module_isLeft__Q6JZ-","isBottom":"DotsOnImage-module_isBottom__c-aLe"};
595
+
596
+ const DotsOnImage = ({
597
+ block: {
598
+ optimized,
599
+ width,
600
+ height,
601
+ credit,
602
+ display,
603
+ dots
604
+ }
605
+ }) => {
606
+ const [ratio, setRatio] = React.useState(1);
607
+ const [ref, inView, entry] = reactIntersectionObserver.useInView();
608
+ const container = React.useRef(null);
609
+ const [popover, setPopover] = React.useState({
610
+ title: null,
611
+ body: null,
612
+ show: false,
613
+ id: null
614
+ });
615
+ const [visible, setVisible] = React.useState(false);
616
+ const defaultWidth = 375;
617
+ React.useEffect(() => {
618
+ if (entry && entry.boundingClientRect && entry.boundingClientRect.y < 0) {
619
+ setVisible(true);
620
+ }
621
+ }, [entry]);
622
+ React.useEffect(() => {
623
+ if (inView) {
624
+ setVisible(true);
625
+ }
626
+ }, [inView]);
627
+ React.useEffect(() => {
628
+ if (popover.id) {
629
+ document.addEventListener('click', handleClickOutside);
630
+ } else {
631
+ document.removeEventListener('click', handleClickOutside);
632
+ }
633
+ return () => document.removeEventListener('click', handleClickOutside);
634
+ }, [popover]);
635
+ React.useEffect(() => {
636
+ setDotSize();
637
+ window.addEventListener('resize', setDotSize);
638
+ return () => document.removeEventListener('resize', setDotSize);
639
+ }, [visible]);
640
+ const setDotSize = () => {
641
+ const width = window.innerWidth;
642
+ if (width < defaultWidth) {
643
+ const ratio = width / defaultWidth;
644
+ setRatio(ratio);
645
+ } else {
646
+ setRatio(1);
647
+ }
648
+ };
649
+ const handleClickOutside = event => {
650
+ const path = event.composedPath();
651
+ if (path.indexOf(container.current) === -1) {
652
+ setPopover({
653
+ show: false
654
+ });
655
+ }
656
+ };
657
+ const handleDotClick = dot => {
658
+ const shouldShow = dot.id !== popover.id;
659
+ const side = dot.position.x > 50 ? 'isLeft' : 'isRight';
660
+ const align = dot.position.y > 50 ? 'isBottom' : 'isTop';
661
+ const style = {
662
+ top: `${dot.position.y}%`,
663
+ left: `${dot.position.x}%`
664
+ };
665
+ setPopover({
666
+ title: dot.title,
667
+ body: dot.body,
668
+ show: shouldShow,
669
+ id: shouldShow ? dot.id : null,
670
+ style,
671
+ side,
672
+ align
673
+ });
674
+ };
675
+ return /*#__PURE__*/React.createElement("div", {
676
+ className: makeClassName([[styles$C.root, true], [styles$C.isVisible, visible]]),
677
+ "data-testid": "dots-on-image",
678
+ ref: ref
679
+ }, /*#__PURE__*/React.createElement(Image, {
680
+ fullscreen: false,
681
+ optimized: optimized,
682
+ width: width,
683
+ height: height,
684
+ alt: credit,
685
+ display: display
686
+ }), /*#__PURE__*/React.createElement("div", {
687
+ ref: container
688
+ }, dots.map(dot => ( /*#__PURE__*/React.createElement("div", {
689
+ className: styles$C.dot,
690
+ key: dot.id,
691
+ style: {
692
+ top: `${dot.position.y}%`,
693
+ left: `${dot.position.x}%`,
694
+ transform: `scale(${ratio}) translate(-${50 / ratio}%, -${50 / ratio}%)`
695
+ }
696
+ }, /*#__PURE__*/React.createElement("button", {
697
+ className: makeClassName([[styles$C.marker, true], [styles$C.isActive, dot.id === popover.id]]),
698
+ type: "button",
699
+ style: {
700
+ backgroundColor: dot.icon.color
701
+ },
702
+ onClick: () => handleDotClick(dot)
703
+ }, dot.icon.type === 'svg' && ( /*#__PURE__*/React.createElement("div", {
704
+ dangerouslySetInnerHTML: {
705
+ __html: dot.icon.svg_string
706
+ }
707
+ })), dot.icon.type === 'number' && dot.icon.number)))), popover.show && ( /*#__PURE__*/React.createElement(React.Fragment, null, viewportSize().width >= MediaQuerySizes.LANDSCAPE_TABLET ? ( /*#__PURE__*/React.createElement("div", {
708
+ className: makeClassName([[styles$C.popover, true], [styles$C[popover.side], !!popover.side], [styles$C[popover.align], !!popover.align]]),
709
+ style: popover.style
710
+ }, /*#__PURE__*/React.createElement(Footnote, {
711
+ onClose: () => {
712
+ setPopover({
713
+ show: false
714
+ });
715
+ }
716
+ }, popover.title && /*#__PURE__*/React.createElement("h3", null, popover.title), /*#__PURE__*/React.createElement("div", {
717
+ dangerouslySetInnerHTML: {
718
+ __html: popover.body
719
+ }
720
+ })))) : ( /*#__PURE__*/React.createElement(Popover, {
721
+ onClose: () => {
722
+ setPopover({
723
+ show: false
724
+ });
725
+ }
726
+ }, popover.title && /*#__PURE__*/React.createElement("h3", null, popover.title), /*#__PURE__*/React.createElement("div", {
727
+ dangerouslySetInnerHTML: {
728
+ __html: popover.body
729
+ }
730
+ })))))));
731
+ };
732
+
733
+ var styles$B = {"root":"Tag-module_root__sGbnM","small":"Tag-module_small__hcPrf","large":"Tag-module_large__EKMu6","dark":"Tag-module_dark__9SHCb","light":"Tag-module_light__qlfy3","gold":"Tag-module_gold__u0bzS","gray":"Tag-module_gray__eazPk","inherit":"Tag-module_inherit__z21c-","is1to1":"Tag-module_is1to1__V-fH5","is1to2":"Tag-module_is1to2__b9Obh","isInSuperBlock":"Tag-module_isInSuperBlock__wrFUY","is1to3":"Tag-module_is1to3__vZT-R","is1to4":"Tag-module_is1to4__MBh5V","slide":"Tag-module_slide__gzptP","game":"Tag-module_game__NmKec","podcastMaterial":"Tag-module_podcastMaterial__O-LBI","richRelated":"Tag-module_richRelated__Qs6Ei","isInBookRelated":"Tag-module_isInBookRelated__ikTaj","card":"Tag-module_card__TX87-","live":"Tag-module_live__ykyR7","episode":"Tag-module_episode__3OHmN","podcast":"Tag-module_podcast__K6dHn","rich":"Tag-module_rich__vPnWd","isInDynamicBlock":"Tag-module_isInDynamicBlock__WNleF","mobile":"Tag-module_mobile__19oMH","desktop":"Tag-module_desktop__cNyQs"};
734
+
735
+ const Tag = ({
736
+ children,
737
+ size = 'small',
738
+ theme = 'gold',
739
+ styleContext,
740
+ correlation,
741
+ onlyOn
742
+ }) => {
743
+ let classNames = [[styles$B.root, true], [styles$B[size], !!size && !!styles$B[size]], [styles$B[theme], !!theme && !!styles$B[theme]], [styles$B[onlyOn], !!onlyOn && !!styles$B[onlyOn]], [styles$B[correlation], !!correlation && !!styles$B[correlation]]];
744
+ if (styleContext) {
745
+ classNames = makeStyleContext(classNames, styleContext, styles$B);
746
+ }
747
+ return /*#__PURE__*/React.createElement("div", {
748
+ "data-testid": "tag",
749
+ className: makeClassName(classNames)
750
+ }, children);
751
+ };
752
+
753
+ var styles$A = {"root":"MediaCaption-module_root__1r0wu","caption":"MediaCaption-module_caption__ewfcc","credit":"MediaCaption-module_credit__7y4v8","dark":"MediaCaption-module_dark__7a9Cm","video":"MediaCaption-module_video__RDTUa","picture":"MediaCaption-module_picture__abCvw","desktop":"MediaCaption-module_desktop__e0lCY","isDark":"MediaCaption-module_isDark__IFb9X"};
754
+
755
+ const MediaCaption = ({
756
+ credit,
757
+ caption,
758
+ styleContext
759
+ }) => {
760
+ let classNames = [[styles$A.root, true]];
761
+ if (styleContext) {
762
+ classNames = makeStyleContext(classNames, styleContext, styles$A);
763
+ }
764
+ return /*#__PURE__*/React.createElement("div", {
765
+ "data-testid": "media-caption",
766
+ className: makeClassName(classNames)
767
+ }, caption && ( /*#__PURE__*/React.createElement("div", {
768
+ className: styles$A.caption,
769
+ dangerouslySetInnerHTML: {
770
+ __html: caption
771
+ }
772
+ })), credit && ( /*#__PURE__*/React.createElement("div", {
773
+ className: styles$A.credit,
774
+ dangerouslySetInnerHTML: {
775
+ __html: credit
776
+ }
777
+ })));
778
+ };
779
+
780
+ var styles$z = {"root":"Table-module_root__fRuZq","card":"Table-module_card__8r-EA","table":"Table-module_table__7Pagp","slide":"Table-module_slide__dgMPV","wrapper":"Table-module_wrapper__AP4Pz","tracks":"Table-module_tracks__mRNG0","default":"Table-module_default__nwBEg","full":"Table-module_full__YZPDz","row":"Table-module_row__9OHT3","cell":"Table-module_cell__yFdqc","fixedColumn":"Table-module_fixedColumn__O2528","white":"Table-module_white__Laj3-","gray":"Table-module_gray__FPFh0","pink":"Table-module_pink__CGkAA","blue":"Table-module_blue__b8BHs","yellow":"Table-module_yellow__YOJgu","orange":"Table-module_orange__B-i8L","green":"Table-module_green__Bt6iC","violet":"Table-module_violet__yTZd7","header":"Table-module_header__YPDzO","s":"Table-module_s__I-CeX","m":"Table-module_m__vxhDf","l":"Table-module_l__GYHhk","xs":"Table-module_xs__imR8t"};
781
+
782
+ const Table = ({
783
+ styleContext,
784
+ block: {
785
+ rows,
786
+ options,
787
+ display,
788
+ columns_widths: columnsWidth,
789
+ table_credit: tableCredit
790
+ }
791
+ }) => {
792
+ const colors = {
793
+ '#ffffff': 'white',
794
+ '#f5f5f5': 'gray',
795
+ '#feeeee': 'pink',
796
+ '#e6f3ff': 'blue',
797
+ '#fffde6': 'yellow',
798
+ '#fff9f2': 'orange',
799
+ '#e7f2ef': 'green',
800
+ '#f4f0f8': 'violet'
801
+ };
802
+ let classNames = [[styles$z.root, true], [styles$z[display], !!display && !!styles$z[display]]];
803
+ if (styleContext) {
804
+ classNames = makeStyleContext(classNames, styleContext, styles$z);
805
+ }
806
+ return /*#__PURE__*/React.createElement("div", {
807
+ "data-testid": "table",
808
+ className: makeClassName(classNames)
809
+ }, /*#__PURE__*/React.createElement("div", {
810
+ className: styles$z.wrapper
811
+ }, /*#__PURE__*/React.createElement("div", {
812
+ className: styles$z.table
813
+ }, /*#__PURE__*/React.createElement("div", {
814
+ className: styles$z.tracks
815
+ }, rows.map((row, i) => {
816
+ return /*#__PURE__*/React.createElement("div", {
817
+ key: row.key,
818
+ className: styles$z.row
819
+ }, row.cells.map((cell, j) => ( /*#__PURE__*/React.createElement("div", {
820
+ key: cell.key,
821
+ className: makeClassName([[styles$z.cell, true], [styles$z.header, options.header && i === 0], [styles$z[colors[cell.color]], true], [styles$z[columnsWidth[j]], true], [styles$z.fixedColumn, options.fixed_first_column && j === 0]]),
822
+ dangerouslySetInnerHTML: {
823
+ __html: cell.val
824
+ }
825
+ }))));
826
+ })))), tableCredit && ( /*#__PURE__*/React.createElement(MediaCaption, {
827
+ credit: tableCredit,
828
+ styleContext: styleContext
829
+ })));
830
+ };
831
+
832
+ var styles$y = {"root":"MaterialNote-module_root__99HSA","dark":"MaterialNote-module_dark__etjym","note_credit":"MaterialNote-module_note_credit__J1skG","note_caption":"MaterialNote-module_note_caption__G2Ad0","center":"MaterialNote-module_center__mDLEO","default":"MaterialNote-module_default__ozgd7","card":"MaterialNote-module_card__EVuZe","slide":"MaterialNote-module_slide__mg8XV","game":"MaterialNote-module_game__c-r0n","gameSurvey":"MaterialNote-module_gameSurvey__azhu6"};
833
+
834
+ const MaterialNote = ({
835
+ block: {
836
+ data
837
+ },
838
+ styleContext
839
+ }) => {
840
+ let classNames = [[styles$y.root, true]];
841
+ if (styleContext) {
842
+ classNames = makeStyleContext(classNames, styleContext, styles$y);
843
+ }
844
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
845
+ "data-testid": "material-note",
846
+ className: makeClassName(classNames)
847
+ }, data && data.map(item => ( /*#__PURE__*/React.createElement("p", {
848
+ className: styles$y[item.type],
849
+ key: item.id,
850
+ dangerouslySetInnerHTML: {
851
+ __html: item.data
852
+ }
853
+ })))));
854
+ };
855
+
856
+ var styles$x = {"root":"BookmarkButton-module_root__A-75w","control":"BookmarkButton-module_control__-xy5O","dark":"BookmarkButton-module_dark__GkMEC","light":"BookmarkButton-module_light__1W6tx","isInBookmarks":"BookmarkButton-module_isInBookmarks__YSjjj","isInGrid":"BookmarkButton-module_isInGrid__Desh-"};
857
+
858
+ const BookmarkButton = ({
859
+ styleContext,
860
+ theme,
861
+ isInBookmarks,
862
+ onClick
863
+ }) => {
864
+ let classNames = [[styles$x.root, true], [styles$x.isInBookmarks, isInBookmarks], [styles$x[theme], !!theme && !!styles$x[theme]]];
865
+ if (styleContext) {
866
+ classNames = makeStyleContext(classNames, styleContext, styles$x);
867
+ }
868
+ return /*#__PURE__*/React.createElement("div", {
869
+ "data-testid": "bookmark-button",
870
+ className: makeClassName(classNames)
871
+ }, /*#__PURE__*/React.createElement("button", {
872
+ className: styles$x.control,
873
+ onClick: () => onClick(),
874
+ type: "button"
875
+ }, /*#__PURE__*/React.createElement(SvgSymbol, {
876
+ icon: "bookmark",
877
+ size: "unset"
878
+ })));
879
+ };
880
+
881
+ var styles$w = {"root":"MaterialTitle-module_root__VSphO","primary":"MaterialTitle-module_primary__XGnpb","secondary":"MaterialTitle-module_secondary__7IDEp"};
882
+
883
+ const Primary = ({
884
+ children
885
+ }) => {
886
+ return /*#__PURE__*/React.createElement("span", {
887
+ className: styles$w.primary
888
+ }, children);
889
+ };
890
+ const Secondary = ({
891
+ children
892
+ }) => {
893
+ return /*#__PURE__*/React.createElement("span", {
894
+ className: styles$w.secondary
895
+ }, children);
896
+ };
897
+ const MaterialTitle = ({
898
+ children
899
+ }) => {
900
+ return /*#__PURE__*/React.createElement("h1", {
901
+ className: styles$w.root,
902
+ "data-testid": "material-title"
903
+ }, children);
904
+ };
905
+
906
+ var styles$v = {"root":"Dropdown-module_root__Wv7S-","menu":"Dropdown-module_menu__11IQL","inactive":"Dropdown-module_inactive__E5CP6","isInAudioPanel":"Dropdown-module_isInAudioPanel__UniSV"};
907
+
908
+ const Menu = ({
909
+ children
910
+ }) => {
911
+ return /*#__PURE__*/React.createElement("div", {
912
+ "data-testid": "dropdown",
913
+ className: styles$v.menu
914
+ }, children);
915
+ };
916
+ const Dropdown = ({
917
+ children,
918
+ active,
919
+ styleContext
920
+ }) => {
921
+ let classNames = [[styles$v.root, true], [styles$v.inactive, !active && styleContext === 'isPodcastSeason' && !!styles$v.inactive]];
922
+ if (styleContext) {
923
+ classNames = makeStyleContext(classNames, styleContext, styles$v);
924
+ }
925
+ return /*#__PURE__*/React.createElement("div", {
926
+ "data-testid": "dropdown",
927
+ className: makeClassName(classNames)
928
+ }, children);
929
+ };
930
+
931
+ var styles$u = {"root":"Toolbar-module_root__RnmlI","list":"Toolbar-module_list__-IhdP","item":"Toolbar-module_item__CWmGM","isInTopbar":"Toolbar-module_isInTopbar__WEDi8","center":"Toolbar-module_center__pvdiJ","game":"Toolbar-module_game__etwIA","gameSurvey":"Toolbar-module_gameSurvey__v4D31","slide":"Toolbar-module_slide__PtB3l","card":"Toolbar-module_card__Lutyq","isDark":"Toolbar-module_isDark__MG6Ar","dark":"Toolbar-module_dark__a9sgz"};
932
+
933
+ const ToolbarItem = ({
934
+ children
935
+ }) => {
936
+ return /*#__PURE__*/React.createElement("li", {
937
+ className: styles$u.item
938
+ }, children);
939
+ };
940
+
941
+ const Toolbar = ({
942
+ children,
943
+ styleContext
944
+ }) => {
945
+ let classNames = [[styles$u.root, true]];
946
+ if (styleContext) {
947
+ classNames = makeStyleContext(classNames, styleContext, styles$u);
948
+ }
949
+ return /*#__PURE__*/React.createElement("div", {
950
+ "data-testid": "toolbar",
951
+ className: makeClassName(classNames)
952
+ }, /*#__PURE__*/React.createElement("ul", {
953
+ className: styles$u.list
954
+ }, children));
955
+ };
956
+
957
+ var styles$t = {"root":"Meta-module_root__H-Q4d","rich":"Meta-module_rich__dCkJK","podcast":"Meta-module_podcast__MI8gD","episode":"Meta-module_episode__0n9CF","simple":"Meta-module_simple__tztcr","slide":"Meta-module_slide__3OyIN","card":"Meta-module_card__2vqfN","game":"Meta-module_game__HNcgr","isInMaterial":"Meta-module_isInMaterial__vKcTK","isInSearchItem":"Meta-module_isInSearchItem__ENqHo","isInMediaBlock":"Meta-module_isInMediaBlock__TENZG","center":"Meta-module_center__seHro","half":"Meta-module_half__aoa9h","podcastMaterial":"Meta-module_podcastMaterial__GTPyD","light":"Meta-module_light__oW3kc","dark":"Meta-module_dark__tLQNJ","isDark":"Meta-module_isDark__xSl1J","hasSource":"Meta-module_hasSource__OZJ0y","bookmark":"Meta-module_bookmark__jcFWn","isInBookRelated":"Meta-module_isInBookRelated__Ohidg","mobile":"Meta-module_mobile__PbG8N","desktop":"Meta-module_desktop__W5AB7"};
958
+
959
+ const Meta = ({
960
+ hasSource,
961
+ theme,
962
+ children,
963
+ onlyOn,
964
+ styleContext
965
+ }) => {
966
+ let classNames = [[styles$t.root, true], [styles$t[theme], !!theme && !!styles$t[theme]], [styles$t[onlyOn], !!onlyOn], [styles$t.hasSource, hasSource]];
967
+ if (styleContext) {
968
+ classNames = makeStyleContext(classNames, styleContext, styles$t);
969
+ }
970
+ return /*#__PURE__*/React.createElement("div", {
971
+ "data-testid": "meta",
972
+ className: makeClassName(classNames)
973
+ }, children);
974
+ };
975
+
976
+ var styles$s = {"root":"Timestamp-module_root__jPJ6w"};
977
+
978
+ const Timestamp = ({
979
+ publishedAt,
980
+ locale = 'ru',
981
+ type
982
+ }) => {
983
+ let published;
984
+ const timeFormat = locale === 'ru' ? 'HH:mm, D MMMM YYYY' : 'h:mm a, MMMM D, YYYY';
985
+ const preparedPublishedAt = publishedAt * 1000;
986
+ dayjs.locale(locale);
987
+ dayjs.extend(relativeTime);
988
+ if (type === 'fromNow') {
989
+ published = dayjs(preparedPublishedAt).fromNow();
990
+ } else if (type === 'format') {
991
+ published = dayjs(preparedPublishedAt).format('HH:mm');
992
+ } else if (type === 'date') {
993
+ published = dayjs(preparedPublishedAt).format(timeFormat);
994
+ } else {
995
+ throw new Error('Unknown time type');
996
+ }
997
+ return /*#__PURE__*/React.createElement("time", {
998
+ suppressHydrationWarning: true,
999
+ "data-testid": "timestamp",
1000
+ className: styles$s.root
1001
+ }, published);
1002
+ };
1003
+
1004
+ const DangerousHTML = ({
1005
+ className = '',
1006
+ tagName: TagName = 'div',
1007
+ html
1008
+ }) => {
1009
+ const element = React.useRef(null);
1010
+ const [canRenderHtml, setCanRenderHtml] = React.useState(false);
1011
+ React.useEffect(() => {
1012
+ setCanRenderHtml(true);
1013
+ }, []);
1014
+ const replaceScriptElementsRecursive = React.useCallback(node => {
1015
+ if (node.tagName === 'SCRIPT' && (!node.id || node.id.indexOf('script-') !== 0)) {
1016
+ const script = document.createElement('script');
1017
+ script.id = `script-${Math.random().toString(16).slice(2)}`;
1018
+ script.innerHTML = node.innerHTML;
1019
+ const attrs = node.attributes;
1020
+ for (let i = 0; i < attrs.length; i += 1) {
1021
+ const {
1022
+ name,
1023
+ value
1024
+ } = attrs[i];
1025
+ script.setAttribute(name, value);
1026
+ }
1027
+ node.parentElement.replaceChild(script, node);
1028
+ } else {
1029
+ let i = 0;
1030
+ const children = node.childNodes;
1031
+ while (i < children.length) {
1032
+ replaceScriptElementsRecursive(children[i]);
1033
+ i += 1;
1034
+ }
1035
+ }
1036
+ }, []);
1037
+ const prepareAnchors = React.useCallback(() => {
1038
+ const anchors = Array.from(element.current.querySelectorAll('a'));
1039
+ anchors.forEach(a => {
1040
+ a.setAttribute('target', '_blank');
1041
+ });
1042
+ }, []);
1043
+ React.useEffect(() => {
1044
+ if (canRenderHtml && html.indexOf('script') > -1 && element.current.firstElementChild) {
1045
+ element.current.firstElementChild.innerHTML = html;
1046
+ replaceScriptElementsRecursive(element.current.firstElementChild);
1047
+ prepareAnchors();
1048
+ }
1049
+ }, [canRenderHtml, element, html, replaceScriptElementsRecursive, prepareAnchors]);
1050
+ return /*#__PURE__*/React.createElement("div", {
1051
+ ref: element
1052
+ }, /*#__PURE__*/React.createElement(TagName, {
1053
+ className: className,
1054
+ dangerouslySetInnerHTML: {
1055
+ __html: html
1056
+ }
1057
+ }));
1058
+ };
1059
+
1060
+ var styles$r = {"root":"EmbedBlock-module_root__wNZlD","object":"EmbedBlock-module_object__DONQ0","objectWrap":"EmbedBlock-module_objectWrap__qpbni","gameEmbed":"EmbedBlock-module_gameEmbed__tO5Ha","proportional":"EmbedBlock-module_proportional__zDPfm","default":"EmbedBlock-module_default__np8MO","xs":"EmbedBlock-module_xs__PNHGz","full":"EmbedBlock-module_full__Gmz7o","super_full":"EmbedBlock-module_super_full__-h382","figure":"EmbedBlock-module_figure__fNZB-","dark":"EmbedBlock-module_dark__S2R9f","isInGroupedBlock":"EmbedBlock-module_isInGroupedBlock__Wjj7k","control":"EmbedBlock-module_control__9bJUa","raw_html":"EmbedBlock-module_raw_html__EfYVy","mobileFullwidth":"EmbedBlock-module_mobileFullwidth__1MDT5","isInCard":"EmbedBlock-module_isInCard__WnLHG","isInSlide":"EmbedBlock-module_isInSlide__BtdnY","cc":"EmbedBlock-module_cc__Gyw44","isInSensitiveBlock":"EmbedBlock-module_isInSensitiveBlock__nYajZ","isInAnswer":"EmbedBlock-module_isInAnswer__WuZ0H","picture":"EmbedBlock-module_picture__Weamy","wrapper":"EmbedBlock-module_wrapper__ynT7R","mobile":"EmbedBlock-module_mobile__lEuww","desktop":"EmbedBlock-module_desktop__599S7"};
1061
+
1062
+ const EmbedGif = ({
1063
+ gif,
1064
+ mp4Url,
1065
+ style
1066
+ }) => {
1067
+ const [videoFrozen, setVideoFrozen] = React.useState(false);
1068
+ const videoElem = React.useRef(null);
1069
+ const handleVideoTouch = () => {
1070
+ videoElem.current.play();
1071
+ setVideoFrozen(false);
1072
+ };
1073
+ const handleVideoError = () => {
1074
+ const video = videoElem.current;
1075
+ video.setAttribute('poster', video.dataset.gif);
1076
+ setVideoFrozen(false);
1077
+ };
1078
+ React.useEffect(() => {
1079
+ const video = videoElem.current;
1080
+ const {
1081
+ width: viewportWidth
1082
+ } = viewportSize();
1083
+ if (viewportWidth >= MediaQuerySizes.MOBILE) {
1084
+ video.setAttribute('autoplay', true);
1085
+ video.play();
1086
+ } else {
1087
+ setVideoFrozen(true);
1088
+ video.pause();
1089
+ video.addEventListener('touchstart', handleVideoTouch);
1090
+ }
1091
+ video.addEventListener('error', handleVideoError);
1092
+ return () => {
1093
+ video.removeEventListener('touchstart', handleVideoTouch);
1094
+ video.removeEventListener('error', handleVideoError);
1095
+ };
1096
+ }, []);
1097
+ return /*#__PURE__*/React.createElement("div", {
1098
+ className: styles$r.figure
1099
+ }, /*#__PURE__*/React.createElement("div", {
1100
+ className: styles$r.objectWrap,
1101
+ style: style,
1102
+ "data-frozen": videoFrozen
1103
+ }, /*#__PURE__*/React.createElement("video", {
1104
+ playsInline: true,
1105
+ muted: true,
1106
+ loop: true,
1107
+ autoPlay: true,
1108
+ preload: "metadata",
1109
+ "data-gif": gif,
1110
+ ref: videoElem
1111
+ }, /*#__PURE__*/React.createElement("source", {
1112
+ src: `https://meduza.io${mp4Url}`,
1113
+ type: "video/mp4"
1114
+ }))));
1115
+ };
1116
+
1117
+ const EmbedBlock = ({
1118
+ block,
1119
+ block: {
1120
+ data,
1121
+ data: {
1122
+ html,
1123
+ display,
1124
+ only_on: onlyOn,
1125
+ provider,
1126
+ cc,
1127
+ optimized,
1128
+ small_url: small,
1129
+ large_url: large,
1130
+ gif_url: gifUrl,
1131
+ mp4_url: mp4Url
1132
+ }
1133
+ },
1134
+ styleContext,
1135
+ children
1136
+ }) => {
1137
+ const [isPopoverShown, setIsPopoverShown] = React.useState(false);
1138
+ const style = {};
1139
+ const isProportional = block.data.height && block.data.width;
1140
+ const fullWidthProviders = ['youtube', 'vimeo', 'onetv', 'coub', 'meduza', 'facebook_video'];
1141
+ const mobileFullwidth = fullWidthProviders.indexOf(provider) > -1 || block.type === 'dots_on_image';
1142
+ const renderCC = context => ( /*#__PURE__*/React.createElement(MediaCaption, {
1143
+ credit: data.credit,
1144
+ caption: data.caption,
1145
+ styleContext: context || styleContext
1146
+ }));
1147
+ const renderEmbed = style => {
1148
+ switch (block.type) {
1149
+ case 'gif':
1150
+ {
1151
+ return /*#__PURE__*/React.createElement(EmbedGif, {
1152
+ gif: gifUrl,
1153
+ mp4Url: mp4Url,
1154
+ style: style
1155
+ });
1156
+ }
1157
+ case 'image':
1158
+ {
1159
+ return /*#__PURE__*/React.createElement("div", {
1160
+ className: styles$r.figure
1161
+ }, /*#__PURE__*/React.createElement(Image, {
1162
+ source: !optimized && [small, large],
1163
+ optimized: block.data.optimized,
1164
+ width: block.data.width,
1165
+ height: block.data.height,
1166
+ alt: block.data.caption,
1167
+ display: block.data.display,
1168
+ lazy: block.data.lazy,
1169
+ styleContext: styleContext
1170
+ }));
1171
+ }
1172
+ case 'game_embed':
1173
+ {
1174
+ return /*#__PURE__*/React.createElement("div", {
1175
+ className: styles$r.gameEmbed
1176
+ }, /*#__PURE__*/React.createElement("iframe", {
1177
+ src: block.data.game_src,
1178
+ id: block.data.game_id,
1179
+ title: "Game embed"
1180
+ }));
1181
+ }
1182
+ case 'dots_on_image':
1183
+ {
1184
+ return /*#__PURE__*/React.createElement("div", {
1185
+ className: styles$r.figure
1186
+ }, /*#__PURE__*/React.createElement(DotsOnImage, {
1187
+ block: data
1188
+ }));
1189
+ }
1190
+ default:
1191
+ {
1192
+ return /*#__PURE__*/React.createElement("div", {
1193
+ className: styles$r.object
1194
+ }, /*#__PURE__*/React.createElement("div", {
1195
+ className: styles$r.wrapper,
1196
+ style: style
1197
+ }, /*#__PURE__*/React.createElement(DangerousHTML, {
1198
+ className: styles$r.objectWrap,
1199
+ html: html
1200
+ })));
1201
+ }
1202
+ }
1203
+ };
1204
+ if (isProportional) {
1205
+ style.paddingBottom = `${block.data.height / block.data.width * 100}%`;
1206
+ style.height = 0;
1207
+ }
1208
+ let classNames = [[styles$r.root, true], [styles$r.cc, cc], [styles$r[display], !!display && styles$r[display]], [styles$r[provider], !!provider && !!styles$r[provider]], [styles$r[onlyOn], !!onlyOn && styles$r[onlyOn]], [styles$r.mobileFullwidth, mobileFullwidth], [styles$r.proportional, isProportional]];
1209
+ // Убираем из контекста все, что не начинается с приставки isIn,
1210
+ // чтобы не применились лишние модификаторы
1211
+ // TODO: в w6 модификаторы должны передаваться явно
1212
+ if (styleContext && Array.isArray(styleContext)) {
1213
+ const filteredContext = styleContext.filter(key => key.startsWith('isIn') && styles$r[key]).reduce((acc, key) => {
1214
+ acc.push(key);
1215
+ return acc;
1216
+ }, []);
1217
+ classNames = makeStyleContext(classNames, filteredContext, styles$r);
1218
+ }
1219
+ return /*#__PURE__*/React.createElement("figure", {
1220
+ className: makeClassName(classNames)
1221
+ }, children && ( /*#__PURE__*/React.createElement("div", {
1222
+ className: styles$r.object
1223
+ }, /*#__PURE__*/React.createElement("div", {
1224
+ className: styles$r.wrapper,
1225
+ style: style
1226
+ }, /*#__PURE__*/React.createElement("div", {
1227
+ className: styles$r.objectWrap
1228
+ }, children)))), !children && renderEmbed(style), cc === 'default' && /*#__PURE__*/React.createElement("figcaption", null, renderCC()), cc === 'button' && ( /*#__PURE__*/React.createElement("button", {
1229
+ className: styles$r.control,
1230
+ type: "button",
1231
+ "aria-label": "Open",
1232
+ onClick: () => {
1233
+ setIsPopoverShown(!isPopoverShown);
1234
+ }
1235
+ })), cc === 'button' && isPopoverShown && ( /*#__PURE__*/React.createElement(Popover, {
1236
+ onClose: () => {
1237
+ setIsPopoverShown(false);
1238
+ }
1239
+ }, renderCC('isInPopover'))));
1240
+ };
1241
+
1242
+ const IframeBlock = ({
1243
+ block,
1244
+ block: {
1245
+ id
1246
+ },
1247
+ styleContext,
1248
+ lang = 'ru'
1249
+ }) => {
1250
+ const element = React.useRef(null);
1251
+ const renderIframe = () => {
1252
+ const rootEl = document.createElement('div');
1253
+ const contentEl = document.createElement('div');
1254
+ const scriptEl = document.createElement('script');
1255
+ const style = document.createElement('style');
1256
+ const range = document.createRange();
1257
+ range.setStart(contentEl, 0);
1258
+ contentEl.setAttribute('id', 'content');
1259
+ scriptEl.textContent = `
1260
+ function getDocHeight() {
1261
+ var doc = document;
1262
+ var body = doc.body;
1263
+ var html = doc.documentElement;
1264
+ var height = Math.max( body.scrollHeight, body.offsetHeight,
1265
+ html.clientHeight, html.scrollHeight, html.offsetHeight );
1266
+
1267
+ doc.body.style.margin="0";
1268
+
1269
+ return document.getElementById('content') ? document.getElementById('content').offsetHeight : height;
1270
+ }
1271
+
1272
+ function sendDocHeightMsg() {
1273
+ var height = getDocHeight();
1274
+ var message = JSON.stringify({
1275
+ action: {
1276
+ type: "UPDATE_HEIGHT",
1277
+ payload: {
1278
+ id: "${block.id}",
1279
+ height: height
1280
+ }
1281
+ }
1282
+ });
1283
+ parent.postMessage("mdzMaterialEmbedHeight=" + message, '*');
1284
+ }
1285
+
1286
+ setInterval(sendDocHeightMsg, 300);
1287
+ `;
1288
+ style.type = 'text/css';
1289
+ style.innerHTML = block.type === 'embed_code' ? '.twitter-tweet { padding-top: 15px; margin: 0 !important; }' : '.twitter-tweet { margin: 0 !important; } .fb-post { display: block; } .instagram-media { min-width: 0 !important; }';
1290
+ contentEl.appendChild(range.createContextualFragment(block.data.html));
1291
+ rootEl.appendChild(scriptEl);
1292
+ rootEl.appendChild(contentEl);
1293
+ contentEl.appendChild(style);
1294
+ const frame = element.current.querySelector('iframe').contentDocument;
1295
+ frame.open();
1296
+ frame.close();
1297
+ frame.documentElement.setAttribute('lang', lang);
1298
+ frame.body.appendChild(rootEl);
1299
+ };
1300
+ React.useEffect(() => {
1301
+ renderIframe();
1302
+ }, []);
1303
+ return /*#__PURE__*/React.createElement(EmbedBlock, {
1304
+ block: block,
1305
+ styleContext: styleContext
1306
+ }, /*#__PURE__*/React.createElement("div", {
1307
+ ref: element,
1308
+ dangerouslySetInnerHTML: {
1309
+ __html: `<iframe id=${id} frameBorder="0" scrolling="no"></iframe>`
1310
+ }
1311
+ }));
1312
+ };
1313
+
1314
+ const EmbedBlockContainer = ({
1315
+ block,
1316
+ styleContext,
1317
+ lang
1318
+ }) => {
1319
+ if (block.data && block.data.wrap_with_iframe) {
1320
+ return /*#__PURE__*/React.createElement(IframeBlock, {
1321
+ block: block,
1322
+ styleContext: styleContext,
1323
+ lang: lang
1324
+ });
1325
+ }
1326
+ return /*#__PURE__*/React.createElement(EmbedBlock, {
1327
+ block: block,
1328
+ styleContext: styleContext
1329
+ });
1330
+ };
1331
+
1332
+ var styles$q = {"root":"QuoteBlock-module_root__4qa1J","center":"QuoteBlock-module_center__1f83y"};
1333
+
1334
+ const QuoteBlock = ({
1335
+ block: {
1336
+ data
1337
+ },
1338
+ styleContext
1339
+ }) => {
1340
+ let classNames = [[styles$q.root, true]];
1341
+ if (styleContext) {
1342
+ classNames = makeStyleContext(classNames, styleContext, styles$q);
1343
+ }
1344
+ return /*#__PURE__*/React.createElement("div", {
1345
+ "data-testid": "quote-block",
1346
+ className: makeClassName(classNames)
1347
+ }, /*#__PURE__*/React.createElement("p", {
1348
+ dangerouslySetInnerHTML: {
1349
+ __html: data
1350
+ }
1351
+ }));
1352
+ };
1353
+
1354
+ var styles$p = {"root":"CardTitle-module_root__Pvx--","index":"CardTitle-module_index__Keled","title":"CardTitle-module_title__Lkflo","mobile":"CardTitle-module_mobile__6N3hB","desktop":"CardTitle-module_desktop__sBokS"};
1355
+
1356
+ const CardTitle = ({
1357
+ block: {
1358
+ data: {
1359
+ only_on: onlyOn,
1360
+ index,
1361
+ text
1362
+ },
1363
+ id
1364
+ },
1365
+ styleContext
1366
+ }) => {
1367
+ return /*#__PURE__*/React.createElement("div", {
1368
+ "data-testid": "card-title",
1369
+ id: id,
1370
+ className: makeClassName([[styles$p.root, true], [styles$p[onlyOn], !!onlyOn], [styles$p[styleContext], !!styleContext && !!styles$p[styleContext]]])
1371
+ }, /*#__PURE__*/React.createElement("div", {
1372
+ className: styles$p.index
1373
+ }, index), /*#__PURE__*/React.createElement("h3", {
1374
+ className: styles$p.title
1375
+ }, text));
1376
+ };
1377
+
1378
+ var styles$o = {"root":"ChapterBlock-module_root__iw7d2","subtitle":"ChapterBlock-module_subtitle__IpWgz","mobile":"ChapterBlock-module_mobile__V1Eye","desktop":"ChapterBlock-module_desktop__9xWf4"};
1379
+
1380
+ const ChapterBlock = ({
1381
+ block: {
1382
+ data,
1383
+ only_on: onlyOn
1384
+ },
1385
+ styleContext,
1386
+ id
1387
+ }) => {
1388
+ return /*#__PURE__*/React.createElement("div", {
1389
+ "data-testid": "chapter-block",
1390
+ id: id,
1391
+ className: makeClassName([[styles$o.root, true], [styles$o[onlyOn], !!onlyOn]])
1392
+ }, /*#__PURE__*/React.createElement("div", {
1393
+ className: makeClassName([[styles$o.subtitle, true], [styles$o[styleContext], !!styleContext && !!styles$o[styleContext]]]),
1394
+ dangerouslySetInnerHTML: {
1395
+ __html: data
1396
+ }
1397
+ }));
1398
+ };
1399
+
1400
+ const generateGradient = (color, type) => {
1401
+ const steps = {
1402
+ mediaBlockBottom: [[0, 7], [0.08, 12], [0.16, 17], [0.22, 21], [0.32, 26], [0.42, 32], [0.52, 38], [0.62, 47], [0.72, 57], [0.82, 65], [1, 82]],
1403
+ mediaBlockTop: [[0.5, 0], [0, 97]]
1404
+ };
1405
+ const gradient = steps[type].map(i => `rgba(${color}, ${i[0]}) ${i[1]}%`);
1406
+ return `linear-gradient(-180deg, ${gradient})`;
1407
+ };
1408
+
1409
+ var styles$n = {"root":"SimpleTitle-module_root__YOzNn","mobile":"SimpleTitle-module_mobile__1QiJd","desktop":"SimpleTitle-module_desktop__ZF5Af"};
1410
+
1411
+ const SimpleTitle = ({
1412
+ block: {
1413
+ data: {
1414
+ first
1415
+ },
1416
+ only_on: onlyOn
1417
+ },
1418
+ styleContext
1419
+ }) => {
1420
+ let classNames = [[styles$n.root, true], [styles$n[onlyOn], true]];
1421
+ if (styleContext) {
1422
+ classNames = makeStyleContext(classNames, styleContext, styles$n);
1423
+ }
1424
+ return /*#__PURE__*/React.createElement("h1", {
1425
+ "data-testid": "simple-title",
1426
+ className: makeClassName(classNames)
1427
+ }, first);
1428
+ };
1429
+
1430
+ var styles$m = {"root":"RichTitle-module_root__U5XQu","slide":"RichTitle-module_slide__eU9Ob","game":"RichTitle-module_game__S1csb","podcastMaterial":"RichTitle-module_podcastMaterial__AulVF","half":"RichTitle-module_half__yBMby","featured":"RichTitle-module_featured__ULNQn","isInMediaBlock":"RichTitle-module_isInMediaBlock__2h6rl","isInBookRelated":"RichTitle-module_isInBookRelated__LcCPV","mobile":"RichTitle-module_mobile__W5L9E","desktop":"RichTitle-module_desktop__k0PkC"};
1431
+
1432
+ const RichTitle = ({
1433
+ block: {
1434
+ only_on: onlyOn,
1435
+ data: {
1436
+ featured,
1437
+ first,
1438
+ second,
1439
+ as: TagName = 'h1'
1440
+ }
1441
+ },
1442
+ styleContext
1443
+ }) => {
1444
+ let classNames = [[styles$m.root, true], [styles$m[onlyOn], true], [styles$m.featured, !!featured]];
1445
+ if (styleContext) {
1446
+ classNames = makeStyleContext(classNames, styleContext, styles$m);
1447
+ }
1448
+ return /*#__PURE__*/React.createElement(TagName, {
1449
+ "data-testid": "rich-title",
1450
+ className: makeClassName(classNames)
1451
+ }, first, second && /*#__PURE__*/React.createElement("span", null, " ", second));
1452
+ };
1453
+
1454
+ var styles$l = {"p":"SimpleBlock-module_p__7aRnT","h2":"SimpleBlock-module_h2__aWlMn","h3":"SimpleBlock-module_h3__uPh0-","h4":"SimpleBlock-module_h4__MxGXA","lead":"SimpleBlock-module_lead__NzEPT","lead_hr":"SimpleBlock-module_lead_hr__XN0rm","context_p":"SimpleBlock-module_context_p__Mdu1R","blockquote":"SimpleBlock-module_blockquote__nX-Ab","game":"SimpleBlock-module_game__uVeJJ","slide":"SimpleBlock-module_slide__MaaUF","dark":"SimpleBlock-module_dark__qtLhq","divider":"SimpleBlock-module_divider__-VXBu","isInIntro":"SimpleBlock-module_isInIntro__UOePf","center":"SimpleBlock-module_center__D1CsV","isInImportantLead":"SimpleBlock-module_isInImportantLead__qzKDo","podcastMaterial":"SimpleBlock-module_podcastMaterial__XEMjh","isInAnswer":"SimpleBlock-module_isInAnswer__Asx7d","mobile":"SimpleBlock-module_mobile__EVGYJ","desktop":"SimpleBlock-module_desktop__6ZH5e","isDark":"SimpleBlock-module_isDark__ehYKr"};
1455
+
1456
+ const SimpleBlock = ({
1457
+ block: {
1458
+ data,
1459
+ type,
1460
+ only_on: onlyOn
1461
+ },
1462
+ styleContext,
1463
+ id = null
1464
+ }) => {
1465
+ let TagName;
1466
+ let classNames = [[styles$l[type], !!type && !!styles$l[type]], [styles$l[onlyOn], true]];
1467
+ if (styleContext) {
1468
+ classNames = makeStyleContext(classNames, styleContext, styles$l);
1469
+ }
1470
+ switch (type) {
1471
+ case 'context_p':
1472
+ case 'lead':
1473
+ case 'note_caption':
1474
+ case 'note_credit':
1475
+ {
1476
+ TagName = 'p';
1477
+ break;
1478
+ }
1479
+ case 'divider':
1480
+ return /*#__PURE__*/React.createElement("hr", {
1481
+ className: makeClassName(classNames)
1482
+ });
1483
+ case 'lead_hr':
1484
+ {
1485
+ TagName = 'div';
1486
+ break;
1487
+ }
1488
+ default:
1489
+ TagName = type;
1490
+ }
1491
+ return /*#__PURE__*/React.createElement(TagName, {
1492
+ className: makeClassName(classNames),
1493
+ dangerouslySetInnerHTML: {
1494
+ __html: data
1495
+ },
1496
+ id: id
1497
+ });
1498
+ };
1499
+
1500
+ var styles$k = {"root":"ListBlock-module_root__dqomP","ol":"ListBlock-module_ol__1l6nP","ul":"ListBlock-module_ul__bgHlv","center":"ListBlock-module_center__bEBN-","isInImportantLead":"ListBlock-module_isInImportantLead__ewcD1","dark":"ListBlock-module_dark__NzpYz","mobile":"ListBlock-module_mobile__qEBsn","desktop":"ListBlock-module_desktop__HN0IU"};
1501
+
1502
+ const ListBlock = ({
1503
+ block: {
1504
+ type,
1505
+ data,
1506
+ only_on: onlyOn
1507
+ },
1508
+ styleContext
1509
+ }) => {
1510
+ const TagName = type;
1511
+ let classNames = [[styles$k.root, true], [styles$k[onlyOn], true], [styles$k[type], !!type && !!styles$k[type]]];
1512
+ if (styleContext) {
1513
+ classNames = makeStyleContext(classNames, styleContext, styles$k);
1514
+ }
1515
+ return /*#__PURE__*/React.createElement(TagName, {
1516
+ className: makeClassName(classNames),
1517
+ "data-testid": "list-block"
1518
+ }, data.map((item, index) => ( /*#__PURE__*/React.createElement("li", {
1519
+ key: index,
1520
+ dangerouslySetInnerHTML: {
1521
+ __html: item
1522
+ }
1523
+ }))));
1524
+ };
1525
+
1526
+ var styles$j = {"root":"RelatedBlock-module_root__cr1c-","header":"RelatedBlock-module_header__bfUJD","items":"RelatedBlock-module_items__rzzam","rich":"RelatedBlock-module_rich__1cWdn","first":"RelatedBlock-module_first__ZkcP5","simple":"RelatedBlock-module_simple__m22bj","center":"RelatedBlock-module_center__WVpIJ","isInSlideMaterial":"RelatedBlock-module_isInSlideMaterial__VumDw","mobile":"RelatedBlock-module_mobile__AScBA","desktop":"RelatedBlock-module_desktop__uMXUY"};
1527
+
1528
+ const RelatedBlock = ({
1529
+ block: {
1530
+ data: {
1531
+ title,
1532
+ related
1533
+ },
1534
+ only_on: onlyOn
1535
+ },
1536
+ styleContext
1537
+ }) => {
1538
+ let classNames = [[styles$j.root, true], [styles$j[onlyOn], true]];
1539
+ if (styleContext) {
1540
+ classNames = makeStyleContext(classNames, styleContext, styles$j);
1541
+ }
1542
+ return /*#__PURE__*/React.createElement("div", {
1543
+ "data-testid": "related-block",
1544
+ className: makeClassName(classNames)
1545
+ }, /*#__PURE__*/React.createElement("h3", {
1546
+ className: styles$j.header
1547
+ }, title), /*#__PURE__*/React.createElement("ul", {
1548
+ className: styles$j.items
1549
+ }, related.map((item, index) => ( /*#__PURE__*/React.createElement("li", {
1550
+ key: item.id || index,
1551
+ className: styles$j[item.layout]
1552
+ }, /*#__PURE__*/React.createElement(reactRouterDom.Link, {
1553
+ to: item.full_url || `/${item.url}`
1554
+ }, /*#__PURE__*/React.createElement("span", {
1555
+ className: styles$j.first
1556
+ }, item.title), item.second_title && ' ', item.second_title && /*#__PURE__*/React.createElement("span", null, item.second_title)))))));
1557
+ };
1558
+
1559
+ var styles$i = {"root":"SourceBlock-module_root__9dnI4","text":"SourceBlock-module_text__M5-uy","origin":"SourceBlock-module_origin__fyvxH","center":"SourceBlock-module_center__UOMwy","mobile":"SourceBlock-module_mobile__QVEyg","desktop":"SourceBlock-module_desktop__xdXWm","isDark":"SourceBlock-module_isDark__etwk1"};
1560
+
1561
+ const SourceBlock = ({
1562
+ block: {
1563
+ only_on: onlyOn,
1564
+ data: {
1565
+ quote,
1566
+ origin,
1567
+ url
1568
+ }
1569
+ },
1570
+ styleContext
1571
+ }) => {
1572
+ let classNames = [[styles$i.root, true], [styles$i[onlyOn], true]];
1573
+ if (styleContext) {
1574
+ classNames = makeStyleContext(classNames, styleContext, styles$i);
1575
+ }
1576
+ return /*#__PURE__*/React.createElement("blockquote", {
1577
+ "data-testid": "source-block",
1578
+ cite: url,
1579
+ className: makeClassName(classNames)
1580
+ }, /*#__PURE__*/React.createElement("a", {
1581
+ className: styles$i.text,
1582
+ href: url,
1583
+ target: "_blank",
1584
+ rel: "noopener noreferrer"
1585
+ }, quote.map((item, index) => ( /*#__PURE__*/React.createElement("p", {
1586
+ key: index,
1587
+ dangerouslySetInnerHTML: {
1588
+ __html: item.data
1589
+ }
1590
+ }))), /*#__PURE__*/React.createElement("footer", null, /*#__PURE__*/React.createElement("cite", {
1591
+ className: styles$i.origin
1592
+ }, origin))));
1593
+ };
1594
+
1595
+ var styles$h = {"root":"SensitiveBlock-module_root__1Nl9-","container":"SensitiveBlock-module_container__GE2tW","overlay":"SensitiveBlock-module_overlay__tEsK8","content":"SensitiveBlock-module_content__RYbdd","button":"SensitiveBlock-module_button__LGEEM","default":"SensitiveBlock-module_default__pkWhC","full":"SensitiveBlock-module_full__hlH41","media":"SensitiveBlock-module_media__nuL1S","super_full":"SensitiveBlock-module_super_full__C7UyP","visible":"SensitiveBlock-module_visible__bXhYO","isInCard":"SensitiveBlock-module_isInCard__uANYL","isInSlide":"SensitiveBlock-module_isInSlide__ZAVUU"};
1596
+
1597
+ const SensitiveBlock = ({
1598
+ block,
1599
+ block: {
1600
+ cc,
1601
+ caption,
1602
+ credit,
1603
+ blurred_image: blurredImage
1604
+ },
1605
+ block: {
1606
+ item: {
1607
+ data: {
1608
+ display
1609
+ }
1610
+ }
1611
+ },
1612
+ styleContext
1613
+ }) => {
1614
+ const [visible, isVisible] = React.useState(false);
1615
+ const handleClick = () => {
1616
+ isVisible(true);
1617
+ };
1618
+ let classNames = [[styles$h.root, true], [styles$h.visible, visible], [styles$h[display], display && styles$h[display]]];
1619
+ let context = ['isInSensitiveBlock'];
1620
+ if (styleContext) {
1621
+ classNames = makeStyleContext(classNames, styleContext, styles$h);
1622
+ context = [...styleContext, 'isInSensitiveBlock'];
1623
+ }
1624
+ return /*#__PURE__*/React.createElement("div", {
1625
+ "data-testid": "sensitive-block",
1626
+ className: makeClassName(classNames)
1627
+ }, /*#__PURE__*/React.createElement("div", {
1628
+ className: styles$h.container
1629
+ }, /*#__PURE__*/React.createElement("div", {
1630
+ className: styles$h.overlay,
1631
+ style: {
1632
+ backgroundImage: `url(${blurredImage})`
1633
+ }
1634
+ }, /*#__PURE__*/React.createElement("div", {
1635
+ className: styles$h.content
1636
+ }, /*#__PURE__*/React.createElement("p", {
1637
+ dangerouslySetInnerHTML: {
1638
+ __html: block.title
1639
+ }
1640
+ }), /*#__PURE__*/React.createElement("div", {
1641
+ className: styles$h.button
1642
+ }, /*#__PURE__*/React.createElement(Button, {
1643
+ onClick: () => handleClick(),
1644
+ theme: "light"
1645
+ }, block.button.text)))), /*#__PURE__*/React.createElement("div", {
1646
+ className: styles$h.media
1647
+ }, /*#__PURE__*/React.createElement(EmbedBlockContainer, {
1648
+ block: block.item,
1649
+ styleContext: context
1650
+ }))), cc && ( /*#__PURE__*/React.createElement("figcaption", {
1651
+ className: styles$h.figcaption
1652
+ }, /*#__PURE__*/React.createElement(MediaCaption, {
1653
+ credit: credit,
1654
+ caption: caption,
1655
+ styleContext: styleContext
1656
+ }))));
1657
+ };
1658
+
1659
+ var styles$g = {"root":"GroupedBlock-module_root__MQQin","hasFigcaption":"GroupedBlock-module_hasFigcaption__Y05ed","item":"GroupedBlock-module_item__-InqF","items":"GroupedBlock-module_items__8X4js","figcaption":"GroupedBlock-module_figcaption__OE5-u","default":"GroupedBlock-module_default__Tha8f","full":"GroupedBlock-module_full__SNwyE","super_full":"GroupedBlock-module_super_full__HTA9D","mobile":"GroupedBlock-module_mobile__xqMw5","desktop":"GroupedBlock-module_desktop__Oobdp"};
1660
+
1661
+ const GroupedBlock = ({
1662
+ block,
1663
+ block: {
1664
+ only_on: onlyOn
1665
+ },
1666
+ styleContext
1667
+ }) => {
1668
+ const maxHeight = Math.min(...block.data.map(item => item.data && item.data.height || item.item && item.item.data.height));
1669
+ const normalizedBoxesWidth = block.data.map(item => {
1670
+ const width = item.data && item.data.width || item.item && item.item.data.heigh;
1671
+ const height = item.data && item.data.height || item.item && item.item.data.heigh;
1672
+ return width / (height / maxHeight);
1673
+ });
1674
+ const sumWidth = normalizedBoxesWidth.reduce((sum, x) => sum + x);
1675
+ let classNames = [[styles$g.root, true], [styles$g[onlyOn], true], [styles$g.hasFigcaption, block.cc === 'default'], [styles$g[block.display], !!block.display && styles$g[block.display]]];
1676
+ if (styleContext) {
1677
+ classNames = makeStyleContext(classNames, styleContext, styles$g);
1678
+ }
1679
+ return /*#__PURE__*/React.createElement("div", {
1680
+ "data-testid": "grouped-block",
1681
+ className: makeClassName(classNames)
1682
+ }, /*#__PURE__*/React.createElement("div", {
1683
+ className: styles$g.items
1684
+ }, block.data.map((item, index) => {
1685
+ const percentWidth = normalizedBoxesWidth[index] / sumWidth * 100;
1686
+ return /*#__PURE__*/React.createElement("div", {
1687
+ className: styles$g.item,
1688
+ key: item.id,
1689
+ style: {
1690
+ width: `${percentWidth}%`
1691
+ }
1692
+ }, item.type === 'sensitive' ? ( /*#__PURE__*/React.createElement(SensitiveBlock, {
1693
+ block: item,
1694
+ styleContext: ['isInGroupedBlock']
1695
+ })) : ( /*#__PURE__*/React.createElement(EmbedBlockContainer, {
1696
+ block: item,
1697
+ styleContext: ['isInGroupedBlock']
1698
+ })));
1699
+ })), block.cc && ( /*#__PURE__*/React.createElement("figcaption", {
1700
+ className: styles$g.figcaption
1701
+ }, /*#__PURE__*/React.createElement(MediaCaption, {
1702
+ credit: block.credit,
1703
+ caption: block.caption,
1704
+ styleContext: styleContext
1705
+ }))));
1706
+ };
1707
+
1708
+ var styles$f = {"root":"MetaItem-module_root__sRbrZ","hasBullets":"MetaItem-module_hasBullets__b1eW9","hasSource":"MetaItem-module_hasSource__35olm","listened":"MetaItem-module_listened__XZWFQ","read":"MetaItem-module_read__O3cUz","datetime":"MetaItem-module_datetime__--O8c"};
1709
+
1710
+ const MetaItem = ({
1711
+ hasSource,
1712
+ type,
1713
+ children,
1714
+ bullets
1715
+ }) => {
1716
+ const classNames = [[styles$f.root, true], [styles$f[type], !!type && !!styles$f[type]], [styles$f.hasSource, !!hasSource], [styles$f.hasBullets, !!bullets]];
1717
+ return /*#__PURE__*/React.createElement("div", {
1718
+ "data-testid": "meta-item",
1719
+ className: makeClassName(classNames)
1720
+ }, children);
1721
+ };
1722
+
1723
+ var styles$e = {"root":"MetaItemLive-module_root__XfQiW","gold":"MetaItemLive-module_gold__f1UOy","frame":"MetaItemLive-module_frame__FHByQ","liveMiddle":"MetaItemLive-module_liveMiddle__SX4Gs","liveFirstWave":"MetaItemLive-module_liveFirstWave__QqstP","liveSecondWave":"MetaItemLive-module_liveSecondWave__hlbpt"};
1724
+
1725
+ const MetaItemLive = ({
1726
+ theme = 'gold'
1727
+ }) => {
1728
+ const classNames = [[styles$e.root, true], [styles$e[theme], !!theme && styles$e[theme]]];
1729
+ return /*#__PURE__*/React.createElement("div", {
1730
+ "data-testid": "meta-item-live",
1731
+ "data-meta": "live",
1732
+ className: makeClassName(classNames)
1733
+ }, /*#__PURE__*/React.createElement("div", {
1734
+ className: styles$e.frame
1735
+ }));
1736
+ };
1737
+
1738
+ const pluralize = (number, one, two, five) => {
1739
+ let n = Math.abs(number);
1740
+ n %= 100;
1741
+ if (n >= 5 && n <= 20) {
1742
+ return five;
1743
+ }
1744
+ n %= 10;
1745
+ if (n === 1) {
1746
+ return one;
1747
+ }
1748
+ if (n >= 2 && n <= 4) {
1749
+ return two;
1750
+ }
1751
+ return five;
1752
+ };
1753
+
1754
+ var styles$d = {"root":"DocumentItemsCount-module_root__u4M3y","items":"DocumentItemsCount-module_items__OE-hf"};
1755
+
1756
+ const DocumentItemsCount = ({
1757
+ type,
1758
+ lang = 'ru',
1759
+ items,
1760
+ children
1761
+ }) => {
1762
+ const i18n = {
1763
+ ru: {
1764
+ card: {
1765
+ one: 'карточка',
1766
+ two: 'карточки',
1767
+ five: 'карточек'
1768
+ },
1769
+ podcast: {
1770
+ one: 'эпизод',
1771
+ two: 'эпизода',
1772
+ five: 'эпизодов'
1773
+ }
1774
+ },
1775
+ en: {
1776
+ card: {
1777
+ one: 'card',
1778
+ two: 'cards',
1779
+ five: 'cards'
1780
+ },
1781
+ podcast: {
1782
+ one: 'episode',
1783
+ two: 'episodes',
1784
+ five: 'episodes'
1785
+ }
1786
+ }
1787
+ };
1788
+ const itemsCount = `${items} ${pluralize(items, i18n[lang][type].one, i18n[lang][type].two, i18n[lang][type].five)}`;
1789
+ return /*#__PURE__*/React.createElement("div", {
1790
+ "data-testid": "document-items-count",
1791
+ className: styles$d.root
1792
+ }, children, /*#__PURE__*/React.createElement("span", {
1793
+ className: styles$d.items
1794
+ }, itemsCount));
1795
+ };
1796
+
1797
+ const MetaContainer = ({
1798
+ lang,
1799
+ block,
1800
+ isRead,
1801
+ isListened,
1802
+ bookmarkAction,
1803
+ isInBookmarks,
1804
+ block: {
1805
+ data: {
1806
+ components,
1807
+ theme
1808
+ }
1809
+ },
1810
+ styleContext
1811
+ }) => {
1812
+ const themeColor = styleContext && styleContext.indexOf('dark') !== -1 ? 'light' : 'unset';
1813
+ const isPodcast = styleContext && styleContext.indexOf('podcast') !== -1;
1814
+ const isSlides = styleContext && styleContext.indexOf('slide') !== -1;
1815
+ let context = [];
1816
+ if (styleContext && Array.isArray(styleContext)) {
1817
+ context = styleContext.filter(item => {
1818
+ return item !== 'dark';
1819
+ });
1820
+ }
1821
+ const hasSource = !!components.find(item => item.type === 'source_name');
1822
+ return /*#__PURE__*/React.createElement(Meta, {
1823
+ styleContext: context,
1824
+ theme: theme || themeColor,
1825
+ onlyOn: block.only_on,
1826
+ hasSource: hasSource
1827
+ }, components.map(component => {
1828
+ switch (component.type) {
1829
+ case 'source_name':
1830
+ {
1831
+ return /*#__PURE__*/React.createElement(MetaItem, {
1832
+ hasSource: hasSource,
1833
+ bullets: true,
1834
+ key: component.id
1835
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, lang === 'ru' ? 'Источник: ' : 'Source: ', component.url && ( /*#__PURE__*/React.createElement("a", {
1836
+ href: component.url,
1837
+ rel: "noopener noreferrer",
1838
+ target: "_blank"
1839
+ }, component.text)), !component.url && component.text));
1840
+ }
1841
+ case 'duration':
1842
+ {
1843
+ return /*#__PURE__*/React.createElement(MetaItem, {
1844
+ hasSource: hasSource,
1845
+ bullets: true,
1846
+ key: component.id
1847
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SvgSymbol, {
1848
+ icon: "podcast",
1849
+ size: "small"
1850
+ }), component.text));
1851
+ }
1852
+ case 'datetime':
1853
+ {
1854
+ const format = component.format && toCamel(component.format) || 'date';
1855
+ return /*#__PURE__*/React.createElement(MetaItem, {
1856
+ hasSource: hasSource,
1857
+ bullets: true,
1858
+ key: component.id,
1859
+ type: "datetime"
1860
+ }, /*#__PURE__*/React.createElement(Timestamp, {
1861
+ publishedAt: component.datetime,
1862
+ type: format || 'date',
1863
+ locale: lang
1864
+ }));
1865
+ }
1866
+ case 'items_count':
1867
+ {
1868
+ return /*#__PURE__*/React.createElement(MetaItem, {
1869
+ hasSource: hasSource,
1870
+ bullets: true,
1871
+ key: component.id
1872
+ }, /*#__PURE__*/React.createElement(DocumentItemsCount, {
1873
+ items: component.count,
1874
+ type: isPodcast ? 'podcast' : 'card',
1875
+ lang: lang
1876
+ }, /*#__PURE__*/React.createElement(SvgSymbol, {
1877
+ icon: "card",
1878
+ size: "unset"
1879
+ })));
1880
+ }
1881
+ case 'broadcast_active':
1882
+ {
1883
+ return /*#__PURE__*/React.createElement(MetaItem, {
1884
+ hasSource: hasSource,
1885
+ bullets: true,
1886
+ key: component.id
1887
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MetaItemLive, null), " \u041F\u0440\u044F\u043C\u043E\u0439 \u044D\u0444\u0438\u0440"));
1888
+ }
1889
+ case 'broadcast':
1890
+ {
1891
+ return /*#__PURE__*/React.createElement(MetaItem, {
1892
+ hasSource: hasSource,
1893
+ bullets: true,
1894
+ key: component.id
1895
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, component.with_icon && /*#__PURE__*/React.createElement(MetaItemLive, null), component.label));
1896
+ }
1897
+ case 'string':
1898
+ {
1899
+ return /*#__PURE__*/React.createElement(MetaItem, {
1900
+ hasSource: hasSource,
1901
+ bullets: true,
1902
+ key: component.id
1903
+ }, component.text);
1904
+ }
1905
+ default:
1906
+ {
1907
+ return null;
1908
+ }
1909
+ }
1910
+ }), (isRead || isListened) && ( /*#__PURE__*/React.createElement(MetaItem, {
1911
+ hasSource: hasSource,
1912
+ bullets: true,
1913
+ type: isListened ? 'listened' : 'read'
1914
+ }, /*#__PURE__*/React.createElement(SvgSymbol, {
1915
+ icon: isListened ? 'listened' : 'read',
1916
+ size: "unset"
1917
+ }))), isSlides && lang === 'ru' && ( /*#__PURE__*/React.createElement("div", {
1918
+ className: styles$t.bookmark
1919
+ }, /*#__PURE__*/React.createElement(BookmarkButton, {
1920
+ isInBookmarks: isInBookmarks,
1921
+ onClick: () => bookmarkAction('bookmark', 'top')
1922
+ }))));
1923
+ };
1924
+
1925
+ var styles$c = {"root":"DonatesTeaser-module_root__XQCVy","main":"DonatesTeaser-module_main__eN9kd","title":"DonatesTeaser-module_title__9umo1","text":"DonatesTeaser-module_text__s6tyf","cta":"DonatesTeaser-module_cta__-50aB","center":"DonatesTeaser-module_center__gxLvW","isInCard":"DonatesTeaser-module_isInCard__vaUhd","isInSlide":"DonatesTeaser-module_isInSlide__Dh4NH","ru":"DonatesTeaser-module_ru__y-PlJ","en":"DonatesTeaser-module_en__0Iisr"};
1926
+
1927
+ const DonatesTeaser = ({
1928
+ styleContext,
1929
+ lang = 'ru'
1930
+ }) => {
1931
+ let classNames = [[styles$c.root, true], [styles$c[lang], styles$c[lang]]];
1932
+ if (styleContext) {
1933
+ classNames = makeStyleContext(classNames, styleContext, styles$c);
1934
+ }
1935
+ const data = {
1936
+ ru: {
1937
+ title: '«Медуза». Работаем 24/7. И&nbsp;только&nbsp;в&nbsp;интересах читателей',
1938
+ subtitle: 'Нам срочно нужна ваша поддержка',
1939
+ button: 'Хочу помочь',
1940
+ href: 'https://support.meduza.io/'
1941
+ },
1942
+ en: {
1943
+ title: 'Meduza, working 24/7, always&nbsp;for our readers',
1944
+ subtitle: 'We&nbsp;need&nbsp;your&nbsp;help like never&nbsp;before',
1945
+ button: 'Okay!',
1946
+ href: 'https://support.meduza.io/en'
1947
+ }
1948
+ };
1949
+ return /*#__PURE__*/React.createElement("div", {
1950
+ "data-testid": "donates-teaser",
1951
+ className: makeClassName(classNames)
1952
+ }, /*#__PURE__*/React.createElement("div", {
1953
+ className: styles$c.main
1954
+ }, /*#__PURE__*/React.createElement("h3", {
1955
+ className: styles$c.title
1956
+ }, /*#__PURE__*/React.createElement("span", {
1957
+ dangerouslySetInnerHTML: {
1958
+ __html: data[lang].title
1959
+ }
1960
+ }), ` `, /*#__PURE__*/React.createElement("span", {
1961
+ className: styles$c.text,
1962
+ dangerouslySetInnerHTML: {
1963
+ __html: data[lang].subtitle
1964
+ }
1965
+ }))), /*#__PURE__*/React.createElement("div", {
1966
+ className: styles$c.cta
1967
+ }, /*#__PURE__*/React.createElement("a", {
1968
+ href: data[lang].href,
1969
+ target: "_blank",
1970
+ rel: "noreferrer"
1971
+ }, /*#__PURE__*/React.createElement("span", null, data[lang].button))));
1972
+ };
1973
+
1974
+ var styles$b = {"root":"AnnouncementInText-module_root__C4-Oo","body":"AnnouncementInText-module_body__lZy-L","title":"AnnouncementInText-module_title__cb6i1","footer":"AnnouncementInText-module_footer__jRk9p","button":"AnnouncementInText-module_button__JuT-E","link":"AnnouncementInText-module_link__C0YxL","center":"AnnouncementInText-module_center__1DJjd","isInCard":"AnnouncementInText-module_isInCard__jIqpa","isInSlide":"AnnouncementInText-module_isInSlide__BWO-A","ru":"AnnouncementInText-module_ru__QHQad","en":"AnnouncementInText-module_en__r0PvM"};
1975
+
1976
+ const AnnouncementInText = ({
1977
+ styleContext,
1978
+ lang = 'ru'
1979
+ }) => {
1980
+ let classNames = [[styles$b.root, true], [styles$b[lang], styles$b[lang]]];
1981
+ if (styleContext) {
1982
+ classNames = makeStyleContext(classNames, styleContext, styles$b);
1983
+ }
1984
+ const data = {
1985
+ ru: {
1986
+ title: '&laquo;Медуза&raquo; заблокирована в&nbsp;России. Мы&nbsp;были к&nbsp;этому готовы&nbsp;&mdash; и&nbsp;продолжаем работать. Несмотря&nbsp;ни&nbsp;на&nbsp;что',
1987
+ text: '<p>Нам нужна ваша помощь как никогда. Прямо сейчас. Дальше всем нам будет еще труднее. Мы&nbsp;независимое издание и&nbsp;работаем только в&nbsp;интересах читателей.</p>',
1988
+ button: 'Хочу помочь',
1989
+ href: 'https://mdza.io/yiNxPZ7Bs-k'
1990
+ },
1991
+ en: {
1992
+ title: 'Meduza has been blocked in Russia. We&nbsp;were ready for this and our work continues, no matter what, but we need your support like never before. ',
1993
+ text: '<p>We need it now. Tomorrow could be too late. We are an independent publication, and we work only in the interests of our readers. Many&nbsp;of&nbsp;our&nbsp;readers in Russia can no longer contribute, so we turn to you, our audience around the world.</p>',
1994
+ button: 'I want to help',
1995
+ href: 'https://support.meduza.io/en'
1996
+ }
1997
+ };
1998
+ const localeData = data[lang];
1999
+ return /*#__PURE__*/React.createElement("div", {
2000
+ "data-testid": "announcement-in-text",
2001
+ className: makeClassName(classNames)
2002
+ }, /*#__PURE__*/React.createElement("div", {
2003
+ className: styles$b.body
2004
+ }, /*#__PURE__*/React.createElement("h3", {
2005
+ className: styles$b.title,
2006
+ dangerouslySetInnerHTML: {
2007
+ __html: localeData.title
2008
+ }
2009
+ }), /*#__PURE__*/React.createElement("div", {
2010
+ dangerouslySetInnerHTML: {
2011
+ __html: localeData.text
2012
+ }
2013
+ })), /*#__PURE__*/React.createElement("div", {
2014
+ className: styles$b.footer
2015
+ }, /*#__PURE__*/React.createElement("a", {
2016
+ className: styles$b.link,
2017
+ href: localeData.href,
2018
+ target: "_blank",
2019
+ rel: "noreferrer"
2020
+ }, /*#__PURE__*/React.createElement("span", null, localeData.button)), /*#__PURE__*/React.createElement("span", {
2021
+ className: styles$b.button
2022
+ }, /*#__PURE__*/React.createElement("span", null, localeData.button))));
2023
+ };
2024
+
2025
+ var styles$a = {"root":"VersesBlock-module_root__CrgSZ","ol":"VersesBlock-module_ol__ToXjg","ul":"VersesBlock-module_ul__wfaQD","center":"VersesBlock-module_center__E1IS-","isInImportantLead":"VersesBlock-module_isInImportantLead__pdugk","dark":"VersesBlock-module_dark__FwaPS","mobile":"VersesBlock-module_mobile__EcHvz","desktop":"VersesBlock-module_desktop__quKfJ"};
2026
+
2027
+ const VersesBlock = ({
2028
+ block: {
2029
+ type,
2030
+ data,
2031
+ only_on: onlyOn
2032
+ },
2033
+ styleContext
2034
+ }) => {
2035
+ let classNames = [[styles$a.root, true], [styles$a[onlyOn], true], [styles$a[type], !!type && !!styles$a[type]]];
2036
+ if (styleContext) {
2037
+ classNames = makeStyleContext(classNames, styleContext, styles$a);
2038
+ }
2039
+ return /*#__PURE__*/React.createElement("ul", {
2040
+ className: makeClassName(classNames),
2041
+ "data-testid": "verses-block"
2042
+ }, data.map((item, index) => ( /*#__PURE__*/React.createElement("li", {
2043
+ key: index,
2044
+ dangerouslySetInnerHTML: {
2045
+ __html: item
2046
+ }
2047
+ }))));
2048
+ };
2049
+
2050
+ const RenderBlocks = ({
2051
+ block,
2052
+ styleContext,
2053
+ lang,
2054
+ isRead,
2055
+ isListened,
2056
+ bookmarkAction,
2057
+ isInBookmarks
2058
+ }) => {
2059
+ switch (block.type) {
2060
+ case 'tag':
2061
+ {
2062
+ return /*#__PURE__*/React.createElement(Tag, {
2063
+ size: "large",
2064
+ onlyOn: block.only_on,
2065
+ theme: block.data.theme,
2066
+ styleContext: styleContext
2067
+ }, block.data.text);
2068
+ }
2069
+ case 'simple_title':
2070
+ {
2071
+ return /*#__PURE__*/React.createElement(SimpleTitle, {
2072
+ block: block,
2073
+ styleContext: styleContext
2074
+ });
2075
+ }
2076
+ case 'rich_title':
2077
+ {
2078
+ return /*#__PURE__*/React.createElement(RichTitle, {
2079
+ block: block,
2080
+ styleContext: styleContext
2081
+ });
2082
+ }
2083
+ case 'meta':
2084
+ {
2085
+ return /*#__PURE__*/React.createElement(MetaContainer, {
2086
+ block: block,
2087
+ lang: block.data.lang,
2088
+ styleContext: styleContext,
2089
+ isRead: isRead,
2090
+ isListened: isListened,
2091
+ isInBookmarks: isInBookmarks,
2092
+ bookmarkAction: bookmarkAction
2093
+ });
2094
+ }
2095
+ case 'blockquote':
2096
+ case 'p':
2097
+ case 'context_p':
2098
+ case 'divider':
2099
+ case 'lead':
2100
+ case 'lead_hr':
2101
+ {
2102
+ return /*#__PURE__*/React.createElement(SimpleBlock, {
2103
+ block: block,
2104
+ styleContext: styleContext
2105
+ });
2106
+ }
2107
+ case 'h1':
2108
+ case 'h2':
2109
+ case 'h3':
2110
+ case 'h4':
2111
+ {
2112
+ return /*#__PURE__*/React.createElement(SimpleBlock, {
2113
+ block: block,
2114
+ styleContext: styleContext,
2115
+ id: block.id
2116
+ });
2117
+ }
2118
+ case 'quote':
2119
+ return /*#__PURE__*/React.createElement(QuoteBlock, {
2120
+ block: block,
2121
+ styleContext: styleContext
2122
+ });
2123
+ case 'ol':
2124
+ case 'ul':
2125
+ {
2126
+ return /*#__PURE__*/React.createElement(ListBlock, {
2127
+ block: block,
2128
+ styleContext: styleContext
2129
+ });
2130
+ }
2131
+ case 'verses':
2132
+ {
2133
+ return /*#__PURE__*/React.createElement(VersesBlock, {
2134
+ block: block,
2135
+ styleContext: styleContext
2136
+ });
2137
+ }
2138
+ case 'chapter-subtitle':
2139
+ {
2140
+ return /*#__PURE__*/React.createElement(ChapterBlock, {
2141
+ block: block,
2142
+ styleContext: styleContext,
2143
+ id: block.id
2144
+ });
2145
+ }
2146
+ case 'card_title':
2147
+ {
2148
+ return /*#__PURE__*/React.createElement(CardTitle, {
2149
+ block: block,
2150
+ styleContext: styleContext
2151
+ });
2152
+ }
2153
+ case 'related':
2154
+ {
2155
+ return /*#__PURE__*/React.createElement(RelatedBlock, {
2156
+ block: block,
2157
+ styleContext: styleContext
2158
+ });
2159
+ }
2160
+ case 'source':
2161
+ return /*#__PURE__*/React.createElement(SourceBlock, {
2162
+ block: block,
2163
+ styleContext: styleContext
2164
+ });
2165
+ case 'table':
2166
+ return /*#__PURE__*/React.createElement(Table, {
2167
+ block: block,
2168
+ styleContext: styleContext
2169
+ });
2170
+ case 'sensitive':
2171
+ return /*#__PURE__*/React.createElement(SensitiveBlock, {
2172
+ block: block,
2173
+ styleContext: styleContext
2174
+ });
2175
+ case 'embed':
2176
+ case 'embed_code':
2177
+ case 'game_embed':
2178
+ case 'image':
2179
+ case 'dots_on_image':
2180
+ case 'gif':
2181
+ return /*#__PURE__*/React.createElement(EmbedBlockContainer, {
2182
+ block: block,
2183
+ styleContext: styleContext,
2184
+ lang: lang
2185
+ });
2186
+ case 'grouped':
2187
+ return /*#__PURE__*/React.createElement(GroupedBlock, {
2188
+ block: block,
2189
+ styleContext: styleContext
2190
+ });
2191
+ case 'donation':
2192
+ return /*#__PURE__*/React.createElement(DonatesTeaser, {
2193
+ styleContext: styleContext,
2194
+ lang: lang
2195
+ });
2196
+ case 'material_note':
2197
+ return /*#__PURE__*/React.createElement(MaterialNote, {
2198
+ block: block,
2199
+ styleContext: styleContext
2200
+ });
2201
+ case 'announcement_in_text':
2202
+ return /*#__PURE__*/React.createElement(AnnouncementInText, {
2203
+ styleContext: styleContext,
2204
+ lang: lang
2205
+ });
2206
+ default:
2207
+ {
2208
+ return null;
2209
+ }
2210
+ }
2211
+ };
2212
+
2213
+ var styles$9 = {"root":"Cover-module_root__3pscq","body":"Cover-module_body__eJpUI","image":"Cover-module_image__frrrH","rich":"Cover-module_rich__YcxWa","dark":"Cover-module_dark__cRucL","light":"Cover-module_light__la-sk","control":"Cover-module_control__WP0G3","isInDynamicBlock":"Cover-module_isInDynamicBlock__qO-yt","mobile":"Cover-module_mobile__aotep","desktop":"Cover-module_desktop__dfbC-"};
2214
+
2215
+ const Cover = ({
2216
+ block: {
2217
+ only_on: onlyOn,
2218
+ data: {
2219
+ blocks,
2220
+ cover: {
2221
+ credit,
2222
+ caption,
2223
+ urls,
2224
+ mobile_ratio: mobileRatio,
2225
+ gradients,
2226
+ cc
2227
+ }
2228
+ }
2229
+ },
2230
+ styleContext
2231
+ }) => {
2232
+ const [isPopoverShown, setIsPopoverShown] = React.useState(false);
2233
+ const style = {};
2234
+ let classNames = [[styles$9.root, true], [styles$9[onlyOn], !!onlyOn && !!styles$9[onlyOn]]];
2235
+ if (styleContext) {
2236
+ classNames = makeStyleContext(classNames, styleContext, styles$9);
2237
+ }
2238
+ if (gradients) {
2239
+ const theme = [gradients.text_rgb === '0,0,0' ? 'dark' : 'light'];
2240
+ classNames = makeStyleContext(classNames, theme, styles$9);
2241
+ style.backgroundImage = generateGradient(gradients.bg_rgb, 'mediaBlockBottom');
2242
+ }
2243
+ const renderCC = context => ( /*#__PURE__*/React.createElement(MediaCaption, {
2244
+ credit: credit,
2245
+ caption: caption,
2246
+ styleContext: context || styleContext
2247
+ }));
2248
+ return /*#__PURE__*/React.createElement("div", {
2249
+ "data-testid": "cover",
2250
+ className: makeClassName(classNames)
2251
+ }, /*#__PURE__*/React.createElement("div", {
2252
+ className: styles$9.image
2253
+ }, /*#__PURE__*/React.createElement(Image, {
2254
+ optimized: urls,
2255
+ ratio: mobileRatio,
2256
+ display: "narrow"
2257
+ })), /*#__PURE__*/React.createElement("div", {
2258
+ className: styles$9.body,
2259
+ style: style
2260
+ }, blocks.map(item => ( /*#__PURE__*/React.createElement(RenderBlocks, {
2261
+ key: item.id,
2262
+ block: item,
2263
+ styleContext: styleContext
2264
+ })))), cc === 'button' && ( /*#__PURE__*/React.createElement("button", {
2265
+ className: styles$9.control,
2266
+ type: "button",
2267
+ "aria-label": "Open",
2268
+ onClick: () => {
2269
+ setIsPopoverShown(!isPopoverShown);
2270
+ }
2271
+ })), cc === 'button' && isPopoverShown && ( /*#__PURE__*/React.createElement(Popover, {
2272
+ onClose: () => {
2273
+ setIsPopoverShown(false);
2274
+ }
2275
+ }, renderCC('isInPopover'))));
2276
+ };
2277
+
2278
+ var styles$8 = {"root":"HalfBlock-module_root__EXQbz","main":"HalfBlock-module_main__eIcRo","body":"HalfBlock-module_body__HPhGj","footer":"HalfBlock-module_footer__TFfCQ","image":"HalfBlock-module_image__XWLbK","mobile":"HalfBlock-module_mobile__uGGpm","desktop":"HalfBlock-module_desktop__p-hAq"};
2279
+
2280
+ const HalfBlock = ({
2281
+ block: {
2282
+ only_on: onlyOn,
2283
+ data,
2284
+ data: {
2285
+ cover: {
2286
+ optimized,
2287
+ ratio,
2288
+ credit,
2289
+ caption
2290
+ }
2291
+ }
2292
+ },
2293
+ styleContext
2294
+ }) => {
2295
+ let classNames = [[styles$8.root, true], [styles$8[onlyOn], true]];
2296
+ if (styleContext) {
2297
+ classNames = makeStyleContext(classNames, styleContext, styles$8);
2298
+ }
2299
+ return /*#__PURE__*/React.createElement("div", {
2300
+ "data-testid": "half-block",
2301
+ className: makeClassName(classNames)
2302
+ }, /*#__PURE__*/React.createElement("div", {
2303
+ className: styles$8.main
2304
+ }, /*#__PURE__*/React.createElement("div", {
2305
+ className: styles$8.image
2306
+ }, /*#__PURE__*/React.createElement(Image, {
2307
+ optimized: optimized,
2308
+ ratio: ratio,
2309
+ display: "super_full"
2310
+ })), /*#__PURE__*/React.createElement("div", {
2311
+ className: styles$8.body
2312
+ }, data.blocks.map(item => ( /*#__PURE__*/React.createElement(RenderBlocks, {
2313
+ key: item.id,
2314
+ block: item,
2315
+ styleContext: ['rich']
2316
+ }))))), /*#__PURE__*/React.createElement("div", {
2317
+ className: styles$8.footer
2318
+ }, /*#__PURE__*/React.createElement(MediaCaption, {
2319
+ credit: credit,
2320
+ caption: caption,
2321
+ styleContext: styleContext
2322
+ })));
2323
+ };
2324
+
2325
+ var styles$7 = {"root":"ImportantLead-module_root__-rnt6","slide":"ImportantLead-module_slide__zcovu","mobile":"ImportantLead-module_mobile__msInp","desktop":"ImportantLead-module_desktop__ELC2-"};
2326
+
2327
+ const ImportantLead = ({
2328
+ block: {
2329
+ only_on: onlyOn,
2330
+ data
2331
+ },
2332
+ styleContext
2333
+ }) => {
2334
+ let classNames = [[styles$7.root, true], [styles$7[onlyOn], !!onlyOn]];
2335
+ if (styleContext) {
2336
+ classNames = makeStyleContext(classNames, styleContext, styles$7);
2337
+ }
2338
+ return /*#__PURE__*/React.createElement("div", {
2339
+ "data-testid": "important-lead",
2340
+ className: makeClassName(classNames)
2341
+ }, data.map(item => ( /*#__PURE__*/React.createElement(RenderBlocks, {
2342
+ key: item.id,
2343
+ block: item,
2344
+ styleContext: "isInImportantLead"
2345
+ }))));
2346
+ };
2347
+
2348
+ var styles$6 = {"root":"Spoiler-module_root__fAbb9","header":"Spoiler-module_header__iEKsQ","body":"Spoiler-module_body__jjqIn","spoiled":"Spoiler-module_spoiled__ENI93","footer":"Spoiler-module_footer__g21Zn","spoilerSticky":"Spoiler-module_spoilerSticky__YTiyF","spoilerStickyBg":"Spoiler-module_spoilerStickyBg__tmDnG","center":"Spoiler-module_center__0XCWo","full":"Spoiler-module_full__FtKDT","default":"Spoiler-module_default__wvlKw","mobile":"Spoiler-module_mobile__PWCMW","desktop":"Spoiler-module_desktop__qTakd"};
2349
+
2350
+ const Spoiler = ({
2351
+ block: {
2352
+ display,
2353
+ button,
2354
+ only_on: onlyOn,
2355
+ btn_title: buttonTitle,
2356
+ title,
2357
+ blocks
2358
+ },
2359
+ styleContext
2360
+ }) => {
2361
+ const [spoiled, setSpoiled] = React.useState(false);
2362
+ const ref = React.useRef(null);
2363
+ const handleButtonClick = () => {
2364
+ setSpoiled(!spoiled);
2365
+ if (spoiled) {
2366
+ postMessage('', 'closeSpoiler', 'click');
2367
+ const rect = ref.current.getBoundingClientRect();
2368
+ if (rect.top < 0) {
2369
+ ref.current.scrollIntoView({
2370
+ behavior: 'smooth'
2371
+ });
2372
+ }
2373
+ } else {
2374
+ postMessage('', 'openSpoiler', 'click');
2375
+ }
2376
+ };
2377
+ let classNames = [[styles$6.root, true], [styles$6[onlyOn], !!onlyOn], [styles$6[display], !!display && styles$6[display]], [[styles$6.spoiled], !!spoiled]];
2378
+ const context = ['center'];
2379
+ if (styleContext) {
2380
+ context.concat(styleContext);
2381
+ classNames = makeStyleContext(classNames, styleContext, styles$6);
2382
+ }
2383
+ const buttonCollapse = button ? button.collapse : 'Свернуть';
2384
+ const buttonExpande = button ? button.expand : buttonTitle;
2385
+ return /*#__PURE__*/React.createElement("div", {
2386
+ ref: ref,
2387
+ className: makeClassName(classNames),
2388
+ "data-testid": "spoiler"
2389
+ }, /*#__PURE__*/React.createElement("div", {
2390
+ className: styles$6.header
2391
+ }, title && /*#__PURE__*/React.createElement("h3", null, title)), /*#__PURE__*/React.createElement("div", {
2392
+ className: styles$6.body
2393
+ }, blocks.map(item => ( /*#__PURE__*/React.createElement(RenderBlocks, {
2394
+ key: item.id,
2395
+ block: item,
2396
+ styleContext: context
2397
+ })))), /*#__PURE__*/React.createElement("div", {
2398
+ className: styles$6.footer
2399
+ }, /*#__PURE__*/React.createElement(Button, {
2400
+ size: "default",
2401
+ theme: "gray",
2402
+ onClick: () => handleButtonClick(),
2403
+ styleContext: "isInSpoiler"
2404
+ }, spoiled ? buttonCollapse : buttonExpande, /*#__PURE__*/React.createElement(SvgSymbol, {
2405
+ icon: "arrow"
2406
+ }))));
2407
+ };
2408
+
2409
+ var styles$5 = {"root":"RelatedRichBlock-module_root__-SEe7","wrapper":"RelatedRichBlock-module_wrapper__YkEpr","overlay":"RelatedRichBlock-module_overlay__tWuyR","overlayHeader":"RelatedRichBlock-module_overlayHeader__V3ynX","body":"RelatedRichBlock-module_body__XhS0U","isRich":"RelatedRichBlock-module_isRich__Z2kQ8","hasGradient":"RelatedRichBlock-module_hasGradient__s5Krh","picture":"RelatedRichBlock-module_picture__OmRKx","isCard":"RelatedRichBlock-module_isCard__wkMw-","cover":"RelatedRichBlock-module_cover__3gnIx","tag":"RelatedRichBlock-module_tag__c18sv","center":"RelatedRichBlock-module_center__KANd-","dark":"RelatedRichBlock-module_dark__cnk4R","light":"RelatedRichBlock-module_light__aJLn7","mobile":"RelatedRichBlock-module_mobile__N-G4U","desktop":"RelatedRichBlock-module_desktop__EaPOr"};
2410
+
2411
+ /* eslint-disable react/jsx-no-target-blank */
2412
+ const RelatedRichBlock = ({
2413
+ block: {
2414
+ only_on: onlyOn,
2415
+ data: {
2416
+ blocks,
2417
+ url,
2418
+ cover: {
2419
+ urls,
2420
+ gradients,
2421
+ tag,
2422
+ layout,
2423
+ ratio
2424
+ }
2425
+ }
2426
+ },
2427
+ styleContext
2428
+ }) => {
2429
+ const style = {};
2430
+ const styleHeader = {};
2431
+ const cardType = `is${toCapitalize(layout)}`;
2432
+ const [ref, inView] = reactIntersectionObserver.useInView({
2433
+ threshold: 0,
2434
+ triggerOnce: true
2435
+ });
2436
+ React.useEffect(() => {
2437
+ if (inView) {
2438
+ if (onlyOn === 'mobile' && window.innerWidth <= 511 || onlyOn === 'desktop' && window.innerWidth >= 512 || !onlyOn) {
2439
+ postMessage('richRelated', url, 'view');
2440
+ }
2441
+ }
2442
+ }, [inView]);
2443
+ const handleClick = () => {
2444
+ postMessage('richRelated', url, 'click');
2445
+ };
2446
+ let classNames = [[styles$5.root, true], [styles$5[cardType], !!layout && !!styles$5[cardType]], [styles$5.hasGradient, !!gradients], [styles$5[onlyOn], !!onlyOn && !!styles$5[onlyOn]]];
2447
+ let context = ['isInMediaBlock'];
2448
+ if (styleContext) {
2449
+ classNames = makeStyleContext(classNames, styleContext, styles$5);
2450
+ context = [...styleContext, 'isInMediaBlock'];
2451
+ }
2452
+ if (gradients) {
2453
+ styleHeader.backgroundImage = generateGradient(gradients.bg_rgb, 'mediaBlockTop');
2454
+ const theme = [gradients.text_rgb === '0,0,0' ? 'dark' : 'light'];
2455
+ classNames = makeStyleContext(classNames, theme, styles$5);
2456
+ if (onlyOn === 'desktop') {
2457
+ style.backgroundImage = generateGradient(gradients.bg_rgb, 'mediaBlockBottom');
2458
+ }
2459
+ }
2460
+ return /*#__PURE__*/React.createElement(reactRouterDom.Link, {
2461
+ "data-testid": "related-rich-block",
2462
+ className: makeClassName(classNames),
2463
+ to: `/${url}`,
2464
+ onClick: () => handleClick(),
2465
+ ref: ref
2466
+ }, layout === 'rich' && ( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
2467
+ className: styles$5.overlay,
2468
+ style: style
2469
+ }), /*#__PURE__*/React.createElement("div", {
2470
+ className: styles$5.overlayHeader,
2471
+ style: styleHeader
2472
+ }))), /*#__PURE__*/React.createElement("div", {
2473
+ className: styles$5.tag
2474
+ }, /*#__PURE__*/React.createElement(Tag, {
2475
+ size: "small",
2476
+ theme: "inherit",
2477
+ styleContext: "richRelated"
2478
+ }, tag)), /*#__PURE__*/React.createElement("div", {
2479
+ className: styles$5.cover
2480
+ }, /*#__PURE__*/React.createElement("div", {
2481
+ className: styles$5.picture
2482
+ }, /*#__PURE__*/React.createElement(Image, {
2483
+ optimized: urls,
2484
+ ratio: ratio,
2485
+ display: "narrow"
2486
+ }))), /*#__PURE__*/React.createElement("div", {
2487
+ className: styles$5.body
2488
+ }, blocks.map(item => ( /*#__PURE__*/React.createElement(RenderBlocks, {
2489
+ key: item.id,
2490
+ block: item,
2491
+ styleContext: context
2492
+ })))));
2493
+ };
2494
+
2495
+ var styles$4 = {"root":"ShopRelatedBlock-module_root__eTGjC","wrapper":"ShopRelatedBlock-module_wrapper__v6yE3","overlay":"ShopRelatedBlock-module_overlay__oR67Y","overlayHeader":"ShopRelatedBlock-module_overlayHeader__YMcNw","body":"ShopRelatedBlock-module_body__W4pBN","hasGradient":"ShopRelatedBlock-module_hasGradient__50JTl","picture":"ShopRelatedBlock-module_picture__zjFL4","tag":"ShopRelatedBlock-module_tag__ixkda","center":"ShopRelatedBlock-module_center__IpBP4","title":"ShopRelatedBlock-module_title__COl93","price":"ShopRelatedBlock-module_price__5Qitu","dark":"ShopRelatedBlock-module_dark__d0QiW","light":"ShopRelatedBlock-module_light__lUDWA","mobile":"ShopRelatedBlock-module_mobile__I6Hih","desktop":"ShopRelatedBlock-module_desktop__ywKrb"};
2496
+
2497
+ /* eslint-disable react/jsx-no-target-blank */
2498
+ const ShopRelatedBlock = ({
2499
+ block: {
2500
+ only_on: onlyOn,
2501
+ data: {
2502
+ url,
2503
+ cover: {
2504
+ urls,
2505
+ gradients,
2506
+ tag,
2507
+ layout,
2508
+ ratio,
2509
+ first_title: firstTitle,
2510
+ second_title: secondTitle
2511
+ }
2512
+ }
2513
+ },
2514
+ styleContext
2515
+ }) => {
2516
+ const style = {};
2517
+ const styleHeader = {};
2518
+ const [ref, inView] = reactIntersectionObserver.useInView({
2519
+ threshold: 0,
2520
+ triggerOnce: true
2521
+ });
2522
+ React.useEffect(() => {
2523
+ if (inView) {
2524
+ if (onlyOn === 'mobile' && window.innerWidth <= 511 || onlyOn === 'desktop' && window.innerWidth >= 512 || !onlyOn) {
2525
+ postMessage('productRelated', url, 'view');
2526
+ }
2527
+ }
2528
+ }, [inView]);
2529
+ const handleClick = () => {
2530
+ postMessage('productRelated', url, 'click');
2531
+ };
2532
+ let classNames = [[styles$4.root, true], [styles$4.hasGradient, !!gradients], [styles$4[onlyOn], !!onlyOn && !!styles$4[onlyOn]]];
2533
+ if (styleContext) {
2534
+ classNames = makeStyleContext(classNames, styleContext, styles$4);
2535
+ }
2536
+ if (gradients) {
2537
+ styleHeader.backgroundImage = generateGradient(gradients.bg_rgb, 'mediaBlockTop');
2538
+ const theme = [gradients.text_rgb === '0,0,0' ? 'dark' : 'light'];
2539
+ classNames = makeStyleContext(classNames, theme, styles$4);
2540
+ if (onlyOn === 'desktop') {
2541
+ style.backgroundImage = generateGradient(gradients.bg_rgb, 'mediaBlockBottom');
2542
+ }
2543
+ }
2544
+ return /*#__PURE__*/React.createElement("a", {
2545
+ "data-testid": "related-rich-block",
2546
+ className: makeClassName(classNames),
2547
+ href: url,
2548
+ target: "_blank",
2549
+ onClick: () => handleClick(),
2550
+ ref: ref
2551
+ }, layout === 'rich' && ( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
2552
+ className: styles$4.overlay,
2553
+ style: style
2554
+ }), /*#__PURE__*/React.createElement("div", {
2555
+ className: styles$4.overlayHeader,
2556
+ style: styleHeader
2557
+ }))), /*#__PURE__*/React.createElement("div", {
2558
+ className: styles$4.tag
2559
+ }, /*#__PURE__*/React.createElement(Tag, {
2560
+ size: "small",
2561
+ theme: "inherit",
2562
+ styleContext: "richRelated"
2563
+ }, tag)), /*#__PURE__*/React.createElement("div", {
2564
+ className: styles$4.cover
2565
+ }, /*#__PURE__*/React.createElement("div", {
2566
+ className: styles$4.picture
2567
+ }, /*#__PURE__*/React.createElement(Image, {
2568
+ optimized: urls,
2569
+ ratio: ratio,
2570
+ display: "narrow"
2571
+ }))), /*#__PURE__*/React.createElement("div", {
2572
+ className: styles$4.body
2573
+ }, /*#__PURE__*/React.createElement("h2", {
2574
+ className: styles$4.title
2575
+ }, firstTitle, /*#__PURE__*/React.createElement("span", {
2576
+ className: styles$4.price
2577
+ }, secondTitle))));
2578
+ };
2579
+
2580
+ var styles$3 = {"root":"RelatedBook-module_root__QsOmA","container":"RelatedBook-module_container__vdDiZ","imageWrap":"RelatedBook-module_imageWrap__WmwnE","image":"RelatedBook-module_image__U1e5t","picture":"RelatedBook-module_picture__NXg-K","tag":"RelatedBook-module_tag__mSbbz","contentWrap":"RelatedBook-module_contentWrap__HIGRi","content":"RelatedBook-module_content__23Pfr","title":"RelatedBook-module_title__VRbr-","footer":"RelatedBook-module_footer__Z05t-","center":"RelatedBook-module_center__Fa6cj","isLight":"RelatedBook-module_isLight__W-0TO","isDark":"RelatedBook-module_isDark__0mrtK"};
2581
+
2582
+ const RelatedBook = ({
2583
+ block,
2584
+ styleContext
2585
+ }) => {
2586
+ const theme = block.data.theme.text_color === '0,0,0' ? 'isDark' : 'isLight';
2587
+ let classNames = [[styles$3.root, true], [styles$3[theme], theme], [styles$3[block.data.onlyOn], !!block.data.onlyOn && !!styles$3[block.data.onlyOn]]];
2588
+ if (styleContext) {
2589
+ classNames = makeStyleContext(classNames, styleContext, styles$3);
2590
+ }
2591
+ const cssProps = {
2592
+ '--bgColor': `rgb(${block.data.theme.background_color || '0, 0, 0'})`
2593
+ };
2594
+ return /*#__PURE__*/React.createElement(reactRouterDom.Link, {
2595
+ to: `/${block.data.url}`,
2596
+ className: makeClassName(classNames),
2597
+ style: cssProps
2598
+ }, /*#__PURE__*/React.createElement("div", {
2599
+ className: styles$3.container
2600
+ }, /*#__PURE__*/React.createElement("div", {
2601
+ className: styles$3.imageWrap
2602
+ }, /*#__PURE__*/React.createElement("div", {
2603
+ className: styles$3.image
2604
+ }, /*#__PURE__*/React.createElement("picture", {
2605
+ className: styles$3.picture
2606
+ }, /*#__PURE__*/React.createElement(Image, {
2607
+ optimized: block.data.cover.urls,
2608
+ ratio: 0,
2609
+ display: "narrow",
2610
+ styleContext: ['isStatic'],
2611
+ lazy: true
2612
+ })))), /*#__PURE__*/React.createElement("div", {
2613
+ className: styles$3.contentWrap
2614
+ }, /*#__PURE__*/React.createElement("div", {
2615
+ className: styles$3.content
2616
+ }, block.data.blocks.map(item => ( /*#__PURE__*/React.createElement(RenderBlocks, {
2617
+ key: item.id,
2618
+ block: item,
2619
+ styleContext: ['isInMediaBlock', 'isInBookRelated', 'isCustom']
2620
+ })))))));
2621
+ };
2622
+
2623
+ const RawHtmlBlock = ({
2624
+ block,
2625
+ styleContext,
2626
+ isRead,
2627
+ isListened,
2628
+ isInBookmarks,
2629
+ bookmarkAction,
2630
+ lightBox,
2631
+ lang
2632
+ }) => {
2633
+ const context = {
2634
+ lightBox: lightBox || null
2635
+ };
2636
+ switch (block.type) {
2637
+ case 'important_lead':
2638
+ {
2639
+ return /*#__PURE__*/React.createElement(ImportantLead, {
2640
+ block: block,
2641
+ styleContext: styleContext
2642
+ });
2643
+ }
2644
+ case 'spoiler':
2645
+ {
2646
+ return /*#__PURE__*/React.createElement(BlockProvider, {
2647
+ value: context
2648
+ }, /*#__PURE__*/React.createElement(Spoiler, {
2649
+ block: block,
2650
+ styleContext: styleContext
2651
+ }));
2652
+ }
2653
+ case 'cover':
2654
+ {
2655
+ return /*#__PURE__*/React.createElement(Cover, {
2656
+ block: block,
2657
+ styleContext: styleContext
2658
+ });
2659
+ }
2660
+ case 'half':
2661
+ {
2662
+ return /*#__PURE__*/React.createElement(HalfBlock, {
2663
+ block: block,
2664
+ styleContext: styleContext
2665
+ });
2666
+ }
2667
+ case 'related_rich':
2668
+ {
2669
+ return /*#__PURE__*/React.createElement(RelatedRichBlock, {
2670
+ block: block,
2671
+ styleContext: styleContext
2672
+ });
2673
+ }
2674
+ case 'related_book':
2675
+ {
2676
+ return /*#__PURE__*/React.createElement(RelatedBook, {
2677
+ block: block,
2678
+ styleContext: styleContext
2679
+ });
2680
+ }
2681
+ case 'related_shop':
2682
+ {
2683
+ return /*#__PURE__*/React.createElement(ShopRelatedBlock, {
2684
+ block: block,
2685
+ styleContext: styleContext
2686
+ });
2687
+ }
2688
+ default:
2689
+ {
2690
+ return /*#__PURE__*/React.createElement(BlockProvider, {
2691
+ value: context
2692
+ }, /*#__PURE__*/React.createElement(RenderBlocks, {
2693
+ block: block,
2694
+ styleContext: styleContext,
2695
+ isRead: isRead,
2696
+ isListened: isListened,
2697
+ isInBookmarks: isInBookmarks,
2698
+ bookmarkAction: bookmarkAction,
2699
+ lang: lang
2700
+ }));
2701
+ }
2702
+ }
2703
+ };
2704
+
2705
+ var styles$2 = {"root":"ListViewSwitcher-module_root__pBsR5","input":"ListViewSwitcher-module_input__vtDVD","knob":"ListViewSwitcher-module_knob__g-OZ2","sm":"ListViewSwitcher-module_sm__y1teD","md":"ListViewSwitcher-module_md__0M8KR","grid":"ListViewSwitcher-module_grid__qBmnM","list":"ListViewSwitcher-module_list__NORMp"};
2706
+
2707
+ const ListViewSwitcher = ({
2708
+ enabled,
2709
+ onChange,
2710
+ size = 'md'
2711
+ }) => ( /*#__PURE__*/React.createElement("label", {
2712
+ "data-testid": "listViewSwitcher",
2713
+ className: makeClassName([[styles$2.root, true], [styles$2[size], true]])
2714
+ }, /*#__PURE__*/React.createElement("input", {
2715
+ className: styles$2.input,
2716
+ type: "checkbox",
2717
+ checked: enabled,
2718
+ onChange: onChange
2719
+ }), /*#__PURE__*/React.createElement("span", {
2720
+ className: styles$2.knob
2721
+ }), /*#__PURE__*/React.createElement("span", {
2722
+ className: styles$2.grid
2723
+ }), /*#__PURE__*/React.createElement("span", {
2724
+ className: styles$2.list
2725
+ })));
2726
+
2727
+ var styles$1 = {"root":"ToolbarButton-module_root__upsEH","isDark":"ToolbarButton-module_isDark__gWpv-","dark":"ToolbarButton-module_dark__5XOEp","bookmark":"ToolbarButton-module_bookmark__7SWkm","isActive":"ToolbarButton-module_isActive__N4kkV","icon":"ToolbarButton-module_icon__Ldcgq","text":"ToolbarButton-module_text__4R2a0"};
2728
+
2729
+ const ToolbarButton = ({
2730
+ type,
2731
+ theme,
2732
+ isActive,
2733
+ lang = 'ru',
2734
+ text,
2735
+ icon,
2736
+ onClick
2737
+ }) => {
2738
+ const classNames = [[styles$1.root, true], [styles$1[type], !!styles$1[type]], [styles$1[theme], !!styles$1[theme] && !!theme], [styles$1.isActive, !!isActive]];
2739
+ const label = SocialLabels[lang][type];
2740
+ return /*#__PURE__*/React.createElement("button", {
2741
+ "data-testid": "toolbar-button",
2742
+ className: makeClassName(classNames),
2743
+ type: "button",
2744
+ onClick: event => onClick(event, type)
2745
+ }, icon && ( /*#__PURE__*/React.createElement("div", {
2746
+ className: styles$1.icon
2747
+ }, /*#__PURE__*/React.createElement(SvgSymbol, {
2748
+ size: "medium",
2749
+ icon: icon,
2750
+ styleContext: "isInToolbar"
2751
+ }))), /*#__PURE__*/React.createElement("span", {
2752
+ className: styles$1.text
2753
+ }, text || label));
2754
+ };
2755
+
2756
+ var styles = {"root":"Tooltip-module_root__xK21R","isCenterBottom":"Tooltip-module_isCenterBottom__-qv7D","isLeftBottom":"Tooltip-module_isLeftBottom__0-f5z","isCenterTop":"Tooltip-module_isCenterTop__xQ3Ql","isLeftTop":"Tooltip-module_isLeftTop__yjKrV","body":"Tooltip-module_body__5qgzu","footer":"Tooltip-module_footer__swU9S"};
2757
+
2758
+ const capitalizeFirstLetter = string => string.charAt(0).toUpperCase() + string.slice(1);
2759
+
2760
+ const Tooltip = ({
2761
+ children,
2762
+ position
2763
+ }) => {
2764
+ const [x, y] = position;
2765
+ const positionClass = `is${capitalizeFirstLetter(x)}${capitalizeFirstLetter(y)}`;
2766
+ return /*#__PURE__*/React.createElement("div", {
2767
+ className: makeClassName([[styles.root, true], [styles[positionClass], true]])
2768
+ }, /*#__PURE__*/React.createElement("div", {
2769
+ className: styles.body
2770
+ }, children));
2771
+ };
2772
+
2773
+ const TooltipFooter = ({
2774
+ children
2775
+ }) => {
2776
+ return /*#__PURE__*/React.createElement("div", {
2777
+ className: styles.footer
2778
+ }, children);
2779
+ };
2780
+
2781
+ exports.AnnouncementInText = AnnouncementInText;
2782
+ exports.BookmarkButton = BookmarkButton;
2783
+ exports.Button = Button;
2784
+ exports.ButtonLoader = ButtonLoader;
2785
+ exports.CardTitle = CardTitle;
2786
+ exports.ChapterBlock = ChapterBlock;
2787
+ exports.Cover = Cover;
2788
+ exports.DocumentItemsCount = DocumentItemsCount;
2789
+ exports.DonatesTeaser = DonatesTeaser;
2790
+ exports.DotsOnImage = DotsOnImage;
2791
+ exports.Dropdown = Dropdown;
2792
+ exports.EmbedBlockContainer = EmbedBlockContainer;
2793
+ exports.Footnote = Footnote;
2794
+ exports.GroupedBlock = GroupedBlock;
2795
+ exports.HalfBlock = HalfBlock;
2796
+ exports.Image = Image;
2797
+ exports.ImportantLead = ImportantLead;
2798
+ exports.Lazy = Lazy;
2799
+ exports.ListBlock = ListBlock;
2800
+ exports.ListViewSwitcher = ListViewSwitcher;
2801
+ exports.MaterialNote = MaterialNote;
2802
+ exports.MaterialTitle = MaterialTitle;
2803
+ exports.MediaCaption = MediaCaption;
2804
+ exports.Menu = Menu;
2805
+ exports.Meta = Meta;
2806
+ exports.MetaItem = MetaItem;
2807
+ exports.MetaItemLive = MetaItemLive;
2808
+ exports.Popover = Popover;
2809
+ exports.Primary = Primary;
2810
+ exports.QuoteBlock = QuoteBlock;
2811
+ exports.RawHtmlBlock = RawHtmlBlock;
2812
+ exports.RelatedBlock = RelatedBlock;
2813
+ exports.RelatedRichBlock = RelatedRichBlock;
2814
+ exports.RenderBlocks = RenderBlocks;
2815
+ exports.RichTitle = RichTitle;
2816
+ exports.Secondary = Secondary;
2817
+ exports.SensitiveBlock = SensitiveBlock;
2818
+ exports.ShopRelatedBlock = ShopRelatedBlock;
2819
+ exports.SimpleBlock = SimpleBlock;
2820
+ exports.SimpleTitle = SimpleTitle;
2821
+ exports.SourceBlock = SourceBlock;
2822
+ exports.Spoiler = Spoiler;
2823
+ exports.SvgSymbol = SvgSymbol;
2824
+ exports.Switcher = Switcher;
2825
+ exports.Table = Table;
2826
+ exports.Tag = Tag;
2827
+ exports.Timestamp = Timestamp;
2828
+ exports.Toolbar = Toolbar;
2829
+ exports.ToolbarButton = ToolbarButton;
2830
+ exports.ToolbarItem = ToolbarItem;
2831
+ exports.Tooltip = Tooltip;
2832
+ exports.TooltipFooter = TooltipFooter;
2833
+ //# sourceMappingURL=ui-kit-2.cjs.development.js.map