@arc-ui/community-components 3.2.0 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/.turbo/turbo-build.log +133 -13
  2. package/CHANGELOG.md +31 -0
  3. package/lib/Accordion/Accordion.cjs +2 -3
  4. package/lib/Accordion/Accordion.mjs +2 -3
  5. package/lib/ActionTile/ActionTile.cjs +4 -5
  6. package/lib/ActionTile/ActionTile.mjs +10 -11
  7. package/lib/ActionTile/styles.css +1 -1
  8. package/lib/ArticleSidebar/ArticleSidebar.cjs +9 -10
  9. package/lib/ArticleSidebar/ArticleSidebar.mjs +46 -47
  10. package/lib/Author/Author.cjs +2 -3
  11. package/lib/Author/Author.mjs +2 -3
  12. package/lib/BannerWithTabs/BannerWithTabs.cjs +4 -5
  13. package/lib/BannerWithTabs/BannerWithTabs.mjs +8 -9
  14. package/lib/ContentInfoWidget/ContentInfoWidget.cjs +3 -2
  15. package/lib/ContentInfoWidget/ContentInfoWidget.mjs +8 -7
  16. package/lib/CopyLead/CopyLead.cjs +32 -23
  17. package/lib/CopyLead/CopyLead.mjs +60 -51
  18. package/lib/DownloadList/DownloadList.cjs +6 -8
  19. package/lib/DownloadList/DownloadList.mjs +11 -13
  20. package/lib/FAQs/FAQs.cjs +5 -6
  21. package/lib/FAQs/FAQs.mjs +22 -23
  22. package/lib/FeaturePost/FeaturePost.cjs +14 -15
  23. package/lib/FeaturePost/FeaturePost.mjs +54 -55
  24. package/lib/Highlights/Highlights.cjs +11 -12
  25. package/lib/Highlights/Highlights.mjs +24 -25
  26. package/lib/InlineLinkGroup/InlineLinkGroup.cjs +25 -0
  27. package/lib/InlineLinkGroup/InlineLinkGroup.mjs +23 -0
  28. package/lib/InlineLinkGroup/styles.css +1 -0
  29. package/lib/LinkTile/LinkTile.cjs +6 -6
  30. package/lib/LinkTile/LinkTile.mjs +7 -7
  31. package/lib/LinkTile/styles.css +1 -1
  32. package/lib/ProductNavigation/ProductNavigation.cjs +6 -7
  33. package/lib/ProductNavigation/ProductNavigation.mjs +18 -19
  34. package/lib/PromoListing/PromoListing.cjs +7 -8
  35. package/lib/PromoListing/PromoListing.mjs +17 -18
  36. package/lib/PromoListingThumbnailSignpost/PromoListingThumbnailSignpost.cjs +7 -8
  37. package/lib/PromoListingThumbnailSignpost/PromoListingThumbnailSignpost.mjs +9 -10
  38. package/lib/Quote/Quote.cjs +5 -6
  39. package/lib/Quote/Quote.mjs +9 -10
  40. package/lib/SectionHeading/SectionHeading.cjs +2 -3
  41. package/lib/SectionHeading/SectionHeading.mjs +2 -3
  42. package/lib/Statistics/Statistics.cjs +21 -19
  43. package/lib/Statistics/Statistics.mjs +35 -33
  44. package/lib/Statistics/styles.css +1 -1
  45. package/lib/Summary/Summary.cjs +4 -4
  46. package/lib/Summary/Summary.mjs +13 -13
  47. package/lib/ThumbnailSignpost/ThumbnailSignpost.cjs +2 -3
  48. package/lib/ThumbnailSignpost/ThumbnailSignpost.mjs +2 -3
  49. package/lib/VideoHeroCard/VideoHeroCard.cjs +76 -0
  50. package/lib/VideoHeroCard/VideoHeroCard.mjs +74 -0
  51. package/lib/VideoPortraitCard/VideoPortraitCard.cjs +22 -0
  52. package/lib/VideoPortraitCard/VideoPortraitCard.mjs +20 -0
  53. package/lib/_shared/cjs/{Accordion-DfNGOjTm.cjs → Accordion-QqDoB3pY.cjs} +8 -9
  54. package/lib/_shared/cjs/{Author-D4dKNQem.cjs → Author-aL8YXi7C.cjs} +4 -5
  55. package/lib/_shared/cjs/Preview-Dx1kCzJ1.cjs +102 -0
  56. package/lib/_shared/cjs/{SectionHeading-DeSFM0HV.cjs → SectionHeading-Dj-dJfv3.cjs} +4 -5
  57. package/lib/_shared/cjs/{ThumbnailSignpost-GkOiwt-Z.cjs → ThumbnailSignpost-SBnrGooA.cjs} +4 -5
  58. package/lib/_shared/cjs/VideoCardThumbnail-BqYgpk0u.cjs +440 -0
  59. package/lib/_shared/cjs/dash.all.min-BPXzla24.cjs +6 -0
  60. package/lib/_shared/cjs/{tslib.es6-BxB9I209.cjs → filter-attrs-C26zOt4_.cjs} +25 -0
  61. package/lib/_shared/cjs/hls-Ckhp5fVA.cjs +36628 -0
  62. package/lib/_shared/cjs/index-DjiIVIaV.cjs +96 -0
  63. package/lib/_shared/cjs/index-oGP6D6gL.cjs +14826 -0
  64. package/lib/_shared/cjs/{index.es-Dq8bYrbW.cjs → index.es-B0J3cvrY.cjs} +1 -1
  65. package/lib/_shared/cjs/mixin-BFwaXKGB.cjs +1027 -0
  66. package/lib/_shared/cjs/react-CEvhi3LL.cjs +737 -0
  67. package/lib/_shared/cjs/react-CqsEClV0.cjs +466 -0
  68. package/lib/_shared/cjs/react-DE6M3seI.cjs +496 -0
  69. package/lib/_shared/cjs/react-Dri2yjKm.cjs +554 -0
  70. package/lib/_shared/cjs/react-DxToimBj.cjs +4239 -0
  71. package/lib/_shared/cjs/react-JTfV8OSA.cjs +325 -0
  72. package/lib/_shared/cjs/react-caXJFZ8W.cjs +400 -0
  73. package/lib/_shared/cjs/react-fep2ei7j.cjs +727 -0
  74. package/lib/_shared/esm/{Accordion-cd1oYvBv.mjs → Accordion-DtU7jbCv.mjs} +16 -17
  75. package/lib/_shared/esm/Author-CJQFrQM9.mjs +27 -0
  76. package/lib/_shared/esm/Preview-CmbKOgEO.mjs +100 -0
  77. package/lib/_shared/esm/{SectionHeading-CpDLCndw.mjs → SectionHeading-BskdQ2Tt.mjs} +10 -11
  78. package/lib/_shared/esm/{ThumbnailSignpost-BeRiXbUp.mjs → ThumbnailSignpost-CBSdQiHw.mjs} +13 -14
  79. package/lib/_shared/esm/VideoCardThumbnail-VfOKmPCv.mjs +437 -0
  80. package/lib/_shared/esm/dash.all.min-CbWI_8dN.mjs +4 -0
  81. package/lib/_shared/esm/{tslib.es6-D6Wu-xwB.mjs → filter-attrs-D-1kWaCP.mjs} +25 -1
  82. package/lib/_shared/esm/hls-AFbJDS9D.mjs +36625 -0
  83. package/lib/_shared/esm/index-CrcIrdjn.mjs +14799 -0
  84. package/lib/_shared/esm/index-DYnuIO1L.mjs +94 -0
  85. package/lib/_shared/esm/{index.es-Bfdys5__.mjs → index.es-DraZ-qKh.mjs} +1 -1
  86. package/lib/_shared/esm/mixin-BGGG8VrM.mjs +1024 -0
  87. package/lib/_shared/esm/react-BGimq-TB.mjs +4237 -0
  88. package/lib/_shared/esm/react-BHT4t_eQ.mjs +494 -0
  89. package/lib/_shared/esm/react-BSd0sGcO.mjs +464 -0
  90. package/lib/_shared/esm/react-CSr43fZV.mjs +552 -0
  91. package/lib/_shared/esm/react-Ca6E7Fr-.mjs +398 -0
  92. package/lib/_shared/esm/react-DG070IvZ.mjs +725 -0
  93. package/lib/_shared/esm/react-DZyqy7W7.mjs +735 -0
  94. package/lib/_shared/esm/react-WW_9iHcl.mjs +323 -0
  95. package/lib/index.cjs +299 -181
  96. package/lib/index.cjs.map +1 -1
  97. package/lib/index.d.cts +77 -63
  98. package/lib/index.d.mts +77 -63
  99. package/lib/index.mjs +297 -181
  100. package/lib/index.mjs.map +1 -1
  101. package/lib/styles.css +1 -1
  102. package/package.json +15 -12
  103. package/rollup.config.js +1 -1
  104. package/src/components/ActionTile/ActionTile.module.css +56 -37
  105. package/src/components/ActionTile/ActionTile.tsx +1 -1
  106. package/src/components/ArticleSidebar/ArticleSidebar.tsx +4 -6
  107. package/src/components/Author/Author.tsx +0 -3
  108. package/src/components/BannerWithTabs/BannerWithTabs.tsx +4 -6
  109. package/src/components/ContentInfoWidget/ContentInfoWidget.tsx +3 -4
  110. package/src/components/CopyLead/components/MediaContent/MediaContent.tsx +7 -6
  111. package/src/components/CopyLead/templates/Content/Content.tsx +5 -3
  112. package/src/components/CopyLead/templates/Media/Media.tsx +5 -6
  113. package/src/components/DownloadList/DownloadList.tsx +8 -8
  114. package/src/components/FeaturePost/FeaturePost.tsx +3 -7
  115. package/src/components/Highlights/Highlights.tsx +3 -2
  116. package/src/components/Highlights/components/HighlightItem/HighlightItem.tsx +3 -2
  117. package/src/components/Highlights/components/HighlightList/HighlightList.tsx +5 -2
  118. package/src/components/InlineLinkGroup/InlineLinkGroup.module.css +81 -0
  119. package/src/components/InlineLinkGroup/InlineLinkGroup.tsx +67 -0
  120. package/src/components/InlineLinkGroup/index.ts +5 -0
  121. package/src/components/LinkTile/LinkTile.module.css +62 -26
  122. package/src/components/LinkTile/LinkTile.tsx +8 -1
  123. package/src/components/PromoListing/PromoListing.tsx +3 -11
  124. package/src/components/PromoListingThumbnailSignpost/PromoListingThumbnailSignpost.tsx +2 -0
  125. package/src/components/Quote/Quote.tsx +1 -7
  126. package/src/components/Statistics/Statistics.module.css +0 -10
  127. package/src/components/Statistics/Statistics.tsx +35 -32
  128. package/src/components/Summary/Summary.tsx +3 -1
  129. package/src/components/VideoHeroCard/VideoHeroCard.tsx +63 -0
  130. package/src/components/VideoHeroCard/components/VideoHeroCardContent/VideoHeroCardContent.module.css +32 -0
  131. package/src/components/VideoHeroCard/components/VideoHeroCardContent/VideoHeroCardContent.tsx +97 -0
  132. package/src/components/VideoHeroCard/components/VideoHeroCardContent/index.ts +4 -0
  133. package/src/components/VideoHeroCard/index.ts +1 -0
  134. package/src/components/VideoPortraitCard/VideoPortraitCard.tsx +54 -0
  135. package/src/components/VideoPortraitCard/index.ts +4 -0
  136. package/src/components/index.ts +3 -1
  137. package/src/internal/MultiLineText/MultiLineText.tsx +25 -0
  138. package/src/internal/MultiLineText/index.ts +1 -0
  139. package/src/internal/VideoCardPlayer/VideoCardPlayer.module.css +54 -0
  140. package/src/internal/VideoCardPlayer/VideoCardPlayer.tsx +62 -0
  141. package/src/internal/VideoCardPlayer/components/VideoCardPlayIcon/VideoCardPlayIcon.module.css +41 -0
  142. package/src/internal/VideoCardPlayer/components/VideoCardPlayIcon/VideoCardPlayIcon.tsx +28 -0
  143. package/src/internal/VideoCardPlayer/components/VideoCardPlayIcon/index.ts +1 -0
  144. package/src/internal/VideoCardPlayer/components/VideoCardThumbnail/VideoCardThumbnail.module.css +58 -0
  145. package/src/internal/VideoCardPlayer/components/VideoCardThumbnail/VideoCardThumbnail.tsx +38 -0
  146. package/src/internal/VideoCardPlayer/components/VideoCardThumbnail/index.ts +1 -0
  147. package/src/internal/VideoCardPlayer/index.ts +2 -0
  148. package/src/internal/VideoCardPlayer/types/player-props.ts +6 -0
  149. package/versions.json +1 -1
  150. package/lib/HeroLink/HeroLink.cjs +0 -35
  151. package/lib/HeroLink/HeroLink.mjs +0 -33
  152. package/lib/HeroLink/styles.css +0 -1
  153. package/lib/_shared/cjs/filter-attrs-BizjMsy0.cjs +0 -27
  154. package/lib/_shared/esm/Author-HnYsFTPT.mjs +0 -28
  155. package/lib/_shared/esm/filter-attrs-DZ7RCEZm.mjs +0 -25
  156. package/src/components/HeroLink/HeroLink.module.css +0 -44
  157. package/src/components/HeroLink/HeroLink.tsx +0 -136
  158. package/src/components/HeroLink/index.ts +0 -2
