@meduza/ui-kit-2 0.3.0 → 0.4.0

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 (188) hide show
  1. package/dist/AnnouncementInText/AnnouncementInText.types.d.ts +4 -4
  2. package/dist/AnnouncementInText/index.d.ts +3 -3
  3. package/dist/BookmarkButton/BookmarkButton.types.d.ts +6 -6
  4. package/dist/BookmarkButton/index.d.ts +3 -3
  5. package/dist/Button/Button.d.ts +3 -3
  6. package/dist/Button/Button.types.d.ts +16 -16
  7. package/dist/Button/ButtonLoader.d.ts +2 -2
  8. package/dist/Button/index.d.ts +2 -2
  9. package/dist/CardTitle/CardTitle.types.d.ts +10 -10
  10. package/dist/CardTitle/index.d.ts +3 -3
  11. package/dist/ChapterBlock/ChapterBlock.types.d.ts +7 -7
  12. package/dist/ChapterBlock/index.d.ts +3 -3
  13. package/dist/Cover/Cover.types.d.ts +24 -24
  14. package/dist/Cover/index.d.ts +3 -3
  15. package/dist/DocumentItemsCount/DocumentItemsCount.types.d.ts +6 -7
  16. package/dist/DocumentItemsCount/index.d.ts +3 -3
  17. package/dist/DonatesTeaser/DonatesTeaser.types.d.ts +4 -4
  18. package/dist/DonatesTeaser/index.d.ts +3 -3
  19. package/dist/DotsOnImage/DotsOnImage.types.d.ts +46 -46
  20. package/dist/DotsOnImage/index.d.ts +3 -3
  21. package/dist/Dropdown/Dropdown.types.d.ts +5 -6
  22. package/dist/Dropdown/index.d.ts +4 -4
  23. package/dist/EmbedBlock/EmbedBlock.d.ts +3 -3
  24. package/dist/EmbedBlock/EmbedBlock.types.d.ts +12 -11
  25. package/dist/EmbedBlock/EmbedGif.d.ts +3 -3
  26. package/dist/EmbedBlock/IframeBlock.d.ts +3 -3
  27. package/dist/EmbedBlock/index.d.ts +3 -3
  28. package/dist/Footnote/Footnote.types.d.ts +5 -5
  29. package/dist/Footnote/index.d.ts +3 -3
  30. package/dist/GroupedBlock/GroupedBlock.types.d.ts +4 -4
  31. package/dist/GroupedBlock/index.d.ts +3 -3
  32. package/dist/HalfBlock/HalfBlock.types.d.ts +4 -4
  33. package/dist/HalfBlock/index.d.ts +3 -3
  34. package/dist/Image/Image.types.d.ts +35 -35
  35. package/dist/Image/RenderPicture.d.ts +4 -4
  36. package/dist/Image/index.d.ts +3 -3
  37. package/dist/ImportantLead/ImportantLead.types.d.ts +4 -4
  38. package/dist/ImportantLead/index.d.ts +3 -3
  39. package/dist/Lazy/Lazy.types.d.ts +4 -5
  40. package/dist/Lazy/index.d.ts +3 -3
  41. package/dist/ListBlock/ListBlock.types.d.ts +9 -10
  42. package/dist/ListBlock/index.d.ts +3 -3
  43. package/dist/MaterialNote/MaterialNote.types.d.ts +13 -13
  44. package/dist/MaterialNote/index.d.ts +3 -3
  45. package/dist/MaterialTitle/MaterialTitle.types.d.ts +4 -4
  46. package/dist/MaterialTitle/index.d.ts +5 -5
  47. package/dist/MediaCaption/MediaCaption.types.d.ts +5 -5
  48. package/dist/MediaCaption/index.d.ts +3 -3
  49. package/dist/Meta/Meta.types.d.ts +19 -19
  50. package/dist/Meta/MetaContainer.d.ts +3 -3
  51. package/dist/Meta/index.d.ts +3 -3
  52. package/dist/MetaItem/MetaItem.types.d.ts +7 -7
  53. package/dist/MetaItem/index.d.ts +3 -3
  54. package/dist/MetaItemLive/MetaItemLive.types.d.ts +3 -3
  55. package/dist/MetaItemLive/index.d.ts +3 -3
  56. package/dist/Popover/Popover.types.d.ts +5 -5
  57. package/dist/Popover/index.d.ts +3 -3
  58. package/dist/QuoteBlock/QuoteBlock.types.d.ts +6 -6
  59. package/dist/QuoteBlock/index.d.ts +3 -3
  60. package/dist/RawHtmlBlock/RawHtmlBlock.types.d.ts +17 -17
  61. package/dist/RawHtmlBlock/index.d.ts +3 -3
  62. package/dist/RelatedBlock/RelatedBlock.types.d.ts +17 -17
  63. package/dist/RelatedBlock/index.d.ts +3 -3
  64. package/dist/RelatedRichBlock/RelatedRichBlock.types.d.ts +4 -4
  65. package/dist/RelatedRichBlock/index.d.ts +3 -3
  66. package/dist/RenderBlocks/RenderBlocks.types.d.ts +11 -11
  67. package/dist/RenderBlocks/index.d.ts +3 -3
  68. package/dist/RichTitle/RichTitle.types.d.ts +12 -13
  69. package/dist/RichTitle/index.d.ts +3 -3
  70. package/dist/SensitiveBlock/SensitiveBlock.types.d.ts +15 -15
  71. package/dist/SensitiveBlock/index.d.ts +3 -3
  72. package/dist/ShopRelatedBlock/ShopRelatedBlock.types.d.ts +4 -4
  73. package/dist/ShopRelatedBlock/index.d.ts +3 -3
  74. package/dist/SimpleBlock/SimpleBlock.types.d.ts +4 -4
  75. package/dist/SimpleBlock/index.d.ts +3 -3
  76. package/dist/SimpleTitle/SimpleTitle.types.d.ts +9 -9
  77. package/dist/SimpleTitle/index.d.ts +3 -3
  78. package/dist/SourceBlock/SourceBlock.types.d.ts +15 -15
  79. package/dist/SourceBlock/index.d.ts +3 -3
  80. package/dist/Spoiler/Spoiler.types.d.ts +4 -4
  81. package/dist/Spoiler/index.d.ts +3 -3
  82. package/dist/SvgSymbol/SvgSymbol.types.d.ts +8 -8
  83. package/dist/SvgSymbol/icons.d.ts +167 -167
  84. package/dist/SvgSymbol/index.d.ts +3 -3
  85. package/dist/Switcher/Switcher.types.d.ts +12 -12
  86. package/dist/Switcher/index.d.ts +3 -3
  87. package/dist/Table/Table.types.d.ts +25 -25
  88. package/dist/Table/index.d.ts +3 -3
  89. package/dist/Tag/Tag.types.d.ts +12 -12
  90. package/dist/Tag/index.d.ts +3 -3
  91. package/dist/Timestamp/Timestamp.types.d.ts +5 -5
  92. package/dist/Timestamp/index.d.ts +4 -4
  93. package/dist/Toolbar/Toolbar.d.ts +3 -3
  94. package/dist/Toolbar/Toolbar.types.d.ts +7 -8
  95. package/dist/Toolbar/ToolbarItem.d.ts +3 -3
  96. package/dist/Toolbar/index.d.ts +2 -2
  97. package/dist/ToolbarButton/ToolbarButton.types.d.ts +10 -10
  98. package/dist/ToolbarButton/index.d.ts +3 -3
  99. package/dist/Tooltip/Tooltip.d.ts +3 -3
  100. package/dist/Tooltip/Tooltip.types.d.ts +8 -8
  101. package/dist/Tooltip/TooltipFooter.d.ts +3 -3
  102. package/dist/Tooltip/index.d.ts +2 -2
  103. package/dist/constants.d.ts +41 -41
  104. package/dist/index.d.ts +45 -45
  105. package/dist/index.js +2 -2
  106. package/dist/types.d.ts +20 -20
  107. package/dist/ui-kit.css +3894 -4102
  108. package/dist/uikit.cjs.development.js +2706 -0
  109. package/dist/uikit.cjs.development.js.map +1 -0
  110. package/dist/uikit.cjs.production.min.js +2 -0
  111. package/dist/uikit.cjs.production.min.js.map +1 -0
  112. package/dist/uikit.esm.js +2652 -0
  113. package/dist/uikit.esm.js.map +1 -0
  114. package/dist/utils/BlockContext.d.ts +8 -8
  115. package/dist/utils/DangerousHtml.d.ts +8 -8
  116. package/dist/utils/capitalizeFirstLetter.d.ts +1 -1
  117. package/dist/utils/converCase.d.ts +2 -2
  118. package/dist/utils/generateGradient.d.ts +2 -2
  119. package/dist/utils/getElementPositionRelativeToViewport.d.ts +2 -2
  120. package/dist/utils/makeClassName.d.ts +3 -3
  121. package/dist/utils/makeStyleContext.d.ts +3 -3
  122. package/dist/utils/pluralize.d.ts +2 -2
  123. package/dist/utils/postMessage.d.ts +2 -2
  124. package/dist/utils/viewportSize.d.ts +6 -6
  125. package/package.json +68 -62
  126. package/src/BookmarkButton/BookmarkButton.css +4 -3
  127. package/src/BookmarkButton/BookmarkButton.module.css +4 -3
  128. package/src/Button/Button.module.css +29 -19
  129. package/src/Cover/Cover.module.css +20 -13
  130. package/src/EmbedBlock/EmbedBlock.types.ts +1 -0
  131. package/src/Toolbar/Toolbar.module.css +13 -12
  132. package/src/Toolbar/Toolbar.stories.tsx +1 -3
  133. package/src/ToolbarButton/ToolbarButton.module.css +8 -7
  134. package/src/ToolbarButton/ToolbarButton.stories.tsx +1 -3
  135. package/src/ToolbarButton/ToolbarButton.test.tsx +1 -3
  136. package/src/Tooltip/Tooltip.module.css +13 -6
  137. package/dist/AnnouncementInText/AnnouncementInText.stories.d.ts +0 -10
  138. package/dist/BookmarkButton/BookmarkButton.stories.d.ts +0 -10
  139. package/dist/Button/Button.stories.d.ts +0 -10
  140. package/dist/CardTitle/CardTitle.stories.d.ts +0 -10
  141. package/dist/ChapterBlock/ChapterBlock.stories.d.ts +0 -10
  142. package/dist/Cover/Cover.stories.d.ts +0 -10
  143. package/dist/DocumentItemsCount/DocumentItemsCount.stories.d.ts +0 -10
  144. package/dist/DonatesTeaser/DonatesTeaser.stories.d.ts +0 -10
  145. package/dist/DotsOnImage/DotsOnImage.stories.d.ts +0 -10
  146. package/dist/Dropdown/Dropdown.stories.d.ts +0 -10
  147. package/dist/EmbedBlock/EmbedBlock.stories.d.ts +0 -10
  148. package/dist/Footnote/Footnote.stories.d.ts +0 -10
  149. package/dist/GroupedBlock/GroupedBlock.stories.d.ts +0 -10
  150. package/dist/HalfBlock/HalfBlock.stories.d.ts +0 -10
  151. package/dist/Image/Image.stories.d.ts +0 -10
  152. package/dist/ImportantLead/ImportantLead.stories.d.ts +0 -10
  153. package/dist/Lazy/Lazy.stories.d.ts +0 -10
  154. package/dist/ListBlock/ListBlock.stories.d.ts +0 -11
  155. package/dist/MaterialNote/MaterialNote.stories.d.ts +0 -11
  156. package/dist/MaterialTitle/MaterialTitle.stories.d.ts +0 -10
  157. package/dist/MediaCaption/MediaCaption.stories.d.ts +0 -10
  158. package/dist/Meta/Meta.stories.d.ts +0 -10
  159. package/dist/MetaItem/MetaItem.stories.d.ts +0 -10
  160. package/dist/MetaItemLive/MetaItemLive.stories.d.ts +0 -10
  161. package/dist/Popover/Popover.stories.d.ts +0 -10
  162. package/dist/QuoteBlock/QuoteBlock.stories.d.ts +0 -10
  163. package/dist/RawHtmlBlock/RawHtmlBlock.stories.d.ts +0 -10
  164. package/dist/RelatedBlock/RelatedBlock.stories.d.ts +0 -10
  165. package/dist/RelatedRichBlock/RelatedRichBlock.stories.d.ts +0 -10
  166. package/dist/RenderBlocks/RenderBlocks.stories.d.ts +0 -10
  167. package/dist/RichTitle/RichTitle.stories.d.ts +0 -10
  168. package/dist/SensitiveBlock/SensitiveBlock.stories.d.ts +0 -10
  169. package/dist/ShopRelatedBlock/ShopRelatedBlock.stories.d.ts +0 -10
  170. package/dist/SimpleBlock/SimpleBlock.stories.d.ts +0 -10
  171. package/dist/SimpleTitle/SimpleTitle.stories.d.ts +0 -10
  172. package/dist/SourceBlock/SourceBlock.stories.d.ts +0 -10
  173. package/dist/Spoiler/Spoiler.stories.d.ts +0 -10
  174. package/dist/SvgSymbol/SvgSymbol.stories.d.ts +0 -10
  175. package/dist/Switcher/Switcher.stories.d.ts +0 -10
  176. package/dist/Table/Table.stories.d.ts +0 -10
  177. package/dist/Tag/Tag.stories.d.ts +0 -10
  178. package/dist/Timestamp/Timestamp.stories.d.ts +0 -10
  179. package/dist/Toolbar/Toolbar.stories.d.ts +0 -10
  180. package/dist/ToolbarButton/ToolbarButton.stories.d.ts +0 -10
  181. package/dist/Tooltip/Tooltip.stories.d.ts +0 -10
  182. package/dist/_storybook/PreviewWrapper/index.d.ts +0 -6
  183. package/dist/ui-kit-2.cjs.development.js +0 -2906
  184. package/dist/ui-kit-2.cjs.development.js.map +0 -1
  185. package/dist/ui-kit-2.cjs.production.min.js +0 -2
  186. package/dist/ui-kit-2.cjs.production.min.js.map +0 -1
  187. package/dist/ui-kit-2.esm.js +0 -2849
  188. package/dist/ui-kit-2.esm.js.map +0 -1
