"use client";import{c as n}from"./chunk-S7CSCIW4.mjs";import"./chunk-JZXLCA2E.mjs";import{useCallback as c,useState as b}from"react";import g from"next/dynamic";import{jsx as o,jsxs as P}from"react/jsx-runtime";var v=({className:t,...e})=>P("svg",{className:n("size-full",t),viewBox:"0 0 123 123",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o("circle",{cx:"61.5",cy:"61.5",r:"61.5",fillOpacity:"0.922864"}),o("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M82.7064 62.0304L48.7754 81.6468V42.4141L82.7064 62.0304Z",stroke:"white"})]}),r=({onClick:t})=>o("button",{className:"absolute left-1/2 top-1/2 w-1/5 -translate-x-1/2 -translate-y-1/2 transition hover:scale-90",type:"button","aria-label":"Play video",onClick:t,children:o(v,{})});import{jsx as l}from"react/jsx-runtime";var h=g(()=>import("react-player/lazy").then(t=>t.default),{ssr:!1}),B=({url:t,autoPlay:e=!1,loop:p,controls:u,lazyLoad:s=!1,placeholderImageUrl:m,muted:f})=>{let[d,a]=b(e),i=c(()=>a(!0),[]),y=c(()=>a(!1),[]);return l("div",{className:"relative aspect-video size-full [&_video]:!object-cover",children:t&&l(h,{className:"absolute left-0 top-0",url:t,playing:d,onPause:y,onPlay:i,width:"100%",height:"100%",controls:u,muted:f,loop:p,light:s&&m||s,playIcon:l(r,{onClick:i})})})};export{B as Video};
