UNPKG

reactjs-media

Version:
2 lines (1 loc) 42.5 kB
import e,{createContext as n,useRef as t,useState as r,useEffect as o,useContext as i,forwardRef as c,useCallback as u}from"react";import{jsx as a,jsxs as l}from"react/jsx-runtime";var d=function(){return d=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},d.apply(this,arguments)};function s(e,n,t,r){return new(t||(t=Promise))((function(o,i){function c(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(c,u)}a((r=r.apply(e,n||[])).next())}))}function v(e,n){var t,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(a){return function(u){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(c=0)),c;)try{if(t=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return c.label++,{value:u[1],done:!1};case 5:c.label++,r=u[1],u=[0];continue;case 7:u=c.ops.pop(),c.trys.pop();continue;default:if(!(o=c.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){c=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){c.label=u[1];break}if(6===u[0]&&c.label<o[1]){c.label=o[1],o=u;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(u);break}o[2]&&c.ops.pop(),c.trys.pop();continue}u=n.call(e,c)}catch(e){u=[6,e],r=0}finally{t=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}}"function"==typeof SuppressedError&&SuppressedError;var m=n({videoRef:{current:null},containerRef:{current:null},overlayRef:{current:null},seekPreview:!1,setSeekPreview:function(e){},menuClientX:0,setMenuClientX:function(e){},menuClientY:0,setMenuClientY:function(e){},contextMenuItems:[],setContextMenuItems:function(e){},menuOpen:!1,setMenuOpen:function(e){},setSrc:function(e){},src:null}),f=function(e){var n=e.children,i=e.src,c=t(null),u=t(null),l=t(null),d=r(!1),s=d[0],v=d[1],f=r(0),h=f[0],p=f[1],g=r(0),_=g[0],b=g[1],y=r([]),w=y[0],C=y[1],x=r(!1),L=x[0],k=x[1],E=r(i),P=E[0],M=E[1];return o((function(){M(i)}),[i]),a(m.Provider,{value:{videoRef:c,containerRef:u,seekPreview:s,setSeekPreview:v,menuClientX:h,setMenuClientX:p,menuClientY:_,setMenuClientY:b,contextMenuItems:w,setContextMenuItems:C,menuOpen:L,setMenuOpen:k,overlayRef:l,src:P,setSrc:M},children:n})},h=function(){var e=i(m),n=e.videoRef,t=e.containerRef,r=function(){return s(void 0,void 0,void 0,(function(){return v(this,(function(e){switch(e.label){case 0:return n.current?[4,n.current.play()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},o=function(){n.current&&n.current.pause()};return{play:r,pause:o,togglePlay:function(){return s(void 0,void 0,void 0,(function(){return v(this,(function(e){switch(e.label){case 0:return n.current?n.current.paused?[4,r()]:[3,2]:[3,3];case 1:return e.sent(),[3,3];case 2:o(),e.label=3;case 3:return[2]}}))}))},forward:function(){n.current&&(n.current.currentTime+=10)},rewind:function(){n.current&&(n.current.currentTime-=10)},updateVolume:function(e){n.current&&(n.current.volume=e)},updatePlaybackRate:function(e){n.current&&(n.current.playbackRate=e)},increasePlaybackRate:function(){n.current&&(n.current.playbackRate+=.25)},decreasePlaybackRate:function(){n.current&&(n.current.playbackRate-=.25)},toggleMute:function(){n.current&&(n.current.muted=!n.current.muted)},increaseVolume:function(){n.current&&(n.current.volume+=.1)},decreaseVolume:function(){n.current&&(n.current.volume-=.1)},toggleFullscreen:function(){t.current&&(document.fullscreenElement?document.exitFullscreen():t.current.requestFullscreen())},togglePip:function(){return s(void 0,void 0,void 0,(function(){var e;return v(this,(function(t){switch(t.label){case 0:if(!n.current||!("requestPictureInPicture"in n.current))return[3,7];t.label=1;case 1:return t.trys.push([1,6,,7]),document.pictureInPictureElement?[4,document.exitPictureInPicture()]:[3,3];case 2:return t.sent(),[3,5];case 3:return[4,n.current.requestPictureInPicture()];case 4:t.sent(),t.label=5;case 5:return[3,7];case 6:return e=t.sent(),console.error(e),[3,7];case 7:return[2]}}))}))},seek:function(e){n.current&&(n.current.currentTime=e)},setLoop:function(e){n.current&&(n.current.loop=e)}}},p={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},g=e.createContext&&e.createContext(p),_=["attr","size","title"];function b(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function y(){return y=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},y.apply(this,arguments)}function w(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function C(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?w(Object(t),!0).forEach((function(n){x(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):w(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function x(e,n,t){return(n=function(e){var n=function(e,n){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:String(n)}(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function L(n){return n&&n.map(((n,t)=>e.createElement(n.tag,C({key:t},n.attr),L(n.child))))}function k(n){return t=>e.createElement(E,y({attr:C({},n.attr)},t),L(n.child))}function E(n){var t=t=>{var r,{attr:o,size:i,title:c}=n,u=b(n,_),a=i||t.size||"1em";return t.className&&(r=t.className),n.className&&(r=(r?r+" ":"")+n.className),e.createElement("svg",y({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,o,u,{className:r,style:C(C({color:n.color||t.color},t.style),n.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),c&&e.createElement("title",null,c),n.children)};return void 0!==g?e.createElement(g.Consumer,null,(e=>t(e))):t(p)}function P(e){return k({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12zM288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12zm148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12zM160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12z"},child:[]}]})(e)}function M(e){return k({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M512 76v360c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12V284.1L276.5 440.6c-20.6 17.2-52.5 2.8-52.5-24.6V284.1L52.5 440.6C31.9 457.8 0 443.4 0 416V96c0-27.4 31.9-41.7 52.5-24.6L224 226.8V96c0-27.4 31.9-41.7 52.5-24.6L448 226.8V76c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12z"},child:[]}]})(e)}function B(e){return k({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M144 479H48c-26.5 0-48-21.5-48-48V79c0-26.5 21.5-48 48-48h96c26.5 0 48 21.5 48 48v352c0 26.5-21.5 48-48 48zm304-48V79c0-26.5-21.5-48-48-48h-96c-26.5 0-48 21.5-48 48v352c0 26.5 21.5 48 48 48h96c26.5 0 48-21.5 48-48z"},child:[]}]})(e)}function V(e){return k({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"},child:[]}]})(e)}function z(e){return k({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M215.03 71.05L126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97zM461.64 256l45.64-45.64c6.3-6.3 6.3-16.52 0-22.82l-22.82-22.82c-6.3-6.3-16.52-6.3-22.82 0L416 210.36l-45.64-45.64c-6.3-6.3-16.52-6.3-22.82 0l-22.82 22.82c-6.3 6.3-6.3 16.52 0 22.82L370.36 256l-45.63 45.63c-6.3 6.3-6.3 16.52 0 22.82l22.82 22.82c6.3 6.3 16.52 6.3 22.82 0L416 301.64l45.64 45.64c6.3 6.3 16.52 6.3 22.82 0l22.82-22.82c6.3-6.3 6.3-16.52 0-22.82L461.64 256z"},child:[]}]})(e)}function N(e){return k({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M215 71l-89 89H24a24 24 0 0 0-24 24v144a24 24 0 0 0 24 24h102.06L215 441c15 15 41 4.47 41-17V88c0-21.47-26-32-41-17z"},child:[]}]})(e)}function O(e){return k({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M215.03 71.05L126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97zm233.32-51.08c-11.17-7.33-26.18-4.24-33.51 6.95-7.34 11.17-4.22 26.18 6.95 33.51 66.27 43.49 105.82 116.6 105.82 195.58 0 78.98-39.55 152.09-105.82 195.58-11.17 7.32-14.29 22.34-6.95 33.5 7.04 10.71 21.93 14.56 33.51 6.95C528.27 439.58 576 351.33 576 256S528.27 72.43 448.35 19.97zM480 256c0-63.53-32.06-121.94-85.77-156.24-11.19-7.14-26.03-3.82-33.12 7.46s-3.78 26.21 7.41 33.36C408.27 165.97 432 209.11 432 256s-23.73 90.03-63.48 115.42c-11.19 7.14-14.5 22.07-7.41 33.36 6.51 10.36 21.12 15.14 33.12 7.46C447.94 377.94 480 319.54 480 256zm-141.77-76.87c-11.58-6.33-26.19-2.16-32.61 9.45-6.39 11.61-2.16 26.2 9.45 32.61C327.98 228.28 336 241.63 336 256c0 14.38-8.02 27.72-20.92 34.81-11.61 6.41-15.84 21-9.45 32.61 6.43 11.66 21.05 15.8 32.61 9.45 28.23-15.55 45.77-45 45.77-76.88s-17.54-61.32-45.78-76.86z"},child:[]}]})(e)}function R(e){return k({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 7h-8v6h8V7zm2-4H3c-1.1 0-2 .9-2 2v14c0 1.1.9 1.98 2 1.98h18c1.1 0 2-.88 2-1.98V5c0-1.1-.9-2-2-2zm0 16.01H3V4.98h18v14.03z"},child:[]}]})(e)}function I(e){return k({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 0 0 .12-.61l-1.92-3.32a.488.488 0 0 0-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 0 0-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 0 0-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"},child:[]}]})(e)}function H(e){return k({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"},child:[]}]})(e)}function S(e){return k({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M21 3C21.5523 3 22 3.44772 22 4V11H20V5H4V19H10V21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H21ZM21 13C21.5523 13 22 13.4477 22 14V20C22 20.5523 21.5523 21 21 21H13C12.4477 21 12 20.5523 12 20V14C12 13.4477 12.4477 13 13 13H21ZM20 15H14V19H20V15ZM6.70711 6.29289L8.95689 8.54289L11 6.5V12H5.5L7.54289 9.95689L5.29289 7.70711L6.70711 6.29289Z"},child:[]}]})(e)}function T(e){return k({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M21 3C21.5523 3 22 3.44772 22 4V11H20V5H4V19H10V21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H21ZM21 13C21.5523 13 22 13.4477 22 14V20C22 20.5523 21.5523 21 21 21H13C12.4477 21 12 20.5523 12 20V14C12 13.4477 12.4477 13 13 13H21ZM11.5 7L9.45711 9.04311L11.7071 11.2929L10.2929 12.7071L8.04311 10.4571L6 12.5V7H11.5Z"},child:[]}]})(e)}var j={videoRoot:"video-module_videoRoot__RXFIL",videoOverlay:"video-module_videoOverlay__cbySQ",videoLoader:"video-module_videoLoader__G-QHd",videoError:"video-module_videoError__8z6--",videoLoaderSpinner:"video-module_videoLoaderSpinner__WibeR",spin:"video-module_spin__p2vcz",videoTooltip:"video-module_videoTooltip__cd0GD",videoPoster:"video-module_videoPoster__MUSIO",videoPosterPlayButton:"video-module_videoPosterPlayButton__CJm-m",videoControlsBar:"video-module_videoControlsBar__NXw-a",videoControlsBarLeft:"video-module_videoControlsBarLeft__8pHvX",videoControlsBarRight:"video-module_videoControlsBarRight__1z7jL",videoControlsButton:"video-module_videoControlsButton__sY-vH",videoControlsContainer:"video-module_videoControlsContainer__Gfx4p",videoTime:"video-module_videoTime__lpo-v",videoTimeDuration:"video-module_videoTimeDuration__t-MSf",videoProgressBar:"video-module_videoProgressBar__DtfAs",videoProgressBarFill:"video-module_videoProgressBarFill__ps6Eo",seekingCanvas:"video-module_seekingCanvas__RZeny",videoVolumeControlContainer:"video-module_videoVolumeControlContainer__mISJl",volumeControlsButton:"video-module_volumeControlsButton__cZo0r",volumeControlsBar:"video-module_volumeControlsBar__OV5gG",volumeControlsBarFill:"video-module_volumeControlsBarFill__9jDkV",volumeControlsBarHandle:"video-module_volumeControlsBarHandle__xSJqU",contextPageOverlay:"video-module_contextPageOverlay__wqsdS",contextMenuCard:"video-module_contextMenuCard__gSYIB",contextMenu:"video-module_contextMenu__VPChO",contextMenuItem:"video-module_contextMenuItem__EvkZ8",contextMenuItemIcon:"video-module_contextMenuItemIcon__CvJ92",contextMenuItemLabel:"video-module_contextMenuItemLabel__wynsl",settingsOverlay:"video-module_settingsOverlay__uDaJy",settingRoot:"video-module_settingRoot__7mf39",settingHeader:"video-module_settingHeader__mFn-J",settingTitle:"video-module_settingTitle__wtmeq"};!function(e,n){void 0===n&&(n={});var t=n.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".video-module_videoRoot__RXFIL {\n position: relative;\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n\n.video-module_videoOverlay__cbySQ {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n color: white;\n font-size: 2rem;\n font-weight: bold;\n text-align: center;\n}\n\n.video-module_videoLoader__G-QHd {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.video-module_videoError__8z6-- {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n color: white;\n font-size: 2rem;\n font-weight: bold;\n}\n\n.video-module_videoLoaderSpinner__WibeR {\n display: inline-block;\n width: 50px;\n height: 50px;\n border: 3px solid rgba(255, 255, 255, 0.3);\n border-radius: 50%;\n border-top-color: white;\n animation: video-module_spin__p2vcz 1s linear infinite;\n}\n\n@keyframes video-module_spin__p2vcz {\n to {\n transform: rotate(360deg);\n }\n}\n.video-module_videoTooltip__cd0GD {\n position: absolute;\n top: -4.5rem;\n left: 0;\n background-color: rgba(0, 0, 0, 0.5);\n color: white;\n padding: 0.2rem 0.5rem;\n border-radius: 0.2rem;\n font-size: 0.8rem;\n z-index: 2;\n}\n\n.video-module_videoPoster__MUSIO {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n cursor: pointer;\n z-index: 1;\n background-position: center;\n background-size: cover;\n}\n.video-module_videoPoster__MUSIO:hover {\n filter: brightness(0.8);\n}\n\n.video-module_videoPosterPlayButton__CJm-m {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 50px;\n height: 50px;\n border: 3px solid white;\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n}\n\n.video-module_videoControlsBar__NXw-a {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 5px 0px;\n width: 96%;\n margin: 0 auto;\n}\n\n.video-module_videoControlsBarLeft__8pHvX {\n display: flex;\n align-items: center;\n}\n\n.video-module_videoControlsBarRight__1z7jL {\n display: flex;\n align-items: center;\n}\n\n.video-module_videoControlsButton__sY-vH {\n background-color: transparent;\n border: none;\n color: white;\n font-size: 1.2rem;\n cursor: pointer;\n margin: 0 10px;\n}\n\n.video-module_videoControlsContainer__Gfx4p {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n background: linear-gradient(transparent, rgb(0, 0, 0));\n display: flex;\n flex-direction: column;\n height: fit-content;\n}\n\n.video-module_videoTime__lpo-v {\n color: white;\n text-align: left;\n width: 96%;\n margin: 0 auto;\n display: flex;\n margin-bottom: 10px;\n}\n@media (min-width: 1024px) {\n .video-module_videoTime__lpo-v {\n font-size: 0.8rem;\n }\n}\n@media (max-width: 1024px) and (min-width: 768px) {\n .video-module_videoTime__lpo-v {\n font-size: 0.7rem;\n }\n}\n@media (max-width: 768px) {\n .video-module_videoTime__lpo-v {\n font-size: 0.5rem;\n margin-bottom: 10px;\n }\n}\n\n.video-module_videoTimeDuration__t-MSf {\n margin-left: auto;\n}\n\n.video-module_videoProgressBar__DtfAs {\n width: 96%;\n margin: 0 auto;\n height: 3px;\n background-color: rgba(255, 255, 255, 0.5);\n position: relative;\n cursor: pointer;\n transition: height 0.3s;\n}\n.video-module_videoProgressBar__DtfAs:hover {\n height: 5px;\n}\n.video-module_videoProgressBar__DtfAs:hover .video-module_videoProgressBarFill__ps6Eo {\n background-color: white;\n}\n\n.video-module_videoProgressBarFill__ps6Eo {\n height: 100%;\n background-color: rgba(255, 255, 255, 0.5);\n transition: background-color 0.3s;\n}\n\n.video-module_seekingCanvas__RZeny {\n position: absolute;\n top: -3rem;\n left: 0;\n width: 80px;\n height: 40px;\n background-color: rgba(255, 255, 255, 0.5);\n z-index: 2;\n border-radius: 0.2rem;\n border: 1px solid white;\n}\n\n.video-module_videoVolumeControlContainer__mISJl {\n display: flex;\n align-items: center;\n margin: 0 10px;\n}\n@media (max-width: 768px) {\n .video-module_videoVolumeControlContainer__mISJl {\n display: none;\n }\n}\n\n.video-module_volumeControlsButton__cZo0r {\n background-color: transparent;\n border: none;\n color: white;\n font-size: 1rem;\n cursor: pointer;\n margin: 0 10px;\n}\n\n.video-module_volumeControlsBar__OV5gG {\n width: 70px;\n height: 3px;\n background-color: rgba(255, 255, 255, 0.5);\n position: relative;\n cursor: pointer;\n transition: height 0.3s;\n}\n.video-module_volumeControlsBar__OV5gG:hover .video-module_volumeControlsBarFill__9jDkV {\n background-color: rgba(255, 255, 255, 0.702);\n}\n\n.video-module_volumeControlsBarFill__9jDkV {\n height: 100%;\n background-color: white;\n transition: background-color 0.3s;\n}\n\n.video-module_volumeControlsBarHandle__xSJqU {\n position: absolute;\n top: -3.5px;\n left: 0;\n width: 10px;\n height: 10px;\n background-color: white;\n border-radius: 50%;\n cursor: pointer;\n}\n\n.video-module_contextPageOverlay__wqsdS {\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n\n.video-module_contextMenuCard__gSYIB {\n position: absolute;\n}\n\n.video-module_contextMenu__VPChO {\n background: rgba(0, 0, 0, 0.507);\n display: flex;\n flex-direction: column;\n color: white;\n padding: 5px;\n}\n\n.video-module_contextMenuItem__EvkZ8 {\n display: flex;\n align-items: center;\n padding: 10px;\n outline: none;\n border: none;\n border-radius: 5px;\n background: transparent;\n color: white;\n cursor: pointer;\n}\n.video-module_contextMenuItem__EvkZ8:hover {\n background: rgba(245, 245, 245, 0.325);\n}\n\n.video-module_contextMenuItemIcon__CvJ92 {\n color: white;\n margin-right: 10px;\n}\n\n.video-module_contextMenuItemLabel__wynsl {\n color: white;\n font-size: 0.7rem;\n}\n\n.video-module_settingsOverlay__uDaJy {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: rgba(0, 0, 0, 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 2;\n}\n\n.video-module_settingRoot__7mf39 {\n background-color: white;\n width: 50%;\n height: 50%;\n border-radius: 0.2rem;\n padding: 1rem;\n}\n\n.video-module_settingHeader__mFn-J {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 1rem;\n}\n\n.video-module_settingTitle__wtmeq {\n font-size: 1.5rem;\n}");var A=function(){var e,n=i(m).videoRef,t=r("00:00"),c=t[0],u=t[1];function d(e){var n=Math.floor(e/60),t=Math.floor(e%60),r=t<10?"0".concat(t):"".concat(t),o=n<10?"0".concat(n):"".concat(n);return"".concat(o,":").concat(r)}return o((function(){if(n.current){var e=function(){n.current&&u(d(n.current.currentTime))};return n.current.addEventListener("timeupdate",e),function(){var t;null===(t=n.current)||void 0===t||t.removeEventListener("timeupdate",e)}}}),[n.current]),l("div",{className:j.videoTime,children:[a("span",{className:j.videoTimeCurrent,children:c}),a("span",{className:j.videoTimeDuration,children:d((null===(e=n.current)||void 0===e?void 0:e.duration)||0)})]})};function D(e){return k({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M48 64C21.5 64 0 85.5 0 112V400c0 26.5 21.5 48 48 48H80c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48H48zm192 0c-26.5 0-48 21.5-48 48V400c0 26.5 21.5 48 48 48h32c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48H240z"},child:[]}]})(e)}function F(e){return k({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M301.1 34.8C312.6 40 320 51.4 320 64V448c0 12.6-7.4 24-18.9 29.2s-25 3.1-34.4-5.3L131.8 352H64c-35.3 0-64-28.7-64-64V224c0-35.3 28.7-64 64-64h67.8L266.7 40.1c9.4-8.4 22.9-10.4 34.4-5.3zM412.6 181.5C434.1 199.1 448 225.9 448 256s-13.9 56.9-35.4 74.5c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C393.1 284.4 400 271 400 256s-6.9-28.4-17.7-37.3c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5z"},child:[]}]})(e)}var X=function(){var e=h(),n=e.updateVolume,c=e.toggleMute,u=i(m).videoRef,d=r(1),s=d[0],v=d[1],f=t(null),p=r(!1),g=p[0],_=p[1];return o((function(){if(f.current){var e=function(e){if(f.current&&u.current){var t=f.current.getBoundingClientRect(),r=(e.clientX-t.left)/t.width*100;n(r/100),v(r/100)}};return f.current.addEventListener("mousedown",e),function(){var n;null===(n=f.current)||void 0===n||n.removeEventListener("mousedown",e)}}}),[f.current]),o((function(){u.current&&v(u.current.volume)}),[u.current]),o((function(){if(u.current){var e=function(){u.current&&v(u.current.volume)},n=function(){u.current&&_(u.current.muted)};return u.current.addEventListener("volumechange",e),u.current.addEventListener("muted",n),function(){var t,r;null===(t=u.current)||void 0===t||t.removeEventListener("volumechange",e),null===(r=u.current)||void 0===r||r.removeEventListener("muted",n)}}}),[u.current]),l("div",{className:j.videoVolumeControlContainer,children:[a("button",{className:j.volumeControlsButton,onClick:function(){g?(c(),_(!1)):(c(),_(!0))},children:a(g||0===s?z:s<=.3?N:s<.5?F:O,{})}),l("div",{className:j.volumeControlsBar,ref:f,children:[a("div",{className:j.volumeControlsBarFill,style:{width:"".concat(100*s,"%")}}),a("div",{className:"volume-controls-bar__handle",style:{left:"".concat(100*s-3.5,"%")}})]})]})},Z=function(){var e=i(m),n=e.videoRef,c=e.seekPreview,u=r(0),d=u[0],s=u[1],v=t(null),f=r(0),h=f[0],p=f[1],g=r(!1),_=g[0],b=g[1],y=r("00:00"),w=y[0],C=y[1],x=r(0),L=x[0],k=x[1];return o((function(){if(v.current){var e=function(e){!function(e){if(v.current&&n.current){var t=v.current.getBoundingClientRect(),r=(e.clientX-t.left)/t.width*100;n.current.currentTime=r/100*n.current.duration}}(e)};return v.current.addEventListener("mousedown",e),function(){var n;null===(n=v.current)||void 0===n||n.removeEventListener("mousedown",e)}}}),[v.current]),o((function(){if(v.current){var e=function(e){if(v.current&&n.current){var t=v.current.getBoundingClientRect(),r=(e.clientX-t.left)/t.width*100;p(r);var o=r/100*n.current.duration;k(o),C(function(e){var n=Math.floor(e/60),t=Math.floor(e%60),r=t<10?"0".concat(t):"".concat(t),o=n<10?"0".concat(n):"".concat(n);return"".concat(o,":").concat(r)}(o))}},t=function(){b(!0)},r=function(){b(!1)};return v.current.addEventListener("mousemove",e),v.current.addEventListener("mouseenter",t),v.current.addEventListener("mouseleave",r),function(){var n,o,i;null===(n=v.current)||void 0===n||n.removeEventListener("mousemove",e),null===(o=v.current)||void 0===o||o.removeEventListener("mouseenter",t),null===(i=v.current)||void 0===i||i.removeEventListener("mouseleave",r)}}}),[v.current]),o((function(){if(n.current){var e=function(){n.current&&s(n.current.currentTime/n.current.duration*100)};return n.current.addEventListener("timeupdate",e),function(){var t;null===(t=n.current)||void 0===t||t.removeEventListener("timeupdate",e)}}}),[n.current]),l("div",{ref:v,className:j.videoProgressBar,children:[c&&_&&a(G,{time:L,percentage:h}),a("div",{className:j.videoProgressBarFill,style:{width:"".concat(d,"%")}}),a(J,{text:w,open:_,percentage:h})]})},J=function(e){var n=e.text,t=e.percentage;return e.open?a("div",{className:j.videoTooltip,style:{left:"".concat(t-3,"%")},children:n}):null},G=function(e){var n=e.time,c=e.percentage,u=t(null),l=i(m).videoRef,d=r(null),f=d[0],h=d[1];return o((function(){if(null===f&&l.current){var e=document.createElement("video");e.src=l.current.src,e.volume=0,h(e)}}),[f,l.current]),o((function(){!function(e){s(this,void 0,void 0,(function(){var n;return v(this,(function(t){switch(t.label){case 0:if(!u.current||!f)return[3,5];if(!(n=u.current.getContext("2d")))return[3,5];f.currentTime=e,t.label=1;case 1:return t.trys.push([1,3,,4]),[4,f.play()];case 2:return t.sent(),[3,4];case 3:return t.sent(),console.warn("Reference Video Inturrupted"),[3,4];case 4:try{f.pause()}catch(e){}n.drawImage(f,0,0,80,40),t.label=5;case 5:return[2]}}))}))}(n)}),[u.current,n,f]),a("canvas",{style:{left:"".concat(c-5,"%")},ref:u,className:j.seekingCanvas,height:40,width:80})},Y=function(){var e=i(m).overlayRef;return l("div",{className:j.videoOverlay,ref:e,children:[a(U,{}),a(q,{})]})},U=function(){var e=i(m).videoRef,n=r(!0),t=n[0],c=n[1];return o((function(){if(e.current){var n=function(){c(!1)};return e.current.addEventListener("loadeddata",n),function(){var t;null===(t=e.current)||void 0===t||t.removeEventListener("loadeddata",n)}}}),[e.current]),o((function(){if(e.current){var n=function(){c(!1)};return e.current.addEventListener("canplay",n),function(){var t;null===(t=e.current)||void 0===t||t.removeEventListener("canplay",n)}}}),[e.current]),o((function(){if(e.current){var n=function(){c(!0)};return e.current.addEventListener("waiting",n),function(){var t;null===(t=e.current)||void 0===t||t.removeEventListener("waiting",n)}}}),[e.current]),t?a("div",{className:j.videoLoader,children:a("div",{className:j.videoLoaderSpinner})}):null},q=function(){var e=i(m),n=e.containerRef,t=e.src,c=r(!1),u=c[0],d=c[1],s=r(!1),v=s[0],f=s[1];return o((function(){if(n.current){var e;u&&(e=setTimeout((function(){d(!1)}),5e3));var t=function(){d(!0)},r=function(){d(!1)},o=function(){d(!0),e&&clearTimeout(e),e=setTimeout((function(){d(!1)}),5e3)};return n.current.addEventListener("mouseenter",t),n.current.addEventListener("mouseleave",r),n.current.addEventListener("mousemove",o),function(){var e,i,c;null===(e=n.current)||void 0===e||e.removeEventListener("mouseenter",t),null===(i=n.current)||void 0===i||i.removeEventListener("mouseleave",r),null===(c=n.current)||void 0===c||c.removeEventListener("mousemove",o)}}}),[n.current]),o((function(){f("string"==typeof t)}),[t]),v?l("div",{className:j.videoControlsContainer,style:{display:u?"flex":"none"},children:[a(A,{}),a(Z,{}),a(W,{})]}):null},Q=function(e){var n=e.src,t=i(m).videoRef,c=h().play,u=r(!1),l=u[0],d=u[1];return o((function(){t.current&&(t.current.poster=n)}),[]),o((function(){if(t.current){var e=function(){d(!0)};return t.current.addEventListener("play",e),function(){var n;null===(n=t.current)||void 0===n||n.removeEventListener("play",e)}}}),[t.current]),l?null:a("div",{className:j.videoPoster,style:{backgroundImage:"url(".concat(n,")")},children:a("button",{className:j.videoPosterPlayButton,onClick:c,children:a(V,{})})})},W=function(){return"string"!=typeof i(m).src?null:l("div",{className:j.videoControlsBar,children:[l("div",{className:j.videoControlsBarLeft,children:[a(te,{}),a(K,{}),a(X,{})]}),l("div",{className:j.videoControlsBarRight,children:[a(ne,{}),a(ee,{}),a($,{})]})]})},K=function(){var e=h().forward;return a("button",{className:j.videoControlsButton,onClick:e,children:a(M,{})})},$=function(){return a("button",{className:j.videoControlsButton,children:a(I,{})})},ee=function(){var e=r(!1),n=e[0],t=e[1],i=h().toggleFullscreen;return o((function(){var e=function(){t(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",e),function(){document.removeEventListener("fullscreenchange",e)}}),[]),a("button",{className:j.videoControlsButton,onClick:i,children:a(n?H:P,{})})},ne=function(){var e=i(m).videoRef,n=r(!1),t=n[0],c=n[1],u=h().togglePip;return o((function(){if(e.current){var n=function(){c(!0)},t=function(){c(!1)};return e.current.addEventListener("enterpictureinpicture",n),e.current.addEventListener("leavepictureinpicture",t),function(){var r,o;null===(r=e.current)||void 0===r||r.removeEventListener("enterpictureinpicture",n),null===(o=e.current)||void 0===o||o.removeEventListener("leavepictureinpicture",t)}}}),[e.current]),a("button",{className:j.videoControlsButton,onClick:u,children:a(t?T:S,{})})},te=function(){var e=h().togglePlay,n=i(m).videoRef,t=r(!1),c=t[0],u=t[1];return o((function(){var n=function(n){" "===n.key&&e()};return window.addEventListener("keydown",n),function(){window.removeEventListener("keydown",n)}}),[]),o((function(){if(n.current){var e=function(){u(!0)},t=function(){u(!1)};return n.current.addEventListener("play",e),n.current.addEventListener("pause",t),function(){var r,o;null===(r=n.current)||void 0===r||r.removeEventListener("play",e),null===(o=n.current)||void 0===o||o.removeEventListener("pause",t)}}}),[n.current]),a("button",{className:j.videoControlsButton,children:a(c?B:V,{onClick:e})})},re=function(e){var n=e.controls,t=void 0===n||n,r=e.src,c=i(m).videoRef;return o((function(){c.current&&(r&&("string"==typeof r?c.current.src=r:(c.current.autoplay=!0,c.current.srcObject=r)),c.current.preload="metadata")}),[c.current,r]),a("video",{ref:c,className:j.videoElement,width:"100%",height:"100%",controls:t})},oe=function(e){var n=e.renderCustomMenu,t=i(m),r=t.contextMenuItems,o=t.menuOpen,c=t.setMenuOpen,u=t.menuClientX,d=t.menuClientY;return o?a("div",{className:j.contextPageOverlay,onClick:function(){return c(!1)},children:a("div",{className:j.contextMenuCard,style:{top:d,left:u},children:n?n(r):a("div",{className:j.contextMenu,children:null==r?void 0:r.map((function(e,n){return l("button",{className:j.contextMenuItem,onClick:e.onClick,children:[a("span",{className:j.contextMenuItemIcon,children:e.icon}),a("span",{className:j.contextMenuItemLabel,children:e.label})]},n)}))})})}):null},ie=c((function(e,n){return l(ce,d({},e,{ref:n,children:[a(re,{src:e.src,controls:!1}),e.controls&&e.src&&a(Y,{}),e.poster&&a(Q,{src:e.poster}),a(oe,{})]}))})),ce=c((function(e,n){return a(f,d({},e,{children:a(ue,d({},e,{ref:n,children:e.children}))}))})),ue=c((function(e,n){var t=i(m),r=t.containerRef,c=t.setSeekPreview,u=t.setContextMenuItems,l=t.setMenuClientX,d=t.setMenuClientY,s=t.setMenuOpen,v=t.overlayRef,f=h(),p=f.play,g=f.pause,_=f.togglePlay,b=f.updatePlaybackRate,y=f.updateVolume,w=f.seek,C=f.toggleFullscreen,x=f.togglePip,L=f.toggleMute;o((function(){c(!!e.seekPreview)}),[e.seekPreview]),o((function(){n&&(n.current={play:p,pause:g,seek:w,volume:y,playbackRate:b,toggleFullscreen:C,togglePip:x,toggleMute:L,togglePlay:_})}),[]),o((function(){var n=r.current;if(n){var t=n.querySelector("video");if(t){var o=function(){e.onTimeUpdate&&e.onTimeUpdate(t.currentTime)},i=function(){e.onPlay&&e.onPlay()},c=function(){e.onPause&&e.onPause()},u=function(){e.onEnded&&e.onEnded()},a=function(){e.onVolumeChange&&e.onVolumeChange(t.volume)},l=function(){e.onSeeking&&e.onSeeking()},d=function(){e.onSeeked&&e.onSeeked()},s=function(){e.onLoadedMetadata&&e.onLoadedMetadata()},v=function(){e.onLoadedData&&e.onLoadedData()},m=function(){e.onCanPlay&&e.onCanPlay()};return t.addEventListener("timeupdate",o),t.addEventListener("play",i),t.addEventListener("pause",c),t.addEventListener("ended",u),t.addEventListener("volumechange",a),t.addEventListener("seeking",l),t.addEventListener("seeked",d),t.addEventListener("loadedmetadata",s),t.addEventListener("loadeddata",v),t.addEventListener("canplay",m),function(){t.removeEventListener("timeupdate",o),t.removeEventListener("play",i),t.removeEventListener("pause",c),t.removeEventListener("ended",u),t.removeEventListener("volumechange",a),t.removeEventListener("seeking",l),t.removeEventListener("seeked",d),t.removeEventListener("loadedmetadata",s),t.removeEventListener("loadeddata",v),t.removeEventListener("canplay",m)}}}}),[]);var k=[{label:"Play",onClick:p,icon:a(V,{})},{label:"Pause",onClick:g,icon:a(D,{})},{label:"Toggle Fullscreen",onClick:C,icon:a(P,{})},{label:"Toggle Picture in Picture",onClick:x,icon:a(R,{})},{label:"Toggle Mute",onClick:L,icon:a(z,{})}];return o((function(){var n;e.contextMenu&&(e.contextMenuItems?u(e.contextMenuItems):u(k),null===(n=v.current)||void 0===n||n.addEventListener("contextmenu",(function(e){e.preventDefault(),l(e.clientX),d(e.clientY),s(!0)})))}),[]),a("div",{ref:r,className:j.videoRoot,style:{maxHeight:e.height,maxWidth:e.width,background:"black"},children:e.children})})),ae=function(e){var n=e.src,i=e.controls,c=void 0===i||i,m=e.customControls,f=void 0!==m&&m,h=e.autoplay,p=void 0!==h&&h,g=e.loop,_=void 0!==g&&g,b=e.volume,y=void 0===b?1:b,w=e.playbackRate,C=void 0===w?1:w,x=e.onPlay,L=e.onPause,k=e.onEnd,E=e.onError,P=e.onVolumeChange,M=e.onSeek,B=e.className,V=t(null),z=r({isPlaying:!1,currentTime:0,duration:0,volume:y,playbackRate:C,isMuted:!1,isLoading:!0,error:null}),N=z[0],O=z[1];o((function(){V.current&&(V.current.volume=y,V.current.playbackRate=C,V.current.loop=_,p&&V.current.play().catch((function(e){O((function(n){return d(d({},n),{error:e})})),E&&E(e)})))}),[]);var R=u((function(){return s(void 0,void 0,void 0,(function(){var e;return v(this,(function(n){switch(n.label){case 0:if(!V.current)return[2];n.label=1;case 1:return n.trys.push([1,6,,7]),N.isPlaying?[4,V.current.pause()]:[3,3];case 2:return n.sent(),L&&L(),[3,5];case 3:return[4,V.current.play()];case 4:n.sent(),x&&x(),n.label=5;case 5:return O((function(e){return d(d({},e),{isPlaying:!e.isPlaying})})),[3,7];case 6:return e=n.sent(),O((function(n){return d(d({},n),{error:e})})),E&&E(e),[3,7];case 7:return[2]}}))}))}),[N.isPlaying,x,L,E]),I=u((function(e){V.current&&(V.current.currentTime=e,O((function(n){return d(d({},n),{currentTime:e})})),M&&M(e))}),[M]),H=u((function(e){V.current&&(V.current.volume=e,O((function(n){return d(d({},n),{volume:e})})),P&&P(e))}),[P]),S=u((function(e){V.current&&(V.current.playbackRate=e,O((function(n){return d(d({},n),{playbackRate:e})})))}),[]);o((function(){var e,n=function(){V.current&&O((function(e){return d(d({},e),{currentTime:V.current.currentTime,duration:V.current.duration})}))};return null===(e=V.current)||void 0===e||e.addEventListener("timeupdate",n),function(){var e;null===(e=V.current)||void 0===e||e.removeEventListener("timeupdate",n)}}),[]),o((function(){var e=function(e){if(V.current)switch(e.code){case"Space":e.preventDefault(),R();break;case"ArrowUp":e.preventDefault(),H(Math.min(N.volume+.1,1));break;case"ArrowDown":e.preventDefault(),H(Math.max(N.volume-.1,0));break;case"ArrowLeft":e.preventDefault(),I(Math.max(N.currentTime-5,0));break;case"ArrowRight":e.preventDefault(),I(Math.min(N.currentTime+5,N.duration))}};return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}),[N.volume,N.currentTime,N.duration,R,H,I]);return l("div",{className:"audio-wrapper ".concat(B||""),children:[a("audio",d({ref:V,src:n,controls:c&&!f,loop:_,onEnded:k,onError:function(e){var n=new Error("Audio playback error");O((function(e){return d(d({},e),{error:n})})),E&&E(n)}},!c&&{"aria-hidden":!0})),f&&l("div",{className:"audio-controls",role:"group","aria-label":"Audio controls",children:[a("button",{onClick:R,"aria-label":N.isPlaying?"Pause":"Play",className:"control-button",children:N.isPlaying?"⏸️":"▶️"}),a("input",{type:"range",min:0,max:N.duration,value:N.currentTime,onChange:function(e){return I(Number(e.target.value))},"aria-label":"Seek",className:"seek-slider"}),l("div",{className:"volume-control",children:[a("button",{onClick:function(){return O((function(e){return d(d({},e),{isMuted:!e.isMuted})}))},"aria-label":N.isMuted?"Unmute":"Mute",className:"control-button",children:N.isMuted?"🔇":"🔊"}),a("input",{type:"range",min:0,max:1,step:.1,value:N.volume,onChange:function(e){return H(Number(e.target.value))},"aria-label":"Volume",className:"volume-slider"})]}),l("select",{value:N.playbackRate,onChange:function(e){return S(Number(e.target.value))},"aria-label":"Playback speed",className:"playback-rate",children:[a("option",{value:.5,children:"0.5x"}),a("option",{value:1,children:"1x"}),a("option",{value:1.5,children:"1.5x"}),a("option",{value:2,children:"2x"})]}),l("span",{className:"time-display",role:"timer",children:[le(N.currentTime)," / ",le(N.duration)]})]})]})},le=function(e){if(isNaN(e))return"0:00";var n=Math.floor(e/60),t=Math.floor(e%60);return"".concat(n,":").concat(t.toString().padStart(2,"0"))},de=function(e){var n=e.src,i=e.alt,c=e.width,m=void 0===c?"auto":c,f=e.height,h=void 0===f?"auto":f,p=e.lazy,g=void 0===p||p,_=e.placeholder,b=e.srcSet,y=e.sizes,w=e.className,C=void 0===w?"":w,x=e.style,L=void 0===x?{}:x,k=e.filter,E=e.onLoad,P=e.onError,M=e.onClick,B=e.caption,V=e.overlay,z=e.zoomable,N=void 0!==z&&z,O=e.fallbackSrc,R=r({isLoaded:!1,hasError:!1,isZoomed:!1,zoomPosition:{x:0,y:0}}),I=R[0],H=R[1],S=t(null),T=t(null),j=function(e,n){var t=void 0===n?{}:n,i=t.threshold,c=void 0===i?0:i,u=t.rootMargin,a=void 0===u?"0px":u,l=t.triggerOnce,d=void 0!==l&&l,s=r(!1),v=s[0],m=s[1];return o((function(){var n=e.current;if(n){var t=new IntersectionObserver((function(e){var r=e[0];m(r.isIntersecting),r.isIntersecting&&d&&t.unobserve(n)}),{threshold:c,rootMargin:a});return t.observe(n),function(){return t.disconnect()}}}),[e,c,a,d]),{isIntersecting:v}}(T,{threshold:.1,triggerOnce:!0}).isIntersecting,A=u((function(){H((function(e){return d(d({},e),{isLoaded:!0})})),null==E||E()}),[E]),D=u((function(){var e=new Error("Image failed to load");H((function(e){return d(d({},e),{hasError:!0})})),null==P||P(e)}),[P]),F=u((function(e){if(N&&S.current&&T.current){var n=T.current.getBoundingClientRect(),t=(e.clientX-n.left)/n.width,r=(e.clientY-n.top)/n.height;H((function(e){return d(d({},e),{isZoomed:!e.isZoomed,zoomPosition:{x:t,y:r}})}))}}),[N]),X=k?{filter:k}:{},Z=d(d(d({},L),X),{width:m,height:h,objectFit:"cover",transition:"opacity 0.3s ease-in-out"});o((function(){s(void 0,void 0,void 0,(function(){var e;return v(this,(function(n){return(e=new Image).src="data:image/webp;base64,UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",[2,new Promise((function(n){e.onload=function(){return n(!0)},e.onerror=function(){return n(!1)}}))]}))})).then((function(e){e&&b&&!b.includes(".webp")&&console.warn("WebP format is supported but not included in srcSet")}))}),[b]);return l("div",{ref:T,className:"image-container ".concat(C),style:{position:"relative",overflow:"hidden",cursor:N?"zoom-in":"initial"},children:[(!g||j)&&a("img",{ref:S,src:n,alt:i,srcSet:b,sizes:y,style:d(d({},Z),{opacity:I.isLoaded?1:0,transform:I.isZoomed?"scale(2)":"none",transformOrigin:"".concat(100*I.zoomPosition.x,"% ").concat(100*I.zoomPosition.y,"%")}),onLoad:A,onError:D,onClick:function(e){F(e),null==M||M(e)},loading:g?"lazy":void 0}),!I.isLoaded&&!I.hasError&&a("div",{style:{width:m,height:h,backgroundColor:"#f0f0f0",display:"flex",alignItems:"center",justifyContent:"center"},children:_?a("img",{src:_,alt:"",style:{width:"100%",height:"100%",objectFit:"cover",filter:"blur(10px)"}}):a("div",{role:"presentation",children:"Loading..."})}),I.hasError&&a("div",{style:{width:m,height:h,backgroundColor:"#fee",display:"flex",alignItems:"center",justifyContent:"center"},children:O?a("img",{src:O,alt:i,style:{width:"100%",height:"100%",objectFit:"cover"}}):a("div",{role:"alert",children:"Failed to load image"})}),V&&I.isLoaded&&!I.hasError&&a("div",{className:"image-overlay",style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"},children:V}),B&&I.isLoaded&&!I.hasError&&a("figcaption",{className:"image-caption",style:{position:"absolute",bottom:0,left:0,right:0,padding:"8px",backgroundColor:"rgba(0, 0, 0, 0.7)",color:"white",textAlign:"center"},children:B})]})};export{ae as Audio,de as Img,ie as Video,m as VideoContext,Y as VideoControls,re as VideoElement,Q as VideoPoster,ce as VideoProvider,h as useControls};