@@ -0,0 +1,437 @@
1
+ import { _ as __rest, a as __assign, f as filterAttrs } from './filter-attrs-D-1kWaCP.mjs';
2
+ import React__default, { lazy, useRef, useEffect, useCallback, useState, Suspense } from 'react';
3
+ import { c as classNames } from './index-BfTCfPZ1.mjs';
4
+ import { Icon } from '@arc-ui/components/Icon';
5
+ import { Visible } from '@arc-ui/components/Visible';
6
+
7
+ /**
8
+ * Do not edit directly
9
+ * Generated file
10
+ */
11
+
12
+ const ArcIconPlay =
13
+ "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 56 56'%3e%3cpath fill='currentColor' d='M36.468 26.32 23.907 19.07A1.938 1.938 0 0 0 21 20.745V35.25a1.935 1.935 0 0 0 2.907 1.68l12.561-7.254a1.938 1.938 0 0 0 0-3.354m-.875 1.84-12.561 7.254a.18.18 0 0 1-.187 0 .18.18 0 0 1-.095-.165V20.745a.18.18 0 0 1 .095-.16.18.18 0 0 1 .187 0l12.561 7.25a.18.18 0 0 1 .095.164.18.18 0 0 1-.095.16'/%3e%3c/svg%3e";
14
+
15
+ const AUDIO_EXTENSIONS = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i;
16
+ const VIDEO_EXTENSIONS = /\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i;
17
+ const HLS_EXTENSIONS = /\.(m3u8)($|\?)/i;
18
+ const DASH_EXTENSIONS = /\.(mpd)($|\?)/i;
19
+ const MATCH_URL_MUX = /stream\.mux\.com\/(?!\w+\.m3u8)(\w+)/;
20
+ const MATCH_URL_YOUTUBE = /(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//;
21
+ const MATCH_URL_VIMEO = /vimeo\.com\/(?!progressive_redirect).+/;
22
+ const MATCH_URL_WISTIA = /(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/;
23
+ const MATCH_URL_SPOTIFY = /open\.spotify\.com\/(\w+)\/(\w+)/i;
24
+ const MATCH_URL_TWITCH = /(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+|(videos?\/|\?video=)\d+)($|\?)/;
25
+ const MATCH_URL_TIKTOK = /tiktok\.com\/(?:player\/v1\/|share\/video\/|@[^/]+\/video\/)([0-9]+)/;
26
+ const canPlayFile = (url, test) => {
27
+ if (Array.isArray(url)) {
28
+ for (const item of url) {
29
+ if (typeof item === "string" && canPlayFile(item, test)) {
30
+ return true;
31
+ }
32
+ if (canPlayFile(item.src, test)) {
33
+ return true;
34
+ }
35
+ }
36
+ return false;
37
+ }
38
+ return test(url);
39
+ };
40
+ const canPlay = {
41
+ html: (url) => canPlayFile(url, (u) => AUDIO_EXTENSIONS.test(u) || VIDEO_EXTENSIONS.test(u)),
42
+ hls: (url) => canPlayFile(url, (u) => HLS_EXTENSIONS.test(u)),
43
+ dash: (url) => canPlayFile(url, (u) => DASH_EXTENSIONS.test(u)),
44
+ mux: (url) => MATCH_URL_MUX.test(url),
45
+ youtube: (url) => MATCH_URL_YOUTUBE.test(url),
46
+ vimeo: (url) => MATCH_URL_VIMEO.test(url) && !VIDEO_EXTENSIONS.test(url) && !HLS_EXTENSIONS.test(url),
47
+ wistia: (url) => MATCH_URL_WISTIA.test(url),
48
+ spotify: (url) => MATCH_URL_SPOTIFY.test(url),
49
+ twitch: (url) => MATCH_URL_TWITCH.test(url),
50
+ tiktok: (url) => MATCH_URL_TIKTOK.test(url)
51
+ };
52
+
53
+ const HtmlPlayer = React__default.forwardRef((props, ref) => {
54
+ const Media = AUDIO_EXTENSIONS.test(`${props.src}`) ? "audio" : "video";
55
+ return /* @__PURE__ */ React__default.createElement(Media, { ...props, ref }, props.children);
56
+ });
57
+ var HtmlPlayer_default = HtmlPlayer;
58
+
59
+ const Players = [
60
+ {
61
+ key: "hls",
62
+ name: "hls.js",
63
+ canPlay: canPlay.hls,
64
+ canEnablePIP: () => true,
65
+ player: lazy(
66
+ () => import(
67
+ /* webpackChunkName: 'reactPlayerHls' */
68
+ './react-Ca6E7Fr-.mjs'
69
+ )
70
+ )
71
+ },
72
+ {
73
+ key: "dash",
74
+ name: "dash.js",
75
+ canPlay: canPlay.dash,
76
+ canEnablePIP: () => true,
77
+ player: lazy(
78
+ () => import(
79
+ /* webpackChunkName: 'reactPlayerDash' */
80
+ './react-WW_9iHcl.mjs'
81
+ )
82
+ )
83
+ },
84
+ {
85
+ key: "mux",
86
+ name: "Mux",
87
+ canPlay: canPlay.mux,
88
+ canEnablePIP: () => true,
89
+ player: lazy(
90
+ () => import(
91
+ /* webpackChunkName: 'reactPlayerMux' */
92
+ './index-CrcIrdjn.mjs'
93
+ )
94
+ )
95
+ },
96
+ {
97
+ key: "youtube",
98
+ name: "YouTube",
99
+ canPlay: canPlay.youtube,
100
+ player: lazy(
101
+ () => import(
102
+ /* webpackChunkName: 'reactPlayerYouTube' */
103
+ './react-DZyqy7W7.mjs'
104
+ )
105
+ )
106
+ },
107
+ {
108
+ key: "vimeo",
109
+ name: "Vimeo",
110
+ canPlay: canPlay.vimeo,
111
+ player: lazy(
112
+ () => import(
113
+ /* webpackChunkName: 'reactPlayerVimeo' */
114
+ './react-BGimq-TB.mjs'
115
+ )
116
+ )
117
+ },
118
+ {
119
+ key: "wistia",
120
+ name: "Wistia",
121
+ canPlay: canPlay.wistia,
122
+ canEnablePIP: () => true,
123
+ player: lazy(
124
+ () => import(
125
+ /* webpackChunkName: 'reactPlayerWistia' */
126
+ './react-DG070IvZ.mjs'
127
+ )
128
+ )
129
+ },
130
+ {
131
+ key: "spotify",
132
+ name: "Spotify",
133
+ canPlay: canPlay.spotify,
134
+ canEnablePIP: () => false,
135
+ player: lazy(
136
+ () => import(
137
+ /* webpackChunkName: 'reactPlayerSpotify' */
138
+ './react-BHT4t_eQ.mjs'
139
+ )
140
+ )
141
+ },
142
+ {
143
+ key: "twitch",
144
+ name: "Twitch",
145
+ canPlay: canPlay.twitch,
146
+ canEnablePIP: () => false,
147
+ player: lazy(
148
+ () => import(
149
+ /* webpackChunkName: 'reactPlayerTwitch' */
150
+ './react-CSr43fZV.mjs'
151
+ )
152
+ )
153
+ },
154
+ {
155
+ key: "tiktok",
156
+ name: "TikTok",
157
+ canPlay: canPlay.tiktok,
158
+ canEnablePIP: () => false,
159
+ player: lazy(
160
+ () => import(
161
+ /* webpackChunkName: 'reactPlayerTiktok' */
162
+ './react-BSd0sGcO.mjs'
163
+ )
164
+ )
165
+ },
166
+ {
167
+ key: "html",
168
+ name: "html",
169
+ canPlay: canPlay.html,
170
+ canEnablePIP: () => true,
171
+ player: HtmlPlayer_default
172
+ }
173
+ ];
174
+ var players_default = Players;
175
+
176
+ const defaultProps = {
177
+ // Falsy values don't need to be defined
178
+ //
179
+ // native video attrs
180
+ // src: undefined,
181
+ // preload: undefined,
182
+ // crossOrigin: undefined,
183
+ // autoPlay: false,
184
+ // muted: false,
185
+ // loop: false,
186
+ // controls: false,
187
+ // playsInline: false,
188
+ // disableRemotePlayback: false,
189
+ width: "320px",
190
+ height: "180px",
191
+ // native video props
192
+ volume: 1,
193
+ playbackRate: 1,
194
+ // custom props
195
+ // playing: undefined,
196
+ // pip: false,
197
+ // light: false,
198
+ // fallback: null,
199
+ previewTabIndex: 0,
200
+ previewAriaLabel: "",
201
+ oEmbedUrl: "https://noembed.com/embed?url={url}"
202
+ };
203
+
204
+ const Player = React__default.forwardRef((props, ref) => {
205
+ const { playing, pip } = props;
206
+ const Player2 = props.activePlayer;
207
+ const playerRef = useRef(null);
208
+ const startOnPlayRef = useRef(true);
209
+ useEffect(() => {
210
+ var _a, _b;
211
+ if (!playerRef.current) return;
212
+ if (playerRef.current.paused && playing === true) {
213
+ playerRef.current.play();
214
+ }
215
+ if (!playerRef.current.paused && playing === false) {
216
+ playerRef.current.pause();
217
+ }
218
+ playerRef.current.playbackRate = (_a = props.playbackRate) != null ? _a : 1;
219
+ playerRef.current.volume = (_b = props.volume) != null ? _b : 1;
220
+ });
221
+ useEffect(() => {
222
+ var _a, _b, _c, _d, _e;
223
+ if (!playerRef.current || !globalThis.document) return;
224
+ if (pip && !document.pictureInPictureElement) {
225
+ try {
226
+ (_b = (_a = playerRef.current).requestPictureInPicture) == null ? void 0 : _b.call(_a);
227
+ } catch (err) {
228
+ }
229
+ }
230
+ if (!pip && document.pictureInPictureElement) {
231
+ try {
232
+ (_d = (_c = playerRef.current).exitPictureInPicture) == null ? void 0 : _d.call(_c);
233
+ (_e = document.exitPictureInPicture) == null ? void 0 : _e.call(document);
234
+ } catch (err) {
235
+ }
236
+ }
237
+ }, [pip]);
238
+ const handleLoadStart = (event) => {
239
+ var _a, _b;
240
+ startOnPlayRef.current = true;
241
+ (_a = props.onReady) == null ? void 0 : _a.call(props);
242
+ (_b = props.onLoadStart) == null ? void 0 : _b.call(props, event);
243
+ };
244
+ const handlePlay = (event) => {
245
+ var _a, _b;
246
+ if (startOnPlayRef.current) {
247
+ startOnPlayRef.current = false;
248
+ (_a = props.onStart) == null ? void 0 : _a.call(props, event);
249
+ }
250
+ (_b = props.onPlay) == null ? void 0 : _b.call(props, event);
251
+ };
252
+ if (!Player2) {
253
+ return null;
254
+ }
255
+ const eventProps = {};
256
+ const reactPlayerEventHandlers = ["onReady", "onStart"];
257
+ for (const key in props) {
258
+ if (key.startsWith("on") && !reactPlayerEventHandlers.includes(key)) {
259
+ eventProps[key] = props[key];
260
+ }
261
+ }
262
+ return /* @__PURE__ */ React__default.createElement(
263
+ Player2,
264
+ {
265
+ ...eventProps,
266
+ style: props.style,
267
+ className: props.className,
268
+ slot: props.slot,
269
+ ref: useCallback(
270
+ (node) => {
271
+ playerRef.current = node;
272
+ if (typeof ref === "function") {
273
+ ref(node);
274
+ } else if (ref !== null) {
275
+ ref.current = node;
276
+ }
277
+ },
278
+ [ref]
279
+ ),
280
+ src: props.src,
281
+ crossOrigin: props.crossOrigin,
282
+ preload: props.preload,
283
+ controls: props.controls,
284
+ muted: props.muted,
285
+ autoPlay: props.autoPlay,
286
+ loop: props.loop,
287
+ playsInline: props.playsInline,
288
+ disableRemotePlayback: props.disableRemotePlayback,
289
+ config: props.config,
290
+ onLoadStart: handleLoadStart,
291
+ onPlay: handlePlay
292
+ },
293
+ props.children
294
+ );
295
+ });
296
+ Player.displayName = "Player";
297
+ var Player_default = Player;
298
+
299
+ const Preview = lazy(() => import(
300
+ /* webpackChunkName: 'reactPlayerPreview' */
301
+ './Preview-CmbKOgEO.mjs'
302
+ ));
303
+ const customPlayers = [];
304
+ const createReactPlayer = (players, playerFallback) => {
305
+ const getActivePlayer = (src) => {
306
+ for (const player of [...customPlayers, ...players]) {
307
+ if (src && player.canPlay(src)) {
308
+ return player;
309
+ }
310
+ }
311
+ if (playerFallback) {
312
+ return playerFallback;
313
+ }
314
+ return null;
315
+ };
316
+ const ReactPlayer = React__default.forwardRef((_props, ref) => {
317
+ const props = { ...defaultProps, ..._props };
318
+ const { src, slot, className, style, width, height, fallback, wrapper } = props;
319
+ const [showPreview, setShowPreview] = useState(!!props.light);
320
+ useEffect(() => {
321
+ if (props.light) {
322
+ setShowPreview(true);
323
+ } else {
324
+ setShowPreview(false);
325
+ }
326
+ }, [props.light]);
327
+ const handleClickPreview = (e) => {
328
+ var _a;
329
+ setShowPreview(false);
330
+ (_a = props.onClickPreview) == null ? void 0 : _a.call(props, e);
331
+ };
332
+ const renderPreview = (src2) => {
333
+ if (!src2) return null;
334
+ const { light, playIcon, previewTabIndex, oEmbedUrl, previewAriaLabel } = props;
335
+ return /* @__PURE__ */ React__default.createElement(
336
+ Preview,
337
+ {
338
+ src: src2,
339
+ light,
340
+ playIcon,
341
+ previewTabIndex,
342
+ previewAriaLabel,
343
+ oEmbedUrl,
344
+ onClickPreview: handleClickPreview
345
+ }
346
+ );
347
+ };
348
+ const renderActivePlayer = (src2) => {
349
+ var _a, _b;
350
+ const player = getActivePlayer(src2);
351
+ if (!player) return null;
352
+ const { style: style2, width: width2, height: height2, wrapper: wrapper2 } = props;
353
+ const config = (_a = props.config) == null ? void 0 : _a[player.key];
354
+ return /* @__PURE__ */ React__default.createElement(
355
+ Player_default,
356
+ {
357
+ ...props,
358
+ ref,
359
+ activePlayer: (_b = player.player) != null ? _b : player,
360
+ slot: wrapper2 ? void 0 : slot,
361
+ className: wrapper2 ? void 0 : className,
362
+ style: wrapper2 ? { display: "block", width: "100%", height: "100%" } : { display: "block", width: width2, height: height2, ...style2 },
363
+ config
364
+ }
365
+ );
366
+ };
367
+ const Wrapper = wrapper == null ? ForwardChildren : wrapper;
368
+ const UniversalSuspense = fallback === false ? ForwardChildren : Suspense;
369
+ return /* @__PURE__ */ React__default.createElement(Wrapper, { slot, className, style: { width, height, ...style } }, /* @__PURE__ */ React__default.createElement(UniversalSuspense, { fallback }, showPreview ? renderPreview(src) : renderActivePlayer(src)));
370
+ });
371
+ ReactPlayer.displayName = "ReactPlayer";
372
+ ReactPlayer.addCustomPlayer = (player) => {
373
+ customPlayers.push(player);
374
+ };
375
+ ReactPlayer.removeCustomPlayers = () => {
376
+ customPlayers.length = 0;
377
+ };
378
+ ReactPlayer.canPlay = (src) => {
379
+ if (src) {
380
+ for (const Player2 of [...customPlayers, ...players]) {
381
+ if (Player2.canPlay(src)) {
382
+ return true;
383
+ }
384
+ }
385
+ }
386
+ return false;
387
+ };
388
+ ReactPlayer.canEnablePIP = (src) => {
389
+ var _a;
390
+ if (src) {
391
+ for (const Player2 of [...customPlayers, ...players]) {
392
+ if (Player2.canPlay(src) && ((_a = Player2.canEnablePIP) == null ? void 0 : _a.call(Player2))) {
393
+ return true;
394
+ }
395
+ }
396
+ }
397
+ return false;
398
+ };
399
+ return ReactPlayer;
400
+ };
401
+ const ForwardChildren = ({ children }) => children;
402
+
403
+ const fallback = players_default[players_default.length - 1];
404
+ var src_default = createReactPlayer(players_default, fallback);
405
+
406
+ var styles$2 = {"playIconContainer":"VideoCardPlayIcon-module_playIconContainer__ZqZP3","playIconContainer--s":"VideoCardPlayIcon-module_playIconContainer--s__ETbOZ","playIconContainer--l":"VideoCardPlayIcon-module_playIconContainer--l__OGccg","playIcon":"VideoCardPlayIcon-module_playIcon__kzito"};
407
+
408
+ var VideoCardPlayIcon = function (_a) {
409
+ var _b = _a.size, size = _b === void 0 ? "l" : _b;
410
+ return (React__default.createElement("div", { className: classNames(styles$2.playIconContainer, styles$2["playIconContainer--".concat(size)]) },
411
+ React__default.createElement("div", { className: styles$2.playIcon },
412
+ React__default.createElement(Icon, { icon: ArcIconPlay }))));
413
+ };
414
+
415
+ var styles$1 = {"container":"VideoCardPlayer-module_container__G-Uta","player":"VideoCardPlayer-module_player__BgueT","playerWrapper":"VideoCardPlayer-module_playerWrapper__UcH1q","playerWrapper--landscape":"VideoCardPlayer-module_playerWrapper--landscape__shKv-","playerWrapper--portrait":"VideoCardPlayer-module_playerWrapper--portrait__7bKAr"};
416
+
417
+ var VideoCardPlayer = function (_a) {
418
+ var thumbnail = _a.thumbnail, playIconSize = _a.playIconSize, orientation = _a.orientation, children = _a.children, player = _a.player, props = __rest(_a, ["thumbnail", "playIconSize", "orientation", "children", "player"]);
419
+ var _b = useState(false), isClient = _b[0], setIsClient = _b[1];
420
+ useEffect(function () {
421
+ setIsClient(true);
422
+ }, []);
423
+ var playerProps = __assign(__assign({}, player), { light: thumbnail, playIcon: React__default.createElement(VideoCardPlayIcon, { size: playIconSize }), muted: !thumbnail, playing: true, controls: true, className: styles$1.player, width: "100%", height: "100%" });
424
+ return (React__default.createElement("div", __assign({ className: styles$1.container }, filterAttrs(props)),
425
+ React__default.createElement("div", { "data-testid": "arc-video-card", className: classNames(styles$1.playerWrapper, styles$1["playerWrapper--".concat(orientation)]) }, isClient && React__default.createElement(src_default, __assign({}, playerProps))),
426
+ children));
427
+ };
428
+
429
+ var styles = {"thumbnail":"VideoCardThumbnail-module_thumbnail__Yamk0","thumbnail--landscape":"VideoCardThumbnail-module_thumbnail--landscape__FmnLk","thumbnail--portrait":"VideoCardThumbnail-module_thumbnail--portrait__FZS93","thumbnailContent":"VideoCardThumbnail-module_thumbnailContent__cHham"};
430
+
431
+ var VideoCardThumbnail = function (_a) {
432
+ var orientation = _a.orientation, contentVisibility = _a.contentVisibility, src = _a.src, children = _a.children;
433
+ var content = React__default.createElement("div", { className: styles.thumbnailContent }, children);
434
+ return (React__default.createElement("div", { className: classNames(styles.thumbnail, styles["thumbnail--".concat(orientation)]), style: { backgroundImage: "url(".concat(src, ")") } }, contentVisibility ? (React__default.createElement(Visible, __assign({}, contentVisibility), content)) : (content)));
435
+ };
436
+
437
+ export { VideoCardPlayer as V, VideoCardThumbnail as a };