pageflow 16.0.0 → 16.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (188) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +86 -33
  3. data/README.md +6 -6
  4. data/Rakefile +1 -1
  5. data/admins/pageflow/entry.rb +0 -1
  6. data/admins/pageflow/sites.rb +3 -0
  7. data/app/assets/images/pageflow/admin/icons/published_with_noindex.svg +4 -0
  8. data/app/assets/javascripts/pageflow/dist/ui.js +299 -72
  9. data/app/assets/stylesheets/pageflow/admin/active_admin_patches.scss +1 -1
  10. data/app/assets/stylesheets/pageflow/admin/entries.scss +4 -0
  11. data/app/assets/stylesheets/pageflow/admin/permalink_input.scss +10 -0
  12. data/app/assets/stylesheets/pageflow/admin/publication_state_indicator.scss +4 -0
  13. data/app/assets/stylesheets/pageflow/editor/base.scss +0 -1
  14. data/app/assets/stylesheets/pageflow/editor/drop_down_button.scss +61 -7
  15. data/app/assets/stylesheets/pageflow/editor/file_meta_data.scss +12 -1
  16. data/app/assets/stylesheets/pageflow/editor/file_thumbnails.scss +4 -0
  17. data/app/assets/stylesheets/pageflow/editor/help.scss +3 -3
  18. data/app/assets/stylesheets/pageflow/editor/info_box.scss +7 -0
  19. data/app/assets/stylesheets/pageflow/editor/inputs/file_input.scss +0 -5
  20. data/app/assets/stylesheets/pageflow/ui/forms.scss +4 -4
  21. data/app/assets/stylesheets/pageflow/{editor/wysihtml5.scss → ui/input/text_area_input.scss} +13 -1
  22. data/app/assets/stylesheets/pageflow/ui.scss +1 -0
  23. data/app/controllers/pageflow/chapters_controller.rb +2 -2
  24. data/app/controllers/pageflow/editor/entry_publications_controller.rb +5 -1
  25. data/app/controllers/pageflow/editor/file_import_controller.rb +1 -1
  26. data/app/controllers/pageflow/editor/files_controller.rb +1 -1
  27. data/app/controllers/pageflow/entries_controller.rb +12 -2
  28. data/app/controllers/pageflow/feeds_controller.rb +18 -0
  29. data/app/controllers/pageflow/pages_controller.rb +2 -2
  30. data/app/controllers/pageflow/sitemaps_controller.rb +15 -0
  31. data/app/controllers/pageflow/storylines_controller.rb +2 -2
  32. data/app/helpers/pageflow/entries_helper.rb +4 -1
  33. data/app/helpers/pageflow/feeds_helper.rb +66 -0
  34. data/app/helpers/pageflow/meta_tags_helper.rb +2 -1
  35. data/app/helpers/pageflow/page_types_helper.rb +10 -10
  36. data/app/helpers/pageflow/revision_file_helper.rb +3 -3
  37. data/app/helpers/pageflow/social_share_helper.rb +2 -2
  38. data/app/inputs/pageflow_permalink_input.rb +15 -3
  39. data/app/models/concerns/pageflow/entry_publication_states.rb +9 -0
  40. data/app/models/concerns/pageflow/reusable_file.rb +3 -3
  41. data/app/models/concerns/pageflow/uploadable_file.rb +5 -0
  42. data/app/models/pageflow/account.rb +8 -0
  43. data/app/models/pageflow/audio_file_url_templates.rb +2 -1
  44. data/app/models/pageflow/draft_entry.rb +1 -1
  45. data/app/models/pageflow/entries_feed.rb +32 -0
  46. data/app/models/pageflow/entry.rb +7 -5
  47. data/app/models/pageflow/entry_at_revision.rb +2 -0
  48. data/app/models/pageflow/image_file.rb +34 -8
  49. data/app/models/pageflow/image_file_url_templates.rb +7 -1
  50. data/app/models/pageflow/membership.rb +3 -2
  51. data/app/models/pageflow/other_file.rb +5 -0
  52. data/app/models/pageflow/other_file_url_templates.rb +16 -0
  53. data/app/models/pageflow/published_entry.rb +6 -0
  54. data/app/models/pageflow/revision.rb +6 -0
  55. data/app/models/pageflow/site.rb +8 -0
  56. data/app/models/pageflow/sitemaps.rb +14 -0
  57. data/app/models/pageflow/used_file.rb +10 -2
  58. data/app/models/pageflow/video_file_url_templates.rb +3 -1
  59. data/app/models/pageflow/widget.rb +9 -1
  60. data/app/views/admin/entries/_permalink_inputs.html.erb +1 -2
  61. data/app/views/admin/sites/_attributes_table.html.arb +3 -0
  62. data/app/views/admin/sites/_fields.html.erb +6 -0
  63. data/app/views/components/pageflow/admin/extensible_attributes_table.rb +2 -2
  64. data/app/views/components/pageflow/admin/revisions_tab.rb +8 -0
  65. data/app/views/components/pageflow/admin/sites_tab.rb +3 -0
  66. data/app/views/pageflow/editor/config/_seeds.json.jbuilder +2 -0
  67. data/app/views/pageflow/editor/entries/_entry.json.jbuilder +1 -0
  68. data/app/views/pageflow/editor/entry_publications/check.json.jbuilder +1 -0
  69. data/app/views/pageflow/feeds/index.atom.builder +20 -0
  70. data/app/views/pageflow/image_files/_image_file.json.jbuilder +1 -0
  71. data/app/views/pageflow/meta_tags/_entry.html.erb +1 -0
  72. data/app/views/pageflow/sitemaps/index.xml.builder +9 -0
  73. data/config/initializers/features.rb +3 -0
  74. data/config/initializers/paperclip.rb +8 -0
  75. data/config/locales/de.yml +77 -6
  76. data/config/locales/en.yml +79 -4
  77. data/config/routes.rb +3 -0
  78. data/config/spring.rb +1 -1
  79. data/db/migrate/20230120092923_create_other_files.rb +23 -0
  80. data/db/migrate/20230323115745_add_feeds_enabled_to_sites.rb +5 -0
  81. data/db/migrate/20230323154323_add_sitemap_enabled_to_sites.rb +5 -0
  82. data/db/migrate/20230331103823_add_title_to_sites.rb +5 -0
  83. data/db/migrate/20230405103612_add_custom_feed_url_to_sites.rb +5 -0
  84. data/db/migrate/20231024062501_add_output_presences_to_image_files.rb +5 -0
  85. data/db/migrate/20231128124523_add_noindex_to_revisions.rb +5 -0
  86. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/editor.js +710 -259
  87. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/frontend.js +34 -5
  88. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/react-client.js +1 -1
  89. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/react-server.js +1 -1
  90. data/entry_types/paged/app/controllers/pageflow_paged/editor/entries_controller.rb +0 -2
  91. data/entry_types/paged/app/controllers/pageflow_paged/entries_controller.rb +2 -1
  92. data/entry_types/paged/app/views/pageflow_paged/entries/show.html.erb +1 -0
  93. data/entry_types/paged/config/initializers/features.rb +0 -1
  94. data/entry_types/paged/lib/pageflow_paged/engine.rb +13 -1
  95. data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/chapters_controller.rb +2 -2
  96. data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/content_elements_controller.rb +3 -4
  97. data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/sections_controller.rb +13 -6
  98. data/entry_types/scrolled/app/controllers/pageflow_scrolled/entries_controller.rb +11 -3
  99. data/entry_types/scrolled/app/helpers/pageflow_scrolled/cache_helper.rb +11 -0
  100. data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/entry_json_seed_helper.rb +42 -0
  101. data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/seed_html_helper.rb +8 -5
  102. data/entry_types/scrolled/app/helpers/pageflow_scrolled/packs_helper.rb +17 -12
  103. data/entry_types/scrolled/app/helpers/pageflow_scrolled/react_server_side_rendering_helper.rb +9 -1
  104. data/entry_types/scrolled/app/helpers/pageflow_scrolled/themes_helper.rb +1 -1
  105. data/entry_types/scrolled/app/models/pageflow_scrolled/chapter.rb +23 -0
  106. data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_head.html.erb +1 -1
  107. data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_seed.json.jbuilder +1 -5
  108. data/entry_types/scrolled/app/views/pageflow_scrolled/editor/sections/_section_with_content_elements.json.jbuilder +10 -0
  109. data/entry_types/scrolled/app/views/pageflow_scrolled/entries/show.html.erb +44 -41
  110. data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_consent_vendors.json.jbuilder +16 -0
  111. data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_entry.json.jbuilder +7 -0
  112. data/entry_types/scrolled/config/initializers/features.rb +5 -0
  113. data/entry_types/scrolled/config/locales/consent_widget.de.yml +4 -0
  114. data/entry_types/scrolled/config/locales/consent_widget.en.yml +4 -0
  115. data/entry_types/scrolled/config/locales/de.yml +225 -8
  116. data/entry_types/scrolled/config/locales/en.yml +239 -2
  117. data/entry_types/scrolled/config/routes.rb +4 -0
  118. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb +69 -44
  119. data/entry_types/scrolled/lib/pageflow_scrolled/additional_packs.rb +2 -1
  120. data/entry_types/scrolled/lib/pageflow_scrolled/additional_seed_data.rb +1 -1
  121. data/entry_types/scrolled/lib/pageflow_scrolled/configuration.rb +96 -0
  122. data/entry_types/scrolled/lib/pageflow_scrolled/content_element_consent_vendors.rb +38 -0
  123. data/entry_types/scrolled/lib/pageflow_scrolled/engine.rb +13 -1
  124. data/entry_types/scrolled/lib/pageflow_scrolled/plugin.rb +30 -0
  125. data/entry_types/scrolled/lib/pageflow_scrolled/react_widget_type.rb +6 -1
  126. data/entry_types/scrolled/lib/pageflow_scrolled/web_app_manifest.rb +1 -1
  127. data/entry_types/scrolled/lib/tasks/pageflow_scrolled/dummy.rake +1 -1
  128. data/entry_types/scrolled/lib/tasks/pageflow_scrolled/storybook.rake +1 -2
  129. data/entry_types/scrolled/package/config/webpack.js +26 -0
  130. data/entry_types/scrolled/package/contentElements-editor.js +330 -32
  131. data/entry_types/scrolled/package/contentElements-frontend.css +1 -1
  132. data/entry_types/scrolled/package/contentElements-frontend.js +920 -145
  133. data/entry_types/scrolled/package/editor.js +819 -239
  134. data/entry_types/scrolled/package/frontend/{EditableInlineText.module-14c7b097.js → EditableInlineText.module-6ee0e024.js} +1975 -1792
  135. data/entry_types/scrolled/package/frontend/PhonePlatformContext-b28d991a.js +32 -0
  136. data/entry_types/scrolled/package/frontend/ToggleFullscreenCornerButton-8242f213.js +107 -0
  137. data/entry_types/scrolled/package/frontend/Viewer-32cd1ac1.js +154 -0
  138. data/entry_types/scrolled/package/frontend/{Viewer-b6becc57.js → Viewer-6e4d14ed.js} +32 -161
  139. data/entry_types/scrolled/package/frontend/arrowRight-e42e6011.js +77 -0
  140. data/entry_types/scrolled/package/frontend/{components-b3160dd7.js → components-24363f97.js} +188 -47
  141. data/entry_types/scrolled/package/frontend/{PhonePlatformContext-f6093cc6.js → i18n-71c39823.js} +191 -111
  142. data/entry_types/scrolled/package/frontend/index-fc4b13e6.js +118 -0
  143. data/entry_types/scrolled/package/frontend/index.css +1 -1
  144. data/entry_types/scrolled/package/frontend/index.js +252 -76
  145. data/entry_types/scrolled/package/frontend/useContentElementEditorState-245f1986.js +52 -0
  146. data/entry_types/scrolled/package/package.json +6 -4
  147. data/entry_types/scrolled/package/testHelpers.js +11 -2
  148. data/entry_types/scrolled/package/values/colors.module.css +15 -0
  149. data/entry_types/scrolled/package/widgets/consentBar.css +1 -0
  150. data/entry_types/scrolled/package/widgets/consentBar.js +426 -0
  151. data/entry_types/scrolled/package/widgets/defaultNavigation.css +2 -2
  152. data/entry_types/scrolled/package/widgets/defaultNavigation.js +39 -4
  153. data/entry_types/scrolled/package/widgets/iconInlineFileRights.css +1 -0
  154. data/entry_types/scrolled/package/widgets/iconInlineFileRights.js +49 -0
  155. data/entry_types/scrolled/package/widgets/textInlineFileRights.css +1 -0
  156. data/entry_types/scrolled/package/widgets/textInlineFileRights.js +37 -0
  157. data/lib/generators/pageflow/resque/resque_generator.rb +1 -1
  158. data/lib/generators/pageflow/resque/templates/resque.rake +1 -1
  159. data/lib/generators/pageflow/resque/templates/resque.rb +1 -1
  160. data/lib/generators/pageflow/routes/routes_generator.rb +1 -1
  161. data/lib/pageflow/ability_mixin.rb +5 -5
  162. data/lib/pageflow/active_admin_can_can_fix.rb +2 -2
  163. data/lib/pageflow/built_in_file_type.rb +7 -0
  164. data/lib/pageflow/configuration.rb +29 -1
  165. data/lib/pageflow/engine.rb +18 -40
  166. data/lib/pageflow/entry_export_import/revision_serialization.rb +1 -1
  167. data/lib/pageflow/file_type.rb +2 -2
  168. data/lib/pageflow/global_config_api.rb +2 -2
  169. data/lib/pageflow/nested_revision_component.rb +23 -5
  170. data/lib/pageflow/page_type.rb +1 -1
  171. data/lib/pageflow/paperclip_processors/webp.rb +63 -0
  172. data/lib/pageflow/rails_version.rb +19 -0
  173. data/lib/pageflow/seeds.rb +10 -7
  174. data/lib/pageflow/user_mixin.rb +1 -1
  175. data/lib/pageflow/version.rb +1 -1
  176. data/lib/pageflow/widget_types.rb +4 -0
  177. data/package/config/jest/index.js +3 -1
  178. data/package/config/webpack5.js +14 -0
  179. data/package/editor.js +410 -181
  180. data/package/frontend.js +34 -4
  181. data/package/testHelpers.js +1 -1
  182. data/package/ui.js +297 -71
  183. data/spec/factories/entries.rb +34 -3
  184. data/spec/factories/sites.rb +3 -0
  185. data/vendor/assets/javascripts/iscroll.js +4 -7
  186. metadata +118 -80
  187. data/app/helpers/pageflow/admin/permalinks_helper.rb +0 -15
  188. data/entry_types/scrolled/package/frontend/arrowRight-78a7cee4.js +0 -42
@@ -1,12 +1,15 @@
1
1
  import regeneratorRuntime from 'regenerator-runtime';
2
- import { events, browser, documentHiddenState, PlayerSourceIDMap, media, MultiPlayer, settings, consent } from 'pageflow/frontend';
3
- import React, { useReducer, useState, useLayoutEffect, useEffect, useRef, createContext, useContext, useMemo, useCallback } from 'react';
4
- import { _ as _objectWithoutProperties, u as useI18n, a as _objectSpread2, b as _defineProperty, c as _slicedToArray, d as useLocale, e as useLegalInfo, f as useTheme, g as useEntryMetadata, h as useNestedFiles, i as useFile, j as _toConsumableArray, k as useSectionContentElements, l as useAdditionalSeedData, m as useSectionsWithChapter, n as useBrowserFeature, P as PhonePlatformContext, B as BrowserFeaturesProvider, E as EntryStateProvider, L as LocaleProvider, o as useEntryStateDispatch, p as useSection, q as useChapter } from './PhonePlatformContext-f6093cc6.js';
5
- import I18n from 'i18n-js';
2
+ import { events, browser, documentHiddenState, PlayerSourceIDMap, media, MultiPlayer, settings, features, consent } from 'pageflow/frontend';
3
+ import React, { useState, useRef, useEffect, createContext, useContext, useMemo, useReducer, useCallback, useLayoutEffect } from 'react';
4
+ import { _ as _slicedToArray, a as _objectSpread2, b as _defineProperty, u as useI18n, c as useEntryMetadata, d as useNestedFiles, e as _objectWithoutProperties, f as useWidget, g as useTheme, h as useFileWithInlineRights, i as useFile, j as useSectionContentElements, k as useAdditionalSeedData, l as useSectionsWithChapter, m as useContentElementConsentVendor, n as _toConsumableArray, E as EntryStateProvider, L as LocaleProvider, o as useChapter, p as useEntryStateDispatch, q as useSection } from './i18n-71c39823.js';
6
5
  import classNames from 'classnames';
6
+ import { u as useDelayedBoolean, a as useContentElementEditorState } from './useContentElementEditorState-245f1986.js';
7
7
  import { _ as _createClass, a as _classCallCheck, b as _inherits, c as _createSuper } from './createSuper-d0f30da3.js';
8
8
  import BackboneEvents from 'backbone-events-standalone';
9
+ import I18n from 'i18n-js';
10
+ import stripTags from 'striptags';
9
11
  import Measure from 'react-measure';
12
+ import { u as useBrowserFeature, P as PhonePlatformContext, B as BrowserFeaturesProvider } from './PhonePlatformContext-b28d991a.js';
10
13
 
11
14
  var regenerator = regeneratorRuntime;
12
15
 
@@ -46,241 +49,6 @@ function _asyncToGenerator(fn) {
46
49
  };
47
50
  }
48
51
 
49
- var styles = {"toggle":"Toggle-module_toggle__1fb_N"};
50
-
51
- function _extends() {
52
- _extends = Object.assign || function (target) {
53
- for (var i = 1; i < arguments.length; i++) {
54
- var source = arguments[i];
55
-
56
- for (var key in source) {
57
- if (Object.prototype.hasOwnProperty.call(source, key)) {
58
- target[key] = source[key];
59
- }
60
- }
61
- }
62
-
63
- return target;
64
- };
65
-
66
- return _extends.apply(this, arguments);
67
- }
68
- var ToggleOnIcon = (function (_ref) {
69
- var _ref$styles = _ref.styles,
70
- props = _objectWithoutProperties(_ref, ["styles"]);
71
-
72
- return /*#__PURE__*/React.createElement("svg", _extends({
73
- xmlns: "http://www.w3.org/2000/svg",
74
- viewBox: "60 170 90 157"
75
- }, props), /*#__PURE__*/React.createElement("path", {
76
- d: "M150 297a50 50 0 0050-50 50 50 0 00-50-50H50a50 50 0 00-50 50 50 50 0 0050 50z"
77
- }), /*#__PURE__*/React.createElement("circle", {
78
- cx: "-150",
79
- cy: "-247",
80
- fill: "currentColor",
81
- r: "40",
82
- transform: "scale(-1)"
83
- }), /*#__PURE__*/React.createElement("path", {
84
- stroke: "currentColor",
85
- strokeWidth: "6",
86
- d: "M87 227l-37 37-16-18",
87
- fill: "none"
88
- }));
89
- });
90
-
91
- function _extends$1() {
92
- _extends$1 = Object.assign || function (target) {
93
- for (var i = 1; i < arguments.length; i++) {
94
- var source = arguments[i];
95
-
96
- for (var key in source) {
97
- if (Object.prototype.hasOwnProperty.call(source, key)) {
98
- target[key] = source[key];
99
- }
100
- }
101
- }
102
-
103
- return target;
104
- };
105
-
106
- return _extends$1.apply(this, arguments);
107
- }
108
- var ToggleOffIcon = (function (_ref) {
109
- var _ref$styles = _ref.styles,
110
- props = _objectWithoutProperties(_ref, ["styles"]);
111
-
112
- return /*#__PURE__*/React.createElement("svg", _extends$1({
113
- xmlns: "http://www.w3.org/2000/svg",
114
- viewBox: "60 170 90 157"
115
- }, props), /*#__PURE__*/React.createElement("path", {
116
- d: "M50 197a50 50 0 00-50 50 50 50 0 0050 50h100a50 50 0 0050-50 50 50 0 00-50-50H50z"
117
- }), /*#__PURE__*/React.createElement("circle", {
118
- cx: "50",
119
- cy: "247",
120
- fill: "currentColor",
121
- r: "40"
122
- }), /*#__PURE__*/React.createElement("path", {
123
- stroke: "currentColor",
124
- strokeWidth: "6",
125
- d: "M110.103 271.897l49.795-49.794m-.001 49.794l-49.794-49.795",
126
- fill: "none"
127
- }));
128
- });
129
-
130
- function Toggle(_ref) {
131
- var id = _ref.id,
132
- checked = _ref.checked,
133
- onChange = _ref.onChange;
134
- var Icon = checked ? ToggleOnIcon : ToggleOffIcon;
135
- return /*#__PURE__*/React.createElement("button", {
136
- id: id,
137
- className: styles.toggle,
138
- role: "checkbox",
139
- "aria-checked": checked ? 'true' : 'false',
140
- onClick: onChange
141
- }, /*#__PURE__*/React.createElement(Icon, {
142
- width: 50,
143
- height: 35
144
- }));
145
- }
146
-
147
- function _extends$2() {
148
- _extends$2 = Object.assign || function (target) {
149
- for (var i = 1; i < arguments.length; i++) {
150
- var source = arguments[i];
151
-
152
- for (var key in source) {
153
- if (Object.prototype.hasOwnProperty.call(source, key)) {
154
- target[key] = source[key];
155
- }
156
- }
157
- }
158
-
159
- return target;
160
- };
161
-
162
- return _extends$2.apply(this, arguments);
163
- }
164
- var information = (function (_ref) {
165
- var _ref$styles = _ref.styles,
166
- props = _objectWithoutProperties(_ref, ["styles"]);
167
-
168
- return /*#__PURE__*/React.createElement("svg", _extends$2({
169
- xmlns: "http://www.w3.org/2000/svg",
170
- viewBox: "-65 -65 449 449"
171
- }, props), /*#__PURE__*/React.createElement("path", {
172
- d: "M165 0C74.019 0 0 74.02 0 165.001 0 255.982 74.019 330 165 330s165-74.018 165-164.999S255.981 0 165 0zm0 300c-74.44 0-135-60.56-135-134.999S90.56 30 165 30s135 60.562 135 135.001C300 239.44 239.439 300 165 300z"
173
- }), /*#__PURE__*/React.createElement("path", {
174
- d: "M164.998 70c-11.026 0-19.996 8.976-19.996 20.009 0 11.023 8.97 19.991 19.996 19.991 11.026 0 19.996-8.968 19.996-19.991 0-11.033-8.97-20.009-19.996-20.009zm.002 70c-8.284 0-15 6.716-15 15v90c0 8.284 6.716 15 15 15 8.284 0 15-6.716 15-15v-90c0-8.284-6.716-15-15-15z"
175
- }));
176
- });
177
-
178
- var styles$1 = {"bar":"Bar-module_bar__kk5uX","text":"Bar-module_text__3EwGu","button":"Bar-module_button__3Dg6p","acceptAllButton":"Bar-module_acceptAllButton__Ij5lh Bar-module_button__3Dg6p","saveButton":"Bar-module_saveButton__km-gH Bar-module_button__3Dg6p","configureButton":"Bar-module_configureButton__2mQQz Bar-module_button__3Dg6p","vendorsBox":"Bar-module_vendorsBox__1Uyex","vendorList":"Bar-module_vendorList__11m8q","vendor":"Bar-module_vendor__2ogmn","expandVendor":"Bar-module_expandVendor__1gfA3","decisionButtons":"Bar-module_decisionButtons__2JzYP"};
179
-
180
- function reducer(state, vendorName) {
181
- return _objectSpread2(_objectSpread2({}, state), {}, _defineProperty({}, vendorName, !state[vendorName]));
182
- }
183
-
184
- function VendorsBox(_ref) {
185
- var vendors = _ref.vendors,
186
- save = _ref.save,
187
- _ref$defaultExpanded = _ref.defaultExpanded,
188
- defaultExpanded = _ref$defaultExpanded === void 0 ? false : _ref$defaultExpanded;
189
-
190
- var _useI18n = useI18n(),
191
- t = _useI18n.t;
192
-
193
- var _useReducer = useReducer(reducer, vendors.reduce(function (result, vendor) {
194
- return _objectSpread2(_objectSpread2({}, result), {}, _defineProperty({}, vendor.name, vendor.state === 'accepted'));
195
- }, {})),
196
- _useReducer2 = _slicedToArray(_useReducer, 2),
197
- vendorStates = _useReducer2[0],
198
- dispatch = _useReducer2[1];
199
-
200
- return /*#__PURE__*/React.createElement("div", {
201
- className: styles$1.vendorsBox
202
- }, /*#__PURE__*/React.createElement("h3", null, t('pageflow_scrolled.public.consent_settings')), /*#__PURE__*/React.createElement("div", {
203
- className: styles$1.vendorList
204
- }, renderVendors({
205
- vendors: vendors,
206
- vendorStates: vendorStates,
207
- t: t,
208
- defaultExpanded: defaultExpanded,
209
- onToggle: dispatch
210
- })), /*#__PURE__*/React.createElement("button", {
211
- className: styles$1.saveButton,
212
- onClick: function onClick() {
213
- return save(vendorStates);
214
- }
215
- }, t('pageflow_scrolled.public.consent_save')));
216
- }
217
-
218
- function renderVendors(_ref2) {
219
- var vendors = _ref2.vendors,
220
- vendorStates = _ref2.vendorStates,
221
- t = _ref2.t,
222
- defaultExpanded = _ref2.defaultExpanded,
223
- onToggle = _ref2.onToggle;
224
-
225
- if (!vendors.length) {
226
- return /*#__PURE__*/React.createElement("div", {
227
- className: "consent_vendor_list-blank"
228
- }, t('pageflow_scrolled.public.consent_no_vendors'));
229
- }
230
-
231
- return vendors.map(function (vendor) {
232
- return /*#__PURE__*/React.createElement(Vendor, {
233
- key: vendor.name,
234
- vendor: vendor,
235
- state: vendorStates[vendor.name],
236
- t: t,
237
- defaultExpanded: defaultExpanded,
238
- onToggle: onToggle
239
- });
240
- });
241
- }
242
-
243
- function Vendor(_ref3) {
244
- var vendor = _ref3.vendor,
245
- state = _ref3.state,
246
- onToggle = _ref3.onToggle,
247
- t = _ref3.t,
248
- defaultExpanded = _ref3.defaultExpanded;
249
-
250
- var _useState = useState(defaultExpanded),
251
- _useState2 = _slicedToArray(_useState, 2),
252
- expanded = _useState2[0],
253
- setExpanded = _useState2[1];
254
-
255
- var id = "consent-vendor-".concat(vendor.name);
256
- return /*#__PURE__*/React.createElement("div", {
257
- className: styles$1.vendor
258
- }, /*#__PURE__*/React.createElement("label", {
259
- htmlFor: id
260
- }, vendor.displayName), /*#__PURE__*/React.createElement(Toggle, {
261
- id: id,
262
- checked: state,
263
- onChange: function onChange() {
264
- return onToggle(vendor.name);
265
- }
266
- }), /*#__PURE__*/React.createElement("button", {
267
- className: styles$1.expandVendor,
268
- title: t('pageflow_scrolled.public.consent_expand_vendor'),
269
- onClick: function onClick() {
270
- return setExpanded(!expanded);
271
- }
272
- }, /*#__PURE__*/React.createElement(information, {
273
- width: 30,
274
- height: 34
275
- })), expanded && /*#__PURE__*/React.createElement("p", {
276
- dangerouslySetInnerHTML: {
277
- __html: vendor.description
278
- }
279
- }));
280
- }
281
-
282
- var useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;
283
-
284
52
  function useOnScreen(ref) {
285
53
  var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
286
54
  rootMargin = _ref.rootMargin,
@@ -361,7 +129,7 @@ function createIntersectionObserver(callback, options, skipIframeFix) {
361
129
  }
362
130
  }
363
131
 
364
- var styles$2 = {"wrapper":"useScrollPositionLifecycle-module_wrapper__1a6Kr","isActiveProbe":"useScrollPositionLifecycle-module_isActiveProbe__3VKB5"};
132
+ var styles = {"wrapper":"useScrollPositionLifecycle-module_wrapper__1a6Kr","isActiveProbe":"useScrollPositionLifecycle-module_isActiveProbe__3VKB5"};
365
133
 
366
134
  var StaticPreviewContext = createContext(false);
