import{r as n,j as a}from"./index-2SI3TtYZ.js";import{c as y,ad as N}from"./LoginPage-yYkKaUvX.js";const E=100,F=(e,o)=>{const r=e||-1;return o*E/r},W=(e,o,r)=>e>=o&&e<=r,R=(e,o,r)=>{const c=W(e,o,r),u=r-o,C=e-o;return c?C/u:0},$=(e,o,r)=>{const c=o*E/r;return Math.floor(+(c*(e/E)))},A=n.memo(({startTime:e,maxTime:o,endTime:r,trackWidth:c=0,currentTime:u,seekHoverTime:C})=>{const d=F(o,e),l=c/100*d,k=(r-e)/o*100,f=c/100*k,h=R(u,e,r),g=R(C,e,r);return a.jsxs("div",{className:"main",style:{width:`${f}px`,left:`${l}px`},children:[a.jsx("div",{className:"inner-seek-block seek-hover",style:{transform:`scaleX(${g})`}}),a.jsx("div",{className:"inner-seek-block connect",style:{transform:`scaleX(${h})`}})]})}),z=({max:e=1e3,currentTime:o=0,onChange:r=()=>{},onChangeEnd:c=()=>{},fullScreen:u})=>{const[C,d]=n.useState(0),[l,S]=n.useState(0),[k,f]=n.useState(!1),h=n.useRef(!1),g=n.useRef(!1),m=n.useRef(null),X=$(e,C,l),M=t=>{var b;const i=((b=m.current)==null?void 0:b.getBoundingClientRect().left)||0;let s=t-i;s=s<0?0:s,s=s>l?l:s,d(s);const p=+(s*100/l*(e/100)).toFixed(0);r(p)},x=t=>{var v;if(t.preventDefault(),t.stopPropagation(),!g.current)return;const{changedTouches:i}=t;let s=((v=i==null?void 0:i[i.length-1])==null?void 0:v.pageX)||0;s=s<0?0:s,M(s)},H=t=>{h.current&&M(t.pageX)},w=()=>{m.current&&S(m.current.offsetWidth)},V=(t,i)=>{var p;const s=((p=m.current)==null?void 0:p.getBoundingClientRect().left)||0,v=t?0:i.pageX-s;d(v)},Z=()=>({transform:`translateX(${l/(e/o)}px)`}),P=(t=!0)=>{g.current=t,d(t?C:0)},T=(t,i)=>{i.preventDefault(),h.current=t,H(i),d(t?C:0)},L=t=>{T(!1,t),c()},j=()=>{P(!1),c()},B=()=>{f(!0),P(!0)},D=()=>{setTimeout(()=>f(!1),2e3)};return n.useEffect(()=>(w(),window.addEventListener("resize",w),window.addEventListener("mousemove",H),window.addEventListener("mouseup",L),window.addEventListener("touchmove",x),window.addEventListener("touchend",j),()=>{window.removeEventListener("resize",w),window.removeEventListener("mousemove",H),window.removeEventListener("mouseup",L),window.removeEventListener("touchmove",x),window.removeEventListener("touchend",j)}),[e,l]),n.useEffect(()=>{setTimeout(()=>w(),1)},[u]),a.jsxs("div",{className:y("seek-slider",k&&"enlarged"),children:[a.jsx("div",{className:"track",ref:m,onMouseMove:t=>V(!1,t),onMouseLeave:t=>V(!0,t),onMouseDown:t=>T(!0,t),onTouchStart:B,onTouchEnd:D,children:a.jsx(A,{trackWidth:l,maxTime:e,startTime:0,endTime:e,currentTime:o,seekHoverTime:X})}),a.jsx("div",{className:"thumb",style:Z(),children:a.jsx("div",{className:"handler"})})]})},G=e=>n.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},n.createElement("path",{d:"M8.36364 2H5.63636C3.62809 2 2 3.62806 2 5.63636V8.36364M2 15.6364V18.3636C2 20.3719 3.62809 22 5.63636 22H8.36364M15.6364 22H18.3636C20.3719 22 22 20.3719 22 18.3636V15.6364M22 8.36364V5.63636C22 3.62806 20.3719 2 18.3636 2H15.6364",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),q=e=>n.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},n.createElement("path",{d:"M1 12C1 7.41699 1 5.12549 2.16712 3.51909C2.54405 3.00029 3.00029 2.54405 3.51909 2.16712C5.12549 1 7.41699 1 12 1C16.583 1 18.8745 1 20.4809 2.16712C20.9997 2.54405 21.456 3.00029 21.8329 3.51909C23 5.12549 23 7.41699 23 12C23 16.583 23 18.8745 21.8329 20.4809C21.456 20.9997 20.9997 21.456 20.4809 21.8329C18.8745 23 16.583 23 12 23C7.41699 23 5.12549 23 3.51909 21.8329C3.00029 21.456 2.54405 20.9997 2.16712 20.4809C1 18.8745 1 16.583 1 12Z",stroke:"#FAFAFA",strokeWidth:1.5}),n.createElement("path",{d:"M7.773 16.084C7.213 16.084 6.709 15.988 6.261 15.796C5.813 15.596 5.461 15.316 5.205 14.956C4.949 14.596 4.821 14.176 4.821 13.696H6.285C6.317 14.056 6.457 14.352 6.705 14.584C6.961 14.816 7.317 14.932 7.773 14.932C8.245 14.932 8.613 14.82 8.877 14.596C9.141 14.364 9.273 14.068 9.273 13.708C9.273 13.428 9.189 13.2 9.021 13.024C8.861 12.848 8.657 12.712 8.409 12.616C8.169 12.52 7.833 12.416 7.401 12.304C6.857 12.16 6.413 12.016 6.069 11.872C5.733 11.72 5.445 11.488 5.205 11.176C4.965 10.864 4.845 10.448 4.845 9.928C4.845 9.448 4.965 9.028 5.205 8.668C5.445 8.308 5.781 8.032 6.213 7.84C6.645 7.648 7.145 7.552 7.713 7.552C8.521 7.552 9.181 7.756 9.693 8.164C10.213 8.564 10.501 9.116 10.557 9.82H9.045C9.021 9.516 8.877 9.256 8.613 9.04C8.349 8.824 8.001 8.716 7.569 8.716C7.177 8.716 6.857 8.816 6.609 9.016C6.361 9.216 6.237 9.504 6.237 9.88C6.237 10.136 6.313 10.348 6.465 10.516C6.625 10.676 6.825 10.804 7.065 10.9C7.305 10.996 7.633 11.1 8.049 11.212C8.601 11.364 9.049 11.516 9.393 11.668C9.745 11.82 10.041 12.056 10.281 12.376C10.529 12.688 10.653 13.108 10.653 13.636C10.653 14.06 10.537 14.46 10.305 14.836C10.081 15.212 9.749 15.516 9.309 15.748C8.877 15.972 8.365 16.084 7.773 16.084ZM14.9912 7.66C15.8792 7.66 16.6552 7.832 17.3192 8.176C17.9912 8.512 18.5072 9 18.8672 9.64C19.2352 10.272 19.4192 11.012 19.4192 11.86C19.4192 12.708 19.2352 13.444 18.8672 14.068C18.5072 14.692 17.9912 15.172 17.3192 15.508C16.6552 15.836 15.8792 16 14.9912 16H12.2672V7.66H14.9912ZM14.9912 14.884C15.9672 14.884 16.7152 14.62 17.2352 14.092C17.7552 13.564 18.0152 12.82 18.0152 11.86C18.0152 10.892 17.7552 10.136 17.2352 9.592C16.7152 9.048 15.9672 8.776 14.9912 8.776H13.6352V14.884H14.9912Z",fill:"white"})),J=e=>n.createElement("svg",{width:22,height:22,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.16712 2.51909C0 4.12549 0 6.41699 0 11C0 15.583 0 17.8745 1.16712 19.4809C1.54405 19.9997 2.00029 20.456 2.51909 20.8329C4.12549 22 6.41699 22 11 22C15.583 22 17.8745 22 19.4809 20.8329C19.9997 20.456 20.456 19.9997 20.8329 19.4809C22 17.8745 22 15.583 22 11C22 6.41699 22 4.12549 20.8329 2.51909C20.456 2.00029 19.9997 1.54405 19.4809 1.16712C17.8745 0 15.583 0 11 0C6.41699 0 4.12549 0 2.51909 1.16712C2.00029 1.54405 1.54405 2.00029 1.16712 2.51909ZM10.0756 15V6.66H8.70763V10.236H4.78363V6.66H3.41563V15H4.78363V11.352H8.70763V15H10.0756ZM16.9286 7.176C16.2646 6.832 15.4886 6.66 14.6006 6.66H11.8766V15H14.6006C15.4886 15 16.2646 14.836 16.9286 14.508C17.6006 14.172 18.1166 13.692 18.4766 13.068C18.8446 12.444 19.0286 11.708 19.0286 10.86C19.0286 10.012 18.8446 9.272 18.4766 8.64C18.1166 8 17.6006 7.512 16.9286 7.176ZM16.8446 13.092C16.3246 13.62 15.5766 13.884 14.6006 13.884H13.2446V7.776H14.6006C15.5766 7.776 16.3246 8.048 16.8446 8.592C17.3646 9.136 17.6246 9.892 17.6246 10.86C17.6246 11.82 17.3646 12.564 16.8446 13.092Z",fill:"white"})),K=({id:e})=>{N.emit("set_playing_gif",{id:e})},O=({id:e})=>{N.emit("toggle_fullscreen",{id:e})};export{z as P,G as S,J as a,q as b,K as c,O as o}; //# sourceMappingURL=busHandlers-qQRaWD8D.js.map