2 lines
30 KiB
JavaScript
2 lines
30 KiB
JavaScript
(("undefined"!=typeof self?self:this).webpackJsonp__wix_thunderbolt_elements=("undefined"!=typeof self?self:this).webpackJsonp__wix_thunderbolt_elements||[]).push([[393],{1815:function(n,e,t){var r=t(676);n.exports=r.create("PlayableCover1036756629",{classes:{root:"PlayableCover1036756629__root",responsiveMode:"PlayableCover1036756629__responsiveMode",overlay:"PlayableCover1036756629__overlay",title:"PlayableCover1036756629__title",poster:"PlayableCover1036756629__poster",playButton:"PlayableCover1036756629__playButton"},vars:{},stVars:{},keyframes:{}},"",-1,n.i)},579:function(n,e,t){"use strict";t.r(e);var r=t(5),u=t(181),o=t.n(u),i=function(){var n=o.a.useRef(),e=o.a.useRef([]);return[function(){return void 0!==n.current?Promise.resolve(n.current):new Promise((function(n){e.current.push(n)}))},function(){return n.current},function(t){n.current=t,e.current.forEach((function(n){return n(t)})),e.current=[]},function(){return n.current=void 0}]},a=t(769),c=t(782),l=t(711),s=t(763),f="playable-cover",d="playable",v="dailymotion",y="twitch",m="youtube",p="facebook",b="vimeo",h="playable-title",g=t(742),P=function(){var n=u.useRef(0),e=u.useRef([]),t=function(){clearTimeout(n.current)},r=function(){t(),e.current.forEach((function(n){return n()})),n.current=setTimeout(r,1e3)};return u.useEffect((function(){t(),e.current=[]}),[]),{update:r,stop:t,subscribe:function(n){e.current.push(n)}}},w=/(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/,_=/(?:www\.|go\.)?twitch\.tv\/([a-z0-9_]+)($|\?)/;var E=u.forwardRef((function(n,e){var t=n.src,r=n.playing,o=n.muted,a=n.volume,f=void 0===a?0:a,d=n.onReady,v=n.onInit,m=n.onDuration,p=n.onProgress,b=n.onPlay,h=n.onPause,E=n.onEnded,O=n.onFirstPlay,j=n.onFirstEnded,C=u.useRef(null),R=u.useRef(null),V=u.useRef(!1),M=u.useRef(!1),T=u.useRef(!1),D=i(),F=D[0],I=D[1],k=P(),S=function(n){var e=_.test(n);return{channelId:e?n.match(_)[1]:"",videoId:e?"":n.match(w)[1]}}(t),N=S.channelId,A=S.videoId,x=function(n,e,t){var r=i(),u=r[0],o=r[1],a=r[2];return Object(l.a)((function(){Object(g.a)("twitch").then((function(r){e.current=r,a(new r.Player(n.current,t))}))})),[u,o]}(C,R,{video:A,channel:N,height:"100%",width:"100%",playsinline:!0,autoplay:r,muted:o}),z=x[0],U=x[1];return Object(l.a)((function(){z().then((function(n){!function(n,e,t,r,u,o,i,a,c){var l=t.onReady,s=t.onPlay,f=t.onPause,d=t.onEnded,v=t.onDuration,y=t.onProgress,m=t.onFirstPlay,p=t.onFirstEnded,b=e.READY,h=e.PLAY,g=e.PAUSE,P=e.ENDED;if(o.subscribe((function(){null==y||y(n.getCurrentTime()||0)})),v)var w=setInterval((function(){var e=n.getDuration();e&&(r(e),clearInterval(w))}),1e3);n.addEventListener(b,(function(){v&&u().then((function(n){return v(n)})),null==l||l()})),n.addEventListener(h,(function(){c.current||(c.current=!0,null==m||m()),i.current=!0,null==s||s(),o.update()})),n.addEventListener(g,(function(){i.current=!1,null==f||f(),o.stop()})),n.addEventListener(P,(function(){a.current||(a.current=!0,null==p||p()),i.current=!1,null==d||d(),o.stop()}))}(n,R.current.Player,{onReady:d,onPlay:b,onPause:h,onEnded:E,onDuration:m,onProgress:p,onFirstPlay:O,onFirstEnded:j},I,F,k,V,T,T),null==v||v(n,"twitch")}))})),function(n,e,t,r){var u=n.src,o=n.playing,i=n.muted,a=n.volume;Object(s.a)(u,(function(){e.current=!1,t.current=!1})),Object(s.a)(o,(function(){return r().then((function(n){return o?n.play():n.pause()}))})),Object(s.a)(i,(function(){return r().then((function(n){return n.setMuted(i)}))})),Object(s.a)(a,(function(){return r().then((function(n){return n.setVolume(a/100)}))}))}({src:t,playing:r,muted:o,volume:f},M,T,z),u.useImperativeHandle(e,(function(){return function(n,e,t){var r={play:function(){return n().then((function(n){return n.play()}))},pause:function(){return n().then((function(n){return n.pause()}))},togglePlay:function(){return t.current?r.pause():r.play()},getDuration:function(){var n=e();return n&&n.getDuration()||0},getCurrentTime:function(){var n=e();return n&&n.getCurrentTime()||0},seekTo:function(e){return n().then((function(n){return n.seek(e)}))},getVolume:function(){var n=e();return n?100*n.getVolume():0},setVolume:function(e){return n().then((function(n){return n.setVolume(e/100)}))},isMuted:function(){var n=e();return!n||n.getMuted()},isPlaying:function(){return t.current},mute:function(){return n().then((function(n){return n.setMuted(!0)}))},unMute:function(){return n().then((function(n){return n.setMuted(!1)}))}};return r}(z,U,V)})),u.createElement("div",{ref:C,className:c.classes.playerContainer,"data-player-name":"Twitch","data-testid":y})})),O=t(1624),j=t(942),C=t.n(j),R=t(1019),V=t.n(R),M=t(682),T=t(1815);function D(){return(D=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n}).apply(this,arguments)}var F=u.createElement("g",{fill:"none",fillRule:"evenodd"},u.createElement("circle",{cx:18,cy:18,r:17,stroke:"#fff",strokeWidth:2}),u.createElement("path",{fill:"#fff",d:"M23.935 17.708l-10.313 6.033V11.676z"}));function I(n){return u.createElement("svg",D({viewBox:"0 0 36 36",preserveAspectRatio:"xMidYMin slice"},n),F)}var k=function(n){var e=n.id,t=n.showTitle,o=n.title,i=n.poster,a=n.hideOverlay,c=n.playing,l=n.description,s=n.hasBeenPlayed,d=n.onPlay,v=n.className;return a||c||s?null:u.createElement("div",{onClick:d,"data-testid":f,id:"cover-"+e,className:Object(T.st)(T.classes.root,{transparentOverlay:!i},v)},i&&u.createElement(M.a,Object(r.__assign)({id:"img_"+e},i,{containerId:e,displayMode:"fill",alt:l||"",name:""})),u.createElement("div",{className:T.classes.overlay},t&&o&&u.createElement("div",{title:o,"data-testid":h,className:T.classes.title},o),u.createElement("button",{className:T.classes.playButton},u.createElement(I,null))))},S=function(n){n.showPlayControl(),n.showVolumeControl(),n.showTimeControl(),n.showFullScreenControl(),n.showProgressControl(),n.showPictureInPictureControl()},N=function(n){n.hidePlayControl(),n.hideVolumeControl(),n.hideTimeControl(),n.hideFullScreenControl(),n.hideProgressControl(),n.hidePictureInPictureControl()},A=function(){},x=u.forwardRef((function(n,e){var t=n.id,o=n.src,a=n.showTitle,f=n.title,v=n.poster,y=n.hideOverlay,m=n.playing,p=n.muted,b=n.preload,h=void 0===b?"none":b,g=n.controls,P=n.loop,w=n.texts,_=void 0===w?{}:w,E=n.hideMainUI,j=void 0!==E&&E,R=n.description,M=n.onReady,T=void 0===M?A:M,D=n.onDuration,F=void 0===D?A:D,I=n.onProgress,x=void 0===I?A:I,z=n.onPlay,U=void 0===z?A:z,B=n.onPause,L=void 0===B?A:B,Y=n.onEnded,$=void 0===Y?A:Y,H=n.onFirstPlay,G=void 0===H?A:H,J=n.onFirstEnded,Z=void 0===J?A:J,q=n.onInit,Q=void 0===q?A:q,W=u.useRef(null),K=function(n){var e=i(),t=e[0],r=e[1],u=e[2];return Object(l.a)((function(){return u(Object(O.create)(n)),function(){var n,e=r();null===(n=e.destroy)||void 0===n||n.call(e)}})),[t,r]}({src:o,autoplay:Boolean(m),playsinline:!0,muted:p,fillAllSpace:!0,title:f,preload:v?h:"metadata",loop:P,texts:_,hideOverlay:!0,hideMainUI:j,preventContextMenu:!0}),X=K[0],nn=K[1],en=u.useState(!1),tn=en[0],rn=en[1],un=u.useRef(!1),on=u.useRef(!1),an=u.useRef(!1);Object(l.a)((function(){X().then((function(n){N(n),a||n.hideTitle(),n.attachToElement(W.current),function(n,e,t,r,u,o){var i=e.controls,a=e.onReady,c=e.onDuration,l=e.onFirstPlay,s=e.onPlay,f=e.onPause,d=e.onFirstEnded,v=e.onEnded,y=e.onProgress;n.on(V.a.PLAY_REQUESTED,(function(){i&&S(n),t(!0)})),n.on(V.a.METADATA_LOADED,(function(){null==a||a(),null==c||c(n.getDuration())})),n.on(V.a.PLAYING,(function(){t(!0),u.current||(u.current=!0,null==l||l()),r.current=!0,null==s||s()})),n.on(V.a.PAUSED,(function(){r.current=!1,null==f||f()})),n.on(V.a.ENDED,(function(){t(!1),o.current||(o.current=!0,null==d||d()),r.current=!1,null==v||v()})),n.on(C.a.CURRENT_TIME_UPDATED,(function(n){null==y||y(n)}))}(n,{controls:g,onReady:T,onDuration:F,onFirstPlay:G,onPlay:U,onPause:L,onFirstEnded:Z,onEnded:$,onProgress:x},rn,un,on,an),Q(n,"playable")}))})),function(n,e,t,u){var o=n.src,i=n.playing,a=n.muted,c=n.volume,l=n.title,f=n.preload,d=n.showTitle,v=n.controls;Object(s.a)(o,(function(){return Object(r.__awaiter)(void 0,void 0,void 0,(function(){return Object(r.__generator)(this,(function(n){switch(n.label){case 0:return t.current=!1,u.current=!1,[4,e()];case 1:return n.sent().setSrc(o),[2]}}))}))})),Object(s.a)(i,(function(){return Object(r.__awaiter)(void 0,void 0,void 0,(function(){var n;return Object(r.__generator)(this,(function(t){switch(t.label){case 0:return i?[4,e()]:[3,2];case 1:return n=t.sent().play(),[3,4];case 2:return[4,e()];case 3:n=t.sent().pause(),t.label=4;case 4:return[2,n]}}))}))})),Object(s.a)(a,(function(){return Object(r.__awaiter)(void 0,void 0,void 0,(function(){var n;return Object(r.__generator)(this,(function(t){switch(t.label){case 0:return a?[4,e()]:[3,2];case 1:return n=t.sent().mute(),[3,4];case 2:return[4,e()];case 3:n=t.sent().unmute(),t.label=4;case 4:return[2,n]}}))}))})),Object(s.a)(c,(function(){return Object(r.__awaiter)(void 0,void 0,void 0,(function(){return Object(r.__generator)(this,(function(n){switch(n.label){case 0:return[4,e()];case 1:return[2,n.sent().setVolume(c)]}}))}))})),Object(s.a)(l,(function(){return Object(r.__awaiter)(void 0,void 0,void 0,(function(){return Object(r.__generator)(this,(function(n){switch(n.label){case 0:return[4,e()];case 1:return[2,n.sent().setTitle(l)]}}))}))})),Object(s.a)(f,(function(){return Object(r.__awaiter)(void 0,void 0,void 0,(function(){return Object(r.__generator)(this,(function(n){switch(n.label){case 0:return[4,e()];case 1:return[2,n.sent().setPreload(f)]}}))}))})),Object(s.a)(d,(function(){return Object(r.__awaiter)(void 0,void 0,void 0,(function(){var n;return Object(r.__generator)(this,(function(t){switch(t.label){case 0:return d?[4,e()]:[3,2];case 1:return n=t.sent().showTitle(),[3,4];case 2:return[4,e()];case 3:n=t.sent().hideTitle(),t.label=4;case 4:return[2,n]}}))}))})),Object(s.a)(v,(function(){return Object(r.__awaiter)(void 0,void 0,void 0,(function(){var n,t,u;return Object(r.__generator)(this,(function(r){switch(r.label){case 0:return v?(t=S,[4,e()]):[3,2];case 1:return n=t.apply(void 0,[r.sent()]),[3,4];case 2:return u=N,[4,e()];case 3:n=u.apply(void 0,[r.sent()]),r.label=4;case 4:return[2,n]}}))}))}))}({src:o,playing:m,muted:p,title:f,loop:P,preload:h,showTitle:a,controls:g},X,on,an),u.useImperativeHandle(e,(function(){return function(n,e,t){var u={play:function(){return new Promise((function(e){return Object(r.__awaiter)(void 0,void 0,void 0,(function(){var t;return Object(r.__generator)(this,(function(r){switch(r.label){case 0:return[4,n()];case 1:return(t=r.sent()).once(V.a.PLAYING,e),t.play(),[2]}}))}))}))},pause:function(){return new Promise((function(e){return Object(r.__awaiter)(void 0,void 0,void 0,(function(){var t;return Object(r.__generator)(this,(function(r){switch(r.label){case 0:return[4,n()];case 1:return(t=r.sent()).once(V.a.PAUSED,e),t.pause(),[2]}}))}))}))},togglePlay:function(){return t.current?u.pause():u.play()},stop:function(){return Object(r.__awaiter)(void 0,void 0,void 0,(function(){return Object(r.__generator)(this,(function(e){switch(e.label){case 0:return[4,n()];case 1:return[2,e.sent().reset()]}}))}))},getDuration:function(){var n=e();return n&&n.getDuration()||0},getCurrentTime:function(){var n=e();return n&&n.getCurrentTime()||0},seekTo:function(e){return Object(r.__awaiter)(void 0,void 0,void 0,(function(){return Object(r.__generator)(this,(function(t){switch(t.label){case 0:return[4,n()];case 1:return[2,t.sent().seekTo(e)]}}))}))},setVolume:function(e){return Object(r.__awaiter)(void 0,void 0,void 0,(function(){return Object(r.__generator)(this,(function(t){switch(t.label){case 0:return[4,n()];case 1:return[2,t.sent().setVolume(e)]}}))}))},getVolume:function(){var n=e();return n&&n.getVolume()||0},isMuted:function(){var n=e();return!n||n.isMuted},isPlaying:function(){return t.current},mute:function(){return Object(r.__awaiter)(void 0,void 0,void 0,(function(){return Object(r.__generator)(this,(function(e){switch(e.label){case 0:return[4,n()];case 1:return[2,e.sent().mute()]}}))}))},unMute:function(){return Object(r.__awaiter)(void 0,void 0,void 0,(function(){return Object(r.__generator)(this,(function(e){switch(e.label){case 0:return[4,n()];case 1:return[2,e.sent().unmute()]}}))}))}};return u}(X,nn,un)}));var cn=u.useCallback((function(){return Object(r.__awaiter)(void 0,void 0,void 0,(function(){return Object(r.__generator)(this,(function(n){switch(n.label){case 0:return[4,X()];case 1:return n.sent().play(),[2]}}))}))}),[X]);return u.createElement(u.Fragment,null,u.createElement("div",{ref:W,"data-player-name":"Playable","data-testid":d,className:c.classes.playerContainer}),u.createElement(k,{id:t,showTitle:a,title:f,poster:v,hideOverlay:y,playing:m,description:R,hasBeenPlayed:tn,onPlay:cn,className:Object(c.st)(c.classes.cover,{isMobileView:n.isMobileView})}))})),z=t(671),U=t.n(z),B="play",L="pause",Y="ended",$="volumechange",H="timeupdate";var G=u.forwardRef((function(n,e){var t=n.src,r=n.playing,o=n.muted,a=n.loop,f=n.showTitle,d=n.volume,v=void 0===d?0:d,y=n.onReady,m=n.onInit,p=n.onDuration,h=n.onProgress,P=n.onPlay,w=n.onPause,_=n.onEnded,E=n.onFirstPlay,O=n.onFirstEnded,j=n.onError,C=u.useRef(null),R=u.useRef(0),V=u.useRef(0),M=u.useRef(v),T=u.useRef(!1),D=u.useRef(!1),F=u.useRef(!1),I=function(n,e){var t=i(),r=t[0],u=t[2];return Object(l.a)((function(){return Object(g.a)("vimeo").then((function(t){u(new t.Player(n.current,e))})),function(){r().then((function(n){return n.destroy()}))}})),r}(C,{url:t,autoplay:r,muted:o,loop:a,title:f});return Object(l.a)((function(){I().then((function(n){n.ready().then((function(){null==y||y(),n.getDuration().then((function(n){R.current=n,null==p||p(n)}))})),function(n,e,t,r,u,o,i){var a=e.onProgress,c=e.onPlay,l=e.onPause,s=e.onEnded,f=e.onFirstPlay,d=e.onFirstEnded,v=e.onError;n.on(B,(function(){i.current||(i.current=!0,null==f||f()),u.current=!0,null==c||c()})),n.on(L,(function(){u.current=!1,null==l||l()})),n.on(Y,(function(){o.current||(o.current=!0,null==d||d()),u.current=!1,null==s||s()})),n.on($,(function(n){var e=n.volume;r.current=100*e})),n.on(H,(function(n){var e=n.seconds;t.current=e,null==a||a(e)})),v&&n.on("error",v)}(n,{onProgress:h,onPlay:P,onPause:w,onEnded:_,onFirstPlay:E,onFirstEnded:O,onError:j},V,M,T,F,D),null==m||m(n,"vimeo")}))})),function(n,e,t,r){var u=n.src,o=n.playing,i=n.muted,a=n.volume;Object(s.a)(u,(function(){e.current=!1,t.current=!1})),Object(s.a)(o,(function(){return r().then((function(n){return o?n.play():n.pause()}))})),Object(s.a)(i,(function(){return r().then((function(n){return n.setVolume(i?0:1)}))})),Object(s.a)(a,(function(){return r().then((function(n){return n.setVolume(a/100)}))}))}({src:t,playing:r,muted:o,volume:v},D,F,I),u.useImperativeHandle(e,(function(){return function(n,e,t,r,u){var o={play:function(){return n().then((function(n){return n.play()}))},pause:function(){return n().then((function(n){return n.pause()}))},togglePlay:function(){return e.current?o.pause():o.play()},getDuration:function(){return t.current},getCurrentTime:function(){return r.current},seekTo:function(e){return n().then((function(n){return n.setCurrentTime(e)}))},getVolume:function(){return u.current},setVolume:function(e){return n().then((function(n){return n.setVolume(e/100)}))},isMuted:function(){return 0===u.current},isPlaying:function(){return e.current},mute:function(){return n().then((function(n){return n.setVolume(0)}))},unMute:function(){return n().then((function(n){return n.setVolume(1)}))}};return o}(I,T,R,V,M)})),u.createElement("div",{ref:C,"data-player-name":"Vimeo","data-testid":b,className:U()(c.classes.playerContainer,c.classes.vimeoContainer)})})),J=/(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})/;function Z(n,e,t,r,u,o,i){var a=t.onPlay,c=t.onPause,l=t.onEnded,s=t.onProgress,f=t.onFirstPlay,d=t.onFirstEnded;r.subscribe((function(){null==s||s(n().getCurrentTime()||0)}));return function(n){var t=n.data,s=e(),v=s.PLAYING,y=s.PAUSED,m=s.ENDED;t===v&&(i.current||(i.current=!0,null==f||f()),u.current=!0,null==a||a(),r.update()),t===y&&(u.current=!1,null==c||c(),r.stop()),t===m&&(o.current||(o.current=!0,null==d||d()),u.current=!1,null==l||l(),r.stop())}}var q=u.forwardRef((function(n,e){var t=n.src,o=n.playing,a=n.muted,f=n.loop,d=n.controls,v=n.volume,y=void 0===v?0:v,p=n.onReady,b=n.onInit,h=n.onDuration,w=n.onProgress,_=n.onPlay,E=n.onPause,O=n.onEnded,j=n.onFirstPlay,C=n.onFirstEnded,R=n.onError,V=u.useRef(null),M=u.useRef(null),T=u.useRef(!1),D=u.useRef(!1),F=u.useRef(!1),I=P(),k=function(n){return n.match(J)[1]}(t),S=function(n,e,t){var r=i(),u=r[0],o=r[1],a=r[2];return Object(l.a)((function(){Object(g.a)("youtube").then((function(r){e.current=r,a(new r.Player(n.current,t))}))})),[u,o]}(M,V,{width:"100%",height:"100%",videoId:k,playerVars:Object(r.__assign)({autoplay:o?1:0,mute:a?1:0,controls:d?1:0,loop:f?1:0,origin:"undefined"!=typeof window&&window.location&&window.location.origin,playsinline:1},f&&{playlist:k}),events:{onReady:function(){null==p||p(),null==h||h(A().getDuration())},onStateChange:Z((function(){return A()}),(function(){return V.current.PlayerState}),{onPlay:_,onPause:E,onEnded:O,onProgress:w,onFirstPlay:j,onFirstEnded:C},I,T,F,D),onError:R}}),N=S[0],A=S[1];return Object(l.a)((function(){N().then((function(n){null==b||b(n,"youtube")}))})),function(n,e,t,r){var u=n.src,o=n.playing,i=n.muted,a=n.volume;Object(s.a)(u,(function(){e.current=!1,t.current=!1})),Object(s.a)(o,(function(){return r().then((function(n){return o?n.playVideo():n.pauseVideo()}))})),Object(s.a)(i,(function(){return r().then((function(n){return i?n.mute():n.unMute()}))})),Object(s.a)(a,(function(){return r().then((function(n){return n.setVolume(a)}))}))}({src:t,playing:o,muted:a,volume:y},D,F,N),u.useImperativeHandle(e,(function(){return function(n,e,t){var r={play:function(){return n().then((function(n){return n.playVideo()}))},pause:function(){return n().then((function(n){return n.pauseVideo()}))},togglePlay:function(){return t.current?r.pause():r.play()},stop:function(){return n().then((function(n){return n.stopVideo()}))},getDuration:function(){var n=e();return n&&n.getDuration?n.getDuration():0},getCurrentTime:function(){var n=e();return n&&n.getCurrentTime?n.getCurrentTime():0},seekTo:function(e){return n().then((function(n){return n.seekTo(e)}))},getVolume:function(){var n=e();return n&&n.getVolume?n.getVolume():0},setVolume:function(e){return n().then((function(n){return n.setVolume(e)}))},isMuted:function(){var n=e();return!n||!n.isMuted||n.isMuted()},isPlaying:function(){return t.current},mute:function(){return n().then((function(n){return n.mute()}))},unMute:function(){return n().then((function(n){return n.unMute()}))}};return r}(N,A,T)})),u.createElement("div",{className:c.classes.playerContainer,"data-player-name":"YouTube","data-testid":m},u.createElement("div",{ref:M}))})),Q=/^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?(?:\?.*)?$/;function W(n,e,t,r,u,o){var i=e.onReady,a=e.onPlay,c=e.onPause,l=e.onEnded,s=e.onDuration,f=e.onProgress,d=e.onFirstPlay,v=e.onFirstEnded,y=e.onError;return t.subscribe((function(){null==f||f(n().currentTime||0)})),{apiready:function(){return null==i?void 0:i()},durationChange:function(){return null==s?void 0:s(n().duration)},playing:function(){o.current||(o.current=!0,null==d||d()),r.current=!0,null==a||a(),t.update()},pause:function(){r.current=!1,null==c||c(),t.stop()},video_end:function(){u.current||(u.current=!0,null==v||v()),r.current=!1,null==l||l(),t.stop()},error:function(n){return y&&y(n)}}}var K=u.forwardRef((function(n,e){var t=n.src,r=n.playing,o=n.muted,a=n.controls,f=n.volume,d=void 0===f?0:f,y=n.onReady,m=n.onInit,p=n.onDuration,b=n.showTitle,h=n.onProgress,w=n.onPlay,_=n.onPause,E=n.onEnded,O=n.onFirstPlay,j=n.onFirstEnded,C=n.onError,R=u.useRef(null),V=u.useRef(!1),M=u.useRef(!1),T=u.useRef(!1),D=P(),F=function(n,e){var t=i(),r=t[0],u=t[1],o=t[2];return Object(l.a)((function(){Object(g.a)("dailyMotion").then((function(t){o(new t.player(n.current,e))}))})),[r,u]}(R,{width:"100%",height:"100%",video:function(n){return n.match(Q)[1]}(t),params:{controls:a,autoplay:r,mute:o,"ui-start-screen-info":b,origin:"undefined"!=typeof window&&window.location&&window.location.origin},events:W((function(){return k()}),{onReady:y,onPlay:w,onPause:_,onEnded:E,onDuration:p,onProgress:h,onFirstPlay:O,onFirstEnded:j,onError:C},D,V,T,M)}),I=F[0],k=F[1];return Object(l.a)((function(){I().then((function(n){null==m||m(n,"dailymotion")}))})),function(n,e,t,r){var u=n.src,o=n.playing,i=n.muted,a=n.volume,c=n.controls;Object(s.a)(u,(function(){e.current=!1,t.current=!1})),Object(s.a)(o,(function(){return r().then((function(n){return o?n.play():n.pause()}))})),Object(s.a)(i,(function(){return r().then((function(n){return n.setMuted(i)}))})),Object(s.a)(a,(function(){return r().then((function(n){return n.setVolume(a/100)}))})),Object(s.a)(c,(function(){return r().then((function(n){return n.setControls(c)}))}))}({src:t,playing:r,muted:o,volume:d,controls:a},M,T,I),u.useImperativeHandle(e,(function(){return function(n,e,t){var r={play:function(){return n().then((function(n){return n.play()}))},pause:function(){return n().then((function(n){return n.pause()}))},togglePlay:function(){return t.current?r.pause():r.play()},getDuration:function(){var n=e();return n&&n.duration||0},getCurrentTime:function(){var n=e();return n&&n.currentTime||0},seekTo:function(e){return n().then((function(n){return n.setCurrentTime(e)}))},getVolume:function(){var n=e();return n?100*n.volume:0},setVolume:function(e){return n().then((function(n){return n.setVolume(e/100)}))},isMuted:function(){var n=e();return!n||n.muted},isPlaying:function(){return t.current},mute:function(){return n().then((function(n){return n.setMuted(!0)}))},unMute:function(){return n().then((function(n){return n.setMuted(!1)}))}};return r}(I,k,V)})),u.createElement("div",{className:c.classes.playerContainer,"data-player-name":"DailyMotion","data-testid":v},u.createElement("div",{ref:R}))})),X="startedPlaying",nn="paused",en="finishedPlaying",tn="error",rn=function(n,e,t,r){n.init({appId:"",xfbml:!0,version:"v2.5"}),n.Event.subscribe("xfbml.ready",(function(n){un({msg:n,setPlayer:e,config:t})})),n.Event.subscribe("iframeplugin:create",(function(){return on(r)}))},un=function(n){var e=n.msg,t=n.setPlayer,r=n.config.playerId;"video"===e.type&&e.id===r&&t(e.instance)},on=function(n){if(n.current){var e=n.current.querySelector("iframe");e&&e.setAttribute("allow","autoplay; encrypted-media")}};var an={dailymotion:K,facebook:u.forwardRef((function(n,e){var t=n.src,r=n.playing,o=n.muted,a=n.volume,f=void 0===a?0:a,d=n.containerDimensions,v=n.onInit,y=n.onProgress,m=n.controls,b=n.onError,h=n.onPlay,w=n.onPause,_=n.onFirstPlay,E=n.onFirstEnded,O=n.onEnded,j="facebook-"+n.id,C=u.useRef(!1),R=u.useRef(null),V=u.useRef(!1),M=u.useRef(!1),T=P(),D=function(n,e){var t=i(),r=t[0],u=t[1],o=t[2];return Object(l.a)((function(){var t=Object(g.a)("facebook",{appId:"",language:"en_US",version:"v2.4"});return t.then((function(t){rn(t,o,e,n)})),function(){t.then((function(n){n.Event.unsubscribe("xfbml.ready",un),n.Event.unsubscribe("iframeplugin:create",on)}))}})),[r,u]}(R,{playerId:j}),F=D[0],I=D[1];return Object(l.a)((function(){F().then((function(n){!function(n,e,t,r,u,o){var i=e.onPlay,a=e.onPause,c=e.onFirstPlay,l=e.onFirstEnded,s=e.onEnded,f=e.onProgress,d=e.onError;t.subscribe((function(){null==f||f(n().getCurrentPosition()||0)})),n().subscribe(X,(function(){u.current||(u.current=!0,null==c||c()),o.current=!0,null==i||i(),t.update()})),n().subscribe(nn,(function(){o.current=!1,null==a||a(),t.stop()})),n().subscribe(en,(function(){r.current||(r.current=!0,null==l||l()),o.current=!1,null==s||s(),t.stop()})),d&&n().subscribe(tn,d)}((function(){return I()}),{onPlay:h,onPause:w,onFirstPlay:_,onFirstEnded:E,onEnded:O,onProgress:y,onError:b},T,M,V,C),o||n.unmute(),null==v||v(n,"facebook")}))})),function(n,e,t,r){var u=n.src,o=n.playing,i=n.muted,a=n.volume;Object(s.a)(u,(function(){e.current=!1,t.current=!1})),Object(s.a)(o,(function(){return r().then((function(n){return o?n.play():n.pause()}))})),Object(s.a)(i,(function(){return r().then((function(n){return i?n.mute():n.unmute()}))})),Object(s.a)(a,(function(){return r().then((function(n){return n.setVolume(a/100)}))}))}({src:t,playing:r,muted:o,volume:f},V,M,F),u.useImperativeHandle(e,(function(){return function(n,e,t){var r={play:function(){return n().then((function(n){return n.play()}))},pause:function(){return n().then((function(n){return n.pause()}))},togglePlay:function(){return t.current?r.pause():r.play()},getDuration:function(){var n=e();return n&&n.getDuration()||0},getCurrentTime:function(){var n=e();return n&&n.getCurrentPosition()||0},seekTo:function(e){return n().then((function(n){return n.seek(e)}))},getVolume:function(){var n=e();return n&&100*n.getVolume()||0},setVolume:function(e){return n().then((function(n){return n.setVolume(e/100)}))},isMuted:function(){return 0===r.getVolume()},isPlaying:function(){return t.current},mute:function(){return n().then((function(n){return n.mute()}))},unMute:function(){return n().then((function(n){return n.unmute()}))}};return r}(F,I,C)})),u.createElement("div",{className:c.classes.facebookContainer},u.createElement("div",{ref:R,className:"fb-video","data-player-name":"Facebook",id:j,"data-href":t,"data-autoplay":r?"true":"false","data-allowfullscreen":"true","data-controls":m?"true":"false","data-width":d.width,"data-height":d.height,"data-testid":p}))})),playable:x,vimeo:G,twitch:E,youtube:q},cn=function(n){return"string"==typeof n},ln=/^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?(?:\?.*)?$/,sn=/facebook\.com\/([^/?].+\/)?video(s|\.php)[/?].*$/,fn=/\.(mp4|og[gv]|webm|mov|m4v)($|\?)/i,dn=/(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/,vn=/(?:www\.|go\.)?twitch\.tv\/([a-z0-9_]+)($|\?)/,yn=/vimeo\.com\/.+/,mn=/(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})/,pn={dailymotion:function(n){return cn(n)&&ln.test(n)},facebook:function(n){return cn(n)&&sn.test(n)},playable:function(n){return cn(n)?fn.test(n):(e=n,!!Array.isArray(e)&&n.some((function(n){return fn.test(n)})));var e},twitch:function(n){return cn(n)&&(dn.test(n)||vn.test(n))},vimeo:function(n){return cn(n)&&yn.test(n)},youtube:function(n){return cn(n)&&mn.test(n)}};e.default=u.forwardRef((function(n,e){var t=n.onMouseEnter,o=n.onMouseLeave,l=!n.reducedMotion&&n.autoplay,s=u.useState(0),f=s[0],d=s[1],v=u.useState(!1),y=v[0],m=v[1],p=function(n){for(var e in pn){var t=e;if(pn[t](n))return t}return"playable"}(n.src),b="playable"===p,h=an[p],g=u.useCallback((function(){return d(f+1)}),[f]),P=u.useRef(null),w=u.useRef(null),_=i(),E=_[0],O=_[1],j=_[2],C=_[3],R=function(e){if(n.onStateUpdated){var t=e||{},u=O(),o=u?{isPlaying:u.isPlaying(),duration:Number(u.getDuration())}:{},i=Object(r.__assign)(Object(r.__assign)({},o),t);n.onStateUpdated({type:"onStateUpdated",state:i})}};u.useImperativeHandle(e,(function(){return{resetPlayerRef:function(){return C()},play:function(){return m(!0),E().then((function(n){return n.play()}))},pause:function(){return E().then((function(n){return n.pause()}))},stop:function(){return E().then((function(n){return n.stop?n.stop():g()}))},togglePlay:function(){return m(!0),E().then((function(n){return n.togglePlay()}))},mute:function(){return R({isMuted:!0}),E().then((function(n){return n.mute()}))},unmute:function(){return R({isMuted:!1}),E().then((function(n){return n.unMute()}))},seek:function(n){return E().then((function(e){return e.seekTo(n)}))},setVolume:function(n){R({volume:n}),E().then((function(e){return e.setVolume(n)}))}}}));var V=function(n){var e=u.useState(!1),t=e[0],r=e[1],o=Object(a.a)(n,!0);return u.useEffect((function(){o&&r(!0)}),[o]),t}(P);return l||V||y?u.createElement("div",{id:n.id,className:Object(c.st)(c.classes.root),ref:P,onMouseEnter:t,onMouseLeave:o},u.createElement(h,Object(r.__assign)({key:"player-"+n.src+"-"+f},n,b&&n.playableConfig,{playing:l,onProgress:function(e){var t,r=O(),u=r.getVolume(),o=r.isMuted();R({currentTime:e,volume:u,isMuted:Boolean(o)}),null===(t=n.onProgress)||void 0===t||t.call(n,{type:"onProgress"})},onDuration:function(n){R({duration:n})},onInit:function(){var e;j(w.current),null===(e=n.onPlayerInitialized)||void 0===e||e.call(n,{type:"onPlayerInitialized"})},onPlay:function(){var e,t=O();R({isPlaying:t.isPlaying()}),null===(e=n.onPlay)||void 0===e||e.call(n,{type:"onPlay"})},onPause:function(){var e,t=O();R({isPlaying:t.isPlaying()}),null===(e=n.onPause)||void 0===e||e.call(n,{type:"onPause"})},onEnded:function(){var e,t=O();R({isPlaying:t.isPlaying()}),null===(e=n.onEnded)||void 0===e||e.call(n,{type:"onEnded"})},ref:w}))):u.createElement("div",{id:n.id,className:Object(c.st)(c.classes.root),ref:P})}))},711:function(n,e,t){"use strict";t.d(e,"a",(function(){return u}));var r=t(181),u=function(n){return Object(r.useEffect)(n,[])}},763:function(n,e,t){"use strict";t.d(e,"a",(function(){return u}));var r=t(819);function u(n,e){var t=Object(r.a)(n,n);n!==t&&e(t)}},769:function(n,e,t){"use strict";t.d(e,"a",(function(){return o}));var r=t(181),u=function(){return"function"==typeof window.IntersectionObserver};function o(n,e){void 0===e&&(e=!1);var t=Object(r.useState)(!1),o=t[0],i=t[1];return Object(r.useEffect)((function(){if(!u())return i(e),function(){};var t=n.current;if(t&&u()){var r=new window.IntersectionObserver((function(n){var e=n[0];i(e.isIntersecting)}));return r.observe(t),function(){r.disconnect()}}return function(){}}),[n,e]),o}},782:function(n,e,t){var r=t(676);n.exports=r.create("VideoPlayer358301519",{classes:{root:"VideoPlayer358301519__root",playerContainer:"VideoPlayer358301519__playerContainer",facebookContainer:"VideoPlayer358301519__facebookContainer",cover:"VideoPlayer358301519__cover",vimeoContainer:"VideoPlayer358301519__vimeoContainer"},vars:{},stVars:{backgroundColor:"rgba(var(--backgroundColor, 0,0,0), var(--alpha-backgroundColor, 1))",font:"var(--font)",fontColor:"rgba(var(--fontColor, 255,255,255), var(--alpha-fontColor, 1))",borderColor:"rgba(var(--borderColor, 0,0,0), var(--alpha-borderColor, 1))",borderSize:"var(--borderSize)",boxShadow:"var(--boxShadow)",playButtonSize:"var(--playButtonSize)",playButtonMobileSize:"var(--playButtonMobileSize)",textSizeScale:"'1px'"},keyframes:{}},"",-1,n.i)},819:function(n,e,t){"use strict";t.d(e,"a",(function(){return u}));var r=t(181);function u(n,e){void 0===e&&(e=null);var t=Object(r.useRef)(e);return Object(r.useEffect)((function(){t.current=n}),[n]),t.current}}}]);
|
|
//# sourceMappingURL=https://static.parastorage.com/services/editor-elements/dist/VideoPlayer.36c2a31d.chunk.min.js.map
|