367
135
  function StaticPreview(_ref) {
@@ -385,7 +153,8 @@ function useIsStaticPreview() {
385
153
  function createScrollPositionLifecycleProvider(Context) {
386
154
  return function ScrollPositionLifecycleProvider(_ref2) {
387
155
  var children = _ref2.children,
388
- onActivate = _ref2.onActivate;
156
+ onActivate = _ref2.onActivate,
157
+ entersWithFadeTransition = _ref2.entersWithFadeTransition;
389
158
  var ref = useRef();
390
159
  var isActiveProbeRef = useRef();
391
160
  var isStaticPreview = useContext(StaticPreviewContext);
@@ -394,12 +163,39 @@ function createScrollPositionLifecycleProvider(Context) {
394
163
  });
395
164
  var shouldPrepare = useOnScreen(ref, {
396
165
  rootMargin: '25% 0px 25% 0px'
166
+ }) && !isStaticPreview; // Sections that enter with fade transition only become visible
167
+ // once they reach the center of the viewport. We want to reflect
168
+ // that in `isVisible`/`onVisible` to prevent background videos
169
+ // from starting too soon. Since fade section might still exit
170
+ // with a scroll transition, we want to keep `isVisible` true
171
+ // until the section has completely left the viewport. We do not
172
+ // care about when exactly a background video pauses.
173
+ //
174
+ // Note that with fade transitions sections actually stay visible
175
+ // a bit longer while they are still fading out. This is handled
176
+ // by `isVisibleWithDelay` below.
177
+
178
+ var shouldBeVisible = useOnScreen(ref, {
179
+ rootMargin: entersWithFadeTransition ? '0px 0px -50% 0px' : undefined
397
180
  }) && !isStaticPreview;
398
- var isVisible = useOnScreen(ref) && !isStaticPreview;
399
- var isActive = useOnScreen(isActiveProbeRef, {
181
+ var shouldBeActive = useOnScreen(isActiveProbeRef, {
400
182
  rootMargin: '-50% 0px -50% 0px',
401
183
  onIntersecting: onActivate
402
- }) && !isStaticPreview;
184
+ }) && !isStaticPreview; // useDelayedBoolean causes an extra render once the delay has
185
+ // elapsed. When entersWithFadeTransition is false,
186
+ // isVisibleWithDelay is never used, though. Since hooks can not
187
+ // be wrapped in conditionals, we ensure that the value passed to
188
+ // useDelayedBoolean is always false if entersWithFadeTransition
189
+ // is false. This prevents the extra render.
190
+
191
+ var isVisibleWithDelay = useDelayedBoolean(shouldBeVisible && entersWithFadeTransition, {
192
+ fromTrueToFalse: 1000
193
+ });
194
+ var isVisible = entersWithFadeTransition ? isVisibleWithDelay : shouldBeVisible; // We want to make sure that `onActivate` is never called before
195
+ // `onVisible`, no matter in which order the intersection
196
+ // observers above fire.
197
+
198
+ var isActive = isVisible && shouldBeActive;
403
199
  var value = useMemo(function () {
404
200
  return {
405
201
  shouldLoad: shouldLoad,
@@ -410,10 +206,10 @@ function createScrollPositionLifecycleProvider(Context) {
410
206
  }, [shouldLoad, shouldPrepare, isVisible, isActive]);
411
207
  return /*#__PURE__*/React.createElement("div", {
412
208
  ref: ref,
413
- className: classNames(styles$2.wrapper)
209
+ className: classNames(styles.wrapper)
414
210
  }, /*#__PURE__*/React.createElement("div", {
415
211
  ref: isActiveProbeRef,
416
- className: styles$2.isActiveProbe
212
+ className: styles.isActiveProbe
417
213
  }), /*#__PURE__*/React.createElement(Context.Provider, {
418
214
  value: value
419
215
  }, children));
@@ -457,718 +253,274 @@ function createScrollPositionLifecycleHook(Context) {
457
253
  };
458
254
  }
459
255
 
460
- var ContentElementEditorStateContext = createContext({
461
- isSelected: false,
462
- isEditable: false,
463
- setTransientState: function setTransientState() {}
464
- });
465
- /**
466
- * Use inside a content element component to determine whether the
467
- * component is being rendered inside the editor iframe, and whether
468
- * the content element is currently selected. This can be used to
469
- * implement simple inline editing capabilities like displaying extra
470
- * information when the content element is selected.
471
- *
472
- * @example
473
- * const {isEditable, isSelected} = useContentElementEditorState();
474
- */
256
+ var SectionLifecycleContext = createContext();
257
+ var SectionLifecycleProvider = createScrollPositionLifecycleProvider(SectionLifecycleContext);
258
+ var useSectionLifecycle = createScrollPositionLifecycleHook(SectionLifecycleContext);
475
259
 
476
- function useContentElementEditorState() {
477
- return useContext(ContentElementEditorStateContext);
478
- }
260
+ var Atmo = /*#__PURE__*/function () {
261
+ function Atmo(_ref) {
262
+ var _this = this;
479
263
 
480
- var ConsentContext = createContext();
481
- function ConsentProvider(_ref) {
482
- var consent = _ref.consent,
483
- children = _ref.children;
484
- return /*#__PURE__*/React.createElement(ConsentContext.Provider, {
485
- value: consent
486
- }, children);
487
- }
488
- function useConsentRequested() {
489
- var consent = useContext(ConsentContext);
264
+ var atmoSourceId = _ref.atmoSourceId,
265
+ multiPlayer = _ref.multiPlayer,
266
+ backgroundMedia = _ref.backgroundMedia;
490
267
 
491
- var _useState = useState({}),
492
- _useState2 = _slicedToArray(_useState, 2),
493
- request = _useState2[0],
494
- setRequest = _useState2[1];
268
+ _classCallCheck(this, Atmo);
495
269
 
496
- useIsomorphicLayoutEffect(function () {
497
- var unmounted = false;
270
+ this.multiPlayer = multiPlayer;
271
+ this.atmoSourceId = atmoSourceId;
272
+ this.backgroundMedia = backgroundMedia;
273
+ this.backgroundMedia.on('change:muted', function () {
274
+ _this.update();
275
+ });
276
+ documentHiddenState(function (hiddenState) {
277
+ if (hiddenState === 'hidden') {
278
+ _this.multiPlayer.fadeOutIfPlaying();
279
+ } else {
280
+ _this.update();
281
+ }
282
+ });
283
+ this.listenTo(this.multiPlayer, 'playfailed', function () {
284
+ backgroundMedia.mute(true);
285
+ });
286
+ }
498
287
 
499
- _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
500
- var _yield$consent$reques, vendors, _acceptAll, _denyAll, _save;
288
+ _createClass(Atmo, [{
289
+ key: "disable",
290
+ value: function disable() {
291
+ this.disabled = true;
292
+ this.multiPlayer.fadeOutAndPause();
293
+ events.trigger('atmo:disabled');
294
+ }
295
+ }, {
296
+ key: "enable",
297
+ value: function enable() {
298
+ this.disabled = false;
299
+ this.update();
300
+ events.trigger('atmo:enabled');
301
+ }
302
+ }, {
303
+ key: "pause",
304
+ value: function pause() {
305
+ if (browser.has('volume control support')) {
306
+ return this.multiPlayer.fadeOutAndPause();
307
+ } else {
308
+ this.multiPlayer.pause();
309
+ }
310
+ }
311
+ }, {
312
+ key: "turnDown",
313
+ value: function turnDown() {
314
+ if (browser.has('volume control support')) {
315
+ return this.multiPlayer.changeVolumeFactor(0.2);
316
+ } else {
317
+ this.multiPlayer.pause();
318
+ }
319
+ }
320
+ }, {
321
+ key: "resume",
322
+ value: function resume() {
323
+ if (this.multiPlayer.paused()) {
324
+ if (this.disabled || this.backgroundMedia.muted) {
325
+ return Promise.resolve();
326
+ } else {
327
+ return this.multiPlayer.resumeAndFadeIn();
328
+ }
329
+ } else {
330
+ return this.multiPlayer.changeVolumeFactor(1);
331
+ }
332
+ }
333
+ }, {
334
+ key: "update",
335
+ value: function update() {
336
+ if (!this.disabled) {
337
+ if (this.backgroundMedia.muted) {
338
+ this.multiPlayer.fadeOutAndPause();
339
+ } else {
340
+ this.multiPlayer.fadeTo(this.atmoSourceId);
341
+ }
342
+ }
343
+ }
344
+ }, {
345
+ key: "createMediaPlayerHooks",
346
+ value: function createMediaPlayerHooks(atmoDuringPlayback) {
347
+ var atmo = this;
348
+ return {
349
+ before: function before() {
350
+ if (atmoDuringPlayback === 'mute') {
351
+ atmo.pause();
352
+ } else if (atmoDuringPlayback === 'turnDown') {
353
+ atmo.turnDown();
354
+ }
355
+ },
356
+ after: function after() {
357
+ atmo.resume();
358
+ }
359
+ };
360
+ }
361
+ }]);
501
362
 
502
- return regenerator.wrap(function _callee$(_context) {
503
- while (1) {
504
- switch (_context.prev = _context.next) {
505
- case 0:
506
- _context.next = 2;
507
- return consent.requested();
508
-
509
- case 2:
510
- _yield$consent$reques = _context.sent;
511
- vendors = _yield$consent$reques.vendors;
512
- _acceptAll = _yield$consent$reques.acceptAll;
513
- _denyAll = _yield$consent$reques.denyAll;
514
- _save = _yield$consent$reques.save;
515
-
516
- if (!unmounted) {
517
- setRequest({
518
- vendors: vendors,
519
- acceptAll: function acceptAll() {
520
- _acceptAll();
521
-
522
- setRequest({});
523
- },
524
- denyAll: function denyAll() {
525
- _denyAll();
526
-
527
- setRequest({});
528
- },
529
- save: function save(decisions) {
530
- _save(decisions);
531
-
532
- setRequest({});
533
- }
534
- });
535
- }
363
+ return Atmo;
364
+ }();
365
+ Object.assign(Atmo.prototype, BackboneEvents);
536
366
 
537
- case 8:
538
- case "end":
539
- return _context.stop();
540
- }
541
- }
542
- }, _callee);
543
- }))();
367
+ function getContextValue(updateAtmo, createMediaPlayerHooks) {
368
+ var empty = function empty() {};
544
369
 
545
- return function () {
546
- return unmounted = true;
547
- };
548
- }, [consent]);
549
- return request;
370
+ return {
371
+ updateAtmo: updateAtmo || empty,
372
+ createMediaPlayerHooks: createMediaPlayerHooks || empty
373
+ };
550
374
  }
551
- function useConsentGiven(vendorName) {
552
- var consent = useContext(ConsentContext);
553
375
 
554
- var _useContentElementEdi = useContentElementEditorState(),
555
- isEditable = _useContentElementEdi.isEditable;
556
-
557
- var isStaticPreview = useIsStaticPreview();
558
-
559
- var _useState3 = useState(isEditable || isStaticPreview),
560
- _useState4 = _slicedToArray(_useState3, 2),
561
- consentGiven = _useState4[0],
562
- setConsentGiven = _useState4[1];
376
+ var AtmoContext = createContext(getContextValue());
377
+ function AtmoProvider(_ref) {
378
+ var children = _ref.children;
379
+ var atmoConfig = useRef({});
380
+ useEffect(function () {
381
+ var currentAtmo = atmoConfig.current;
382
+ currentAtmo.pool = PlayerSourceIDMap(media, {
383
+ playerOptions: {
384
+ tagName: 'audio',
385
+ loop: true
386
+ }
387
+ });
388
+ currentAtmo.multiPlayer = new MultiPlayer(currentAtmo.pool, {
389
+ fadeDuration: 500,
390
+ crossFade: true,
391
+ playFromBeginning: false,
392
+ rewindOnChange: true
393
+ });
394
+ currentAtmo.atmo = new Atmo({
395
+ multiPlayer: currentAtmo.multiPlayer,
396
+ backgroundMedia: media
397
+ });
398
+ }, []);
563
399
 
564
- useIsomorphicLayoutEffect(function () {
565
- var unmounted = false;
400
+ var updateAtmo = function updateAtmo(_ref2) {
401
+ var audioFilePermaId = _ref2.audioFilePermaId,
402
+ sources = _ref2.sources;
403
+ var currentAtmo = atmoConfig.current;
566
404
 
567
- _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2() {
568
- var result;
569
- return regenerator.wrap(function _callee2$(_context2) {
570
- while (1) {
571
- switch (_context2.prev = _context2.next) {
572
- case 0:
573
- if (!(!vendorName || isEditable || isStaticPreview)) {
574
- _context2.next = 2;
575
- break;
576
- }
405
+ if (currentAtmo.atmo) {
406
+ currentAtmo.pool.mapSources(audioFilePermaId, sources);
407
+ currentAtmo.atmo.atmoSourceId = audioFilePermaId;
408
+ currentAtmo.atmo.update();
409
+ }
410
+ };
577
411
 
578
- return _context2.abrupt("return");
412
+ var createMediaPlayerHooks = function createMediaPlayerHooks(options) {
413
+ if (atmoConfig.current.atmo) {
414
+ return atmoConfig.current.atmo.createMediaPlayerHooks(options);
415
+ }
416
+ };
579
417
 
580
- case 2:
581
- _context2.next = 4;
582
- return consent.requireAccepted(vendorName);
418
+ var contextValue = useMemo(function () {
419
+ return getContextValue(updateAtmo, createMediaPlayerHooks);
420
+ }, []);
421
+ return /*#__PURE__*/React.createElement(AtmoContext.Provider, {
422
+ value: contextValue
423
+ }, children);
424
+ }
425
+ function useAtmo() {
426
+ return useContext(AtmoContext);
427
+ }
583
428
 
584
- case 4:
585
- result = _context2.sent;
429
+ function PlayerContainer(_ref) {
430
+ var filePermaId = _ref.filePermaId,
431
+ sources = _ref.sources,
432
+ textTrackSources = _ref.textTrackSources,
433
+ type = _ref.type,
434
+ playsInline = _ref.playsInline,
435
+ loop = _ref.loop,
436
+ controls = _ref.controls,
437
+ altText = _ref.altText,
438
+ mediaEventsContextData = _ref.mediaEventsContextData,
439
+ atmoDuringPlayback = _ref.atmoDuringPlayback,
440
+ onSetup = _ref.onSetup,
441
+ onDispose = _ref.onDispose;
442
+ var playerWrapperRef = useRef(null);
443
+ var atmo = useAtmo();
444
+ useEffect(function () {
445
+ var playerWrapper = playerWrapperRef.current;
586
446
 
587
- if (!unmounted && result === 'fulfilled') {
588
- setConsentGiven(true);
589
- }
447
+ if (sources) {
448
+ var player = media.getPlayer(sources, {
449
+ textTrackSources: textTrackSources,
450
+ filePermaId: filePermaId,
451
+ tagName: type,
452
+ playsInline: playsInline,
453
+ loop: loop,
454
+ controls: controls,
455
+ hooks: atmoDuringPlayback ? atmo.createMediaPlayerHooks(atmoDuringPlayback) : {},
456
+ //create hooks only for inline media players
457
+ mediaEventsContextData: mediaEventsContextData,
458
+ altText: altText,
459
+ onRelease: function onRelease() {
460
+ playerWrapper.removeChild(player.el());
461
+ player = null;
590
462
 
591
- case 6:
592
- case "end":
593
- return _context2.stop();
463
+ if (onDispose) {
464
+ onDispose();
594
465
  }
595
466
  }
596
- }, _callee2);
597
- }))();
598
-
599
- return function () {
600
- return unmounted = true;
601
- };
602
- }, [consent, vendorName]);
603
- var giveConsent = useCallback(function () {
604
- return consent.accept(vendorName);
605
- }, [consent, vendorName]);
606
- return [consentGiven, giveConsent];
607
- }
467
+ });
468
+ playerWrapper.appendChild(player.el());
608
469
 
609
- function _extends$3() {
610
- _extends$3 = Object.assign || function (target) {
611
- for (var i = 1; i < arguments.length; i++) {
612
- var source = arguments[i];
470
+ if (onSetup) {
471
+ onSetup(player);
472
+ }
613
473
 
614
- for (var key in source) {
615
- if (Object.prototype.hasOwnProperty.call(source, key)) {
616
- target[key] = source[key];
474
+ return function () {
475
+ // onRelease might already have been called by the pool when
476
+ // it needed to re-use a player.
477
+ if (player) {
478
+ media.releasePlayer(player);
617
479
  }
618
- }
480
+ };
619
481
  }
620
-
621
- return target;
622
- };
623
-
624
- return _extends$3.apply(this, arguments);
482
+ });
483
+ return /*#__PURE__*/React.createElement("div", {
484
+ ref: playerWrapperRef
485
+ });
625
486
  }
626
- var GearIcon = (function (_ref) {
627
- var _ref$styles = _ref.styles,
628
- props = _objectWithoutProperties(_ref, ["styles"]);
629
-
630
- return /*#__PURE__*/React.createElement("svg", _extends$3({
631
- xmlns: "http://www.w3.org/2000/svg",
632
- viewBox: "-3 -3 30 30"
633
- }, props), /*#__PURE__*/React.createElement("path", {
634
- d: "M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65A.488.488 0 0014 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"
635
- }));
636
- });
637
-
638
- function Bar(_ref) {
639
- var _ref$defaultExpanded = _ref.defaultExpanded,
640
- defaultExpanded = _ref$defaultExpanded === void 0 ? false : _ref$defaultExpanded;
641
487
 
642
- var _useConsentRequested = useConsentRequested(),
643
- vendors = _useConsentRequested.vendors,
644
- acceptAll = _useConsentRequested.acceptAll,
645
- denyAll = _useConsentRequested.denyAll,
646
- save = _useConsentRequested.save;
488
+ PlayerContainer.defaultProps = {
489
+ textTrackSources: []
490
+ }; // This function assumes that that the parameters are arrays of
491
+ // objects containing only skalar values. It is not a full deep
492
+ // equality check, but suffices for the use case.
647
493
 
648
- var _useState = useState(defaultExpanded),
649
- _useState2 = _slicedToArray(_useState, 2),
650
- expanded = _useState2[0],
651
- setExpanded = _useState2[1];
494
+ function deepEqual(a, b) {
495
+ if (a.length !== b.length) {
496
+ return false;
497
+ }
652
498
 
653
- var _useI18n = useI18n(),
654
- t = _useI18n.t;
499
+ for (var i = 0; i < a.length; i++) {
500
+ var aItem = a[i];
501
+ var bItem = b[i];
655
502
 
656
- var locale = useLocale();
657
- var privacyLinkUrl = useLegalInfo().privacy.url;
503
+ if (Object.keys(aItem).length !== Object.keys(bItem).length) {
504
+ return false;
505
+ }
658
506
 
659
- if (vendors) {
660
- return /*#__PURE__*/React.createElement("div", {
661
- className: styles$1.bar
662
- }, renderText({
663
- privacyLinkUrl: privacyLinkUrl,
664
- t: t,
665
- locale: locale,
666
- vendors: vendors
667
- }), !expanded && /*#__PURE__*/React.createElement("button", {
668
- className: styles$1.configureButton,
669
- onClick: function onClick() {
670
- return setExpanded(true);
507
+ for (var key in aItem) {
508
+ if (aItem[key] !== bItem[key]) {
509
+ return false;
671
510
  }
672
- }, /*#__PURE__*/React.createElement(GearIcon, {
673
- width: 15,
674
- height: 15
675
- }), t('pageflow_scrolled.public.consent_configure')), expanded && /*#__PURE__*/React.createElement(VendorsBox, {
676
- vendors: vendors,
677
- save: save,
678
- t: t,
679
- defaultExpanded: defaultExpanded
680
- }), /*#__PURE__*/React.createElement("div", {
681
- className: styles$1.decisionButtons
682
- }, /*#__PURE__*/React.createElement("button", {
683
- className: styles$1.button,
684
- onClick: denyAll
685
- }, t('pageflow_scrolled.public.consent_deny_all')), /*#__PURE__*/React.createElement("button", {
686
- className: styles$1.acceptAllButton,
687
- onClick: acceptAll
688
- }, t('pageflow_scrolled.public.consent_accept_all'))));
511
+ }
689
512
  }
690
513
 
691
- return null;
514
+ return true;
692
515
  }
693
516
 
694
- function renderText(_ref2) {
695
- var privacyLinkUrl = _ref2.privacyLinkUrl,
696
- t = _ref2.t,
697
- locale = _ref2.locale,
698
- vendors = _ref2.vendors;
699
- var vendorNames = vendors.map(function (vendor) {
700
- return vendor.name;
701
- }).join(',');
702
- var text = t('pageflow_scrolled.public.consent_prompt_html', {
703
- privacyLinkUrl: "".concat(privacyLinkUrl, "?lang=").concat(locale, "&vendors=").concat(vendorNames, "#consent")
704
- });
705
- return /*#__PURE__*/React.createElement("div", {
706
- className: styles$1.text,
707
- dangerouslySetInnerHTML: {
708
- __html: text
709
- }
710
- });
517
+ function areEqual(prevProps, nextProps) {
518
+ return prevProps.type === nextProps.type && prevProps.playsInline === nextProps.playsInline && prevProps.loop === nextProps.loop && prevProps.controls === nextProps.controls && prevProps.altText === nextProps.altText && prevProps.atmoDuringPlayback === nextProps.atmoDuringPlayback && deepEqual(prevProps.sources, nextProps.sources) && deepEqual(prevProps.textTrackSources, nextProps.textTrackSources);
711
519
  }
712
520
 
713
- var styles$3 = {"optIn":"OptIn-module_optIn__3nHo1","optInIcon":"OptIn-module_optInIcon__3-81I","optInMessage":"OptIn-module_optInMessage__1OfTR","optInButton":"OptIn-module_optInButton__1LhtX"};
521
+ var PlayerContainer$1 = React.memo(PlayerContainer, areEqual);
714
522
 
715
- function _extends$4() {
716
- _extends$4 = Object.assign || function (target) {
717
- for (var i = 1; i < arguments.length; i++) {
718
- var source = arguments[i];
719
-
720
- for (var key in source) {
721
- if (Object.prototype.hasOwnProperty.call(source, key)) {
722
- target[key] = source[key];
723
- }
724
- }
725
- }
726
-
727
- return target;
728
- };
729
-
730
- return _extends$4.apply(this, arguments);
731
- }
732
- var OptInIcon = (function (_ref) {
733
- var _ref$styles = _ref.styles,
734
- props = _objectWithoutProperties(_ref, ["styles"]);
735
-
736
- return /*#__PURE__*/React.createElement("svg", _extends$4({
737
- xmlns: "http://www.w3.org/2000/svg",
738
- viewBox: "0 0 131 95"
739
- }, props), /*#__PURE__*/React.createElement("path", {
740
- d: "M32.01.01C46.678-.01 61.345.009 76.014.002 83.007.007 90-.009 96.99.011c.015 9.157.014 18.316 0 27.474-1.357.073-2.706.259-4.048.478-.01-7.986 0-15.975-.004-23.961-18.958-.003-37.917-.003-56.875 0l-.001 28.916c.01 2.37-.022 4.742.016 7.113 6.173-.025 12.348-.006 18.52-.011 5.804.01 11.609-.022 17.41.013-1 1.28-2.001 2.56-2.844 3.948-12.372.024-24.748-.011-37.12.019-.06-.365-.03-.735-.034-1.1V17.497c.007-5.83-.024-11.659.001-17.486zm17.617 8.004a5.999 5.999 0 014.359 1.49c1.273 1.116 2.048 2.8 2.013 4.498.042 1.806-.845 3.59-2.263 4.702-1.271 1.013-2.975 1.483-4.583 1.228a5.88 5.88 0 01-3.479-1.785c-1.44-1.459-2.013-3.695-1.475-5.67.6-2.448 2.905-4.346 5.428-4.463zm22.106 7.758c.181-.258.332-.54.547-.772 2.325 3.868 4.683 7.717 7.02 11.578.891 1.503 1.85 2.973 2.7 4.5a35.062 35.062 0 00-5.646 3.779c-.154.162-.387.14-.592.143-10.585-.014-21.174.014-31.762-.015.088-.228.308-.367.47-.542 3.79-3.745 7.58-7.484 11.365-11.232.098-.085.217-.265.366-.15 2.65 1.308 5.3 2.62 7.951 3.928 2.545-3.73 5.052-7.48 7.581-11.217zM0 21.042c.256-.058.517-.039.775-.039 9.175.007 18.349-.007 27.523.007l.064.076c.017 1.308-.012 2.618.015 3.927-5.416.038-10.834.001-16.252.018-.01 7.981-.013 15.962.002 23.944 11.917.013 23.834.013 35.752 0 .022-.674-.002-1.35.012-2.023 4.034.01 8.07.01 12.105 0 .002 11.349.01 22.698-.003 34.048-12.082-.025-24.163-.003-36.244-.01-7.911.007-15.823-.015-23.734.01-.02-19.988.01-39.975-.015-59.959zm3.435 4.043c-.904.236-1.577 1.152-1.482 2.086.079.997.994 1.837 1.999 1.82 1.367.002 2.736.015 4.105-.007 1.04-.036 1.928-.995 1.878-2.03-.003-.996-.867-1.896-1.868-1.925-1.294-.01-2.585.002-3.878-.005-.252.004-.51-.013-.754.061zm-.219 8.067c-.815.317-1.373 1.203-1.256 2.076.1.938.94 1.724 1.89 1.756 1.25.016 2.5-.002 3.752.008.439.008.9-.025 1.288-.246.73-.39 1.173-1.257 1.019-2.075-.136-.889-.95-1.62-1.852-1.645-1.328-.007-2.653.002-3.98-.004-.29-.005-.589.016-.86.13zm.219 7.923c-.762.2-1.372.884-1.471 1.665-.128.844.384 1.718 1.158 2.064.403.192.859.19 1.295.181 1.217-.008 2.434.011 3.651-.008 1.032-.047 1.92-.998 1.868-2.034-.007-.994-.87-1.891-1.87-1.922-1.293-.011-2.584.002-3.877-.006-.252-.001-.51-.008-.754.06zm-.01 8.003c-1.018.249-1.706 1.392-1.413 2.403.21.868 1.057 1.512 1.95 1.497 1.364-.003 2.728.01 4.09-.006 1.02-.034 1.906-.958 1.883-1.975.026-1.017-.858-1.958-1.88-1.981-1.252-.011-2.503.002-3.754-.003-.292-.004-.591-.018-.877.065zm48.107 0c-1.117.272-1.79 1.607-1.323 2.66a2.027 2.027 0 001.86 1.238c1.326.003 2.652.003 3.977 0 1.056.025 2.032-.916 1.996-1.978.045-1.022-.86-1.96-1.88-1.984-1.252-.008-2.503.003-3.754-.002-.293 0-.591-.017-.876.066zM12.13 53.016c-.015 7.981-.012 15.961-.001 23.943 11.917.003 23.836.003 35.753 0 .011-7.982.014-15.962-.001-23.943a14203.52 14203.52 0 00-35.75 0zm-8.694 4.05c-.797.208-1.422.943-1.482 1.764-.112 1.07.805 2.103 1.883 2.137 1.371.014 2.743.003 4.113.006 1.035.01 1.977-.89 1.986-1.928.054-1.033-.83-2.003-1.87-2.037-1.254-.01-2.508.003-3.763-.005-.289 0-.584-.014-.867.064zm48.108.003c-.951.235-1.623 1.244-1.456 2.208.123.947 1.016 1.71 1.972 1.696h3.997c1.031.013 1.994-.886 1.984-1.928.071-1.036-.829-2.011-1.866-2.037-1.254-.01-2.51.003-3.764-.005-.29 0-.586-.014-.867.066zM3.425 65.066c-.955.242-1.634 1.262-1.45 2.234.14.9.957 1.638 1.874 1.662 1.364.011 2.727 0 4.09.006 1.06.022 2.023-.925 1.997-1.984.027-1.02-.86-1.952-1.882-1.98-1.211-.012-2.426.002-3.637-.004-.332-.001-.669-.021-.992.066zm48.107.003c-.927.231-1.584 1.195-1.456 2.14.093.935.935 1.723 1.879 1.752 1.365.011 2.73 0 4.093.006 1.055.016 2.043-.917 1.994-1.984.045-1.023-.86-1.958-1.88-1.981-1.252-.011-2.502.002-3.753-.003-.294-.003-.592-.012-.877.07zM3.435 73.057c-.797.204-1.422.94-1.482 1.76-.111 1.07.802 2.112 1.883 2.138 1.371.013 2.743.002 4.113.005 1.035.017 1.977-.891 1.986-1.928.054-1.033-.835-1.997-1.87-2.037-1.254-.01-2.508.003-3.763-.005-.289.001-.584-.01-.867.067zm48.108 0c-.887.22-1.543 1.118-1.476 2.029.035.974.892 1.837 1.874 1.869 1.37.013 2.742.002 4.114.005 1.033.017 1.993-.883 1.985-1.925.071-1.039-.833-2.006-1.868-2.04-1.254-.01-2.509.003-3.763-.005-.289.001-.585-.01-.866.067zM96.83 31.045c6.813-.36 13.73 1.456 19.431 5.154a32.396 32.396 0 019.482 9.342 31.527 31.527 0 015.043 13.773c.625 5.36-.123 10.88-2.225 15.867-1.766 4.254-4.499 8.108-7.91 11.243a32.605 32.605 0 01-11.584 6.844 33.066 33.066 0 01-15.656 1.337 32.59 32.59 0 01-13.329-5.235c-5.2-3.514-9.323-8.551-11.692-14.307a31.532 31.532 0 01-2.327-14.038 31.433 31.433 0 013.839-13.243 32.232 32.232 0 018.329-9.799c5.259-4.156 11.865-6.62 18.6-6.938zm15.6 12.011c-8.543.979-17.086 1.933-25.627 2.92-.013 8.152.006 16.308-.008 24.462-2.325-.848-5.015-.792-7.24.318-1.33.665-2.493 1.763-2.997 3.169-.503 1.356-.289 2.934.528 4.128.752 1.154 1.947 1.978 3.235 2.465 1.48.569 3.115.675 4.68.452 1.888-.295 3.742-1.222 4.862-2.784.67-.936.965-2.102.894-3.237-.014-7.054.008-14.105-.01-21.158 1.976-.282 3.965-.458 5.946-.7 4.944-.56 9.885-1.124 14.827-1.682V67.42c-1.677-.563-3.506-.755-5.247-.362-1.764.38-3.483 1.32-4.479 2.84a4.618 4.618 0 00-.637 3.729c.32 1.196 1.12 2.243 2.139 2.959 1.533 1.101 3.474 1.576 5.355 1.489 2.036-.083 4.111-.843 5.498-2.353a5.078 5.078 0 001.329-3.83c-.007-6.755-.002-13.51-.005-20.265.058-2.962-.002-5.924-.002-8.884-1.018.053-2.03.212-3.04.313z"
741
- }));
742
- });
743
-
744
- /**
745
- * Render opt in prompt instead of children if third party consent
746
- * cookie has been configured in theme options and user has not given
747
- * consent for passed provider.
748
- *
749
- * @param {Object} props
750
- * @param {string} props.providerName -
751
- * Only render children if user has given consent for this provider.
752
- * @param {React.ReactElement} props.children -
753
- * Children to conditionally render.
754
- * @param {function} [props.wrapper] -
755
- * Function that receives children to allow wrapping opt-in prompt
756
- * in custom elements.
757
- * @param {boolean} [props.icon=true] -
758
- * Allow hiding the icon in the opt-in prompt.
759
- *
760
- * @name ThirdPartyOptIn
761
- */
762
-
763
- function OptIn(_ref) {
764
- var children = _ref.children,
765
- providerName = _ref.providerName,
766
- wrapper = _ref.wrapper,
767
- icon = _ref.icon;
768
-
769
- var _useI18n = useI18n(),
770
- t = _useI18n.t;
771
-
772
- var cookieMessage = t("pageflow_scrolled.public.third_party_consent.opt_in_prompt.".concat(providerName));
773
-
774
- var _useState = useState(false),
775
- _useState2 = _slicedToArray(_useState, 2),
776
- consentedHere = _useState2[0],
777
- setConsentedHere = _useState2[1];
778
-
779
- var _useConsentGiven = useConsentGiven(providerName),
780
- _useConsentGiven2 = _slicedToArray(_useConsentGiven, 2),
781
- consentGiven = _useConsentGiven2[0],
782
- giveConsent = _useConsentGiven2[1];
783
-
784
- if (consentGiven || !providerName) {
785
- return typeof children === 'function' ? children({
786
- consentedHere: consentedHere
787
- }) : children;
788
- }
789
-
790
- function accept() {
791
- giveConsent(providerName);
792
- setConsentedHere(true);
793
- }
794
-
795
- return wrapper( /*#__PURE__*/React.createElement("div", {
796
- className: styles$3.optIn
797
- }, icon && /*#__PURE__*/React.createElement("div", {
798
- className: styles$3.optInIcon
799
- }, /*#__PURE__*/React.createElement(OptInIcon, null)), /*#__PURE__*/React.createElement("div", {
800
- className: styles$3.optInMessage
801
- }, cookieMessage), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", {
802
- className: styles$3.optInButton,
803
- onClick: accept
804
- }, t('pageflow_scrolled.public.third_party_consent.confirm')))));
805
- }
806
- OptIn.defaultProps = {
807
- icon: true,
808
- wrapper: function wrapper(children) {
809
- return children;
810
- }
811
- };
812
-
813
- var styles$4 = {"optOut":"OptOutInfo-module_optOut__2Q3d5","tooltip":"OptOutInfo-module_tooltip__2bpU0","icon":"OptOutInfo-module_icon__1kL6Q utils-module_unstyledButton__3rgne","full":"OptOutInfo-module_full__s_Ono"};
814
-
815
- /**
816
- * Display info tooltip with a link to opt out of third party
817
- * embeds. Opt out url needs to be configured in theme options.
818
- *
819
- * @param {Object} props
820
- * @param {string} props.providerName -
821
- * Only display if user has given consent for this provider.
822
- * @param {string} props.contentElementPosition -
823
- * Position setting of parent content element. Used to correctly place
824
- * tooltip when content element uses full width.
825
- * @param {boolean} [hide] -
826
- * Temporarily hide the tooltip, e.g. while the embed is playing
827
- *
828
- * @name ThirdPartyOptOutInfo
829
- */
830
-
831
- function OptOutInfo(_ref) {
832
- var _theme$options$thirdP;
833
-
834
- var providerName = _ref.providerName,
835
- hide = _ref.hide,
836
- contentElementPosition = _ref.contentElementPosition;
837
-
838
- var _useI18n = useI18n(),
839
- t = _useI18n.t;
840
-
841
- var theme = useTheme();
842
- var optOutUrl = (_theme$options$thirdP = theme.options.thirdPartyConsent) === null || _theme$options$thirdP === void 0 ? void 0 : _theme$options$thirdP.optOutUrl;
843
-
844
- var _useConsentGiven = useConsentGiven(providerName),
845
- _useConsentGiven2 = _slicedToArray(_useConsentGiven, 1),
846
- consentGiven = _useConsentGiven2[0];
847
-
848
- if (!optOutUrl || !consentGiven) {
849
- return null;
850
- }
851
-
852
- var linkText = t('pageflow_scrolled.public.third_party_consent.opt_out.prompt_link');
853
- var linkHtml = "<a href=\"".concat(optOutUrl, "\" target=\"_blank\" rel=\"noopener noreferrer\">").concat(linkText, "</a>");
854
- var html = t('pageflow_scrolled.public.third_party_consent.opt_out.prompt', {
855
- link: linkHtml
856
- });
857
- return /*#__PURE__*/React.createElement("div", {
858
- className: classNames(styles$4.optOut, styles$4[contentElementPosition]),
859
- style: hide ? {
860
- opacity: 0,
861
- visibility: 'hidden'
862
- } : undefined
863
- }, /*#__PURE__*/React.createElement("button", {
864
- className: styles$4.icon
865
- }, /*#__PURE__*/React.createElement(information, null)), /*#__PURE__*/React.createElement("div", {
866
- className: styles$4.tooltip
867
- }, /*#__PURE__*/React.createElement("div", {
868
- dangerouslySetInnerHTML: {
869
- __html: html
870
- }
871
- })));
872
- }
873
-
874
- function registerVendors(_ref) {
875
- var contentElementTypes = _ref.contentElementTypes,
876
- seed = _ref.seed,
877
- consent = _ref.consent,
878
- cookieName = _ref.cookieName;
879
- var options = seed.config.theme.options.thirdPartyConsent;
880
- var locale = seed.collections.entries[0].locale;
881
- cookieName = cookieName || (options === null || options === void 0 ? void 0 : options.cookieName);
882
- contentElementTypes.consentVendors({
883
- contentElements: seed.collections.contentElements,
884
- t: function t(key, options) {
885
- return I18n.t(key, _objectSpread2(_objectSpread2({}, options), {}, {
886
- locale: locale
887
- }));
888
- }
889
- }).forEach(function (vendor) {
890
- var _options$cookieProvid;
891
-
892
- consent.registerVendor(vendor.name, {
893
- displayName: vendor.displayName,
894
- description: vendor.description,
895
- paradigm: cookieName ? vendor.paradigm || 'opt-in' : 'skip',
896
- cookieName: cookieName,
897
- cookieKey: options === null || options === void 0 ? void 0 : (_options$cookieProvid = options.cookieProviderNameMapping) === null || _options$cookieProvid === void 0 ? void 0 : _options$cookieProvid[vendor.name],
898
- cookieDomain: options === null || options === void 0 ? void 0 : options.cookieDomain
899
- });
900
- });
901
- consent.closeVendorRegistration();
902
- }
903
-
904
- var SectionLifecycleContext = createContext();
905
- var SectionLifecycleProvider = createScrollPositionLifecycleProvider(SectionLifecycleContext);
906
- var useSectionLifecycle = createScrollPositionLifecycleHook(SectionLifecycleContext);
907
-
908
- var Atmo = /*#__PURE__*/function () {
909
- function Atmo(_ref) {
910
- var _this = this;
911
-
912
- var atmoSourceId = _ref.atmoSourceId,
913
- multiPlayer = _ref.multiPlayer,
914
- backgroundMedia = _ref.backgroundMedia;
915
-
916
- _classCallCheck(this, Atmo);
917
-
918
- this.multiPlayer = multiPlayer;
919
- this.atmoSourceId = atmoSourceId;
920
- this.backgroundMedia = backgroundMedia;
921
- this.backgroundMedia.on('change:muted', function () {
922
- _this.update();
923
- });
924
- documentHiddenState(function (hiddenState) {
925
- if (hiddenState === 'hidden') {
926
- _this.multiPlayer.fadeOutIfPlaying();
927
- } else {
928
- _this.update();
929
- }
930
- });
931
- this.listenTo(this.multiPlayer, 'playfailed', function () {
932
- backgroundMedia.mute(true);
933
- });
934
- }
935
-
936
- _createClass(Atmo, [{
937
- key: "disable",
938
- value: function disable() {
939
- this.disabled = true;
940
- this.multiPlayer.fadeOutAndPause();
941
- events.trigger('atmo:disabled');
942
- }
943
- }, {
944
- key: "enable",
945
- value: function enable() {
946
- this.disabled = false;
947
- this.update();
948
- events.trigger('atmo:enabled');
949
- }
950
- }, {
951
- key: "pause",
952
- value: function pause() {
953
- if (browser.has('volume control support')) {
954
- return this.multiPlayer.fadeOutAndPause();
955
- } else {
956
- this.multiPlayer.pause();
957
- }
958
- }
959
- }, {
960
- key: "turnDown",
961
- value: function turnDown() {
962
- if (browser.has('volume control support')) {
963
- return this.multiPlayer.changeVolumeFactor(0.2);
964
- } else {
965
- this.multiPlayer.pause();
966
- }
967
- }
968
- }, {
969
- key: "resume",
970
- value: function resume() {
971
- if (this.multiPlayer.paused()) {
972
- if (this.disabled || this.backgroundMedia.muted) {
973
- return Promise.resolve();
974
- } else {
975
- return this.multiPlayer.resumeAndFadeIn();
976
- }
977
- } else {
978
- return this.multiPlayer.changeVolumeFactor(1);
979
- }
980
- }
981
- }, {
982
- key: "update",
983
- value: function update() {
984
- if (!this.disabled) {
985
- if (this.backgroundMedia.muted) {
986
- this.multiPlayer.fadeOutAndPause();
987
- } else {
988
- this.multiPlayer.fadeTo(this.atmoSourceId);
989
- }
990
- }
991
- }
992
- }, {
993
- key: "createMediaPlayerHooks",
994
- value: function createMediaPlayerHooks(atmoDuringPlayback) {
995
- var atmo = this;
996
- return {
997
- before: function before() {
998
- if (atmoDuringPlayback === 'mute') {
999
- atmo.pause();
1000
- } else if (atmoDuringPlayback === 'turnDown') {
1001
- atmo.turnDown();
1002
- }
1003
- },
1004
- after: function after() {
1005
- atmo.resume();
1006
- }
1007
- };
1008
- }
1009
- }]);
1010
-
1011
- return Atmo;
1012
- }();
1013
- Object.assign(Atmo.prototype, BackboneEvents);
1014
-
1015
- function getContextValue(updateAtmo, createMediaPlayerHooks) {
1016
- var empty = function empty() {};
1017
-
1018
- return {
1019
- updateAtmo: updateAtmo || empty,
1020
- createMediaPlayerHooks: createMediaPlayerHooks || empty
1021
- };
1022
- }
1023
-
1024
- var AtmoContext = createContext(getContextValue());
1025
- function AtmoProvider(_ref) {
1026
- var children = _ref.children;
1027
- var atmoConfig = useRef({});
1028
- useEffect(function () {
1029
- var currentAtmo = atmoConfig.current;
1030
- currentAtmo.pool = PlayerSourceIDMap(media, {
1031
- playerOptions: {
1032
- tagName: 'audio',
1033
- loop: true
1034
- }
1035
- });
1036
- currentAtmo.multiPlayer = new MultiPlayer(currentAtmo.pool, {
1037
- fadeDuration: 500,
1038
- crossFade: true,
1039
- playFromBeginning: false,
1040
- rewindOnChange: true
1041
- });
1042
- currentAtmo.atmo = new Atmo({
1043
- multiPlayer: currentAtmo.multiPlayer,
1044
- backgroundMedia: media
1045
- });
1046
- }, []);
1047
-
1048
- var updateAtmo = function updateAtmo(_ref2) {
1049
- var audioFilePermaId = _ref2.audioFilePermaId,
1050
- sources = _ref2.sources;
1051
- var currentAtmo = atmoConfig.current;
1052
-
1053
- if (currentAtmo.atmo) {
1054
- currentAtmo.pool.mapSources(audioFilePermaId, sources);
1055
- currentAtmo.atmo.atmoSourceId = audioFilePermaId;
1056
- currentAtmo.atmo.update();
1057
- }
1058
- };
1059
-
1060
- var createMediaPlayerHooks = function createMediaPlayerHooks(options) {
1061
- if (atmoConfig.current.atmo) {
1062
- return atmoConfig.current.atmo.createMediaPlayerHooks(options);
1063
- }
1064
- };
1065
-
1066
- var contextValue = useMemo(function () {
1067
- return getContextValue(updateAtmo, createMediaPlayerHooks);
1068
- }, []);
1069
- return /*#__PURE__*/React.createElement(AtmoContext.Provider, {
1070
- value: contextValue
1071
- }, children);
1072
- }
1073
- function useAtmo() {
1074
- return useContext(AtmoContext);
1075
- }
1076
-
1077
- function PlayerContainer(_ref) {
1078
- var filePermaId = _ref.filePermaId,
1079
- sources = _ref.sources,
1080
- textTrackSources = _ref.textTrackSources,
1081
- type = _ref.type,
1082
- playsInline = _ref.playsInline,
1083
- loop = _ref.loop,
1084
- controls = _ref.controls,
1085
- altText = _ref.altText,
1086
- mediaEventsContextData = _ref.mediaEventsContextData,
1087
- atmoDuringPlayback = _ref.atmoDuringPlayback,
1088
- onSetup = _ref.onSetup,
1089
- onDispose = _ref.onDispose;
1090
- var playerWrapperRef = useRef(null);
1091
- var atmo = useAtmo();
1092
- useEffect(function () {
1093
- var playerWrapper = playerWrapperRef.current;
1094
-
1095
- if (sources) {
1096
- var player = media.getPlayer(sources, {
1097
- textTrackSources: textTrackSources,
1098
- filePermaId: filePermaId,
1099
- tagName: type,
1100
- playsInline: playsInline,
1101
- loop: loop,
1102
- controls: controls,
1103
- hooks: atmoDuringPlayback ? atmo.createMediaPlayerHooks(atmoDuringPlayback) : {},
1104
- //create hooks only for inline media players
1105
- mediaEventsContextData: mediaEventsContextData,
1106
- altText: altText,
1107
- onRelease: function onRelease() {
1108
- playerWrapper.removeChild(player.el());
1109
- player = null;
1110
-
1111
- if (onDispose) {
1112
- onDispose();
1113
- }
1114
- }
1115
- });
1116
- playerWrapper.appendChild(player.el());
1117
-
1118
- if (onSetup) {
1119
- onSetup(player);
1120
- }
1121
-
1122
- return function () {
1123
- // onRelease might already have been called by the pool when
1124
- // it needed to re-use a player.
1125
- if (player) {
1126
- media.releasePlayer(player);
1127
- }
1128
- };
1129
- }
1130
- });
1131
- return /*#__PURE__*/React.createElement("div", {
1132
- ref: playerWrapperRef
1133
- });
1134
- }
1135
-
1136
- PlayerContainer.defaultProps = {
1137
- textTrackSources: []
1138
- }; // This function assumes that that the parameters are arrays of
1139
- // objects containing only skalar values. It is not a full deep
1140
- // equality check, but suffices for the use case.
1141
-
1142
- function deepEqual(a, b) {
1143
- if (a.length !== b.length) {
1144
- return false;
1145
- }
1146
-
1147
- for (var i = 0; i < a.length; i++) {
1148
- var aItem = a[i];
1149
- var bItem = b[i];
1150
-
1151
- if (Object.keys(aItem).length !== Object.keys(bItem).length) {
1152
- return false;
1153
- }
1154
-
1155
- for (var key in aItem) {
1156
- if (aItem[key] !== bItem[key]) {
1157
- return false;
1158
- }
1159
- }
1160
- }
1161
-
1162
- return true;
1163
- }
1164
-
1165
- function areEqual(prevProps, nextProps) {
1166
- return prevProps.type === nextProps.type && prevProps.playsInline === nextProps.playsInline && prevProps.loop === nextProps.loop && prevProps.controls === nextProps.controls && prevProps.altText === nextProps.altText && prevProps.atmoDuringPlayback === nextProps.atmoDuringPlayback && deepEqual(prevProps.sources, nextProps.sources) && deepEqual(prevProps.textTrackSources, nextProps.textTrackSources);
1167
- }
1168
-
1169
- var PlayerContainer$1 = React.memo(PlayerContainer, areEqual);
1170
-
1171
- var ScrollToSectionContext = React.createContext(function () {});
523
+ var ScrollToSectionContext = React.createContext(function () {});
1172
524
 
1173
525
  function watchPlayer (player, actions) {
1174
526
  player.on('loadedmetadata', function () {
@@ -1353,7 +705,7 @@ function getTextTrackSources(textTrackFiles, textTracksDisabled) {
1353
705
 
1354
706
  var textTrackStyles = {"inset":"textTracks-module_inset__K7DIL"};
1355
707
 
1356
- var styles$5 = {"wrapper":"MediaPlayer-module_wrapper__1cSGR","cover":"MediaPlayer-module_cover__2wGez"};
708
+ var styles$1 = {"wrapper":"MediaPlayer-module_wrapper__1cSGR","cover":"MediaPlayer-module_cover__2wGez"};
1357
709
 
1358
710
  var PLAY = 'MEDIA_PLAY';
1359
711
  var PLAYING = 'MEDIA_PLAYING';
@@ -1814,6 +1166,10 @@ function playerStateReducer(state, action) {
1814
1166
  });
1815
1167
 
1816
1168
  case USER_INTERACTION:
1169
+ if (!state.userIdle) {
1170
+ return state;
1171
+ }
1172
+
1817
1173
  return _objectSpread2(_objectSpread2({}, state), {}, {
1818
1174
  userIdle: false
1819
1175
  });
@@ -1861,7 +1217,7 @@ function MediaPlayer(props) {
1861
1217
  var isStaticPreview = useIsStaticPreview();
1862
1218
  var load = props.load === 'auto' && isStaticPreview ? 'poster' : props.load;
1863
1219
  return /*#__PURE__*/React.createElement("div", {
1864
- className: classNames(styles$5.wrapper, styles$5[props.fit], _defineProperty({}, textTrackStyles.inset, props.textTracksInset))
1220
+ className: classNames(styles$1.wrapper, styles$1[props.fit], _defineProperty({}, textTrackStyles.inset, props.textTracksInset))
1865
1221
  }, load === 'auto' && /*#__PURE__*/React.createElement(PreparedMediaPlayer, props), load !== 'none' && /*#__PURE__*/React.createElement(Poster, {
1866
1222
  imageUrl: props.posterImageUrl,
1867
1223
  objectPosition: props.objectPosition,
@@ -2100,6 +1456,8 @@ function addDisplayLabel(textTrackFile, t) {
2100
1456
  });
2101
1457
  }
2102
1458
 
1459
+ var useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;
1460
+
2103
1461
  function usePrevious(value) {
2104
1462
  var ref = useRef();
2105
1463
  useEffect(function () {
@@ -2205,7 +1563,7 @@ function AudioStructuredData(_ref) {
2205
1563
  });
2206
1564
  }
2207
1565
 
2208
- var styles$6 = {"spaceForTextTracks":"AudioPlayer-module_spaceForTextTracks__169MK","spaceForTextTracksActive":"AudioPlayer-module_spaceForTextTracksActive__99m7R"};
1566
+ var styles$2 = {"spaceForTextTracks":"AudioPlayer-module_spaceForTextTracks__169MK","spaceForTextTracksActive":"AudioPlayer-module_spaceForTextTracksActive__99m7R"};
2209
1567
 
2210
1568
  /**
2211
1569
  * Render audio file in MediaPlayer.
@@ -2230,7 +1588,7 @@ function AudioPlayer(_ref) {
2230
1588
 
2231
1589
  if (audioFile && audioFile.isReady) {
2232
1590
  return /*#__PURE__*/React.createElement("div", {
2233
- className: classNames(styles$6.spaceForTextTracks, _defineProperty({}, styles$6.spaceForTextTracksActive, !posterImageFile && textTracks.files.length))
1591
+ className: classNames(styles$2.spaceForTextTracks, _defineProperty({}, styles$2.spaceForTextTracksActive, !posterImageFile && textTracks.files.length))
2234
1592
  }, /*#__PURE__*/React.createElement(MediaPlayer, Object.assign({
2235
1593
  type: 'audio',
2236
1594
  textTracks: textTracks,
@@ -2276,11 +1634,8 @@ function processSources(audioFile) {
2276
1634
  return sources;
2277
1635
  }
2278
1636
 
2279
- function SectionAtmo(props) {
2280
- var audioFile = useFile({
2281
- collectionName: 'audioFiles',
2282
- permaId: props.audioFilePermaId
2283
- });
1637
+ function SectionAtmo(_ref) {
1638
+ var audioFile = _ref.audioFile;
2284
1639
  var lastAudioFile = usePrevious(audioFile);
2285
1640
  var atmo = useAtmo();
2286
1641
  var processAtmo = useCallback(function () {
@@ -2293,10 +1648,10 @@ function SectionAtmo(props) {
2293
1648
  if (atmo) {
2294
1649
  atmo.updateAtmo({
2295
1650
  sources: sources,
2296
- audioFilePermaId: props.audioFilePermaId
1651
+ audioFilePermaId: audioFile === null || audioFile === void 0 ? void 0 : audioFile.permaId
2297
1652
  });
2298
1653
  }
2299
- }, [atmo, audioFile, props.audioFilePermaId]);
1654
+ }, [atmo, audioFile]);
2300
1655
  useSectionLifecycle({
2301
1656
  onActivate: function onActivate() {
2302
1657
  processAtmo();
@@ -2310,7 +1665,7 @@ function SectionAtmo(props) {
2310
1665
  return null;
2311
1666
  }
2312
1667
 
2313
- var styles$7 = {"Foreground":"Foreground-module_Foreground__13ODU","fullFadeHeight":"Foreground-module_fullFadeHeight__2p9dx","fullHeight":"Foreground-module_fullHeight__1vMXb","paddingBottom":"Foreground-module_paddingBottom__3OtY4"};
1668
+ var styles$3 = {"Foreground":"Foreground-module_Foreground__13ODU","fullFadeHeight":"Foreground-module_fullFadeHeight__2p9dx","fullHeight":"Foreground-module_fullHeight__1vMXb","paddingBottom":"Foreground-module_paddingBottom__3OtY4"};
2314
1669
 
2315
1670
  var ForcePaddingContext = createContext(false);
2316
1671
  function Foreground(props) {
@@ -2324,7 +1679,19 @@ function Foreground(props) {
2324
1679
  }
2325
1680
 
2326
1681
  function className(props, forcePadding) {
2327
- return classNames(styles$7.Foreground, props.transitionStyles.foreground, props.transitionStyles["foreground-".concat(props.state)], _defineProperty({}, styles$7.paddingBottom, props.paddingBottom || forcePadding), styles$7["".concat(props.heightMode, "Height")]);
1682
+ return classNames(styles$3.Foreground, props.transitionStyles.foreground, props.transitionStyles["foreground-".concat(props.state)], _defineProperty({}, styles$3.paddingBottom, props.paddingBottom || forcePadding), styles$3["".concat(props.heightMode, "Height")]);
1683
+ }
1684
+
1685
+ function isBlank(html) {
1686
+ return !!stripTags(html).match(/^\s*$/);
1687
+ }
1688
+ function presence(html) {
1689
+ return isBlank(html) ? null : html;
1690
+ }
1691
+ function isBlankEditableTextValue(value) {
1692
+ var _value$0$children$;
1693
+
1694
+ return !value || value.length === 0 || value.length === 1 && value[0].children.length <= 1 && !((_value$0$children$ = value[0].children[0]) === null || _value$0$children$ === void 0 ? void 0 : _value$0$children$.text);
2328
1695
  }
2329
1696
 
2330
1697
  /**
@@ -2464,6 +1831,117 @@ var api = {
2464
1831
  widgetTypes: new WidgetTypeRegistry()
2465
1832
  };
2466
1833
 
1834
+ function Widget(_ref) {
1835
+ var role = _ref.role,
1836
+ props = _ref.props,
1837
+ children = _ref.children;
1838
+ var widget = useWidget({
1839
+ role: role
1840
+ });
1841
+
1842
+ if (!widget) {
1843
+ return null;
1844
+ }
1845
+
1846
+ var Component = api.widgetTypes.getComponent(widget.typeName);
1847
+ return /*#__PURE__*/React.createElement(Component, Object.assign({
1848
+ configuration: widget.configuration
1849
+ }, props, {
1850
+ children: children
1851
+ }));
1852
+ }
1853
+
1854
+ var styles$4 = {"list":"InlineFileRights-module_list__2OuO5"};
1855
+
1856
+ function InlineFileRights(_ref) {
1857
+ var _ref$items = _ref.items,
1858
+ items = _ref$items === void 0 ? [] : _ref$items,
1859
+ _ref$context = _ref.context,
1860
+ context = _ref$context === void 0 ? 'standAlone' : _ref$context,
1861
+ playerControlsTransparent = _ref.playerControlsTransparent,
1862
+ playerControlsStandAlone = _ref.playerControlsStandAlone;
1863
+
1864
+ var _useI18n = useI18n(),
1865
+ t = _useI18n.t;
1866
+
1867
+ var filteredItems = items.filter(function (item) {
1868
+ return item.file && item.file.inlineRights && !isBlank(item.file.rights);
1869
+ });
1870
+
1871
+ if (!filteredItems.length) {
1872
+ return null;
1873
+ }
1874
+
1875
+ return /*#__PURE__*/React.createElement(Widget, {
1876
+ role: "inlineFileRights",
1877
+ props: {
1878
+ context: context,
1879
+ playerControlsTransparent: playerControlsTransparent,
1880
+ playerControlsStandAlone: playerControlsStandAlone
1881
+ }
1882
+ }, /*#__PURE__*/React.createElement("ul", {
1883
+ className: styles$4.list
1884
+ }, filteredItems.map(function (_ref2) {
1885
+ var label = _ref2.label,
1886
+ file = _ref2.file;
1887
+ return /*#__PURE__*/React.createElement("li", {
1888
+ key: "".concat(label, "-").concat(file.id)
1889
+ }, label && /*#__PURE__*/React.createElement("span", null, t(label, {
1890
+ scope: 'pageflow_scrolled.public.inline_file_rights_labels'
1891
+ }), ": "), renderRights(file), renderLicense(file));
1892
+ })));
1893
+ }
1894
+
1895
+ function renderRights(file) {
1896
+ if (isBlank(file.configuration.source_url)) {
1897
+ return file.rights;
1898
+ } else {
1899
+ return /*#__PURE__*/React.createElement("a", {
1900
+ href: file.configuration.source_url,
1901
+ target: "_blank",
1902
+ rel: "noopener noreferrer"
1903
+ }, file.rights);
1904
+ }
1905
+ }
1906
+
1907
+ function renderLicense(file) {
1908
+ if (!file.license) {
1909
+ return null;
1910
+ }
1911
+
1912
+ return /*#__PURE__*/React.createElement(React.Fragment, null, ' ', "(", /*#__PURE__*/React.createElement("a", {
1913
+ href: file.license.url,
1914
+ target: "_blank",
1915
+ rel: "noopener noreferrer"
1916
+ }, file.license.name), ")");
1917
+ }
1918
+
1919
+ var styles$5 = {"fade-duration":"0.5s","wrapper":"SectionInlineFileRights-module_wrapper__1l6rr","fade":"SectionInlineFileRights-module_fade__1Snfk","inactive":"SectionInlineFileRights-module_inactive__1VpQh"};
1920
+
1921
+ function SectionInlineFileRights(_ref) {
1922
+ var _section$nextSection, _section$nextSection$, _classNames;
1923
+
1924
+ var section = _ref.section,
1925
+ state = _ref.state,
1926
+ backdrop = _ref.backdrop,
1927
+ atmoAudioFile = _ref.atmoAudioFile;
1928
+ return /*#__PURE__*/React.createElement("div", {
1929
+ className: classNames(styles$5.wrapper, (_classNames = {}, _defineProperty(_classNames, styles$5.fade, (_section$nextSection = section.nextSection) === null || _section$nextSection === void 0 ? void 0 : (_section$nextSection$ = _section$nextSection.transition) === null || _section$nextSection$ === void 0 ? void 0 : _section$nextSection$.startsWith('fade')), _defineProperty(_classNames, styles$5.inactive, state !== 'active'), _classNames))
1930
+ }, /*#__PURE__*/React.createElement(InlineFileRights, {
1931
+ context: "section",
1932
+ items: [{
1933
+ label: 'image',
1934
+ file: backdrop.image
1935
+ }, {
1936
+ label: 'video',
1937
+ file: backdrop.video
1938
+ }, {
1939
+ label: 'atmo',
1940
+ file: atmoAudioFile
1941
+ }]
1942
+ }));
1943
+ }
1944
+
2467
1945
  // For reasons that are beyond me, Storybook's Webpack build fails
2468
1946
  // with a "JavaScript heap out of memory" error if this import
2469
1947
  // expression lives in inlineEditing/index.js directly. I originally
@@ -2472,7 +1950,7 @@ var api = {
2472
1950
  // file with an empty one, but found out that extracting the import
2473
1951
  // to a separate file apparently is enough.
2474
1952
  function importComponents() {
2475
- return import('./components-b3160dd7.js');
1953
+ return import('./components-24363f97.js');
2476
1954
  }
2477
1955
 
2478
1956
  var components = {};
@@ -2509,12 +1987,14 @@ function withInlineEditingAlternative(name, Component) {
2509
1987
  var ContentElementAttributesContext = createContext({});
2510
1988
  function ContentElementAttributesProvider(_ref) {
2511
1989
  var id = _ref.id,
1990
+ width = _ref.width,
2512
1991
  children = _ref.children;
2513
1992
  var attributes = useMemo(function () {
2514
1993
  return {
2515
- contentElementId: id
1994
+ contentElementId: id,
1995
+ width: width
2516
1996
  };
2517
- }, [id]);
1997
+ }, [id, width]);
2518
1998
  return /*#__PURE__*/React.createElement(ContentElementAttributesContext.Provider, {
2519
1999
  value: attributes
2520
2000
  }, children);
@@ -2575,22 +2055,35 @@ function useContentElementLifecycle(options) {
2575
2055
  return result;
2576
2056
  }
2577
2057
 
2578
- var styles$8 = {"wrapper":"ContentElementMargin-module_wrapper__20kIk"};
2058
+ var widths = {
2059
+ xxs: -3,
2060
+ xs: -2,
2061
+ sm: -1,
2062
+ md: 0,
2063
+ lg: 1,
2064
+ xl: 2,
2065
+ full: 3
2066
+ };
2067
+ function widthName(width) {
2068
+ return Object.keys(widths)[(width || 0) + 3];
2069
+ }
2070
+
2071
+ var styles$6 = {"wrapper":"ContentElementMargin-module_wrapper__20kIk"};
2579
2072
 
2580
2073
  function ContentElementMargin(_ref) {
2581
- var position = _ref.position,
2074
+ var width = _ref.width,
2582
2075
  children = _ref.children;
2583
2076
 
2584
- if (position === 'full') {
2077
+ if (width === widths.full) {
2585
2078
  return children;
2586
2079
  }
2587
2080
 
2588
2081
  return /*#__PURE__*/React.createElement("div", {
2589
- className: styles$8.wrapper
2082
+ className: styles$6.wrapper
2590
2083
  }, children);
2591
2084
  }
2592
2085
 
2593
- var styles$9 = {"missing":"ContentElement-module_missing__2_1j9"};
2086
+ var styles$7 = {"missing":"ContentElement-module_missing__2_1j9"};
2594
2087
 
2595
2088
  var ContentElementErrorBoundary = /*#__PURE__*/function (_React$Component) {
2596
2089
  _inherits(ContentElementErrorBoundary, _React$Component);
@@ -2614,7 +2107,7 @@ var ContentElementErrorBoundary = /*#__PURE__*/function (_React$Component) {
2614
2107
  value: function render() {
2615
2108
  if (this.state.hasError) {
2616
2109
  return /*#__PURE__*/React.createElement("div", {
2617
- className: styles$9.missing
2110
+ className: styles$7.missing
2618
2111
  }, "Error rendering element of type \"", this.props.type, "\"");
2619
2112
  }
2620
2113
 
@@ -2637,21 +2130,24 @@ var ContentElement = withInlineEditingDecorator('ContentElementDecorator', funct
2637
2130
 
2638
2131
  if (Component) {
2639
2132
  return /*#__PURE__*/React.createElement(ContentElementAttributesProvider, {
2640
- id: props.id
2133
+ id: props.id,
2134
+ width: props.width
2641
2135
  }, /*#__PURE__*/React.createElement(ContentElementLifecycleProvider, {
2642
2136
  type: props.type
2643
2137
  }, /*#__PURE__*/React.createElement(ContentElementMargin, {
2644
- position: props.itemProps.position
2138
+ width: props.width
2645
2139
  }, /*#__PURE__*/React.createElement(ContentElementErrorBoundary, {
2646
2140
  type: props.type
2647
2141
  }, /*#__PURE__*/React.createElement(Component, {
2648
2142
  sectionProps: props.sectionProps,
2143
+ customMargin: props.customMargin,
2649
2144
  configuration: props.itemProps,
2145
+ contentElementWidth: props.width,
2650
2146
  contentElementId: props.id
2651
2147
  })))));
2652
2148
  } else {
2653
2149
  return /*#__PURE__*/React.createElement("div", {
2654
- className: styles$9.missing
2150
+ className: styles$7.missing
2655
2151
  }, "Element of unknown type \"", props.type, "\"");
2656
2152
  }
2657
2153
  });
@@ -2659,22 +2155,45 @@ ContentElement.defaultProps = {
2659
2155
  itemProps: {}
2660
2156
  };
2661
2157
 
2158
+ var styles$8 = {"wrapper":"ContentElementScrollSpace-module_wrapper__2ZBwZ","inner":"ContentElementScrollSpace-module_inner__1FBgh"};
2159
+
2160
+ function ContentElementScrollSpace(_ref) {
2161
+ var children = _ref.children;
2162
+ return /*#__PURE__*/React.createElement("div", {
2163
+ className: styles$8.wrapper
2164
+ }, /*#__PURE__*/React.createElement(Measure, {
2165
+ bounds: true
2166
+ }, function (_ref2) {
2167
+ var measureRef = _ref2.measureRef,
2168
+ contentRect = _ref2.contentRect;
2169
+ return /*#__PURE__*/React.createElement("div", {
2170
+ ref: measureRef,
2171
+ className: styles$8.inner,
2172
+ style: {
2173
+ '--height': contentRect.bounds.height / 2
2174
+ }
2175
+ }, children);
2176
+ }));
2177
+ }
2178
+
2662
2179
  function ContentElements(props) {
2663
2180
  return /*#__PURE__*/React.createElement(React.Fragment, null, props.items.map(function (item, index) {
2664
- return props.children(item, /*#__PURE__*/React.createElement(MemoizedContentElement, {
2181
+ return props.children(item, renderScrollSpace(item, /*#__PURE__*/React.createElement(MemoizedContentElement, {
2665
2182
  key: item.id,
2666
2183
  id: item.id,
2667
2184
  permaId: item.permaId,
2668
2185
  type: item.type,
2669
2186
  first: index === 0,
2670
2187
  position: item.position,
2188
+ width: item.width,
2671
2189
  itemProps: item.props,
2190
+ customMargin: props.customMargin,
2672
2191
  sectionProps: props.sectionProps
2673
- }), index);
2192
+ })), index);
2674
2193
  }));
2675
2194
  }
2676
2195
  var MemoizedContentElement = React.memo(ContentElement, function (prevProps, nextProps) {
2677
- return prevProps.id === nextProps.id && prevProps.permaId === nextProps.permaId && prevProps.type === nextProps.type && prevProps.position === nextProps.position && prevProps.itemProps === nextProps.itemProps && prevProps.sectionProps === nextProps.sectionProps;
2196
+ return prevProps.id === nextProps.id && prevProps.permaId === nextProps.permaId && prevProps.type === nextProps.type && prevProps.position === nextProps.position && prevProps.width === nextProps.width && prevProps.itemProps === nextProps.itemProps && prevProps.customMargin === nextProps.customMargin && prevProps.sectionProps === nextProps.sectionProps;
2678
2197
  });
2679
2198
  ContentElements.defaultProps = {
2680
2199
  children: function children(item, child) {
@@ -2682,123 +2201,178 @@ ContentElements.defaultProps = {
2682
2201
  }
2683
2202
  };
2684
2203
 
2204
+ function renderScrollSpace(item, children) {
2205
+ if (!item.standAlone) {
2206
+ return children;
2207
+ }
2208
+
2209
+ return /*#__PURE__*/React.createElement(ContentElementScrollSpace, {
2210
+ key: item.id,
2211
+ children: children
2212
+ });
2213
+ }
2214
+
2685
2215
  function useMediaQuery(query) {
2216
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
2217
+ active: true
2218
+ },
2219
+ active = _ref.active;
2220
+
2686
2221
  var _useState = useState(false),
2687
2222
  _useState2 = _slicedToArray(_useState, 2),
2688
2223
  doesMatch = _useState2[0],
2689
- onSetDoesMatch = _useState2[1];
2224
+ setDoesMatch = _useState2[1];
2690
2225
 
2691
2226
  useEffect(function () {
2692
- var onUpdateMatch = function onUpdateMatch(_ref) {
2693
- var matches = _ref.matches;
2694
- onSetDoesMatch(matches);
2227
+ if (!active) {
2228
+ return;
2229
+ }
2230
+
2231
+ var onUpdateMatch = function onUpdateMatch(_ref2) {
2232
+ var matches = _ref2.matches;
2233
+ setDoesMatch(matches);
2695
2234
  };
2696
2235
 
2697
2236
  var matcher = window.matchMedia(query);
2698
- var isModern = ('addEventListener' in matcher);
2699
-
2700
- if (isModern) {
2701
- matcher.addEventListener('change', onUpdateMatch);
2702
- } else {
2703
- matcher.addListener(onUpdateMatch);
2704
- }
2705
-
2237
+ matcher.addEventListener('change', onUpdateMatch);
2706
2238
  onUpdateMatch(matcher);
2707
2239
  return function () {
2708
- if (isModern) {
2709
- matcher.removeEventListener('change', onUpdateMatch);
2710
- } else {
2711
- matcher.removeListener(onUpdateMatch);
2712
- }
2240
+ matcher.removeEventListener('change', onUpdateMatch);
2713
2241
  };
2714
- }, [query, onSetDoesMatch]);
2715
- return doesMatch;
2716
- }
2717
-
2718
- function useNarrowViewport() {
2719
- var _theme$options$proper, _theme$options$proper2;
2720
-
2721
- var theme = useTheme();
2722
- var maxWidth = ((_theme$options$proper = theme.options.properties) === null || _theme$options$proper === void 0 ? void 0 : (_theme$options$proper2 = _theme$options$proper.root) === null || _theme$options$proper2 === void 0 ? void 0 : _theme$options$proper2.narrowViewportBreakpoint) || '950px';
2723
- return useMediaQuery("(max-width: ".concat(maxWidth, ")"));
2242
+ }, [query, setDoesMatch, active]);
2243
+ return active && doesMatch;
2724
2244
  }
2725
2245
 
2726
- var styles$a = {"root":"TwoColumn-module_root__37EqL","group":"TwoColumn-module_group__3Hg2y","group-full":"TwoColumn-module_group-full__2OT4o","sticky":"TwoColumn-module_sticky__4LCDO","inline":"TwoColumn-module_inline__1fPfM","wide":"TwoColumn-module_wide__xdF_t","right":"TwoColumn-module_right__Fr52a","narrowViewport":"TwoColumn-module_narrowViewport__1x_NY","wideViewport":"TwoColumn-module_wideViewport___c_Zz"};
2727
-
2728
- function availablePositions(narrow) {
2729
- if (narrow) {
2730
- return ['inline', 'wide', 'full'];
2731
- } else {
2732
- return ['inline', 'sticky', 'wide', 'full'];
2733
- }
2734
- }
2246
+ var styles$9 = {"root":"TwoColumn-module_root__37EqL","group":"TwoColumn-module_group__3Hg2y","group-full":"TwoColumn-module_group-full__2OT4o","box":"TwoColumn-module_box__1Nils","inline":"TwoColumn-module_inline__1fPfM","width-lg":"TwoColumn-module_width-lg__2MD35","width-xl":"TwoColumn-module_width-xl__3Bxet","width-full":"TwoColumn-module_width-full__1QWYO","restrict-xxs":"TwoColumn-module_restrict-xxs__6il-H","restrict-xs":"TwoColumn-module_restrict-xs__AOezq","restrict-sm":"TwoColumn-module_restrict-sm__2rKty","customMargin":"TwoColumn-module_customMargin__o0uxH","right":"TwoColumn-module_right__Fr52a","sticky":"TwoColumn-module_sticky__4LCDO"};
2735
2247
 
2736
2248
  function TwoColumn(props) {
2737
- var narrow = useNarrowViewport();
2249
+ var shouldInline = useShouldInlineSticky();
2738
2250
  return /*#__PURE__*/React.createElement("div", {
2739
- className: classNames(styles$a.root, styles$a[props.align], narrow ? styles$a.narrowViewport : styles$a.wideViewport)
2251
+ className: classNames(styles$9.root, styles$9[props.align])
2740
2252
  }, /*#__PURE__*/React.createElement("div", {
2741
- className: classNames(styles$a.group),
2253
+ className: classNames(styles$9.group),
2742
2254
  key: props.align
2743
2255
  }, /*#__PURE__*/React.createElement("div", {
2744
- className: styles$a.inline,
2256
+ className: classNames(styles$9.box, styles$9.inline),
2745
2257
  ref: props.contentAreaRef
2746
- })), renderItems(props, narrow), renderPlaceholder(props.placeholder));
2258
+ })), renderItems(props, shouldInline), renderPlaceholder(props.placeholder));
2747
2259
  }
2748
2260
  TwoColumn.defaultProps = {
2749
2261
  align: 'left'
2750
2262
  };
2751
2263
 
2752
- function renderItems(props, narrow) {
2753
- return groupItemsByPosition(props.items, availablePositions(narrow)).map(function (group, index) {
2754
- return /*#__PURE__*/React.createElement("div", {
2264
+ function useShouldInlineSticky() {
2265
+ var _theme$options$proper, _shouldInline;
2266
+
2267
+ var theme = useTheme();
2268
+ var root = ((_theme$options$proper = theme.options.properties) === null || _theme$options$proper === void 0 ? void 0 : _theme$options$proper.root) || {};
2269
+ var shouldInline = (_shouldInline = {}, _defineProperty(_shouldInline, widths.md, useMediaQuery("(max-width: ".concat(root.twoColumnStickyBreakpoint || '950px', ")"))), _defineProperty(_shouldInline, widths.lg, useMediaQuery("(max-width: ".concat(root.twoColumnStickyLgBreakpoint || '1200px', ")"))), _defineProperty(_shouldInline, widths.xl, useMediaQuery("(max-width: ".concat(root.twoColumnStickyXlBreakpoint || '1400px', ")"))), _shouldInline);
2270
+ return function (width) {
2271
+ return width <= widths.md ? shouldInline[widths.md] : shouldInline[width];
2272
+ };
2273
+ } // Used in tests to render markers around groups
2274
+
2275
+
2276
+ TwoColumn.GroupComponent = 'div';
2277
+
2278
+ function renderItems(props, shouldInline) {
2279
+ return groupItemsByPosition(props.items, shouldInline).map(function (group, index) {
2280
+ return /*#__PURE__*/React.createElement(TwoColumn.GroupComponent, {
2755
2281
  key: index,
2756
- className: classNames(styles$a.group, styles$a["group-".concat(group.position)])
2757
- }, renderItemGroup(props, group, 'sticky'), renderItemGroup(props, group, 'inline'), renderItemGroup(props, group, 'wide'), renderItemGroup(props, group, 'full'));
2282
+ className: classNames(styles$9.group, styles$9["group-".concat(widthName(group.width))])
2283
+ }, group.boxes.map(function (box, index) {
2284
+ return renderItemGroup(props, box, index);
2285
+ }));
2758
2286
  });
2759
2287
  }
2760
2288
 
2761
- function renderItemGroup(props, group, position) {
2762
- if (group[position].length) {
2289
+ function renderItemGroup(props, box, key) {
2290
+ if (box.items.length) {
2763
2291
  return /*#__PURE__*/React.createElement("div", {
2764
- className: styles$a[position]
2765
- }, props.children( /*#__PURE__*/React.createElement(ContentElements, {
2292
+ key: key,
2293
+ className: classNames(styles$9.box, styles$9[box.position], styles$9["width-".concat(widthName(box.width))], _defineProperty({}, styles$9.customMargin, box.customMargin))
2294
+ }, props.children( /*#__PURE__*/React.createElement(RestrictWidth, {
2295
+ width: box.width
2296
+ }, /*#__PURE__*/React.createElement(ContentElements, {
2766
2297
  sectionProps: props.sectionProps,
2767
- items: group[position]
2768
- }), {
2769
- position: position,
2770
- openStart: position === 'inline' && group.openStart,
2771
- openEnd: position === 'inline' && group.openEnd
2298
+ customMargin: box.customMargin,
2299
+ items: box.items
2300
+ })), {
2301
+ position: box.position,
2302
+ width: box.width,
2303
+ customMargin: box.customMargin,
2304
+ openStart: box.openStart,
2305
+ openEnd: box.openEnd
2772
2306
  }));
2773
2307
  }
2774
2308
  }
2775
2309
 
2776
- function groupItemsByPosition(items, availablePositions) {
2310
+ function RestrictWidth(_ref) {
2311
+ var width = _ref.width,
2312
+ children = _ref.children;
2313
+
2314
+ if (width >= 0) {
2315
+ return children;
2316
+ } else {
2317
+ return /*#__PURE__*/React.createElement("div", {
2318
+ className: styles$9["restrict-".concat(widthName(width))]
2319
+ }, children);
2320
+ }
2321
+ }
2322
+
2323
+ function groupItemsByPosition(items, shouldInline) {
2777
2324
  var groups = [];
2778
- var currentGroup;
2779
- items.reduce(function (previousItemPosition, item, index) {
2780
- var position = availablePositions.indexOf(item.position) >= 0 ? item.position : 'inline';
2325
+ var lastInlineBox = null;
2326
+ var currentGroup, currentBox;
2327
+ items.reduce(function (previousPosition, item, index) {
2328
+ var _ref2 = api.contentElementTypes.getOptions(item.type) || {},
2329
+ elementSupportsCustomMargin = _ref2.customMargin;
2330
+
2331
+ var width = item.width || 0;
2332
+ var position = item.position === 'sticky' && !shouldInline(width) ? 'sticky' : 'inline';
2333
+ var customMargin = !!elementSupportsCustomMargin && width < widths.full;
2334
+
2335
+ if (item.position === 'sticky' && position === 'inline' && width > widths.md) {
2336
+ width -= 1;
2337
+ }
2338
+
2339
+ if (!currentGroup || previousPosition !== position || position === 'sticky' && currentBox.customMargin !== customMargin || currentBox.width !== width) {
2340
+ currentBox = null;
2341
+
2342
+ if (!(previousPosition === 'sticky' && position === 'inline' && width <= widths.md)) {
2343
+ currentGroup = {
2344
+ width: width,
2345
+ boxes: []
2346
+ };
2347
+ groups.push(currentGroup);
2348
+ }
2349
+ }
2781
2350
 
2782
- if (!previousItemPosition || previousItemPosition !== position && !(previousItemPosition === 'sticky' && position === 'inline')) {
2783
- currentGroup = {
2351
+ if (!currentBox || currentBox.customMargin !== customMargin) {
2352
+ currentBox = {
2353
+ customMargin: customMargin,
2784
2354
  position: position,
2785
- sticky: [],
2786
- inline: [],
2787
- wide: [],
2788
- full: []
2355
+ width: width,
2356
+ items: []
2789
2357
  };
2790
- groups = [].concat(_toConsumableArray(groups), [currentGroup]);
2358
+
2359
+ if (lastInlineBox && position === 'inline' && width <= widths.md && !customMargin) {
2360
+ lastInlineBox.openEnd = true;
2361
+ currentBox.openStart = true;
2362
+ }
2363
+
2364
+ if (position === 'inline' && width <= widths.md && !customMargin) {
2365
+ lastInlineBox = currentBox;
2366
+ } else if (position === 'inline' && width > widths.md || customMargin && position !== 'sticky') {
2367
+ lastInlineBox = null;
2368
+ }
2369
+
2370
+ currentGroup.boxes.push(currentBox);
2791
2371
  }
2792
2372
 
2793
- currentGroup[position].push(item);
2373
+ currentBox.items.push(item);
2794
2374
  return position;
2795
2375
  }, null);
2796
- groups.forEach(function (group, index) {
2797
- var previous = groups[index - 1];
2798
- var next = groups[index + 1];
2799
- group.openStart = previous && !(previous.full.length || previous.wide.length);
2800
- group.openEnd = next && next.inline.length > 0;
2801
- });
2802
2376
  return groups;
2803
2377
  }
2804
2378
 
@@ -2808,60 +2382,132 @@ function renderPlaceholder(placeholder) {
2808
2382
  }
2809
2383
 
2810
2384
  return /*#__PURE__*/React.createElement("div", {
2811
- className: classNames(styles$a.group)
2385
+ className: classNames(styles$9.group)
2812
2386
  }, /*#__PURE__*/React.createElement("div", {
2813
- className: styles$a.inline
2387
+ className: classNames(styles$9.box, styles$9.inline)
2814
2388
  }, placeholder));
2815
2389
  }
2816
2390
 
2817
- var styles$b = {"outer":"Center-module_outer__3Rr0H","outer-full":"Center-module_outer-full__3dknO","item":"Center-module_item__1KSs3","item-wide":"Center-module_item-wide__2shH7","item-full":"Center-module_item-full__1cEuv","clear":"Center-module_clear__jJEap","inner-left":"Center-module_inner-left__2z9Ea","inner-right":"Center-module_inner-right__KBkVt"};
2391
+ var styles$a = {"outer":"Center-module_outer__3Rr0H","customMargin":"Center-module_customMargin__1es3t","outer-full":"Center-module_outer-full__3dknO","item":"Center-module_item__1KSs3","item-inline-lg":"Center-module_item-inline-lg__DGjXl","item-inline-xl":"Center-module_item-inline-xl__2McfB","item-inline-full":"Center-module_item-inline-full__l-6kG","clear":"Center-module_clear__jJEap","inner-xxs":"Center-module_inner-xxs__1oroz","inner-xs":"Center-module_inner-xs__3FRT8","inner-sm":"Center-module_inner-sm__-oQ0E","inner-left":"Center-module_inner-left__2z9Ea","inner-right":"Center-module_inner-right__KBkVt","sideBySide":"Center-module_sideBySide__-YsP0","inner-md":"Center-module_inner-md__3dLC3","inner-lg":"Center-module_inner-lg__2GQbs","inner-xl":"Center-module_inner-xl__3dOME"};
2818
2392
 
2393
+ var floatedPositions = ['left', 'right'];
2819
2394
  function Center(props) {
2820
2395
  return /*#__PURE__*/React.createElement("div", {
2821
- className: classNames(styles$b.root)
2396
+ className: classNames(styles$a.root)
2822
2397
  }, /*#__PURE__*/React.createElement("div", {
2823
2398
  ref: props.contentAreaRef
2824
- }), /*#__PURE__*/React.createElement(ContentElements, {
2825
- sectionProps: props.sectionProps,
2826
- items: props.items
2827
- }, function (item, child, index) {
2828
- return /*#__PURE__*/React.createElement("div", {
2399
+ }), props.items.map(function (item, index) {
2400
+ var customMargin = hasCustomMargin(item);
2401
+ var position = item.position;
2402
+ var width = widthName(getWidth(item));
2403
+ return /*#__PURE__*/React.createElement(ContentElements, {
2829
2404
  key: item.id,
2830
- className: outerClassName(item)
2831
- }, /*#__PURE__*/React.createElement("div", {
2832
- className: classNames(styles$b.item, styles$b["item-".concat(item.position)])
2833
- }, props.children( /*#__PURE__*/React.createElement("div", {
2834
- className: styles$b["inner-".concat(item.position)]
2835
- }, child), boxProps(props.items, item, index))));
2405
+ sectionProps: props.sectionProps,
2406
+ items: [item],
2407
+ customMargin: customMargin
2408
+ }, function (item, child) {
2409
+ return /*#__PURE__*/React.createElement("div", {
2410
+ key: item.id,
2411
+ className: outerClassName(props.items, index)
2412
+ }, /*#__PURE__*/React.createElement("div", {
2413
+ className: classNames(styles$a.item, styles$a["item-".concat(position, "-").concat(width)])
2414
+ }, props.children( /*#__PURE__*/React.createElement("div", {
2415
+ className: classNames(styles$a["inner-".concat(item.position)], styles$a["inner-".concat(width)], _defineProperty({}, styles$a["sideBySide"], sideBySideFloat(props.items, index)))
2416
+ }, child), boxProps(props.items, item, index))));
2417
+ });
2836
2418
  }), renderPlaceholder$1(props.placeholder));
2837
2419
  }
2838
2420
 
2839
- function outerClassName(item) {
2840
- var _api$contentElementTy = api.contentElementTypes.getOptions(item.type),
2841
- supportsWrappingAroundFloats = _api$contentElementTy.supportsWrappingAroundFloats;
2842
-
2843
- return classNames(styles$b.outer, styles$b["outer-".concat(item.position)], _defineProperty({}, styles$b.clear, !supportsWrappingAroundFloats));
2421
+ function outerClassName(items, index) {
2422
+ var item = items[index];
2423
+ return classNames(styles$a.outer, styles$a["outer-".concat(widthName(getWidth(item)))], _defineProperty({}, styles$a.customMargin, hasCustomMargin(item)), _defineProperty({}, styles$a.clear, clearItem(items, index)));
2844
2424
  }
2845
2425
 
2846
2426
  function boxProps(items, item, index) {
2847
2427
  var previous = items[index - 1];
2848
2428
  var next = items[index + 1];
2429
+ var customMargin = hasCustomMargin(item);
2430
+ var width = getWidth(item);
2849
2431
  return {
2850
2432
  position: item.position,
2851
- openStart: previous && item.position !== 'full' && previous.position !== 'full' && item.position !== 'wide' && previous.position !== 'wide',
2852
- openEnd: next && item.position !== 'full' && next.position !== 'full' && item.position !== 'wide' && next.position !== 'wide'
2433
+ width: width,
2434
+ customMargin: customMargin,
2435
+ selfClear: selfClear(items, index),
2436
+ openStart: previous && !customMargin && !hasCustomMargin(previous) && !isWideOrFull(item) && !isWideOrFull(previous),
2437
+ openEnd: next && !customMargin && !hasCustomMargin(next) && !isWideOrFull(item) && !isWideOrFull(next)
2853
2438
  };
2854
2439
  }
2855
2440
 
2441
+ function isWideOrFull(item) {
2442
+ return item.position === 'inline' && getWidth(item) > widths.md;
2443
+ }
2444
+
2445
+ function selfClear(items, index) {
2446
+ var item = items[index];
2447
+ var next = items[index + 1];
2448
+
2449
+ if (supportsWrappingAroundFloats(item) || isFloated(item) && (!next || clearItem(items, index + 1))) {
2450
+ return 'both';
2451
+ } else if (isFloated(item)) {
2452
+ return item.position === 'left' ? 'right' : 'left';
2453
+ }
2454
+
2455
+ return 'none';
2456
+ }
2457
+
2458
+ function clearItem(items, index) {
2459
+ return supportsWrappingAroundFloats(items[index]) ? followsSideBySideElements(items, index) : !isFloatedFollowingOppositeFloated(items, index);
2460
+ }
2461
+
2462
+ function followsSideBySideElements(items, index) {
2463
+ return index > 1 && (items[index - 1].position === 'left' && items[index - 2].position === 'right' || items[index - 1].position === 'right' && items[index - 2].position === 'left');
2464
+ }
2465
+
2466
+ function sideBySideFloat(items, index) {
2467
+ return isFloatedFollowingOppositeFloated(items, index) || isFloatedFollowedByOppositeFloated(items, index);
2468
+ }
2469
+
2470
+ function isFloatedFollowingOppositeFloated(items, index) {
2471
+ return index > 0 && isFloated(items[index]) && isFloated(items[index - 1]) && items[index].position !== items[index - 1].position;
2472
+ }
2473
+
2474
+ function isFloatedFollowedByOppositeFloated(items, index) {
2475
+ return index < items.length - 1 && isFloated(items[index]) && isFloated(items[index + 1]) && items[index].position !== items[index + 1].position;
2476
+ }
2477
+
2478
+ function isFloated(item) {
2479
+ return floatedPositions.includes(item.position);
2480
+ }
2481
+
2482
+ function supportsWrappingAroundFloats(item) {
2483
+ var _api$contentElementTy = api.contentElementTypes.getOptions(item.type),
2484
+ supportsWrappingAroundFloats = _api$contentElementTy.supportsWrappingAroundFloats;
2485
+
2486
+ return supportsWrappingAroundFloats;
2487
+ }
2488
+
2489
+ function hasCustomMargin(item) {
2490
+ var position = item.position;
2491
+
2492
+ var _ref = api.contentElementTypes.getOptions(item.type) || {},
2493
+ elementSupportsCustomMargin = _ref.customMargin;
2494
+
2495
+ return !!(elementSupportsCustomMargin && position === 'inline' && getWidth(item) < widths.full);
2496
+ }
2497
+
2498
+ function getWidth(item) {
2499
+ return item.width || widths.md;
2500
+ }
2501
+
2856
2502
  function renderPlaceholder$1(placeholder) {
2857
2503
  if (!placeholder) {
2858
2504
  return null;
2859
2505
  }
2860
2506
 
2861
2507
  return /*#__PURE__*/React.createElement("div", {
2862
- className: classNames(styles$b.outer)
2508
+ className: classNames(styles$a.outer)
2863
2509
  }, /*#__PURE__*/React.createElement("div", {
2864
- className: classNames(styles$b.item)
2510
+ className: classNames(styles$a.item)
2865
2511
  }, placeholder));
2866
2512
  }
2867
2513
 
@@ -2894,6 +2540,44 @@ function useScrollTarget(ref, isScrollTarget) {
2894
2540
  }, [ref, isScrollTarget]);
2895
2541
  }
2896
2542
 
2543
+ var SectionViewTimelineContext = React.createContext();
2544
+ function SectionViewTimelineProvider(_ref) {
2545
+ var _backdrop$effects;
2546
+
2547
+ var backdrop = _ref.backdrop,
2548
+ children = _ref.children;
2549
+
2550
+ var _useState = useState(),
2551
+ _useState2 = _slicedToArray(_useState, 2),
2552
+ timeline = _useState2[0],
2553
+ setTimeline = _useState2[1];
2554
+
2555
+ var ref = useRef();
2556
+ var isNeeded = backdrop === null || backdrop === void 0 ? void 0 : (_backdrop$effects = backdrop.effects) === null || _backdrop$effects === void 0 ? void 0 : _backdrop$effects.some(function (effect) {
2557
+ return effect.name === 'scrollParallax';
2558
+ });
2559
+ useEffect(function () {
2560
+ if (!isNeeded || !window.ViewTimeline) {
2561
+ return;
2562
+ }
2563
+
2564
+ setTimeline(new window.ViewTimeline({
2565
+ subject: ref.current
2566
+ }));
2567
+ return function () {
2568
+ return setTimeline(null);
2569
+ };
2570
+ }, [isNeeded]);
2571
+ return /*#__PURE__*/React.createElement("div", {
2572
+ ref: ref
2573
+ }, /*#__PURE__*/React.createElement(SectionViewTimelineContext.Provider, {
2574
+ value: timeline
2575
+ }, children));
2576
+ }
2577
+ function useSectionViewTimeline() {
2578
+ return useContext(SectionViewTimelineContext);
2579
+ }
2580
+
2897
2581
  var DarkBackgroundContext = createContext(true);
2898
2582
  function BackgroundColorProvider(_ref) {
2899
2583
  var dark = _ref.dark,
@@ -2988,7 +2672,7 @@ function useDimension() {
2988
2672
  return [componentSize, measuredRef];
2989
2673
  }
2990
2674
 
2991
- var styles$c = {"root":"Fullscreen-module_root__1N3CI"};
2675
+ var styles$b = {"root":"Fullscreen-module_root__1N3CI"};
2992
2676
 
2993
2677
  var DimensionContext = React.createContext({});
2994
2678
  function useFullscreenDimensions() {
@@ -3014,18 +2698,18 @@ var Fullscreen = React.forwardRef(function Fullscreen(props, ref) {
3014
2698
 
3015
2699
  return /*#__PURE__*/React.createElement("div", {
3016
2700
  ref: ref,
3017
- className: styles$c.root,
2701
+ className: styles$b.root,
3018
2702
  style: {
3019
2703
  height: height
3020
2704
  }
3021
2705
  }, props.children);
3022
2706
  });
3023
2707
 
3024
- var styles$d = {"FillColor":"FillColor-module_FillColor__S1uEG"};
2708
+ var styles$c = {"FillColor":"FillColor-module_FillColor__S1uEG"};
3025
2709
 
3026
2710
  function FillColor(props) {
3027
2711
  return /*#__PURE__*/React.createElement("div", {
3028
- className: styles$d.FillColor,
2712
+ className: styles$c.FillColor,
3029
2713
  style: {
3030
2714
  backgroundColor: props.color
3031
2715
  }
@@ -3187,7 +2871,12 @@ function sources(videoFile) {
3187
2871
  }
3188
2872
  }
3189
2873
 
3190
- if (quality === 'auto') {
2874
+ if (features.isEnabled('force_fullhd_video_quality')) {
2875
+ return [{
2876
+ type: 'video/mp4',
2877
+ src: videoFile.urls.fullhd || videoFile.urls.high
2878
+ }];
2879
+ } else if (quality === 'auto') {
3191
2880
  var result = [{
3192
2881
  type: 'application/x-mpegURL',
3193
2882
  src: videoFile.urls['hls-playlist']
@@ -3196,7 +2885,7 @@ function sources(videoFile) {
3196
2885
  src: videoFile.urls.high
3197
2886
  }];
3198
2887
 
3199
- if (videoFile.urls['dash-playlist']) {
2888
+ if (videoFile.urls['dash-playlist'] && !features.isEnabled('hls_instead_of_dash')) {
3200
2889
  result = [{
3201
2890
  type: 'application/dash+xml',
3202
2891
  src: videoFile.urls['dash-playlist']
@@ -3290,7 +2979,7 @@ VideoPlayer.defaultProps = {
3290
2979
  controls: true
3291
2980
  };
3292
2981
 
3293
- var styles$e = {"root":"MotifArea-module_root__1_ACd","visible":"MotifArea-module_visible__18Kln"};
2982
+ var styles$d = {"root":"MotifArea-module_root__1_ACd","visible":"MotifArea-module_visible__18Kln"};
3294
2983
 
3295
2984
  var MotifAreaVisibilityContext = React.createContext(false);
3296
2985
  function MotifAreaVisibilityProvider(_ref) {
@@ -3327,7 +3016,7 @@ var MotifArea = function MotifArea(props) {
3327
3016
 
3328
3017
  return /*#__PURE__*/React.createElement("div", {
3329
3018
  ref: setElementRef,
3330
- className: classNames(styles$e.root, _defineProperty({}, styles$e.visible, visible)),
3019
+ className: classNames(styles$d.root, _defineProperty({}, styles$d.visible, visible)),
3331
3020
  style: position,
3332
3021
  onMouseEnter: props.onMouseEnter,
3333
3022
  onMouseLeave: props.onMouseLeave
@@ -3346,18 +3035,72 @@ function getPosition(props) {
3346
3035
  };
3347
3036
  }
3348
3037
 
3349
- var styles$f = {"Backdrop":"Backdrop-module_Backdrop__1w4UZ","noCompositionLayer":"Backdrop-module_noCompositionLayer__33IlH","defaultBackground":"Backdrop-module_defaultBackground__1YQQL","effects":"Backdrop-module_effects__lCEXd"};
3038
+ var styles$e = {"Backdrop":"Backdrop-module_Backdrop__1w4UZ","noCompositionLayer":"Backdrop-module_noCompositionLayer__33IlH","defaultBackground":"Backdrop-module_defaultBackground__1YQQL","effects":"Backdrop-module_effects__lCEXd"};
3350
3039
 
3351
3040
  function Effects(_ref) {
3352
3041
  var file = _ref.file,
3353
3042
  children = _ref.children;
3043
+ var ref = useRef();
3044
+ var sectionViewTimeline = useSectionViewTimeline();
3045
+ var isStaticPreview = useIsStaticPreview();
3046
+
3047
+ var _useSectionLifecycle = useSectionLifecycle(),
3048
+ isVisible = _useSectionLifecycle.isVisible;
3049
+
3050
+ var scrollParallaxValue = getEffectValue(file, 'scrollParallax');
3051
+ var autoZoomValue = getEffectValue(file, 'autoZoom');
3052
+ useIsomorphicLayoutEffect(function () {
3053
+ if (scrollParallaxValue && !isStaticPreview && sectionViewTimeline) {
3054
+ var max = 20 * scrollParallaxValue / 100;
3055
+ var scale = 100 + 2 * max;
3056
+ var animation = ref.current.animate({
3057
+ transform: ["scale(".concat(scale, "%) translateY(").concat(max, "%)"), "scale(".concat(scale, "%) translateY(").concat(-max, "%)")]
3058
+ }, {
3059
+ fill: 'forwards',
3060
+ timeline: sectionViewTimeline,
3061
+ rangeStart: 'cover 0%',
3062
+ rangeEnd: 'cover 100%'
3063
+ });
3064
+ return function () {
3065
+ return animation.cancel();
3066
+ };
3067
+ }
3068
+ }, [sectionViewTimeline, scrollParallaxValue, isStaticPreview]);
3069
+ var x = (file === null || file === void 0 ? void 0 : file.motifArea) ? 50 - (file.motifArea.left + file.motifArea.width / 2) : 0;
3070
+ var y = (file === null || file === void 0 ? void 0 : file.motifArea) ? 50 - (file.motifArea.top + file.motifArea.height / 2) : 0;
3071
+ useIsomorphicLayoutEffect(function () {
3072
+ if (autoZoomValue && isVisible) {
3073
+ var animation = ref.current.animate({
3074
+ transform: ["translate(".concat(-x, "%, ").concat(-y, "%) scale(1) translate(").concat(x, "%, ").concat(y, "%)"), "translate(".concat(-x, "%, ").concat(-y, "%) scale(1.2) translate(").concat(x, "%, ").concat(y, "%)")]
3075
+ }, {
3076
+ iterations: 1,
3077
+ fill: 'forwards',
3078
+ duration: 1000 * (autoZoomValue / 100) + 40000 * (1 - autoZoomValue / 100),
3079
+ composite: 'add',
3080
+ easing: 'ease'
3081
+ });
3082
+ return function () {
3083
+ return animation.cancel();
3084
+ };
3085
+ }
3086
+ }, [autoZoomValue, isVisible, x, y]);
3354
3087
  return /*#__PURE__*/React.createElement("div", {
3355
- className: styles$f.effects,
3088
+ ref: ref,
3089
+ className: styles$e.effects,
3356
3090
  style: {
3357
3091
  filter: getFilter((file === null || file === void 0 ? void 0 : file.effects) || [])
3358
3092
  }
3359
3093
  }, children);
3360
3094
  }
3095
+
3096
+ function getEffectValue(file, name) {
3097
+ var _find;
3098
+
3099
+ return (_find = ((file === null || file === void 0 ? void 0 : file.effects) || []).find(function (effect) {
3100
+ return effect.name === name;
3101
+ })) === null || _find === void 0 ? void 0 : _find.value;
3102
+ }
3103
+
3361
3104
  function getFilter(effects) {
3362
3105
  return effects.map(function (effect) {
3363
3106
  if (effect.name === 'blur') {
@@ -3365,10 +3108,10 @@ function getFilter(effects) {
3365
3108
  } else if (['brightness', 'contrast', 'saturate'].includes(effect.name)) {
3366
3109
  var value = Math.round(effect.value < 0 ? 100 + effect.value * 0.6 : 100 + effect.value);
3367
3110
  return "".concat(effect.name, "(").concat(value, "%)");
3368
- } else {
3111
+ } else if (['grayscale', 'sepia'].includes(effect.name)) {
3369
3112
  return "".concat(effect.name, "(").concat(effect.value, "%)");
3370
3113
  }
3371
- }).join(' ');
3114
+ }).filter(Boolean).join(' ');
3372
3115
  }
3373
3116
 
3374
3117
  function BackgroundVideo(_ref) {
@@ -3434,16 +3177,7 @@ function BackgroundVideo(_ref) {
3434
3177
  }));
3435
3178
  }
3436
3179
 
3437
- /**
3438
- * Returns boolean indicating whether viewport orientation is currently
3439
- * portrait.
3440
- */
3441
-
3442
- function usePortraitOrientation() {
3443
- return useMediaQuery('(orientation: portrait)');
3444
- }
3445
-
3446
- var styles$g = {"root":"Image-module_root__1ef3j"};
3180
+ var styles$f = {"fill":"Image-module_fill__1D1wH"};
3447
3181
 
3448
3182
  function ImageStructuredData(_ref) {
3449
3183
  var file = _ref.file;
@@ -3477,6 +3211,7 @@ function ImageStructuredData(_ref) {
3477
3211
  * @param {boolean} [props.load] - Whether to load the image. Can be used for lazy loading.
3478
3212
  * @param {boolean} [props.structuredData] - Whether to render a JSON+LD script tag.
3479
3213
  * @param {boolean} [props.preferSvg] - Use original if image is SVG.
3214
+ * @param {boolean} [props.fill=true] - Position absolute and fill parent.
3480
3215
  */
3481
3216
 
3482
3217
  function Image(_ref) {
@@ -3494,7 +3229,7 @@ function renderImageTag(props, imageFile) {
3494
3229
  var cropPositionX = imageFile.cropPosition ? imageFile.cropPosition.x : 50;
3495
3230
  var cropPositionY = imageFile.cropPosition ? imageFile.cropPosition.y : 50;
3496
3231
  return /*#__PURE__*/React.createElement("img", {
3497
- className: classNames(styles$g.root),
3232
+ className: classNames(_defineProperty({}, styles$f.fill, props.fill)),
3498
3233
  src: imageUrl(imageFile, props),
3499
3234
  alt: imageFile.configuration.alt ? imageFile.configuration.alt : '',
3500
3235
  style: {
@@ -3524,7 +3259,8 @@ function renderStructuredData(props, file) {
3524
3259
 
3525
3260
  Image.defaultProps = {
3526
3261
  load: true,
3527
- variant: 'large'
3262
+ variant: 'large',
3263
+ fill: true
3528
3264
  };
3529
3265
 
3530
3266
  function BackgroundImage(_ref) {
@@ -3540,114 +3276,48 @@ function BackgroundImage(_ref) {
3540
3276
  }, /*#__PURE__*/React.createElement(Image, {
3541
3277
  imageFile: image,
3542
3278
  load: shouldLoad,
3543
- structuredData: true,
3544
- preferSvg: true
3545
- })), /*#__PURE__*/React.createElement(MotifArea, {
3546
- key: image === null || image === void 0 ? void 0 : image.permaId,
3547
- onUpdate: onMotifAreaUpdate,
3548
- file: image,
3549
- containerWidth: containerDimension.width,
3550
- containerHeight: containerDimension.height
3551
- }));
3552
- }
3553
-
3554
- function OrientationAwareBackgroundImage(_ref) {
3555
- var image = _ref.image,
3556
- onMotifAreaUpdate = _ref.onMotifAreaUpdate,
3557
- imageMobile = _ref.imageMobile,
3558
- containerDimension = _ref.containerDimension;
3559
- var mobile = usePortraitOrientation();
3560
-
3561
- if (mobile) {
3562
- return /*#__PURE__*/React.createElement(BackgroundImage, {
3563
- image: imageMobile,
3564
- onMotifAreaUpdate: onMotifAreaUpdate,
3565
- containerDimension: containerDimension
3566
- });
3567
- } else {
3568
- return /*#__PURE__*/React.createElement(BackgroundImage, {
3569
- image: image,
3570
- onMotifAreaUpdate: onMotifAreaUpdate,
3571
- containerDimension: containerDimension
3572
- });
3573
- }
3279
+ structuredData: true,
3280
+ preferSvg: true
3281
+ })), /*#__PURE__*/React.createElement(MotifArea, {
3282
+ key: image === null || image === void 0 ? void 0 : image.permaId,
3283
+ onUpdate: onMotifAreaUpdate,
3284
+ file: image,
3285
+ containerWidth: containerDimension.width,
3286
+ containerHeight: containerDimension.height
3287
+ }));
3574
3288
  }
3575
3289
 
3576
3290
  function BackgroundAsset(props) {
3577
- var video = useBackgroundFile({
3578
- file: useFile({
3579
- collectionName: 'videoFiles',
3580
- permaId: props.video
3581
- }),
3582
- motifArea: props.videoMotifArea,
3583
- containerDimension: props.containerDimension,
3584
- effects: props.effects
3585
- });
3586
- var image = useBackgroundFile({
3587
- file: useFile({
3588
- collectionName: 'imageFiles',
3589
- permaId: props.image
3590
- }),
3591
- motifArea: props.imageMotifArea,
3592
- containerDimension: props.containerDimension,
3593
- effects: props.effects
3594
- });
3595
- var imageMobile = useBackgroundFile({
3596
- file: useFile({
3597
- collectionName: 'imageFiles',
3598
- permaId: props.imageMobile
3599
- }),
3600
- motifArea: props.imageMobileMotifArea,
3601
- containerDimension: props.containerDimension,
3602
- effects: props.effectsMobile
3291
+ var backgroundFile = useBackgroundFile({
3292
+ file: props.backdrop.video || props.backdrop.image,
3293
+ motifArea: props.backdrop.motifArea,
3294
+ effects: props.backdrop.effects,
3295
+ containerDimension: props.containerDimension
3603
3296
  });
3604
3297
 
3605
- if (video) {
3298
+ if (props.backdrop.video) {
3606
3299
  return /*#__PURE__*/React.createElement(Fullscreen, {
3607
3300
  ref: props.setContainerRef
3608
3301
  }, /*#__PURE__*/React.createElement(BackgroundVideo, {
3609
- video: video,
3302
+ video: backgroundFile,
3610
3303
  onMotifAreaUpdate: props.onMotifAreaUpdate,
3611
3304
  containerDimension: props.containerDimension
3612
3305
  }));
3613
- } else if (props.color || props.image && props.image.toString().startsWith('#')) {
3306
+ } else if (props.backdrop.color) {
3614
3307
  return /*#__PURE__*/React.createElement(FillColor, {
3615
- color: props.color || props.image
3308
+ color: props.backdrop.color
3616
3309
  });
3617
3310
  } else {
3618
3311
  return /*#__PURE__*/React.createElement(Fullscreen, {
3619
3312
  ref: props.setContainerRef
3620
- }, renderBackgroundImage({
3621
- image: image,
3622
- imageMobile: imageMobile,
3313
+ }, /*#__PURE__*/React.createElement(BackgroundImage, {
3314
+ image: backgroundFile,
3623
3315
  onMotifAreaUpdate: props.onMotifAreaUpdate,
3624
3316
  containerDimension: props.containerDimension
3625
3317
  }));
3626
3318
  }
3627
3319
  }
3628
3320
 
3629
- function renderBackgroundImage(_ref) {
3630
- var image = _ref.image,
3631
- imageMobile = _ref.imageMobile,
3632
- onMotifAreaUpdate = _ref.onMotifAreaUpdate,
3633
- containerDimension = _ref.containerDimension;
3634
-
3635
- if (image && imageMobile) {
3636
- return /*#__PURE__*/React.createElement(OrientationAwareBackgroundImage, {
3637
- image: image,
3638
- imageMobile: imageMobile,
3639
- onMotifAreaUpdate: onMotifAreaUpdate,
3640
- containerDimension: containerDimension
3641
- });
3642
- } else {
3643
- return /*#__PURE__*/React.createElement(BackgroundImage, {
3644
- image: image || imageMobile,
3645
- onMotifAreaUpdate: onMotifAreaUpdate,
3646
- containerDimension: containerDimension
3647
- });
3648
- }
3649
- }
3650
-
3651
3321
  function Backdrop(props) {
3652
3322
  var _useDimension = useDimension(),
3653
3323
  _useDimension2 = _slicedToArray(_useDimension, 2),
@@ -3658,11 +3328,11 @@ function Backdrop(props) {
3658
3328
  shouldLoad = _useSectionLifecycle.shouldLoad;
3659
3329
 
3660
3330
  return /*#__PURE__*/React.createElement("div", {
3661
- className: classNames(styles$f.Backdrop, _defineProperty({}, styles$f.noCompositionLayer, !shouldLoad && !props.eagerLoad), props.transitionStyles.backdrop, props.transitionStyles["backdrop-".concat(props.state)])
3331
+ className: classNames(styles$e.Backdrop, _defineProperty({}, styles$e.noCompositionLayer, !shouldLoad && !props.eagerLoad), props.transitionStyles.backdrop, props.transitionStyles["backdrop-".concat(props.state)])
3662
3332
  }, /*#__PURE__*/React.createElement("div", {
3663
3333
  className: props.transitionStyles.backdropInner
3664
3334
  }, /*#__PURE__*/React.createElement("div", {
3665
- className: classNames(styles$f.defaultBackground, props.transitionStyles.backdropInner2)
3335
+ className: classNames(styles$e.defaultBackground, props.transitionStyles.backdropInner2)
3666
3336
  }, props.children( /*#__PURE__*/React.createElement(BackgroundAsset, Object.assign({}, props, {
3667
3337
  containerDimension: containerDimension,
3668
3338
  setContainerRef: setContainerRef
@@ -3906,29 +3576,91 @@ function getIntersectionRatioY(isContentPadded, motifAreaRect, contentAreaRect)
3906
3576
  return isContentPadded ? motifAreaOverlap / motifAreaRect.height : 0;
3907
3577
  }
3908
3578
 
3909
- function useBackdrop() {}
3579
+ /**
3580
+ * Returns boolean indicating whether viewport orientation is currently
3581
+ * portrait.
3582
+ */
3583
+
3584
+ function usePortraitOrientation(options) {
3585
+ return useMediaQuery('(orientation: portrait)', options);
3586
+ }
3587
+
3588
+ function useBackdrop(section) {
3589
+ var _section$backdrop, _section$backdrop2;
3590
+
3591
+ var videoBackdrop = useFileBackdrop({
3592
+ section: section,
3593
+ collectionName: 'videoFiles',
3594
+ propertyName: 'video'
3595
+ });
3596
+ var imageBackdrop = useFileBackdrop({
3597
+ section: section,
3598
+ collectionName: 'imageFiles',
3599
+ propertyName: 'image'
3600
+ });
3601
+
3602
+ if (((_section$backdrop = section.backdrop) === null || _section$backdrop === void 0 ? void 0 : _section$backdrop.color) || ((_section$backdrop2 = section.backdrop) === null || _section$backdrop2 === void 0 ? void 0 : _section$backdrop2.image) && section.backdrop.image.toString().startsWith('#')) {
3603
+ return {
3604
+ color: section.backdrop.color || section.backdrop.image
3605
+ };
3606
+ } else {
3607
+ return videoBackdrop || imageBackdrop || {};
3608
+ }
3609
+ }
3610
+
3611
+ function useFileBackdrop(_ref) {
3612
+ var section = _ref.section,
3613
+ collectionName = _ref.collectionName,
3614
+ propertyName = _ref.propertyName;
3615
+ var file = useFileWithInlineRights({
3616
+ configuration: section.backdrop || {},
3617
+ collectionName: collectionName,
3618
+ propertyName: propertyName
3619
+ });
3620
+ var mobileFile = useFileWithInlineRights({
3621
+ configuration: section.backdrop || {},
3622
+ collectionName: collectionName,
3623
+ propertyName: "".concat(propertyName, "Mobile")
3624
+ });
3625
+ var mobile = usePortraitOrientation({
3626
+ active: file && mobileFile
3627
+ });
3628
+
3629
+ if (mobileFile && (mobile || !file)) {
3630
+ var _ref2;
3631
+
3632
+ return _ref2 = {}, _defineProperty(_ref2, propertyName, mobileFile), _defineProperty(_ref2, "motifArea", section.backdrop["".concat(propertyName, "MobileMotifArea")]), _defineProperty(_ref2, "effects", section.backdropEffectsMobile), _ref2;
3633
+ } else if (file) {
3634
+ var _ref3;
3635
+
3636
+ return _ref3 = {}, _defineProperty(_ref3, propertyName, file), _defineProperty(_ref3, "motifArea", section.backdrop["".concat(propertyName, "MotifArea")]), _defineProperty(_ref3, "effects", section.backdropEffects), _ref3;
3637
+ } else {
3638
+ return null;
3639
+ }
3640
+ }
3641
+
3910
3642
  function useBackdropSectionCustomProperties() {}
3911
3643
  function useBackdropSectionClassNames() {}
3912
3644
 
3913
3645
  var v1 = /*#__PURE__*/Object.freeze({
3914
3646
  __proto__: null,
3915
- useBackdrop: useBackdrop,
3916
3647
  useBackdropSectionCustomProperties: useBackdropSectionCustomProperties,
3917
3648
  useBackdropSectionClassNames: useBackdropSectionClassNames,
3918
3649
  Backdrop: Backdrop,
3919
- useMotifAreaState: useMotifAreaState
3650
+ useMotifAreaState: useMotifAreaState,
3651
+ useBackdrop: useBackdrop
3920
3652
  });
3921
3653
 
3922
- var styles$h = {"wrapper":"Positioner-module_wrapper__3iFSg"};
3654
+ var styles$g = {"wrapper":"Positioner-module_wrapper__3iFSg"};
3923
3655
 
3924
3656
  function Positioner(_ref) {
3925
3657
  var children = _ref.children;
3926
3658
  return /*#__PURE__*/React.createElement("div", {
3927
- className: styles$h.wrapper
3659
+ className: styles$g.wrapper
3928
3660
  }, children);
3929
3661
  }
3930
3662
 
3931
- var styles$i = {"root":"Picture-module_root__1BCCg"};
3663
+ var styles$h = {"root":"Picture-module_root__1BCCg"};
3932
3664
 
3933
3665
  function Picture(_ref) {
3934
3666
  var imageFile = _ref.imageFile,
@@ -3966,7 +3698,7 @@ function renderTag(_ref2) {
3966
3698
  }),
3967
3699
  media: "(orientation: portrait)"
3968
3700
  }), /*#__PURE__*/React.createElement("img", {
3969
- className: classNames(styles$i.root),
3701
+ className: classNames(styles$h.root),
3970
3702
  src: imageUrl$1({
3971
3703
  imageFile: imageFile,
3972
3704
  variant: variant,
@@ -4010,18 +3742,18 @@ var MotifArea$1 = function MotifArea(props) {
4010
3742
  var visible = useContext(MotifAreaVisibilityContext);
4011
3743
  return /*#__PURE__*/React.createElement("div", {
4012
3744
  ref: props.onUpdate,
4013
- className: classNames(styles$e.root, v2Styles.root, _defineProperty({}, styles$e.visible, visible))
3745
+ className: classNames(styles$d.root, v2Styles.root, _defineProperty({}, styles$d.visible, visible))
4014
3746
  });
4015
3747
  };
4016
3748
 
4017
- var styles$j = {"effects":"Effects-module_effects__MDZRR"};
3749
+ var styles$i = {"effects":"Effects-module_effects__MDZRR"};
4018
3750
 
4019
3751
  function Effects$1(_ref) {
4020
3752
  var file = _ref.file,
4021
3753
  mobileFile = _ref.mobileFile,
4022
3754
  children = _ref.children;
4023
3755
  return /*#__PURE__*/React.createElement("div", {
4024
- className: styles$j.effects,
3756
+ className: styles$i.effects,
4025
3757
  style: {
4026
3758
  '--filter': getFilter$1((file === null || file === void 0 ? void 0 : file.effects) || []),
4027
3759
  '--mobile-filter': getFilter$1((mobileFile === null || mobileFile === void 0 ? void 0 : mobileFile.effects) || [])
@@ -4157,11 +3889,11 @@ BackgroundAsset$1.defaultProps = {
4157
3889
 
4158
3890
  function Backdrop$1(props) {
4159
3891
  return /*#__PURE__*/React.createElement("div", {
4160
- className: classNames(styles$f.Backdrop, props.transitionStyles.backdrop, props.transitionStyles["backdrop-".concat(props.state)])
3892
+ className: classNames(styles$e.Backdrop, props.transitionStyles.backdrop, props.transitionStyles["backdrop-".concat(props.state)])
4161
3893
  }, /*#__PURE__*/React.createElement("div", {
4162
3894
  className: props.transitionStyles.backdropInner
4163
3895
  }, /*#__PURE__*/React.createElement("div", {
4164
- className: classNames(styles$f.defaultBackground, props.transitionStyles.backdropInner2)
3896
+ className: classNames(styles$e.defaultBackground, props.transitionStyles.backdropInner2)
4165
3897
  }, props.children( /*#__PURE__*/React.createElement(BackgroundAsset$1, props)))));
4166
3898
  }
4167
3899
  Backdrop$1.defaultProps = {
@@ -4354,7 +4086,7 @@ function motifAreaCustomProperties(motifArea, prefix) {
4354
4086
  return motifArea ? (_ref = {}, _defineProperty(_ref, "--".concat(prefix, "motif-t"), motifArea.top), _defineProperty(_ref, "--".concat(prefix, "motif-l"), motifArea.left), _defineProperty(_ref, "--".concat(prefix, "motif-w"), motifArea.width), _defineProperty(_ref, "--".concat(prefix, "motif-h"), motifArea.height), _ref) : {};
4355
4087
  }
4356
4088
 
4357
- var styles$k = {"section":"Section-module_section__7UvMm","orientation":"Section-module_orientation__3-m2N","exposeMotifArea":"Section-module_exposeMotifArea__2rsq_","layout-left":"Section-module_layout-left__2IqOD","layout-right":"Section-module_layout-right__3al0b"};
4089
+ var styles$j = {"section":"Section-module_section__7UvMm","orientation":"Section-module_orientation__3-m2N","exposeMotifArea":"Section-module_exposeMotifArea__2rsq_","layout-left":"Section-module_layout-left__2IqOD","layout-right":"Section-module_layout-right__3al0b"};
4358
4090
 
4359
4091
  function useBackdropSectionClassNames$1(backdrop) {
4360
4092
  var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
@@ -4363,7 +4095,7 @@ function useBackdropSectionClassNames$1(backdrop) {
4363
4095
  empty = _ref.empty;
4364
4096
 
4365
4097
  var fullscreenDimensions = useFullscreenDimensions();
4366
- return [styles$k.section, !fullscreenDimensions.height && styles$k.orientation, styles$k["layout-".concat(layout || 'left')], exposeMotifArea && !empty && styles$k.exposeMotifArea, useAspectRatioClassName(backdrop.file, fullscreenDimensions), useAspectRatioClassName(backdrop.mobileFile, fullscreenDimensions, {
4098
+ return [styles$j.section, !fullscreenDimensions.height && styles$j.orientation, styles$j["layout-".concat(layout || 'left')], exposeMotifArea && !empty && styles$j.exposeMotifArea, useAspectRatioClassName(backdrop.file, fullscreenDimensions), useAspectRatioClassName(backdrop.mobileFile, fullscreenDimensions, {
4367
4099
  mobile: true
4368
4100
  })].filter(Boolean);
4369
4101
  }
@@ -4425,605 +4157,986 @@ function ensureAspectRatioStyleTag(aspectRatio, className, orientation) {
4425
4157
  }
4426
4158
  }
4427
4159
 
4428
- function getAspectRatioCSS(aspectRatio, className, orientation) {
4429
- if (className === 'minAspectRatio') {
4430
- return getAspectRatioRule('minAspectRatio');
4431
- } else {
4432
- return "\n @media ".concat(orientation, "(min-aspect-ratio: ").concat(aspectRatio, "/1000) {\n ").concat(getAspectRatioRule(className), "\n }\n ");
4433
- }
4434
- }
4160
+ function getAspectRatioCSS(aspectRatio, className, orientation) {
4161
+ if (className === 'minAspectRatio') {
4162
+ return getAspectRatioRule('minAspectRatio');
4163
+ } else {
4164
+ return "\n @media ".concat(orientation, "(min-aspect-ratio: ").concat(aspectRatio, "/1000) {\n ").concat(getAspectRatioRule(className), "\n }\n ");
4165
+ }
4166
+ }
4167
+
4168
+ function getAspectRatioRule(className) {
4169
+ // WARNING: This CSS snippet needs to be kept in sync with the
4170
+ // corresponding snippet in GeneratedMediaQueriesHelper
4171
+ return "\n section.".concat(className, " {\n --backdrop-positioner-transform: var(--backdrop-positioner-min-ar-transform);\n --backdrop-positioner-width: var(--backdrop-positioner-min-ar-width);\n --backdrop-positioner-height: var(--backdrop-positioner-min-ar-height);\n\n --motif-placeholder-width: var(--motif-placeholder-min-ar-width);\n\n --motif-display-top: var(--motif-display-min-ar-top);\n --motif-display-bottom: var(--motif-display-min-ar-bottom);\n --motif-display-height: var(--motif-display-min-ar-height);\n }\n ");
4172
+ }
4173
+
4174
+
4175
+
4176
+ var v2 = /*#__PURE__*/Object.freeze({
4177
+ __proto__: null,
4178
+ Backdrop: Backdrop$1,
4179
+ useMotifAreaState: useMotifAreaState$1,
4180
+ useBackdrop: useBackdrop$1,
4181
+ useBackdropSectionCustomProperties: useBackdropSectionCustomProperties$1,
4182
+ useBackdropSectionClassNames: useBackdropSectionClassNames$1
4183
+ });
4184
+
4185
+ var styles$k = {"darkContentTextColor":"var(--theme-dark-content-text-color, #222)","lightContentTextColor":"var(--theme-light-content-text-color, #fff)","darkContentLinkColor":"var(--theme-dark-content-link-color, var(--theme-content-link-color, currentColor))","lightContentLinkColor":"var(--theme-light-content-link-color, var(--theme-content-link-color, currentColor))","Section":"Section-module_Section__Yo58b","first":"Section-module_first__1vLBH","narrow":"Section-module_narrow__3Dawu","invert":"Section-module_invert__3_p7F"};
4186
+
4187
+ var fadeInBgConceal = {"fade-duration":"0.5s","backdrop":"fadeInBgConceal-module_backdrop__11JGO","backdropInner":"fadeInBgConceal-module_backdropInner__1IAYD","backdrop-below":"fadeInBgConceal-module_backdrop-below__3E6Uk"};
4188
+
4189
+ var fadeInBgFadeOut = {"fade-duration":"0.5s","backdrop":"fadeInBgFadeOut-module_backdrop__r0YXp","backdropInner":"fadeInBgFadeOut-module_backdropInner__IQp87","backdrop-below":"fadeInBgFadeOut-module_backdrop-below__2G-Ic","foreground":"fadeInBgFadeOut-module_foreground__Q2vkT","foreground-above":"fadeInBgFadeOut-module_foreground-above__3pmz9"};
4190
+
4191
+ var fadeInBgFadeOutBg = {"fade-duration":"0.5s","backdrop":"fadeInBgFadeOutBg-module_backdrop__15ocl","backdropInner":"fadeInBgFadeOutBg-module_backdropInner__sAnz6","boxShadow":"fadeInBgFadeOutBg-module_boxShadow__xUKyj","boxShadow-above":"fadeInBgFadeOutBg-module_boxShadow-above__2bY0E","backdrop-below":"fadeInBgFadeOutBg-module_backdrop-below__1rDT6"};
4192
+
4193
+ var fadeInBgScrollOut = {"fade-duration":"0.5s","backdrop":"fadeInBgScrollOut-module_backdrop__1bSsb","backdropInner":"fadeInBgScrollOut-module_backdropInner__3JZBG","backdropInner2":"fadeInBgScrollOut-module_backdropInner2__q-00L","foreground":"fadeInBgScrollOut-module_foreground__1ODH9","backdrop-below":"fadeInBgScrollOut-module_backdrop-below__2Dbkr"};
4194
+
4195
+ var fadeInConceal = {"fade-duration":"0.5s","backdrop":"fadeInConceal-module_backdrop__1zaRO","backdropInner":"fadeInConceal-module_backdropInner__1AIvq","backdrop-below":"fadeInConceal-module_backdrop-below__AWyQe","foreground":"fadeInConceal-module_foreground__3giM9","foreground-below":"fadeInConceal-module_foreground-below__2z5Op"};
4196
+
4197
+ var fadeInFadeOut = {"fade-duration":"0.5s","backdrop":"fadeInFadeOut-module_backdrop__Y4xOA","backdropInner":"fadeInFadeOut-module_backdropInner__1oRfP","backdrop-below":"fadeInFadeOut-module_backdrop-below__1h2I4","foreground":"fadeInFadeOut-module_foreground__1eleZ","foreground-above":"fadeInFadeOut-module_foreground-above__249wa","foreground-below":"fadeInFadeOut-module_foreground-below__3mE6f"};
4198
+
4199
+ var fadeInFadeOutBg = {"fade-duration":"0.5s","backdrop":"fadeInFadeOutBg-module_backdrop__2-IF3","backdropInner":"fadeInFadeOutBg-module_backdropInner__3r_bo","boxShadow":"fadeInFadeOutBg-module_boxShadow__3x7Ki","backdrop-below":"fadeInFadeOutBg-module_backdrop-below__4Ys_2","boxShadow-above":"fadeInFadeOutBg-module_boxShadow-above__3T2K5","foreground":"fadeInFadeOutBg-module_foreground__24f_M","foreground-below":"fadeInFadeOutBg-module_foreground-below__3pTRc"};
4200
+
4201
+ var fadeInScrollOut = {"fade-duration":"0.5s","backdrop":"fadeInScrollOut-module_backdrop__2FhBb","backdropInner":"fadeInScrollOut-module_backdropInner__1OfNZ","backdropInner2":"fadeInScrollOut-module_backdropInner2__5bNPT","foreground":"fadeInScrollOut-module_foreground__3h0EX","foreground-below":"fadeInScrollOut-module_foreground-below__1Jcql","backdrop-below":"fadeInScrollOut-module_backdrop-below__3cRLH"};
4202
+
4203
+ var revealConceal = {"backdrop":"revealConceal-module_backdrop__dLUhU utils-module_clip__34eot","backdropInner":"revealConceal-module_backdropInner__2k1Z-"};
4204
+
4205
+ var revealFadeOut = {"fade-duration":"0.5s","backdrop":"revealFadeOut-module_backdrop___Q1QF utils-module_clip__34eot","backdropInner":"revealFadeOut-module_backdropInner__17qRn","foreground":"revealFadeOut-module_foreground__1GzBs","foreground-above":"revealFadeOut-module_foreground-above__3GxOf"};
4206
+
4207
+ var revealFadeOutBg = {"fade-duration":"0.5s","backdrop":"revealFadeOutBg-module_backdrop__30OCF utils-module_clip__34eot","backdropInner":"revealFadeOutBg-module_backdropInner__3v3tM","boxShadow":"revealFadeOutBg-module_boxShadow__1NZRz","boxShadow-above":"revealFadeOutBg-module_boxShadow-above__2r4ov"};
4208
+
4209
+ var revealScrollOut = {"backdrop":"revealScrollOut-module_backdrop__2yOXd utils-module_clip__34eot","backdropInner":"revealScrollOut-module_backdropInner__211p3","backdropInner2":"revealScrollOut-module_backdropInner2__v6WqM","foreground":"revealScrollOut-module_foreground__3z-hw"};
4210
+
4211
+ var scrollInConceal = {"backdrop":"scrollInConceal-module_backdrop__2OJJC"};
4212
+
4213
+ var scrollInFadeOut = {"fade-duration":"0.5s","backdrop":"scrollInFadeOut-module_backdrop__1vXJd","foreground":"scrollInFadeOut-module_foreground__3Ikxb","foreground-above":"scrollInFadeOut-module_foreground-above__6ipm-"};
4214
+
4215
+ var scrollInFadeOutBg = {"fade-duration":"0.5s","backdrop":"scrollInFadeOutBg-module_backdrop__zw95c","boxShadow":"scrollInFadeOutBg-module_boxShadow__3UxCQ","boxShadow-above":"scrollInFadeOutBg-module_boxShadow-above__3kfau"};
4216
+
4217
+ var scrollInScrollOut = {"backdrop":"scrollInScrollOut-module_backdrop__XzCge","foreground":"scrollInScrollOut-module_foreground__1yyY8"};
4218
+
4219
+ var styles$l = {
4220
+ fadeInBgConceal: fadeInBgConceal,
4221
+ fadeInBgFadeOut: fadeInBgFadeOut,
4222
+ fadeInBgFadeOutBg: fadeInBgFadeOutBg,
4223
+ fadeInBgScrollOut: fadeInBgScrollOut,
4224
+ fadeInConceal: fadeInConceal,
4225
+ fadeInFadeOut: fadeInFadeOut,
4226
+ fadeInFadeOutBg: fadeInFadeOutBg,
4227
+ fadeInScrollOut: fadeInScrollOut,
4228
+ revealConceal: revealConceal,
4229
+ revealFadeOut: revealFadeOut,
4230
+ revealFadeOutBg: revealFadeOutBg,
4231
+ revealScrollOut: revealScrollOut,
4232
+ scrollInConceal: scrollInConceal,
4233
+ scrollInFadeOut: scrollInFadeOut,
4234
+ scrollInFadeOutBg: scrollInFadeOutBg,
4235
+ scrollInScrollOut: scrollInScrollOut
4236
+ };
4237
+ var enterTransitions = {
4238
+ fade: 'fadeIn',
4239
+ fadeBg: 'fadeInBg',
4240
+ scroll: 'scrollIn',
4241
+ scrollOver: 'scrollIn',
4242
+ reveal: 'reveal',
4243
+ beforeAfter: 'reveal'
4244
+ };
4245
+ var exitTransitions = {
4246
+ fade: 'fadeOut',
4247
+ fadeBg: 'fadeOutBg',
4248
+ scroll: 'scrollOut',
4249
+ scrollOver: 'conceal',
4250
+ reveal: 'scrollOut',
4251
+ beforeAfter: 'conceal'
4252
+ };
4253
+ function getTransitionNames() {
4254
+ return Object.keys(exitTransitions);
4255
+ }
4256
+ function getAvailableTransitionNames(section, previousSection) {
4257
+ if (!section.fullHeight || !previousSection.fullHeight) {
4258
+ return getTransitionNames().filter(function (name) {
4259
+ return !name.startsWith('fade');
4260
+ });
4261
+ }
4262
+
4263
+ return getTransitionNames();
4264
+ }
4265
+ function getTransitionStyles(section, previousSection, nextSection) {
4266
+ var name = getTransitionStylesName(section, previousSection, nextSection);
4267
+
4268
+ if (!styles$l[name]) {
4269
+ throw new Error("Unknown transition ".concat(name));
4270
+ }
4271
+
4272
+ return styles$l[name];
4273
+ }
4274
+ function getEnterAndExitTransitions(section, previousSection, nextSection) {
4275
+ return [enterTransitions[getTransitionName(previousSection, section)], exitTransitions[getTransitionName(section, nextSection)]];
4276
+ }
4277
+ function getTransitionStylesName(section, previousSection, nextSection) {
4278
+ var _getEnterAndExitTrans = getEnterAndExitTransitions(section, previousSection, nextSection),
4279
+ _getEnterAndExitTrans2 = _slicedToArray(_getEnterAndExitTrans, 2),
4280
+ enter = _getEnterAndExitTrans2[0],
4281
+ exit = _getEnterAndExitTrans2[1];
4282
+
4283
+ return "".concat(enter).concat(capitalize(exit));
4284
+ }
4285
+
4286
+ function getTransitionName(previousSection, section) {
4287
+ if (!section || !previousSection) {
4288
+ return 'scroll';
4289
+ }
4290
+
4291
+ if ((!section.fullHeight || !previousSection.fullHeight) && section.transition.startsWith('fade')) {
4292
+ return 'scroll';
4293
+ }
4294
+
4295
+ return section.transition;
4296
+ }
4297
+
4298
+ function capitalize(string) {
4299
+ return string.charAt(0).toUpperCase() + string.slice(1);
4300
+ }
4301
+
4302
+ function NoOpShadow(props) {
4303
+ return /*#__PURE__*/React.createElement("div", null, props.children);
4304
+ }
4305
+
4306
+ var styles$m = {"static":"GradientShadow-module_static__rXNpZ","dynamic":"GradientShadow-module_dynamic__2v2JU","align-right":"GradientShadow-module_align-right__3iXZs","dark":"GradientShadow-module_dark__1YuV5","align-left":"GradientShadow-module_align-left__3qcNM","align-center":"GradientShadow-module_align-center__2C7cl","align-centerRagged":"GradientShadow-module_align-centerRagged__2-iv8","light":"GradientShadow-module_light__Vn92v","shadow":"GradientShadow-module_shadow__2UiDH"};
4307
+
4308
+ function GradientShadow(props) {
4309
+ // Hide static shadow if motif area intersects with content area.
4310
+ var staticShadowOpacity = props.motifAreaState.isContentPadded ? 0 : props.staticShadowOpacity; // If motif area intersects with content area horizontally, fade in
4311
+ // shadow soon as the content has been scrolled far enough to start
4312
+ // intersecting with the motif area vertically.
4313
+
4314
+ var opacityFactor = // Make shadow reach full opacity when content has been scrolled
4315
+ // up half way across the motif area.
4316
+ roundToFirstDecimalPlace(Math.min(1, props.motifAreaState.intersectionRatioY * 2));
4317
+ return /*#__PURE__*/React.createElement("div", {
4318
+ className: classNames(styles$m["align-".concat(props.align)], props.inverted ? styles$m.light : styles$m.dark)
4319
+ }, /*#__PURE__*/React.createElement("div", {
4320
+ className: styles$m.dynamic,
4321
+ style: {
4322
+ opacity: props.dynamicShadowOpacity * opacityFactor
4323
+ }
4324
+ }, /*#__PURE__*/React.createElement(Fullscreen, null)), /*#__PURE__*/React.createElement("div", {
4325
+ className: styles$m["static"],
4326
+ style: {
4327
+ opacity: staticShadowOpacity
4328
+ }
4329
+ }, /*#__PURE__*/React.createElement(Fullscreen, null)), props.children);
4330
+ }
4331
+ GradientShadow.defaultProps = {
4332
+ opacity: 0.7,
4333
+ align: 'left'
4334
+ };
4335
+
4336
+ function roundToFirstDecimalPlace(value) {
4337
+ return Math.round(value * 10) / 10;
4338
+ }
4339
+
4340
+ var styles$n = {"start":"InvisibleBoxWrapper-module_start__F1nZ7","end":"InvisibleBoxWrapper-module_end__nphD-"};
4341
+
4342
+ function InvisibleBoxWrapper(_ref) {
4343
+ var _classNames;
4344
+
4345
+ var position = _ref.position,
4346
+ width = _ref.width,
4347
+ openStart = _ref.openStart,
4348
+ openEnd = _ref.openEnd,
4349
+ children = _ref.children;
4350
+ var full = width === widths.full;
4351
+ return /*#__PURE__*/React.createElement("div", {
4352
+ className: classNames((_classNames = {}, _defineProperty(_classNames, styles$n.start, !openStart && !full), _defineProperty(_classNames, styles$n.end, !openEnd && !full), _classNames))
4353
+ }, children);
4354
+ }
4355
+
4356
+ var styles$o = {"wrapper":"GradientBox-module_wrapper__1Jj7N","content":"GradientBox-module_content__96lDk","shadow":"GradientBox-module_shadow__2XilX","gradient":"GradientBox-module_gradient__31tJ-","long":"GradientBox-module_long__10s6v","root":"GradientBox-module_root__8Xn9W","withShadow":"GradientBox-module_withShadow__3mhPR","shadowDark":"GradientBox-module_shadowDark__3Tv0L","shadowLight":"GradientBox-module_shadowLight__Bieg6"};
4357
+
4358
+ function GradientBox(props) {
4359
+ var _classNames;
4360
+
4361
+ return /*#__PURE__*/React.createElement("div", {
4362
+ className: classNames(styles$o.root, (_classNames = {}, _defineProperty(_classNames, styles$o.gradient, props.motifAreaState.isContentPadded), _defineProperty(_classNames, styles$o["long"], props.coverInvisibleNextSection), _classNames)),
4363
+ style: {
4364
+ paddingTop: props.motifAreaState.paddingTop
4365
+ }
4366
+ }, /*#__PURE__*/React.createElement("div", {
4367
+ className: styles$o.wrapper
4368
+ }, /*#__PURE__*/React.createElement("div", {
4369
+ className: classNames(styles$o.shadow, props.inverted ? styles$o.shadowLight : styles$o.shadowDark, props.transitionStyles.boxShadow, props.transitionStyles["boxShadow-".concat(props.state)]),
4370
+ style: {
4371
+ top: props.motifAreaState.paddingTop,
4372
+ opacity: props.staticShadowOpacity
4373
+ }
4374
+ }), /*#__PURE__*/React.createElement("div", {
4375
+ className: styles$o.content
4376
+ }, props.children)));
4377
+ }
4378
+
4379
+ var styles$p = {"content":"CardBox-module_content__36v7J","wrapper":"CardBox-module_wrapper__3vnaH"};
4435
4380
 
4436
- function getAspectRatioRule(className) {
4437
- // WARNING: This CSS snippet needs to be kept in sync with the
4438
- // corresponding snippet in GeneratedMediaQueriesHelper
4439
- return "\n section.".concat(className, " {\n --backdrop-positioner-transform: var(--backdrop-positioner-min-ar-transform);\n --backdrop-positioner-width: var(--backdrop-positioner-min-ar-width);\n --backdrop-positioner-height: var(--backdrop-positioner-min-ar-height);\n\n --motif-placeholder-width: var(--motif-placeholder-min-ar-width);\n\n --motif-display-top: var(--motif-display-min-ar-top);\n --motif-display-bottom: var(--motif-display-min-ar-bottom);\n --motif-display-height: var(--motif-display-min-ar-height);\n }\n ");
4381
+ function CardBox(props) {
4382
+ return /*#__PURE__*/React.createElement("div", {
4383
+ className: styles$p.wrapper,
4384
+ style: {
4385
+ paddingTop: props.motifAreaState.paddingTop
4386
+ }
4387
+ }, /*#__PURE__*/React.createElement("div", {
4388
+ className: styles$p.content
4389
+ }, props.children));
4440
4390
  }
4441
4391
 
4392
+ var styles$q = {"darkContentSurfaceColor":"var(--theme-dark-content-surface-color, #101010)","lightContentSurfaceColor":"var(--theme-light-content-surface-color, #fff)","darkContentTextColor":"var(--theme-dark-content-text-color, #222)","lightContentTextColor":"var(--theme-light-content-text-color, #fff)","darkContentLinkColor":"var(--theme-dark-content-link-color, var(--theme-content-link-color, currentColor))","lightContentLinkColor":"var(--theme-light-content-link-color, var(--theme-content-link-color, currentColor))","card":"CardBoxWrapper-module_card__hvRUa scope-cardsAppearance","selfClear-left":"CardBoxWrapper-module_selfClear-left__2Dd26","selfClear-right":"CardBoxWrapper-module_selfClear-right__9kgvN","selfClear-both":"CardBoxWrapper-module_selfClear-both__2hwB7","cardStart":"CardBoxWrapper-module_cardStart__2NywG","cardEnd":"CardBoxWrapper-module_cardEnd__x4Ye6","cardBgWhite":"CardBoxWrapper-module_cardBgWhite__xXhg7","cardBgBlack":"CardBoxWrapper-module_cardBgBlack__Ahp3s"};
4442
4393
 
4394
+ function CardBoxWrapper(props) {
4395
+ if (outsideBox(props)) {
4396
+ return props.children;
4397
+ }
4443
4398
 
4444
- var v2 = /*#__PURE__*/Object.freeze({
4445
- __proto__: null,
4446
- Backdrop: Backdrop$1,
4447
- useMotifAreaState: useMotifAreaState$1,
4448
- useBackdrop: useBackdrop$1,
4449
- useBackdropSectionCustomProperties: useBackdropSectionCustomProperties$1,
4450
- useBackdropSectionClassNames: useBackdropSectionClassNames$1
4451
- });
4452
-
4453
- var styles$l = {"darkContentTextColor":"var(--theme-dark-content-text-color, #222)","lightContentTextColor":"var(--theme-light-content-text-color, #fff)","Section":"Section-module_Section__Yo58b","first":"Section-module_first__1vLBH","narrow":"Section-module_narrow__3Dawu","invert":"Section-module_invert__3_p7F"};
4454
-
4455
- var fadeInBgConceal = {"fade-duration":"0.5s","backdrop":"fadeInBgConceal-module_backdrop__11JGO","backdropInner":"fadeInBgConceal-module_backdropInner__1IAYD","backdrop-below":"fadeInBgConceal-module_backdrop-below__3E6Uk"};
4456
-
4457
- var fadeInBgFadeOut = {"fade-duration":"0.5s","backdrop":"fadeInBgFadeOut-module_backdrop__r0YXp","backdropInner":"fadeInBgFadeOut-module_backdropInner__IQp87","backdrop-below":"fadeInBgFadeOut-module_backdrop-below__2G-Ic","foreground":"fadeInBgFadeOut-module_foreground__Q2vkT","foreground-above":"fadeInBgFadeOut-module_foreground-above__3pmz9"};
4399
+ return /*#__PURE__*/React.createElement("div", {
4400
+ className: className$1(props)
4401
+ }, /*#__PURE__*/React.createElement(BackgroundColorProvider, {
4402
+ invert: true
4403
+ }, props.children));
4404
+ }
4458
4405
 
4459
- var fadeInBgFadeOutBg = {"fade-duration":"0.5s","backdrop":"fadeInBgFadeOutBg-module_backdrop__15ocl","backdropInner":"fadeInBgFadeOutBg-module_backdropInner__sAnz6","boxShadow":"fadeInBgFadeOutBg-module_boxShadow__xUKyj","boxShadow-above":"fadeInBgFadeOutBg-module_boxShadow-above__2bY0E","backdrop-below":"fadeInBgFadeOutBg-module_backdrop-below__1rDT6"};
4406
+ function outsideBox(props) {
4407
+ return props.position === 'sticky' || props.position === 'inline' && props.width > widths.md || props.customMargin;
4408
+ }
4460
4409
 
4461
- var fadeInBgScrollOut = {"fade-duration":"0.5s","backdrop":"fadeInBgScrollOut-module_backdrop__1bSsb","backdropInner":"fadeInBgScrollOut-module_backdropInner__3JZBG","backdropInner2":"fadeInBgScrollOut-module_backdropInner2__q-00L","foreground":"fadeInBgScrollOut-module_foreground__1ODH9","backdrop-below":"fadeInBgScrollOut-module_backdrop-below__2Dbkr"};
4410
+ function className$1(props) {
4411
+ return classNames(styles$q.card, props.inverted ? styles$q.cardBgBlack : styles$q.cardBgWhite, styles$q["selfClear-".concat(props.selfClear)], _defineProperty({}, styles$q.cardStart, !props.openStart), _defineProperty({}, styles$q.cardEnd, !props.openEnd));
4412
+ }
4462
4413
 
4463
- var fadeInConceal = {"fade-duration":"0.5s","backdrop":"fadeInConceal-module_backdrop__1zaRO","backdropInner":"fadeInConceal-module_backdropInner__1AIvq","backdrop-below":"fadeInConceal-module_backdrop-below__AWyQe","foreground":"fadeInConceal-module_foreground__3giM9","foreground-below":"fadeInConceal-module_foreground-below__2z5Op"};
4414
+ var components$1 = {
4415
+ shadow: {
4416
+ Shadow: GradientShadow,
4417
+ Box: GradientBox,
4418
+ BoxWrapper: InvisibleBoxWrapper
4419
+ },
4420
+ transparent: {
4421
+ Shadow: NoOpShadow,
4422
+ Box: CardBox,
4423
+ BoxWrapper: InvisibleBoxWrapper
4424
+ },
4425
+ cards: {
4426
+ Shadow: NoOpShadow,
4427
+ Box: CardBox,
4428
+ BoxWrapper: CardBoxWrapper
4429
+ }
4430
+ };
4431
+ function getAppearanceComponents(appearance) {
4432
+ return components$1[appearance || 'shadow'];
4433
+ }
4464
4434
 
4465
- var fadeInFadeOut = {"fade-duration":"0.5s","backdrop":"fadeInFadeOut-module_backdrop__Y4xOA","backdropInner":"fadeInFadeOut-module_backdropInner__1oRfP","backdrop-below":"fadeInFadeOut-module_backdrop-below__1h2I4","foreground":"fadeInFadeOut-module_foreground__1eleZ","foreground-above":"fadeInFadeOut-module_foreground-above__249wa","foreground-below":"fadeInFadeOut-module_foreground-below__3mE6f"};
4435
+ var Section = withInlineEditingDecorator('SectionDecorator', function Section(_ref) {
4436
+ var _section$transition;
4466
4437
 
4467
- var fadeInFadeOutBg = {"fade-duration":"0.5s","backdrop":"fadeInFadeOutBg-module_backdrop__2-IF3","backdropInner":"fadeInFadeOutBg-module_backdropInner__3r_bo","boxShadow":"fadeInFadeOutBg-module_boxShadow__3x7Ki","backdrop-below":"fadeInFadeOutBg-module_backdrop-below__4Ys_2","boxShadow-above":"fadeInFadeOutBg-module_boxShadow-above__3T2K5","foreground":"fadeInFadeOutBg-module_foreground__24f_M","foreground-below":"fadeInFadeOutBg-module_foreground-below__3pTRc"};
4438
+ var section = _ref.section,
4439
+ contentElements = _ref.contentElements,
4440
+ state = _ref.state,
4441
+ isScrollTarget = _ref.isScrollTarget,
4442
+ onActivate = _ref.onActivate,
4443
+ domIdPrefix = _ref.domIdPrefix;
4468
4444
 
4469
- var fadeInScrollOut = {"fade-duration":"0.5s","backdrop":"fadeInScrollOut-module_backdrop__2FhBb","backdropInner":"fadeInScrollOut-module_backdropInner__1OfNZ","backdropInner2":"fadeInScrollOut-module_backdropInner2__5bNPT","foreground":"fadeInScrollOut-module_foreground__3h0EX","foreground-below":"fadeInScrollOut-module_foreground-below__1Jcql","backdrop-below":"fadeInScrollOut-module_backdrop-below__3cRLH"};
4445
+ var _ref2 = useAdditionalSeedData('frontendVersion') === 2 ? v2 : v1,
4446
+ useBackdrop = _ref2.useBackdrop,
4447
+ useBackdropSectionClassNames = _ref2.useBackdropSectionClassNames,
4448
+ useBackdropSectionCustomProperties = _ref2.useBackdropSectionCustomProperties;
4470
4449
 
4471
- var revealConceal = {"backdrop":"revealConceal-module_backdrop__dLUhU utils-module_clip__34eot","backdropInner":"revealConceal-module_backdropInner__2k1Z-"};
4450
+ var backdrop = useBackdrop(section);
4451
+ var ref = useRef();
4452
+ useScrollTarget(ref, isScrollTarget);
4453
+ var transitionStyles = getTransitionStyles(section, section.previousSection, section.nextSection);
4454
+ var backdropSectionClassNames = useBackdropSectionClassNames(backdrop, {
4455
+ layout: section.layout,
4456
+ exposeMotifArea: section.exposeMotifArea,
4457
+ empty: !contentElements.length
4458
+ });
4459
+ var atmoAudioFile = useFileWithInlineRights({
4460
+ configuration: section,
4461
+ collectionName: 'audioFiles',
4462
+ propertyName: 'atmoAudioFileId'
4463
+ });
4464
+ return /*#__PURE__*/React.createElement("section", {
4465
+ id: "".concat(domIdPrefix, "-").concat(section.permaId),
4466
+ ref: ref,
4467
+ className: classNames(styles$k.Section, transitionStyles.section, backdropSectionClassNames, _defineProperty({}, styles$k.first, section.sectionIndex === 0), _defineProperty({}, styles$k.narrow, section.width === 'narrow'), _defineProperty({}, styles$k.invert, section.invert)),
4468
+ style: useBackdropSectionCustomProperties(backdrop)
4469
+ }, /*#__PURE__*/React.createElement(SectionLifecycleProvider, {
4470
+ onActivate: onActivate,
4471
+ entersWithFadeTransition: (_section$transition = section.transition) === null || _section$transition === void 0 ? void 0 : _section$transition.startsWith('fade')
4472
+ }, /*#__PURE__*/React.createElement(SectionViewTimelineProvider, {
4473
+ backdrop: backdrop
4474
+ }, /*#__PURE__*/React.createElement(SectionAtmo, {
4475
+ audioFile: atmoAudioFile
4476
+ }), /*#__PURE__*/React.createElement(SectionContents, {
4477
+ section: section,
4478
+ backdrop: backdrop,
4479
+ contentElements: contentElements,
4480
+ state: state,
4481
+ transitionStyles: transitionStyles
4482
+ }), /*#__PURE__*/React.createElement(SectionInlineFileRights, {
4483
+ section: section,
4484
+ backdrop: backdrop,
4485
+ atmoAudioFile: atmoAudioFile,
4486
+ state: state
4487
+ }))));
4488
+ });
4489
+ Section.defaultProps = {
4490
+ domIdPrefix: 'section'
4491
+ };
4472
4492
 
4473
- var revealFadeOut = {"fade-duration":"0.5s","backdrop":"revealFadeOut-module_backdrop___Q1QF utils-module_clip__34eot","backdropInner":"revealFadeOut-module_backdropInner__17qRn","foreground":"revealFadeOut-module_foreground__1GzBs","foreground-above":"revealFadeOut-module_foreground-above__3GxOf"};
4493
+ function SectionContents(_ref3) {
4494
+ var section = _ref3.section,
4495
+ backdrop = _ref3.backdrop,
4496
+ contentElements = _ref3.contentElements,
4497
+ state = _ref3.state,
4498
+ transitionStyles = _ref3.transitionStyles;
4474
4499
 
4475
- var revealFadeOutBg = {"fade-duration":"0.5s","backdrop":"revealFadeOutBg-module_backdrop__30OCF utils-module_clip__34eot","backdropInner":"revealFadeOutBg-module_backdropInner__3v3tM","boxShadow":"revealFadeOutBg-module_boxShadow__1NZRz","boxShadow-above":"revealFadeOutBg-module_boxShadow-above__2r4ov"};
4500
+ var _ref4 = useAdditionalSeedData('frontendVersion') === 2 ? v2 : v1,
4501
+ Backdrop = _ref4.Backdrop,
4502
+ useMotifAreaState = _ref4.useMotifAreaState;
4476
4503
 
4477
- var revealScrollOut = {"backdrop":"revealScrollOut-module_backdrop__2yOXd utils-module_clip__34eot","backdropInner":"revealScrollOut-module_backdropInner__211p3","backdropInner2":"revealScrollOut-module_backdropInner2__v6WqM","foreground":"revealScrollOut-module_foreground__3z-hw"};
4504
+ var _useSectionLifecycle = useSectionLifecycle(),
4505
+ shouldPrepare = _useSectionLifecycle.shouldPrepare;
4478
4506
 
4479
- var scrollInConceal = {"backdrop":"scrollInConceal-module_backdrop__2OJJC"};
4507
+ var sectionProperties = useMemo(function () {
4508
+ return {
4509
+ layout: section.layout,
4510
+ invert: section.invert,
4511
+ sectionIndex: section.sectionIndex
4512
+ };
4513
+ }, [section.layout, section.invert, section.sectionIndex]);
4514
+ var transitions = getEnterAndExitTransitions(section, section.previousSection, section.nextSection);
4480
4515
 
4481
- var scrollInFadeOut = {"fade-duration":"0.5s","backdrop":"scrollInFadeOut-module_backdrop__1vXJd","foreground":"scrollInFadeOut-module_foreground__3Ikxb","foreground-above":"scrollInFadeOut-module_foreground-above__6ipm-"};
4516
+ var _transitions = _slicedToArray(transitions, 2),
4517
+ exitTransition = _transitions[1];
4482
4518
 
4483
- var scrollInFadeOutBg = {"fade-duration":"0.5s","backdrop":"scrollInFadeOutBg-module_backdrop__zw95c","boxShadow":"scrollInFadeOutBg-module_boxShadow__3UxCQ","boxShadow-above":"scrollInFadeOutBg-module_boxShadow-above__3kfau"};
4519
+ var _useMotifAreaState = useMotifAreaState({
4520
+ updateOnScrollAndResize: shouldPrepare,
4521
+ exposeMotifArea: section.exposeMotifArea,
4522
+ transitions: transitions,
4523
+ empty: !contentElements.length,
4524
+ sectionTransition: section.transition,
4525
+ fullHeight: section.fullHeight
4526
+ }),
4527
+ _useMotifAreaState2 = _slicedToArray(_useMotifAreaState, 3),
4528
+ motifAreaState = _useMotifAreaState2[0],
4529
+ setMotifAreaRef = _useMotifAreaState2[1],
4530
+ setContentAreaRef = _useMotifAreaState2[2];
4484
4531
 
4485
- var scrollInScrollOut = {"backdrop":"scrollInScrollOut-module_backdrop__XzCge","foreground":"scrollInScrollOut-module_foreground__1yyY8"};
4532
+ var _getAppearanceCompone = getAppearanceComponents(section.appearance),
4533
+ Shadow = _getAppearanceCompone.Shadow,
4534
+ Box = _getAppearanceCompone.Box,
4535
+ BoxWrapper = _getAppearanceCompone.BoxWrapper;
4486
4536
 
4487
- var styles$m = {
4488
- fadeInBgConceal: fadeInBgConceal,
4489
- fadeInBgFadeOut: fadeInBgFadeOut,
4490
- fadeInBgFadeOutBg: fadeInBgFadeOutBg,
4491
- fadeInBgScrollOut: fadeInBgScrollOut,
4492
- fadeInConceal: fadeInConceal,
4493
- fadeInFadeOut: fadeInFadeOut,
4494
- fadeInFadeOutBg: fadeInFadeOutBg,
4495
- fadeInScrollOut: fadeInScrollOut,
4496
- revealConceal: revealConceal,
4497
- revealFadeOut: revealFadeOut,
4498
- revealFadeOutBg: revealFadeOutBg,
4499
- revealScrollOut: revealScrollOut,
4500
- scrollInConceal: scrollInConceal,
4501
- scrollInFadeOut: scrollInFadeOut,
4502
- scrollInFadeOutBg: scrollInFadeOutBg,
4503
- scrollInScrollOut: scrollInScrollOut
4504
- };
4505
- var enterTransitions = {
4506
- fade: 'fadeIn',
4507
- fadeBg: 'fadeInBg',
4508
- scroll: 'scrollIn',
4509
- scrollOver: 'scrollIn',
4510
- reveal: 'reveal',
4511
- beforeAfter: 'reveal'
4512
- };
4513
- var exitTransitions = {
4514
- fade: 'fadeOut',
4515
- fadeBg: 'fadeOutBg',
4516
- scroll: 'scrollOut',
4517
- scrollOver: 'conceal',
4518
- reveal: 'scrollOut',
4519
- beforeAfter: 'conceal'
4520
- };
4521
- function getTransitionNames() {
4522
- return Object.keys(exitTransitions);
4537
+ var staticShadowOpacity = percentToFraction(section.staticShadowOpacity, {
4538
+ defaultValue: 0.7
4539
+ });
4540
+ var dynamicShadowOpacity = percentToFraction(section.dynamicShadowOpacity, {
4541
+ defaultValue: 0.7
4542
+ });
4543
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Backdrop, {
4544
+ backdrop: backdrop,
4545
+ eagerLoad: section.sectionIndex === 0,
4546
+ onMotifAreaUpdate: setMotifAreaRef,
4547
+ state: state,
4548
+ transitionStyles: transitionStyles
4549
+ }, function (children) {
4550
+ return /*#__PURE__*/React.createElement(Shadow, {
4551
+ align: section.layout,
4552
+ inverted: section.invert,
4553
+ motifAreaState: motifAreaState,
4554
+ staticShadowOpacity: staticShadowOpacity,
4555
+ dynamicShadowOpacity: dynamicShadowOpacity
4556
+ }, children);
4557
+ }), /*#__PURE__*/React.createElement(Foreground, {
4558
+ transitionStyles: transitionStyles,
4559
+ state: state,
4560
+ minHeight: motifAreaState.minHeight,
4561
+ paddingBottom: !endsWithFullWidthElement(contentElements),
4562
+ heightMode: heightMode(section)
4563
+ }, /*#__PURE__*/React.createElement(Box, {
4564
+ inverted: section.invert,
4565
+ coverInvisibleNextSection: exitTransition.startsWith('fade'),
4566
+ transitionStyles: transitionStyles,
4567
+ state: state,
4568
+ motifAreaState: motifAreaState,
4569
+ staticShadowOpacity: staticShadowOpacity
4570
+ }, /*#__PURE__*/React.createElement(BackgroundColorProvider, {
4571
+ dark: !section.invert
4572
+ }, /*#__PURE__*/React.createElement(Layout, {
4573
+ sectionId: section.id,
4574
+ items: contentElements,
4575
+ appearance: section.appearance,
4576
+ contentAreaRef: setContentAreaRef,
4577
+ sectionProps: sectionProperties
4578
+ }, function (children, boxProps) {
4579
+ return /*#__PURE__*/React.createElement(BoxWrapper, Object.assign({}, boxProps, {
4580
+ inverted: section.invert
4581
+ }), children);
4582
+ })))));
4523
4583
  }
4524
- function getAvailableTransitionNames(section, previousSection) {
4525
- if (!section.fullHeight || !previousSection.fullHeight) {
4526
- return getTransitionNames().filter(function (name) {
4527
- return !name.startsWith('fade');
4528
- });
4529
- }
4530
4584
 
4531
- return getTransitionNames();
4585
+ function ConnectedSection(props) {
4586
+ var contentElements = useSectionContentElements({
4587
+ sectionId: props.section.id,
4588
+ layout: props.section.layout
4589
+ });
4590
+ return /*#__PURE__*/React.createElement(Section, Object.assign({}, props, {
4591
+ contentElements: contentElements
4592
+ }));
4532
4593
  }
4533
- function getTransitionStyles(section, previousSection, nextSection) {
4534
- var name = getTransitionStylesName(section, previousSection, nextSection);
4535
4594
 
4536
- if (!styles$m[name]) {
4537
- throw new Error("Unknown transition ".concat(name));
4595
+ function heightMode(section) {
4596
+ if (section.fullHeight) {
4597
+ if (section.transition.startsWith('fade') && section.previousSection || section.nextSection && section.nextSection.transition.startsWith('fade')) {
4598
+ return 'fullFade';
4599
+ } else {
4600
+ return 'full';
4601
+ }
4538
4602
  }
4539
4603
 
4540
- return styles$m[name];
4604
+ return 'dynamic';
4541
4605
  }
4542
- function getEnterAndExitTransitions(section, previousSection, nextSection) {
4543
- return [enterTransitions[getTransitionName(previousSection, section)], exitTransitions[getTransitionName(section, nextSection)]];
4606
+
4607
+ function endsWithFullWidthElement(elements) {
4608
+ var lastElement = elements[elements.length - 1];
4609
+ return lastElement && lastElement.position === 'inline' && lastElement.width === widths.full;
4544
4610
  }
4545
- function getTransitionStylesName(section, previousSection, nextSection) {
4546
- var _getEnterAndExitTrans = getEnterAndExitTransitions(section, previousSection, nextSection),
4547
- _getEnterAndExitTrans2 = _slicedToArray(_getEnterAndExitTrans, 2),
4548
- enter = _getEnterAndExitTrans2[0],
4549
- exit = _getEnterAndExitTrans2[1];
4550
4611
 
4551
- return "".concat(enter).concat(capitalize(exit));
4612
+ function percentToFraction(value, _ref5) {
4613
+ var defaultValue = _ref5.defaultValue;
4614
+ return typeof value !== 'undefined' ? value / 100 : defaultValue;
4552
4615
  }
4553
4616
 
4554
- function getTransitionName(previousSection, section) {
4555
- if (!section || !previousSection) {
4556
- return 'scroll';
4557
- }
4617
+ var CurrentChapterContext = React.createContext();
4618
+ var CurrentSectionIndexStateContext = React.createContext();
4619
+ function CurrentSectionProvider(_ref) {
4620
+ var children = _ref.children;
4558
4621
 
4559
- if ((!section.fullHeight || !previousSection.fullHeight) && section.transition.startsWith('fade')) {
4560
- return 'scroll';
4561
- }
4622
+ var _useState = useState(0),
4623
+ _useState2 = _slicedToArray(_useState, 2),
4624
+ currentSectionIndex = _useState2[0],
4625
+ setCurrentSectionIndex = _useState2[1];
4562
4626
 
4563
- return section.transition;
4627
+ var currentSectionIndexState = useMemo(function () {
4628
+ return [currentSectionIndex, setCurrentSectionIndex];
4629
+ }, [currentSectionIndex, setCurrentSectionIndex]);
4630
+ var sections = useSectionsWithChapter();
4631
+ var currentSection = sections[currentSectionIndex];
4632
+ return /*#__PURE__*/React.createElement(CurrentChapterContext.Provider, {
4633
+ value: currentSection === null || currentSection === void 0 ? void 0 : currentSection.chapter
4634
+ }, /*#__PURE__*/React.createElement(CurrentSectionIndexStateContext.Provider, {
4635
+ value: currentSectionIndexState
4636
+ }, children));
4564
4637
  }
4638
+ /**
4639
+ * Returns chapter containing the current scroll position.
4640
+ *
4641
+ * @example
4642
+ *
4643
+ * const chapter = useCurrentChapter();
4644
+ * chapter // =>
4645
+ * {
4646
+ * id: 3,
4647
+ * permaId: 5,
4648
+ * title: 'Chapter 1',
4649
+ * summary: 'An introductory chapter',
4650
+ * chapterSlug: 'chapter-1'
4651
+ * }
4652
+ */
4565
4653
 
4566
- function capitalize(string) {
4567
- return string.charAt(0).toUpperCase() + string.slice(1);
4654
+ function useCurrentChapter() {
4655
+ return useContext(CurrentChapterContext);
4656
+ }
4657
+ function useCurrentSectionIndexState() {
4658
+ return useContext(CurrentSectionIndexStateContext);
4568
4659
  }
4569
4660
 
4570
- function NoOpShadow(props) {
4571
- return /*#__PURE__*/React.createElement("div", null, props.children);
4661
+ function usePostMessageListener(receiveData) {
4662
+ useEffect(function () {
4663
+ if (window.parent !== window) {
4664
+ window.addEventListener('message', receive);
4665
+ }
4666
+
4667
+ return function () {
4668
+ return window.removeEventListener('message', receive);
4669
+ };
4670
+
4671
+ function receive(message) {
4672
+ if (window.location.href.indexOf(message.origin) === 0) {
4673
+ receiveData(message.data);
4674
+ }
4675
+ }
4676
+ }, [receiveData]);
4572
4677
  }
4573
4678
 
4574
- var styles$n = {"static":"GradientShadow-module_static__rXNpZ","dynamic":"GradientShadow-module_dynamic__2v2JU","align-right":"GradientShadow-module_align-right__3iXZs","dark":"GradientShadow-module_dark__1YuV5","align-left":"GradientShadow-module_align-left__3qcNM","align-center":"GradientShadow-module_align-center__2C7cl","align-centerRagged":"GradientShadow-module_align-centerRagged__2-iv8","light":"GradientShadow-module_light__Vn92v","shadow":"GradientShadow-module_shadow__2UiDH"};
4679
+ var contentStyles = {"Content":"Content-module_Content__m7urk"};
4575
4680
 
4576
- function GradientShadow(props) {
4577
- // Hide static shadow if motif area intersects with content area.
4578
- var staticShadowOpacity = props.motifAreaState.isContentPadded ? 0 : props.staticShadowOpacity; // If motif area intersects with content area horizontally, fade in
4579
- // shadow soon as the content has been scrolled far enough to start
4580
- // intersecting with the motif area vertically.
4681
+ var styles$r = {"focusOutlineDisabled":"focusOutline-module_focusOutlineDisabled__KV7d-"};
4581
4682
 
4582
- var opacityFactor = // Make shadow reach full opacity when content has been scrolled
4583
- // up half way across the motif area.
4584
- roundToFirstDecimalPlace(Math.min(1, props.motifAreaState.intersectionRatioY * 2));
4585
- return /*#__PURE__*/React.createElement("div", {
4586
- className: classNames(styles$n["align-".concat(props.align)], props.inverted ? styles$n.light : styles$n.dark)
4587
- }, /*#__PURE__*/React.createElement("div", {
4588
- className: styles$n.dynamic,
4589
- style: {
4590
- opacity: props.dynamicShadowOpacity * opacityFactor
4683
+ var FocusVisibleContext = createContext();
4684
+ function useFocusOutlineVisible() {
4685
+ return useContext(FocusVisibleContext);
4686
+ }
4687
+ function FocusOutlineProvider(_ref) {
4688
+ var children = _ref.children;
4689
+
4690
+ var _useState = useState(),
4691
+ _useState2 = _slicedToArray(_useState, 2),
4692
+ value = _useState2[0],
4693
+ setValue = _useState2[1];
4694
+
4695
+ useEffect(function () {
4696
+ document.body.addEventListener('keydown', enable);
4697
+ document.body.addEventListener('mousedown', disable);
4698
+ disable();
4699
+ return function () {
4700
+ document.body.removeEventListener('keydown', enable);
4701
+ document.body.removeEventListener('mousedown', disable);
4702
+ };
4703
+
4704
+ function enable() {
4705
+ document.body.classList.remove(styles$r.focusOutlineDisabled);
4706
+ setValue(true);
4591
4707
  }
4592
- }, /*#__PURE__*/React.createElement(Fullscreen, null)), /*#__PURE__*/React.createElement("div", {
4593
- className: styles$n["static"],
4594
- style: {
4595
- opacity: staticShadowOpacity
4708
+
4709
+ function disable() {
4710
+ document.body.classList.add(styles$r.focusOutlineDisabled);
4711
+ setValue(false);
4596
4712
  }
4597
- }, /*#__PURE__*/React.createElement(Fullscreen, null)), props.children);
4713
+ }, []);
4714
+ return /*#__PURE__*/React.createElement(FocusVisibleContext.Provider, {
4715
+ value: value
4716
+ }, children);
4598
4717
  }
4599
- GradientShadow.defaultProps = {
4600
- opacity: 0.7,
4601
- align: 'left'
4602
- };
4603
4718
 
4604
- function roundToFirstDecimalPlace(value) {
4605
- return Math.round(value * 10) / 10;
4606
- }
4719
+ var PhonePlatformProvider = withInlineEditingAlternative('PhonePlatformProvider', function PhonePlatformProvider(_ref) {
4720
+ var children = _ref.children;
4721
+ var isPhonePlatform = useBrowserFeature('phone platform');
4722
+ return /*#__PURE__*/React.createElement(PhonePlatformContext.Provider, {
4723
+ value: isPhonePlatform
4724
+ }, children);
4725
+ });
4607
4726
 
4608
- var styles$o = {"start":"InvisibleBoxWrapper-module_start__F1nZ7","end":"InvisibleBoxWrapper-module_end__nphD-"};
4727
+ var AudioFocusContext = createContext();
4728
+ function AudioFocusProvider(_ref) {
4729
+ var children = _ref.children;
4609
4730
 
4610
- function InvisibleBoxWrapper(_ref) {
4611
- var _classNames;
4731
+ var _useState = useState([]),
4732
+ _useState2 = _slicedToArray(_useState, 2),
4733
+ currentKey = _useState2[0],
4734
+ setCurrentKey = _useState2[1];
4612
4735
 
4613
- var position = _ref.position,
4614
- openStart = _ref.openStart,
4615
- openEnd = _ref.openEnd,
4616
- children = _ref.children;
4617
- return /*#__PURE__*/React.createElement("div", {
4618
- className: classNames((_classNames = {}, _defineProperty(_classNames, styles$o.start, !openStart && position !== 'full'), _defineProperty(_classNames, styles$o.end, !openEnd && position !== 'full'), _classNames))
4736
+ var value = useMemo(function () {
4737
+ return [currentKey, setCurrentKey];
4738
+ }, [currentKey, setCurrentKey]);
4739
+ return /*#__PURE__*/React.createElement(AudioFocusContext.Provider, {
4740
+ value: value
4619
4741
  }, children);
4620
4742
  }
4743
+ /**
4744
+ * Prevent parallel playback of multiple media elements.
4745
+ *
4746
+ * @param {Object} options
4747
+ * @param {number} options.key - Unique id used to identify the element.
4748
+ * @param {boolean} options.request - Set to true to request audio focus.
4749
+ * @param {Function} options.onLost -
4750
+ * Callback that will be invoked if another element requests audio
4751
+ * focus, thereby preempting your hold of audio focus. The callback
4752
+ * should pause the element.
4753
+ */
4621
4754
 
4622
- var styles$p = {"wrapper":"GradientBox-module_wrapper__1Jj7N","content":"GradientBox-module_content__96lDk","shadow":"GradientBox-module_shadow__2XilX","gradient":"GradientBox-module_gradient__31tJ-","long":"GradientBox-module_long__10s6v","root":"GradientBox-module_root__8Xn9W","withShadow":"GradientBox-module_withShadow__3mhPR","shadowDark":"GradientBox-module_shadowDark__3Tv0L","shadowLight":"GradientBox-module_shadowLight__Bieg6"};
4755
+ function useAudioFocus(_ref2) {
4756
+ var key = _ref2.key,
4757
+ request = _ref2.request,
4758
+ onLost = _ref2.onLost;
4759
+ var wasRequested = usePrevious(request);
4623
4760
 
4624
- function GradientBox(props) {
4625
- var _classNames;
4761
+ var _useContext = useContext(AudioFocusContext),
4762
+ _useContext2 = _slicedToArray(_useContext, 2),
4763
+ currentKey = _useContext2[0],
4764
+ setCurrentKey = _useContext2[1];
4626
4765
 
4627
- return /*#__PURE__*/React.createElement("div", {
4628
- className: classNames(styles$p.root, (_classNames = {}, _defineProperty(_classNames, styles$p.gradient, props.motifAreaState.isContentPadded), _defineProperty(_classNames, styles$p["long"], props.coverInvisibleNextSection), _classNames)),
4629
- style: {
4630
- paddingTop: props.motifAreaState.paddingTop
4766
+ var previousKey = usePrevious(currentKey);
4767
+ useEffect(function () {
4768
+ if (request && !wasRequested) {
4769
+ setCurrentKey(key);
4631
4770
  }
4632
- }, /*#__PURE__*/React.createElement("div", {
4633
- className: styles$p.wrapper
4634
- }, /*#__PURE__*/React.createElement("div", {
4635
- className: classNames(styles$p.shadow, props.inverted ? styles$p.shadowLight : styles$p.shadowDark, props.transitionStyles.boxShadow, props.transitionStyles["boxShadow-".concat(props.state)]),
4636
- style: {
4637
- top: props.motifAreaState.paddingTop,
4638
- opacity: props.staticShadowOpacity
4771
+ }, [request, wasRequested, setCurrentKey, key]);
4772
+ useEffect(function () {
4773
+ if (previousKey === key && currentKey !== key) {
4774
+ onLost();
4639
4775
  }
4640
- }), /*#__PURE__*/React.createElement("div", {
4641
- className: styles$p.content
4642
- }, props.children)));
4776
+ }, [currentKey, previousKey, key, onLost]);
4643
4777
  }
4644
4778
 
4645
- var styles$q = {"content":"CardBox-module_content__36v7J","wrapper":"CardBox-module_wrapper__3vnaH"};
4646
-
4647
- function CardBox(props) {
4648
- return /*#__PURE__*/React.createElement("div", {
4649
- className: styles$q.wrapper,
4650
- style: {
4651
- paddingTop: props.motifAreaState.paddingTop
4652
- }
4653
- }, /*#__PURE__*/React.createElement("div", {
4654
- className: styles$q.content
4655
- }, props.children));
4779
+ var ConsentContext = createContext();
4780
+ function ConsentProvider(_ref) {
4781
+ var consent = _ref.consent,
4782
+ children = _ref.children;
4783
+ return /*#__PURE__*/React.createElement(ConsentContext.Provider, {
4784
+ value: consent
4785
+ }, children);
4656
4786
  }
4787
+ function useConsentRequested() {
4788
+ var consent = useContext(ConsentContext);
4789
+
4790
+ var _useState = useState({}),
4791
+ _useState2 = _slicedToArray(_useState, 2),
4792
+ request = _useState2[0],
4793
+ setRequest = _useState2[1];
4657
4794
 
4658
- var styles$r = {"darkContentSurfaceColor":"var(--theme-dark-content-surface-color, #101010)","lightContentSurfaceColor":"var(--theme-light-content-surface-color, #fff)","darkContentTextColor":"var(--theme-dark-content-text-color, #222)","lightContentTextColor":"var(--theme-light-content-text-color, #fff)","card":"CardBoxWrapper-module_card__hvRUa","cardStart":"CardBoxWrapper-module_cardStart__2NywG","cardEnd":"CardBoxWrapper-module_cardEnd__x4Ye6","cardBgWhite":"CardBoxWrapper-module_cardBgWhite__xXhg7","cardBgBlack":"CardBoxWrapper-module_cardBgBlack__Ahp3s"};
4795
+ useIsomorphicLayoutEffect(function () {
4796
+ var unmounted = false;
4659
4797
 
4660
- var positionOutsideBox = ['sticky', 'wide', 'full'];
4661
- function CardBoxWrapper(props) {
4662
- return /*#__PURE__*/React.createElement("div", {
4663
- className: className$1(props)
4664
- }, /*#__PURE__*/React.createElement(BackgroundColorProvider, {
4665
- invert: !positionOutsideBox.includes(props.position)
4666
- }, props.children));
4667
- }
4798
+ _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
4799
+ var _yield$consent$reques, vendors, _acceptAll, _denyAll, _save;
4668
4800
 
4669
- function className$1(props) {
4670
- if (positionOutsideBox.includes(props.position)) {
4671
- return undefined;
4672
- }
4801
+ return regenerator.wrap(function _callee$(_context) {
4802
+ while (1) {
4803
+ switch (_context.prev = _context.next) {
4804
+ case 0:
4805
+ _context.next = 2;
4806
+ return consent.requested();
4807
+
4808
+ case 2:
4809
+ _yield$consent$reques = _context.sent;
4810
+ vendors = _yield$consent$reques.vendors;
4811
+ _acceptAll = _yield$consent$reques.acceptAll;
4812
+ _denyAll = _yield$consent$reques.denyAll;
4813
+ _save = _yield$consent$reques.save;
4814
+
4815
+ if (!unmounted) {
4816
+ setRequest({
4817
+ vendors: vendors,
4818
+ acceptAll: function acceptAll() {
4819
+ _acceptAll();
4673
4820
 
4674
- return classNames(styles$r.card, props.inverted ? styles$r.cardBgBlack : styles$r.cardBgWhite, _defineProperty({}, styles$r.cardStart, !props.openStart), _defineProperty({}, styles$r.cardEnd, !props.openEnd));
4675
- }
4821
+ setRequest({});
4822
+ },
4823
+ denyAll: function denyAll() {
4824
+ _denyAll();
4676
4825
 
4677
- var components$1 = {
4678
- shadow: {
4679
- Shadow: GradientShadow,
4680
- Box: GradientBox,
4681
- BoxWrapper: InvisibleBoxWrapper
4682
- },
4683
- transparent: {
4684
- Shadow: NoOpShadow,
4685
- Box: CardBox,
4686
- BoxWrapper: InvisibleBoxWrapper
4687
- },
4688
- cards: {
4689
- Shadow: NoOpShadow,
4690
- Box: CardBox,
4691
- BoxWrapper: CardBoxWrapper
4692
- }
4693
- };
4694
- function getAppearanceComponents(appearance) {
4695
- return components$1[appearance || 'shadow'];
4696
- }
4826
+ setRequest({});
4827
+ },
4828
+ save: function save(decisions) {
4829
+ _save(decisions);
4697
4830
 
4698
- var Section = withInlineEditingDecorator('SectionDecorator', function Section(_ref) {
4699
- var section = _ref.section,
4700
- contentElements = _ref.contentElements,
4701
- state = _ref.state,
4702
- isScrollTarget = _ref.isScrollTarget,
4703
- onActivate = _ref.onActivate,
4704
- domIdPrefix = _ref.domIdPrefix;
4831
+ setRequest({});
4832
+ }
4833
+ });
4834
+ }
4705
4835
 
4706
- var _ref2 = useAdditionalSeedData('frontendVersion') === 2 ? v2 : v1,
4707
- useBackdrop = _ref2.useBackdrop,
4708
- useBackdropSectionClassNames = _ref2.useBackdropSectionClassNames,
4709
- useBackdropSectionCustomProperties = _ref2.useBackdropSectionCustomProperties;
4836
+ case 8:
4837
+ case "end":
4838
+ return _context.stop();
4839
+ }
4840
+ }
4841
+ }, _callee);
4842
+ }))();
4710
4843
 
4711
- var backdrop = useBackdrop(section);
4712
- var ref = useRef();
4713
- useScrollTarget(ref, isScrollTarget);
4714
- var transitionStyles = getTransitionStyles(section, section.previousSection, section.nextSection);
4715
- var backdropSectionClassNames = useBackdropSectionClassNames(backdrop, {
4716
- layout: section.layout,
4717
- exposeMotifArea: section.exposeMotifArea,
4718
- empty: !contentElements.length
4719
- });
4720
- return /*#__PURE__*/React.createElement("section", {
4721
- id: "".concat(domIdPrefix, "-").concat(section.permaId),
4722
- ref: ref,
4723
- className: classNames(styles$l.Section, transitionStyles.section, backdropSectionClassNames, _defineProperty({}, styles$l.first, section.sectionIndex === 0), _defineProperty({}, styles$l.narrow, section.width === 'narrow'), _defineProperty({}, styles$l.invert, section.invert)),
4724
- style: useBackdropSectionCustomProperties(backdrop)
4725
- }, /*#__PURE__*/React.createElement(SectionLifecycleProvider, {
4726
- onActivate: onActivate,
4727
- isLast: !section.nextSection
4728
- }, /*#__PURE__*/React.createElement(SectionAtmo, {
4729
- audioFilePermaId: section.atmoAudioFileId
4730
- }), /*#__PURE__*/React.createElement(SectionContents, {
4731
- section: section,
4732
- backdrop: backdrop,
4733
- contentElements: contentElements,
4734
- state: state,
4735
- transitionStyles: transitionStyles
4736
- })));
4737
- });
4738
- Section.defaultProps = {
4739
- domIdPrefix: 'section'
4740
- };
4844
+ return function () {
4845
+ return unmounted = true;
4846
+ };
4847
+ }, [consent]);
4848
+ return request;
4849
+ }
4850
+ function useConsentGiven(vendorName) {
4851
+ var consent = useContext(ConsentContext);
4741
4852
 
4742
- function SectionContents(_ref3) {
4743
- var section = _ref3.section,
4744
- backdrop = _ref3.backdrop,
4745
- contentElements = _ref3.contentElements,
4746
- state = _ref3.state,
4747
- transitionStyles = _ref3.transitionStyles;
4853
+ var _useContentElementEdi = useContentElementEditorState(),
4854
+ isEditable = _useContentElementEdi.isEditable;
4748
4855
 
4749
- var _ref4 = useAdditionalSeedData('frontendVersion') === 2 ? v2 : v1,
4750
- Backdrop = _ref4.Backdrop,
4751
- useMotifAreaState = _ref4.useMotifAreaState;
4856
+ var isStaticPreview = useIsStaticPreview();
4752
4857
 
4753
- var _useSectionLifecycle = useSectionLifecycle(),
4754
- shouldPrepare = _useSectionLifecycle.shouldPrepare;
4858
+ var _useState3 = useState(isEditable || isStaticPreview),
4859
+ _useState4 = _slicedToArray(_useState3, 2),
4860
+ consentGiven = _useState4[0],
4861
+ setConsentGiven = _useState4[1];
4755
4862
 
4756
- var sectionProperties = useMemo(function () {
4757
- return {
4758
- layout: section.layout,
4759
- invert: section.invert,
4760
- sectionIndex: section.sectionIndex
4761
- };
4762
- }, [section.layout, section.invert, section.sectionIndex]);
4763
- var transitions = getEnterAndExitTransitions(section, section.previousSection, section.nextSection);
4863
+ useIsomorphicLayoutEffect(function () {
4864
+ var unmounted = false;
4764
4865
 
4765
- var _transitions = _slicedToArray(transitions, 2),
4766
- exitTransition = _transitions[1];
4866
+ _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2() {
4867
+ var result;
4868
+ return regenerator.wrap(function _callee2$(_context2) {
4869
+ while (1) {
4870
+ switch (_context2.prev = _context2.next) {
4871
+ case 0:
4872
+ if (!(!vendorName || isEditable || isStaticPreview)) {
4873
+ _context2.next = 2;
4874
+ break;
4875
+ }
4767
4876
 
4768
- var _useMotifAreaState = useMotifAreaState({
4769
- updateOnScrollAndResize: shouldPrepare,
4770
- exposeMotifArea: section.exposeMotifArea,
4771
- transitions: transitions,
4772
- empty: !contentElements.length,
4773
- sectionTransition: section.transition,
4774
- fullHeight: section.fullHeight
4775
- }),
4776
- _useMotifAreaState2 = _slicedToArray(_useMotifAreaState, 3),
4777
- motifAreaState = _useMotifAreaState2[0],
4778
- setMotifAreaRef = _useMotifAreaState2[1],
4779
- setContentAreaRef = _useMotifAreaState2[2];
4877
+ return _context2.abrupt("return");
4780
4878
 
4781
- var _getAppearanceCompone = getAppearanceComponents(section.appearance),
4782
- Shadow = _getAppearanceCompone.Shadow,
4783
- Box = _getAppearanceCompone.Box,
4784
- BoxWrapper = _getAppearanceCompone.BoxWrapper;
4879
+ case 2:
4880
+ _context2.next = 4;
4881
+ return consent.requireAccepted(vendorName);
4785
4882
 
4786
- var staticShadowOpacity = percentToFraction(section.staticShadowOpacity, {
4787
- defaultValue: 0.7
4788
- });
4789
- var dynamicShadowOpacity = percentToFraction(section.dynamicShadowOpacity, {
4790
- defaultValue: 0.7
4791
- });
4792
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Backdrop, Object.assign({}, section.backdrop, {
4793
- effects: section.backdropEffects,
4794
- effectsMobile: section.backdropEffectsMobile,
4795
- backdrop: backdrop,
4796
- eagerLoad: section.sectionIndex === 0,
4797
- onMotifAreaUpdate: setMotifAreaRef,
4798
- state: state,
4799
- transitionStyles: transitionStyles
4800
- }), function (children) {
4801
- return /*#__PURE__*/React.createElement(Shadow, {
4802
- align: section.layout,
4803
- inverted: section.invert,
4804
- motifAreaState: motifAreaState,
4805
- staticShadowOpacity: staticShadowOpacity,
4806
- dynamicShadowOpacity: dynamicShadowOpacity
4807
- }, children);
4808
- }), /*#__PURE__*/React.createElement(Foreground, {
4809
- transitionStyles: transitionStyles,
4810
- state: state,
4811
- minHeight: motifAreaState.minHeight,
4812
- paddingBottom: !endsWithFullWidthElement(contentElements),
4813
- heightMode: heightMode(section)
4814
- }, /*#__PURE__*/React.createElement(Box, {
4815
- inverted: section.invert,
4816
- coverInvisibleNextSection: exitTransition.startsWith('fade'),
4817
- transitionStyles: transitionStyles,
4818
- state: state,
4819
- motifAreaState: motifAreaState,
4820
- staticShadowOpacity: staticShadowOpacity
4821
- }, /*#__PURE__*/React.createElement(BackgroundColorProvider, {
4822
- dark: !section.invert
4823
- }, /*#__PURE__*/React.createElement(Layout, {
4824
- sectionId: section.id,
4825
- items: contentElements,
4826
- appearance: section.appearance,
4827
- contentAreaRef: setContentAreaRef,
4828
- sectionProps: sectionProperties
4829
- }, function (children, boxProps) {
4830
- return /*#__PURE__*/React.createElement(BoxWrapper, Object.assign({}, boxProps, {
4831
- inverted: section.invert
4832
- }), children);
4833
- })))));
4834
- }
4883
+ case 4:
4884
+ result = _context2.sent;
4835
4885
 
4836
- function ConnectedSection(props) {
4837
- var contentElements = useSectionContentElements({
4838
- sectionId: props.section.id
4839
- });
4840
- return /*#__PURE__*/React.createElement(Section, Object.assign({}, props, {
4841
- contentElements: contentElements
4842
- }));
4843
- }
4886
+ if (!unmounted && result === 'fulfilled') {
4887
+ setConsentGiven(true);
4888
+ }
4844
4889
 
4845
- function heightMode(section) {
4846
- if (section.fullHeight) {
4847
- if (section.transition.startsWith('fade') && section.previousSection || section.nextSection && section.nextSection.transition.startsWith('fade')) {
4848
- return 'fullFade';
4849
- } else {
4850
- return 'full';
4851
- }
4852
- }
4890
+ case 6:
4891
+ case "end":
4892
+ return _context2.stop();
4893
+ }
4894
+ }
4895
+ }, _callee2);
4896
+ }))();
4853
4897
 
4854
- return 'dynamic';
4898
+ return function () {
4899
+ return unmounted = true;
4900
+ };
4901
+ }, [consent, vendorName]);
4902
+ var giveConsent = useCallback(function () {
4903
+ return consent.accept(vendorName);
4904
+ }, [consent, vendorName]);
4905
+ return [consentGiven, giveConsent];
4855
4906
  }
4856
4907
 
4857
- function endsWithFullWidthElement(elements) {
4858
- var lastElement = elements[elements.length - 1];
4859
- return lastElement && lastElement.position === 'full';
4860
- }
4908
+ var styles$s = {"optIn":"OptIn-module_optIn__3nHo1","optInIcon":"OptIn-module_optInIcon__3-81I","optInMessage":"OptIn-module_optInMessage__1OfTR","optInButton":"OptIn-module_optInButton__1LhtX"};
4861
4909
 
4862
- function percentToFraction(value, _ref5) {
4863
- var defaultValue = _ref5.defaultValue;
4864
- return typeof value !== 'undefined' ? value / 100 : defaultValue;
4865
- }
4910
+ function _extends() {
4911
+ _extends = Object.assign || function (target) {
4912
+ for (var i = 1; i < arguments.length; i++) {
4913
+ var source = arguments[i];
4866
4914
 
4867
- var CurrentChapterContext = React.createContext();
4868
- var CurrentSectionIndexStateContext = React.createContext();
4869
- function CurrentSectionProvider(_ref) {
4870
- var children = _ref.children;
4915
+ for (var key in source) {
4916
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
4917
+ target[key] = source[key];
4918
+ }
4919
+ }
4920
+ }
4871
4921
 
4872
- var _useState = useState(0),
4873
- _useState2 = _slicedToArray(_useState, 2),
4874
- currentSectionIndex = _useState2[0],
4875
- setCurrentSectionIndex = _useState2[1];
4922
+ return target;
4923
+ };
4876
4924
 
4877
- var currentSectionIndexState = useMemo(function () {
4878
- return [currentSectionIndex, setCurrentSectionIndex];
4879
- }, [currentSectionIndex, setCurrentSectionIndex]);
4880
- var sections = useSectionsWithChapter();
4881
- var currentSection = sections[currentSectionIndex];
4882
- return /*#__PURE__*/React.createElement(CurrentChapterContext.Provider, {
4883
- value: currentSection === null || currentSection === void 0 ? void 0 : currentSection.chapter
4884
- }, /*#__PURE__*/React.createElement(CurrentSectionIndexStateContext.Provider, {
4885
- value: currentSectionIndexState
4886
- }, children));
4925
+ return _extends.apply(this, arguments);
4887
4926
  }
4927
+ var OptInIcon = (function (_ref) {
4928
+ var _ref$styles = _ref.styles,
4929
+ props = _objectWithoutProperties(_ref, ["styles"]);
4930
+
4931
+ return /*#__PURE__*/React.createElement("svg", _extends({
4932
+ xmlns: "http://www.w3.org/2000/svg",
4933
+ viewBox: "0 0 131 95"
4934
+ }, props), /*#__PURE__*/React.createElement("path", {
4935
+ d: "M32.01.01C46.678-.01 61.345.009 76.014.002 83.007.007 90-.009 96.99.011c.015 9.157.014 18.316 0 27.474-1.357.073-2.706.259-4.048.478-.01-7.986 0-15.975-.004-23.961-18.958-.003-37.917-.003-56.875 0l-.001 28.916c.01 2.37-.022 4.742.016 7.113 6.173-.025 12.348-.006 18.52-.011 5.804.01 11.609-.022 17.41.013-1 1.28-2.001 2.56-2.844 3.948-12.372.024-24.748-.011-37.12.019-.06-.365-.03-.735-.034-1.1V17.497c.007-5.83-.024-11.659.001-17.486zm17.617 8.004a5.999 5.999 0 014.359 1.49c1.273 1.116 2.048 2.8 2.013 4.498.042 1.806-.845 3.59-2.263 4.702-1.271 1.013-2.975 1.483-4.583 1.228a5.88 5.88 0 01-3.479-1.785c-1.44-1.459-2.013-3.695-1.475-5.67.6-2.448 2.905-4.346 5.428-4.463zm22.106 7.758c.181-.258.332-.54.547-.772 2.325 3.868 4.683 7.717 7.02 11.578.891 1.503 1.85 2.973 2.7 4.5a35.062 35.062 0 00-5.646 3.779c-.154.162-.387.14-.592.143-10.585-.014-21.174.014-31.762-.015.088-.228.308-.367.47-.542 3.79-3.745 7.58-7.484 11.365-11.232.098-.085.217-.265.366-.15 2.65 1.308 5.3 2.62 7.951 3.928 2.545-3.73 5.052-7.48 7.581-11.217zM0 21.042c.256-.058.517-.039.775-.039 9.175.007 18.349-.007 27.523.007l.064.076c.017 1.308-.012 2.618.015 3.927-5.416.038-10.834.001-16.252.018-.01 7.981-.013 15.962.002 23.944 11.917.013 23.834.013 35.752 0 .022-.674-.002-1.35.012-2.023 4.034.01 8.07.01 12.105 0 .002 11.349.01 22.698-.003 34.048-12.082-.025-24.163-.003-36.244-.01-7.911.007-15.823-.015-23.734.01-.02-19.988.01-39.975-.015-59.959zm3.435 4.043c-.904.236-1.577 1.152-1.482 2.086.079.997.994 1.837 1.999 1.82 1.367.002 2.736.015 4.105-.007 1.04-.036 1.928-.995 1.878-2.03-.003-.996-.867-1.896-1.868-1.925-1.294-.01-2.585.002-3.878-.005-.252.004-.51-.013-.754.061zm-.219 8.067c-.815.317-1.373 1.203-1.256 2.076.1.938.94 1.724 1.89 1.756 1.25.016 2.5-.002 3.752.008.439.008.9-.025 1.288-.246.73-.39 1.173-1.257 1.019-2.075-.136-.889-.95-1.62-1.852-1.645-1.328-.007-2.653.002-3.98-.004-.29-.005-.589.016-.86.13zm.219 7.923c-.762.2-1.372.884-1.471 1.665-.128.844.384 1.718 1.158 2.064.403.192.859.19 1.295.181 1.217-.008 2.434.011 3.651-.008 1.032-.047 1.92-.998 1.868-2.034-.007-.994-.87-1.891-1.87-1.922-1.293-.011-2.584.002-3.877-.006-.252-.001-.51-.008-.754.06zm-.01 8.003c-1.018.249-1.706 1.392-1.413 2.403.21.868 1.057 1.512 1.95 1.497 1.364-.003 2.728.01 4.09-.006 1.02-.034 1.906-.958 1.883-1.975.026-1.017-.858-1.958-1.88-1.981-1.252-.011-2.503.002-3.754-.003-.292-.004-.591-.018-.877.065zm48.107 0c-1.117.272-1.79 1.607-1.323 2.66a2.027 2.027 0 001.86 1.238c1.326.003 2.652.003 3.977 0 1.056.025 2.032-.916 1.996-1.978.045-1.022-.86-1.96-1.88-1.984-1.252-.008-2.503.003-3.754-.002-.293 0-.591-.017-.876.066zM12.13 53.016c-.015 7.981-.012 15.961-.001 23.943 11.917.003 23.836.003 35.753 0 .011-7.982.014-15.962-.001-23.943a14203.52 14203.52 0 00-35.75 0zm-8.694 4.05c-.797.208-1.422.943-1.482 1.764-.112 1.07.805 2.103 1.883 2.137 1.371.014 2.743.003 4.113.006 1.035.01 1.977-.89 1.986-1.928.054-1.033-.83-2.003-1.87-2.037-1.254-.01-2.508.003-3.763-.005-.289 0-.584-.014-.867.064zm48.108.003c-.951.235-1.623 1.244-1.456 2.208.123.947 1.016 1.71 1.972 1.696h3.997c1.031.013 1.994-.886 1.984-1.928.071-1.036-.829-2.011-1.866-2.037-1.254-.01-2.51.003-3.764-.005-.29 0-.586-.014-.867.066zM3.425 65.066c-.955.242-1.634 1.262-1.45 2.234.14.9.957 1.638 1.874 1.662 1.364.011 2.727 0 4.09.006 1.06.022 2.023-.925 1.997-1.984.027-1.02-.86-1.952-1.882-1.98-1.211-.012-2.426.002-3.637-.004-.332-.001-.669-.021-.992.066zm48.107.003c-.927.231-1.584 1.195-1.456 2.14.093.935.935 1.723 1.879 1.752 1.365.011 2.73 0 4.093.006 1.055.016 2.043-.917 1.994-1.984.045-1.023-.86-1.958-1.88-1.981-1.252-.011-2.502.002-3.753-.003-.294-.003-.592-.012-.877.07zM3.435 73.057c-.797.204-1.422.94-1.482 1.76-.111 1.07.802 2.112 1.883 2.138 1.371.013 2.743.002 4.113.005 1.035.017 1.977-.891 1.986-1.928.054-1.033-.835-1.997-1.87-2.037-1.254-.01-2.508.003-3.763-.005-.289.001-.584-.01-.867.067zm48.108 0c-.887.22-1.543 1.118-1.476 2.029.035.974.892 1.837 1.874 1.869 1.37.013 2.742.002 4.114.005 1.033.017 1.993-.883 1.985-1.925.071-1.039-.833-2.006-1.868-2.04-1.254-.01-2.509.003-3.763-.005-.289.001-.585-.01-.866.067zM96.83 31.045c6.813-.36 13.73 1.456 19.431 5.154a32.396 32.396 0 019.482 9.342 31.527 31.527 0 015.043 13.773c.625 5.36-.123 10.88-2.225 15.867-1.766 4.254-4.499 8.108-7.91 11.243a32.605 32.605 0 01-11.584 6.844 33.066 33.066 0 01-15.656 1.337 32.59 32.59 0 01-13.329-5.235c-5.2-3.514-9.323-8.551-11.692-14.307a31.532 31.532 0 01-2.327-14.038 31.433 31.433 0 013.839-13.243 32.232 32.232 0 018.329-9.799c5.259-4.156 11.865-6.62 18.6-6.938zm15.6 12.011c-8.543.979-17.086 1.933-25.627 2.92-.013 8.152.006 16.308-.008 24.462-2.325-.848-5.015-.792-7.24.318-1.33.665-2.493 1.763-2.997 3.169-.503 1.356-.289 2.934.528 4.128.752 1.154 1.947 1.978 3.235 2.465 1.48.569 3.115.675 4.68.452 1.888-.295 3.742-1.222 4.862-2.784.67-.936.965-2.102.894-3.237-.014-7.054.008-14.105-.01-21.158 1.976-.282 3.965-.458 5.946-.7 4.944-.56 9.885-1.124 14.827-1.682V67.42c-1.677-.563-3.506-.755-5.247-.362-1.764.38-3.483 1.32-4.479 2.84a4.618 4.618 0 00-.637 3.729c.32 1.196 1.12 2.243 2.139 2.959 1.533 1.101 3.474 1.576 5.355 1.489 2.036-.083 4.111-.843 5.498-2.353a5.078 5.078 0 001.329-3.83c-.007-6.755-.002-13.51-.005-20.265.058-2.962-.002-5.924-.002-8.884-1.018.053-2.03.212-3.04.313z"
4936
+ }));
4937
+ });
4938
+
4888
4939
  /**
4889
- * Returns chapter containing the current scroll position.
4940
+ * Render opt in prompt instead of children if third party consent
4941
+ * cookie has been configured in theme options and user has not given
4942
+ * consent for passed provider.
4890
4943
  *
4891
- * @example
4944
+ * @param {Object} props
4945
+ * @param {string} props.providerName -
4946
+ * Only render children if user has given consent for this provider.
4947
+ * @param {React.ReactElement} props.children -
4948
+ * Children to conditionally render.
4949
+ * @param {function} [props.wrapper] -
4950
+ * Function that receives children to allow wrapping opt-in prompt
4951
+ * in custom elements.
4952
+ * @param {boolean} [props.icon=true] -
4953
+ * Allow hiding the icon in the opt-in prompt.
4892
4954
  *
4893
- * const chapter = useCurrentChapter();
4894
- * chapter // =>
4895
- * {
4896
- * id: 3,
4897
- * permaId: 5,
4898
- * title: 'Chapter 1',
4899
- * summary: 'An introductory chapter',
4900
- * chapterSlug: 'chapter-1'
4901
- * }
4955
+ * @name ThirdPartyOptIn
4902
4956
  */
4903
4957
 
4904
- function useCurrentChapter() {
4905
- return useContext(CurrentChapterContext);
4906
- }
4907
- function useCurrentSectionIndexState() {
4908
- return useContext(CurrentSectionIndexStateContext);
4909
- }
4958
+ function OptIn(_ref) {
4959
+ var children = _ref.children,
4960
+ providerName = _ref.providerName,
4961
+ wrapper = _ref.wrapper,
4962
+ icon = _ref.icon;
4910
4963
 
4911
- function usePostMessageListener(receiveData) {
4912
- useEffect(function () {
4913
- if (window.parent !== window) {
4914
- window.addEventListener('message', receive);
4915
- }
4964
+ var _useI18n = useI18n(),
4965
+ t = _useI18n.t;
4916
4966
 
4917
- return function () {
4918
- return window.removeEventListener('message', receive);
4919
- };
4967
+ var _useContentElementAtt = useContentElementAttributes(),
4968
+ contentElementId = _useContentElementAtt.contentElementId;
4920
4969
 
4921
- function receive(message) {
4922
- if (window.location.href.indexOf(message.origin) === 0) {
4923
- receiveData(message.data);
4924
- }
4925
- }
4926
- }, [receiveData]);
4927
- }
4970
+ var contentElementConsentVendor = useContentElementConsentVendor({
4971
+ contentElementId: contentElementId
4972
+ });
4973
+ providerName = providerName || (contentElementConsentVendor === null || contentElementConsentVendor === void 0 ? void 0 : contentElementConsentVendor.name);
4974
+ var cookieMessage = (contentElementConsentVendor === null || contentElementConsentVendor === void 0 ? void 0 : contentElementConsentVendor.optInPrompt) || t("pageflow_scrolled.public.third_party_consent.opt_in_prompt.".concat(providerName));
4928
4975
 
4929
- var contentStyles = {"Content":"Content-module_Content__m7urk"};
4976
+ var _useState = useState(false),
4977
+ _useState2 = _slicedToArray(_useState, 2),
4978
+ consentedHere = _useState2[0],
4979
+ setConsentedHere = _useState2[1];
4930
4980
 
4931
- var styles$s = {"focusOutlineDisabled":"focusOutline-module_focusOutlineDisabled__KV7d-"};
4981
+ var _useConsentGiven = useConsentGiven(providerName),
4982
+ _useConsentGiven2 = _slicedToArray(_useConsentGiven, 2),
4983
+ consentGiven = _useConsentGiven2[0],
4984
+ giveConsent = _useConsentGiven2[1];
4932
4985
 
4933
- var FocusVisibleContext = createContext();
4934
- function useFocusOutlineVisible() {
4935
- return useContext(FocusVisibleContext);
4986
+ if (consentGiven || !providerName) {
4987
+ return typeof children === 'function' ? children({
4988
+ consentedHere: consentedHere
4989
+ }) : children;
4990
+ }
4991
+
4992
+ function accept() {
4993
+ giveConsent(providerName);
4994
+ setConsentedHere(true);
4995
+ }
4996
+
4997
+ return wrapper( /*#__PURE__*/React.createElement("div", {
4998
+ className: styles$s.optIn
4999
+ }, icon && /*#__PURE__*/React.createElement("div", {
5000
+ className: styles$s.optInIcon
5001
+ }, /*#__PURE__*/React.createElement(OptInIcon, null)), /*#__PURE__*/React.createElement("div", {
5002
+ className: styles$s.optInMessage
5003
+ }, cookieMessage), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", {
5004
+ className: styles$s.optInButton,
5005
+ onClick: accept
5006
+ }, t('pageflow_scrolled.public.third_party_consent.confirm')))));
4936
5007
  }
4937
- function FocusOutlineProvider(_ref) {
4938
- var children = _ref.children;
5008
+ OptIn.defaultProps = {
5009
+ icon: true,
5010
+ wrapper: function wrapper(children) {
5011
+ return children;
5012
+ }
5013
+ };
4939
5014
 
4940
- var _useState = useState(),
4941
- _useState2 = _slicedToArray(_useState, 2),
4942
- value = _useState2[0],
4943
- setValue = _useState2[1];
5015
+ var styles$t = {"optOut":"OptOutInfo-module_optOut__2Q3d5","tooltip":"OptOutInfo-module_tooltip__2bpU0","icon":"OptOutInfo-module_icon__1kL6Q utils-module_unstyledButton__3rgne","full":"OptOutInfo-module_full__s_Ono"};
4944
5016
 
4945
- useEffect(function () {
4946
- document.body.addEventListener('keydown', enable);
4947
- document.body.addEventListener('mousedown', disable);
4948
- disable();
4949
- return function () {
4950
- document.body.removeEventListener('keydown', enable);
4951
- document.body.removeEventListener('mousedown', disable);
4952
- };
5017
+ function _extends$1() {
5018
+ _extends$1 = Object.assign || function (target) {
5019
+ for (var i = 1; i < arguments.length; i++) {
5020
+ var source = arguments[i];
4953
5021
 
4954
- function enable() {
4955
- document.body.classList.remove(styles$s.focusOutlineDisabled);
4956
- setValue(true);
5022
+ for (var key in source) {
5023
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
5024
+ target[key] = source[key];
5025
+ }
5026
+ }
4957
5027
  }
4958
5028
 
4959
- function disable() {
4960
- document.body.classList.add(styles$s.focusOutlineDisabled);
4961
- setValue(false);
4962
- }
4963
- }, []);
4964
- return /*#__PURE__*/React.createElement(FocusVisibleContext.Provider, {
4965
- value: value
4966
- }, children);
5029
+ return target;
5030
+ };
5031
+
5032
+ return _extends$1.apply(this, arguments);
4967
5033
  }
5034
+ var information = (function (_ref) {
5035
+ var _ref$styles = _ref.styles,
5036
+ props = _objectWithoutProperties(_ref, ["styles"]);
4968
5037
 
4969
- var PhonePlatformProvider = withInlineEditingAlternative('PhonePlatformProvider', function PhonePlatformProvider(_ref) {
4970
- var children = _ref.children;
4971
- var isPhonePlatform = useBrowserFeature('phone platform');
4972
- return /*#__PURE__*/React.createElement(PhonePlatformContext.Provider, {
4973
- value: isPhonePlatform
4974
- }, children);
5038
+ return /*#__PURE__*/React.createElement("svg", _extends$1({
5039
+ xmlns: "http://www.w3.org/2000/svg",
5040
+ viewBox: "-65 -65 449 449"
5041
+ }, props), /*#__PURE__*/React.createElement("path", {
5042
+ d: "M165 0C74.019 0 0 74.02 0 165.001 0 255.982 74.019 330 165 330s165-74.018 165-164.999S255.981 0 165 0zm0 300c-74.44 0-135-60.56-135-134.999S90.56 30 165 30s135 60.562 135 135.001C300 239.44 239.439 300 165 300z"
5043
+ }), /*#__PURE__*/React.createElement("path", {
5044
+ d: "M164.998 70c-11.026 0-19.996 8.976-19.996 20.009 0 11.023 8.97 19.991 19.996 19.991 11.026 0 19.996-8.968 19.996-19.991 0-11.033-8.97-20.009-19.996-20.009zm.002 70c-8.284 0-15 6.716-15 15v90c0 8.284 6.716 15 15 15 8.284 0 15-6.716 15-15v-90c0-8.284-6.716-15-15-15z"
5045
+ }));
4975
5046
  });
4976
5047
 
4977
- var AudioFocusContext = createContext();
4978
- function AudioFocusProvider(_ref) {
4979
- var children = _ref.children;
4980
-
4981
- var _useState = useState([]),
4982
- _useState2 = _slicedToArray(_useState, 2),
4983
- currentKey = _useState2[0],
4984
- setCurrentKey = _useState2[1];
4985
-
4986
- var value = useMemo(function () {
4987
- return [currentKey, setCurrentKey];
4988
- }, [currentKey, setCurrentKey]);
4989
- return /*#__PURE__*/React.createElement(AudioFocusContext.Provider, {
4990
- value: value
4991
- }, children);
4992
- }
4993
5048
  /**
4994
- * Prevent parallel playback of multiple media elements.
5049
+ * Display info tooltip with a link to opt out of third party
5050
+ * embeds. Opt out url needs to be configured in theme options.
4995
5051
  *
4996
- * @param {Object} options
4997
- * @param {number} options.key - Unique id used to identify the element.
4998
- * @param {boolean} options.request - Set to true to request audio focus.
4999
- * @param {Function} options.onLost -
5000
- * Callback that will be invoked if another element requests audio
5001
- * focus, thereby preempting your hold of audio focus. The callback
5002
- * should pause the element.
5052
+ * @param {Object} props
5053
+ * @param {string} props.providerName -
5054
+ * Only display if user has given consent for this provider.
5055
+ * @param {boolean} [hide] -
5056
+ * Temporarily hide the tooltip, e.g. while the embed is playing
5057
+ *
5058
+ * @name ThirdPartyOptOutInfo
5003
5059
  */
5004
5060
 
5005
- function useAudioFocus(_ref2) {
5006
- var key = _ref2.key,
5007
- request = _ref2.request,
5008
- onLost = _ref2.onLost;
5009
- var wasRequested = usePrevious(request);
5061
+ function OptOutInfo(_ref) {
5062
+ var _theme$options$thirdP;
5010
5063
 
5011
- var _useContext = useContext(AudioFocusContext),
5012
- _useContext2 = _slicedToArray(_useContext, 2),
5013
- currentKey = _useContext2[0],
5014
- setCurrentKey = _useContext2[1];
5064
+ var providerName = _ref.providerName,
5065
+ hide = _ref.hide;
5015
5066
 
5016
- var previousKey = usePrevious(currentKey);
5017
- useEffect(function () {
5018
- if (request && !wasRequested) {
5019
- setCurrentKey(key);
5067
+ var _useI18n = useI18n(),
5068
+ t = _useI18n.t;
5069
+
5070
+ var theme = useTheme();
5071
+ var optOutUrl = (_theme$options$thirdP = theme.options.thirdPartyConsent) === null || _theme$options$thirdP === void 0 ? void 0 : _theme$options$thirdP.optOutUrl;
5072
+
5073
+ var _useContentElementAtt = useContentElementAttributes(),
5074
+ width = _useContentElementAtt.width,
5075
+ contentElementId = _useContentElementAtt.contentElementId;
5076
+
5077
+ var contentElementConsentVendor = useContentElementConsentVendor({
5078
+ contentElementId: contentElementId
5079
+ });
5080
+ providerName = providerName || (contentElementConsentVendor === null || contentElementConsentVendor === void 0 ? void 0 : contentElementConsentVendor.name);
5081
+
5082
+ var _useConsentGiven = useConsentGiven(providerName),
5083
+ _useConsentGiven2 = _slicedToArray(_useConsentGiven, 1),
5084
+ consentGiven = _useConsentGiven2[0];
5085
+
5086
+ if (!optOutUrl || !consentGiven) {
5087
+ return null;
5088
+ }
5089
+
5090
+ var linkText = t('pageflow_scrolled.public.third_party_consent.opt_out.prompt_link');
5091
+ var linkHtml = "<a href=\"".concat(optOutUrl, "\" target=\"_blank\" rel=\"noopener noreferrer\">").concat(linkText, "</a>");
5092
+ var html = t('pageflow_scrolled.public.third_party_consent.opt_out.prompt', {
5093
+ link: linkHtml
5094
+ });
5095
+ return /*#__PURE__*/React.createElement("div", {
5096
+ className: classNames(styles$t.optOut, _defineProperty({}, styles$t.full, width === widths.full)),
5097
+ style: hide ? {
5098
+ opacity: 0,
5099
+ visibility: 'hidden'
5100
+ } : undefined
5101
+ }, /*#__PURE__*/React.createElement("button", {
5102
+ className: styles$t.icon
5103
+ }, /*#__PURE__*/React.createElement(information, null)), /*#__PURE__*/React.createElement("div", {
5104
+ className: styles$t.tooltip
5105
+ }, /*#__PURE__*/React.createElement("div", {
5106
+ dangerouslySetInnerHTML: {
5107
+ __html: html
5020
5108
  }
5021
- }, [request, wasRequested, setCurrentKey, key]);
5022
- useEffect(function () {
5023
- if (previousKey === key && currentKey !== key) {
5024
- onLost();
5109
+ })));
5110
+ }
5111
+
5112
+ function registerVendors(_ref) {
5113
+ var contentElementTypes = _ref.contentElementTypes,
5114
+ seed = _ref.seed,
5115
+ consent = _ref.consent,
5116
+ cookieName = _ref.cookieName;
5117
+ var options = seed.config.theme.options.thirdPartyConsent;
5118
+ var locale = seed.collections.entries[0].locale;
5119
+ cookieName = cookieName || (options === null || options === void 0 ? void 0 : options.cookieName);
5120
+ [].concat(_toConsumableArray(seed.config.consentVendors), _toConsumableArray(contentElementTypes.consentVendors({
5121
+ contentElements: seed.collections.contentElements,
5122
+ t: function t(key, options) {
5123
+ return I18n.t(key, _objectSpread2(_objectSpread2({}, options), {}, {
5124
+ locale: locale
5125
+ }));
5025
5126
  }
5026
- }, [currentKey, previousKey, key, onLost]);
5127
+ }))).forEach(function (vendor) {
5128
+ var _options$cookieProvid;
5129
+
5130
+ consent.registerVendor(vendor.name, {
5131
+ displayName: vendor.displayName,
5132
+ description: vendor.description,
5133
+ paradigm: cookieName ? vendor.paradigm || 'opt-in' : 'skip',
5134
+ cookieName: cookieName,
5135
+ cookieKey: options === null || options === void 0 ? void 0 : (_options$cookieProvid = options.cookieProviderNameMapping) === null || _options$cookieProvid === void 0 ? void 0 : _options$cookieProvid[vendor.name],
5136
+ cookieDomain: options === null || options === void 0 ? void 0 : options.cookieDomain
5137
+ });
5138
+ });
5139
+ consent.closeVendorRegistration();
5027
5140
  }
5028
5141
 
5029
5142
  function RootProviders(_ref) {
@@ -5038,15 +5151,36 @@ function RootProviders(_ref) {
5038
5151
  }, children)))))))));
5039
5152
  }
5040
5153
 
5041
- var textStyles = {"text-s":"20px","text-base":"22px","text-md":"33px","text-l":"40px","text-2l":"50px","text-xl":"66px","text-2xl":"88px","text-3xl":"110px","heading-lg":"Text-module_heading-lg__FKxzu typography-headingLg typography-heading","heading-md":"Text-module_heading-md__1q5Ss typography-headingMd typography-heading","heading-sm":"Text-module_heading-sm__2awaz typography-headingSm typography-heading","heading-xs":"Text-module_heading-xs__21nHy typography-headingXs typography-heading","body":"Text-module_body__4oWD- typography-body","caption":"Text-module_caption__3_6Au typography-caption","question":"Text-module_question__ByVAq typography-question"};
5154
+ function camelize(snakeCase) {
5155
+ return snakeCase.replace(/[_-][a-z]/g, function (match) {
5156
+ return match[1].toUpperCase();
5157
+ });
5158
+ }
5159
+
5160
+ /**
5161
+ * Resolve a palette color to a CSS custom property.
5162
+ *
5163
+ * @example
5164
+ * <div style={{backgroundColor: paletteColor(configuration.backgroundColor)}}>
5165
+ */
5166
+ function paletteColor(value) {
5167
+ return !value || value[0] === '#' ? value : "var(--theme-palette-color-".concat(value, ")");
5168
+ }
5169
+
5170
+ var textStyles = {"text-s":"20px","text-base":"22px","text-md":"33px","text-l":"40px","text-2l":"50px","text-xl":"66px","text-2xl":"88px","text-3xl":"110px","text-4xl":"200px","text-5xl":"350px","heading-lg":"Text-module_heading-lg__FKxzu typography-headingLg typography-heading","heading-md":"Text-module_heading-md__1q5Ss typography-headingMd typography-heading","heading-sm":"Text-module_heading-sm__2awaz typography-headingSm typography-heading","heading-xs":"Text-module_heading-xs__21nHy typography-headingXs typography-heading","headingTagline-lg":"Text-module_headingTagline-lg__1O2TQ typography-headingTagline","headingTagline-md":"Text-module_headingTagline-md__2hrVS typography-headingTagline","headingTagline-sm":"Text-module_headingTagline-sm__1Fw2J typography-headingTagline","headingSubtitle-lg":"Text-module_headingSubtitle-lg__15kj0 typography-headingSubtitle","headingSubtitle-md":"Text-module_headingSubtitle-md__2_qtz typography-headingSubtitle","headingSubtitle-sm":"Text-module_headingSubtitle-sm__MOc_6 typography-headingSubtitle","body":"Text-module_body__4oWD- typography-body","caption":"Text-module_caption__3_6Au typography-caption","question":"Text-module_question__ByVAq typography-question","quoteText-lg":"Text-module_quoteText-lg__3ZnZi typography-quoteText","quoteText-md":"Text-module_quoteText-md__2eooO typography-quoteText","quoteText-sm":"Text-module_quoteText-sm__5nKex typography-quoteText","quoteText-xs":"Text-module_quoteText-xs__2p5on typography-quoteText","quoteAttribution":"Text-module_quoteAttribution__VBqLw typography-quoteAttribution","counterNumber-lg":"Text-module_counterNumber-lg__2myJg typography-counterNumber","counterNumber-md":"Text-module_counterNumber-md__1NC3q typography-counterNumber","counterNumber-sm":"Text-module_counterNumber-sm__2SwHQ typography-counterNumber","counterNumber-xs":"Text-module_counterNumber-xs__1D-YR typography-counterNumber","counterDescription":"Text-module_counterDescription__34NjQ typography-counterDescription"};
5042
5171
 
5043
5172
  /**
5044
5173
  * Render some text using the default typography scale.
5045
5174
  *
5046
5175
  * @param {Object} props
5047
5176
  * @param {string} props.scaleCategory -
5048
- * One of the styles `'heading-lg'`, `'heading-md'`, `'heading-sm'`,
5049
- * `'heading-xs'`, `'body'`, `'caption'`, `'question'`.
5177
+ * One of the styles `'heading-lg'`, `'heading-md'`, `'heading-sm'`,`'heading-xs'`,
5178
+ * `'headingTagline-lg'`, `'headingTagline-md'`, `'headingTagline-sm'`,
5179
+ * `'headingSubtitle-lg'`, `'headingSubtitle-md'`, `'headingSubtitle-sm'`,
5180
+ * `'body'`, `'caption'`, `'question'`,
5181
+ * `'quoteText-lg'`, `'quoteText-md'`, `'quoteText-sm'`, `'quoteText-xs'`, `'quoteAttribution'`,
5182
+ * `'counterNumber-lg'`, `'counterNumber-md'`, `'counterNumber-sm'`,
5183
+ * `'counterNumber-xs'`, `'counterDescription`'.
5050
5184
  * @param {string} [props.inline] - Render a span instread of a div.
5051
5185
  * @param {string} props.children - Nodes to render with specified typography.
5052
5186
  */
@@ -5060,123 +5194,27 @@ function Text(_ref) {
5060
5194
  }, children);
5061
5195
  }
5062
5196
 
5063
- var styles$t = {"crop":"SectionThumbnail-module_crop__Q1nZj","scale":"SectionThumbnail-module_scale__2tKDG"};
5064
-
5065
- function StandaloneSectionThumbnail(_ref) {
5066
- var seed = _ref.seed,
5067
- props = _objectWithoutProperties(_ref, ["seed"]);
5068
-
5069
- return /*#__PURE__*/React.createElement(RootProviders, {
5070
- seed: seed
5071
- }, /*#__PURE__*/React.createElement(SectionThumbnail, props));
5072
- }
5073
- function SectionThumbnail(_ref2) {
5074
- var sectionPermaId = _ref2.sectionPermaId,
5075
- subscribe = _ref2.subscribe,
5076
- scale = _ref2.scale;
5077
- var dispatch = useEntryStateDispatch();
5078
- useEffect(function () {
5079
- if (subscribe) {
5080
- return subscribe(dispatch);
5081
- }
5082
- }, [subscribe, dispatch]);
5083
- var section = useSection({
5084
- sectionPermaId: sectionPermaId
5085
- });
5086
- var scaleFactor = scale ? 5 : 1;
5087
-
5088
- if (section) {
5089
- return /*#__PURE__*/React.createElement(StaticPreview, null, /*#__PURE__*/React.createElement(Measure, {
5090
- client: true
5091
- }, function (_ref3) {
5092
- var measureRef = _ref3.measureRef,
5093
- contentRect = _ref3.contentRect;
5094
- return /*#__PURE__*/React.createElement(FullscreenDimensionProvider, clientDimensions(contentRect, scaleFactor), /*#__PURE__*/React.createElement("div", {
5095
- ref: measureRef,
5096
- className: styles$t.crop,
5097
- inert: ""
5098
- }, /*#__PURE__*/React.createElement("div", {
5099
- className: classNames(_defineProperty({}, styles$t.scale, scale))
5100
- }, /*#__PURE__*/React.createElement("div", {
5101
- className: contentStyles.Content,
5102
- style: viewportUnitCustomProperties(clientDimensions(contentRect, scaleFactor))
5103
- }, /*#__PURE__*/React.createElement(ConnectedSection, {
5104
- state: "active",
5105
- domIdPrefix: "section-preview",
5106
- section: _objectSpread2(_objectSpread2({}, section), {}, {
5107
- transition: 'preview'
5108
- })
5109
- })))));
5110
- }));
5111
- } else {
5112
- return /*#__PURE__*/React.createElement("div", {
5113
- className: styles$t.root
5114
- }, "Not found.");
5115
- }
5116
- }
5117
- SectionThumbnail.defaultProps = {
5118
- scale: true,
5119
- subscribe: function subscribe() {}
5120
- };
5121
-
5122
- function clientDimensions(contentRect, scaleFactor) {
5123
- return {
5124
- width: contentRect.client.width && Math.ceil(contentRect.client.width * scaleFactor),
5125
- height: contentRect.client.height && Math.ceil(contentRect.client.height * scaleFactor)
5126
- };
5127
- }
5128
-
5129
- function viewportUnitCustomProperties(_ref4) {
5130
- var width = _ref4.width,
5131
- height = _ref4.height;
5132
- return {
5133
- '--vw': width && "".concat(width / 100, "px"),
5134
- '--vh': height && "".concat(height / 100, "px")
5135
- };
5136
- }
5137
-
5138
- var ContentElementConfigurationUpdateContext = React.createContext(function () {});
5139
- function useContentElementConfigurationUpdate() {
5140
- return useContext(ContentElementConfigurationUpdateContext);
5141
- }
5142
-
5143
- var ContentElementEditorCommandEmitterContext = createContext({
5144
- on: function on() {},
5145
- off: function off() {}
5146
- });
5147
- function useContentElementEditorCommandSubscription(callback) {
5148
- var _useContentElementAtt = useContentElementAttributes(),
5149
- contentElementId = _useContentElementAtt.contentElementId;
5150
-
5151
- var emitter = useContext(ContentElementEditorCommandEmitterContext);
5152
- useEffect(function () {
5153
- emitter.on("command:".concat(contentElementId), callback);
5154
- return function () {
5155
- return emitter.off("command:".concat(contentElementId), callback);
5156
- };
5157
- }, [emitter, callback, contentElementId]);
5158
- }
5159
-
5160
- function camelize(snakeCase) {
5161
- return snakeCase.replace(/-[a-z]/g, function (match) {
5162
- return match[1].toUpperCase();
5163
- });
5164
- }
5165
-
5166
- var styles$u = {"root":"EditableText-module_root__2v1tU"};
5197
+ var styles$u = {"darkContentTextColor":"var(--theme-dark-content-text-color, #222)","lightContentTextColor":"var(--theme-light-content-text-color, #fff)","root":"EditableText-module_root__2v1tU","light":"EditableText-module_light__2c29h","dark":"EditableText-module_dark__2ym90"};
5167
5198
 
5199
+ var defaultValue = [{
5200
+ type: 'paragraph',
5201
+ children: [{
5202
+ text: ''
5203
+ }]
5204
+ }];
5168
5205
  var EditableText = withInlineEditingAlternative('EditableText', function EditableText(_ref) {
5169
5206
  var value = _ref.value,
5170
- className = _ref.className;
5207
+ className = _ref.className,
5208
+ _ref$scaleCategory = _ref.scaleCategory,
5209
+ scaleCategory = _ref$scaleCategory === void 0 ? 'body' : _ref$scaleCategory;
5171
5210
  return /*#__PURE__*/React.createElement("div", {
5172
5211
  className: classNames(styles$u.root, className)
5173
5212
  }, /*#__PURE__*/React.createElement(Text, {
5174
- scaleCategory: "body"
5175
- }, render(value)));
5213
+ scaleCategory: scaleCategory
5214
+ }, render(value || defaultValue)));
5176
5215
  });
5177
5216
 
5178
- function render() {
5179
- var children = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
5217
+ function render(children) {
5180
5218
  return children.map(function (element, index) {
5181
5219
  if (element.type) {
5182
5220
  return renderElement({
@@ -5192,7 +5230,7 @@ function render() {
5192
5230
  key: index
5193
5231
  },
5194
5232
  leaf: element,
5195
- children: element.text.trim() === '' ? "\uFEFF" : element.text
5233
+ children: children.length === 1 && element.text.trim() === '' ? "\uFEFF" : element.text
5196
5234
  });
5197
5235
  }
5198
5236
  });
@@ -5203,30 +5241,42 @@ function renderElement(_ref2) {
5203
5241
  children = _ref2.children,
5204
5242
  element = _ref2.element;
5205
5243
  var variantClassName = element.variant && ['typography-textBlock', camelize(element.type), element.variant].join('-');
5244
+ var styles = element.color && {
5245
+ color: paletteColor(element.color)
5246
+ };
5206
5247
 
5207
5248
  switch (element.type) {
5208
5249
  case 'block-quote':
5209
5250
  return /*#__PURE__*/React.createElement("blockquote", Object.assign({}, attributes, {
5210
- className: variantClassName
5251
+ className: variantClassName,
5252
+ style: styles
5211
5253
  }), children);
5212
5254
 
5213
5255
  case 'bulleted-list':
5214
5256
  return /*#__PURE__*/React.createElement("ul", Object.assign({}, attributes, {
5215
- className: variantClassName
5257
+ className: variantClassName,
5258
+ style: styles
5216
5259
  }), children);
5217
5260
 
5218
5261
  case 'numbered-list':
5219
5262
  return /*#__PURE__*/React.createElement("ol", Object.assign({}, attributes, {
5220
- className: variantClassName
5263
+ className: variantClassName,
5264
+ style: styles
5221
5265
  }), children);
5222
5266
 
5223
5267
  case 'list-item':
5224
5268
  return /*#__PURE__*/React.createElement("li", attributes, children);
5225
5269
 
5226
5270
  case 'heading':
5227
- return /*#__PURE__*/React.createElement("h2", Object.assign({}, attributes, {
5228
- className: classNames(variantClassName, textStyles['heading-xs'])
5229
- }), children);
5271
+ var key = attributes.key,
5272
+ otherAttributes = _objectWithoutProperties(attributes, ["key"]);
5273
+
5274
+ return /*#__PURE__*/React.createElement(Heading, {
5275
+ key: key,
5276
+ attributes: otherAttributes,
5277
+ variantClassName: variantClassName,
5278
+ styles: styles
5279
+ }, children);
5230
5280
 
5231
5281
  case 'link':
5232
5282
  return renderLink({
@@ -5237,17 +5287,30 @@ function renderElement(_ref2) {
5237
5287
 
5238
5288
  default:
5239
5289
  return /*#__PURE__*/React.createElement("p", Object.assign({}, attributes, {
5240
- className: variantClassName
5290
+ className: variantClassName,
5291
+ style: styles
5241
5292
  }), children);
5242
5293
  }
5243
5294
  }
5244
5295
 
5245
- function renderLink(_ref3) {
5246
- var _element$href, _element$href2;
5247
-
5296
+ function Heading(_ref3) {
5248
5297
  var attributes = _ref3.attributes,
5249
- children = _ref3.children,
5250
- element = _ref3.element;
5298
+ variantClassName = _ref3.variantClassName,
5299
+ inlineStyles = _ref3.styles,
5300
+ children = _ref3.children;
5301
+ var darkBackground = useDarkBackground();
5302
+ return /*#__PURE__*/React.createElement("h2", Object.assign({}, attributes, {
5303
+ className: classNames(variantClassName, darkBackground ? styles$u.light : styles$u.dark, 'scope-headings', textStyles['heading-xs']),
5304
+ style: inlineStyles
5305
+ }), children);
5306
+ }
5307
+
5308
+ function renderLink(_ref4) {
5309
+ var _element$href, _element$href2, _element$href3;
5310
+
5311
+ var attributes = _ref4.attributes,
5312
+ children = _ref4.children,
5313
+ element = _ref4.element;
5251
5314
 
5252
5315
  if (element === null || element === void 0 ? void 0 : (_element$href = element.href) === null || _element$href === void 0 ? void 0 : _element$href.chapter) {
5253
5316
  var key = attributes.key,
@@ -5262,6 +5325,17 @@ function renderLink(_ref3) {
5262
5325
  return /*#__PURE__*/React.createElement("a", Object.assign({}, attributes, {
5263
5326
  href: "#section-".concat(element.href.section)
5264
5327
  }), children);
5328
+ }
5329
+
5330
+ if (element === null || element === void 0 ? void 0 : (_element$href3 = element.href) === null || _element$href3 === void 0 ? void 0 : _element$href3.file) {
5331
+ var _key = attributes.key,
5332
+ _otherAttributes = _objectWithoutProperties(attributes, ["key"]);
5333
+
5334
+ return /*#__PURE__*/React.createElement(FileLink, {
5335
+ key: _key,
5336
+ attributes: _otherAttributes,
5337
+ fileOptions: element.href.file
5338
+ }, children);
5265
5339
  } else {
5266
5340
  var targetAttributes = element.openInNewTab ? {
5267
5341
  target: '_blank',
@@ -5273,10 +5347,10 @@ function renderLink(_ref3) {
5273
5347
  }
5274
5348
  }
5275
5349
 
5276
- function ChapterLink(_ref4) {
5277
- var attributes = _ref4.attributes,
5278
- children = _ref4.children,
5279
- chapterPermaId = _ref4.chapterPermaId;
5350
+ function ChapterLink(_ref5) {
5351
+ var attributes = _ref5.attributes,
5352
+ children = _ref5.children,
5353
+ chapterPermaId = _ref5.chapterPermaId;
5280
5354
  var chapter = useChapter({
5281
5355
  permaId: chapterPermaId
5282
5356
  });
@@ -5285,10 +5359,22 @@ function ChapterLink(_ref4) {
5285
5359
  }), children);
5286
5360
  }
5287
5361
 
5288
- function renderLeaf(_ref5) {
5289
- var attributes = _ref5.attributes,
5290
- children = _ref5.children,
5291
- leaf = _ref5.leaf;
5362
+ function FileLink(_ref6) {
5363
+ var attributes = _ref6.attributes,
5364
+ children = _ref6.children,
5365
+ fileOptions = _ref6.fileOptions;
5366
+ var file = useFile(fileOptions);
5367
+ return /*#__PURE__*/React.createElement("a", Object.assign({}, attributes, {
5368
+ target: "_blank",
5369
+ rel: "noopener noreferrer",
5370
+ href: (file === null || file === void 0 ? void 0 : file.urls.original) || '#'
5371
+ }), children);
5372
+ }
5373
+
5374
+ function renderLeaf(_ref7) {
5375
+ var attributes = _ref7.attributes,
5376
+ children = _ref7.children,
5377
+ leaf = _ref7.leaf;
5292
5378
 
5293
5379
  if (leaf.bold) {
5294
5380
  children = /*#__PURE__*/React.createElement("strong", null, children);
@@ -5309,6 +5395,103 @@ function renderLeaf(_ref5) {
5309
5395
  return /*#__PURE__*/React.createElement("span", attributes, children);
5310
5396
  }
5311
5397
 
5398
+ var ContentElementConfigurationUpdateContext = React.createContext(function () {});
5399
+ function useContentElementConfigurationUpdate() {
5400
+ return useContext(ContentElementConfigurationUpdateContext);
5401
+ }
5402
+
5403
+ var styles$v = {"crop":"SectionThumbnail-module_crop__Q1nZj","scale":"SectionThumbnail-module_scale__2tKDG"};
5404
+
5405
+ function StandaloneSectionThumbnail(_ref) {
5406
+ var seed = _ref.seed,
5407
+ props = _objectWithoutProperties(_ref, ["seed"]);
5408
+
5409
+ return /*#__PURE__*/React.createElement(RootProviders, {
5410
+ seed: seed
5411
+ }, /*#__PURE__*/React.createElement(SectionThumbnail, props));
5412
+ }
5413
+ function SectionThumbnail(_ref2) {
5414
+ var sectionPermaId = _ref2.sectionPermaId,
5415
+ subscribe = _ref2.subscribe,
5416
+ scale = _ref2.scale;
5417
+ var dispatch = useEntryStateDispatch();
5418
+ useEffect(function () {
5419
+ if (subscribe) {
5420
+ return subscribe(dispatch);
5421
+ }
5422
+ }, [subscribe, dispatch]);
5423
+ var section = useSection({
5424
+ sectionPermaId: sectionPermaId
5425
+ });
5426
+ var scaleFactor = scale ? 5 : 1;
5427
+
5428
+ if (section) {
5429
+ return /*#__PURE__*/React.createElement(StaticPreview, null, /*#__PURE__*/React.createElement(Measure, {
5430
+ client: true
5431
+ }, function (_ref3) {
5432
+ var measureRef = _ref3.measureRef,
5433
+ contentRect = _ref3.contentRect;
5434
+ return /*#__PURE__*/React.createElement(FullscreenDimensionProvider, clientDimensions(contentRect, scaleFactor), /*#__PURE__*/React.createElement("div", {
5435
+ ref: measureRef,
5436
+ className: styles$v.crop,
5437
+ inert: ""
5438
+ }, /*#__PURE__*/React.createElement("div", {
5439
+ className: classNames(_defineProperty({}, styles$v.scale, scale))
5440
+ }, /*#__PURE__*/React.createElement("div", {
5441
+ className: contentStyles.Content,
5442
+ style: viewportUnitCustomProperties(clientDimensions(contentRect, scaleFactor))
5443
+ }, /*#__PURE__*/React.createElement(ConnectedSection, {
5444
+ state: "active",
5445
+ domIdPrefix: "section-preview",
5446
+ section: _objectSpread2(_objectSpread2({}, section), {}, {
5447
+ transition: 'preview'
5448
+ })
5449
+ })))));
5450
+ }));
5451
+ } else {
5452
+ return /*#__PURE__*/React.createElement("div", {
5453
+ className: styles$v.root
5454
+ }, "Not found.");
5455
+ }
5456
+ }
5457
+ SectionThumbnail.defaultProps = {
5458
+ scale: true,
5459
+ subscribe: function subscribe() {}
5460
+ };
5461
+
5462
+ function clientDimensions(contentRect, scaleFactor) {
5463
+ return {
5464
+ width: contentRect.client.width && Math.ceil(contentRect.client.width * scaleFactor),
5465
+ height: contentRect.client.height && Math.ceil(contentRect.client.height * scaleFactor)
5466
+ };
5467
+ }
5468
+
5469
+ function viewportUnitCustomProperties(_ref4) {
5470
+ var width = _ref4.width,
5471
+ height = _ref4.height;
5472
+ return {
5473
+ '--vw': width && "".concat(width / 100, "px"),
5474
+ '--vh': height && "".concat(height / 100, "px")
5475
+ };
5476
+ }
5477
+
5478
+ var ContentElementEditorCommandEmitterContext = createContext({
5479
+ on: function on() {},
5480
+ off: function off() {}
5481
+ });
5482
+ function useContentElementEditorCommandSubscription(callback) {
5483
+ var _useContentElementAtt = useContentElementAttributes(),
5484
+ contentElementId = _useContentElementAtt.contentElementId;
5485
+
5486
+ var emitter = useContext(ContentElementEditorCommandEmitterContext);
5487
+ useEffect(function () {
5488
+ emitter.on("command:".concat(contentElementId), callback);
5489
+ return function () {
5490
+ return emitter.off("command:".concat(contentElementId), callback);
5491
+ };
5492
+ }, [emitter, callback, contentElementId]);
5493
+ }
5494
+
5312
5495
  var frontendStyles = {"root":"EditableInlineText-module_root__3eA-J","hyphens-manual":"EditableInlineText-module_hyphens-manual__3Lj4H","hyphens-none":"EditableInlineText-module_hyphens-none__1UvNH"};
5313
5496
 
5314
- export { processSources as $, AtmoProvider as A, Bar as B, ConnectedSection as C, useContentElementLifecycle as D, EventContextDataProvider as E, useCurrentChapter as F, useIsStaticPreview as G, useOnUnmuteMedia as H, usePortraitOrientation as I, EditableText as J, PhonePlatformProvider as K, OptOutInfo as L, getTransitionNames as M, getAvailableTransitionNames as N, OptIn as O, PlayerEventContextDataProvider as P, Image as Q, RootProviders as R, ScrollToSectionContext as S, Text as T, MediaPlayer as U, getInitialPlayerState as V, playerStateReducer as W, usePlayerState as X, VideoPlayer as Y, AudioPlayer as Z, _asyncToGenerator as _, useCurrentSectionIndexState as a, Atmo as a0, AtmoContext as a1, useAtmo as a2, useOnScreen as a3, StandaloneSectionThumbnail as a4, SectionThumbnail as a5, ContentElementEditorCommandEmitterContext as a6, MotifAreaVisibilityProvider as a7, ForcePaddingContext as a8, ContentElementConfigurationUpdateContext as a9, ContentElementEditorStateContext as aa, LayoutWithoutInlineEditing as ab, renderElement as ac, renderLeaf as ad, usePostMessageListener as b, contentStyles as c, api as d, regenerator as e, useDarkBackground as f, getEventObject as g, useTextTracks as h, useMediaMuted as i, useFocusOutlineVisible as j, useVideoQualitySetting as k, useIsomorphicLayoutEffect as l, withInlineEditingAlternative as m, frontendStyles as n, useFullscreenDimensions as o, information as p, camelize as q, registerVendors as r, styles$p as s, loadInlineEditingComponents as t, usePrevious as u, useAudioFocus as v, withInlineEditingDecorator as w, useContentElementConfigurationUpdate as x, useContentElementEditorCommandSubscription as y, useContentElementEditorState as z };
5497
+ export { Image as $, AtmoProvider as A, registerVendors as B, ConnectedSection as C, api as D, EventContextDataProvider as E, loadInlineEditingComponents as F, useAudioFocus as G, useContentElementEditorCommandSubscription as H, InlineFileRights as I, useContentElementLifecycle as J, useCurrentChapter as K, useIsStaticPreview as L, useOnUnmuteMedia as M, usePortraitOrientation as N, PhonePlatformProvider as O, PlayerEventContextDataProvider as P, OptIn as Q, RootProviders as R, ScrollToSectionContext as S, OptOutInfo as T, useConsentRequested as U, getTransitionNames as V, Widget as W, getAvailableTransitionNames as X, paletteColor as Y, widthName as Z, _asyncToGenerator as _, useCurrentSectionIndexState as a, Text as a0, MediaPlayer as a1, getInitialPlayerState as a2, playerStateReducer as a3, usePlayerState as a4, VideoPlayer as a5, AudioPlayer as a6, processSources as a7, Atmo as a8, AtmoContext as a9, useAtmo as aa, useOnScreen as ab, StandaloneSectionThumbnail as ac, SectionThumbnail as ad, ContentElementEditorCommandEmitterContext as ae, MotifAreaVisibilityProvider as af, ForcePaddingContext as ag, ContentElementConfigurationUpdateContext as ah, LayoutWithoutInlineEditing as ai, renderElement as aj, renderLeaf as ak, usePostMessageListener as b, contentStyles as c, regenerator as d, withInlineEditingAlternative as e, useDarkBackground as f, getEventObject as g, EditableText as h, isBlankEditableTextValue as i, useContentElementConfigurationUpdate as j, useContentElementAttributes as k, widths as l, useTextTracks as m, useMediaMuted as n, useFocusOutlineVisible as o, useVideoQualitySetting as p, useIsomorphicLayoutEffect as q, frontendStyles as r, useFullscreenDimensions as s, information as t, usePrevious as u, camelize as v, withInlineEditingDecorator as w, isBlank as x, presence as y, styles$o as z };