1import{o as ce,r as i,b as W,j as u}from"./constants-Cot2Ohot.js";import{w as p,f as ue,K as B,c as de,h as fe}from"./index-CmrRmcEC.js";import{a as pe}from"./ReactPlayer-IR1En65Y.js";import{d as he}from"./index.esm-DF0swfqG.js";import{I as V}from"./Icon-Bt01rcx3.js";import{u as be}from"./useAxios-CRmKBirv.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"[email protected]"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="0c061d08-df85-403f-bac3-ba7e0896cb9a",e._sentryDebugIdIdentifier="sentry-dbid-0c061d08-df85-403f-bac3-ba7e0896cb9a")}catch{}})();var T={exports:{}};/*! 2* screenfull 3* v5.2.0 - 2021-11-03 4* (c) Sindre Sorhus; MIT License 5*/var N;function ge(){return N||(N=1,function(e){(function(){var t=typeof window<"u"&&typeof window.document<"u"?window.document:{},o=e.exports,r=function(){for(var n,l=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],s=0,h=l.length,b={};s<h;s++)if(n=l[s],n&&n[1]in t){for(s=0;s<n.length;s++)b[l[0][s]]=n[s];return b}return!1}(),d={change:r.fullscreenchange,error:r.fullscreenerror},c={request:function(n,l){return new Promise((function(s,h){var b=(function(){this.off("change",b),s()}).bind(this);this.on("change",b),n=n||t.documentElement;var x=n[r.requestFullscreen](l);x instanceof Promise&&x.then(b).catch(h)}).bind(this))},exit:function(){return new Promise((function(n,l){if(!this.isFullscreen){n();return}var s=(function(){this.off("change",s),n()}).bind(this);this.on("change",s);var h=t[r.exitFullscreen]();h instanceof Promise&&h.then(s).catch(l)}).bind(this))},toggle:function(n,l){return this.isFullscreen?this.exit():this.request(n,l)},onchange:function(n){this.on("change",n)},onerror:function(n){this.on("error",n)},on:function(n,l){var s=d[n];s&&t.addEventListener(s,l,!1)},off:function(n,l){var s=d[n];s&&t.removeEventListener(s,l,!1)},raw:r};if(!r){o?e.exports={isEnabled:!1}:window.screenfull={isEnabled:!1};return}Object.defineProperties(c,{isFullscreen:{get:function(){return!!t[r.fullscreenElement]}},element:{enumerable:!0,get:function(){return t[r.fullscreenElement]}},isEnabled:{enumerable:!0,get:function(){return!!t[r.fullscreenEnabled]}}}),o?e.exports=c:window.screenfull=c})()}(T)),T.exports}var me=ge();const E=ce(me),we=p("div",{target:"ex3hdu49"})(({theme:e})=>({position:"absolute",bottom:0,left:0,right:0,display:"flex",justifyContent:"space-between",alignItems:"center",zIndex:2,button:{outline:"none"},input:{outline:"none"}})),xe=p("div",{target:"ex3hdu48"})({name:"iskvdr",styles:"position:relative;padding-top:56.25%;width:100%;background:black;overflow:hidden;.react-player{position:absolute;top:0;left:0;}"}),ve=p("div",{target:"ex3hdu47"})(({theme:e,url:t,fullScreen:o})=>({position:"absolute",top:-5,bottom:-5,left:-5,right:-5,backgroundImage:`url(${t})`,backgroundPosition:"center",backgroundSize:"cover",filter:`blur(5px) brightness(${o?.2:.4})`,transitionDuration:"0.3s"})),ke=p("div",{target:"ex3hdu46"})({name:"bpuij",styles:"position:absolute;bottom:0;top:0;left:0;right:0;z-index:1"}),ye=p("button",{target:"ex3hdu45"})({name:"m7ell9",styles:"flex-grow:0;height:30px;width:30px;background:transparent;border:none;margin:10px 30px 10px 20px;cursor:pointer;display:flex;justify-content:center;align-items:center"}),Ee=p("div",{target:"ex3hdu44"})(({theme:e})=>({flexGrow:1,position:"relative",height:4,span:{position:"absolute",background:e.color.blue,top:0,bottom:0,left:0,borderRadius:0,pointerEvents:"none"}})),Fe=p("input",{target:"ex3hdu43"})(({theme:e})=>({position:"absolute",top:0,bottom:0,left:0,appearance:"none",width:"100%",background:e.color.staticWhite,height:4,borderRadius:0,cursor:"pointer","::-webkit-slider-thumb":{appearance:"none",width:12,height:12,margin:"-4px 0",borderRadius:"50%",background:e.color.blue,cursor:"pointer",border:"none"},"::-moz-range-thumb":{appearance:"none",width:12,height:12,margin:"-4px 0",borderRadius:"50%",background:e.color.blue,cursor:"pointer",border:"none"},"::-ms-thumb":{appearance:"none",width:12,height:12,margin:"-4px 0",borderRadius:"50%",background:e.color.blue,cursor:"pointer",border:"none"}})),Se=p("button",{target:"ex3hdu42"})({name:"1du4ykp",styles:"flex-grow:0;height:30px;width:30px;background:transparent;border:none;margin:10px 20px 10px 15px;cursor:pointer;display:flex;justify-content:center;align-items:center"}),Re=p("div",{target:"ex3hdu41"})(({theme:e,mousePosition:t,scrubbing:o,aspectRatio:r})=>{let d=3.75,c=40/40,n=150*(100/(r*100));return{borderRadius:4,width:o?150:0,height:o?`${n}px`:0,overflow:"hidden",bottom:25,position:"absolute",left:`calc(${t}% - ${t<20?t*d:t>80?(t-80)*d+75:75}px)`,pointerEvents:"none",img:{width:150,height:`${n*50}px`,position:"absolute",top:`calc(-${t%2===0?n*(t/2):n*((t-1)/2)}px)`},"+ p":{position:"absolute",bottom:8,width:o?40:0,overflow:o?"auto":"hidden",left:`calc(${t}% - ${t<20?t*c:t>80?(t-80)*c+18:20}px)`}}}),Ce=p("div",{target:"ex3hdu40"})(({theme:e,mousePosition:t,played:o})=>({width:4,height:8,borderRadius:2,position:"absolute",left:`calc(${t}% - 2px)`,bottom:-2,backgroundColor:o*100>t?e.color.staticWhite:e.color.blue})),U=()=>!!E.isEnabled,H=e=>typeof e.webkitEnterFullscreen=="function",O=e=>{if(!e)return null;const t=e.getInternalPlayer();return t instanceof HTMLVideoElement?t:null},_e=e=>H(e)?e:null,$e=({wrapper:e,getVideo:t})=>{var d,c;if(U()&&e){Promise.resolve(E.toggle(e)).catch(()=>{});return}const o=t();if(!o)return;const r=_e(o);if(r)try{if(r.webkitDisplayingFullscreen){(d=r.webkitExitFullscreen)==null||d.call(r);return}(c=r.webkitEnterFullscreen)==null||c.call(r)}catch{}},Ie=(e,t)=>{const o=()=>t(!0),r=()=>t(!1);return e.addEventListener("webkitbeginfullscreen",o),e.addEventListener("webkitendfullscreen",r),()=>{e.removeEventListener("webkitbeginfullscreen",o),e.removeEventListener("webkitendfullscreen",r)}},Pe=e=>{if(!U())return()=>{};const t=()=>e(E.isFullscreen);return E.on("change",t),()=>{E.off("change",t)}};var Me={name:"1625jcf",styles:"padding:8px 0;flex-grow:1;cursor:pointer"};const We=({clip:e,autoplay:t,loop:o,hideFullscreen:r=!1,isPreview:d=!1})=>{const[c,n]=i.useState(!1),[l,s]=i.useState(0),[h,b]=i.useState(!1),[x,j]=i.useState(!1),[S,G]=i.useState("00:00"),[v,L]=i.useState(!1),[K,X]=i.useState("00:00"),[R,Y]=i.useState(0),[C,_]=be(),{isAuthed:$}=ue(),I=i.useRef(),k=i.useRef(),q=i.useRef(),P=i.useRef(),w=i.useRef(null);i.useEffect(()=>{$&&t&&C.notAsked&&!d&&_.post("/clips/history",{clips:[e.id]})},[$,t,e.id,C.notAsked,_,d]),i.useEffect(()=>Pe(j),[]),i.useEffect(()=>()=>{w.current&&(w.current(),w.current=null)},[]);const J=e?Object.keys(e.movie.data.public_paths):[],z=[];J.forEach(a=>{a==="mp4.wat.h.484."&&z.push({src:e.movie.data.public_paths[a],type:"video/mp4"})});const Q=he(500,!0,a=>{k.current.seekTo(parseFloat(a))}),Z=()=>{$&&C.notAsked&&_.post("/clips/history",{clips:[e.id]}),n(!c)},ee=()=>{b(!0),n(!1)},te=a=>{s(parseFloat(a.target.value)),Q(a.target.value)},ne=()=>{b(!1),n(!0)},re=({played:a})=>{var F;let g=((F=e.duration_in_seconds)==null?void 0:F.split(":"))||0;g=g.length===2?parseFloat(g[0])*60+parseFloat(g[1]):parseFloat(g[0]);let M=parseInt(a*g/60),m=parseInt(a*g%60);m=m<10?`0${m}`:m;const f=`0${M}:${m}`;S!==f&&G(f),h||s(a)},se=()=>{$e({wrapper:q.current,getVideo:()=>O(k.current)})},oe=()=>n(!1),le=()=>{P.current.click(),P.current.focus()},ae=()=>{t&&!c&&!h&&setTimeout(()=>n(!0),100);const a=O(k.current);w.current&&(w.current(),w.current=null),a&&H(a)&&(w.current=Ie(a,j))},ie=a=>{var A;const g=a.pageX-I.current.getBoundingClientRect().x,M=I.current.offsetWidth,m=Math.floor(g/M*100);Y(m);let f=((A=e.duration_in_seconds)==null?void 0:A.split(":"))||0;f=f.length===2?parseFloat(f[0])*60+parseFloat(f[1]):parseFloat(f[0]);let F=parseInt(m*.01*f/60),y=parseInt(m*.01*f%60);y=y<10?`0${y}`:y;const D=`0${F}:${y}`;S!==D&&X(D),v||L(!0)};return W(xe,{ref:q,children:[u(ve,{url:e==null?void 0:e.movie.data.thumb.paths["480"],fullScreen:x}),u(pe,{onReady:ae,playsinline:!0,ref:k,className:"react-player",width:"100%",height:"100%",url:z,playing:c,onEnded:oe,onProgress:re,progressInterval:50,volume:0,muted:!0,onError:()=>n(!1),loop:o,config:{file:{attributes:{poster:e.movie.data.thumb.paths["h.484"]}}}}),u(ke,{onClick:le}),W(we,{progress:l,children:[u(ye,{onClick:Z,ref:P,"aria-label":c?"Pause":"Play",children:u(V,{name:c?"pause":"play",color:"staticWhite"})}),u("span",{onClick:()=>k.current.seekTo(R/100,"fraction"),onMouseMove:e.scrub_thumb_url?ie:null,onMouseLeave:e.scrub_thumb_url?()=>L(!1):null,ref:I,css:Me,children:W(Ee,{children:[u(Fe,{type:"range","aria-label":"Seek",min:0,max:.99999,step:"any",value:l,onMouseDown:ee,onChange:te,onMouseUp:ne}),u("span",{style:{right:`${(1-l)*100}%`}}),e.scrub_thumb_url&&u(Re,{aspectRatio:e.aspect_ratio,scrubbing:v,mousePosition:R,children:v&&u("img",{src:e.scrub_thumb_url,alt:""})}),v&&u(B,{center:!0,color:"staticWhite",children:K}),v&&u(Ce,{mousePosition:R,played:l})]})}),u(B,{color:"staticWhite",css:de({width:40,marginLeft:10,...r&&{marginRight:30}},""),children:S}),!r&&u(Se,{onClick:se,"aria-label":x?"Exit fullscreen":"Fullscreen","data-testid":"player-fullscreen-button",children:u(V,{name:x?"contract":"exp
5and",color:"staticWhite",size:20})})]})]})};We.propTypes={clip:fe.object.isRequired};export{We as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.