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