"use strict";(self.webpackChunkdrExports=self.webpackChunkdrExports||[]).push([[353],{1924:function(e,r,t){t.r(r),t.d(r,{default:function(){return i}});var a=t(1609);const n="64px",l={};var i=({src:e,light:r,oEmbedUrl:t,onClickPreview:i,playIcon:o,previewTabIndex:s,previewAriaLabel:c})=>{const[d,u]=(0,a.useState)(null);(0,a.useEffect)(()=>{e&&r&&t&&p({src:e,light:r,oEmbedUrl:t})},[e,r,t]);const p=async({src:e,light:r,oEmbedUrl:t})=>{if(a.isValidElement(r))return;if("string"==typeof r)return void u(r);if(l[e])return void u(l[e]);u(null);const n=await fetch(t.replace("{url}",e)),i=await n.json();if(i.thumbnail_url){const r=i.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");u(r),l[e]=r}},h=a.isValidElement(r),b={display:"flex",alignItems:"center",justifyContent:"center"},g={preview:{width:"100%",height:"100%",backgroundImage:d&&!h?`url(${d})`: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:n,width:n,height:n,position:h?"absolute":void 0,...b},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},y=a.createElement("div",{style:g.shadow,className:"react-player__shadow"},a.createElement("div",{style:g.playIcon,className:"react-player__play-icon"}));return a.createElement("div",{style:g.preview,className:"react-player__preview",tabIndex:s,onClick:e=>{null==i||i(e)},onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||null==i||i(e)},...c?{"aria-label":c}:{}},h?r:null,o||y)}}}]);