import"./rolldown-runtime-DIIn1E2Q.js";import{nt as e}from"./vendor-primevue-BDZ_jj__.js";import{A as t,Bt as n,D as r,G as i,I as a,O as o,R as s,Rt as c,Ut as l,_t as u,et as d,j as f,ut as p}from"./vendor-vue-core-DO0afONr.js";import{t as m}from"./Button-Ca3rDegY.js";import{t as h}from"./Slider-D50kmiD4.js";var g={key:0,class:`pointer-events-auto absolute top-0 left-0 z-10 flex w-full flex-col items-center gap-2 pt-2`},_={class:`flex items-center justify-center gap-2`},v={class:`flex w-full max-w-xs items-center gap-2 px-4`},y={class:`min-w-16 text-xs text-base-foreground`},b=s({__name:`AnimationControls`,props:{animations:{},animationsModifiers:{},playing:{type:Boolean},playingModifiers:{},selectedSpeed:{},selectedSpeedModifiers:{},selectedAnimation:{},selectedAnimationModifiers:{},animationProgress:{default:0},animationProgressModifiers:{},animationDuration:{default:0},animationDurationModifiers:{}},emits:i([`seek`],[`update:animations`,`update:playing`,`update:selectedSpeed`,`update:selectedAnimation`,`update:animationProgress`,`update:animationDuration`]),setup(i,{emit:s}){let b=p(i,`animations`),x=p(i,`playing`),S=p(i,`selectedSpeed`),C=p(i,`selectedAnimation`),w=p(i,`animationProgress`),T=p(i,`animationDuration`),E=s,D=[{name:`0.1x`,value:.1},{name:`0.5x`,value:.5},{name:`1x`,value:1},{name:`1.5x`,value:1.5},{name:`2x`,value:2}],O=r(()=>T.value?w.value/100*T.value:0);function formatTime(e){let t=Math.floor(e/60),n=(e%60).toFixed(1);return t>0?`${t}:${n.padStart(4,`0`)}`:`${n}s`}function togglePlay(){x.value=!x.value}function handleSliderChange(e){if(!e)return;let t=e[0];w.value=t,E(`seek`,t)}return(r,i)=>b.value&&b.value.length>0?(d(),f(`div`,g,[o(`div`,_,[a(m,{size:`icon`,variant:`textonly`,class:`rounded-full`,"aria-label":r.$t(`g.playPause`),onClick:togglePlay},{default:u(()=>[o(`i`,{class:n([`pi`,x.value?`pi-pause`:`pi-play`,`text-lg text-base-foreground`])},null,2)]),_:1},8,[`aria-label`]),a(c(e),{modelValue:S.value,"onUpdate:modelValue":i[0]||=e=>S.value=e,options:D,"option-label":`name`,"option-value":`value`,class:`w-24`},null,8,[`modelValue`]),a(c(e),{modelValue:C.value,"onUpdate:modelValue":i[1]||=e=>C.value=e,options:b.value,"option-label":`name`,"option-value":`index`,class:`w-32`},null,8,[`modelValue`,`options`])]),o(`div`,v,[a(h,{"model-value":[w.value],min:0,max:100,step:.1,class:`flex-1`,"onUpdate:modelValue":handleSliderChange},null,8,[`model-value`]),o(`span`,y,l(formatTime(O.value))+` / `+l(formatTime(T.value)),1)])])):t(``,!0)}});export{b as t};
//# sourceMappingURL=AnimationControls-55ndBLKY.js.map