"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6353],{36584:(e,r,t)=>{t.r(r),t.d(r,{default:()=>n});var a=t(12115);let l="64px",i={};var n=({src:e,light:r,oEmbedUrl:t,onClickPreview:n,playIcon:s,previewTabIndex:o,previewAriaLabel:d})=>{let[c,u]=(0,a.useState)(null);(0,a.useEffect)(()=>{e&&r&&t&&p({src:e,light:r,oEmbedUrl:t})},[e,r,t]);let p=async({src:e,light:r,oEmbedUrl:t})=>{if(a.isValidElement(r))return;if("string"==typeof r)return void u(r);if(i[e])return void u(i[e]);u(null);let l=await fetch(t.replace("{url}",e)),n=await l.json();if(n.thumbnail_url){let r=n.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");u(r),i[e]=r}},h=a.isValidElement(r),b={display:"flex",alignItems:"center",justifyContent:"center"},y={preview:{width:"100%",height:"100%",backgroundImage:c&&!h?`url(${c})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...b},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:l,width:l,height:l,position:h?"absolute":void 0,...b},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},g=a.createElement("div",{style:y.shadow,className:"react-player__shadow"},a.createElement("div",{style:y.playIcon,className:"react-player__play-icon"}));return a.createElement("div",{style:y.preview,className:"react-player__preview",tabIndex:o,onClick:e=>{null==n||n(e)},onKeyPress:e=>{("Enter"===e.key||" "===e.key)&&(null==n||n(e))},...d?{"aria-label":d}:{}},h?r:null,s||g)}}}]);