'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("@gem-sdk/core"),t=require("../../image/components/NextImage.js"),a=require("../hooks/useLiteHtml5Embed.js"),l=require("@gem-sdk/system"),r=require("../common/classes.js"),i=require("../common/styles.js"),o=require("../common/attrs.js");exports.default=c=>{let m=s.useEditorMode(),u="edit"!==m,{thumbnail:n,muted:d,autoplay:g,loop:p,controls:y,src:j,style:x,title:b,className:C,lazy:h,poster:q}=c,{playVideoAndTurnOffThumbnail:v,videoRef:f,showThumbnail:N}=a.default(g,d,j),I=!u&&g&&d&&!!n,T=!h&&c.isVideoComponent&&u,k=!n||!N,L=j||void 0,P=l.createAttr({...o.getHtml5Attr({title:b,autoplay:g,preloadThumbnail:I,offLazyLoad:T,src:j,thumbnail:n})}),w=l.createClass({...r.getWrapThumbnailClasses(k)}),A=l.createStyle({...i.getPreloadImageStyle()}),M=l.createClass({...r.getButtonThumbnailClasses()}),S=l.createClass({...r.getImageThumbnailClasses()}),V=l.createClass({...r.getVideoYoutubeClasses(C,T)});return e.jsxs(e.Fragment,{children:[I?e.jsx(t.default,{src:n,alt:b,priority:!0,style:A}):"",e.jsx("video",{ref:f,...P,style:x,className:V,controls:y,loop:p,muted:d,autoPlay:g,playsInline:!0,src:L}),!k&&e.jsxs("div",{role:"presentation",style:x,className:w,onClick:v,children:[e.jsx(t.default,{id:"video-thumbnail",src:n??"",alt:q?.altText,title:q?.imageTitle,priority:q?.preload&&u,className:S,isDisableAspectStyle:!0,enableLazyLoadImage:!0}),e.jsx("button",{type:"button",className:M,"aria-label":"Play",children:e.jsx("svg",{className:"gp-w-5 gp-text-white",viewBox:"0 0 24 24",children:e.jsx("path",{fill:"currentColor",d:"M5 5.274c0-1.707 1.826-2.792 3.325-1.977l12.362 6.726c1.566.853 1.566 3.101 0 3.953L8.325 20.702C6.826 21.518 5 20.432 5 18.726V5.274Z"})})})]})]})};
