import{template as e,RenderIf as t,isLocalEnv as s,baseAssetURL as i}from"@gem-sdk/core";import{getSettingPreloadData as l}from"../../helpers.js";import{createStateOrContext as r,createStyle as a,createClass as m,If as o}from"@gem-sdk/system";import{getArticleVimeoClasses as p,getImageVimeoClasses as c,getButtonVimeoClasses as d,getIframeVimeoClasses as f}from"../common/classes.js";import{getIframeVimeoStyle as g,getArticleVimeoStyle as n}from"../common/styles.js";import{getVimeoParams as y}from"../common/helpers.js";import $ from"../../image/components/NextImage.liquid.js";let h=h=>{let{title:u,id:b,lazy:v,aspectRatio:S,autoplay:j,muted:w,thumbnailLink:x,poster:E,translatedVideoUrl:k,pageContext:N}=h,{iframeSrc:A}=y(h),I=!v,T=h.thumbnail,V=r({id:b,thumbnail:x,lazy:v,iframeSrc:A,title:u,autoplay:j,muted:w,style:h?.vimeoStyleIframe||"",translatedVideoUrl:k}),C=a({...g(S)}),G=a({...n(S,"")}),L=m({...p(T,S)}),M=m({...c(I)}),O=m({...d(I)}),P=m({...f()});return e`
    <gp-lite-vimeo-embed gp-data='${JSON.stringify(V)}'>
      <article
        aria-hidden
        class="${L}"
        data-title="${u}"
        style="${G}"
      >
      ${$({src:T,alt:E?.altText,title:E?.imageTitle,className:M,isDisableAspectStyle:!0,pageContext:N,priority:E?.preload,height:E?.height,width:E?.width})}
         ${o(!I,e`
          <button type="button" class="${O}" aria-label="Play">
          <svg class="gp-w-5 gp-text-white" viewBox="0 0 24 24">
            <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"
            />
          </svg>
        </button>`)}
        ${o(I,e`
          <iframe
            style="${C}"
            title="${u}"
            frameborder="0"
            allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
            allowfullscreen
            src="${A}"
            class="${P}"
          ></iframe>`)}
      </article>
    </gp-lite-vimeo-embed>
    ${t(s,`<script ${l('class="gps-link" delay',"src")}="{{ 'gp-lite-vimeo-embed-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${l('class="gps-link" delay',"src")}="${i}/assets-v2/gp-lite-vimeo-embed-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
  `};export{h as default};
