@halibegic/react-video-player 0.0.47 → 0.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
(function(R,f){typeof exports=="object"&&typeof module!="undefined"?f(exports,require("react"),require("zustand"),require("mitt"),require("hls.js"),require("@radix-ui/react-slider"),require("@radix-ui/react-popover"),require("@radix-ui/react-scroll-area")):typeof define=="function"&&define.amd?define(["exports","react","zustand","mitt","hls.js","@radix-ui/react-slider","@radix-ui/react-popover","@radix-ui/react-scroll-area"],f):(R=typeof globalThis!="undefined"?globalThis:R||self,f(R.ReactVideoPlayer={},R.React,R.zustand,R.Mitt,R.Hls,R.RadixUISlider,R.RadixUIPopover,R.RadixUIScrollArea))})(this,(function(R,f,B,ee,te,rn,on,sn){"use strict";var
|
|
2
|
-
`+ze+r}}var We=!1,Me;{var Ar=typeof WeakMap=="function"?WeakMap:Map;Me=new Ar}function Ot(r,
|
|
1
|
+
(function(R,f){typeof exports=="object"&&typeof module!="undefined"?f(exports,require("react"),require("zustand"),require("mitt"),require("hls.js"),require("@radix-ui/react-slider"),require("@radix-ui/react-popover"),require("@radix-ui/react-scroll-area")):typeof define=="function"&&define.amd?define(["exports","react","zustand","mitt","hls.js","@radix-ui/react-slider","@radix-ui/react-popover","@radix-ui/react-scroll-area"],f):(R=typeof globalThis!="undefined"?globalThis:R||self,f(R.ReactVideoPlayer={},R.React,R.zustand,R.Mitt,R.Hls,R.RadixUISlider,R.RadixUIPopover,R.RadixUIScrollArea))})(this,(function(R,f,B,ee,te,rn,on,sn){"use strict";var lo=Object.defineProperty,uo=Object.defineProperties;var fo=Object.getOwnPropertyDescriptors;var Ne=Object.getOwnPropertySymbols;var tn=Object.prototype.hasOwnProperty,nn=Object.prototype.propertyIsEnumerable;var en=(R,f,B)=>f in R?lo(R,f,{enumerable:!0,configurable:!0,writable:!0,value:B}):R[f]=B,L=(R,f)=>{for(var B in f||(f={}))tn.call(f,B)&&en(R,B,f[B]);if(Ne)for(var B of Ne(f))nn.call(f,B)&&en(R,B,f[B]);return R},pe=(R,f)=>uo(R,fo(f));var re=(R,f)=>{var B={};for(var ee in R)tn.call(R,ee)&&f.indexOf(ee)<0&&(B[ee]=R[ee]);if(R!=null&&Ne)for(var ee of Ne(R))f.indexOf(ee)<0&&nn.call(R,ee)&&(B[ee]=R[ee]);return B};function Ae(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const _e=Ae(rn),ve=Ae(on),Ee=Ae(sn);function Je(e){var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){return t.reject(n)})})}function Qe(e){var t=this;return new t(function(n,o){if(!(e&&typeof e.length!="undefined"))return o(new TypeError(typeof e+" "+e+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var a=Array.prototype.slice.call(e);if(a.length===0)return n([]);var c=a.length;function u(l,d){if(d&&(typeof d=="object"||typeof d=="function")){var y=d.then;if(typeof y=="function"){y.call(d,function(g){u(l,g)},function(g){a[l]={status:"rejected",reason:g},--c===0&&n(a)});return}}a[l]={status:"fulfilled",value:d},--c===0&&n(a)}for(var i=0;i<a.length;i++)u(i,a[i])})}function qe(e,t){this.name="AggregateError",this.errors=e,this.message=t||""}qe.prototype=Error.prototype;function $e(e){var t=this;return new t(function(n,o){if(!(e&&typeof e.length!="undefined"))return o(new TypeError("Promise.any accepts an array"));var a=Array.prototype.slice.call(e);if(a.length===0)return o();for(var c=[],u=0;u<a.length;u++)try{t.resolve(a[u]).then(n).catch(function(i){c.push(i),c.length===a.length&&o(new qe(c,"All promises were rejected"))})}catch(i){o(i)}})}var an=setTimeout;function et(e){return!!(e&&typeof e.length!="undefined")}function cn(){}function ln(e,t){return function(){e.apply(t,arguments)}}function F(e){if(!(this instanceof F))throw new TypeError("Promises must be constructed via new");if(typeof e!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],nt(e,this)}function tt(e,t){for(;e._state===3;)e=e._value;if(e._state===0){e._deferreds.push(t);return}e._handled=!0,F._immediateFn(function(){var n=e._state===1?t.onFulfilled:t.onRejected;if(n===null){(e._state===1?Oe:ye)(t.promise,e._value);return}var o;try{o=n(e._value)}catch(a){ye(t.promise,a);return}Oe(t.promise,o)})}function Oe(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&(typeof t=="object"||typeof t=="function")){var n=t.then;if(t instanceof F){e._state=3,e._value=t,He(e);return}else if(typeof n=="function"){nt(ln(n,t),e);return}}e._state=1,e._value=t,He(e)}catch(o){ye(e,o)}}function ye(e,t){e._state=2,e._value=t,He(e)}function He(e){e._state===2&&e._deferreds.length===0&&F._immediateFn(function(){e._handled||F._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)tt(e,e._deferreds[t]);e._deferreds=null}function un(e,t,n){this.onFulfilled=typeof e=="function"?e:null,this.onRejected=typeof t=="function"?t:null,this.promise=n}function nt(e,t){var n=!1;try{e(function(o){n||(n=!0,Oe(t,o))},function(o){n||(n=!0,ye(t,o))})}catch(o){if(n)return;n=!0,ye(t,o)}}F.prototype.catch=function(e){return this.then(null,e)},F.prototype.then=function(e,t){var n=new this.constructor(cn);return tt(this,new un(e,t,n)),n},F.prototype.finally=Je,F.all=function(e){return new F(function(t,n){if(!et(e))return n(new TypeError("Promise.all accepts an array"));var o=Array.prototype.slice.call(e);if(o.length===0)return t([]);var a=o.length;function c(i,l){try{if(l&&(typeof l=="object"||typeof l=="function")){var d=l.then;if(typeof d=="function"){d.call(l,function(y){c(i,y)},n);return}}o[i]=l,--a===0&&t(o)}catch(y){n(y)}}for(var u=0;u<o.length;u++)c(u,o[u])})},F.any=$e,F.allSettled=Qe,F.resolve=function(e){return e&&typeof e=="object"&&e.constructor===F?e:new F(function(t){t(e)})},F.reject=function(e){return new F(function(t,n){n(e)})},F.race=function(e){return new F(function(t,n){if(!et(e))return n(new TypeError("Promise.race accepts an array"));for(var o=0,a=e.length;o<a;o++)F.resolve(e[o]).then(t,n)})},F._immediateFn=typeof setImmediate=="function"&&function(e){setImmediate(e)}||function(e){an(e,0)},F._unhandledRejectionFn=function(t){typeof console!="undefined"&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};var ae=(function(){if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global;throw new Error("unable to locate global object")})();typeof ae.Promise!="function"?ae.Promise=F:(ae.Promise.prototype.finally||(ae.Promise.prototype.finally=Je),ae.Promise.allSettled||(ae.Promise.allSettled=Qe),ae.Promise.any||(ae.Promise.any=$e));var Re={exports:{}},ge={};var rt;function dn(){if(rt)return ge;rt=1;var e=f,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function u(i,l,d){var y,g={},w=null,k=null;d!==void 0&&(w=""+d),l.key!==void 0&&(w=""+l.key),l.ref!==void 0&&(k=l.ref);for(y in l)o.call(l,y)&&!c.hasOwnProperty(y)&&(g[y]=l[y]);if(i&&i.defaultProps)for(y in l=i.defaultProps,l)g[y]===void 0&&(g[y]=l[y]);return{$$typeof:t,type:i,key:w,ref:k,props:g,_owner:a.current}}return ge.Fragment=n,ge.jsx=u,ge.jsxs=u,ge}var we={};var ot;function fn(){return ot||(ot=1,process.env.NODE_ENV!=="production"&&(function(){var e=f,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),i=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),k=Symbol.for("react.offscreen"),M=Symbol.iterator,T="@@iterator";function P(r){if(r===null||typeof r!="object")return null;var m=M&&r[M]||r[T];return typeof m=="function"?m:null}var A=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(r){{for(var m=arguments.length,p=new Array(m>1?m-1:0),C=1;C<m;C++)p[C-1]=arguments[C];I("error",r,p)}}function I(r,m,p){{var C=A.ReactDebugCurrentFrame,b=C.getStackAddendum();b!==""&&(m+="%s",p=p.concat([b]));var j=p.map(function(E){return String(E)});j.unshift("Warning: "+m),Function.prototype.apply.call(console[r],console,j)}}var x=!1,V=!1,v=!1,W=!1,G=!1,Z;Z=Symbol.for("react.module.reference");function O(r){return!!(typeof r=="string"||typeof r=="function"||r===o||r===c||G||r===a||r===d||r===y||W||r===k||x||V||v||typeof r=="object"&&r!==null&&(r.$$typeof===w||r.$$typeof===g||r.$$typeof===u||r.$$typeof===i||r.$$typeof===l||r.$$typeof===Z||r.getModuleId!==void 0))}function D(r,m,p){var C=r.displayName;if(C)return C;var b=m.displayName||m.name||"";return b!==""?p+"("+b+")":p}function q(r){return r.displayName||"Context"}function X(r){if(r==null)return null;if(typeof r.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case o:return"Fragment";case n:return"Portal";case c:return"Profiler";case a:return"StrictMode";case d:return"Suspense";case y:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case i:var m=r;return q(m)+".Consumer";case u:var p=r;return q(p._context)+".Provider";case l:return D(r,r.render,"ForwardRef");case g:var C=r.displayName||null;return C!==null?C:X(r.type)||"Memo";case w:{var b=r,j=b._payload,E=b._init;try{return X(E(j))}catch(_){return null}}}return null}var K=Object.assign,se=0,fe,ne,Y,xe,Ft,Vt,Nt;function At(){}At.__reactDisabledLog=!0;function Vr(){{if(se===0){fe=console.log,ne=console.info,Y=console.warn,xe=console.error,Ft=console.group,Vt=console.groupCollapsed,Nt=console.groupEnd;var r={configurable:!0,enumerable:!0,value:At,writable:!0};Object.defineProperties(console,{info:r,log:r,warn:r,error:r,group:r,groupCollapsed:r,groupEnd:r})}se++}}function Nr(){{if(se--,se===0){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:K({},r,{value:fe}),info:K({},r,{value:ne}),warn:K({},r,{value:Y}),error:K({},r,{value:xe}),group:K({},r,{value:Ft}),groupCollapsed:K({},r,{value:Vt}),groupEnd:K({},r,{value:Nt})})}se<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Be=A.ReactCurrentDispatcher,ze;function De(r,m,p){{if(ze===void 0)try{throw Error()}catch(b){var C=b.stack.trim().match(/\n( *(at )?)/);ze=C&&C[1]||""}return`
|
|
2
|
+
`+ze+r}}var We=!1,Me;{var Ar=typeof WeakMap=="function"?WeakMap:Map;Me=new Ar}function Ot(r,m){if(!r||We)return"";{var p=Me.get(r);if(p!==void 0)return p}var C;We=!0;var b=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var j;j=Be.current,Be.current=null,Vr();try{if(m){var E=function(){throw Error()};if(Object.defineProperty(E.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(E,[])}catch(Q){C=Q}Reflect.construct(r,[],E)}else{try{E.call()}catch(Q){C=Q}r.call(E.prototype)}}else{try{throw Error()}catch(Q){C=Q}r()}}catch(Q){if(Q&&C&&typeof Q.stack=="string"){for(var _=Q.stack.split(`
|
|
3
3
|
`),J=C.stack.split(`
|
|
4
4
|
`),H=_.length-1,U=J.length-1;H>=1&&U>=0&&_[H]!==J[U];)U--;for(;H>=1&&U>=0;H--,U--)if(_[H]!==J[U]){if(H!==1||U!==1)do if(H--,U--,U<0||_[H]!==J[U]){var $=`
|
|
5
|
-
`+_[H].replace(" at new "," at ");return r.displayName&&$.includes("<anonymous>")&&($=$.replace("<anonymous>",r.displayName)),typeof r=="function"&&Me.set(r,$),$}while(H>=1&&U>=0);break}}}finally{We=!1,Be.current=j,Nr(),Error.prepareStackTrace=b}var
|
|
5
|
+
`+_[H].replace(" at new "," at ");return r.displayName&&$.includes("<anonymous>")&&($=$.replace("<anonymous>",r.displayName)),typeof r=="function"&&Me.set(r,$),$}while(H>=1&&U>=0);break}}}finally{We=!1,Be.current=j,Nr(),Error.prepareStackTrace=b}var me=r?r.displayName||r.name:"",le=me?De(me):"";return typeof r=="function"&&Me.set(r,le),le}function Or(r,m,p){return Ot(r,!1)}function Hr(r){var m=r.prototype;return!!(m&&m.isReactComponent)}function Fe(r,m,p){if(r==null)return"";if(typeof r=="function")return Ot(r,Hr(r));if(typeof r=="string")return De(r);switch(r){case d:return De("Suspense");case y:return De("SuspenseList")}if(typeof r=="object")switch(r.$$typeof){case l:return Or(r.render);case g:return Fe(r.type,m,p);case w:{var C=r,b=C._payload,j=C._init;try{return Fe(j(b),m,p)}catch(E){}}}return""}var Te=Object.prototype.hasOwnProperty,Ht={},Ut=A.ReactDebugCurrentFrame;function Ve(r){if(r){var m=r._owner,p=Fe(r.type,r._source,m?m.type:null);Ut.setExtraStackFrame(p)}else Ut.setExtraStackFrame(null)}function Ur(r,m,p,C,b){{var j=Function.call.bind(Te);for(var E in r)if(j(r,E)){var _=void 0;try{if(typeof r[E]!="function"){var J=Error((C||"React class")+": "+p+" type `"+E+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[E]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw J.name="Invariant Violation",J}_=r[E](m,E,C,p,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(H){_=H}_&&!(_ instanceof Error)&&(Ve(b),S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",C||"React class",p,E,typeof _),Ve(null)),_ instanceof Error&&!(_.message in Ht)&&(Ht[_.message]=!0,Ve(b),S("Failed %s type: %s",p,_.message),Ve(null))}}}var Br=Array.isArray;function Ze(r){return Br(r)}function zr(r){{var m=typeof Symbol=="function"&&Symbol.toStringTag,p=m&&r[Symbol.toStringTag]||r.constructor.name||"Object";return p}}function Wr(r){try{return Bt(r),!1}catch(m){return!0}}function Bt(r){return""+r}function zt(r){if(Wr(r))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",zr(r)),Bt(r)}var Wt=A.ReactCurrentOwner,Zr={key:!0,ref:!0,__self:!0,__source:!0},Zt,Kt;function Kr(r){if(Te.call(r,"ref")){var m=Object.getOwnPropertyDescriptor(r,"ref").get;if(m&&m.isReactWarning)return!1}return r.ref!==void 0}function Yr(r){if(Te.call(r,"key")){var m=Object.getOwnPropertyDescriptor(r,"key").get;if(m&&m.isReactWarning)return!1}return r.key!==void 0}function Xr(r,m){typeof r.ref=="string"&&Wt.current}function Gr(r,m){{var p=function(){Zt||(Zt=!0,S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",m))};p.isReactWarning=!0,Object.defineProperty(r,"key",{get:p,configurable:!0})}}function Jr(r,m){{var p=function(){Kt||(Kt=!0,S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",m))};p.isReactWarning=!0,Object.defineProperty(r,"ref",{get:p,configurable:!0})}}var Qr=function(r,m,p,C,b,j,E){var _={$$typeof:t,type:r,key:m,ref:p,props:E,_owner:j};return _._store={},Object.defineProperty(_._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(_,"_self",{configurable:!1,enumerable:!1,writable:!1,value:C}),Object.defineProperty(_,"_source",{configurable:!1,enumerable:!1,writable:!1,value:b}),Object.freeze&&(Object.freeze(_.props),Object.freeze(_)),_};function qr(r,m,p,C,b){{var j,E={},_=null,J=null;p!==void 0&&(zt(p),_=""+p),Yr(m)&&(zt(m.key),_=""+m.key),Kr(m)&&(J=m.ref,Xr(m,b));for(j in m)Te.call(m,j)&&!Zr.hasOwnProperty(j)&&(E[j]=m[j]);if(r&&r.defaultProps){var H=r.defaultProps;for(j in H)E[j]===void 0&&(E[j]=H[j])}if(_||J){var U=typeof r=="function"?r.displayName||r.name||"Unknown":r;_&&Gr(E,U),J&&Jr(E,U)}return Qr(r,_,J,b,C,Wt.current,E)}}var Ke=A.ReactCurrentOwner,Yt=A.ReactDebugCurrentFrame;function he(r){if(r){var m=r._owner,p=Fe(r.type,r._source,m?m.type:null);Yt.setExtraStackFrame(p)}else Yt.setExtraStackFrame(null)}var Ye;Ye=!1;function Xe(r){return typeof r=="object"&&r!==null&&r.$$typeof===t}function Xt(){{if(Ke.current){var r=X(Ke.current.type);if(r)return`
|
|
6
6
|
|
|
7
|
-
Check the render method of \``+r+"`."}return""}}function $r(r){return""}var Gt={};function eo(r){{var
|
|
7
|
+
Check the render method of \``+r+"`."}return""}}function $r(r){return""}var Gt={};function eo(r){{var m=Xt();if(!m){var p=typeof r=="string"?r:r.displayName||r.name;p&&(m=`
|
|
8
8
|
|
|
9
|
-
Check the top-level render call using <`+
|
|
9
|
+
Check the top-level render call using <`+p+">.")}return m}}function Jt(r,m){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var p=eo(m);if(Gt[p])return;Gt[p]=!0;var C="";r&&r._owner&&r._owner!==Ke.current&&(C=" It was passed a child from "+X(r._owner.type)+"."),he(r),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',p,C),he(null)}}function Qt(r,m){{if(typeof r!="object")return;if(Ze(r))for(var p=0;p<r.length;p++){var C=r[p];Xe(C)&&Jt(C,m)}else if(Xe(r))r._store&&(r._store.validated=!0);else if(r){var b=P(r);if(typeof b=="function"&&b!==r.entries)for(var j=b.call(r),E;!(E=j.next()).done;)Xe(E.value)&&Jt(E.value,m)}}}function to(r){{var m=r.type;if(m==null||typeof m=="string")return;var p;if(typeof m=="function")p=m.propTypes;else if(typeof m=="object"&&(m.$$typeof===l||m.$$typeof===g))p=m.propTypes;else return;if(p){var C=X(m);Ur(p,r.props,"prop",C,r)}else if(m.PropTypes!==void 0&&!Ye){Ye=!0;var b=X(m);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",b||"Unknown")}typeof m.getDefaultProps=="function"&&!m.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function no(r){{for(var m=Object.keys(r.props),p=0;p<m.length;p++){var C=m[p];if(C!=="children"&&C!=="key"){he(r),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",C),he(null);break}}r.ref!==null&&(he(r),S("Invalid attribute `ref` supplied to `React.Fragment`."),he(null))}}var qt={};function $t(r,m,p,C,b,j){{var E=O(r);if(!E){var _="";(r===void 0||typeof r=="object"&&r!==null&&Object.keys(r).length===0)&&(_+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var J=$r();J?_+=J:_+=Xt();var H;r===null?H="null":Ze(r)?H="array":r!==void 0&&r.$$typeof===t?(H="<"+(X(r.type)||"Unknown")+" />",_=" Did you accidentally export a JSX literal instead of a component?"):H=typeof r,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",H,_)}var U=qr(r,m,p,b,j);if(U==null)return U;if(E){var $=m.children;if($!==void 0)if(C)if(Ze($)){for(var me=0;me<$.length;me++)Qt($[me],r);Object.freeze&&Object.freeze($)}else S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Qt($,r)}if(Te.call(m,"key")){var le=X(r),Q=Object.keys(m).filter(function(co){return co!=="key"}),Ge=Q.length>0?"{key: someKey, "+Q.join(": ..., ")+": ...}":"{key: someKey}";if(!qt[le+Ge]){var ao=Q.length>0?"{"+Q.join(": ..., ")+": ...}":"{}";S(`A props object containing a "key" prop is being spread into JSX:
|
|
10
10
|
let props = %s;
|
|
11
11
|
<%s {...props} />
|
|
12
12
|
React keys must be passed directly to JSX without using spread:
|
|
13
13
|
let props = %s;
|
|
14
|
-
<%s key={someKey} {...props} />`,Ge,
|
|
15
|
-
`);for(const n of t){const o=n.trim();if(o.startsWith("#EXT-X-PROGRAM-DATE-TIME:")){const a=o.replace("#EXT-X-PROGRAM-DATE-TIME:","").trim(),
|
|
16
|
-
`);let o=!1;for(const a of n){const l=a.trim();if(l.startsWith("#EXT-X-STREAM-INF:")){o=!0;continue}if(o&&!l.startsWith("#")){if(l.startsWith("http"))return l;{const u=new URL(t);return new URL(l,u.origin+u.pathname.substring(0,u.pathname.lastIndexOf("/"))+"/").toString()}}}return null}function An(e){return e.replace("playlist.m3u8","playlist_fmp4_dvr.m3u8")}async function On(e){try{const t=An(e);console.log("Converting to DVR URL:",t);const n=await fetch(t);if(!n.ok)throw new Error(`Failed to fetch master playlist: ${n.status} ${n.statusText}`);const o=await n.text(),a=Nn(o,t);if(!a)throw new Error("No chunklist URL found in master playlist");console.log("Found chunklist URL:",a);const l=await fetch(a);if(!l.ok)throw new Error(`Failed to fetch chunklist: ${l.status} ${l.statusText}`);const u=await l.text(),i=Vn(u);return i?console.log("Successfully detected start time:",i.toISOString()):console.log(" No start time found in chunklist"),i}catch(t){return console.error("Error getting start time from HLS URL:",t),null}}function Hn(n){var o=n,{url:e}=o,t=re(o,["url"]);const[a,l]=f.useState(!0),u=N(d=>d.startDate),i=N(d=>d.setStartDate),c=f.useCallback(async()=>{const d=await On(e);d&&i(d)},[e,i]);return f.useEffect(()=>{(async()=>{l(!0),await c(),l(!1)})()},[c]),be(c,u?null:5e3),a?null:s.jsx(Un,L({},t))}function Un({children:e,messages:t={}}){var u,i,c;const n=N(d=>d.startDate),o=h(d=>d.isStarted);return pn(o?null:5e3),n?Date.now()<n.getTime()?s.jsx(Bn,{startDate:n,title:(i=t==null?void 0:t.eventNotStarted)!=null?i:"Event has not started yet.",message:(c=t==null?void 0:t.eventStartingSoon)!=null?c:"Starting in few seconds..."}):s.jsx(s.Fragment,{children:e}):s.jsx("div",{className:oe.playerNotice,children:s.jsx("h3",{className:oe.playerNoticeTitle,children:(u=t==null?void 0:t.unableToPlay)!=null?u:"Unable to play the video. Please try again later."})})}function Bn({startDate:e,title:t,message:n}){const o=e.getTime()-Date.now(),a=Math.floor(o/(1e3*60*60)),l=Math.floor(o%(1e3*60*60)/(1e3*60));return a||l?s.jsxs("div",{className:oe.playerNotice,children:[s.jsx("h3",{className:oe.playerNoticeTitle,children:t}),s.jsxs("p",{className:oe.playerNoticeText,children:["(",a>0?`${a}h ${l}m`:`${l}m`,")"]})]}):s.jsx("div",{className:oe.playerNotice,children:s.jsx("h3",{className:oe.playerNoticeTitle,children:n})})}function dt({callback:e}){const t=h(n=>n.eventEmitter);return f.useEffect(()=>{const n=()=>e("play",void 0),o=()=>e("pause",void 0),a=()=>e("ended",void 0),l=()=>e("seeking",void 0),u=()=>e("seeked",void 0),i=T=>e("volumeChange",T),c=T=>e("fullscreenChange",T),d=T=>e("qualityChange",T),y=T=>e("loadedMetadata",T),g=()=>e("loadStart",void 0),w=()=>e("playing",void 0),k=()=>e("waiting",void 0),M=()=>e("error",void 0);return t.on("play",n),t.on("pause",o),t.on("ended",a),t.on("seeking",l),t.on("seeked",u),t.on("volumeChange",i),t.on("fullscreenChange",c),t.on("qualityChange",d),t.on("loadedMetadata",y),t.on("loadStart",g),t.on("playing",w),t.on("waiting",k),t.on("error",M),()=>{t.off("play",n),t.off("pause",o),t.off("ended",a),t.off("seeking",l),t.off("seeked",u),t.off("volumeChange",i),t.off("fullscreenChange",c),t.off("qualityChange",d),t.off("loadedMetadata",y),t.off("loadStart",g),t.off("playing",w),t.off("waiting",k),t.off("error",M)}},[e,t]),null}const ft=(e,t=0)=>parseInt(Math.max(0,(Date.now()-(e+t*1e3))/1e3).toFixed(0)),ht=(e,t)=>Math.max(0,(Date.now()-e-t*1e3)/1e3),zn=(e,t)=>Math.max(0,(t-e)/1e3),Wn=(e,t=0)=>{const o=t<0?0:t,a=["bytes","kb","mb","gb","tb","pb","eb","zb","yb"],l=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,l)).toFixed(o))}${a[l]}`};function Zn({isAuto:e,level:t,levels:n}){const o=n.length,a=[];return o>1&&a.push({sid:"quality-level-auto",label:"Auto",value:-1,selected:e||t===-1}),n.sort(function(l,u){const i=l.height||l.bitrate||0,c=u.height||u.bitrate||0;return i===c?0:i>c?1:-1}),n.map(l=>{const{bitrate:u,height:i,index:c}=l;a.push({sid:`quality-level-${c}`,label:i?`${i}p`:Wn(u),value:c,selected:o===1||!e&&c===t})}),a}function Kn({callback:e}){const t=N(l=>l.delay),n=N(l=>l.startDate),o=n?n.getTime():0,a=h(l=>l.eventEmitter);return f.useEffect(()=>{const l=()=>e("timeUpdate",{currentTime:ht(o,t),duration:-1});return a.on("timeUpdate",l),()=>{a.off("timeUpdate",l)}},[e,a]),s.jsx(dt,{callback:e})}function pt(){const e=h(i=>i.exitFullscreen),t=h(i=>i.isFullscreen),n=h(i=>i.isFullscreenReady),o=h(i=>i.requestFullscreen),a=h(i=>i.setVolume),l=h(i=>i.volume),u=f.useCallback(i=>{let c=!1;if(!(i.target instanceof HTMLInputElement||i.ctrlKey)){switch(i.code){case"ArrowUp":a(l+10<100?l+10:100),c=!0;break;case"ArrowDown":a(l-10>0?l-10:0),c=!0;break;case"KeyM":a(l===0?100:0),c=!0;break;case"KeyF":n&&(t?e():o(),c=!0);break}c&&i.preventDefault()}},[e,t,n,o,a,l]);return f.useEffect(()=>(document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u)}),[u]),null}function Yn(){const e=N(i=>i.delay),t=h(i=>i.isPlaying),n=h(i=>i.pause),o=h(i=>i.getPauseTimeDiff),a=h(i=>i.play),l=N(i=>i.setDelay),u=f.useCallback(i=>{let c=!1;if(!(i.target instanceof HTMLInputElement||i.ctrlKey)){switch(i.code){case"ArrowLeft":l(e+10),c=!0;break;case"ArrowRight":l(e-10>0?e-10:0),c=!0;break;case"Space":if(t)n();else{const d=o();d&&l(e+d),a()}c=!0;break}c&&i.preventDefault()}},[e,o,t,n,a,l]);return f.useEffect(()=>(document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u)}),[u]),s.jsx(pt,{})}function mt({children:e}){return s.jsx(Fn,{children:e})}function Xn({children:e}){return s.jsx(vn,{children:s.jsx(mt,{children:e})})}function Gn({url:e,isLive:t,messages:n}){const o=f.useRef(null),a=h(x=>x.level),l=h(x=>x.levels),u=h(x=>x.setLevel),i=h(x=>x.setLevels),c=h(x=>x.techRef),d=h(x=>x.setError),y=f.useRef(0),g=f.useRef(null),w=50,k=1e4,M=f.useCallback(x=>{if(o.current&&(o.current.nextLevel=x,u(null),l)){const V=l.map(v=>me(L({},v),{selected:v.value===x}));i(V)}},[l,u,i,o]),T=f.useCallback(()=>{o.current&&(console.log("[Player][HLS] MEDIA_ATTACHED"),o.current.loadSource(e))},[e]),P=f.useCallback(()=>{if(!o.current)return;console.log("[Player][HLS] MANIFEST_LOADED"),d(null),g.current&&(clearTimeout(g.current),g.current=null),y.current=0;const x=o.current.levels,V=o.current.currentLevel,v=o.current.autoLevelEnabled;i(Zn({levels:x.map((W,G)=>{const{bitrate:Z,height:O,width:D}=W;return{bitrate:Z,height:O,index:G,width:D}}),level:V,isAuto:v}))},[d,i]),A=f.useCallback((x,V)=>{var v;if(o.current&&V.fatal)switch(V.type){case te.ErrorTypes.NETWORK_ERROR:let W=(v=n==null?void 0:n.unableToPlay)!=null?v:"Unable to play the video. Please try again later.",G="NETWORK_ERROR";console.log("[Player][HLS] NETWORK_ERROR",V),t?(y.current<w&&(g.current&&clearTimeout(g.current),y.current+=1,g.current=setTimeout(()=>{if(o.current)try{console.log("[Player][HLS] Retrying stream..."),o.current.loadSource(e)}catch(Z){console.error("[Player][HLS] Retry failed:",Z)}},k)),G="LIVE_MANIFEST_LOAD_ERROR"):o.current.startLoad(),d({message:W,code:G,tech:"hls"});break;case te.ErrorTypes.MEDIA_ERROR:o.current.recoverMediaError();break}},[t,e,d]),S=f.useCallback(()=>{if(!c.current)return;let x={startLevel:-1,maxBufferSize:30*1024*1024};Cn?(x.backBufferLength=-1,x.enableWorker=!1):t?x.backBufferLength=10:x.backBufferLength=60;try{console.log("[Player][HLS] URL",e),console.log("[Player][HLS] Config",JSON.stringify(x)),console.log("[Player][HLS] Version",te.version),o.current=new te(x),o.current.attachMedia(c.current),o.current.on(te.Events.MEDIA_ATTACHED,T),o.current.on(te.Events.MANIFEST_LOADED,P),o.current.on(te.Events.ERROR,A)}catch(V){throw new Error(`Error initializing Hls: ${V}`)}},[P,T,A,t,c,e]),I=f.useCallback(()=>{o.current&&(o.current.off(te.Events.MEDIA_ATTACHED,T),o.current.off(te.Events.MANIFEST_LOADED,P),o.current.off(te.Events.ERROR,A),o.current.destroy(),o.current=null),g.current&&(clearTimeout(g.current),g.current=null),y.current=0},[P,T,A]);return f.useEffect(()=>{a!==null&&M(a)},[a,M]),f.useEffect(()=>(te.isSupported()&&S(),I),[I,S]),null}const Jn={playerVideo:"_playerVideo_wc0sm_1"};function vt({url:e,isLive:t,isMuted:n=!1,messages:o={}}){const a=h(v=>v.handleDurationChange),l=h(v=>v.handleEnd),u=h(v=>v.handleLoadedMetadata),i=h(v=>v.handleLoadStart),c=h(v=>v.handlePause),d=h(v=>v.handlePlay),y=h(v=>v.handlePlaying),g=h(v=>v.handleSeeked),w=h(v=>v.handleSeeking),k=h(v=>v.handleTimeUpdate),M=h(v=>v.handleWaiting),T=h(v=>v.handleVolumeChange),P=h(v=>v.handleError),A=h(v=>v.techRef),S=f.useRef(null),I=()=>t?{onTimeUpdate:x}:{onDurationChange:a,onSeeked:g,onSeeking:w,onTimeUpdate:x},x=()=>{(!S.current||Date.now()-S.current>=1e3)&&(k(),S.current=Date.now())},V=I();return s.jsxs(s.Fragment,{children:[s.jsx(Gn,{isLive:t,url:e,messages:o}),s.jsx("video",L({ref:A,className:Jn.playerVideo,playsInline:!0,autoPlay:!0,controls:!1,muted:n,preload:"auto",crossOrigin:"anonymous",onEnded:l,onError:P,onLoadedMetadata:u,onLoadStart:i,onPause:c,onPlay:d,onPlaying:y,onWaiting:M,onVolumeChange:T,tabIndex:-1},V))]})}function Qn({url:e,messages:t={}}){const[n,o]=f.useState(null),a=N(u=>u.delay),l=f.useCallback(async()=>{o(a?e.replace("-live","-catchup").replace("playlist.m3u8",`playlist_fmp4_dvr_timeshift-${a}.m3u8`):e)},[a,e]);return f.useEffect(()=>{l()},[l]),n?s.jsx(vt,{url:n,isLive:!0,messages:t}):null}function qn({url:e}){return h(n=>n.isStarted)?s.jsx($n,{url:e}):null}function $n({url:e}){const t=N(l=>l.setViewerCount),n=f.useRef(null),o=l=>{try{return new URL(l).pathname.split("/").filter(d=>d.length>0)[0]||null}catch(u){return console.error("Failed to extract URI from player URL:",u),null}},a=async()=>{var c;const l=o(e);if(!l){console.error("Could not extract URI from URL:",e);return}n.current&&n.current.abort(),n.current=new AbortController;const i=`https://${e.includes("staging")?"stg":"prd"}-fitnessanny.spectar.tv/analytics-api/v1/token-info/uri/${l}`;try{const d=await fetch(i,{signal:n.current.signal});if(!d.ok)throw new Error(`HTTP error! status: ${d.status}`);const g=(c=(await d.json()).count)!=null?c:0;t(g)}catch(d){if(d.name==="AbortError")return;console.error("Failed to fetch viewer count:",d),t(null)}};return f.useEffect(()=>(a(),()=>{n.current&&n.current.abort()}),[e]),be(a,15e3),null}function er(e,{defaultValue:t=!1,initializeWithValue:n=!0}={}){const o=i=>typeof window=="undefined"?t:window.matchMedia(i).matches,[a,l]=f.useState(()=>n?o(e):t);function u(){l(o(e))}return st(()=>{if(typeof window=="undefined")return;const i=window.matchMedia(e);return u(),i.addListener?i.addListener(u):i.addEventListener("change",u),()=>{i.removeListener?i.removeListener(u):i.removeEventListener("change",u)}},[e]),a}const ue={playbackButton:"_playbackButton_lgsgw_1",seekIndicator:"_seekIndicator_lgsgw_23",seekIndicatorLeft:"_seekIndicatorLeft_lgsgw_49",seekIndicatorRight:"_seekIndicatorRight_lgsgw_53",seekIndicatorVisible:"_seekIndicatorVisible_lgsgw_57"},tr=10;function yt(i){var c=i,{className:e,onClick:t,onForwardSeek:n,onBackwardSeek:o,maxForwardTime:a,maxBackwardTime:l}=c,u=re(c,["className","onClick","onForwardSeek","onBackwardSeek","maxForwardTime","maxBackwardTime"]);return er("(min-width: 1024px)")?s.jsx(nr,L({className:e,onClick:t},u)):s.jsx(rr,L({className:e,maxForwardTime:a,maxBackwardTime:l,onForwardSeek:n,onBackwardSeek:o},u))}function nr(o){var a=o,{className:e,onClick:t}=a,n=re(a,["className","onClick"]);const l=f.useRef(null),u=h(T=>T.exitFullscreen),i=h(T=>T.isFullscreen),c=h(T=>T.requestFullscreen),d=h(T=>T.resetIdle),y=T=>{k()?(w(),i?u():c()):g(T)},g=T=>{l.current=window.setTimeout(()=>{t==null||t(T),w()},200)},w=()=>{l.current!==null&&(window.clearTimeout(l.current),l.current=null)},k=()=>l.current!==null,M=()=>{d()};return f.useEffect(()=>()=>{w()},[]),s.jsx("button",L({onClick:y,onMouseMove:M,className:[ue.playbackButton,e].filter(Boolean).join(" "),"aria-label":"Player gestures"},n))}function rr(u){var i=u,{className:e,maxForwardTime:t,maxBackwardTime:n,onForwardSeek:o,onBackwardSeek:a}=i,l=re(i,["className","maxForwardTime","maxBackwardTime","onForwardSeek","onBackwardSeek"]);const c=f.useRef(null),d=f.useRef({single:null,indicator:null,accumulate:null}),y=f.useRef(null),g=f.useRef(0),w=f.useRef(null),[k,M]=f.useState({visible:!1,direction:null,time:0}),T=h(v=>v.isIdle),P=h(v=>v.setIsIdle),A=h(v=>v.resetIdle),S=(v,W)=>v<W/2?"backward":"forward",I=v=>{if(!y.current)return;const W=v.changedTouches[0];if(!W)return;const G=Date.now(),Z=y.current.getBoundingClientRect(),O=W.clientX-Z.left,D=W.clientY-Z.top;if(O<0||O>Z.width||D<0||D>Z.height)return;const q=c.current,X=q?G-q.time:1/0,K=S(O,Z.width),se=w.current!==null&&w.current===K&&q!==null&&X<700&&Math.abs(O-q.x)<100;if(q!==null&&w.current===null&&X<300&&Math.abs(O-q.x)<50||se){v.preventDefault(),v.stopPropagation(),d.current.single&&(window.clearTimeout(d.current.single),d.current.single=null),A(),(w.current===null||w.current!==K)&&(g.current=0,w.current=K);const ne=K==="backward"?n:t;g.current=Math.min(g.current+tr,ne!=null?ne:1/0),x(K,g.current),d.current.accumulate&&window.clearTimeout(d.current.accumulate),d.current.accumulate=window.setTimeout(()=>{const Y=g.current;Y>0&&(w.current==="backward"?a==null||a(Y):o==null||o(Y),A()),g.current=0,w.current=null,c.current=null,V(),d.current.accumulate=null},500),c.current={time:G,x:O}}else{c.current={time:G,x:O},d.current.single&&window.clearTimeout(d.current.single);const ne=w.current!==null?700:350;d.current.single=window.setTimeout(()=>{if(w.current===null){d.current.single=null;const Y=T;P(!Y),Y&&A()}c.current=null},ne)}},x=(v,W)=>{W!==0&&(M({visible:!0,direction:v,time:W}),d.current.indicator&&window.clearTimeout(d.current.indicator),d.current.indicator=window.setTimeout(()=>{V()},700))},V=()=>{M({visible:!1,direction:null,time:0}),d.current.indicator&&(window.clearTimeout(d.current.indicator),d.current.indicator=null)};return f.useEffect(()=>()=>{d.current.single&&window.clearTimeout(d.current.single),d.current.indicator&&window.clearTimeout(d.current.indicator),d.current.accumulate&&window.clearTimeout(d.current.accumulate)},[]),s.jsxs(s.Fragment,{children:[s.jsx("button",L({ref:y,onTouchEnd:I,className:[ue.playbackButton,e].filter(Boolean).join(" "),"aria-label":"Player gestures"},l)),k.visible&&s.jsxs("div",{className:`${ue.seekIndicator} ${ue.seekIndicatorVisible} ${k.direction==="backward"?ue.seekIndicatorLeft:ue.seekIndicatorRight}`,children:[k.direction==="backward"?"-":"+",Ce(k.time)]})]})}function or(){const e=h(c=>c.isPlaying),t=h(c=>c.pause),n=h(c=>c.getPauseTimeDiff),o=h(c=>c.play),a=N(c=>c.delay),l=N(c=>c.setDelay),u=N(c=>c.startDate),i=u?u.getTime():0;return s.jsx(yt,{onClick:()=>{if(e)t();else{const c=n();c&&l(a+c),o()}},onBackwardSeek:c=>{const d=a+c;l(d)},onForwardSeek:c=>{const d=Math.max(0,a-c);l(d)},maxBackwardTime:Math.floor(i),maxForwardTime:Math.floor(a)})}const gt={playerButton:"_playerButton_izwqq_1",playerButtonCircle:"_playerButtonCircle_izwqq_42"},le=f.forwardRef((a,o)=>{var l=a,{shape:e="circle",className:t}=l,n=re(l,["shape","className"]);const u=e==="circle"?gt.playerButtonCircle:"",i=[gt.playerButton,u,t].filter(Boolean).join(" ");return s.jsx("button",L({ref:o,className:i},n))});le.displayName="PlayerButton";const Se={liveIndicator:"_liveIndicator_1jczn_1",liveIndicatorHasDelay:"_liveIndicatorHasDelay_1jczn_9",liveIndicatorNoDelay:"_liveIndicatorNoDelay_1jczn_13"};function ir(n){var o=n,{message:e}=o,t=re(o,["message"]);const a=N(c=>c.delay),l=N(c=>c.setDelay),u=()=>{a&&l(0)},i=a?`${Se.liveIndicator} ${Se.liveIndicatorHasDelay}`:`${Se.liveIndicator} ${Se.liveIndicatorNoDelay}`;return s.jsxs(le,me(L({onClick:u,shape:"square"},t),{children:[s.jsx("div",{className:i}),e||"Live"]}))}function wt(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M6 5H8V19H6V5ZM16 5H18V19H16V5Z"})})}function Ct(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M19.376 12.4161L8.77735 19.4818C8.54759 19.635 8.23715 19.5729 8.08397 19.3432C8.02922 19.261 8 19.1645 8 19.0658V4.93433C8 4.65818 8.22386 4.43433 8.5 4.43433C8.59871 4.43433 8.69522 4.46355 8.77735 4.5183L19.376 11.584C19.6057 11.7372 19.6678 12.0477 19.5146 12.2774C19.478 12.3323 19.4309 12.3795 19.376 12.4161Z"})})}function sr(){const e=h(i=>i.isPlaying),t=h(i=>i.pause),n=h(i=>i.getPauseTimeDiff),o=h(i=>i.play),a=N(i=>i.delay),l=N(i=>i.setDelay),u=()=>{if(e)t();else{const i=n();i&&l(a+i),o()}};return s.jsx(le,{onClick:u,children:e?s.jsx(wt,{}):s.jsx(Ct,{})})}const ie={progressSlider:"_progressSlider_hwzgf_1",tipContainer:"_tipContainer_hwzgf_7",tipContainerVisible:"_tipContainerVisible_hwzgf_17",tipContainerHidden:"_tipContainerHidden_hwzgf_22",tipContent:"_tipContent_hwzgf_27"},je={sliderRoot:"_sliderRoot_aeak6_1",sliderTrack:"_sliderTrack_aeak6_18",sliderRange:"_sliderRange_aeak6_28",sliderThumb:"_sliderThumb_aeak6_37"},Pe=f.forwardRef((l,a)=>{var u=l,{max:e=100,min:t=0,className:n}=u,o=re(u,["max","min","className"]);return s.jsxs(_e.Root,me(L({ref:a,min:t,max:e,"aria-label":"Player progress",className:[je.sliderRoot,n].filter(Boolean).join(" "),onKeyDown:i=>i.preventDefault()},o),{children:[s.jsx(_e.Track,{className:je.sliderTrack,children:s.jsx(_e.Range,{className:je.sliderRange})}),s.jsx(_e.Thumb,{className:je.sliderThumb})]}))});Pe.displayName="PlayerSlider";function Le(e){const t=e.getBoundingClientRect();return e.offsetWidth/e.offsetHeight>e.clientWidth/e.clientHeight?{left:t.left*100,right:t.right*100,top:t.top*100,bottom:t.bottom*100,width:t.width*100,height:t.height*100}:t}const xt="vod-player-progress-bar";function ar(){const e=f.useRef(null),t=f.useRef(null),[n,o]=f.useState(0),[a,l]=f.useState(0),[u,i]=f.useState(!1),[c,d]=f.useState(-1),[y,g]=f.useState(-1),w=N(D=>D.delay),k=N(D=>D.startDate),M=k?k.getTime():0,T=new Date().getTime(),P=N(D=>D.setDelay),A=h(D=>D.isPlaying),S=h(D=>D.addIdleLock),I=h(D=>D.removeIdleLock),x=f.useCallback(()=>{o(ht(M,w)),l(zn(M,T))},[w,T,M]),V=parseFloat((a?(y!==-1?y:n)/a*100:0).toFixed(1)),v=D=>{g(a*(D[0]/100)),S(xt)},W=()=>{if(y!==-1){const D=ft(M,y);P(D),g(-1),I(xt)}},G=()=>i(!0),Z=()=>i(!1),O=f.useCallback(D=>{const q=e.current,X=t.current;if(q&&X){const K=Le(q),se=Le(X),fe=(D.pageX||D.clientX)-K.left,ne=fe/K.width;if(ne<0)return;let Y=fe-se.width/2;Y<0&&(Y=0),Y>K.width-se.width&&(Y=-1),X.style.left=Y>-1?`${Y}px`:"auto",X.style.right=Y>-1?"auto":"0px";const xe=a-ne*a;d(xe>0?xe:0)}G()},[a]);return be(()=>x(),A?1e3:null),f.useEffect(()=>{x()},[x]),s.jsxs("div",{className:ie.progressSlider,children:[s.jsx(Pe,{ref:e,value:[V],onPointerLeave:Z,onPointerDown:Z,onPointerMove:O,onValueChange:v,onValueCommit:W,step:.1}),s.jsx("div",{ref:t,className:`${ie.tipContainer} ${u?ie.tipContainerVisible:ie.tipContainerHidden}`,children:s.jsx("p",{className:ie.tipContent,children:`-${Ce(c)}`})})]})}function lr(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M22 12C22 17.5228 17.5229 22 12 22C6.4772 22 2 17.5228 2 12C2 6.47715 6.4772 2 12 2V4C7.5817 4 4 7.58172 4 12C4 16.4183 7.5817 20 12 20C16.4183 20 20 16.4183 20 12C20 9.53614 18.8862 7.33243 17.1346 5.86492L15 8V2L21 2L18.5535 4.44656C20.6649 6.28002 22 8.9841 22 12Z"})})}function cr(){const e=N(a=>a.startDate),t=N(a=>a.setDelay),n=e?e.getTime():0,o=()=>t(ft(n));return s.jsx(le,{onClick:o,children:s.jsx(lr,{})})}const ke={viewersContainer:"_viewersContainer_z1ihz_1",viewersIndicator:"_viewersIndicator_z1ihz_16",viewersIcon:"_viewersIcon_z1ihz_24",viewersCount:"_viewersCount_z1ihz_28"};function ur(){const e=N(t=>t.viewerCount);return e?s.jsxs("div",{className:ke.viewersContainer,children:[s.jsx("span",{className:ke.viewersIndicator}),s.jsxs("svg",{className:ke.viewersIcon,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("path",{d:"M8 7C9.10457 7 10 6.10457 10 5C10 3.89543 9.10457 3 8 3C6.89543 3 6 3.89543 6 5C6 6.10457 6.89543 7 8 7Z",fill:"currentColor"}),s.jsx("path",{d:"M8 8C5.79086 8 4 9.79086 4 12V13H12V12C12 9.79086 10.2091 8 8 8Z",fill:"currentColor"})]}),s.jsx("span",{className:ke.viewersCount,children:e.toLocaleString()})]}):null}function Tt(){const e=h(n=>n.error);if(!e)return null;const t=e.code==="LIVE_MANIFEST_LOAD_ERROR";return s.jsx("div",{className:`${oe.playerNotice} ${t?oe.playerNoticeLowZIndex:""}`,children:s.jsx("h3",{className:oe.playerNoticeTitle,children:e.message})})}const z={playerContainer:"_playerContainer_146tx_1",controlsTop:"_controlsTop_146tx_12",controlsBottom:"_controlsBottom_146tx_29",controlsContainer:"_controlsContainer_146tx_45",controlsRow:"_controlsRow_146tx_61",controlsSection:"_controlsSection_146tx_68",controlsSectionStart:"_controlsSectionStart_146tx_78",controlsSectionEnd:"_controlsSectionEnd_146tx_82"};function dr(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M16 3H22V9H20V5H16V3ZM2 3H8V5H4V9H2V3ZM20 19V15H22V21H16V19H20ZM4 19H8V21H2V15H4V19Z"})})}function fr(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M18 7H22V9H16V3H18V7ZM8 9H2V7H6V3H8V9ZM18 17V21H16V15H22V17H18ZM8 15V21H6V17H2V15H8Z"})})}function _t(){const e=h(d=>d.containerRef),t=h(d=>d.exitFullscreen),n=h(d=>d.isFullscreen),o=h(d=>d.requestFullscreen),a=h(d=>d.setIsFullscreen),l=h(d=>d.setIsFullscreenReady),u=h(d=>d.techRef),i=f.useCallback(d=>{d.stopPropagation(),a(xn())},[a]),c=()=>{n?t():o()};return f.useEffect(()=>{const d=ct?u.current:e.current;if(d)return En(d,i)},[e,i,u]),f.useEffect(()=>{l(!0)},[l]),s.jsx(le,{onClick:c,children:n?s.jsx(fr,{}):s.jsx(dr,{})})}const Ue={idleCheckContainer:"_idleCheckContainer_crh2s_1",idleCheckContainerIdle:"_idleCheckContainerIdle_crh2s_5",idleCheckContainerActive:"_idleCheckContainerActive_crh2s_11"},hr=5*1e3;function Et({children:e}){const t=f.useRef(null),n=h(w=>w.isIdle),o=h(w=>w.setIsIdle),a=f.useRef(null),u=h(w=>w.idleLocks).size,i=h(w=>w.eventEmitter),c=f.useCallback(()=>{a.current!==null&&(window.clearTimeout(a.current),a.current=null)},[]),d=f.useCallback(()=>{c(),a.current=window.setTimeout(()=>o(!0),hr)},[c]);f.useEffect(()=>(o(!1),d(),()=>{c()}),[c,d]),f.useEffect(()=>{const w=()=>{o(!1),d()};return i.on("resetIdle",w),()=>{i.off("resetIdle",w)}},[i,o,d]);const y=n&&!u,g=`${Ue.idleCheckContainer} ${y?Ue.idleCheckContainerIdle:Ue.idleCheckContainerActive}`;return s.jsx("div",{ref:t,className:g,children:e})}const pr={spinner:"_spinner_oo4hi_10"};function mr(e){return s.jsx("div",L({className:pr.spinner},e))}function vr(e,t=500){const[n,o]=f.useState(e);return f.useEffect(()=>{const a=window.setTimeout(()=>o(e),t);return()=>{window.clearTimeout(a)}},[e,t]),n}const yr={loadingContainer:"_loadingContainer_v9v7r_1"};function Rt(n){var o=n,{style:e}=o,t=re(o,["style"]);const a=h(u=>u.isLoading);return vr(a,100)?s.jsx("div",me(L({className:yr.loadingContainer,style:e},t),{children:s.jsx(mr,{})})):null}function gr(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M9.9997 15.1709L19.1921 5.97852L20.6063 7.39273L9.9997 17.9993L3.63574 11.6354L5.04996 10.2212L9.9997 15.1709Z"})})}function wr(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M4 5V19H20V5H4ZM3 3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3ZM7.5 11.25H9.5V9H11V15H9.5V12.75H7.5V15H6V9H7.5V11.25ZM14.5 10.5V13.5H16C16.2761 13.5 16.5 13.2761 16.5 13V11C16.5 10.7239 16.2761 10.5 16 10.5H14.5ZM13 9H16C17.1046 9 18 9.89543 18 11V13C18 14.1046 17.1046 15 16 15H13V9Z"})})}const de={dropdownMenuContent:"_dropdownMenuContent_b7j6b_1",dropdownMenuItem:"_dropdownMenuItem_b7j6b_83",scrollAreaRoot:"_scrollAreaRoot_b7j6b_125",scrollAreaViewport:"_scrollAreaViewport_b7j6b_133",scrollAreaScrollbar:"_scrollAreaScrollbar_b7j6b_141",scrollAreaThumb:"_scrollAreaThumb_b7j6b_168"},Cr=ve.Root,xr=ve.Trigger,Tr=ve.Portal,bt=f.forwardRef((l,a)=>{var u=l,{sideOffset:e=4,className:t,children:n}=u,o=re(u,["sideOffset","className","children"]);return s.jsx(ve.Content,me(L({ref:a,sideOffset:e,className:[de.dropdownMenuContent,t].filter(Boolean).join(" "),onOpenAutoFocus:i=>{i.preventDefault()},onCloseAutoFocus:i=>{i.preventDefault()}},o),{children:s.jsxs(Ee.Root,{className:de.scrollAreaRoot,type:"always",scrollHideDelay:0,children:[s.jsx(Ee.Viewport,{className:de.scrollAreaViewport,children:n}),s.jsx(Ee.Scrollbar,{className:de.scrollAreaScrollbar,orientation:"vertical",children:s.jsx(Ee.Thumb,{className:de.scrollAreaThumb})})]})}))});bt.displayName="PlayerMenuContent";const St=f.forwardRef((a,o)=>{var l=a,{className:e,onClick:t}=l,n=re(l,["className","onClick"]);const u=c=>{t==null||t(c)},i=c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),t==null||t(c))};return s.jsx(ve.Close,{asChild:!0,children:s.jsx("div",L({ref:o,className:[de.dropdownMenuItem,e].filter(Boolean).join(" "),role:"menuitem",tabIndex:0,onClick:u,onKeyDown:i},n))})});St.displayName="PlayerMenuItem";const jt="settings";function Pt(){const[e,t]=f.useState(!1),n=h(c=>c.containerRef),o=h(c=>c.addIdleLock),a=h(c=>c.removeIdleLock),l=h(c=>c.levels),u=h(c=>c.setLevel),i=f.useCallback(c=>{t(c),c?o(jt):a(jt)},[o,a]);return s.jsxs(Cr,{open:e,onOpenChange:i,children:[s.jsx(xr,{asChild:!0,children:s.jsx(le,{children:s.jsx(wr,{})})}),s.jsx(Tr,{container:n.current,children:s.jsx(bt,{side:"top",align:"end",children:l==null?void 0:l.map(c=>s.jsxs(St,{onClick:()=>u(c.value),children:[c.label,c.selected&&s.jsx(gr,{})]},c.sid))})})]})}function _r(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M6.60282 10.0001L10 7.22056V16.7796L6.60282 14.0001H3V10.0001H6.60282ZM2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z"})})}function Er(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M13 7.22056L9.60282 10.0001H6V14.0001H9.60282L13 16.7796V7.22056ZM8.88889 16.0001H5C4.44772 16.0001 4 15.5524 4 15.0001V9.00007C4 8.44778 4.44772 8.00007 5 8.00007H8.88889L14.1834 3.66821C14.3971 3.49335 14.7121 3.52485 14.887 3.73857C14.9601 3.8279 15 3.93977 15 4.05519V19.9449C15 20.2211 14.7761 20.4449 14.5 20.4449C14.3846 20.4449 14.2727 20.405 14.1834 20.3319L8.88889 16.0001ZM18.8631 16.5911L17.4411 15.1691C18.3892 14.4376 19 13.2902 19 12.0001C19 10.5697 18.2493 9.31476 17.1203 8.60766L18.5589 7.16906C20.0396 8.26166 21 10.0187 21 12.0001C21 13.8422 20.1698 15.4905 18.8631 16.5911Z"})})}function Rr(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M10 7.22056L6.60282 10.0001H3V14.0001H6.60282L10 16.7796V7.22056ZM5.88889 16.0001H2C1.44772 16.0001 1 15.5524 1 15.0001V9.00007C1 8.44778 1.44772 8.00007 2 8.00007H5.88889L11.1834 3.66821C11.3971 3.49335 11.7121 3.52485 11.887 3.73857C11.9601 3.8279 12 3.93977 12 4.05519V19.9449C12 20.2211 11.7761 20.4449 11.5 20.4449C11.3846 20.4449 11.2727 20.405 11.1834 20.3319L5.88889 16.0001ZM20.4142 12.0001L23.9497 15.5356L22.5355 16.9498L19 13.4143L15.4645 16.9498L14.0503 15.5356L17.5858 12.0001L14.0503 8.46454L15.4645 7.05032L19 10.5859L22.5355 7.05032L23.9497 8.46454L20.4142 12.0001Z"})})}const Lt={volumeContainer:"_volumeContainer_4d6jg_1",volumeSlider:"_volumeSlider_4d6jg_8"},kt="volume";function It(){const e=h(i=>i.setVolume),t=h(i=>i.volume),n=h(i=>i.addIdleLock),o=h(i=>i.removeIdleLock),a=i=>{e(i[0]),n(kt)},l=()=>{o(kt)},u=()=>e(t?0:100);return s.jsxs("div",{className:Lt.volumeContainer,children:[s.jsx(le,{onClick:u,className:"shrink-0",children:t?t>50?s.jsx(_r,{}):s.jsx(Er,{}):s.jsx(Rr,{})}),s.jsx("div",{className:Lt.volumeSlider,children:s.jsx(Pe,{value:[t],onValueChange:a,onValueCommit:l})})]})}const Dt={version:"0.0.47"};function br(e){return s.jsx(Xn,{children:s.jsx(Sr,L({},e))})}function Sr({url:e,messages:t,onEvent:n}){const o=h(a=>a.containerRef);return f.useEffect(()=>{console.log(`[Player][Live] Version: ${Dt.version}`)},[]),s.jsxs("div",{ref:o,className:z.playerContainer,children:[s.jsxs(Hn,{url:e,messages:{eventNotStarted:t==null?void 0:t.eventNotStarted,eventStartingSoon:t==null?void 0:t.eventStartingSoon,unableToPlay:t==null?void 0:t.unableToPlay},children:[s.jsx(Qn,{url:e,messages:{eventFinished:t==null?void 0:t.eventFinished,unableToPlay:t==null?void 0:t.unableToPlay}}),s.jsx(Tt,{}),s.jsx(Rt,{}),s.jsx(or,{}),s.jsxs(Et,{children:[s.jsx("div",{className:z.controlsTop,children:s.jsx("div",{className:z.controlsContainer,children:s.jsx("div",{className:z.controlsRow,children:s.jsx(ur,{})})})}),s.jsx("div",{className:z.controlsBottom,children:s.jsxs("div",{className:z.controlsContainer,children:[s.jsx(ar,{}),s.jsxs("div",{className:z.controlsRow,children:[s.jsxs("div",{className:`${z.controlsSection} ${z.controlsSectionStart}`,children:[s.jsx(sr,{}),s.jsx(cr,{}),s.jsx(It,{})]}),s.jsxs("div",{className:`${z.controlsSection} ${z.controlsSectionEnd}`,children:[s.jsx(ir,{message:t==null?void 0:t.live}),s.jsx(Pt,{}),s.jsx(_t,{})]})]})]})})]})]}),s.jsx(Yn,{}),s.jsx(qn,{url:e}),n&&s.jsx(Kn,{callback:n})]})}function jr(){const e=h(u=>u.isPlaying),t=h(u=>u.pause),n=h(u=>u.play),o=h(u=>u.currentTime),a=h(u=>u.duration),l=h(u=>u.seek);return s.jsx(yt,{onClick:()=>{e?t():n()},onBackwardSeek:u=>{const i=Math.max(0,o-u);l(i)},onForwardSeek:u=>{const i=Math.min(o+u,a);l(i)},maxBackwardTime:Math.floor(o),maxForwardTime:Math.floor(a-o)})}function Pr(){const e=h(a=>a.isPlaying),t=h(a=>a.pause),n=h(a=>a.play),o=()=>{e?t():n()};return s.jsx(le,{onClick:o,children:e?s.jsx(wt,{}):s.jsx(Ct,{})})}const Mt="vod-player-progress-bar";function Lr(){const e=f.useRef(null),t=f.useRef(null),[n,o]=f.useState(!1),[a,l]=f.useState(-1),[u,i]=f.useState(-1),c=h(I=>I.currentTime),d=h(I=>I.duration),y=h(I=>I.seek),g=h(I=>I.addIdleLock),w=h(I=>I.removeIdleLock),k=parseFloat((d?(u!==-1?u:c)/d*100:0).toFixed(1)),M=I=>{i(d*(I[0]/100)),g(Mt)},T=()=>{u!==-1&&(y(u),i(-1),w(Mt))},P=()=>o(!0),A=()=>o(!1),S=f.useCallback(I=>{const x=e.current,V=t.current;if(x&&V){const v=Le(x),W=Le(V),G=(I.pageX||I.clientX)-v.left,Z=G/v.width;if(Z<0)return;let O=G-W.width/2;O<0&&(O=0),O>v.width-W.width&&(O=-1),V.style.left=O>-1?`${O}px`:"auto",V.style.right=O>-1?"auto":"0px",l(Z*d)}P()},[d]);return s.jsxs("div",{className:ie.progressSlider,children:[s.jsx(Pe,{ref:e,value:[k],onPointerLeave:A,onPointerDown:A,onPointerMove:S,onValueChange:M,onValueCommit:T,step:.1}),s.jsx("div",{ref:t,className:`${ie.tipContainer} ${n?ie.tipContainerVisible:ie.tipContainerHidden}`,children:s.jsx("p",{className:ie.tipContent,children:Ce(a)})})]})}const Ie={remainingTimeContainer:"_remainingTimeContainer_1yyhb_1",remainingTime:"_remainingTime_1yyhb_1",remainingSeparator:"_remainingSeparator_1yyhb_17"};function kr(){const e=h(n=>n.currentTime),t=h(n=>n.duration);return s.jsxs("div",{className:Ie.remainingTimeContainer,children:[s.jsx("p",{className:Ie.remainingTime,children:Ce(e)}),s.jsx("p",{className:Ie.remainingSeparator}),s.jsx("p",{className:Ie.remainingTime,children:Ce(t)})]})}function Ir({callback:e}){const t=h(n=>n.eventEmitter);return f.useEffect(()=>{const n=o=>e("timeUpdate",o);return t.on("timeUpdate",n),()=>{t.off("timeUpdate",n)}},[e,t]),s.jsx(dt,{callback:e})}function Dr(){const e=h(i=>i.currentTime),t=h(i=>i.duration),n=h(i=>i.isPlaying),o=h(i=>i.pause),a=h(i=>i.play),l=h(i=>i.seek),u=f.useCallback(i=>{let c=!1;if(!(i.target instanceof HTMLInputElement||i.ctrlKey)){switch(i.code){case"ArrowLeft":l(e-10>=0?e-10:0),c=!0;break;case"ArrowRight":l(e+10<t?e+10:t),c=!0;break;case"Space":n?o():a(),c=!0;break}c&&i.preventDefault()}},[e,t,n,o,a,l]);return f.useEffect(()=>(document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u)}),[u]),s.jsx(pt,{})}function Mr(e){return s.jsx(mt,{children:s.jsx(Fr,L({},e))})}function Fr({url:e,messages:t,onEvent:n,startTime:o}){const a=h(u=>u.setStartTime),l=h(u=>u.containerRef);return f.useEffect(()=>{o&&a(o)},[o,a]),f.useEffect(()=>{console.log(`[Player][VOD] Version: ${Dt.version}`)},[]),s.jsxs("div",{ref:l,className:z.playerContainer,children:[s.jsx(vt,{url:e,isLive:!1,messages:t}),s.jsx(Tt,{}),s.jsx(Rt,{}),s.jsx(jr,{}),s.jsx(Et,{children:s.jsx("div",{className:z.controlsBottom,children:s.jsxs("div",{className:z.controlsContainer,children:[s.jsx(Lr,{}),s.jsxs("div",{className:z.controlsRow,children:[s.jsxs("div",{className:`${z.controlsSection} ${z.controlsSectionStart}`,children:[s.jsx(Pr,{}),s.jsx(It,{}),s.jsx(kr,{})]}),s.jsxs("div",{className:`${z.controlsSection} ${z.controlsSectionEnd}`,children:[s.jsx(Pt,{}),s.jsx(_t,{})]})]})]})})}),s.jsx(Dr,{}),n&&s.jsx(Ir,{callback:n})]})}R.LivePlayer=br,R.VodPlayer=Mr,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})}));
|
|
14
|
+
<%s key={someKey} {...props} />`,Ge,le,ao,le),qt[le+Ge]=!0}}return r===o?no(U):to(U),U}}function ro(r,m,p){return $t(r,m,p,!0)}function oo(r,m,p){return $t(r,m,p,!1)}var io=oo,so=ro;we.Fragment=o,we.jsx=io,we.jsxs=so})()),we}var it;function hn(){return it||(it=1,process.env.NODE_ENV==="production"?Re.exports=dn():Re.exports=fn()),Re.exports}var s=hn();const oe={playerNotice:"_playerNotice_x3acc_1",playerNoticeTitle:"_playerNoticeTitle_x3acc_19",playerNoticeText:"_playerNoticeText_x3acc_28",playerNoticeLowZIndex:"_playerNoticeLowZIndex_x3acc_37"},st=typeof window!="undefined"?f.useLayoutEffect:f.useEffect;function be(e,t){const n=f.useRef(e);st(()=>{n.current=e},[e]),f.useEffect(()=>{if(t===null)return;const o=setInterval(()=>{n.current()},t);return()=>{clearInterval(o)}},[t])}function mn(e){const[,t]=f.useState(0);be(()=>t(n=>n+1),e)}const pn=()=>B.create(e=>({delay:0,startDate:null,viewerCount:null,setDelay:t=>e({delay:t}),setStartDate:t=>e({startDate:t}),setViewerCount:t=>e({viewerCount:t})})),at=f.createContext(null),vn=({children:e})=>{const t=f.useRef(null);return t.current||(t.current=pn()),s.jsx(at.Provider,{value:t.current,children:e})},N=e=>{const t=f.useContext(at);if(!t)throw new Error("usePlayerStore must be used within PlayerStoreProvider");return B.useStore(t,e)};function yn(e,t,n){const o={days:86400,hours:3600,minutes:60,seconds:1,milliseconds:.001};return e*(o[t]/o[n])}function gn(e){return yn(e,"milliseconds","seconds")}const Ce=e=>{if(isNaN(e)||e===1/0)return"0:00";const t=c=>(c<10?"0":"")+c,n=Math.floor(e/3600),o=Math.floor(e%3600/60),a=Math.floor(e%60);return n===0?`${o}:${t(a)}`:`${n}:${t(o)}:${t(a)}`};function wn(e,t){var n,o,a,c,u,i;if(typeof Intl!="undefined"&&Intl.DateTimeFormat)try{const d=new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(e),y=parseInt(((n=d.find(P=>P.type==="year"))==null?void 0:n.value)||"0",10),g=parseInt(((o=d.find(P=>P.type==="month"))==null?void 0:o.value)||"0",10)-1,w=parseInt(((a=d.find(P=>P.type==="day"))==null?void 0:a.value)||"0",10),k=parseInt(((c=d.find(P=>P.type==="hour"))==null?void 0:c.value)||"0",10),M=parseInt(((u=d.find(P=>P.type==="minute"))==null?void 0:u.value)||"0",10),T=parseInt(((i=d.find(P=>P.type==="second"))==null?void 0:i.value)||"0",10);return new Date(y,g,w,k,M,T)}catch(l){return console.warn(`Failed to convert date to timezone ${t}, returning original date:`,l),e}return console.warn("Intl.DateTimeFormat not available, timezone conversion may be inaccurate"),e}function ct(e){var n;const t=typeof window!="undefined"&&((n=window.navigator)==null?void 0:n.userAgent)||"";return e.test(t)}const lt=ct(/iPhone|iPad|iPod/i),Cn=ct(/Tizen/i);function xn(){const e=document;return!!(e.fullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||e.msFullscreenElement)}function Tn(e){e.requestFullscreen?e.requestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.webkitRequestFullScreen?e.webkitRequestFullScreen():e.webkitEnterFullScreen?e.webkitEnterFullScreen():e.mozRequestFullScreen&&e.mozRequestFullScreen()}function _n(e){e.exitFullscreen?e.exitFullscreen():e.msExitFullscreen?e.msExitFullscreen():e.webkitExitFullscreen?e.webkitExitFullscreen():e.mozCancelFullScreen&&e.mozCancelFullScreen()}function En(e,t){return e.addEventListener("fullscreenchange",t),e.addEventListener("webkitfullscreenchange",t),e.addEventListener("mozfullscreenchange",t),e.addEventListener("MSFullscreenChange",t),()=>{e.removeEventListener("fullscreenchange",t),e.removeEventListener("webkitfullscreenchange",t),e.removeEventListener("mozfullscreenchange",t),e.removeEventListener("MSFullscreenChange",t)}}const Rn=()=>ee(),bn=(e,t)=>({currentTime:0,duration:0,isEnded:!1,isLoading:!1,isLoop:!1,isMetaLoaded:!1,isPlaying:!1,isReady:!1,isStarted:!1,pauseTime:0,seekTime:-1,startTime:-1,volume:100,destroy:()=>{},handleDurationChange:()=>{const n=t().techRef.current;n&&e({duration:n.duration})},handleEnd:()=>{t().techRef.current&&(t().eventEmitter.emit("ended"),e({isEnded:!0,isLoading:!1,isMetaLoaded:!1,isPlaying:!1}))},handleLoadedMetadata:()=>{const n=t().techRef.current;n&&(t().eventEmitter.emit("loadedMetadata",{duration:n.duration}),n.loop=t().isLoop,n.volume=n.muted?0:1,t().startTime!==-1&&(n.currentTime=t().startTime),e({currentTime:t().startTime!==-1?t().startTime:n.currentTime,duration:n.duration,startTime:-1,isMetaLoaded:!0,volume:n.muted?0:100}))},handleLoadStart:()=>{const n=t().techRef.current;n&&(t().eventEmitter.emit("loadStart"),e({isReady:!0}),n.play().then(()=>{e({isEnded:!1,isLoading:!1,isPlaying:!0,isStarted:!0,pauseTime:0})}).catch(()=>{e({isStarted:!1,isEnded:!1,isLoading:!1,isPlaying:!1})}))},handlePause:()=>{t().techRef.current&&(t().eventEmitter.emit("pause"),e({isPlaying:!1,pauseTime:Date.now()}))},handlePlay:()=>{t().techRef.current&&(t().eventEmitter.emit("play"),e({isPlaying:!0,pauseTime:0}))},handlePlaying:()=>{t().techRef.current&&(t().eventEmitter.emit("playing"),e({isLoading:!1}))},handleSeeked:()=>{t().techRef.current&&(t().eventEmitter.emit("seeked"),e({isLoading:!1}))},handleSeeking:()=>{t().techRef.current&&(t().eventEmitter.emit("seeking"),e({isLoading:!0}))},handleTimeUpdate:()=>{const n=t().techRef.current;n&&(t().eventEmitter.emit("timeUpdate",{currentTime:n.currentTime,duration:n.duration}),e({currentTime:n.currentTime}))},handleWaiting:()=>{t().techRef.current&&(t().eventEmitter.emit("waiting"),e({isLoading:!0}))},handleVolumeChange:()=>{const n=t().techRef.current;n&&t().eventEmitter.emit("volumeChange",{volume:n.volume})},handleError:n=>{const o=t().techRef.current;if(!o)return;t().eventEmitter.emit("error",n);const a=o.error;if(!a)return;const c=`${a.code}`,u=a.message||"Unknown error occurred";e({error:{message:u,code:c,tech:"native"}})},pause:()=>{const n=t().techRef.current;n&&(n.pause(),e({isEnded:!1,isPlaying:!1,pauseTime:Date.now()}))},getPauseTimeDiff:()=>!t().isStarted||!t().pauseTime?0:parseInt(gn(Date.now()-t().pauseTime).toFixed(0)),play:()=>{const n=t().techRef.current;n&&n.play().then(()=>{e({isEnded:!1,isLoading:!1,isPlaying:!0,isStarted:!0,pauseTime:0})}).catch(()=>{e({isStarted:!1,isEnded:!1,isLoading:!1,isPlaying:!1})})},seek:n=>{const o=t().techRef.current;o&&(o.currentTime=n,(o.paused||o.ended)&&o.play(),e({seekTime:-1,currentTime:n,isStarted:!0,isEnded:!1,isPlaying:!0}))},setIsLoading:n=>e({isLoading:n}),setIsLoop:n=>{const o=t().techRef.current;o&&(o.loop=n,e({isLoop:n}))},setStartTime:n=>e({startTime:n}),setVolume:n=>{const o=t().techRef.current;o&&(o.muted=n===0,o.volume=n/100,e({volume:n}))},stop:()=>{t().techRef.current&&e({isPlaying:!1,isLoading:!1})}}),Sn=(e,t)=>({isIdle:!1,setIsIdle:n=>e({isIdle:n}),resetIdle:()=>t().eventEmitter.emit("resetIdle")}),jn=e=>({idleLocks:new Set,addIdleLock:t=>e(n=>({idleLocks:new Set(n.idleLocks).add(t)})),removeIdleLock:t=>e(n=>{const o=new Set(n.idleLocks);return o.delete(t),{idleLocks:o}})}),Pn=(e,t)=>({level:null,levels:null,setLevels:n=>e({levels:n}),setLevel:n=>{n&&t().eventEmitter.emit("qualityChange",{level:n}),e({level:n})}}),Ln=(e,t)=>({isFullscreen:!1,isFullscreenReady:!1,exitFullscreen:()=>{t().eventEmitter.emit("fullscreenChange",{isFullscreen:!1}),_n(document),e({isFullscreen:!1})},requestFullscreen:()=>{const n=t().techRef.current,o=t().containerRef.current;if(!n||!o)return;t().eventEmitter.emit("fullscreenChange",{isFullscreen:!0});const a=lt?n:o;a&&Tn(a),e({isFullscreen:!0})},setIsFullscreen:n=>e({isFullscreen:n}),setIsFullscreenReady:n=>e({isFullscreenReady:n})}),kn=e=>({error:null,setError:t=>e({error:t})}),In=()=>({eventEmitter:Rn()}),Dn=e=>()=>L({},e),Mn=(e,t)=>B.create()((...n)=>L(L(L(L(L(L(L(L({},bn(...n)),Sn(...n)),jn(...n)),Ln(...n)),Pn(...n)),kn(...n)),In(...n)),Dn({techRef:e,containerRef:t})(...n))),ut=f.createContext(null);function Fn({children:e}){const t=f.useRef(null),n=f.useRef(null),o=f.useRef(null);return t.current||(t.current=Mn(n,o)),s.jsx(ut.Provider,{value:t.current,children:e})}const h=e=>{const t=f.useContext(ut);if(!t)throw new Error("usePlayerStore must be used within PlayerStoreProvider");return B.useStore(t,e)};function Vn(e){const t=e.split(`
|
|
15
|
+
`);for(const n of t){const o=n.trim();if(o.startsWith("#EXT-X-PROGRAM-DATE-TIME:")){const a=o.replace("#EXT-X-PROGRAM-DATE-TIME:","").trim(),c=new Date(a);if(!isNaN(c.getTime()))return wn(c,"Europe/Sarajevo")}}return null}function Nn(e,t){const n=e.split(`
|
|
16
|
+
`);let o=!1;for(const a of n){const c=a.trim();if(c.startsWith("#EXT-X-STREAM-INF:")){o=!0;continue}if(o&&!c.startsWith("#")){if(c.startsWith("http"))return c;{const u=new URL(t);return new URL(c,u.origin+u.pathname.substring(0,u.pathname.lastIndexOf("/"))+"/").toString()}}}return null}function An(e){return e.replace("playlist.m3u8","playlist_fmp4_dvr.m3u8")}async function On(e){try{const t=An(e);console.log("Converting to DVR URL:",t);const n=await fetch(t);if(!n.ok)throw new Error(`Failed to fetch master playlist: ${n.status} ${n.statusText}`);const o=await n.text(),a=Nn(o,t);if(!a)throw new Error("No chunklist URL found in master playlist");console.log("Found chunklist URL:",a);const c=await fetch(a);if(!c.ok)throw new Error(`Failed to fetch chunklist: ${c.status} ${c.statusText}`);const u=await c.text(),i=Vn(u);return i?console.log("Successfully detected start time:",i.toISOString()):console.log(" No start time found in chunklist"),i}catch(t){return console.error("Error getting start time from HLS URL:",t),null}}function Hn(n){var o=n,{url:e}=o,t=re(o,["url"]);const[a,c]=f.useState(!0),u=N(d=>d.startDate),i=N(d=>d.setStartDate),l=f.useCallback(async()=>{const d=await On(e);d&&i(d)},[e,i]);return f.useEffect(()=>{(async()=>{c(!0),await l(),c(!1)})()},[l]),be(l,u?null:5e3),a?null:s.jsx(Un,L({},t))}function Un({children:e,messages:t={}}){var u,i,l;const n=N(d=>d.startDate),o=h(d=>d.isStarted);return mn(o?null:5e3),n?Date.now()<n.getTime()?s.jsx(Bn,{startDate:n,title:(i=t==null?void 0:t.eventNotStarted)!=null?i:"Event has not started yet.",message:(l=t==null?void 0:t.eventStartingSoon)!=null?l:"Starting in few seconds..."}):s.jsx(s.Fragment,{children:e}):s.jsx("div",{className:oe.playerNotice,children:s.jsx("h3",{className:oe.playerNoticeTitle,children:(u=t==null?void 0:t.unableToPlay)!=null?u:"Unable to play the video. Please try again later."})})}function Bn({startDate:e,title:t,message:n}){const o=e.getTime()-Date.now(),a=Math.floor(o/(1e3*60*60)),c=Math.floor(o%(1e3*60*60)/(1e3*60));return a||c?s.jsxs("div",{className:oe.playerNotice,children:[s.jsx("h3",{className:oe.playerNoticeTitle,children:t}),s.jsxs("p",{className:oe.playerNoticeText,children:["(",a>0?`${a}h ${c}m`:`${c}m`,")"]})]}):s.jsx("div",{className:oe.playerNotice,children:s.jsx("h3",{className:oe.playerNoticeTitle,children:n})})}function dt({callback:e}){const t=h(n=>n.eventEmitter);return f.useEffect(()=>{const n=()=>e("play",void 0),o=()=>e("pause",void 0),a=()=>e("ended",void 0),c=()=>e("seeking",void 0),u=()=>e("seeked",void 0),i=T=>e("volumeChange",T),l=T=>e("fullscreenChange",T),d=T=>e("qualityChange",T),y=T=>e("loadedMetadata",T),g=()=>e("loadStart",void 0),w=()=>e("playing",void 0),k=()=>e("waiting",void 0),M=()=>e("error",void 0);return t.on("play",n),t.on("pause",o),t.on("ended",a),t.on("seeking",c),t.on("seeked",u),t.on("volumeChange",i),t.on("fullscreenChange",l),t.on("qualityChange",d),t.on("loadedMetadata",y),t.on("loadStart",g),t.on("playing",w),t.on("waiting",k),t.on("error",M),()=>{t.off("play",n),t.off("pause",o),t.off("ended",a),t.off("seeking",c),t.off("seeked",u),t.off("volumeChange",i),t.off("fullscreenChange",l),t.off("qualityChange",d),t.off("loadedMetadata",y),t.off("loadStart",g),t.off("playing",w),t.off("waiting",k),t.off("error",M)}},[e,t]),null}const ft=(e,t=0)=>parseInt(Math.max(0,(Date.now()-(e+t*1e3))/1e3).toFixed(0)),ht=(e,t)=>Math.max(0,(Date.now()-e-t*1e3)/1e3),zn=(e,t)=>Math.max(0,(t-e)/1e3),Wn=(e,t=0)=>{const o=t<0?0:t,a=["bytes","kb","mb","gb","tb","pb","eb","zb","yb"],c=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,c)).toFixed(o))}${a[c]}`};function Zn({isAuto:e,level:t,levels:n}){const o=n.length,a=[];return o>1&&a.push({sid:"quality-level-auto",label:"Auto",value:-1,selected:e||t===-1}),n.sort(function(c,u){const i=c.height||c.bitrate||0,l=u.height||u.bitrate||0;return i===l?0:i>l?1:-1}),n.map(c=>{const{bitrate:u,height:i,index:l}=c;a.push({sid:`quality-level-${l}`,label:i?`${i}p`:Wn(u),value:l,selected:o===1||!e&&l===t})}),a}function Kn({callback:e}){const t=N(c=>c.delay),n=N(c=>c.startDate),o=n?n.getTime():0,a=h(c=>c.eventEmitter);return f.useEffect(()=>{const c=()=>e("timeUpdate",{currentTime:ht(o,t),duration:-1});return a.on("timeUpdate",c),()=>{a.off("timeUpdate",c)}},[e,a]),s.jsx(dt,{callback:e})}function mt(){const e=h(i=>i.exitFullscreen),t=h(i=>i.isFullscreen),n=h(i=>i.isFullscreenReady),o=h(i=>i.requestFullscreen),a=h(i=>i.setVolume),c=h(i=>i.volume),u=f.useCallback(i=>{let l=!1;if(!(i.target instanceof HTMLInputElement||i.ctrlKey)){switch(i.code){case"ArrowUp":a(c+10<100?c+10:100),l=!0;break;case"ArrowDown":a(c-10>0?c-10:0),l=!0;break;case"KeyM":a(c===0?100:0),l=!0;break;case"KeyF":n&&(t?e():o(),l=!0);break}l&&i.preventDefault()}},[e,t,n,o,a,c]);return f.useEffect(()=>(document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u)}),[u]),null}function Yn(){const e=N(i=>i.delay),t=h(i=>i.isPlaying),n=h(i=>i.pause),o=h(i=>i.getPauseTimeDiff),a=h(i=>i.play),c=N(i=>i.setDelay),u=f.useCallback(i=>{let l=!1;if(!(i.target instanceof HTMLInputElement||i.ctrlKey)){switch(i.code){case"ArrowLeft":c(e+10),l=!0;break;case"ArrowRight":c(e-10>0?e-10:0),l=!0;break;case"Space":if(t)n();else{const d=o();d&&c(e+d),a()}l=!0;break}l&&i.preventDefault()}},[e,o,t,n,a,c]);return f.useEffect(()=>(document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u)}),[u]),s.jsx(mt,{})}function pt({children:e}){return s.jsx(Fn,{children:e})}function Xn({children:e}){return s.jsx(vn,{children:s.jsx(pt,{children:e})})}function Gn({url:e,isLive:t,messages:n}){const o=f.useRef(null),a=h(x=>x.level),c=h(x=>x.levels),u=h(x=>x.setLevel),i=h(x=>x.setLevels),l=h(x=>x.techRef),d=h(x=>x.setError),y=f.useRef(0),g=f.useRef(null),w=50,k=1e4,M=f.useCallback(x=>{if(o.current&&(o.current.nextLevel=x,u(null),c)){const V=c.map(v=>pe(L({},v),{selected:v.value===x}));i(V)}},[c,u,i,o]),T=f.useCallback(()=>{o.current&&(console.log("[Player][HLS] MEDIA_ATTACHED"),o.current.loadSource(e))},[e]),P=f.useCallback(()=>{if(!o.current)return;console.log("[Player][HLS] MANIFEST_LOADED"),d(null),g.current&&(clearTimeout(g.current),g.current=null),y.current=0;const x=o.current.levels,V=o.current.currentLevel,v=o.current.autoLevelEnabled;i(Zn({levels:x.map((W,G)=>{const{bitrate:Z,height:O,width:D}=W;return{bitrate:Z,height:O,index:G,width:D}}),level:V,isAuto:v}))},[d,i]),A=f.useCallback((x,V)=>{var v;if(o.current&&V.fatal)switch(V.type){case te.ErrorTypes.NETWORK_ERROR:let W=(v=n==null?void 0:n.unableToPlay)!=null?v:"Unable to play the video. Please try again later.",G="NETWORK_ERROR";console.log("[Player][HLS] NETWORK_ERROR",V),t?(y.current<w&&(g.current&&clearTimeout(g.current),y.current+=1,g.current=setTimeout(()=>{if(o.current)try{console.log("[Player][HLS] Retrying stream..."),o.current.loadSource(e)}catch(Z){console.error("[Player][HLS] Retry failed:",Z)}},k)),G="LIVE_MANIFEST_LOAD_ERROR"):o.current.startLoad(),d({message:W,code:G,tech:"hls"});break;case te.ErrorTypes.MEDIA_ERROR:o.current.recoverMediaError();break}},[t,e,d]),S=f.useCallback(()=>{if(!l.current)return;let x={startLevel:-1,maxBufferSize:30*1024*1024};Cn?(x.backBufferLength=-1,x.enableWorker=!1):t?x.backBufferLength=10:x.backBufferLength=60;try{console.log("[Player][HLS] URL",e),console.log("[Player][HLS] Config",JSON.stringify(x)),console.log("[Player][HLS] Version",te.version),o.current=new te(x),o.current.attachMedia(l.current),o.current.on(te.Events.MEDIA_ATTACHED,T),o.current.on(te.Events.MANIFEST_LOADED,P),o.current.on(te.Events.ERROR,A)}catch(V){throw new Error(`Error initializing Hls: ${V}`)}},[P,T,A,t,l,e]),I=f.useCallback(()=>{o.current&&(o.current.off(te.Events.MEDIA_ATTACHED,T),o.current.off(te.Events.MANIFEST_LOADED,P),o.current.off(te.Events.ERROR,A),o.current.destroy(),o.current=null),g.current&&(clearTimeout(g.current),g.current=null),y.current=0},[P,T,A]);return f.useEffect(()=>{a!==null&&M(a)},[a,M]),f.useEffect(()=>(te.isSupported()&&S(),I),[I,S]),null}const Jn={playerVideo:"_playerVideo_wc0sm_1"};function vt({url:e,isLive:t,isMuted:n=!1,messages:o={}}){const a=h(v=>v.handleDurationChange),c=h(v=>v.handleEnd),u=h(v=>v.handleLoadedMetadata),i=h(v=>v.handleLoadStart),l=h(v=>v.handlePause),d=h(v=>v.handlePlay),y=h(v=>v.handlePlaying),g=h(v=>v.handleSeeked),w=h(v=>v.handleSeeking),k=h(v=>v.handleTimeUpdate),M=h(v=>v.handleWaiting),T=h(v=>v.handleVolumeChange),P=h(v=>v.handleError),A=h(v=>v.techRef),S=f.useRef(null),I=()=>t?{onTimeUpdate:x}:{onDurationChange:a,onSeeked:g,onSeeking:w,onTimeUpdate:x},x=()=>{(!S.current||Date.now()-S.current>=1e3)&&(k(),S.current=Date.now())},V=I();return s.jsxs(s.Fragment,{children:[s.jsx(Gn,{isLive:t,url:e,messages:o}),s.jsx("video",L({ref:A,className:Jn.playerVideo,playsInline:!0,autoPlay:!0,controls:!1,muted:n,preload:"auto",crossOrigin:"anonymous",onEnded:c,onError:P,onLoadedMetadata:u,onLoadStart:i,onPause:l,onPlay:d,onPlaying:y,onWaiting:M,onVolumeChange:T,tabIndex:-1},V))]})}function Qn({url:e,messages:t={}}){const[n,o]=f.useState(null),a=N(u=>u.delay),c=f.useCallback(async()=>{o(a?e.replace("-live","-catchup").replace("playlist.m3u8",`playlist_fmp4_dvr_timeshift-${a}.m3u8`):e)},[a,e]);return f.useEffect(()=>{c()},[c]),n?s.jsx(vt,{url:n,isLive:!0,messages:t}):null}function qn({url:e}){return h(n=>n.isStarted)?s.jsx($n,{url:e}):null}function $n({url:e}){const t=N(c=>c.setViewerCount),n=f.useRef(null),o=c=>{try{return new URL(c).pathname.split("/").filter(d=>d.length>0)[0]||null}catch(u){return console.error("Failed to extract URI from player URL:",u),null}},a=async()=>{var l;const c=o(e);if(!c){console.error("Could not extract URI from URL:",e);return}n.current&&n.current.abort(),n.current=new AbortController;const i=`https://${e.includes("staging")?"stg":"prd"}-fitnessanny.spectar.tv/analytics-api/v1/token-info/uri/${c}`;try{const d=await fetch(i,{signal:n.current.signal});if(!d.ok)throw new Error(`HTTP error! status: ${d.status}`);const g=(l=(await d.json()).count)!=null?l:0;t(g)}catch(d){if(d.name==="AbortError")return;console.error("Failed to fetch viewer count:",d),t(null)}};return f.useEffect(()=>(a(),()=>{n.current&&n.current.abort()}),[e]),be(a,15e3),null}function er(e,{defaultValue:t=!1,initializeWithValue:n=!0}={}){const o=i=>typeof window=="undefined"?t:window.matchMedia(i).matches,[a,c]=f.useState(()=>n?o(e):t);function u(){c(o(e))}return st(()=>{if(typeof window=="undefined")return;const i=window.matchMedia(e);return u(),i.addListener?i.addListener(u):i.addEventListener("change",u),()=>{i.removeListener?i.removeListener(u):i.removeEventListener("change",u)}},[e]),a}const ue={playbackButton:"_playbackButton_lgsgw_1",seekIndicator:"_seekIndicator_lgsgw_23",seekIndicatorLeft:"_seekIndicatorLeft_lgsgw_49",seekIndicatorRight:"_seekIndicatorRight_lgsgw_53",seekIndicatorVisible:"_seekIndicatorVisible_lgsgw_57"},tr=10;function yt(i){var l=i,{className:e,onClick:t,onForwardSeek:n,onBackwardSeek:o,maxForwardTime:a,maxBackwardTime:c}=l,u=re(l,["className","onClick","onForwardSeek","onBackwardSeek","maxForwardTime","maxBackwardTime"]);return er("(pointer: coarse)")?s.jsx(rr,L({className:e,maxForwardTime:a,maxBackwardTime:c,onForwardSeek:n,onBackwardSeek:o},u)):s.jsx(nr,L({className:e,onClick:t},u))}function nr(o){var a=o,{className:e,onClick:t}=a,n=re(a,["className","onClick"]);const c=f.useRef(null),u=h(T=>T.exitFullscreen),i=h(T=>T.isFullscreen),l=h(T=>T.requestFullscreen),d=h(T=>T.resetIdle),y=T=>{k()?(w(),i?u():l()):g(T)},g=T=>{c.current=window.setTimeout(()=>{t==null||t(T),w()},200)},w=()=>{c.current!==null&&(window.clearTimeout(c.current),c.current=null)},k=()=>c.current!==null,M=()=>{d()};return f.useEffect(()=>()=>{w()},[]),s.jsx("button",L({onClick:y,onMouseMove:M,className:[ue.playbackButton,e].filter(Boolean).join(" "),"aria-label":"Player gestures"},n))}function rr(u){var i=u,{className:e,maxForwardTime:t,maxBackwardTime:n,onForwardSeek:o,onBackwardSeek:a}=i,c=re(i,["className","maxForwardTime","maxBackwardTime","onForwardSeek","onBackwardSeek"]);const l=f.useRef(null),d=f.useRef({single:null,indicator:null,accumulate:null}),y=f.useRef(null),g=f.useRef(0),w=f.useRef(null),[k,M]=f.useState({visible:!1,direction:null,time:0}),T=h(v=>v.isIdle),P=h(v=>v.setIsIdle),A=h(v=>v.resetIdle),S=(v,W)=>v<W/2?"backward":"forward",I=v=>{if(!y.current)return;const W=v.changedTouches[0];if(!W)return;const G=Date.now(),Z=y.current.getBoundingClientRect(),O=W.clientX-Z.left,D=W.clientY-Z.top;if(O<0||O>Z.width||D<0||D>Z.height)return;const q=l.current,X=q?G-q.time:1/0,K=S(O,Z.width),se=w.current!==null&&w.current===K&&q!==null&&X<700&&Math.abs(O-q.x)<100;if(q!==null&&w.current===null&&X<300&&Math.abs(O-q.x)<50||se){v.preventDefault(),v.stopPropagation(),d.current.single&&(window.clearTimeout(d.current.single),d.current.single=null),A(),(w.current===null||w.current!==K)&&(g.current=0,w.current=K);const ne=K==="backward"?n:t;g.current=Math.min(g.current+tr,ne!=null?ne:1/0),x(K,g.current),d.current.accumulate&&window.clearTimeout(d.current.accumulate),d.current.accumulate=window.setTimeout(()=>{const Y=g.current;Y>0&&(w.current==="backward"?a==null||a(Y):o==null||o(Y),A()),g.current=0,w.current=null,l.current=null,V(),d.current.accumulate=null},500),l.current={time:G,x:O}}else{l.current={time:G,x:O},d.current.single&&window.clearTimeout(d.current.single);const ne=w.current!==null?700:350;d.current.single=window.setTimeout(()=>{if(w.current===null){d.current.single=null;const Y=T;P(!Y),Y&&A()}l.current=null},ne)}},x=(v,W)=>{W!==0&&(M({visible:!0,direction:v,time:W}),d.current.indicator&&window.clearTimeout(d.current.indicator),d.current.indicator=window.setTimeout(()=>{V()},700))},V=()=>{M({visible:!1,direction:null,time:0}),d.current.indicator&&(window.clearTimeout(d.current.indicator),d.current.indicator=null)};return f.useEffect(()=>()=>{d.current.single&&window.clearTimeout(d.current.single),d.current.indicator&&window.clearTimeout(d.current.indicator),d.current.accumulate&&window.clearTimeout(d.current.accumulate)},[]),s.jsxs(s.Fragment,{children:[s.jsx("button",L({ref:y,onTouchEnd:I,className:[ue.playbackButton,e].filter(Boolean).join(" "),"aria-label":"Player gestures"},c)),k.visible&&s.jsxs("div",{className:`${ue.seekIndicator} ${ue.seekIndicatorVisible} ${k.direction==="backward"?ue.seekIndicatorLeft:ue.seekIndicatorRight}`,children:[k.direction==="backward"?"-":"+",Ce(k.time)]})]})}function or(){const e=h(l=>l.isPlaying),t=h(l=>l.pause),n=h(l=>l.getPauseTimeDiff),o=h(l=>l.play),a=N(l=>l.delay),c=N(l=>l.setDelay),u=N(l=>l.startDate),i=u?u.getTime():0;return s.jsx(yt,{onClick:()=>{if(e)t();else{const l=n();l&&c(a+l),o()}},onBackwardSeek:l=>{const d=a+l;c(d)},onForwardSeek:l=>{const d=Math.max(0,a-l);c(d)},maxBackwardTime:Math.floor(i),maxForwardTime:Math.floor(a)})}const gt={playerButton:"_playerButton_izwqq_1",playerButtonCircle:"_playerButtonCircle_izwqq_42"},ce=f.forwardRef((a,o)=>{var c=a,{shape:e="circle",className:t}=c,n=re(c,["shape","className"]);const u=e==="circle"?gt.playerButtonCircle:"",i=[gt.playerButton,u,t].filter(Boolean).join(" ");return s.jsx("button",L({ref:o,className:i},n))});ce.displayName="PlayerButton";const Se={liveIndicator:"_liveIndicator_1jczn_1",liveIndicatorHasDelay:"_liveIndicatorHasDelay_1jczn_9",liveIndicatorNoDelay:"_liveIndicatorNoDelay_1jczn_13"};function ir(n){var o=n,{message:e}=o,t=re(o,["message"]);const a=N(l=>l.delay),c=N(l=>l.setDelay),u=()=>{a&&c(0)},i=a?`${Se.liveIndicator} ${Se.liveIndicatorHasDelay}`:`${Se.liveIndicator} ${Se.liveIndicatorNoDelay}`;return s.jsxs(ce,pe(L({onClick:u,shape:"square"},t),{children:[s.jsx("div",{className:i}),e||"Live"]}))}function wt(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M6 5H8V19H6V5ZM16 5H18V19H16V5Z"})})}function Ct(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M19.376 12.4161L8.77735 19.4818C8.54759 19.635 8.23715 19.5729 8.08397 19.3432C8.02922 19.261 8 19.1645 8 19.0658V4.93433C8 4.65818 8.22386 4.43433 8.5 4.43433C8.59871 4.43433 8.69522 4.46355 8.77735 4.5183L19.376 11.584C19.6057 11.7372 19.6678 12.0477 19.5146 12.2774C19.478 12.3323 19.4309 12.3795 19.376 12.4161Z"})})}function sr(){const e=h(i=>i.isPlaying),t=h(i=>i.pause),n=h(i=>i.getPauseTimeDiff),o=h(i=>i.play),a=N(i=>i.delay),c=N(i=>i.setDelay),u=()=>{if(e)t();else{const i=n();i&&c(a+i),o()}};return s.jsx(ce,{onClick:u,children:e?s.jsx(wt,{}):s.jsx(Ct,{})})}const ie={progressSlider:"_progressSlider_hwzgf_1",tipContainer:"_tipContainer_hwzgf_7",tipContainerVisible:"_tipContainerVisible_hwzgf_17",tipContainerHidden:"_tipContainerHidden_hwzgf_22",tipContent:"_tipContent_hwzgf_27"},je={sliderRoot:"_sliderRoot_aeak6_1",sliderTrack:"_sliderTrack_aeak6_18",sliderRange:"_sliderRange_aeak6_28",sliderThumb:"_sliderThumb_aeak6_37"},Pe=f.forwardRef((c,a)=>{var u=c,{max:e=100,min:t=0,className:n}=u,o=re(u,["max","min","className"]);return s.jsxs(_e.Root,pe(L({ref:a,min:t,max:e,"aria-label":"Player progress",className:[je.sliderRoot,n].filter(Boolean).join(" "),onKeyDown:i=>i.preventDefault()},o),{children:[s.jsx(_e.Track,{className:je.sliderTrack,children:s.jsx(_e.Range,{className:je.sliderRange})}),s.jsx(_e.Thumb,{className:je.sliderThumb})]}))});Pe.displayName="PlayerSlider";function Le(e){const t=e.getBoundingClientRect();return e.offsetWidth/e.offsetHeight>e.clientWidth/e.clientHeight?{left:t.left*100,right:t.right*100,top:t.top*100,bottom:t.bottom*100,width:t.width*100,height:t.height*100}:t}const xt="vod-player-progress-bar";function ar(){const e=f.useRef(null),t=f.useRef(null),[n,o]=f.useState(0),[a,c]=f.useState(0),[u,i]=f.useState(!1),[l,d]=f.useState(-1),[y,g]=f.useState(-1),w=N(D=>D.delay),k=N(D=>D.startDate),M=k?k.getTime():0,T=new Date().getTime(),P=N(D=>D.setDelay),A=h(D=>D.isPlaying),S=h(D=>D.addIdleLock),I=h(D=>D.removeIdleLock),x=f.useCallback(()=>{o(ht(M,w)),c(zn(M,T))},[w,T,M]),V=parseFloat((a?(y!==-1?y:n)/a*100:0).toFixed(1)),v=D=>{g(a*(D[0]/100)),S(xt)},W=()=>{if(y!==-1){const D=ft(M,y);P(D),g(-1),I(xt)}},G=()=>i(!0),Z=()=>i(!1),O=f.useCallback(D=>{const q=e.current,X=t.current;if(q&&X){const K=Le(q),se=Le(X),fe=(D.pageX||D.clientX)-K.left,ne=fe/K.width;if(ne<0)return;let Y=fe-se.width/2;Y<0&&(Y=0),Y>K.width-se.width&&(Y=-1),X.style.left=Y>-1?`${Y}px`:"auto",X.style.right=Y>-1?"auto":"0px";const xe=a-ne*a;d(xe>0?xe:0)}G()},[a]);return be(()=>x(),A?1e3:null),f.useEffect(()=>{x()},[x]),s.jsxs("div",{className:ie.progressSlider,children:[s.jsx(Pe,{ref:e,value:[V],onPointerLeave:Z,onPointerDown:Z,onPointerMove:O,onValueChange:v,onValueCommit:W,step:.1}),s.jsx("div",{ref:t,className:`${ie.tipContainer} ${u?ie.tipContainerVisible:ie.tipContainerHidden}`,children:s.jsx("p",{className:ie.tipContent,children:`-${Ce(l)}`})})]})}function cr(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M22 12C22 17.5228 17.5229 22 12 22C6.4772 22 2 17.5228 2 12C2 6.47715 6.4772 2 12 2V4C7.5817 4 4 7.58172 4 12C4 16.4183 7.5817 20 12 20C16.4183 20 20 16.4183 20 12C20 9.53614 18.8862 7.33243 17.1346 5.86492L15 8V2L21 2L18.5535 4.44656C20.6649 6.28002 22 8.9841 22 12Z"})})}function lr(){const e=N(a=>a.startDate),t=N(a=>a.setDelay),n=e?e.getTime():0,o=()=>t(ft(n));return s.jsx(ce,{onClick:o,children:s.jsx(cr,{})})}const ke={viewersContainer:"_viewersContainer_z1ihz_1",viewersIndicator:"_viewersIndicator_z1ihz_16",viewersIcon:"_viewersIcon_z1ihz_24",viewersCount:"_viewersCount_z1ihz_28"};function ur(){const e=N(t=>t.viewerCount);return e?s.jsxs("div",{className:ke.viewersContainer,children:[s.jsx("span",{className:ke.viewersIndicator}),s.jsxs("svg",{className:ke.viewersIcon,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("path",{d:"M8 7C9.10457 7 10 6.10457 10 5C10 3.89543 9.10457 3 8 3C6.89543 3 6 3.89543 6 5C6 6.10457 6.89543 7 8 7Z",fill:"currentColor"}),s.jsx("path",{d:"M8 8C5.79086 8 4 9.79086 4 12V13H12V12C12 9.79086 10.2091 8 8 8Z",fill:"currentColor"})]}),s.jsx("span",{className:ke.viewersCount,children:e.toLocaleString()})]}):null}function Tt(){const e=h(n=>n.error);if(!e)return null;const t=e.code==="LIVE_MANIFEST_LOAD_ERROR";return s.jsx("div",{className:`${oe.playerNotice} ${t?oe.playerNoticeLowZIndex:""}`,children:s.jsx("h3",{className:oe.playerNoticeTitle,children:e.message})})}const z={playerContainer:"_playerContainer_146tx_1",controlsTop:"_controlsTop_146tx_12",controlsBottom:"_controlsBottom_146tx_29",controlsContainer:"_controlsContainer_146tx_45",controlsRow:"_controlsRow_146tx_61",controlsSection:"_controlsSection_146tx_68",controlsSectionStart:"_controlsSectionStart_146tx_78",controlsSectionEnd:"_controlsSectionEnd_146tx_82"};function dr(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M16 3H22V9H20V5H16V3ZM2 3H8V5H4V9H2V3ZM20 19V15H22V21H16V19H20ZM4 19H8V21H2V15H4V19Z"})})}function fr(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M18 7H22V9H16V3H18V7ZM8 9H2V7H6V3H8V9ZM18 17V21H16V15H22V17H18ZM8 15V21H6V17H2V15H8Z"})})}function _t(){const e=h(d=>d.containerRef),t=h(d=>d.exitFullscreen),n=h(d=>d.isFullscreen),o=h(d=>d.requestFullscreen),a=h(d=>d.setIsFullscreen),c=h(d=>d.setIsFullscreenReady),u=h(d=>d.techRef),i=f.useCallback(d=>{d.stopPropagation(),a(xn())},[a]),l=()=>{n?t():o()};return f.useEffect(()=>{const d=lt?u.current:e.current;if(d)return En(d,i)},[e,i,u]),f.useEffect(()=>{c(!0)},[c]),s.jsx(ce,{onClick:l,children:n?s.jsx(fr,{}):s.jsx(dr,{})})}const Ue={idleCheckContainer:"_idleCheckContainer_crh2s_1",idleCheckContainerIdle:"_idleCheckContainerIdle_crh2s_5",idleCheckContainerActive:"_idleCheckContainerActive_crh2s_11"},hr=5*1e3;function Et({children:e}){const t=f.useRef(null),n=h(w=>w.isIdle),o=h(w=>w.setIsIdle),a=f.useRef(null),u=h(w=>w.idleLocks).size,i=h(w=>w.eventEmitter),l=f.useCallback(()=>{a.current!==null&&(window.clearTimeout(a.current),a.current=null)},[]),d=f.useCallback(()=>{l(),a.current=window.setTimeout(()=>o(!0),hr)},[l]);f.useEffect(()=>(o(!1),d(),()=>{l()}),[l,d]),f.useEffect(()=>{const w=()=>{o(!1),d()};return i.on("resetIdle",w),()=>{i.off("resetIdle",w)}},[i,o,d]);const y=n&&!u,g=`${Ue.idleCheckContainer} ${y?Ue.idleCheckContainerIdle:Ue.idleCheckContainerActive}`;return s.jsx("div",{ref:t,className:g,children:e})}const mr={spinner:"_spinner_oo4hi_10"};function pr(e){return s.jsx("div",L({className:mr.spinner},e))}function vr(e,t=500){const[n,o]=f.useState(e);return f.useEffect(()=>{const a=window.setTimeout(()=>o(e),t);return()=>{window.clearTimeout(a)}},[e,t]),n}const yr={loadingContainer:"_loadingContainer_v9v7r_1"};function Rt(n){var o=n,{style:e}=o,t=re(o,["style"]);const a=h(u=>u.isLoading);return vr(a,100)?s.jsx("div",pe(L({className:yr.loadingContainer,style:e},t),{children:s.jsx(pr,{})})):null}function gr(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M9.9997 15.1709L19.1921 5.97852L20.6063 7.39273L9.9997 17.9993L3.63574 11.6354L5.04996 10.2212L9.9997 15.1709Z"})})}function wr(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M4 5V19H20V5H4ZM3 3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3ZM7.5 11.25H9.5V9H11V15H9.5V12.75H7.5V15H6V9H7.5V11.25ZM14.5 10.5V13.5H16C16.2761 13.5 16.5 13.2761 16.5 13V11C16.5 10.7239 16.2761 10.5 16 10.5H14.5ZM13 9H16C17.1046 9 18 9.89543 18 11V13C18 14.1046 17.1046 15 16 15H13V9Z"})})}const de={dropdownMenuContent:"_dropdownMenuContent_b7j6b_1",dropdownMenuItem:"_dropdownMenuItem_b7j6b_83",scrollAreaRoot:"_scrollAreaRoot_b7j6b_125",scrollAreaViewport:"_scrollAreaViewport_b7j6b_133",scrollAreaScrollbar:"_scrollAreaScrollbar_b7j6b_141",scrollAreaThumb:"_scrollAreaThumb_b7j6b_168"},Cr=ve.Root,xr=ve.Trigger,Tr=ve.Portal,bt=f.forwardRef((c,a)=>{var u=c,{sideOffset:e=4,className:t,children:n}=u,o=re(u,["sideOffset","className","children"]);return s.jsx(ve.Content,pe(L({ref:a,sideOffset:e,className:[de.dropdownMenuContent,t].filter(Boolean).join(" "),onOpenAutoFocus:i=>{i.preventDefault()},onCloseAutoFocus:i=>{i.preventDefault()}},o),{children:s.jsxs(Ee.Root,{className:de.scrollAreaRoot,type:"always",scrollHideDelay:0,children:[s.jsx(Ee.Viewport,{className:de.scrollAreaViewport,children:n}),s.jsx(Ee.Scrollbar,{className:de.scrollAreaScrollbar,orientation:"vertical",children:s.jsx(Ee.Thumb,{className:de.scrollAreaThumb})})]})}))});bt.displayName="PlayerMenuContent";const St=f.forwardRef((a,o)=>{var c=a,{className:e,onClick:t}=c,n=re(c,["className","onClick"]);const u=l=>{t==null||t(l)},i=l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),t==null||t(l))};return s.jsx(ve.Close,{asChild:!0,children:s.jsx("div",L({ref:o,className:[de.dropdownMenuItem,e].filter(Boolean).join(" "),role:"menuitem",tabIndex:0,onClick:u,onKeyDown:i},n))})});St.displayName="PlayerMenuItem";const jt="settings";function Pt(){const[e,t]=f.useState(!1),n=h(l=>l.containerRef),o=h(l=>l.addIdleLock),a=h(l=>l.removeIdleLock),c=h(l=>l.levels),u=h(l=>l.setLevel),i=f.useCallback(l=>{t(l),l?o(jt):a(jt)},[o,a]);return s.jsxs(Cr,{open:e,onOpenChange:i,children:[s.jsx(xr,{asChild:!0,children:s.jsx(ce,{children:s.jsx(wr,{})})}),s.jsx(Tr,{container:n.current,children:s.jsx(bt,{side:"top",align:"end",children:c==null?void 0:c.map(l=>s.jsxs(St,{onClick:()=>u(l.value),children:[l.label,l.selected&&s.jsx(gr,{})]},l.sid))})})]})}function _r(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M6.60282 10.0001L10 7.22056V16.7796L6.60282 14.0001H3V10.0001H6.60282ZM2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z"})})}function Er(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M13 7.22056L9.60282 10.0001H6V14.0001H9.60282L13 16.7796V7.22056ZM8.88889 16.0001H5C4.44772 16.0001 4 15.5524 4 15.0001V9.00007C4 8.44778 4.44772 8.00007 5 8.00007H8.88889L14.1834 3.66821C14.3971 3.49335 14.7121 3.52485 14.887 3.73857C14.9601 3.8279 15 3.93977 15 4.05519V19.9449C15 20.2211 14.7761 20.4449 14.5 20.4449C14.3846 20.4449 14.2727 20.405 14.1834 20.3319L8.88889 16.0001ZM18.8631 16.5911L17.4411 15.1691C18.3892 14.4376 19 13.2902 19 12.0001C19 10.5697 18.2493 9.31476 17.1203 8.60766L18.5589 7.16906C20.0396 8.26166 21 10.0187 21 12.0001C21 13.8422 20.1698 15.4905 18.8631 16.5911Z"})})}function Rr(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M10 7.22056L6.60282 10.0001H3V14.0001H6.60282L10 16.7796V7.22056ZM5.88889 16.0001H2C1.44772 16.0001 1 15.5524 1 15.0001V9.00007C1 8.44778 1.44772 8.00007 2 8.00007H5.88889L11.1834 3.66821C11.3971 3.49335 11.7121 3.52485 11.887 3.73857C11.9601 3.8279 12 3.93977 12 4.05519V19.9449C12 20.2211 11.7761 20.4449 11.5 20.4449C11.3846 20.4449 11.2727 20.405 11.1834 20.3319L5.88889 16.0001ZM20.4142 12.0001L23.9497 15.5356L22.5355 16.9498L19 13.4143L15.4645 16.9498L14.0503 15.5356L17.5858 12.0001L14.0503 8.46454L15.4645 7.05032L19 10.5859L22.5355 7.05032L23.9497 8.46454L20.4142 12.0001Z"})})}const Lt={volumeContainer:"_volumeContainer_4d6jg_1",volumeSlider:"_volumeSlider_4d6jg_8"},kt="volume";function It(){const e=h(i=>i.setVolume),t=h(i=>i.volume),n=h(i=>i.addIdleLock),o=h(i=>i.removeIdleLock),a=i=>{e(i[0]),n(kt)},c=()=>{o(kt)},u=()=>e(t?0:100);return s.jsxs("div",{className:Lt.volumeContainer,children:[s.jsx(ce,{onClick:u,className:"shrink-0",children:t?t>50?s.jsx(_r,{}):s.jsx(Er,{}):s.jsx(Rr,{})}),s.jsx("div",{className:Lt.volumeSlider,children:s.jsx(Pe,{value:[t],onValueChange:a,onValueCommit:c})})]})}const Dt={version:"0.0.49"};function br(e){return s.jsx(Xn,{children:s.jsx(Sr,L({},e))})}function Sr({url:e,messages:t,onEvent:n}){const o=h(a=>a.containerRef);return f.useEffect(()=>{console.log(`[Player][Live] Version: ${Dt.version}`)},[]),s.jsxs("div",{ref:o,className:z.playerContainer,children:[s.jsxs(Hn,{url:e,messages:{eventNotStarted:t==null?void 0:t.eventNotStarted,eventStartingSoon:t==null?void 0:t.eventStartingSoon,unableToPlay:t==null?void 0:t.unableToPlay},children:[s.jsx(Qn,{url:e,messages:{eventFinished:t==null?void 0:t.eventFinished,unableToPlay:t==null?void 0:t.unableToPlay}}),s.jsx(Tt,{}),s.jsx(Rt,{}),s.jsx(or,{}),s.jsxs(Et,{children:[s.jsx("div",{className:z.controlsTop,children:s.jsx("div",{className:z.controlsContainer,children:s.jsx("div",{className:z.controlsRow,children:s.jsx(ur,{})})})}),s.jsx("div",{className:z.controlsBottom,children:s.jsxs("div",{className:z.controlsContainer,children:[s.jsx(ar,{}),s.jsxs("div",{className:z.controlsRow,children:[s.jsxs("div",{className:`${z.controlsSection} ${z.controlsSectionStart}`,children:[s.jsx(sr,{}),s.jsx(lr,{}),s.jsx(It,{})]}),s.jsxs("div",{className:`${z.controlsSection} ${z.controlsSectionEnd}`,children:[s.jsx(ir,{message:t==null?void 0:t.live}),s.jsx(Pt,{}),s.jsx(_t,{})]})]})]})})]})]}),s.jsx(Yn,{}),s.jsx(qn,{url:e}),n&&s.jsx(Kn,{callback:n})]})}function jr(){const e=h(u=>u.isPlaying),t=h(u=>u.pause),n=h(u=>u.play),o=h(u=>u.currentTime),a=h(u=>u.duration),c=h(u=>u.seek);return s.jsx(yt,{onClick:()=>{e?t():n()},onBackwardSeek:u=>{const i=Math.max(0,o-u);c(i)},onForwardSeek:u=>{const i=Math.min(o+u,a);c(i)},maxBackwardTime:Math.floor(o),maxForwardTime:Math.floor(a-o)})}function Pr(){const e=h(a=>a.isPlaying),t=h(a=>a.pause),n=h(a=>a.play),o=()=>{e?t():n()};return s.jsx(ce,{onClick:o,children:e?s.jsx(wt,{}):s.jsx(Ct,{})})}const Mt="vod-player-progress-bar";function Lr(){const e=f.useRef(null),t=f.useRef(null),[n,o]=f.useState(!1),[a,c]=f.useState(-1),[u,i]=f.useState(-1),l=h(I=>I.currentTime),d=h(I=>I.duration),y=h(I=>I.seek),g=h(I=>I.addIdleLock),w=h(I=>I.removeIdleLock),k=parseFloat((d?(u!==-1?u:l)/d*100:0).toFixed(1)),M=I=>{i(d*(I[0]/100)),g(Mt)},T=()=>{u!==-1&&(y(u),i(-1),w(Mt))},P=()=>o(!0),A=()=>o(!1),S=f.useCallback(I=>{const x=e.current,V=t.current;if(x&&V){const v=Le(x),W=Le(V),G=(I.pageX||I.clientX)-v.left,Z=G/v.width;if(Z<0)return;let O=G-W.width/2;O<0&&(O=0),O>v.width-W.width&&(O=-1),V.style.left=O>-1?`${O}px`:"auto",V.style.right=O>-1?"auto":"0px",c(Z*d)}P()},[d]);return s.jsxs("div",{className:ie.progressSlider,children:[s.jsx(Pe,{ref:e,value:[k],onPointerLeave:A,onPointerDown:A,onPointerMove:S,onValueChange:M,onValueCommit:T,step:.1}),s.jsx("div",{ref:t,className:`${ie.tipContainer} ${n?ie.tipContainerVisible:ie.tipContainerHidden}`,children:s.jsx("p",{className:ie.tipContent,children:Ce(a)})})]})}const Ie={remainingTimeContainer:"_remainingTimeContainer_1yyhb_1",remainingTime:"_remainingTime_1yyhb_1",remainingSeparator:"_remainingSeparator_1yyhb_17"};function kr(){const e=h(n=>n.currentTime),t=h(n=>n.duration);return s.jsxs("div",{className:Ie.remainingTimeContainer,children:[s.jsx("p",{className:Ie.remainingTime,children:Ce(e)}),s.jsx("p",{className:Ie.remainingSeparator}),s.jsx("p",{className:Ie.remainingTime,children:Ce(t)})]})}function Ir({callback:e}){const t=h(n=>n.eventEmitter);return f.useEffect(()=>{const n=o=>e("timeUpdate",o);return t.on("timeUpdate",n),()=>{t.off("timeUpdate",n)}},[e,t]),s.jsx(dt,{callback:e})}function Dr(){const e=h(i=>i.currentTime),t=h(i=>i.duration),n=h(i=>i.isPlaying),o=h(i=>i.pause),a=h(i=>i.play),c=h(i=>i.seek),u=f.useCallback(i=>{let l=!1;if(!(i.target instanceof HTMLInputElement||i.ctrlKey)){switch(i.code){case"ArrowLeft":c(e-10>=0?e-10:0),l=!0;break;case"ArrowRight":c(e+10<t?e+10:t),l=!0;break;case"Space":n?o():a(),l=!0;break}l&&i.preventDefault()}},[e,t,n,o,a,c]);return f.useEffect(()=>(document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u)}),[u]),s.jsx(mt,{})}function Mr(e){return s.jsx(pt,{children:s.jsx(Fr,L({},e))})}function Fr({url:e,messages:t,onEvent:n,startTime:o}){const a=h(u=>u.setStartTime),c=h(u=>u.containerRef);return f.useEffect(()=>{o&&a(o)},[o,a]),f.useEffect(()=>{console.log(`[Player][VOD] Version: ${Dt.version}`)},[]),s.jsxs("div",{ref:c,className:z.playerContainer,children:[s.jsx(vt,{url:e,isLive:!1,messages:t}),s.jsx(Tt,{}),s.jsx(Rt,{}),s.jsx(jr,{}),s.jsx(Et,{children:s.jsx("div",{className:z.controlsBottom,children:s.jsxs("div",{className:z.controlsContainer,children:[s.jsx(Lr,{}),s.jsxs("div",{className:z.controlsRow,children:[s.jsxs("div",{className:`${z.controlsSection} ${z.controlsSectionStart}`,children:[s.jsx(Pr,{}),s.jsx(It,{}),s.jsx(kr,{})]}),s.jsxs("div",{className:`${z.controlsSection} ${z.controlsSectionEnd}`,children:[s.jsx(Pt,{}),s.jsx(_t,{})]})]})]})})}),s.jsx(Dr,{}),n&&s.jsx(Ir,{callback:n})]})}R.LivePlayer=br,R.VodPlayer=Mr,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})}));
|
|
17
17
|
//# sourceMappingURL=react-video-player.umd.js.map
|