Module 299619

1,218 characters · in no known chunk
Dependencies
Required by (2)
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(e,t,n){"use strict";n.d(t,{A:()=>u});var r=n(627968),i=n(64700),s=n(663675),a=n(621466);function o(e){e.removeAttribute("src"),Array.from(e.children).forEach(e=>{(0,a.vq)(e,HTMLSourceElement)&&(e.removeAttribute("src"),e.removeAttribute("type")),(0,a.vq)(e,HTMLImageElement)&&e.removeAttribute("src")});try{e.load()}catch(e){}}let l=e=>{let{alt:t,externalRef:n,autoPlay:a,playOnHover:l,onPlayError:u,responsive:c,mediaLayoutType:d,useReducedMotion:_,...f}=e,p=!_&&!l&&a,h=i.useRef(null);function m(){l&&h?.current?.play()?.catch(e=>{if(null!=u)u(e);else throw e})}function E(){l&&h?.current?.pause()}function g(){return d===s.d.MOSAIC?{width:"100%",height:"100%",maxHeight:"inherit",objectFit:"contain"}:c?A():{}}function A(){return{maxWidth:f.width,maxHeight:f.height,width:"100%",height:"100%"}}return i.useLayoutEffect(()=>()=>{let{current:e}=h;null!=e&&o(e)},[]),i.useLayoutEffect(()=>("function"==typeof n?(n(null),n(h.current)):null!=n&&(n.current=h.current),()=>{"function"==typeof n?n(null):null!=n&&(n.current=null)}),[n,h]),(0,r.jsx)("video",{"aria-label":t,ref:h,autoPlay:p,onMouseEnter:m,onMouseLeave:E,onFocus:m,onBlur:E,style:g(),...f})},u=i.forwardRef((e,t)=>(0,r.jsx)(l,{...e,externalRef:t}))}