import{r as e}from"./rolldown-runtime-DIIn1E2Q.js";import{$ as t}from"./vendor-primevue-DYf-ECwY.js";import{A as n,D as r,G as i,Ht as a,I as o,Lt as s,O as c,R as l,_t as u,et as d,j as f,ut as p,zt as m}from"./vendor-vue-core-IZuWV8u3.js";import{t as h}from"./Button-BOHBs1GV.js";import{t as g}from"./Slider-DeXCBGeM.js";var _={key:0,class:`pointer-events-auto absolute top-0 left-0 z-10 flex w-full flex-col items-center gap-2 pt-2`},v={class:`flex items-center justify-center gap-2`},y={class:`flex w-full max-w-xs items-center gap-2 px-4`},b={class:`min-w-16 text-xs text-base-foreground`},x=l({__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(e,{emit:i}){let l=p(e,`animations`),x=p(e,`playing`),S=p(e,`selectedSpeed`),C=p(e,`selectedAnimation`),w=p(e,`animationProgress`),T=p(e,`animationDuration`),E=i,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(e,r)=>l.value&&l.value.length>0?(d(),f(`div`,_,[c(`div`,v,[o(h,{size:`icon`,variant:`textonly`,class:`rounded-full`,"aria-label":e.$t(`g.playPause`),onClick:togglePlay},{default:u(()=>[c(`i`,{class:m([`pi`,x.value?`pi-pause`:`pi-play`,`text-lg text-base-foreground`])},null,2)]),_:1},8,[`aria-label`]),o(s(t),{modelValue:S.value,"onUpdate:modelValue":r[0]||=e=>S.value=e,options:D,"option-label":`name`,"option-value":`value`,class:`w-24`},null,8,[`modelValue`]),o(s(t),{modelValue:C.value,"onUpdate:modelValue":r[1]||=e=>C.value=e,options:l.value,"option-label":`name`,"option-value":`index`,class:`w-32`},null,8,[`modelValue`,`options`])]),c(`div`,y,[o(g,{"model-value":[w.value],min:0,max:100,step:.1,class:`flex-1`,"onUpdate:modelValue":handleSliderChange},null,8,[`model-value`]),c(`span`,b,a(formatTime(O.value))+` / `+a(formatTime(T.value)),1)])])):n(``,!0)}});export{x as t};
//# sourceMappingURL=AnimationControls-CcP6lJYg.js.map