@@ -0,0 +1,2652 @@
1
+ import React, { useState, useEffect, useContext, useRef, useCallback } from 'react';
2
+ import { useInView } from 'react-intersection-observer';
3
+ import dayjs from 'dayjs';
4
+ import 'dayjs/locale/ru';
5
+ import relativeTime from 'dayjs/plugin/relativeTime';
6
+ import { Link } from 'react-router-dom';
7
+
8
+ const makeClassName = list => {
9
+ return list.filter(([, active]) => active).map(([className]) => className).join(' ');
10
+ };
11
+
12
+ const ButtonLoader = () => /*#__PURE__*/React.createElement("svg", {
13
+ width: "30px",
14
+ height: "30px",
15
+ viewBox: "0 0 30 30",
16
+ xmlns: "http://www.w3.org/2000/svg"
17
+ }, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
18
+ 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",
19
+ opacity: "0.3"
20
+ })), /*#__PURE__*/React.createElement("g", {
21
+ fillRule: "evenodd"
22
+ }, /*#__PURE__*/React.createElement("animateTransform", {
23
+ attributeName: "transform",
24
+ type: "rotate",
25
+ from: "0 15 15",
26
+ to: "360 15 15",
27
+ dur: "1000ms",
28
+ repeatCount: "indefinite"
29
+ }), /*#__PURE__*/React.createElement("path", {
30
+ 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"
31
+ })));
32
+
33
+ var styles$G = {"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"};
34
+
35
+ const Button = ({
36
+ theme = 'gold',
37
+ size = 'default',
38
+ state = 'isDefault',
39
+ styleContext = 'isInToolbar',
40
+ appearance,
41
+ disabled = false,
42
+ onClick,
43
+ children
44
+ }) => {
45
+ const handleClick = () => {
46
+ if (disabled || !onClick) {
47
+ return;
48
+ }
49
+ onClick();
50
+ };
51
+ return /*#__PURE__*/React.createElement("button", {
52
+ "data-testid": "button",
53
+ className: makeClassName([[styles$G.root, true], [styles$G[size], !!size], [styles$G[theme], !!theme], [styles$G[appearance], !!appearance], [styles$G[state], !!state && !!styles$G[state]], [styles$G[styleContext], !!styleContext]]),
54
+ disabled: disabled,
55
+ onClick: handleClick,
56
+ type: "button"
57
+ }, state === 'isLoading' ? /*#__PURE__*/React.createElement("span", {
58
+ className: styles$G.loader
59
+ }, /*#__PURE__*/React.createElement(ButtonLoader, null)) : children);
60
+ };
61
+
62
+ const icons = {
63
+ meduzaLogo: {
64
+ width: 544,
65
+ height: 115,
66
+ 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" />'
67
+ },
68
+ menu: {
69
+ width: 24,
70
+ height: 24,
71
+ content: '<path d="M2 21h20M2 12h20M2 3h20" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke" />'
72
+ },
73
+ fb: {
74
+ width: 16,
75
+ height: 18,
76
+ 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" />'
77
+ },
78
+ tw: {
79
+ width: 20,
80
+ height: 18,
81
+ 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"/>'
82
+ },
83
+ vk: {
84
+ width: 20,
85
+ height: 18,
86
+ 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"/>'
87
+ },
88
+ ok: {
89
+ width: 9,
90
+ height: 18,
91
+ 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"/>'
92
+ },
93
+ tg: {
94
+ width: 18,
95
+ height: 18,
96
+ 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"/>'
97
+ },
98
+ meduzaSymbol: {
99
+ width: 24,
100
+ height: 18,
101
+ 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" />'
102
+ },
103
+ backward: {
104
+ width: 25,
105
+ height: 27,
106
+ 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"/>'
107
+ },
108
+ forward: {
109
+ width: 25,
110
+ height: 27,
111
+ 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"/>'
112
+ },
113
+ download: {
114
+ width: 25,
115
+ height: 27,
116
+ 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" />'
117
+ },
118
+ play: {
119
+ width: 62,
120
+ height: 62,
121
+ 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"/>'
122
+ },
123
+ pause: {
124
+ width: 22,
125
+ height: 22,
126
+ 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" />'
127
+ },
128
+ speedHalf: {
129
+ width: 25,
130
+ height: 27,
131
+ 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" />'
132
+ },
133
+ speedOne: {
134
+ width: 25,
135
+ height: 27,
136
+ 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"/>'
137
+ },
138
+ speedOneHalf: {
139
+ width: 25,
140
+ height: 27,
141
+ 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"/>'
142
+ },
143
+ speedTwo: {
144
+ width: 25,
145
+ height: 27,
146
+ 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"/>'
147
+ },
148
+ podcastBookmark: {
149
+ width: 25,
150
+ height: 27,
151
+ 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" />'
152
+ },
153
+ reaction: {
154
+ width: 16,
155
+ height: 16,
156
+ 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" />'
157
+ },
158
+ cross: {
159
+ width: 18,
160
+ height: 18,
161
+ 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" />'
162
+ },
163
+ link: {
164
+ width: 24,
165
+ height: 24,
166
+ 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" />'
167
+ },
168
+ search: {
169
+ width: 16,
170
+ height: 16,
171
+ 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>'
172
+ },
173
+ card: {
174
+ width: 15,
175
+ height: 15,
176
+ 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"/>'
177
+ },
178
+ podcast: {
179
+ width: 15,
180
+ height: 15,
181
+ 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" />'
182
+ },
183
+ arrow: {
184
+ width: 12,
185
+ height: 12,
186
+ 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" />'
187
+ },
188
+ brent: {
189
+ width: 9,
190
+ height: 12,
191
+ 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> '
192
+ },
193
+ user: {
194
+ width: 16,
195
+ height: 16,
196
+ 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" />'
197
+ },
198
+ bookmark: {
199
+ width: 17,
200
+ height: 21,
201
+ content: '<path d="M16 20l-7.5-6.333L1 20V1h15z" stroke="currentColor" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"/>'
202
+ },
203
+ shareBookmark: {
204
+ width: 11,
205
+ height: 15,
206
+ 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"/>'
207
+ },
208
+ receipt: {
209
+ width: 10,
210
+ height: 13,
211
+ 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>'
212
+ },
213
+ read: {
214
+ width: 15,
215
+ height: 15,
216
+ 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>'
217
+ },
218
+ listened: {
219
+ width: 15,
220
+ height: 15,
221
+ 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>'
222
+ },
223
+ magic: {
224
+ width: 15,
225
+ height: 15,
226
+ 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>'
227
+ }
228
+ };
229
+
230
+ var styles$F = {"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"};
231
+
232
+ const SvgSymbol = ({
233
+ icon,
234
+ size,
235
+ styleContext
236
+ }) => {
237
+ const data = icons[icon];
238
+ return /*#__PURE__*/React.createElement("svg", {
239
+ "data-testid": "svg-symbol",
240
+ xmlns: "http://www.w3.org/2000/svg",
241
+ xmlnsXlink: "http://www.w3.org/1999/xlink",
242
+ className: makeClassName([[styles$F.root, true], [styles$F[size], !!styles$F[size]], [styles$F[icon], !!styles$F[icon]], [styles$F[styleContext], !!styles$F[styleContext]]]),
243
+ width: data.width,
244
+ height: data.height,
245
+ viewBox: `0 0 ${data.width} ${data.height}`,
246
+ dangerouslySetInnerHTML: {
247
+ __html: data.content
248
+ }
249
+ });
250
+ };
251
+
252
+ var styles$E = {"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","children":"Switcher-module_children__uLapU","left":"Switcher-module_left__5-HNa","right":"Switcher-module_right__82Edk","isInPanel":"Switcher-module_isInPanel__-nBSf","isInMenu":"Switcher-module_isInMenu__RQVhp","isInLive":"Switcher-module_isInLive__ZyMCT"};
253
+
254
+ const Switcher = ({
255
+ enabled,
256
+ children,
257
+ childrenPosition = 'left',
258
+ onChange,
259
+ styleContext,
260
+ theme = 'light'
261
+ }) => /*#__PURE__*/React.createElement("label", {
262
+ "data-testid": "switcher",
263
+ className: makeClassName([[styles$E.root, true], [styles$E[theme], !!styles$E[theme]], [styles$E[styleContext], !!styles$E[styleContext]]])
264
+ }, children && childrenPosition === 'left' && /*#__PURE__*/React.createElement("div", {
265
+ className: makeClassName([[styles$E.children, true], [styles$E.left, true]])
266
+ }, children), /*#__PURE__*/React.createElement("input", {
267
+ className: styles$E.input,
268
+ type: "checkbox",
269
+ checked: enabled,
270
+ onChange: onChange
271
+ }), /*#__PURE__*/React.createElement("span", {
272
+ className: styles$E.control
273
+ }, /*#__PURE__*/React.createElement("span", {
274
+ className: styles$E.knob
275
+ })), children && childrenPosition === 'right' && /*#__PURE__*/React.createElement("div", {
276
+ className: makeClassName([[styles$E.children, true], [styles$E.right, true]])
277
+ }, children));
278
+
279
+ const makeStyleContext = (classNames, styleContext, styles) => {
280
+ const context = Array.isArray(styleContext) ? styleContext.filter(ctx => styles[ctx]).map(ctx => [[styles[ctx]], true]) : [[styles[styleContext], !!styleContext && !!styles[styleContext]]];
281
+ return classNames.concat(context);
282
+ };
283
+
284
+ const BlockContext = /*#__PURE__*/React.createContext({
285
+ lightBox: null
286
+ });
287
+ const BlockProvider = BlockContext.Provider;
288
+
289
+ const POST_MESSAGE_PREFIX = 'mdzKitMsg';
290
+ const postMessage = (category, element, action) => {
291
+ const target = window.top;
292
+ const msg = `${POST_MESSAGE_PREFIX}=${JSON.stringify({
293
+ category,
294
+ element,
295
+ action
296
+ })}`;
297
+ if (typeof target !== 'undefined') {
298
+ target.postMessage(msg, '*');
299
+ }
300
+ };
301
+
302
+ var styles$D = {"root":"Lazy-module_root__DWw8D"};
303
+
304
+ const Lazy = ({
305
+ children,
306
+ threshold
307
+ }) => {
308
+ const [ref, inView, entry] = useInView({
309
+ threshold: threshold || 0
310
+ });
311
+ const [visible, setVisible] = useState(false);
312
+ useEffect(() => {
313
+ if (entry && entry.boundingClientRect && entry.boundingClientRect.y < 0) {
314
+ setVisible(true);
315
+ }
316
+ }, [entry]);
317
+ useEffect(() => {
318
+ if (inView) {
319
+ setVisible(true);
320
+ }
321
+ }, [inView]);
322
+ return /*#__PURE__*/React.createElement("div", {
323
+ className: makeClassName([[styles$D.root, true], [styles$D.visible, visible]]),
324
+ ref: ref,
325
+ "data-testid": "lazy"
326
+ }, visible && children);
327
+ };
328
+
329
+ const MediaQuerySizes = {
330
+ MOBILE: 512,
331
+ PORTRAIT_TABLET: 768,
332
+ LANDSCAPE_TABLET: 1024,
333
+ DESKTOP: 1010,
334
+ WIDE_DESKTOP: 1200
335
+ };
336
+ const imageBreakpoints = {
337
+ 325: '(min-width: 0)',
338
+ 520: '(min-width: 325px)',
339
+ 600: '(min-width: 600px)',
340
+ 650: '(min-width: 650px)',
341
+ 980: '(min-width: 1000px)',
342
+ 1335: '(min-width: 1000px)'
343
+ };
344
+ const imageConditionalKeys = {
345
+ xs: [325],
346
+ superFull: [1335, 650, 520, 325],
347
+ full: [980, 650, 520, 325],
348
+ default: [650, 520, 325],
349
+ narrow: [600, 325]
350
+ };
351
+ const SocialLabels = {
352
+ ru: {
353
+ tg: 'Телеграм',
354
+ fb: 'Фейсбук',
355
+ tw: 'Твиттер',
356
+ pdf: 'PDF',
357
+ unblock: 'Magic link',
358
+ bookmark: 'В закладки',
359
+ reaction: 'Напишите нам'
360
+ },
361
+ en: {
362
+ tg: 'Telegram',
363
+ fb: 'Fb',
364
+ tw: 'Twitter',
365
+ pdf: 'PDF',
366
+ unblock: 'Magic link',
367
+ bookmark: 'Add to bookmarks'
368
+ }
369
+ };
370
+
371
+ const toCamel = s => s.replace(/([_][a-z])/gi, str => str.toUpperCase().replace('_', ''));
372
+ const toCapitalize = s => s[0].toUpperCase() + s.slice(1);
373
+
374
+ const RenderPicture = ({
375
+ source,
376
+ fallbackSource,
377
+ optimized,
378
+ alt,
379
+ display,
380
+ onLoad
381
+ }) => {
382
+ const [fallback, setFallback] = useState(false);
383
+ useEffect(() => {
384
+ setFallback(!window.HTMLPictureElement);
385
+ }, []);
386
+ const keys = imageConditionalKeys[toCamel(display)] || imageConditionalKeys.default;
387
+ return /*#__PURE__*/React.createElement("picture", null, source && /*#__PURE__*/React.createElement("source", {
388
+ media: "(min-width: 325px)",
389
+ srcSet: `${source[1]} 2x`
390
+ }), optimized && !optimized.w325 && /*#__PURE__*/React.createElement("source", {
391
+ media: "(min-width: 0)",
392
+ srcSet: `${optimized.original}`
393
+ }), optimized && keys.map(key => {
394
+ const breakpoint = optimized[`w${key}`];
395
+ if (!breakpoint) {
396
+ return null;
397
+ }
398
+ return /*#__PURE__*/React.createElement(React.Fragment, {
399
+ key: key
400
+ }, /*#__PURE__*/React.createElement("source", {
401
+ type: "image/webp",
402
+ media: imageBreakpoints[key],
403
+ srcSet: `${breakpoint['2x_webp']} 2x, ${breakpoint['1x_webp']} 1x `
404
+ }), /*#__PURE__*/React.createElement("source", {
405
+ type: "image/png",
406
+ media: imageBreakpoints[key],
407
+ srcSet: `${breakpoint['2x']} 2x, ${breakpoint['1x']} 1x `
408
+ }));
409
+ }), /*#__PURE__*/React.createElement("img", {
410
+ src: fallback ? fallbackSource : 'data:image/gif;base64,R0lGODlhAQABAPAAAPLy8gAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==',
411
+ alt: alt,
412
+ onLoad: () => onLoad(true)
413
+ }));
414
+ };
415
+
416
+ var styles$C = {"root":"Image-module_root__H5wAh","isLoaded":"Image-module_isLoaded__keFnD","wrapper":"Image-module_wrapper__gJtbB","fullscreen":"Image-module_fullscreen__4PU9c","dark":"Image-module_dark__qjo5O"};
417
+
418
+ const Image = ({
419
+ alt,
420
+ display,
421
+ optimized,
422
+ width,
423
+ height,
424
+ source,
425
+ lazy,
426
+ ratio,
427
+ styleContext,
428
+ fullscreen = true
429
+ }) => {
430
+ const {
431
+ lightBox
432
+ } = useContext(BlockContext);
433
+ const [isLoaded, setIsLoaded] = useState(lazy ? false : true);
434
+ const handleClick = () => {
435
+ if (!lightBox || !fullscreen || optimized && !optimized.original) {
436
+ return;
437
+ }
438
+ postMessage('', 'fullscreen_click', 'click');
439
+ lightBox.show(optimized, width, height, alt);
440
+ };
441
+ const blockStyles = {
442
+ maxWidth: width <= 649 ? width : '100%'
443
+ };
444
+ const pictureStyles = {
445
+ paddingBottom: `${100 / (ratio || width / height)}%`
446
+ };
447
+ /* fallback w325 url until w6 was released */
448
+ const fallbackSource = source && source[0] || optimized.w325 && optimized.w325['1x'] || optimized.original;
449
+ let classNames = [[styles$C.root, true], [styles$C.isLoaded, isLoaded], [styles$C.fullscreen, lightBox && optimized && optimized.original && fullscreen]];
450
+ if (styleContext) {
451
+ classNames = makeStyleContext(classNames, styleContext, styles$C);
452
+ }
453
+ return /*#__PURE__*/React.createElement("div", {
454
+ className: makeClassName(classNames),
455
+ style: blockStyles,
456
+ "data-testid": "image"
457
+ }, /*#__PURE__*/React.createElement("div", {
458
+ className: styles$C.wrapper,
459
+ style: pictureStyles,
460
+ onClick: () => handleClick(),
461
+ onKeyPress: () => handleClick(),
462
+ role: "button",
463
+ tabIndex: 0
464
+ }, lazy ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Lazy, {
465
+ threshold: 0.25
466
+ }, /*#__PURE__*/React.createElement(RenderPicture, {
467
+ fallbackSource: fallbackSource,
468
+ source: source,
469
+ optimized: optimized,
470
+ alt: alt,
471
+ display: display,
472
+ onLoad: setIsLoaded
473
+ })), /*#__PURE__*/React.createElement("noscript", null, /*#__PURE__*/React.createElement("img", {
474
+ src: fallbackSource,
475
+ alt: alt
476
+ }))) : /*#__PURE__*/React.createElement(RenderPicture, {
477
+ fallbackSource: fallbackSource,
478
+ source: source,
479
+ optimized: optimized,
480
+ alt: alt,
481
+ display: display,
482
+ onLoad: setIsLoaded
483
+ })));
484
+ };
485
+
486
+ var styles$B = {"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"};
487
+
488
+ const Popover = ({
489
+ children,
490
+ onClose
491
+ }) => {
492
+ const [visible, setVisible] = useState(true);
493
+ const handleClose = () => {
494
+ setVisible(false);
495
+ setTimeout(onClose, 350);
496
+ };
497
+ const handleScroll = () => {
498
+ handleClose();
499
+ };
500
+ const escFunction = event => {
501
+ if (event.key === 'Escape') {
502
+ handleClose();
503
+ }
504
+ };
505
+ useEffect(() => {
506
+ document.body.dataset.popover = 'true';
507
+ window.addEventListener('keydown', escFunction, false);
508
+ window.addEventListener('scroll', handleScroll, false);
509
+ return () => {
510
+ document.body.removeAttribute('data-popover');
511
+ window.removeEventListener('keydown', escFunction, false);
512
+ window.removeEventListener('scroll', handleScroll, false);
513
+ };
514
+ }, [visible]);
515
+ /* eslint-disable jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */
516
+ return /*#__PURE__*/React.createElement("div", {
517
+ "data-testid": "popover",
518
+ className: makeClassName([[styles$B.root, true], [styles$B.visible, visible]])
519
+ }, /*#__PURE__*/React.createElement("div", {
520
+ className: styles$B.overlay,
521
+ onClick: () => handleClose()
522
+ }), /*#__PURE__*/React.createElement("div", {
523
+ className: styles$B.container
524
+ }, /*#__PURE__*/React.createElement("button", {
525
+ type: "button",
526
+ className: styles$B.dismiss,
527
+ onClick: () => handleClose(),
528
+ "aria-label": "dismiss"
529
+ }), /*#__PURE__*/React.createElement("svg", {
530
+ width: "100%",
531
+ className: styles$B.background
532
+ }, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("mask", {
533
+ id: "myMask",
534
+ x: "0",
535
+ y: "0",
536
+ width: "100%",
537
+ height: "100%"
538
+ }, /*#__PURE__*/React.createElement("rect", {
539
+ fill: "white",
540
+ y: "0",
541
+ width: "100%",
542
+ height: "100%",
543
+ x: "0"
544
+ }), /*#__PURE__*/React.createElement("svg", {
545
+ x: "50%",
546
+ overflow: "visible"
547
+ }, /*#__PURE__*/React.createElement("g", {
548
+ transform: "translate(-12 0)"
549
+ }, /*#__PURE__*/React.createElement("path", {
550
+ 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"
551
+ }))))), /*#__PURE__*/React.createElement("rect", {
552
+ fill: "#F7F7F7",
553
+ id: "base-mask",
554
+ mask: "url(#myMask)",
555
+ x: "0",
556
+ y: "0",
557
+ width: "100%",
558
+ height: "100%"
559
+ })), /*#__PURE__*/React.createElement("div", {
560
+ className: styles$B.body
561
+ }, children)));
562
+ };
563
+
564
+ var styles$A = {"root":"Footnote-module_root__W5D8G","body":"Footnote-module_body__C-ZC-","dismiss":"Footnote-module_dismiss__Q2hAX"};
565
+
566
+ const Footnote = ({
567
+ children,
568
+ onClose
569
+ }) => {
570
+ return /*#__PURE__*/React.createElement("div", {
571
+ "data-testid": "footnote",
572
+ className: makeClassName([[styles$A.root, true]])
573
+ }, /*#__PURE__*/React.createElement("button", {
574
+ className: styles$A.dismiss,
575
+ type: "button",
576
+ onClick: () => onClose()
577
+ }, /*#__PURE__*/React.createElement(SvgSymbol, {
578
+ icon: "cross",
579
+ size: "unset"
580
+ })), /*#__PURE__*/React.createElement("div", {
581
+ className: styles$A.body
582
+ }, children));
583
+ };
584
+
585
+ var viewportSize = (() => ({
586
+ width: window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
587
+ height: window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
588
+ }));
589
+
590
+ var styles$z = {"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"};
591
+
592
+ const DotsOnImage = ({
593
+ block: {
594
+ optimized,
595
+ width,
596
+ height,
597
+ credit,
598
+ display,
599
+ dots
600
+ }
601
+ }) => {
602
+ const [ratio, setRatio] = useState(1);
603
+ const [ref, inView, entry] = useInView();
604
+ const container = useRef(null);
605
+ const [popover, setPopover] = useState({
606
+ title: null,
607
+ body: null,
608
+ show: false,
609
+ id: null
610
+ });
611
+ const [visible, setVisible] = useState(false);
612
+ const defaultWidth = 375;
613
+ useEffect(() => {
614
+ if (entry && entry.boundingClientRect && entry.boundingClientRect.y < 0) {
615
+ setVisible(true);
616
+ }
617
+ }, [entry]);
618
+ useEffect(() => {
619
+ if (inView) {
620
+ setVisible(true);
621
+ }
622
+ }, [inView]);
623
+ useEffect(() => {
624
+ if (popover.id) {
625
+ document.addEventListener('click', handleClickOutside);
626
+ } else {
627
+ document.removeEventListener('click', handleClickOutside);
628
+ }
629
+ return () => document.removeEventListener('click', handleClickOutside);
630
+ }, [popover]);
631
+ useEffect(() => {
632
+ setDotSize();
633
+ window.addEventListener('resize', setDotSize);
634
+ return () => document.removeEventListener('resize', setDotSize);
635
+ }, [visible]);
636
+ const setDotSize = () => {
637
+ const width = window.innerWidth;
638
+ if (width < defaultWidth) {
639
+ const ratio = width / defaultWidth;
640
+ setRatio(ratio);
641
+ } else {
642
+ setRatio(1);
643
+ }
644
+ };
645
+ const handleClickOutside = event => {
646
+ const path = event.composedPath();
647
+ if (path.indexOf(container.current) === -1) {
648
+ setPopover({
649
+ show: false
650
+ });
651
+ }
652
+ };
653
+ const handleDotClick = dot => {
654
+ const shouldShow = dot.id !== popover.id;
655
+ const side = dot.position.x > 50 ? 'isLeft' : 'isRight';
656
+ const align = dot.position.y > 50 ? 'isBottom' : 'isTop';
657
+ const style = {
658
+ top: `${dot.position.y}%`,
659
+ left: `${dot.position.x}%`
660
+ };
661
+ setPopover({
662
+ title: dot.title,
663
+ body: dot.body,
664
+ show: shouldShow,
665
+ id: shouldShow ? dot.id : null,
666
+ style,
667
+ side,
668
+ align
669
+ });
670
+ };
671
+ return /*#__PURE__*/React.createElement("div", {
672
+ className: makeClassName([[styles$z.root, true], [styles$z.isVisible, visible]]),
673
+ "data-testid": "dots-on-image",
674
+ ref: ref
675
+ }, /*#__PURE__*/React.createElement(Image, {
676
+ fullscreen: false,
677
+ optimized: optimized,
678
+ width: width,
679
+ height: height,
680
+ alt: credit,
681
+ display: display
682
+ }), /*#__PURE__*/React.createElement("div", {
683
+ ref: container
684
+ }, dots.map(dot => /*#__PURE__*/React.createElement("div", {
685
+ className: styles$z.dot,
686
+ key: dot.id,
687
+ style: {
688
+ top: `${dot.position.y}%`,
689
+ left: `${dot.position.x}%`,
690
+ transform: `scale(${ratio}) translate(-${50 / ratio}%, -${50 / ratio}%)`
691
+ }
692
+ }, /*#__PURE__*/React.createElement("button", {
693
+ className: makeClassName([[styles$z.marker, true], [styles$z.isActive, dot.id === popover.id]]),
694
+ type: "button",
695
+ style: {
696
+ backgroundColor: dot.icon.color
697
+ },
698
+ onClick: () => handleDotClick(dot)
699
+ }, dot.icon.type === 'svg' && /*#__PURE__*/React.createElement("div", {
700
+ dangerouslySetInnerHTML: {
701
+ __html: dot.icon.svg_string
702
+ }
703
+ }), dot.icon.type === 'number' && dot.icon.number))), popover.show && /*#__PURE__*/React.createElement(React.Fragment, null, viewportSize().width >= MediaQuerySizes.LANDSCAPE_TABLET ? /*#__PURE__*/React.createElement("div", {
704
+ className: makeClassName([[styles$z.popover, true], [styles$z[popover.side], !!popover.side], [styles$z[popover.align], !!popover.align]]),
705
+ style: popover.style
706
+ }, /*#__PURE__*/React.createElement(Footnote, {
707
+ onClose: () => {
708
+ setPopover({
709
+ show: false
710
+ });
711
+ }
712
+ }, popover.title && /*#__PURE__*/React.createElement("h3", null, popover.title), /*#__PURE__*/React.createElement("div", {
713
+ dangerouslySetInnerHTML: {
714
+ __html: popover.body
715
+ }
716
+ }))) : /*#__PURE__*/React.createElement(Popover, {
717
+ onClose: () => {
718
+ setPopover({
719
+ show: false
720
+ });
721
+ }
722
+ }, popover.title && /*#__PURE__*/React.createElement("h3", null, popover.title), /*#__PURE__*/React.createElement("div", {
723
+ dangerouslySetInnerHTML: {
724
+ __html: popover.body
725
+ }
726
+ })))));
727
+ };
728
+
729
+ var styles$y = {"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","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"};
730
+
731
+ const Tag = ({
732
+ children,
733
+ size = 'small',
734
+ theme = 'gold',
735
+ styleContext,
736
+ correlation,
737
+ onlyOn
738
+ }) => {
739
+ let classNames = [[styles$y.root, true], [styles$y[size], !!size && !!styles$y[size]], [styles$y[theme], !!theme && !!styles$y[theme]], [styles$y[onlyOn], !!onlyOn && !!styles$y[onlyOn]], [styles$y[correlation], !!correlation && !!styles$y[correlation]]];
740
+ if (styleContext) {
741
+ classNames = makeStyleContext(classNames, styleContext, styles$y);
742
+ }
743
+ return /*#__PURE__*/React.createElement("div", {
744
+ "data-testid": "tag",
745
+ className: makeClassName(classNames)
746
+ }, children);
747
+ };
748
+
749
+ var styles$x = {"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"};
750
+
751
+ const MediaCaption = ({
752
+ credit,
753
+ caption,
754
+ styleContext
755
+ }) => {
756
+ let classNames = [[styles$x.root, true]];
757
+ if (styleContext) {
758
+ classNames = makeStyleContext(classNames, styleContext, styles$x);
759
+ }
760
+ return /*#__PURE__*/React.createElement("div", {
761
+ "data-testid": "media-caption",
762
+ className: makeClassName(classNames)
763
+ }, caption && /*#__PURE__*/React.createElement("div", {
764
+ className: styles$x.caption,
765
+ dangerouslySetInnerHTML: {
766
+ __html: caption
767
+ }
768
+ }), credit && /*#__PURE__*/React.createElement("div", {
769
+ className: styles$x.credit,
770
+ dangerouslySetInnerHTML: {
771
+ __html: credit
772
+ }
773
+ }));
774
+ };
775
+
776
+ var styles$w = {"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"};
777
+
778
+ const Table = ({
779
+ styleContext,
780
+ block: {
781
+ rows,
782
+ options,
783
+ display,
784
+ columns_widths: columnsWidth,
785
+ table_credit: tableCredit
786
+ }
787
+ }) => {
788
+ const colors = {
789
+ '#ffffff': 'white',
790
+ '#f5f5f5': 'gray',
791
+ '#feeeee': 'pink',
792
+ '#e6f3ff': 'blue',
793
+ '#fffde6': 'yellow',
794
+ '#fff9f2': 'orange',
795
+ '#e7f2ef': 'green',
796
+ '#f4f0f8': 'violet'
797
+ };
798
+ let classNames = [[styles$w.root, true], [styles$w[display], !!display && !!styles$w[display]]];
799
+ if (styleContext) {
800
+ classNames = makeStyleContext(classNames, styleContext, styles$w);
801
+ }
802
+ return /*#__PURE__*/React.createElement("div", {
803
+ "data-testid": "table",
804
+ className: makeClassName(classNames)
805
+ }, /*#__PURE__*/React.createElement("div", {
806
+ className: styles$w.wrapper
807
+ }, /*#__PURE__*/React.createElement("div", {
808
+ className: styles$w.table
809
+ }, /*#__PURE__*/React.createElement("div", {
810
+ className: styles$w.tracks
811
+ }, rows.map((row, i) => {
812
+ return /*#__PURE__*/React.createElement("div", {
813
+ key: row.key,
814
+ className: styles$w.row
815
+ }, row.cells.map((cell, j) => /*#__PURE__*/React.createElement("div", {
816
+ key: cell.key,
817
+ className: makeClassName([[styles$w.cell, true], [styles$w.header, options.header && i === 0], [styles$w[colors[cell.color]], true], [styles$w[columnsWidth[j]], true], [styles$w.fixedColumn, options.fixed_first_column && j === 0]]),
818
+ dangerouslySetInnerHTML: {
819
+ __html: cell.val
820
+ }
821
+ })));
822
+ })))), tableCredit && /*#__PURE__*/React.createElement(MediaCaption, {
823
+ credit: tableCredit,
824
+ styleContext: styleContext
825
+ }));
826
+ };
827
+
828
+ var styles$v = {"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"};
829
+
830
+ const MaterialNote = ({
831
+ block: {
832
+ data
833
+ },
834
+ styleContext
835
+ }) => {
836
+ let classNames = [[styles$v.root, true]];
837
+ if (styleContext) {
838
+ classNames = makeStyleContext(classNames, styleContext, styles$v);
839
+ }
840
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
841
+ "data-testid": "material-note",
842
+ className: makeClassName(classNames)
843
+ }, data && data.map(item => /*#__PURE__*/React.createElement("p", {
844
+ className: styles$v[item.type],
845
+ key: item.id,
846
+ dangerouslySetInnerHTML: {
847
+ __html: item.data
848
+ }
849
+ }))));
850
+ };
851
+
852
+ var styles$u = {"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-"};
853
+
854
+ const BookmarkButton = ({
855
+ styleContext,
856
+ theme,
857
+ isInBookmarks,
858
+ onClick
859
+ }) => {
860
+ let classNames = [[styles$u.root, true], [styles$u.isInBookmarks, isInBookmarks], [styles$u[theme], !!theme && !!styles$u[theme]]];
861
+ if (styleContext) {
862
+ classNames = makeStyleContext(classNames, styleContext, styles$u);
863
+ }
864
+ return /*#__PURE__*/React.createElement("div", {
865
+ "data-testid": "bookmark-button",
866
+ className: makeClassName(classNames)
867
+ }, /*#__PURE__*/React.createElement("button", {
868
+ className: styles$u.control,
869
+ onClick: () => onClick(),
870
+ type: "button"
871
+ }, /*#__PURE__*/React.createElement(SvgSymbol, {
872
+ icon: "bookmark",
873
+ size: "unset"
874
+ })));
875
+ };
876
+
877
+ var styles$t = {"root":"MaterialTitle-module_root__VSphO","primary":"MaterialTitle-module_primary__XGnpb","secondary":"MaterialTitle-module_secondary__7IDEp"};
878
+
879
+ const Primary = ({
880
+ children
881
+ }) => {
882
+ return /*#__PURE__*/React.createElement("span", {
883
+ className: styles$t.primary
884
+ }, children);
885
+ };
886
+ const Secondary = ({
887
+ children
888
+ }) => {
889
+ return /*#__PURE__*/React.createElement("span", {
890
+ className: styles$t.secondary
891
+ }, children);
892
+ };
893
+ const MaterialTitle = ({
894
+ children
895
+ }) => {
896
+ return /*#__PURE__*/React.createElement("h1", {
897
+ className: styles$t.root,
898
+ "data-testid": "material-title"
899
+ }, children);
900
+ };
901
+
902
+ var styles$s = {"root":"Dropdown-module_root__Wv7S-","active":"Dropdown-module_active__jEkE7","menu":"Dropdown-module_menu__11IQL","isInAudioPanel":"Dropdown-module_isInAudioPanel__UniSV"};
903
+
904
+ const Menu = ({
905
+ children
906
+ }) => {
907
+ return /*#__PURE__*/React.createElement("div", {
908
+ "data-testid": "dropdown",
909
+ className: styles$s.menu
910
+ }, children);
911
+ };
912
+ const Dropdown = ({
913
+ children,
914
+ active,
915
+ styleContext
916
+ }) => {
917
+ let classNames = [[styles$s.root, true], [styles$s.active, !!active && !!styles$s.active]];
918
+ if (styleContext) {
919
+ classNames = makeStyleContext(classNames, styleContext, styles$s);
920
+ }
921
+ return /*#__PURE__*/React.createElement("div", {
922
+ "data-testid": "dropdown",
923
+ className: makeClassName(classNames)
924
+ }, children);
925
+ };
926
+
927
+ var styles$r = {"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"};
928
+
929
+ const ToolbarItem = ({
930
+ children
931
+ }) => {
932
+ return /*#__PURE__*/React.createElement("li", {
933
+ className: styles$r.item
934
+ }, children);
935
+ };
936
+
937
+ const Toolbar = ({
938
+ children,
939
+ styleContext
940
+ }) => {
941
+ let classNames = [[styles$r.root, true]];
942
+ if (styleContext) {
943
+ classNames = makeStyleContext(classNames, styleContext, styles$r);
944
+ }
945
+ return /*#__PURE__*/React.createElement("div", {
946
+ "data-testid": "toolbar",
947
+ className: makeClassName(classNames)
948
+ }, /*#__PURE__*/React.createElement("ul", {
949
+ className: styles$r.list
950
+ }, children));
951
+ };
952
+
953
+ var styles$q = {"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","mobile":"Meta-module_mobile__PbG8N","desktop":"Meta-module_desktop__W5AB7"};
954
+
955
+ const Meta = ({
956
+ hasSource,
957
+ theme,
958
+ children,
959
+ onlyOn,
960
+ styleContext
961
+ }) => {
962
+ let classNames = [[styles$q.root, true], [styles$q[theme], !!theme && !!styles$q[theme]], [styles$q[onlyOn], !!onlyOn], [styles$q.hasSource, hasSource]];
963
+ if (styleContext) {
964
+ classNames = makeStyleContext(classNames, styleContext, styles$q);
965
+ }
966
+ return /*#__PURE__*/React.createElement("div", {
967
+ "data-testid": "meta",
968
+ className: makeClassName(classNames)
969
+ }, children);
970
+ };
971
+
972
+ var styles$p = {"root":"Timestamp-module_root__jPJ6w"};
973
+
974
+ const Timestamp = ({
975
+ publishedAt,
976
+ locale = 'ru',
977
+ type
978
+ }) => {
979
+ let published;
980
+ const timeFormat = locale === 'ru' ? 'HH:mm, D MMMM YYYY' : 'h:mm a, MMMM D, YYYY';
981
+ const preparedPublishedAt = publishedAt * 1000;
982
+ dayjs.locale(locale);
983
+ dayjs.extend(relativeTime);
984
+ if (type === 'fromNow') {
985
+ published = dayjs(preparedPublishedAt).fromNow();
986
+ } else if (type === 'format') {
987
+ published = dayjs(preparedPublishedAt).format('HH:mm');
988
+ } else if (type === 'date') {
989
+ published = dayjs(preparedPublishedAt).format(timeFormat);
990
+ } else {
991
+ throw new Error('Unknown time type');
992
+ }
993
+ return /*#__PURE__*/React.createElement("time", {
994
+ suppressHydrationWarning: true,
995
+ "data-testid": "timestamp",
996
+ className: styles$p.root
997
+ }, published);
998
+ };
999
+
1000
+ const DangerousHTML = ({
1001
+ className = '',
1002
+ tagName: TagName = 'div',
1003
+ html
1004
+ }) => {
1005
+ const element = useRef(null);
1006
+ const [canRenderHtml, setCanRenderHtml] = useState(false);
1007
+ useEffect(() => {
1008
+ setCanRenderHtml(true);
1009
+ }, []);
1010
+ const replaceScriptElementsRecursive = useCallback(node => {
1011
+ if (node.tagName === 'SCRIPT' && (!node.id || node.id.indexOf('script-') !== 0)) {
1012
+ const script = document.createElement('script');
1013
+ script.id = `script-${Math.random().toString(16).slice(2)}`;
1014
+ script.innerHTML = node.innerHTML;
1015
+ const attrs = node.attributes;
1016
+ for (let i = 0; i < attrs.length; i += 1) {
1017
+ const {
1018
+ name,
1019
+ value
1020
+ } = attrs[i];
1021
+ script.setAttribute(name, value);
1022
+ }
1023
+ node.parentElement.replaceChild(script, node);
1024
+ } else {
1025
+ let i = 0;
1026
+ const children = node.childNodes;
1027
+ while (i < children.length) {
1028
+ replaceScriptElementsRecursive(children[i]);
1029
+ i += 1;
1030
+ }
1031
+ }
1032
+ }, []);
1033
+ const prepareAnchors = useCallback(() => {
1034
+ const anchors = Array.from(element.current.querySelectorAll('a'));
1035
+ anchors.forEach(a => {
1036
+ a.setAttribute('target', '_blank');
1037
+ });
1038
+ }, []);
1039
+ useEffect(() => {
1040
+ if (canRenderHtml && html.indexOf('script') > -1 && element.current.firstElementChild) {
1041
+ element.current.firstElementChild.innerHTML = html;
1042
+ replaceScriptElementsRecursive(element.current.firstElementChild);
1043
+ prepareAnchors();
1044
+ }
1045
+ }, [canRenderHtml, element, html, replaceScriptElementsRecursive, prepareAnchors]);
1046
+ return /*#__PURE__*/React.createElement("div", {
1047
+ ref: element
1048
+ }, /*#__PURE__*/React.createElement(TagName, {
1049
+ className: className,
1050
+ dangerouslySetInnerHTML: {
1051
+ __html: html
1052
+ }
1053
+ }));
1054
+ };
1055
+
1056
+ var styles$o = {"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"};
1057
+
1058
+ const EmbedGif = ({
1059
+ gif,
1060
+ mp4Url,
1061
+ style
1062
+ }) => {
1063
+ const [videoFrozen, setVideoFrozen] = useState(false);
1064
+ const videoElem = useRef(null);
1065
+ const handleVideoTouch = () => {
1066
+ videoElem.current.play();
1067
+ setVideoFrozen(false);
1068
+ };
1069
+ const handleVideoError = () => {
1070
+ const video = videoElem.current;
1071
+ video.setAttribute('poster', video.dataset.gif);
1072
+ setVideoFrozen(false);
1073
+ };
1074
+ useEffect(() => {
1075
+ const video = videoElem.current;
1076
+ const {
1077
+ width: viewportWidth
1078
+ } = viewportSize();
1079
+ if (viewportWidth >= MediaQuerySizes.MOBILE) {
1080
+ video.setAttribute('autoplay', true);
1081
+ video.play();
1082
+ } else {
1083
+ setVideoFrozen(true);
1084
+ video.pause();
1085
+ video.addEventListener('touchstart', handleVideoTouch);
1086
+ }
1087
+ video.addEventListener('error', handleVideoError);
1088
+ return () => {
1089
+ video.removeEventListener('touchstart', handleVideoTouch);
1090
+ video.removeEventListener('error', handleVideoError);
1091
+ };
1092
+ }, []);
1093
+ return /*#__PURE__*/React.createElement("div", {
1094
+ className: styles$o.figure
1095
+ }, /*#__PURE__*/React.createElement("div", {
1096
+ className: styles$o.objectWrap,
1097
+ style: style,
1098
+ "data-frozen": videoFrozen
1099
+ }, /*#__PURE__*/React.createElement("video", {
1100
+ playsInline: true,
1101
+ muted: true,
1102
+ loop: true,
1103
+ autoPlay: true,
1104
+ preload: "metadata",
1105
+ "data-gif": gif,
1106
+ ref: videoElem
1107
+ }, /*#__PURE__*/React.createElement("source", {
1108
+ src: `https://meduza.io${mp4Url}`,
1109
+ type: "video/mp4"
1110
+ }))));
1111
+ };
1112
+
1113
+ const EmbedBlock = ({
1114
+ block,
1115
+ block: {
1116
+ data,
1117
+ data: {
1118
+ html,
1119
+ display,
1120
+ only_on: onlyOn,
1121
+ provider,
1122
+ cc,
1123
+ optimized,
1124
+ small_url: small,
1125
+ large_url: large,
1126
+ gif_url: gifUrl,
1127
+ mp4_url: mp4Url
1128
+ }
1129
+ },
1130
+ styleContext,
1131
+ children
1132
+ }) => {
1133
+ const [isPopoverShown, setIsPopoverShown] = useState(false);
1134
+ const style = {};
1135
+ const isProportional = block.data.height && block.data.width;
1136
+ const fullWidthProviders = ['youtube', 'vimeo', 'onetv', 'coub', 'meduza', 'facebook_video'];
1137
+ const mobileFullwidth = fullWidthProviders.indexOf(provider) > -1 || block.type === 'dots_on_image';
1138
+ const renderCC = context => /*#__PURE__*/React.createElement(MediaCaption, {
1139
+ credit: data.credit,
1140
+ caption: data.caption,
1141
+ styleContext: context || styleContext
1142
+ });
1143
+ const renderEmbed = style => {
1144
+ switch (block.type) {
1145
+ case 'gif':
1146
+ {
1147
+ return /*#__PURE__*/React.createElement(EmbedGif, {
1148
+ gif: gifUrl,
1149
+ mp4Url: mp4Url,
1150
+ style: style
1151
+ });
1152
+ }
1153
+ case 'image':
1154
+ {
1155
+ return /*#__PURE__*/React.createElement("div", {
1156
+ className: styles$o.figure
1157
+ }, /*#__PURE__*/React.createElement(Image, {
1158
+ source: !optimized && [small, large],
1159
+ optimized: block.data.optimized,
1160
+ width: block.data.width,
1161
+ height: block.data.height,
1162
+ alt: block.data.caption,
1163
+ display: block.data.display,
1164
+ lazy: block.data.lazy,
1165
+ styleContext: styleContext
1166
+ }));
1167
+ }
1168
+ case 'game_embed':
1169
+ {
1170
+ return /*#__PURE__*/React.createElement("div", {
1171
+ className: styles$o.gameEmbed
1172
+ }, /*#__PURE__*/React.createElement("iframe", {
1173
+ src: block.data.game_src,
1174
+ id: block.data.game_id,
1175
+ title: "Game embed"
1176
+ }));
1177
+ }
1178
+ case 'dots_on_image':
1179
+ {
1180
+ return /*#__PURE__*/React.createElement("div", {
1181
+ className: styles$o.figure
1182
+ }, /*#__PURE__*/React.createElement(DotsOnImage, {
1183
+ block: data
1184
+ }));
1185
+ }
1186
+ default:
1187
+ {
1188
+ return /*#__PURE__*/React.createElement("div", {
1189
+ className: styles$o.object
1190
+ }, /*#__PURE__*/React.createElement("div", {
1191
+ className: styles$o.wrapper,
1192
+ style: style
1193
+ }, /*#__PURE__*/React.createElement(DangerousHTML, {
1194
+ className: styles$o.objectWrap,
1195
+ html: html
1196
+ })));
1197
+ }
1198
+ }
1199
+ };
1200
+ if (isProportional) {
1201
+ style.paddingBottom = `${block.data.height / block.data.width * 100}%`;
1202
+ style.height = 0;
1203
+ }
1204
+ let classNames = [[styles$o.root, true], [styles$o.cc, cc], [styles$o[display], !!display && styles$o[display]], [styles$o[provider], !!provider && !!styles$o[provider]], [styles$o[onlyOn], !!onlyOn && styles$o[onlyOn]], [styles$o.mobileFullwidth, mobileFullwidth], [styles$o.proportional, isProportional]];
1205
+ // Убираем из контекста все, что не начинается с приставки isIn,
1206
+ // чтобы не применились лишние модификаторы
1207
+ // TODO: в w6 модификаторы должны передаваться явно
1208
+ if (styleContext && Array.isArray(styleContext)) {
1209
+ const filteredContext = styleContext.filter(key => key.startsWith('isIn') && styles$o[key]).reduce((acc, key) => {
1210
+ acc.push(key);
1211
+ return acc;
1212
+ }, []);
1213
+ classNames = makeStyleContext(classNames, filteredContext, styles$o);
1214
+ }
1215
+ return /*#__PURE__*/React.createElement("figure", {
1216
+ className: makeClassName(classNames)
1217
+ }, children && /*#__PURE__*/React.createElement("div", {
1218
+ className: styles$o.object
1219
+ }, /*#__PURE__*/React.createElement("div", {
1220
+ className: styles$o.wrapper,
1221
+ style: style
1222
+ }, /*#__PURE__*/React.createElement("div", {
1223
+ className: styles$o.objectWrap
1224
+ }, children))), !children && renderEmbed(style), cc === 'default' && /*#__PURE__*/React.createElement("figcaption", null, renderCC()), cc === 'button' && /*#__PURE__*/React.createElement("button", {
1225
+ className: styles$o.control,
1226
+ type: "button",
1227
+ "aria-label": "Open",
1228
+ onClick: () => {
1229
+ setIsPopoverShown(!isPopoverShown);
1230
+ }
1231
+ }), cc === 'button' && isPopoverShown && /*#__PURE__*/React.createElement(Popover, {
1232
+ onClose: () => {
1233
+ setIsPopoverShown(false);
1234
+ }
1235
+ }, renderCC('isInPopover')));
1236
+ };
1237
+
1238
+ const IframeBlock = ({
1239
+ block,
1240
+ block: {
1241
+ id
1242
+ },
1243
+ styleContext,
1244
+ lang = 'ru'
1245
+ }) => {
1246
+ const element = useRef(null);
1247
+ const renderIframe = () => {
1248
+ const rootEl = document.createElement('div');
1249
+ const contentEl = document.createElement('div');
1250
+ const scriptEl = document.createElement('script');
1251
+ const style = document.createElement('style');
1252
+ const range = document.createRange();
1253
+ range.setStart(contentEl, 0);
1254
+ contentEl.setAttribute('id', 'content');
1255
+ scriptEl.textContent = `
1256
+ function getDocHeight() {
1257
+ var doc = document;
1258
+ var body = doc.body;
1259
+ var html = doc.documentElement;
1260
+ var height = Math.max( body.scrollHeight, body.offsetHeight,
1261
+ html.clientHeight, html.scrollHeight, html.offsetHeight );
1262
+
1263
+ doc.body.style.margin="0";
1264
+
1265
+ return document.getElementById('content') ? document.getElementById('content').offsetHeight : height;
1266
+ }
1267
+
1268
+ function sendDocHeightMsg() {
1269
+ var height = getDocHeight();
1270
+ var message = JSON.stringify({
1271
+ action: {
1272
+ type: "UPDATE_HEIGHT",
1273
+ payload: {
1274
+ id: "${block.id}",
1275
+ height: height
1276
+ }
1277
+ }
1278
+ });
1279
+ parent.postMessage("mdzMaterialEmbedHeight=" + message, '*');
1280
+ }
1281
+
1282
+ setInterval(sendDocHeightMsg, 300);
1283
+ `;
1284
+ style.type = 'text/css';
1285
+ 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; }';
1286
+ contentEl.appendChild(range.createContextualFragment(block.data.html));
1287
+ rootEl.appendChild(scriptEl);
1288
+ rootEl.appendChild(contentEl);
1289
+ contentEl.appendChild(style);
1290
+ const frame = element.current.querySelector('iframe').contentDocument;
1291
+ frame.open();
1292
+ frame.close();
1293
+ frame.documentElement.setAttribute('lang', lang);
1294
+ frame.body.appendChild(rootEl);
1295
+ };
1296
+ useEffect(() => {
1297
+ renderIframe();
1298
+ }, []);
1299
+ return /*#__PURE__*/React.createElement(EmbedBlock, {
1300
+ block: block,
1301
+ styleContext: styleContext
1302
+ }, /*#__PURE__*/React.createElement("div", {
1303
+ ref: element,
1304
+ dangerouslySetInnerHTML: {
1305
+ __html: `<iframe id=${id} frameBorder="0" scrolling="no"></iframe>`
1306
+ }
1307
+ }));
1308
+ };
1309
+
1310
+ const EmbedBlockContainer = ({
1311
+ block,
1312
+ styleContext,
1313
+ lang
1314
+ }) => {
1315
+ if (block.data && block.data.wrap_with_iframe) {
1316
+ return /*#__PURE__*/React.createElement(IframeBlock, {
1317
+ block: block,
1318
+ styleContext: styleContext,
1319
+ lang: lang
1320
+ });
1321
+ }
1322
+ return /*#__PURE__*/React.createElement(EmbedBlock, {
1323
+ block: block,
1324
+ styleContext: styleContext
1325
+ });
1326
+ };
1327
+
1328
+ var styles$n = {"root":"QuoteBlock-module_root__4qa1J","center":"QuoteBlock-module_center__1f83y"};
1329
+
1330
+ const QuoteBlock = ({
1331
+ block: {
1332
+ data
1333
+ },
1334
+ styleContext
1335
+ }) => {
1336
+ let classNames = [[styles$n.root, true]];
1337
+ if (styleContext) {
1338
+ classNames = makeStyleContext(classNames, styleContext, styles$n);
1339
+ }
1340
+ return /*#__PURE__*/React.createElement("div", {
1341
+ "data-testid": "quote-block",
1342
+ className: makeClassName(classNames)
1343
+ }, /*#__PURE__*/React.createElement("p", {
1344
+ dangerouslySetInnerHTML: {
1345
+ __html: data
1346
+ }
1347
+ }));
1348
+ };
1349
+
1350
+ var styles$m = {"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"};
1351
+
1352
+ const CardTitle = ({
1353
+ block: {
1354
+ data: {
1355
+ only_on: onlyOn,
1356
+ index,
1357
+ text
1358
+ }
1359
+ },
1360
+ styleContext
1361
+ }) => {
1362
+ return /*#__PURE__*/React.createElement("div", {
1363
+ "data-testid": "card-title",
1364
+ className: makeClassName([[styles$m.root, true], [styles$m[onlyOn], !!onlyOn], [styles$m[styleContext], !!styleContext && !!styles$m[styleContext]]])
1365
+ }, /*#__PURE__*/React.createElement("div", {
1366
+ className: styles$m.index
1367
+ }, index), /*#__PURE__*/React.createElement("h3", {
1368
+ className: styles$m.title
1369
+ }, text));
1370
+ };
1371
+
1372
+ var styles$l = {"root":"ChapterBlock-module_root__iw7d2","subtitle":"ChapterBlock-module_subtitle__IpWgz","mobile":"ChapterBlock-module_mobile__V1Eye","desktop":"ChapterBlock-module_desktop__9xWf4"};
1373
+
1374
+ const ChapterBlock = ({
1375
+ block: {
1376
+ data,
1377
+ only_on: onlyOn
1378
+ },
1379
+ styleContext
1380
+ }) => {
1381
+ return /*#__PURE__*/React.createElement("div", {
1382
+ "data-testid": "chapter-block",
1383
+ className: makeClassName([[styles$l.root, true], [styles$l[onlyOn], !!onlyOn]])
1384
+ }, /*#__PURE__*/React.createElement("div", {
1385
+ className: makeClassName([[styles$l.subtitle, true], [styles$l[styleContext], !!styleContext && !!styles$l[styleContext]]]),
1386
+ dangerouslySetInnerHTML: {
1387
+ __html: data
1388
+ }
1389
+ }));
1390
+ };
1391
+
1392
+ const generateGradient = (color, type) => {
1393
+ const steps = {
1394
+ 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]],
1395
+ mediaBlockTop: [[0.5, 0], [0, 97]]
1396
+ };
1397
+ const gradient = steps[type].map(i => `rgba(${color}, ${i[0]}) ${i[1]}%`);
1398
+ return `linear-gradient(-180deg, ${gradient})`;
1399
+ };
1400
+
1401
+ var styles$k = {"root":"SimpleTitle-module_root__YOzNn","mobile":"SimpleTitle-module_mobile__1QiJd","desktop":"SimpleTitle-module_desktop__ZF5Af"};
1402
+
1403
+ const SimpleTitle = ({
1404
+ block: {
1405
+ data: {
1406
+ first
1407
+ },
1408
+ only_on: onlyOn
1409
+ },
1410
+ styleContext
1411
+ }) => {
1412
+ let classNames = [[styles$k.root, true], [styles$k[onlyOn], true]];
1413
+ if (styleContext) {
1414
+ classNames = makeStyleContext(classNames, styleContext, styles$k);
1415
+ }
1416
+ return /*#__PURE__*/React.createElement("h1", {
1417
+ "data-testid": "simple-title",
1418
+ className: makeClassName(classNames)
1419
+ }, first);
1420
+ };
1421
+
1422
+ var styles$j = {"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","mobile":"RichTitle-module_mobile__W5L9E","desktop":"RichTitle-module_desktop__k0PkC"};
1423
+
1424
+ const RichTitle = ({
1425
+ block: {
1426
+ only_on: onlyOn,
1427
+ data: {
1428
+ featured,
1429
+ first,
1430
+ second,
1431
+ as: TagName = 'h1'
1432
+ }
1433
+ },
1434
+ styleContext
1435
+ }) => {
1436
+ let classNames = [[styles$j.root, true], [styles$j[onlyOn], true], [styles$j.featured, !!featured]];
1437
+ if (styleContext) {
1438
+ classNames = makeStyleContext(classNames, styleContext, styles$j);
1439
+ }
1440
+ return /*#__PURE__*/React.createElement(TagName, {
1441
+ "data-testid": "rich-title",
1442
+ className: makeClassName(classNames)
1443
+ }, first, second && /*#__PURE__*/React.createElement("span", null, " ", second));
1444
+ };
1445
+
1446
+ var styles$i = {"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"};
1447
+
1448
+ const SimpleBlock = ({
1449
+ block: {
1450
+ data,
1451
+ type,
1452
+ only_on: onlyOn
1453
+ },
1454
+ styleContext
1455
+ }) => {
1456
+ let TagName;
1457
+ let classNames = [[styles$i[type], !!type && !!styles$i[type]], [styles$i[onlyOn], true]];
1458
+ if (styleContext) {
1459
+ classNames = makeStyleContext(classNames, styleContext, styles$i);
1460
+ }
1461
+ switch (type) {
1462
+ case 'context_p':
1463
+ case 'lead':
1464
+ case 'note_caption':
1465
+ case 'note_credit':
1466
+ {
1467
+ TagName = 'p';
1468
+ break;
1469
+ }
1470
+ case 'divider':
1471
+ return /*#__PURE__*/React.createElement("hr", {
1472
+ className: makeClassName(classNames)
1473
+ });
1474
+ case 'lead_hr':
1475
+ {
1476
+ TagName = 'div';
1477
+ break;
1478
+ }
1479
+ default:
1480
+ TagName = type;
1481
+ }
1482
+ return /*#__PURE__*/React.createElement(TagName, {
1483
+ className: makeClassName(classNames),
1484
+ dangerouslySetInnerHTML: {
1485
+ __html: data
1486
+ }
1487
+ });
1488
+ };
1489
+
1490
+ var styles$h = {"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"};
1491
+
1492
+ const ListBlock = ({
1493
+ block: {
1494
+ type,
1495
+ data,
1496
+ only_on: onlyOn
1497
+ },
1498
+ styleContext
1499
+ }) => {
1500
+ const TagName = type;
1501
+ let classNames = [[styles$h.root, true], [styles$h[onlyOn], true], [styles$h[type], !!type && !!styles$h[type]]];
1502
+ if (styleContext) {
1503
+ classNames = makeStyleContext(classNames, styleContext, styles$h);
1504
+ }
1505
+ return /*#__PURE__*/React.createElement(TagName, {
1506
+ className: makeClassName(classNames),
1507
+ "data-testid": "list-block"
1508
+ }, data.map((item, index) => /*#__PURE__*/React.createElement("li", {
1509
+ key: index,
1510
+ dangerouslySetInnerHTML: {
1511
+ __html: item
1512
+ }
1513
+ })));
1514
+ };
1515
+
1516
+ var styles$g = {"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"};
1517
+
1518
+ const RelatedBlock = ({
1519
+ block: {
1520
+ data: {
1521
+ title,
1522
+ related
1523
+ },
1524
+ only_on: onlyOn
1525
+ },
1526
+ styleContext
1527
+ }) => {
1528
+ let classNames = [[styles$g.root, true], [styles$g[onlyOn], true]];
1529
+ if (styleContext) {
1530
+ classNames = makeStyleContext(classNames, styleContext, styles$g);
1531
+ }
1532
+ return /*#__PURE__*/React.createElement("div", {
1533
+ "data-testid": "related-block",
1534
+ className: makeClassName(classNames)
1535
+ }, /*#__PURE__*/React.createElement("h3", {
1536
+ className: styles$g.header
1537
+ }, title), /*#__PURE__*/React.createElement("ul", {
1538
+ className: styles$g.items
1539
+ }, related.map((item, index) => /*#__PURE__*/React.createElement("li", {
1540
+ key: item.id || index,
1541
+ className: styles$g[item.layout]
1542
+ }, /*#__PURE__*/React.createElement(Link, {
1543
+ to: item.full_url || `/${item.url}`
1544
+ }, /*#__PURE__*/React.createElement("span", {
1545
+ className: styles$g.first
1546
+ }, item.title), item.second_title && ' ', item.second_title && /*#__PURE__*/React.createElement("span", null, item.second_title))))));
1547
+ };
1548
+
1549
+ var styles$f = {"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"};
1550
+
1551
+ const SourceBlock = ({
1552
+ block: {
1553
+ only_on: onlyOn,
1554
+ data: {
1555
+ quote,
1556
+ origin,
1557
+ url
1558
+ }
1559
+ },
1560
+ styleContext
1561
+ }) => {
1562
+ let classNames = [[styles$f.root, true], [styles$f[onlyOn], true]];
1563
+ if (styleContext) {
1564
+ classNames = makeStyleContext(classNames, styleContext, styles$f);
1565
+ }
1566
+ return /*#__PURE__*/React.createElement("blockquote", {
1567
+ "data-testid": "source-block",
1568
+ cite: url,
1569
+ className: makeClassName(classNames)
1570
+ }, /*#__PURE__*/React.createElement("a", {
1571
+ className: styles$f.text,
1572
+ href: url,
1573
+ target: "_blank",
1574
+ rel: "noopener noreferrer"
1575
+ }, quote.map((item, index) => /*#__PURE__*/React.createElement("p", {
1576
+ key: index,
1577
+ dangerouslySetInnerHTML: {
1578
+ __html: item.data
1579
+ }
1580
+ })), /*#__PURE__*/React.createElement("footer", null, /*#__PURE__*/React.createElement("cite", {
1581
+ className: styles$f.origin
1582
+ }, origin))));
1583
+ };
1584
+
1585
+ var styles$e = {"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"};
1586
+
1587
+ const SensitiveBlock = ({
1588
+ block,
1589
+ block: {
1590
+ cc,
1591
+ caption,
1592
+ credit,
1593
+ blurred_image: blurredImage
1594
+ },
1595
+ block: {
1596
+ item: {
1597
+ data: {
1598
+ display
1599
+ }
1600
+ }
1601
+ },
1602
+ styleContext
1603
+ }) => {
1604
+ const [visible, isVisible] = useState(false);
1605
+ const handleClick = () => {
1606
+ isVisible(true);
1607
+ };
1608
+ let classNames = [[styles$e.root, true], [styles$e.visible, visible], [styles$e[display], display && styles$e[display]]];
1609
+ let context = ['isInSensitiveBlock'];
1610
+ if (styleContext) {
1611
+ classNames = makeStyleContext(classNames, styleContext, styles$e);
1612
+ context = [...styleContext, 'isInSensitiveBlock'];
1613
+ }
1614
+ return /*#__PURE__*/React.createElement("div", {
1615
+ "data-testid": "sensitive-block",
1616
+ className: makeClassName(classNames)
1617
+ }, /*#__PURE__*/React.createElement("div", {
1618
+ className: styles$e.container
1619
+ }, /*#__PURE__*/React.createElement("div", {
1620
+ className: styles$e.overlay,
1621
+ style: {
1622
+ backgroundImage: `url(${blurredImage})`
1623
+ }
1624
+ }, /*#__PURE__*/React.createElement("div", {
1625
+ className: styles$e.content
1626
+ }, /*#__PURE__*/React.createElement("p", {
1627
+ dangerouslySetInnerHTML: {
1628
+ __html: block.title
1629
+ }
1630
+ }), /*#__PURE__*/React.createElement("div", {
1631
+ className: styles$e.button
1632
+ }, /*#__PURE__*/React.createElement(Button, {
1633
+ onClick: () => handleClick(),
1634
+ theme: "light"
1635
+ }, block.button.text)))), /*#__PURE__*/React.createElement("div", {
1636
+ className: styles$e.media
1637
+ }, /*#__PURE__*/React.createElement(EmbedBlockContainer, {
1638
+ block: block.item,
1639
+ styleContext: context
1640
+ }))), cc && /*#__PURE__*/React.createElement("figcaption", {
1641
+ className: styles$e.figcaption
1642
+ }, /*#__PURE__*/React.createElement(MediaCaption, {
1643
+ credit: credit,
1644
+ caption: caption,
1645
+ styleContext: styleContext
1646
+ })));
1647
+ };
1648
+
1649
+ var styles$d = {"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"};
1650
+
1651
+ const GroupedBlock = ({
1652
+ block,
1653
+ block: {
1654
+ only_on: onlyOn
1655
+ },
1656
+ styleContext
1657
+ }) => {
1658
+ const maxHeight = Math.min(...block.data.map(item => item.data && item.data.height || item.item && item.item.data.height));
1659
+ const normalizedBoxesWidth = block.data.map(item => {
1660
+ const width = item.data && item.data.width || item.item && item.item.data.heigh;
1661
+ const height = item.data && item.data.height || item.item && item.item.data.heigh;
1662
+ return width / (height / maxHeight);
1663
+ });
1664
+ const sumWidth = normalizedBoxesWidth.reduce((sum, x) => sum + x);
1665
+ let classNames = [[styles$d.root, true], [styles$d[onlyOn], true], [styles$d.hasFigcaption, block.cc === 'default'], [styles$d[block.display], !!block.display && styles$d[block.display]]];
1666
+ if (styleContext) {
1667
+ classNames = makeStyleContext(classNames, styleContext, styles$d);
1668
+ }
1669
+ return /*#__PURE__*/React.createElement("div", {
1670
+ "data-testid": "grouped-block",
1671
+ className: makeClassName(classNames)
1672
+ }, /*#__PURE__*/React.createElement("div", {
1673
+ className: styles$d.items
1674
+ }, block.data.map((item, index) => {
1675
+ const percentWidth = normalizedBoxesWidth[index] / sumWidth * 100;
1676
+ return /*#__PURE__*/React.createElement("div", {
1677
+ className: styles$d.item,
1678
+ key: item.id,
1679
+ style: {
1680
+ width: `${percentWidth}%`
1681
+ }
1682
+ }, item.type === 'sensitive' ? /*#__PURE__*/React.createElement(SensitiveBlock, {
1683
+ block: item,
1684
+ styleContext: ['isInGroupedBlock']
1685
+ }) : /*#__PURE__*/React.createElement(EmbedBlockContainer, {
1686
+ block: item,
1687
+ styleContext: ['isInGroupedBlock']
1688
+ }));
1689
+ })), block.cc && /*#__PURE__*/React.createElement("figcaption", {
1690
+ className: styles$d.figcaption
1691
+ }, /*#__PURE__*/React.createElement(MediaCaption, {
1692
+ credit: block.credit,
1693
+ caption: block.caption,
1694
+ styleContext: styleContext
1695
+ })));
1696
+ };
1697
+
1698
+ var styles$c = {"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"};
1699
+
1700
+ const MetaItem = ({
1701
+ hasSource,
1702
+ type,
1703
+ children,
1704
+ bullets
1705
+ }) => {
1706
+ const classNames = [[styles$c.root, true], [styles$c[type], !!type && !!styles$c[type]], [styles$c.hasSource, !!hasSource], [styles$c.hasBullets, !!bullets]];
1707
+ return /*#__PURE__*/React.createElement("div", {
1708
+ "data-testid": "meta-item",
1709
+ className: makeClassName(classNames)
1710
+ }, children);
1711
+ };
1712
+
1713
+ var styles$b = {"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"};
1714
+
1715
+ const MetaItemLive = ({
1716
+ theme = 'gold'
1717
+ }) => {
1718
+ const classNames = [[styles$b.root, true], [styles$b[theme], !!theme && styles$b[theme]]];
1719
+ return /*#__PURE__*/React.createElement("div", {
1720
+ "data-testid": "meta-item-live",
1721
+ "data-meta": "live",
1722
+ className: makeClassName(classNames)
1723
+ }, /*#__PURE__*/React.createElement("div", {
1724
+ className: styles$b.frame
1725
+ }));
1726
+ };
1727
+
1728
+ const pluralize = (number, one, two, five) => {
1729
+ let n = Math.abs(number);
1730
+ n %= 100;
1731
+ if (n >= 5 && n <= 20) {
1732
+ return five;
1733
+ }
1734
+ n %= 10;
1735
+ if (n === 1) {
1736
+ return one;
1737
+ }
1738
+ if (n >= 2 && n <= 4) {
1739
+ return two;
1740
+ }
1741
+ return five;
1742
+ };
1743
+
1744
+ var styles$a = {"root":"DocumentItemsCount-module_root__u4M3y","items":"DocumentItemsCount-module_items__OE-hf"};
1745
+
1746
+ const DocumentItemsCount = ({
1747
+ type,
1748
+ lang = 'ru',
1749
+ items,
1750
+ children
1751
+ }) => {
1752
+ const i18n = {
1753
+ ru: {
1754
+ card: {
1755
+ one: 'карточка',
1756
+ two: 'карточки',
1757
+ five: 'карточек'
1758
+ },
1759
+ podcast: {
1760
+ one: 'эпизод',
1761
+ two: 'эпизода',
1762
+ five: 'эпизодов'
1763
+ }
1764
+ },
1765
+ en: {
1766
+ card: {
1767
+ one: 'card',
1768
+ two: 'cards',
1769
+ five: 'cards'
1770
+ },
1771
+ podcast: {
1772
+ one: 'episode',
1773
+ two: 'episodes',
1774
+ five: 'episodes'
1775
+ }
1776
+ }
1777
+ };
1778
+ const itemsCount = `${items} ${pluralize(items, i18n[lang][type].one, i18n[lang][type].two, i18n[lang][type].five)}`;
1779
+ return /*#__PURE__*/React.createElement("div", {
1780
+ "data-testid": "document-items-count",
1781
+ className: styles$a.root
1782
+ }, children, /*#__PURE__*/React.createElement("span", {
1783
+ className: styles$a.items
1784
+ }, itemsCount));
1785
+ };
1786
+
1787
+ const MetaContainer = ({
1788
+ lang,
1789
+ block,
1790
+ isRead,
1791
+ isListened,
1792
+ bookmarkAction,
1793
+ isInBookmarks,
1794
+ block: {
1795
+ data: {
1796
+ components,
1797
+ theme
1798
+ }
1799
+ },
1800
+ styleContext
1801
+ }) => {
1802
+ const themeColor = styleContext && styleContext.indexOf('dark') !== -1 ? 'light' : 'unset';
1803
+ const isPodcast = styleContext && styleContext.indexOf('podcast') !== -1;
1804
+ const isSlides = styleContext && styleContext.indexOf('slide') !== -1;
1805
+ let context = [];
1806
+ if (styleContext && Array.isArray(styleContext)) {
1807
+ context = styleContext.filter(item => {
1808
+ return item !== 'dark';
1809
+ });
1810
+ }
1811
+ const hasSource = !!components.find(item => item.type === 'source_name');
1812
+ return /*#__PURE__*/React.createElement(Meta, {
1813
+ styleContext: context,
1814
+ theme: theme || themeColor,
1815
+ onlyOn: block.only_on,
1816
+ hasSource: hasSource
1817
+ }, components.map(component => {
1818
+ switch (component.type) {
1819
+ case 'source_name':
1820
+ {
1821
+ return /*#__PURE__*/React.createElement(MetaItem, {
1822
+ hasSource: hasSource,
1823
+ bullets: true,
1824
+ key: component.id
1825
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, lang === 'ru' ? 'Источник: ' : 'Source: ', component.url && /*#__PURE__*/React.createElement("a", {
1826
+ href: component.url,
1827
+ rel: "noopener noreferrer",
1828
+ target: "_blank"
1829
+ }, component.text), !component.url && component.text));
1830
+ }
1831
+ case 'duration':
1832
+ {
1833
+ return /*#__PURE__*/React.createElement(MetaItem, {
1834
+ hasSource: hasSource,
1835
+ bullets: true,
1836
+ key: component.id
1837
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SvgSymbol, {
1838
+ icon: "podcast",
1839
+ size: "small"
1840
+ }), component.text));
1841
+ }
1842
+ case 'datetime':
1843
+ {
1844
+ const format = component.format && toCamel(component.format) || 'date';
1845
+ return /*#__PURE__*/React.createElement(MetaItem, {
1846
+ hasSource: hasSource,
1847
+ bullets: true,
1848
+ key: component.id,
1849
+ type: "datetime"
1850
+ }, /*#__PURE__*/React.createElement(Timestamp, {
1851
+ publishedAt: component.datetime,
1852
+ type: format || 'date',
1853
+ locale: lang
1854
+ }));
1855
+ }
1856
+ case 'items_count':
1857
+ {
1858
+ return /*#__PURE__*/React.createElement(MetaItem, {
1859
+ hasSource: hasSource,
1860
+ bullets: true,
1861
+ key: component.id
1862
+ }, /*#__PURE__*/React.createElement(DocumentItemsCount, {
1863
+ items: component.count,
1864
+ type: isPodcast ? 'podcast' : 'card',
1865
+ lang: lang
1866
+ }, /*#__PURE__*/React.createElement(SvgSymbol, {
1867
+ icon: "card",
1868
+ size: "unset"
1869
+ })));
1870
+ }
1871
+ case 'broadcast_active':
1872
+ {
1873
+ return /*#__PURE__*/React.createElement(MetaItem, {
1874
+ hasSource: hasSource,
1875
+ bullets: true,
1876
+ key: component.id
1877
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MetaItemLive, null), " \u041F\u0440\u044F\u043C\u043E\u0439 \u044D\u0444\u0438\u0440"));
1878
+ }
1879
+ case 'broadcast':
1880
+ {
1881
+ return /*#__PURE__*/React.createElement(MetaItem, {
1882
+ hasSource: hasSource,
1883
+ bullets: true,
1884
+ key: component.id
1885
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, component.with_icon && /*#__PURE__*/React.createElement(MetaItemLive, null), component.label));
1886
+ }
1887
+ default:
1888
+ {
1889
+ return null;
1890
+ }
1891
+ }
1892
+ }), (isRead || isListened) && /*#__PURE__*/React.createElement(MetaItem, {
1893
+ hasSource: hasSource,
1894
+ bullets: true,
1895
+ type: isListened ? 'listened' : 'read'
1896
+ }, /*#__PURE__*/React.createElement(SvgSymbol, {
1897
+ icon: isListened ? 'listened' : 'read',
1898
+ size: "unset"
1899
+ })), isSlides && lang === 'ru' && /*#__PURE__*/React.createElement("div", {
1900
+ className: styles$q.bookmark
1901
+ }, /*#__PURE__*/React.createElement(BookmarkButton, {
1902
+ isInBookmarks: isInBookmarks,
1903
+ onClick: () => bookmarkAction('bookmark', 'top')
1904
+ })));
1905
+ };
1906
+
1907
+ var styles$9 = {"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"};
1908
+
1909
+ const DonatesTeaser = ({
1910
+ styleContext,
1911
+ lang = 'ru'
1912
+ }) => {
1913
+ let classNames = [[styles$9.root, true], [styles$9[lang], styles$9[lang]]];
1914
+ if (styleContext) {
1915
+ classNames = makeStyleContext(classNames, styleContext, styles$9);
1916
+ }
1917
+ const data = {
1918
+ ru: {
1919
+ title: '«Медуза». Работаем 24/7. И&nbsp;только&nbsp;в&nbsp;интересах читателей',
1920
+ subtitle: 'Нам срочно нужна ваша поддержка',
1921
+ button: 'Хочу помочь',
1922
+ href: 'https://support.meduza.io/'
1923
+ },
1924
+ en: {
1925
+ title: 'Meduza, working 24/7, always&nbsp;for our readers',
1926
+ subtitle: 'We&nbsp;need&nbsp;your&nbsp;help like never&nbsp;before',
1927
+ button: 'Okay!',
1928
+ href: 'https://support.meduza.io/en'
1929
+ }
1930
+ };
1931
+ return /*#__PURE__*/React.createElement("div", {
1932
+ "data-testid": "donates-teaser",
1933
+ className: makeClassName(classNames)
1934
+ }, /*#__PURE__*/React.createElement("div", {
1935
+ className: styles$9.main
1936
+ }, /*#__PURE__*/React.createElement("h3", {
1937
+ className: styles$9.title
1938
+ }, /*#__PURE__*/React.createElement("span", {
1939
+ dangerouslySetInnerHTML: {
1940
+ __html: data[lang].title
1941
+ }
1942
+ }), ` `, /*#__PURE__*/React.createElement("span", {
1943
+ className: styles$9.text,
1944
+ dangerouslySetInnerHTML: {
1945
+ __html: data[lang].subtitle
1946
+ }
1947
+ }))), /*#__PURE__*/React.createElement("div", {
1948
+ className: styles$9.cta
1949
+ }, /*#__PURE__*/React.createElement("a", {
1950
+ href: data[lang].href,
1951
+ target: "_blank",
1952
+ rel: "noreferrer"
1953
+ }, /*#__PURE__*/React.createElement("span", null, data[lang].button))));
1954
+ };
1955
+
1956
+ var styles$8 = {"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"};
1957
+
1958
+ const AnnouncementInText = ({
1959
+ styleContext,
1960
+ lang = 'ru'
1961
+ }) => {
1962
+ let classNames = [[styles$8.root, true], [styles$8[lang], styles$8[lang]]];
1963
+ if (styleContext) {
1964
+ classNames = makeStyleContext(classNames, styleContext, styles$8);
1965
+ }
1966
+ const data = {
1967
+ ru: {
1968
+ title: '&laquo;Медуза&raquo; заблокирована в&nbsp;России. Мы&nbsp;были к&nbsp;этому готовы&nbsp;&mdash; и&nbsp;продолжаем работать. Несмотря&nbsp;ни&nbsp;на&nbsp;что',
1969
+ text: '<p>Нам нужна ваша помощь как никогда. Прямо сейчас. Дальше всем нам будет еще труднее. Мы&nbsp;независимое издание и&nbsp;работаем только в&nbsp;интересах читателей.</p>',
1970
+ button: 'Хочу помочь',
1971
+ href: 'https://mdza.io/yiNxPZ7Bs-k'
1972
+ },
1973
+ en: {
1974
+ 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. ',
1975
+ 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>',
1976
+ button: 'I want to help',
1977
+ href: 'https://support.meduza.io/en'
1978
+ }
1979
+ };
1980
+ const localeData = data[lang];
1981
+ return /*#__PURE__*/React.createElement("div", {
1982
+ "data-testid": "announcement-in-text",
1983
+ className: makeClassName(classNames)
1984
+ }, /*#__PURE__*/React.createElement("div", {
1985
+ className: styles$8.body
1986
+ }, /*#__PURE__*/React.createElement("h3", {
1987
+ className: styles$8.title,
1988
+ dangerouslySetInnerHTML: {
1989
+ __html: localeData.title
1990
+ }
1991
+ }), /*#__PURE__*/React.createElement("div", {
1992
+ dangerouslySetInnerHTML: {
1993
+ __html: localeData.text
1994
+ }
1995
+ })), /*#__PURE__*/React.createElement("div", {
1996
+ className: styles$8.footer
1997
+ }, /*#__PURE__*/React.createElement("a", {
1998
+ className: styles$8.link,
1999
+ href: localeData.href,
2000
+ target: "_blank",
2001
+ rel: "noreferrer"
2002
+ }, /*#__PURE__*/React.createElement("span", null, localeData.button)), /*#__PURE__*/React.createElement("span", {
2003
+ className: styles$8.button
2004
+ }, /*#__PURE__*/React.createElement("span", null, localeData.button))));
2005
+ };
2006
+
2007
+ const RenderBlocks = ({
2008
+ block,
2009
+ styleContext,
2010
+ lang,
2011
+ isRead,
2012
+ isListened,
2013
+ bookmarkAction,
2014
+ isInBookmarks
2015
+ }) => {
2016
+ switch (block.type) {
2017
+ case 'tag':
2018
+ {
2019
+ return /*#__PURE__*/React.createElement(Tag, {
2020
+ size: "large",
2021
+ onlyOn: block.only_on,
2022
+ theme: block.data.theme,
2023
+ styleContext: styleContext
2024
+ }, block.data.text);
2025
+ }
2026
+ case 'simple_title':
2027
+ {
2028
+ return /*#__PURE__*/React.createElement(SimpleTitle, {
2029
+ block: block,
2030
+ styleContext: styleContext
2031
+ });
2032
+ }
2033
+ case 'rich_title':
2034
+ {
2035
+ return /*#__PURE__*/React.createElement(RichTitle, {
2036
+ block: block,
2037
+ styleContext: styleContext
2038
+ });
2039
+ }
2040
+ case 'meta':
2041
+ {
2042
+ return /*#__PURE__*/React.createElement(MetaContainer, {
2043
+ block: block,
2044
+ lang: block.data.lang,
2045
+ styleContext: styleContext,
2046
+ isRead: isRead,
2047
+ isListened: isListened,
2048
+ isInBookmarks: isInBookmarks,
2049
+ bookmarkAction: bookmarkAction
2050
+ });
2051
+ }
2052
+ case 'h1':
2053
+ case 'h2':
2054
+ case 'h3':
2055
+ case 'h4':
2056
+ case 'blockquote':
2057
+ case 'p':
2058
+ case 'context_p':
2059
+ case 'divider':
2060
+ case 'lead':
2061
+ case 'lead_hr':
2062
+ {
2063
+ return /*#__PURE__*/React.createElement(SimpleBlock, {
2064
+ block: block,
2065
+ styleContext: styleContext
2066
+ });
2067
+ }
2068
+ case 'quote':
2069
+ return /*#__PURE__*/React.createElement(QuoteBlock, {
2070
+ block: block,
2071
+ styleContext: styleContext
2072
+ });
2073
+ case 'ol':
2074
+ case 'ul':
2075
+ {
2076
+ return /*#__PURE__*/React.createElement(ListBlock, {
2077
+ block: block,
2078
+ styleContext: styleContext
2079
+ });
2080
+ }
2081
+ case 'chapter-subtitle':
2082
+ {
2083
+ return /*#__PURE__*/React.createElement(ChapterBlock, {
2084
+ block: block,
2085
+ styleContext: styleContext
2086
+ });
2087
+ }
2088
+ case 'card_title':
2089
+ {
2090
+ return /*#__PURE__*/React.createElement(CardTitle, {
2091
+ block: block,
2092
+ styleContext: styleContext
2093
+ });
2094
+ }
2095
+ case 'related':
2096
+ {
2097
+ return /*#__PURE__*/React.createElement(RelatedBlock, {
2098
+ block: block,
2099
+ styleContext: styleContext
2100
+ });
2101
+ }
2102
+ case 'source':
2103
+ return /*#__PURE__*/React.createElement(SourceBlock, {
2104
+ block: block,
2105
+ styleContext: styleContext
2106
+ });
2107
+ case 'table':
2108
+ return /*#__PURE__*/React.createElement(Table, {
2109
+ block: block,
2110
+ styleContext: styleContext
2111
+ });
2112
+ case 'sensitive':
2113
+ return /*#__PURE__*/React.createElement(SensitiveBlock, {
2114
+ block: block,
2115
+ styleContext: styleContext
2116
+ });
2117
+ case 'embed':
2118
+ case 'embed_code':
2119
+ case 'game_embed':
2120
+ case 'image':
2121
+ case 'dots_on_image':
2122
+ case 'gif':
2123
+ return /*#__PURE__*/React.createElement(EmbedBlockContainer, {
2124
+ block: block,
2125
+ styleContext: styleContext,
2126
+ lang: lang
2127
+ });
2128
+ case 'grouped':
2129
+ return /*#__PURE__*/React.createElement(GroupedBlock, {
2130
+ block: block,
2131
+ styleContext: styleContext
2132
+ });
2133
+ case 'donation':
2134
+ return /*#__PURE__*/React.createElement(DonatesTeaser, {
2135
+ styleContext: styleContext,
2136
+ lang: lang
2137
+ });
2138
+ case 'material_note':
2139
+ return /*#__PURE__*/React.createElement(MaterialNote, {
2140
+ block: block,
2141
+ styleContext: styleContext
2142
+ });
2143
+ case 'announcement_in_text':
2144
+ return /*#__PURE__*/React.createElement(AnnouncementInText, {
2145
+ styleContext: styleContext,
2146
+ lang: lang
2147
+ });
2148
+ default:
2149
+ {
2150
+ return null;
2151
+ }
2152
+ }
2153
+ };
2154
+
2155
+ var styles$7 = {"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-"};
2156
+
2157
+ const Cover = ({
2158
+ block: {
2159
+ only_on: onlyOn,
2160
+ data: {
2161
+ blocks,
2162
+ cover: {
2163
+ credit,
2164
+ caption,
2165
+ urls,
2166
+ mobile_ratio: mobileRatio,
2167
+ gradients,
2168
+ cc
2169
+ }
2170
+ }
2171
+ },
2172
+ styleContext
2173
+ }) => {
2174
+ const [isPopoverShown, setIsPopoverShown] = useState(false);
2175
+ const style = {};
2176
+ let classNames = [[styles$7.root, true], [styles$7[onlyOn], !!onlyOn && !!styles$7[onlyOn]]];
2177
+ if (styleContext) {
2178
+ classNames = makeStyleContext(classNames, styleContext, styles$7);
2179
+ }
2180
+ if (gradients) {
2181
+ const theme = [gradients.text_rgb === '0,0,0' ? 'dark' : 'light'];
2182
+ classNames = makeStyleContext(classNames, theme, styles$7);
2183
+ style.backgroundImage = generateGradient(gradients.bg_rgb, 'mediaBlockBottom');
2184
+ }
2185
+ const renderCC = context => /*#__PURE__*/React.createElement(MediaCaption, {
2186
+ credit: credit,
2187
+ caption: caption,
2188
+ styleContext: context || styleContext
2189
+ });
2190
+ return /*#__PURE__*/React.createElement("div", {
2191
+ "data-testid": "cover",
2192
+ className: makeClassName(classNames)
2193
+ }, /*#__PURE__*/React.createElement("div", {
2194
+ className: styles$7.image
2195
+ }, /*#__PURE__*/React.createElement(Image, {
2196
+ optimized: urls,
2197
+ ratio: mobileRatio,
2198
+ display: "narrow"
2199
+ })), /*#__PURE__*/React.createElement("div", {
2200
+ className: styles$7.body,
2201
+ style: style
2202
+ }, blocks.map(item => /*#__PURE__*/React.createElement(RenderBlocks, {
2203
+ key: item.id,
2204
+ block: item,
2205
+ styleContext: styleContext
2206
+ }))), cc === 'button' && /*#__PURE__*/React.createElement("button", {
2207
+ className: styles$7.control,
2208
+ type: "button",
2209
+ "aria-label": "Open",
2210
+ onClick: () => {
2211
+ setIsPopoverShown(!isPopoverShown);
2212
+ }
2213
+ }), cc === 'button' && isPopoverShown && /*#__PURE__*/React.createElement(Popover, {
2214
+ onClose: () => {
2215
+ setIsPopoverShown(false);
2216
+ }
2217
+ }, renderCC('isInPopover')));
2218
+ };
2219
+
2220
+ var styles$6 = {"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"};
2221
+
2222
+ const HalfBlock = ({
2223
+ block: {
2224
+ only_on: onlyOn,
2225
+ data,
2226
+ data: {
2227
+ cover: {
2228
+ optimized,
2229
+ ratio,
2230
+ credit,
2231
+ caption
2232
+ }
2233
+ }
2234
+ },
2235
+ styleContext
2236
+ }) => {
2237
+ let classNames = [[styles$6.root, true], [styles$6[onlyOn], true]];
2238
+ if (styleContext) {
2239
+ classNames = makeStyleContext(classNames, styleContext, styles$6);
2240
+ }
2241
+ return /*#__PURE__*/React.createElement("div", {
2242
+ "data-testid": "half-block",
2243
+ className: makeClassName(classNames)
2244
+ }, /*#__PURE__*/React.createElement("div", {
2245
+ className: styles$6.main
2246
+ }, /*#__PURE__*/React.createElement("div", {
2247
+ className: styles$6.image
2248
+ }, /*#__PURE__*/React.createElement(Image, {
2249
+ optimized: optimized,
2250
+ ratio: ratio,
2251
+ display: "super_full"
2252
+ })), /*#__PURE__*/React.createElement("div", {
2253
+ className: styles$6.body
2254
+ }, data.blocks.map(item => /*#__PURE__*/React.createElement(RenderBlocks, {
2255
+ key: item.id,
2256
+ block: item,
2257
+ styleContext: ['rich']
2258
+ })))), /*#__PURE__*/React.createElement("div", {
2259
+ className: styles$6.footer
2260
+ }, /*#__PURE__*/React.createElement(MediaCaption, {
2261
+ credit: credit,
2262
+ caption: caption,
2263
+ styleContext: styleContext
2264
+ })));
2265
+ };
2266
+
2267
+ var styles$5 = {"root":"ImportantLead-module_root__-rnt6","slide":"ImportantLead-module_slide__zcovu","mobile":"ImportantLead-module_mobile__msInp","desktop":"ImportantLead-module_desktop__ELC2-"};
2268
+
2269
+ const ImportantLead = ({
2270
+ block: {
2271
+ only_on: onlyOn,
2272
+ data
2273
+ },
2274
+ styleContext
2275
+ }) => {
2276
+ let classNames = [[styles$5.root, true], [styles$5[onlyOn], !!onlyOn]];
2277
+ if (styleContext) {
2278
+ classNames = makeStyleContext(classNames, styleContext, styles$5);
2279
+ }
2280
+ return /*#__PURE__*/React.createElement("div", {
2281
+ "data-testid": "important-lead",
2282
+ className: makeClassName(classNames)
2283
+ }, data.map(item => /*#__PURE__*/React.createElement(RenderBlocks, {
2284
+ key: item.id,
2285
+ block: item,
2286
+ styleContext: "isInImportantLead"
2287
+ })));
2288
+ };
2289
+
2290
+ var styles$4 = {"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"};
2291
+
2292
+ const Spoiler = ({
2293
+ block: {
2294
+ display,
2295
+ button,
2296
+ only_on: onlyOn,
2297
+ btn_title: buttonTitle,
2298
+ title,
2299
+ blocks
2300
+ },
2301
+ styleContext
2302
+ }) => {
2303
+ const [spoiled, setSpoiled] = useState(false);
2304
+ const ref = useRef(null);
2305
+ const handleButtonClick = () => {
2306
+ setSpoiled(!spoiled);
2307
+ if (spoiled) {
2308
+ postMessage('', 'closeSpoiler', 'click');
2309
+ const rect = ref.current.getBoundingClientRect();
2310
+ if (rect.top < 0) {
2311
+ ref.current.scrollIntoView({
2312
+ behavior: 'smooth'
2313
+ });
2314
+ }
2315
+ } else {
2316
+ postMessage('', 'openSpoiler', 'click');
2317
+ }
2318
+ };
2319
+ let classNames = [[styles$4.root, true], [styles$4[onlyOn], !!onlyOn], [styles$4[display], !!display && styles$4[display]], [[styles$4.spoiled], !!spoiled]];
2320
+ const context = ['center'];
2321
+ if (styleContext) {
2322
+ context.concat(styleContext);
2323
+ classNames = makeStyleContext(classNames, styleContext, styles$4);
2324
+ }
2325
+ const buttonCollapse = button ? button.collapse : 'Свернуть';
2326
+ const buttonExpande = button ? button.expand : buttonTitle;
2327
+ return /*#__PURE__*/React.createElement("div", {
2328
+ ref: ref,
2329
+ className: makeClassName(classNames),
2330
+ "data-testid": "spoiler"
2331
+ }, /*#__PURE__*/React.createElement("div", {
2332
+ className: styles$4.header
2333
+ }, title && /*#__PURE__*/React.createElement("h3", null, title)), /*#__PURE__*/React.createElement("div", {
2334
+ className: styles$4.body
2335
+ }, blocks.map(item => /*#__PURE__*/React.createElement(RenderBlocks, {
2336
+ key: item.id,
2337
+ block: item,
2338
+ styleContext: context
2339
+ }))), /*#__PURE__*/React.createElement("div", {
2340
+ className: styles$4.footer
2341
+ }, /*#__PURE__*/React.createElement(Button, {
2342
+ size: "default",
2343
+ theme: "gray",
2344
+ onClick: () => handleButtonClick(),
2345
+ styleContext: "isInSpoiler"
2346
+ }, spoiled ? buttonCollapse : buttonExpande, /*#__PURE__*/React.createElement(SvgSymbol, {
2347
+ icon: "arrow"
2348
+ }))));
2349
+ };
2350
+
2351
+ var styles$3 = {"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"};
2352
+
2353
+ /* eslint-disable react/jsx-no-target-blank */
2354
+ const RelatedRichBlock = ({
2355
+ block: {
2356
+ only_on: onlyOn,
2357
+ data: {
2358
+ blocks,
2359
+ url,
2360
+ cover: {
2361
+ urls,
2362
+ gradients,
2363
+ tag,
2364
+ layout,
2365
+ ratio
2366
+ }
2367
+ }
2368
+ },
2369
+ styleContext
2370
+ }) => {
2371
+ const style = {};
2372
+ const styleHeader = {};
2373
+ const cardType = `is${toCapitalize(layout)}`;
2374
+ const [ref, inView] = useInView({
2375
+ threshold: 0,
2376
+ triggerOnce: true
2377
+ });
2378
+ useEffect(() => {
2379
+ if (inView) {
2380
+ if (onlyOn === 'mobile' && window.innerWidth <= 511 || onlyOn === 'desktop' && window.innerWidth >= 512 || !onlyOn) {
2381
+ postMessage('richRelated', url, 'view');
2382
+ }
2383
+ }
2384
+ }, [inView]);
2385
+ const handleClick = () => {
2386
+ postMessage('richRelated', url, 'click');
2387
+ };
2388
+ let classNames = [[styles$3.root, true], [styles$3[cardType], !!layout && !!styles$3[cardType]], [styles$3.hasGradient, !!gradients], [styles$3[onlyOn], !!onlyOn && !!styles$3[onlyOn]]];
2389
+ let context = ['isInMediaBlock'];
2390
+ if (styleContext) {
2391
+ classNames = makeStyleContext(classNames, styleContext, styles$3);
2392
+ context = [...styleContext, 'isInMediaBlock'];
2393
+ }
2394
+ if (gradients) {
2395
+ styleHeader.backgroundImage = generateGradient(gradients.bg_rgb, 'mediaBlockTop');
2396
+ const theme = [gradients.text_rgb === '0,0,0' ? 'dark' : 'light'];
2397
+ classNames = makeStyleContext(classNames, theme, styles$3);
2398
+ if (onlyOn === 'desktop') {
2399
+ style.backgroundImage = generateGradient(gradients.bg_rgb, 'mediaBlockBottom');
2400
+ }
2401
+ }
2402
+ return /*#__PURE__*/React.createElement(Link, {
2403
+ "data-testid": "related-rich-block",
2404
+ className: makeClassName(classNames),
2405
+ to: `/${url}`,
2406
+ onClick: () => handleClick(),
2407
+ ref: ref
2408
+ }, layout === 'rich' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
2409
+ className: styles$3.overlay,
2410
+ style: style
2411
+ }), /*#__PURE__*/React.createElement("div", {
2412
+ className: styles$3.overlayHeader,
2413
+ style: styleHeader
2414
+ })), /*#__PURE__*/React.createElement("div", {
2415
+ className: styles$3.tag
2416
+ }, /*#__PURE__*/React.createElement(Tag, {
2417
+ size: "small",
2418
+ theme: "inherit",
2419
+ styleContext: "richRelated"
2420
+ }, tag)), /*#__PURE__*/React.createElement("div", {
2421
+ className: styles$3.cover
2422
+ }, /*#__PURE__*/React.createElement("div", {
2423
+ className: styles$3.picture
2424
+ }, /*#__PURE__*/React.createElement(Image, {
2425
+ optimized: urls,
2426
+ ratio: ratio,
2427
+ display: "narrow"
2428
+ }))), /*#__PURE__*/React.createElement("div", {
2429
+ className: styles$3.body
2430
+ }, blocks.map(item => /*#__PURE__*/React.createElement(RenderBlocks, {
2431
+ key: item.id,
2432
+ block: item,
2433
+ styleContext: context
2434
+ }))));
2435
+ };
2436
+
2437
+ var styles$2 = {"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"};
2438
+
2439
+ /* eslint-disable react/jsx-no-target-blank */
2440
+ const ShopRelatedBlock = ({
2441
+ block: {
2442
+ only_on: onlyOn,
2443
+ data: {
2444
+ url,
2445
+ cover: {
2446
+ urls,
2447
+ gradients,
2448
+ tag,
2449
+ layout,
2450
+ ratio,
2451
+ first_title: firstTitle,
2452
+ second_title: secondTitle
2453
+ }
2454
+ }
2455
+ },
2456
+ styleContext
2457
+ }) => {
2458
+ const style = {};
2459
+ const styleHeader = {};
2460
+ const [ref, inView] = useInView({
2461
+ threshold: 0,
2462
+ triggerOnce: true
2463
+ });
2464
+ useEffect(() => {
2465
+ if (inView) {
2466
+ if (onlyOn === 'mobile' && window.innerWidth <= 511 || onlyOn === 'desktop' && window.innerWidth >= 512 || !onlyOn) {
2467
+ postMessage('productRelated', url, 'view');
2468
+ }
2469
+ }
2470
+ }, [inView]);
2471
+ const handleClick = () => {
2472
+ postMessage('productRelated', url, 'click');
2473
+ };
2474
+ let classNames = [[styles$2.root, true], [styles$2.hasGradient, !!gradients], [styles$2[onlyOn], !!onlyOn && !!styles$2[onlyOn]]];
2475
+ if (styleContext) {
2476
+ classNames = makeStyleContext(classNames, styleContext, styles$2);
2477
+ }
2478
+ if (gradients) {
2479
+ styleHeader.backgroundImage = generateGradient(gradients.bg_rgb, 'mediaBlockTop');
2480
+ const theme = [gradients.text_rgb === '0,0,0' ? 'dark' : 'light'];
2481
+ classNames = makeStyleContext(classNames, theme, styles$2);
2482
+ if (onlyOn === 'desktop') {
2483
+ style.backgroundImage = generateGradient(gradients.bg_rgb, 'mediaBlockBottom');
2484
+ }
2485
+ }
2486
+ return /*#__PURE__*/React.createElement("a", {
2487
+ "data-testid": "related-rich-block",
2488
+ className: makeClassName(classNames),
2489
+ href: url,
2490
+ target: "_blank",
2491
+ onClick: () => handleClick(),
2492
+ ref: ref
2493
+ }, layout === 'rich' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
2494
+ className: styles$2.overlay,
2495
+ style: style
2496
+ }), /*#__PURE__*/React.createElement("div", {
2497
+ className: styles$2.overlayHeader,
2498
+ style: styleHeader
2499
+ })), /*#__PURE__*/React.createElement("div", {
2500
+ className: styles$2.tag
2501
+ }, /*#__PURE__*/React.createElement(Tag, {
2502
+ size: "small",
2503
+ theme: "inherit",
2504
+ styleContext: "richRelated"
2505
+ }, tag)), /*#__PURE__*/React.createElement("div", {
2506
+ className: styles$2.cover
2507
+ }, /*#__PURE__*/React.createElement("div", {
2508
+ className: styles$2.picture
2509
+ }, /*#__PURE__*/React.createElement(Image, {
2510
+ optimized: urls,
2511
+ ratio: ratio,
2512
+ display: "narrow"
2513
+ }))), /*#__PURE__*/React.createElement("div", {
2514
+ className: styles$2.body
2515
+ }, /*#__PURE__*/React.createElement("h2", {
2516
+ className: styles$2.title
2517
+ }, firstTitle, /*#__PURE__*/React.createElement("span", {
2518
+ className: styles$2.price
2519
+ }, secondTitle))));
2520
+ };
2521
+
2522
+ const RawHtmlBlock = ({
2523
+ block,
2524
+ styleContext,
2525
+ isRead,
2526
+ isListened,
2527
+ isInBookmarks,
2528
+ bookmarkAction,
2529
+ lightBox,
2530
+ lang
2531
+ }) => {
2532
+ const context = {
2533
+ lightBox: lightBox || null
2534
+ };
2535
+ switch (block.type) {
2536
+ case 'important_lead':
2537
+ {
2538
+ return /*#__PURE__*/React.createElement(ImportantLead, {
2539
+ block: block,
2540
+ styleContext: styleContext
2541
+ });
2542
+ }
2543
+ case 'spoiler':
2544
+ {
2545
+ return /*#__PURE__*/React.createElement(BlockProvider, {
2546
+ value: context
2547
+ }, /*#__PURE__*/React.createElement(Spoiler, {
2548
+ block: block,
2549
+ styleContext: styleContext
2550
+ }));
2551
+ }
2552
+ case 'cover':
2553
+ {
2554
+ return /*#__PURE__*/React.createElement(Cover, {
2555
+ block: block,
2556
+ styleContext: styleContext
2557
+ });
2558
+ }
2559
+ case 'half':
2560
+ {
2561
+ return /*#__PURE__*/React.createElement(HalfBlock, {
2562
+ block: block,
2563
+ styleContext: styleContext
2564
+ });
2565
+ }
2566
+ case 'related_rich':
2567
+ {
2568
+ return /*#__PURE__*/React.createElement(RelatedRichBlock, {
2569
+ block: block,
2570
+ styleContext: styleContext
2571
+ });
2572
+ }
2573
+ case 'related_shop':
2574
+ {
2575
+ return /*#__PURE__*/React.createElement(ShopRelatedBlock, {
2576
+ block: block,
2577
+ styleContext: styleContext
2578
+ });
2579
+ }
2580
+ default:
2581
+ {
2582
+ return /*#__PURE__*/React.createElement(BlockProvider, {
2583
+ value: context
2584
+ }, /*#__PURE__*/React.createElement(RenderBlocks, {
2585
+ block: block,
2586
+ styleContext: styleContext,
2587
+ isRead: isRead,
2588
+ isListened: isListened,
2589
+ isInBookmarks: isInBookmarks,
2590
+ bookmarkAction: bookmarkAction,
2591
+ lang: lang
2592
+ }));
2593
+ }
2594
+ }
2595
+ };
2596
+
2597
+ 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"};
2598
+
2599
+ const ToolbarButton = ({
2600
+ type,
2601
+ theme,
2602
+ isActive,
2603
+ lang = 'ru',
2604
+ text,
2605
+ icon,
2606
+ onClick
2607
+ }) => {
2608
+ const classNames = [[styles$1.root, true], [styles$1[type], !!styles$1[type]], [styles$1[theme], !!styles$1[theme] && !!theme], [styles$1.isActive, !!isActive]];
2609
+ const label = SocialLabels[lang][type];
2610
+ return /*#__PURE__*/React.createElement("button", {
2611
+ "data-testid": "toolbar-button",
2612
+ className: makeClassName(classNames),
2613
+ type: "button",
2614
+ onClick: event => onClick(event, type)
2615
+ }, icon && /*#__PURE__*/React.createElement("div", {
2616
+ className: styles$1.icon
2617
+ }, /*#__PURE__*/React.createElement(SvgSymbol, {
2618
+ size: "medium",
2619
+ icon: icon,
2620
+ styleContext: "isInToolbar"
2621
+ })), /*#__PURE__*/React.createElement("span", {
2622
+ className: styles$1.text
2623
+ }, text || label));
2624
+ };
2625
+
2626
+ 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"};
2627
+
2628
+ const capitalizeFirstLetter = string => string.charAt(0).toUpperCase() + string.slice(1);
2629
+
2630
+ const Tooltip = ({
2631
+ children,
2632
+ position
2633
+ }) => {
2634
+ const [x, y] = position;
2635
+ const positionClass = `is${capitalizeFirstLetter(x)}${capitalizeFirstLetter(y)}`;
2636
+ return /*#__PURE__*/React.createElement("div", {
2637
+ className: makeClassName([[styles.root, true], [styles[positionClass], true]])
2638
+ }, /*#__PURE__*/React.createElement("div", {
2639
+ className: styles.body
2640
+ }, children));
2641
+ };
2642
+
2643
+ const TooltipFooter = ({
2644
+ children
2645
+ }) => {
2646
+ return /*#__PURE__*/React.createElement("div", {
2647
+ className: styles.footer
2648
+ }, children);
2649
+ };
2650
+
2651
+ export { AnnouncementInText, BookmarkButton, Button, ButtonLoader, CardTitle, ChapterBlock, Cover, DocumentItemsCount, DonatesTeaser, DotsOnImage, Dropdown, EmbedBlockContainer, Footnote, GroupedBlock, HalfBlock, Image, ImportantLead, Lazy, ListBlock, MaterialNote, MaterialTitle, MediaCaption, Menu, Meta, MetaItem, MetaItemLive, Popover, Primary, QuoteBlock, RawHtmlBlock, RelatedBlock, RelatedRichBlock, RenderBlocks, RichTitle, Secondary, SensitiveBlock, ShopRelatedBlock, SimpleBlock, SimpleTitle, SourceBlock, Spoiler, SvgSymbol, Switcher, Table, Tag, Timestamp, Toolbar, ToolbarButton, ToolbarItem, Tooltip, TooltipFooter };
2652
+ //# sourceMappingURL=uikit.esm.js.map