mediacms/static/js/media.js

1 line
156 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

!function(){var e,t={3683:function(e,t,n){"use strict";var r=n(92541),a=(n(62322),n(49268),n(79006),n(55090),n(25101),n(13080),n(52004),n(28407),n(56394),n(38288),n(55677),n(92129),n(24655),n(35466)),i=n(43613),o=n(98578);function l(){return a.createElement("div",{className:"player-container viewer-attachment-container"},a.createElement("div",{className:"player-container-inner"},a.createElement("span",null,a.createElement("span",null,a.createElement("i",{className:"material-icons"},"insert_drive_file")))))}var s=n(3074),u=n.n(s),c=n(18009),d=n.n(c),m=n(80473),f=n(20541),p=n(9722);function y(e){var t=null,n=e.split(".");if(n.length)switch(n=n[n.length-1]){case"webm":t="audio/webm";break;case"flac":t="audio/flac";break;case"wave":t="audio/wave";break;case"wav":t="audio/wav";break;case"ogg":case"ogg":t="audio/ogg";break;case"mp3":case"mpeg":t="audio/mpeg"}return t}var h=n(1283);function g(e){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function v(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function S(e,t){return!t||"object"!==g(t)&&"function"!=typeof t?w(e):t}function w(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E(e){return(E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var P=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&b(e,t)}(u,e);var t,n,r,l,s=(r=u,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=E(r);if(l){var n=E(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return S(this,e)});function u(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),t=s.call(this,e);var n=o.MediaPageStore.get("media-data");t.AudioPlayerData={},t.audioStartedPlaying=!1;var r=(0,m.formatInnerLink)(n.original_media_url,i.SiteContext._currentValue.url);t.videoSources=[{src:r,type:y(r)}],t.videoPoster=n.poster_url,t.videoPoster=t.videoPoster?t.videoPoster:n.thumbnail_url,t.videoPoster=t.videoPoster?(0,m.formatInnerLink)(t.videoPoster,i.SiteContext._currentValue.url):"",t.updatePlayerVolume=t.updatePlayerVolume.bind(w(t)),t.onAudioEnd=t.onAudioEnd.bind(w(t)),t.onAudioRestart=t.onAudioRestart.bind(w(t)),o.PageStore.on("switched_media_auto_play",t.onUpdateMediaAutoPlay.bind(w(t))),t.wrapperClick=t.wrapperClick.bind(w(t));var a=new p.MediaDurationInfo;return a.update(o.MediaPageStore.get("media-data").duration),t.durationISO8601=a.ISO8601(),t}return t=u,(n=[{key:"componentDidMount",value:function(){this.videoSources.length||h.warn("Audio DEBUG:","Audio file doesn't exist"),this.recommendedMedia=o.MediaPageStore.get("media-data").related_media.length?new p.PlayerRecommendedMedia(o.MediaPageStore.get("media-data").related_media,this.refs.AudioElem.parentNode,this.props.inEmbed):null,this.upNextLoaderView=!this.props.inEmbed&&o.MediaPageStore.get("media-data").related_media.length?new p.UpNextLoaderView(o.MediaPageStore.get("media-data").related_media[0]):null,document.hasFocus()||"visible"===document.visibilityState?this.initPlayerInstance():(this.initPlayerInstance=this.initPlayerInstance.bind(this),window.addEventListener("focus",this.initPlayerInstance),document.addEventListener("visibilitychange",this.initPlayerInstance))}},{key:"componentWillUnmount",value:function(){this.recommendedMedia&&(this.AudioPlayerData.instance.player.off("fullscreenchange",this.recommendedMedia.onResize),o.PageStore.removeListener("window_resize",this.recommendedMedia.onResize),o.VideoViewerStore.removeListener("changed_viewer_mode",this.recommendedMedia.onResize),this.recommendedMedia.destroy()),videojs(this.refs.AudioElem).dispose(),this.AudioPlayerData.instance=null,delete this.AudioPlayerData.instance}},{key:"initPlayerInstance",value:function(){window.removeEventListener("focus",this.initPlayerInstance),document.removeEventListener("visibilitychange",this.initPlayerInstance),this.refs.AudioElem.focus(),this.initPlayerInstance=null,setTimeout(function(){if(!this.AudioPlayerData.instance){var e=this.props.inEmbed?document.createElement("a"):null,t=this.props.inEmbed?document.createElement("a"):null;e&&(e.setAttribute("class","title-link"),e.setAttribute("href",o.MediaPageStore.get("media-data").url),e.setAttribute("title",o.MediaPageStore.get("media-data").title),e.setAttribute("target","_blank"),e.innerHTML=o.MediaPageStore.get("media-data").title),t&&(t.setAttribute("class","user-thumb-link"),t.setAttribute("href",o.MediaPageStore.get("media-data").author_profile),t.setAttribute("title",o.MediaPageStore.get("media-data").author_name),t.setAttribute("target","_blank"),t.innerHTML='<img src="'+o.MediaPageStore.get("media-author-thumbnail-url")+'" alt="" />');var n=null,r=null;!this.props.inEmbed&&o.MediaPageStore.get("playlist-id")?(n=o.MediaPageStore.get("playlist-next-media-url"),r=o.MediaPageStore.get("playlist-previous-media-url")):n=o.MediaPageStore.get("media-data").related_media.length&&!this.props.inEmbed?o.MediaPageStore.get("media-data").related_media[0].url:null,this.AudioPlayerData.instance=new(d())(this.refs.AudioElem,{sources:this.videoSources,poster:this.videoPoster,autoplay:!this.props.inEmbed,bigPlayButton:!0,controlBar:{fullscreen:!1,theaterMode:!1,next:!!n,previous:!!r},cornerLayers:{topLeft:e,topRight:this.upNextLoaderView?this.upNextLoaderView.html():null,bottomLeft:this.recommendedMedia?this.recommendedMedia.html():null,bottomRight:t}},{volume:o.VideoViewerStore.get("player-volume"),soundMuted:o.VideoViewerStore.get("player-sound-muted")},null,null,this.onAudioPlayerStateUpdate.bind(this),this.onClickNextButton.bind(this),this.onClickPreviousButton.bind(this)),this.upNextLoaderView&&(this.upNextLoaderView.setVideoJsPlayerElem(this.AudioPlayerData.instance.player.el_),this.onUpdateMediaAutoPlay()),this.refs.AudioElem.parentNode.focus(),this.AudioPlayerData.instance.player.one("play",function(){this.audioStartedPlaying=!0}.bind(this)),this.recommendedMedia&&(this.recommendedMedia.initWrappers(this.AudioPlayerData.instance.player.el_),this.AudioPlayerData.instance.player.one("pause",this.recommendedMedia.init),this.AudioPlayerData.instance.player.on("fullscreenchange",this.recommendedMedia.onResize),o.PageStore.on("window_resize",this.recommendedMedia.onResize),o.VideoViewerStore.on("changed_viewer_mode",this.recommendedMedia.onResize)),this.AudioPlayerData.instance.player.one("ended",this.onAudioEnd)}}.bind(this),50)}},{key:"initialDocumentFocus",value:function(){this.refs.AudioElem.parentNode&&(this.refs.AudioElem.parentNode.focus(),setTimeout(function(){this.AudioPlayerData.instance.player.play()}.bind(this),50)),window.removeEventListener("focus",this.initialDocumentFocus),this.initialDocumentFocus=null}},{key:"onClickNextButton",value:function(){var e;o.MediaPageStore.get("playlist-id")?null===(e=o.MediaPageStore.get("playlist-next-media-url"))&&(e=o.MediaPageStore.get("media-data").related_media[0].url):this.props.inEmbed||(e=o.MediaPageStore.get("media-data").related_media[0].url),window.location.href=e}},{key:"onClickPreviousButton",value:function(){var e;o.MediaPageStore.get("playlist-id")?null===(e=o.MediaPageStore.get("playlist-previous-media-url"))&&(e=o.MediaPageStore.get("media-data").related_media[0].url):this.props.inEmbed||(e=o.MediaPageStore.get("media-data").related_media[0].url),window.location.href=e}},{key:"onUpdateMediaAutoPlay",value:function(){this.upNextLoaderView&&(o.PageStore.get("media-auto-play")?this.upNextLoaderView.showTimerView(this.AudioPlayerData.instance.isEnded()):this.upNextLoaderView.hideTimerView())}},{key:"onAudioPlayerStateUpdate",value:function(e){this.updatePlayerVolume(e.volume,e.soundMuted)}},{key:"onAudioRestart",value:function(){this.recommendedMedia&&(this.recommendedMedia.updateDisplayType("inline"),this.AudioPlayerData.instance.player.one("pause",this.recommendedMedia.init),this.AudioPlayerData.instance.player.one("ended",this.onAudioEnd))}},{key:"onAudioEnd",value:function(){if(this.recommendedMedia&&(this.recommendedMedia.updateDisplayType("full"),this.AudioPlayerData.instance.player.one("playing",this.onAudioRestart)),!this.props.inEmbed&&o.MediaPageStore.get("playlist-id")){var e=document.querySelector(".video-player .more-media"),t=document.querySelector(".video-player .vjs-actions-anim");this.upNextLoaderView.cancelTimer();var n=o.MediaPageStore.get("playlist-next-media-url");return n&&(e&&(e.style.display="none"),t&&(t.style.display="none"),window.location.href=n),void this.upNextLoaderView.hideTimerView()}this.upNextLoaderView&&(o.PageStore.get("media-auto-play")?(this.upNextLoaderView.startTimer(),this.AudioPlayerData.instance.player.one("play",function(){this.upNextLoaderView.cancelTimer()}.bind(this))):this.upNextLoaderView.cancelTimer())}},{key:"updatePlayerVolume",value:function(e,t){o.VideoViewerStore.get("player-volume")!==e&&f.VideoViewerActions.set_player_volume(e),o.VideoViewerStore.get("player-sound-muted")!==t&&f.VideoViewerActions.set_player_sound_muted(t)}},{key:"wrapperClick",value:function(e){e.target.parentNode===this.refs.videoPlayerWrap&&(this.AudioPlayerData.instance.player.ended()||(!this.AudioPlayerData.instance.player.hasStarted_||this.AudioPlayerData.instance.player.paused()?this.AudioPlayerData.instance.player.play():this.AudioPlayerData.instance.player.pause()))}},{key:"render",value:function(){return a.createElement("div",{className:"player-container audio-player-container"},a.createElement("div",{className:"player-container-inner"},a.createElement("div",{className:"video-player",ref:"videoPlayerWrap",onClick:this.wrapperClick},a.createElement("audio",{tabIndex:"1",ref:"AudioElem",className:"video-js vjs-mediacms native-dimensions"}))))}}])&&v(t.prototype,n),u}(a.PureComponent);function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function M(e){var t=(0,a.useContext)(i.SiteContext),n=m();n=(n=n||o.MediaPageStore.get("media-data").thumbnail_url)||"";var r,l,s=(r=(0,a.useState)(n),l=2,function(e){if(Array.isArray(e))return e}(r)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(r,l)||function(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}(r,l)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u=s[0],c=s[1];function d(){c(m())}function m(){var e=o.MediaPageStore.get("media-data"),n="string"==typeof e.poster_url?e.poster_url.trim():"";return""===n&&(n="string"==typeof e.thumbnail_url?e.thumbnail_url.trim():""),""===n&&(n="string"==typeof o.MediaPageStore.get("media-original-url")?o.MediaPageStore.get("media-original-url").trim():""),""===n?"#":t.url+"/"+n.replace(/^\//g,"")}return(0,a.useEffect)((function(){return o.MediaPageStore.on("loaded_image_data",d),function(){return o.MediaPageStore.removeListener("loaded_image_data",d)}}),[]),u?a.createElement("div",{className:"viewer-image-container"},a.createElement("img",{src:u,alt:o.MediaPageStore.get("media-data").title||null})):null}P.defaultProps={inEmbed:!1},P.propTypes={inEmbed:u().bool},n(13233),n(93296),n(20288),n(54458),n(23675);var _=n(12672),A=n(46559);function C(e){var t=e.fileUrl,n=(0,A.defaultLayoutPlugin)();return a.createElement("div",{className:"pdf-container"},a.createElement(_.Worker,{workerUrl:"https://unpkg.com/pdfjs-dist@3.4.120/build/pdf.worker.min.js"},a.createElement(_.Viewer,{fileUrl:t,plugins:[n]})))}n(99751);var N=n(89905),x=n(88727),O=n(1283);function I(e){return(I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function T(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function V(e,t){return(V=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function L(e,t){return!t||"object"!==I(t)&&"function"!=typeof t?j(e):t}function j(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R(e){return(R=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var D=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&V(e,t)}(u,e);var t,n,r,l,s=(r=u,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=R(r);if(l){var n=R(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return L(this,e)});function u(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),(t=s.call(this,e)).state={displayPlayer:!1},t.videoSources=[],function(e){switch(e){case"running":o.MediaPageStore.set("media-load-error-type","encodingRunning"),o.MediaPageStore.set("media-load-error-message","Media encoding is currently running. Try again in few minutes.");break;case"pending":o.MediaPageStore.set("media-load-error-type","encodingPending"),o.MediaPageStore.set("media-load-error-message","Media encoding is pending");break;case"fail":o.MediaPageStore.set("media-load-error-type","encodingFailed"),o.MediaPageStore.set("media-load-error-message","Media encoding failed")}}(t.props.data.encoding_status),null!==o.MediaPageStore.get("media-load-error-type"))return t.state.displayPlayer=!0,L(t);if("string"==typeof t.props.data.poster_url?t.videoPoster=(0,m.formatInnerLink)(t.props.data.poster_url,t.props.siteUrl):"string"==typeof t.props.data.thumbnail_url&&(t.videoPoster=(0,m.formatInnerLink)(t.props.data.thumbnail_url,t.props.siteUrl)),t.videoInfo=(0,N.RA)(t.props.data.encodings_info,t.props.data.hls_info),Object.keys(t.videoInfo).length){var n=o.VideoViewerStore.get("video-quality");(null===n||"Auto"===n&&void 0===t.videoInfo.Auto)&&(n=720);var r=(0,N.$e)(n,t.videoInfo);"Auto"===n&&void 0!==t.videoInfo.Auto&&t.videoSources.push({src:t.videoInfo.Auto.url[0]});var a,l,c=(0,N.KC)();for(l=0;l<t.videoInfo[r].format.length;){if("hls"===t.videoInfo[r].format[l]){t.videoSources.push({src:t.videoInfo[r].url[l]});break}l+=1}for(l in t.props.data.encodings_info[r])t.props.data.encodings_info[r].hasOwnProperty(l)&&c.support[l]&&(a=t.props.data.encodings_info[r][l].url)&&(a=(0,m.formatInnerLink)(a,t.props.siteUrl),t.videoSources.push({src:a,encodings_status:t.props.data.encodings_info[r][l].status}))}else t.videoInfo=null;if(t.videoSources.length){if(!t.props.inEmbed&&1===t.videoSources.length&&"running"===t.videoSources[0].encodings_status)return o.MediaPageStore.set("media-load-error-type","encodingRunning"),o.MediaPageStore.set("media-load-error-message","Media encoding is currently running. Try again in few minutes."),L(t)}else switch(o.MediaPageStore.get("media-load-error-type")){case"encodingRunning":case"encodingPending":case"encodingFailed":break;default:O.warn("VIDEO DEBUG:","Video files don't exist")}o.PageStore.on("switched_media_auto_play",t.onUpdateMediaAutoPlay.bind(j(t))),t.browserCache=new p.BrowserCache(i.SiteContext._currentValue.id,86400);var d=new p.MediaDurationInfo;return d.update(t.props.data.duration),t.durationISO8601=d.ISO8601(),t.playerElem=null,t.playerInstance=null,t.onPlayerInit=t.onPlayerInit.bind(j(t)),t.onClickNext=t.onClickNext.bind(j(t)),t.onClickPrevious=t.onClickPrevious.bind(j(t)),t.onStateUpdate=t.onStateUpdate.bind(j(t)),t.onVideoEnd=t.onVideoEnd.bind(j(t)),t.onVideoRestart=t.onVideoRestart.bind(j(t)),t}return t=u,(n=[{key:"componentDidMount",value:function(){if(this.videoSources.length){this.recommendedMedia=this.props.data.related_media.length?new p.PlayerRecommendedMedia(this.props.data.related_media,this.props.inEmbed,!o.PageStore.get("config-media-item").displayViews):null,this.upNextLoaderView=!this.props.inEmbed&&this.props.data.related_media.length?new p.UpNextLoaderView(this.props.data.related_media[0]):null;var e=null;if(this.props.inEmbed){var t=document.createElement("a"),n=document.createElement("a");(e=document.createElement("div")).setAttribute("class","media-links-top-left"),t&&(t.setAttribute("class","title-link"),t.setAttribute("href",this.props.data.url),t.setAttribute("title",this.props.data.title),t.setAttribute("target","_blank"),t.innerHTML=this.props.data.title),n&&(n.setAttribute("class","user-thumb-link"),n.setAttribute("href",(0,m.formatInnerLink)(this.props.data.author_profile,this.props.siteUrl)),n.setAttribute("title",this.props.data.author_name),n.setAttribute("target","_blank"),n.setAttribute("style","background-image:url("+(0,m.formatInnerLink)(o.MediaPageStore.get("media-author-thumbnail-url"),this.props.siteUrl)+")")),e.appendChild(n),e.appendChild(t)}var r=o.MediaPageStore.get("media-url"),a='<button class="share-video-btn"><i class="material-icons">share</i><span>Share</span></button>';a+='<div class="share-options-wrapper">\t\t\t\t\t\t\t\t\t<div class="share-options">\t\t\t\t\t\t\t\t\t\t<div class="share-options-inner">\t\t\t\t\t\t\t\t\t\t\t<div class="sh-option share-email">\t\t\t\t\t\t\t\t\t\t\t\t<a href="mailto:?body='+r+'" title=""><span><i class="material-icons">email</i></span><span>Email</span></a>\t\t\t\t\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t\t\t\t\t<div class="sh-option share-fb">\t\t\t\t\t\t\t\t\t\t\t\t<a href="https://www.facebook.com/sharer.php?u='+r+'" title="" target="_blank"><span></span><span>Facebook</span></a>\t\t\t\t\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t\t\t\t\t<div class="sh-option share-tw">\t\t\t\t\t\t\t\t\t\t\t\t<a href="https://twitter.com/intent/tweet?url='+r+'" title="" target="_blank"><span></span><span>Twitter</span></a>\t\t\t\t\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t\t\t\t\t<div class="sh-option share-whatsapp">\t\t\t\t\t\t\t\t\t\t\t\t<a href="whatsapp://send?text='+r+'" title="" target="_blank" data-action="share/whatsapp/share"><span></span><span>WhatsApp</span></a>\t\t\t\t\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t\t\t\t\t<div class="sh-option share-telegram">\t\t\t\t\t\t\t\t\t\t\t\t<a href="https://t.me/share/url?url='+r+"&amp;text="+this.props.data.title+'" title="" target="_blank"><span></span><span>Telegram</span></a>\t\t\t\t\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t\t\t\t\t<div class="sh-option share-linkedin">\t\t\t\t\t\t\t\t\t\t\t\t\t<a href="https://www.linkedin.com/shareArticle?mini=true&amp;url='+r+'" title="" target="_blank"><span></span><span>LinkedIn</span></a>\t\t\t\t\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t\t\t\t\t<div class="sh-option share-reddit">\t\t\t\t\t\t\t\t\t\t\t\t<a href="https://reddit.com/submit?url='+r+"&amp;title="+this.props.data.title+'" title="" target="_blank"><span></span><span>reddit</span></a>\t\t\t\t\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t\t\t\t\t<div class="sh-option share-tumblr">\t\t\t\t\t\t\t\t\t\t\t\t<a href="https://www.tumblr.com/widgets/share/tool?canonicalUrl='+r+"&amp;title="+this.props.data.title+'" title="" target="_blank"><span></span><span>Tumblr</span></a>\t\t\t\t\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t\t\t\t\t<div class="sh-option share-pinterest">\t\t\t\t\t\t\t\t\t\t\t\t<a href="http://pinterest.com/pin/create/link/?url='+r+'" title="" target="_blank"><span></span><span>Pinterest</span></a>\t\t\t\t\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t\t\t\t\t<div class="sh-option share-more">\t\t\t\t\t\t\t\t\t\t\t\t<a href="'+r+'" title="More" target="_blank"><span><i class="material-icons">more_horiz</i></span><span></span></a>\t\t\t\t\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t\t</div>',this.cornerLayers={topLeft:e,topRight:this.upNextLoaderView?this.upNextLoaderView.html():null,bottomLeft:this.recommendedMedia?this.recommendedMedia.html():null,bottomRight:this.props.inEmbed?a:null},this.setState({displayPlayer:!0},(function(){setTimeout((function(){var e=document.querySelector(".share-video-btn"),t=document.querySelector(".share-options-wrapper"),n=document.querySelector(".share-options-inner");e&&e.addEventListener("click",(function(e){(0,m.addClassname)(document.querySelector(".video-js.vjs-mediacms"),"vjs-visible-share-options")})),t&&t.addEventListener("click",(function(e){e.target!==n&&e.target!==t||(0,m.removeClassname)(document.querySelector(".video-js.vjs-mediacms"),"vjs-visible-share-options")}))}),1e3)}))}}},{key:"componentWillUnmount",value:function(){this.unsetRecommendedMedia()}},{key:"initRecommendedMedia",value:function(){null!==this.recommendedMedia&&(this.props.inEmbed||this.recommendedMedia.init(),this.playerInstance.player.on("fullscreenchange",this.recommendedMedia.onResize),o.PageStore.on("window_resize",this.recommendedMedia.onResize),o.VideoViewerStore.on("changed_viewer_mode",this.recommendedMedia.onResize))}},{key:"unsetRecommendedMedia",value:function(){null!==this.recommendedMedia&&(this.playerInstance.player.off("fullscreenchange",this.recommendedMedia.onResize),o.PageStore.removeListener("window_resize",this.recommendedMedia.onResize),o.VideoViewerStore.removeListener("changed_viewer_mode",this.recommendedMedia.onResize),this.recommendedMedia.destroy())}},{key:"onClickNext",value:function(){var e;o.MediaPageStore.get("playlist-id")?null===(e=o.MediaPageStore.get("playlist-next-media-url"))&&(e=this.props.data.related_media[0].url):this.props.inEmbed||(e=this.props.data.related_media[0].url),window.location.href=e}},{key:"onClickPrevious",value:function(){var e;o.MediaPageStore.get("playlist-id")?null===(e=o.MediaPageStore.get("playlist-previous-media-url"))&&(e=this.props.data.related_media[0].url):this.props.inEmbed||(e=this.props.data.related_media[0].url),window.location.href=e}},{key:"onStateUpdate",value:function(e){o.VideoViewerStore.get("in-theater-mode")!==e.theaterMode&&f.VideoViewerActions.set_viewer_mode(e.theaterMode),o.VideoViewerStore.get("player-volume")!==e.volume&&f.VideoViewerActions.set_player_volume(e.volume),o.VideoViewerStore.get("player-sound-muted")!==e.soundMuted&&f.VideoViewerActions.set_player_sound_muted(e.soundMuted),o.VideoViewerStore.get("video-quality")!==e.quality&&f.VideoViewerActions.set_video_quality(e.quality),o.VideoViewerStore.get("video-playback-speed")!==e.playbackSpeed&&f.VideoViewerActions.set_video_playback_speed(e.playbackSpeed)}},{key:"onPlayerInit",value:function(e,t){this.playerElem=t,this.playerInstance=e,this.upNextLoaderView&&(this.upNextLoaderView.setVideoJsPlayerElem(this.playerInstance.player.el_),this.onUpdateMediaAutoPlay()),this.props.inEmbed||this.playerElem.parentNode.focus(),null!==this.recommendedMedia&&(this.recommendedMedia.initWrappers(this.playerElem.parentNode),this.props.inEmbed&&(this.playerInstance.player.one("pause",this.recommendedMedia.init),this.initRecommendedMedia())),this.playerInstance.player.one("ended",this.onVideoEnd)}},{key:"onVideoRestart",value:function(){null!==this.recommendedMedia&&(this.recommendedMedia.updateDisplayType("inline"),this.props.inEmbed&&this.playerInstance.player.one("pause",this.recommendedMedia.init),this.playerInstance.player.one("ended",this.onVideoEnd))}},{key:"onVideoEnd",value:function(){if(null!==this.recommendedMedia&&(this.props.inEmbed||this.initRecommendedMedia(),this.recommendedMedia.updateDisplayType("full"),this.playerInstance.player.one("playing",this.onVideoRestart)),!this.props.inEmbed&&o.MediaPageStore.get("playlist-id")){var e=document.querySelector(".video-player .more-media"),t=document.querySelector(".video-player .vjs-actions-anim");this.upNextLoaderView.cancelTimer();var n=o.MediaPageStore.get("playlist-next-media-url");return n&&(e&&(e.style.display="none"),t&&(t.style.display="none"),window.location.href=n),void this.upNextLoaderView.hideTimerView()}this.upNextLoaderView&&(o.PageStore.get("media-auto-play")?(this.upNextLoaderView.startTimer(),this.playerInstance.player.one("play",function(){this.upNextLoaderView.cancelTimer()}.bind(this))):this.upNextLoaderView.cancelTimer())}},{key:"onUpdateMediaAutoPlay",value:function(){this.upNextLoaderView&&(o.PageStore.get("media-auto-play")?this.upNextLoaderView.showTimerView(this.playerInstance.isEnded()):this.upNextLoaderView.hideTimerView())}},{key:"render",value:function(){var e=this,t=null,n=null;!this.props.inEmbed&&o.MediaPageStore.get("playlist-id")?(t=o.MediaPageStore.get("playlist-next-media-url"),n=o.MediaPageStore.get("playlist-previous-media-url")):t=this.props.data.related_media.length&&!this.props.inEmbed?this.props.data.related_media[0].url:null;var r=this.props.data.sprites_url?{url:this.props.siteUrl+"/"+this.props.data.sprites_url.replace(/^\//g,""),frame:{width:160,height:90,seconds:10}}:null;return a.createElement("div",{key:(this.props.inEmbed?"embed-":"")+"player-container",className:"player-container"+(this.videoSources.length?"":" player-container-error"),style:this.props.containerStyles,ref:"playerContainer"},a.createElement("div",{className:"player-container-inner",ref:"playerContainerInner",style:this.props.containerStyles},this.state.displayPlayer&&null!==o.MediaPageStore.get("media-load-error-type")?a.createElement(x.hJ,{errorMessage:o.MediaPageStore.get("media-load-error-message")}):null,this.state.displayPlayer&&null==o.MediaPageStore.get("media-load-error-type")?a.createElement("div",{className:"video-player",ref:"videoPlayerWrapper",key:"videoPlayerWrapper"},a.createElement(i.SiteConsumer,null,(function(i){return a.createElement(x.Y7,{playerVolume:e.browserCache.get("player-volume"),playerSoundMuted:e.browserCache.get("player-sound-muted"),videoQuality:e.browserCache.get("video-quality"),videoPlaybackSpeed:parseInt(e.browserCache.get("video-playback-speed"),10),inTheaterMode:e.browserCache.get("in-theater-mode"),siteId:i.id,siteUrl:i.url,info:e.videoInfo,cornerLayers:e.cornerLayers,sources:e.videoSources,poster:e.videoPoster,previewSprite:r,subtitlesInfo:e.props.data.subtitles_info,enableAutoplay:!e.props.inEmbed,inEmbed:e.props.inEmbed,hasTheaterMode:!e.props.inEmbed,hasNextLink:!!t,hasPreviousLink:!!n,errorMessage:o.MediaPageStore.get("media-load-error-message"),onClickNextCallback:e.onClickNext,onClickPreviousCallback:e.onClickPrevious,onStateUpdateCallback:e.onStateUpdate,onPlayerInitCallback:e.onPlayerInit})}))):null))}}])&&T(t.prototype,n),u}(a.PureComponent);function U(e){for(var t=null,n=[],r=location.search.substr(1).split("&"),a=0;a<r.length;a++)(n=r[a].split("="))[0]===e&&(t=decodeURIComponent(n[1]));return t}D.defaultProps={inEmbed:!0,siteUrl:u().string.isRequired},D.propTypes={inEmbed:u().bool},new MutationObserver((function(e,t){var n,r=document.querySelector(".video-js.vjs-mediacms video");if(r)return(n=videojs(r)).playsinline(!0),1==U("muted")&&n.muted(!0),U("time")>=0&&n.currentTime(U("time")),1==U("autoplay")&&n.play(),void t.disconnect()})).observe(document,{childList:!0,subtree:!0}),n(59808);var B,F,q=n(62546),z=n(84234),H=(n(67441),n(76453),n(7390),n(64669),n(92070),n(49511)),W=n(73064),$=(n(74486),n(6429),n(1283));function Q(e){return(Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Y(e){return function(e){if(Array.isArray(e))return J(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||G(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Z(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||G(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function G(e,t){if(e){if("string"==typeof e)return J(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?J(e,t):void 0}}function J(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}B=void 0,F=function(e){var t,n=(t=e)&&t.__esModule?t:{default:t},r="function"==typeof Symbol&&"symbol"===Q(Symbol.iterator)?function(e){return Q(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":Q(e)},a={markerStyle:{width:"7px","border-radius":"30%","background-color":"red"},markerTip:{display:!0,text:function(e){return"Break: "+e.text},time:function(e){return e.time}},breakOverlay:{display:!0,displayTime:3,text:function(e){return"Break overlay: "+e.overlayText},style:{width:"100%",height:"20%","background-color":"rgba(0,0,0,0.7)",color:"white","font-size":"17px"}},onMarkerClick:function(e){},onMarkerReached:function(e,t){},markers:[]};function i(e){var t;try{t=e.getBoundingClientRect()}catch(e){t={top:0,bottom:0,left:0,width:0,height:0,right:0}}return t}var o=-1;n.default.plugin("markers",(function(e){if(!n.default.mergeOptions){var t=function(e){return!!e&&"object"===(void 0===e?"undefined":r(e))&&"[object Object]"===toString.call(e)&&e.constructor===Object};n.default.mergeOptions=function e(n,r){var a={};return[n,r].forEach((function(n){n&&Object.keys(n).forEach((function(r){var i=n[r];t(i)?(t(a[r])||(a[r]={}),a[r]=e(a[r],i)):a[r]=i}))})),a}}n.default.createEl||(n.default.createEl=function(e,t,r){var a=n.default.Player.prototype.createEl(e,t);return r&&Object.keys(r).forEach((function(e){a.setAttribute(e,r[e])})),a});var l=n.default.mergeOptions(a,e),s={},u=[],c=o,d=this,m=null,f=null,p=o;function y(){u.sort((function(e,t){return l.markerTip.time(e)-l.markerTip.time(t)}))}function h(e){e.forEach((function(e){var t;e.key=(t=(new Date).getTime(),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:3&n|8).toString(16)}))),d.el().querySelector(".vjs-progress-holder").appendChild(function(e){var t=n.default.createEl("div",{},{"data-marker-key":e.key,"data-marker-time":l.markerTip.time(e)});return v(e,t),t.addEventListener("click",(function(t){var n=!1;if("function"==typeof l.onMarkerClick&&(n=!1===l.onMarkerClick(e)),!n){var r=this.getAttribute("data-marker-key");d.currentTime(l.markerTip.time(s[r]))}})),l.markerTip.display&&function(e){e.addEventListener("mouseover",(function(){var t=s[e.getAttribute("data-marker-key")];if(m){m.querySelector(".vjs-tip-inner").innerText=l.markerTip.text(t),m.style.left=g(t)+"%";var n=i(m),r=i(e);m.style.marginLeft=-parseFloat(n.width/2)+parseFloat(r.width/4)+"px",m.style.visibility="visible"}})),e.addEventListener("mouseout",(function(){m&&(m.style.visibility="hidden")}))}(t),t}(e)),s[e.key]=e,u.push(e)})),y()}function g(e){return l.markerTip.time(e)/d.duration()*100}function v(e,t){t.className="vjs-marker "+(e.class||""),Object.keys(l.markerStyle).forEach((function(e){t.style[e]=l.markerStyle[e]}));var n=e.time/d.duration();if((n<0||n>1)&&(t.style.display="none"),t.style.left=g(e)+"%",e.duration)t.style.width=e.duration/d.duration()*100+"%",t.style.marginLeft="0px";else{var r=i(t);t.style.marginLeft=r.width/2+"px"}}function b(e){f&&(p=o,f.style.visibility="hidden"),c=o;var t=[];e.forEach((function(e){var n=u[e];if(n){delete s[n.key],t.push(e);var r=d.el().querySelector(".vjs-marker[data-marker-key='"+n.key+"']");r&&r.parentNode.removeChild(r)}}));try{t.reverse(),t.forEach((function(e){u.splice(e,1)}))}catch(e){$.log(e)}y()}function S(){if(l.breakOverlay.display&&!(c<0)){var e=d.currentTime(),t=u[c],n=l.markerTip.time(t);e>=n&&e<=n+l.breakOverlay.displayTime?(p!==c&&(p=c,f&&(f.querySelector(".vjs-break-overlay-text").innerHTML=l.breakOverlay.text(t))),f&&(f.style.visibility="visible")):(p=o,f&&(f.style.visibility="hidden"))}}function w(){!function(){if(u.length){var t=function(e){return e<u.length-1?l.markerTip.time(u[e+1]):d.duration()},n=d.currentTime(),r=o;if(c!==o){var a=t(c);if(n>=l.markerTip.time(u[c])&&n<a)return;if(c===u.length-1&&n===d.duration())return}if(n<l.markerTip.time(u[0]))r=o;else for(var i=0;i<u.length;i++)if(a=t(i),n>=l.markerTip.time(u[i])&&n<a){r=i;break}r!==c&&(r!==o&&e.onMarkerReached&&e.onMarkerReached(u[r],r),c=r)}}(),S(),e.onTimeUpdateAfterMarkerUpdate&&e.onTimeUpdateAfterMarkerUpdate()}d.on("loadedmetadata",(function(){l.markerTip.display&&(m=n.default.createEl("div",{className:"vjs-tip",innerHTML:"<div class='vjs-tip-arrow'></div><div class='vjs-tip-inner'></div>"}),d.el().querySelector(".vjs-progress-holder").appendChild(m)),d.markers.removeAll(),h(l.markers),l.breakOverlay.display&&(f=n.default.createEl("div",{className:"vjs-break-overlay",innerHTML:"<div class='vjs-break-overlay-text'></div>"}),Object.keys(l.breakOverlay.style).forEach((function(e){f&&(f.style[e]=l.breakOverlay.style[e])})),d.el().appendChild(f),p=o),w(),d.on("timeupdate",w),d.off("loadedmetadata")})),d.markers={getMarkers:function(){return u},next:function(){for(var e=d.currentTime(),t=0;t<u.length;t++){var n=l.markerTip.time(u[t]);if(n>e){d.currentTime(n);break}}},prev:function(){for(var e=d.currentTime(),t=u.length-1;t>=0;t--){var n=l.markerTip.time(u[t]);if(n+.5<e)return void d.currentTime(n)}},add:function(e){h(e)},remove:function(e){b(e)},removeAll:function(){for(var e=[],t=0;t<u.length;t++)e.push(t);b(e)},updateTime:function(e){!function(e){u.forEach((function(t){var n=d.el().querySelector(".vjs-marker[data-marker-key='"+t.key+"']"),r=l.markerTip.time(t);(e||n.getAttribute("data-marker-time")!==r)&&(v(t,n),n.setAttribute("data-marker-time",r))})),y()}(e)},reset:function(e){d.markers.removeAll(),h(e)},destroy:function(){d.markers.removeAll(),f&&f.remove(),m&&m.remove(),d.off("timeupdate",S),delete d.markers}}}))},"function"==typeof define&&n.amdO?define(["mediacms-player"],F):"undefined"!=typeof exports?F(n(18009)):(F((B=window).videojs),B.videojsMarkers={});var K={single:(0,m.translateString)("comment"),uppercaseSingle:(0,m.translateString)("COMMENT"),ucfirstSingle:(0,m.translateString)("Comment"),ucfirstPlural:(0,m.translateString)("Comments"),submitCommentText:(0,m.translateString)("SUBMIT"),disabledCommentsMsg:(0,m.translateString)("Comments are disabled")};function X(e){var t=(0,a.useRef)(null),n=Z((0,a.useState)(""),2),r=n[0],l=n[1],s=Z((0,a.useState)(!1),2),u=s[0],c=s[1],d=Z((0,a.useState)(!1),2),p=d[0],y=d[1],h=Z((0,a.useState)(-1),2),g=h[0],v=h[1],b=Z((0,a.useState)(""),2),S=b[0],w=b[1],E=Z((0,a.useState)(i.MemberContext._currentValue.is.anonymous?i.LinksContext._currentValue.signin+"?next=/"+window.location.href.replace(i.SiteContext._currentValue.url,"").replace(/^\//g,""):null),1)[0];function P(){y(!0)}function k(){y(!1)}function M(){var e=Y(o.MediaPageStore.get("users")),t=[];e.forEach((function(e){t.push({id:e.username,display:e.name})})),w(t)}function _(){t.current.style.height="";var e=t.current.scrollHeight,n=0<g?g:parseFloat(window.getComputedStyle(t.current).lineHeight);l(""),c(!1),v(n),t.current.style.height=Math.max(20,g*Math.ceil(e/n))+"px"}function A(){c(!1)}return(0,a.useEffect)((function(){return o.MediaPageStore.on("comment_submit",_),o.MediaPageStore.on("comment_submit_fail",A),!0===MediaCMS.features.media.actions.comment_mention&&o.MediaPageStore.on("users_load",M),function(){o.MediaPageStore.removeListener("comment_submit",_),o.MediaPageStore.removeListener("comment_submit_fail",A),!0===MediaCMS.features.media.actions.comment_mention&&o.MediaPageStore.removeListener("users_load",M)}})),i.MemberContext._currentValue.is.anonymous?a.createElement("div",{className:"comments-form"},a.createElement("div",{className:"comments-form-inner"},a.createElement(z.UserThumbnail,null),a.createElement("div",{className:"form"},a.createElement("a",{href:E,rel:"noffolow",className:"form-textarea-wrap",title:(0,m.translateString)("Add a ")+K.single+"..."},a.createElement("span",{className:"form-textarea"},(0,m.translateString)("Add a ")+K.single+"...")),a.createElement("div",{className:"form-buttons"},a.createElement("a",{href:E,rel:"noffolow",className:"disabled"},K.submitCommentText))))):a.createElement("div",{className:"comments-form"},a.createElement("div",{className:"comments-form-inner"},a.createElement(z.UserThumbnail,null),a.createElement("div",{className:"form"},a.createElement("div",{className:"form-textarea-wrap"+(p?" focused":"")},MediaCMS.features.media.actions.comment_mention?a.createElement(H.r,{inputRef:t,className:"form-textarea",rows:"1",placeholder:(0,m.translateString)("Add a ")+K.single+"...",value:r,onChange:function(e,n,r,a){t.current.style.height="",l(n),c(!0);var i=t.current.scrollHeight,o=0<g?g:parseFloat(window.getComputedStyle(t.current).lineHeight);v(o),t.current.style.height=Math.max(20,g*Math.ceil(i/o))+"px"},onFocus:P,onBlur:k},a.createElement(H.p,{data:S,markup:"@(___id___)[___display___]"})):a.createElement("textarea",{ref:t,className:"form-textarea",rows:"1",placeholder:(0,m.translateString)("Add a ")+K.single+"...",value:r,onChange:function(e){t.current.style.height="";var n=t.current.scrollHeight,r=0<g?g:parseFloat(window.getComputedStyle(t.current).lineHeight);l(t.current.value),c(!0),v(r),t.current.style.height=Math.max(20,g*Math.ceil(n/r))+"px"},onFocus:P,onBlur:k})),a.createElement("div",{className:"form-buttons"},a.createElement("button",{className:""===r.trim()?"disabled":"",onClick:function(){if(u){var e=r.trim();""!==e&&f.MediaPageActions.submitComment(e)}}},K.submitCommentText)))))}X.propTypes={comment_type:u().oneOf(["new","reply"]),media_id:u().oneOfType([u().string,u().number]).isRequired,reply_comment_id:u().oneOfType([u().string,u().number])},X.defaultProps={comment_type:"new"};function ee(e){var t=Z((0,q.usePopup)(),3),n=t[0],r=t[1],o=t[2];return a.createElement("div",{className:"comment-actions"},i.MemberContext._currentValue.can.deleteComment?a.createElement("div",{className:"comment-action remove-comment"},a.createElement(o,{contentRef:n},a.createElement("button",null,(0,m.translateString)("DELETE")," ",K.uppercaseSingle)),a.createElement(r,{contentRef:n},a.createElement(z.PopupMain,null,a.createElement("div",{className:"popup-message"},a.createElement("span",{className:"popup-message-title"},K.ucfirstSingle," removal"),a.createElement("span",{className:"popup-message-main"},"You're willing to remove ",K.single," permanently?")),a.createElement("hr",null),a.createElement("span",{className:"popup-message-bottom"},a.createElement("button",{className:"button-link cancel-comment-removal",onClick:function(){n.current.toggle()}},"CANCEL"),a.createElement("button",{className:"button-link proceed-comment-removal",onClick:function(){n.current.toggle(),f.MediaPageActions.deleteComment(e.comment_id)}},"PROCEED"))))):null)}function te(e){var t,n=(0,a.useRef)(null),r=(0,a.useRef)(null),o=Z((0,a.useState)(!0),2),l=o[0],s=o[1],u=Z((0,a.useState)(!1),2),c=u[0];return u[1],(0,a.useEffect)((function(){return function(){}}),[]),a.createElement("div",{className:"comment"},a.createElement("div",{className:"comment-inner"},a.createElement("a",{className:"comment-author-thumb",href:e.author_link,title:e.author_name},a.createElement("img",{src:e.author_thumb,alt:e.author_name})),a.createElement("div",{className:"comment-content"},a.createElement("div",{className:"comment-meta"},a.createElement("div",{className:"comment-author"},a.createElement("a",{href:e.author_link,title:e.author_name},e.author_name)),a.createElement("div",{className:"comment-date"},(0,m.replaceString)((0,W.WU)(new Date(e.publish_date))))),a.createElement("div",{ref:n,className:"comment-text"+(l?" show-all":"")},a.createElement("div",{ref:r,className:"comment-text-inner",dangerouslySetInnerHTML:(t=e.text,{__html:t.replace(/\n/g,"<br />")})})),c?a.createElement("button",{className:"toggle-more",onClick:function(){s(!l)}},l?"Show less":"Read more"):null,i.MemberContext._currentValue.can.deleteComment?a.createElement(ee,{comment_id:e.comment_id}):null)))}te.propTypes={comment_id:u().oneOfType([u().string,u().number]).isRequired,media_id:u().oneOfType([u().string,u().number]).isRequired,text:u().string,author_name:u().string,author_link:u().string,author_thumb:u().string,publish_date:u().oneOfType([u().string,u().number]),likes:u().number,dislikes:u().number},te.defaultProps={author_name:"",author_link:"#",publish_date:0,likes:0,dislikes:0};var ne=function(e){var t=e.commentsLength;return a.createElement(a.Fragment,null,!i.MemberContext._currentValue.can.readComment||o.MediaPageStore.get("media-data").enable_comments?null:a.createElement("span",{className:"disabled-comments-msg"},K.disabledCommentsMsg),i.MemberContext._currentValue.can.readComment&&(o.MediaPageStore.get("media-data").enable_comments||i.MemberContext._currentValue.can.editMedia)?a.createElement("h2",null,t?1<t?t+" "+K.ucfirstPlural:t+" "+K.ucfirstSingle:o.MediaPageStore.get("media-data").enable_comments?(0,m.translateString)("No")+" "+K.single+" "+(0,m.translateString)("yet"):""):null)};function re(e){var t=Z((0,a.useState)(o.MediaPageStore.get("media-id")),2),n=t[0],r=(t[1],Z((0,a.useState)(i.MemberContext._currentValue.can.readComment?o.MediaPageStore.get("media-comments"):[]),2)),l=r[0],s=r[1],u=Z((0,a.useState)(!1),2),c=u[0],d=u[1];function m(){var e=Y(o.MediaPageStore.get("media-comments"));s(Y(e))}function p(e){m(),setTimeout((function(){return f.PageActions.addNotification(K.ucfirstSingle+" added","commentSubmit")}),100)}function y(){setTimeout((function(){return f.PageActions.addNotification(K.ucfirstSingle+" submission failed","commentSubmitFail")}),100)}function h(e){m(),setTimeout((function(){return f.PageActions.addNotification(K.ucfirstSingle+" removed","commentDelete")}),100)}function g(e){setTimeout((function(){return f.PageActions.addNotification(K.ucfirstSingle+" removal failed","commentDeleteFail")}),100)}return(0,a.useEffect)((function(){d(l.length&&i.MemberContext._currentValue.can.readComment&&(o.MediaPageStore.get("media-data").enable_comments||i.MemberContext._currentValue.can.editMedia))}),[l]),(0,a.useEffect)((function(){return o.MediaPageStore.on("comments_load",m),o.MediaPageStore.on("comment_submit",p),o.MediaPageStore.on("comment_submit_fail",y),o.MediaPageStore.on("comment_delete",h),o.MediaPageStore.on("comment_delete_fail",g),function(){o.MediaPageStore.removeListener("comments_load",m),o.MediaPageStore.removeListener("comment_submit",p),o.MediaPageStore.removeListener("comment_submit_fail",y),o.MediaPageStore.removeListener("comment_delete",h),o.MediaPageStore.removeListener("comment_delete_fail",g)}}),[]),a.createElement("div",{className:"comments-list"},a.createElement("div",{className:"comments-list-inner"},a.createElement(ne,{commentsLength:l.length}),o.MediaPageStore.get("media-data").enable_comments?a.createElement(X,{media_id:n}):null,c?l.map((function(e){return a.createElement(te,{key:e.uid,comment_id:e.uid,media_id:n,text:e.text,author_name:e.author_name,author_link:e.author_profile,author_thumb:i.SiteContext._currentValue.url+"/"+e.author_thumbnail_url.replace(/^\//g,""),publish_date:e.add_date,likes:0,dislikes:0})})):null))}var ae=n(1283);function ie(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return oe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?oe(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function le(e){var t,n,r=[];if(e.length)for(t=0,n=1<e.length?", ":"";t<e.length;)r[t]=a.createElement("div",{key:t},a.createElement("a",{href:e[t].url,title:e[t].title},e[t].title),t<e.length-1?n:""),t+=1;return r}function se(e){return a.createElement("div",{className:"media-author-banner"},a.createElement("div",null,a.createElement("a",{className:"author-banner-thumb",href:e.link||null,title:e.name},a.createElement("span",{style:{backgroundImage:"url("+e.thumb+")"}},a.createElement("img",{src:e.thumb,loading:"lazy",alt:e.name,title:e.name})))),a.createElement("div",null,a.createElement("span",null,a.createElement("a",{href:e.link,className:"author-banner-name",title:e.name},a.createElement("span",null,e.name))),o.PageStore.get("config-media-item").displayPublishDate&&e.published?a.createElement("span",{className:"author-banner-date"},(0,m.translateString)("Published on")," ",(0,m.replaceString)((0,m.publishedOnDate)(new Date(e.published)))):null))}function ue(e){return a.createElement("div",{className:e.id.trim()?"media-content-"+e.id.trim():null},a.createElement("div",{className:"media-content-field"},a.createElement("div",{className:"media-content-field-label"},a.createElement("h4",null,e.title)),a.createElement("div",{className:"media-content-field-content"},e.value)))}function ce(e){var t=e.link;return window.MediaCMS.site.devEnv&&(t="/edit-media.html"),a.createElement("a",{href:t,rel:"nofollow",title:(0,m.translateString)("Edit media"),className:"edit-media"},(0,m.translateString)("EDIT MEDIA"))}function de(e){var t=e.link;return window.MediaCMS.site.devEnv&&(t="#"),a.createElement("a",{href:t,rel:"nofollow",title:(0,m.translateString)("Edit subtitle"),className:"edit-subtitle"},(0,m.translateString)("EDIT SUBTITLE"))}function me(e){var t=(0,q.useUser)().userCan,n=e.description.trim(),r=!o.PageStore.get("config-enabled").taxonomies.tags||o.PageStore.get("config-enabled").taxonomies.tags.enabled?le(o.MediaPageStore.get("media-tags")):[],l=o.PageStore.get("config-options").pages.media.categoriesWithTitle?[]:!o.PageStore.get("config-enabled").taxonomies.categories||o.PageStore.get("config-enabled").taxonomies.categories.enabled?le(o.MediaPageStore.get("media-categories")):[],s=o.MediaPageStore.get("media-summary");s=s?s.trim():"";var u=ie((0,q.usePopup)(),3),c=u[0],d=u[1],p=u[2],y=ie((0,a.useState)(""!==s),2),h=y[0],g=(y[1],ie((0,a.useState)(""==s),2)),v=g[0],b=g[1];function S(e){setTimeout((function(){f.PageActions.addNotification("Media removed. Redirecting...","mediaDelete"),setTimeout((function(){window.location.href=i.SiteContext._currentValue.url+"/"+o.MediaPageStore.get("media-data").author_profile.replace(/^\//g,"")}),2e3)}),100),void 0!==e&&ae.info("Removed media '"+e+'"')}function w(e){setTimeout((function(){f.PageActions.addNotification("Media removal failed","mediaDeleteFail")}),100),void 0!==e&&ae.info('Media "'+e+'" removal failed')}(0,a.useEffect)((function(){return o.MediaPageStore.on("media_delete",S),o.MediaPageStore.on("media_delete_fail",w),function(){o.MediaPageStore.removeListener("media_delete",S),o.MediaPageStore.removeListener("media_delete_fail",w)}}),[]);var E=(0,m.formatInnerLink)(e.author.url,i.SiteContext._currentValue.url),P=(0,m.formatInnerLink)(e.author.thumb,i.SiteContext._currentValue.url);return a.createElement("div",{className:"media-info-content"},void 0===o.PageStore.get("config-media-item").displayAuthor||null===o.PageStore.get("config-media-item").displayAuthor||o.PageStore.get("config-media-item").displayAuthor?a.createElement(se,{link:E,thumb:P,name:e.author.name,published:e.published}):null,a.createElement("div",{className:"media-content-banner"},a.createElement("div",{className:"media-content-banner-inner"},h?a.createElement("div",{className:"media-content-summary"},s):null,h&&!v||!n?null:o.PageStore.get("config-options").pages.media.htmlInDescription?a.createElement("div",{className:"media-content-description",dangerouslySetInnerHTML:{__html:n}}):a.createElement("div",{className:"media-content-description"},n),h?a.createElement("button",{className:"load-more",onClick:function(){b(!v)}},v?"SHOW LESS":"SHOW MORE"):null,r.length?a.createElement(ue,{value:r,title:1<r.length?(0,m.translateString)("Tags"):(0,m.translateString)("Tag"),id:"tags"}):null,l.length?a.createElement(ue,{value:l,title:1<l.length?(0,m.translateString)("Categories"):(0,m.translateString)("Category"),id:"categories"}):null,t.editMedia||t.editSubtitle||t.deleteMedia?a.createElement("div",{className:"media-author-actions"},t.editMedia?a.createElement(ce,{link:o.MediaPageStore.get("media-data").edit_url}):null,t.editSubtitle&&"video"===o.MediaPageStore.get("media-data").media_type?a.createElement(de,{link:o.MediaPageStore.get("media-data").edit_url.replace("edit?","add_subtitle?")}):null,a.createElement(p,{contentRef:c},a.createElement("button",{className:"remove-media"},(0,m.translateString)("DELETE MEDIA"))),a.createElement(d,{contentRef:c},a.createElement(z.PopupMain,null,a.createElement("div",{className:"popup-message"},a.createElement("span",{className:"popup-message-title"},"Media removal"),a.createElement("span",{className:"popup-message-main"},"You're willing to remove media permanently?")),a.createElement("hr",null),a.createElement("span",{className:"popup-message-bottom"},a.createElement("button",{className:"button-link cancel-comment-removal",onClick:function(){c.current.toggle()}},"CANCEL"),a.createElement("button",{className:"button-link proceed-comment-removal",onClick:function(){f.MediaPageActions.removeMedia(),c.current.toggle()}},"PROCEED"))))):null)),a.createElement(re,null))}function fe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return pe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pe(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ye(){var e=fe((0,a.useState)(o.MediaPageStore.get("user-disliked-media")),2),t=e[0],n=e[1],r=fe((0,a.useState)((0,m.formatViewsNumber)(o.MediaPageStore.get("media-dislikes"),!1)),2),l=r[0],s=r[1];function u(){n(o.MediaPageStore.get("user-disliked-media")),s((0,m.formatViewsNumber)(o.MediaPageStore.get("media-dislikes"),!1))}function c(){u(),f.PageActions.addNotification(i.TextsContext._currentValue.messages.addToDisliked,"mediaDislike")}function d(){u(),f.PageActions.addNotification(i.TextsContext._currentValue.messages.removeFromDisliked,"cancelMediaDislike")}function p(){f.PageActions.addNotification("Action failed","mediaDislikeRequestFail")}return(0,a.useEffect)((function(){return o.MediaPageStore.on("disliked_media",c),o.MediaPageStore.on("undisliked_media",d),o.MediaPageStore.on("disliked_media_failed_request",p),function(){o.MediaPageStore.removeListener("disliked_media",c),o.MediaPageStore.removeListener("undisliked_media",d),o.MediaPageStore.removeListener("disliked_media_failed_request",p)}}),[]),a.createElement("div",{className:"like"},a.createElement("button",{onClick:function(e){e.preventDefault(),e.stopPropagation(),f.MediaPageActions[t?"undislikeMedia":"dislikeMedia"]()}},a.createElement(z.CircleIconButton,{type:"span"},a.createElement(z.MaterialIcon,{type:"thumb_down"})),a.createElement("span",{className:"dislikes-counter"},l)))}function he(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ge(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ge(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ge(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ve(){var e=he((0,a.useState)(o.MediaPageStore.get("user-liked-media")),2),t=e[0],n=e[1],r=he((0,a.useState)((0,m.formatViewsNumber)(o.MediaPageStore.get("media-likes"),!1)),2),l=r[0],s=r[1];function u(){n(o.MediaPageStore.get("user-liked-media")),s((0,m.formatViewsNumber)(o.MediaPageStore.get("media-likes"),!1))}function c(){u(),f.PageActions.addNotification(i.TextsContext._currentValue.addToLiked,"likedMedia")}function d(){u(),f.PageActions.addNotification(i.TextsContext._currentValue.removeFromLiked,"unlikedMedia")}function p(){f.PageActions.addNotification("Action failed","likedMediaRequestFail")}return(0,a.useEffect)((function(){return o.MediaPageStore.on("liked_media",c),o.MediaPageStore.on("unliked_media",d),o.MediaPageStore.on("liked_media_failed_request",p),function(){o.MediaPageStore.removeListener("liked_media",c),o.MediaPageStore.removeListener("unliked_media",d),o.MediaPageStore.removeListener("liked_media_failed_request",p)}}),[]),a.createElement("div",{className:"like"},a.createElement("button",{onClick:function(e){e.preventDefault(),e.stopPropagation(),f.MediaPageActions[t?"unlikeMedia":"likeMedia"]()}},a.createElement(z.CircleIconButton,{type:"span"},a.createElement(z.MaterialIcon,{type:"thumb_up"})),a.createElement("span",{className:"likes-counter"},l)))}function be(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Se(e){var t,n,r=(0,a.useRef)(null),i=(0,a.useRef)(null),l=(t=(0,a.useState)(null),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(t,n)||function(e,t){if(e){if("string"==typeof e)return be(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?be(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=l[0],u=l[1];function c(){u(window.innerHeight-(104+r.current.offsetHeight))}return(0,a.useEffect)((function(){return c(),o.PageStore.on("window_resize",c),function(){o.PageStore.removeListener("window_resize",c)}}),[]),a.createElement("form",null,a.createElement("div",{className:"report-form",style:null!==s?{maxHeight:s+"px"}:null},a.createElement("div",{className:"form-title"},"Report media"),a.createElement("div",{className:"form-field"},a.createElement("span",{className:"label"},"URL"),a.createElement("input",{type:"text",readOnly:!0,value:e.mediaUrl})),a.createElement("div",{className:"form-field"},a.createElement("span",{className:"label"},"Description"),a.createElement("textarea",{ref:i,required:!0})),a.createElement("div",{className:"form-field form-help-text"},"Reported media is reviewed")),a.createElement("div",{ref:r,className:"form-actions-bottom"},a.createElement("button",{className:"cancel",onClick:function(t){t.preventDefault(),void 0!==e.cancelReportForm&&e.cancelReportForm()}},"CANCEL"),a.createElement("button",{onClick:function(t){var n=i.current.value.trim();""!==n&&(t.preventDefault(),void 0!==e.submitReportForm&&e.submitReportForm(n))}},"SUBMIT")))}function we(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ee(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ee(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ee(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Pe(e,t){var n,r,a=i.SiteContext._currentValue,o=e.encodings_info,l={};for(n in o)if(o.hasOwnProperty(n)&&Object.keys(o[n]).length)for(r in o[n])o[n].hasOwnProperty(r)&&"success"===o[n][r].status&&100===o[n][r].progress&&null!==o[n][r].url&&(l[o[n][r].title]={text:n+" - "+r.toUpperCase()+" ("+o[n][r].size+")",link:(0,m.formatInnerLink)(o[n][r].url,a.url),linkAttr:{target:"_blank",download:e.title+"_"+n+"_"+r.toUpperCase()}});return l.original_media_url={text:"Original file ("+e.size+")",link:(0,m.formatInnerLink)(e.original_media_url,a.url),linkAttr:{target:"_blank",download:e.title}},Object.values(l)}function ke(e,t,n,r,i,o,l){var s=t.url,u=t.media_type,c=t.state||"N/A",d=t.encoding_status||"N/A",m=t.reported_times,f=t.is_reviewed,p="video"===u,y=function(e,t,n,r,a){var i=[],o="video"===t.media_type,l=t.reported_times;return n&&e.downloadMedia&&(o?i.push({itemType:"open-subpage",text:"Download",icon:"arrow_downward",itemAttr:{className:"visible-only-in-small"},buttonAttr:{className:"change-page","data-page-id":"videoDownloadOptions"}}):r&&i.push({itemType:"link",link:r,text:"Download",icon:"arrow_downward",itemAttr:{className:"visible-only-in-small"},linkAttr:{target:"_blank",download:t.title}})),o&&e.editMedia&&i.push({itemType:"open-subpage",text:"Status info",icon:"info",buttonAttr:{className:"change-page","data-page-id":"mediaStatusInfo"}}),e.reportMedia&&(a?i.push({itemType:"div",text:"Reported",icon:"flag",divAttr:{className:"reported-label loggedin-media-reported"}}):i.push({itemType:"open-subpage",text:"Report",icon:"flag",buttonAttr:{className:"change-page"+(l?" loggedin-media-reported":""),"data-page-id":"loggedInReportMedia"}})),i}(e,t,n,r,i),h={};return y.length&&(h.main=a.createElement("div",{className:"main-options"},a.createElement(z.PopupMain,null,a.createElement(z.NavigationMenuList,{items:y})))),e.reportMedia&&(h.loggedInReportMedia=i?null:a.createElement("div",{className:"popup-fullscreen"},a.createElement(z.PopupMain,null,a.createElement("span",{className:"popup-fullscreen-overlay"}),a.createElement("div",null,a.createElement(Se,{mediaUrl:s,submitReportForm:o,cancelReportForm:l}))))),e.editMedia&&(h.mediaStatusInfo=a.createElement("div",{className:"main-options"},a.createElement(z.PopupMain,null,a.createElement("ul",{className:"media-status-info"},a.createElement("li",null,"Media type: ",a.createElement("span",null,u)),a.createElement("li",null,"State: ",a.createElement("span",null,c)),a.createElement("li",null,"Review state: ",a.createElement("span",null,f?"Is reviewed":"Pending review")),p?a.createElement("li",null,"Encoding Status: ",a.createElement("span",null,d)):null,m?a.createElement("li",{className:"reports"},"Reports: ",a.createElement("span",null,m)):null)))),n&&e.downloadMedia&&p&&(h.videoDownloadOptions=a.createElement("div",{className:"video-download-options"},a.createElement(z.PopupMain,null,a.createElement(z.NavigationMenuList,{items:Pe(t)})))),h}n(49628),Se.propTypes={mediaUrl:u().string.isRequired,cancelReportForm:u().func,submitReportForm:u().func};var Me="more-options active-options";function _e(e){var t=(0,q.useUser)().userCan,n=i.SiteContext._currentValue,r=(0,m.formatInnerLink)(o.MediaPageStore.get("media-original-url"),n.url),l=o.MediaPageStore.get("media-data"),s="video"===l.media_type,u=we((0,q.usePopup)(),3),c=u[0],d=u[1],p=u[2],y=we((0,a.useState)(!1),2),h=y[0],g=y[1],v=we((0,a.useState)(!1),2),b=v[0],S=v[1],w=we((0,a.useState)({}),2),E=w[0],P=w[1],k=we((0,a.useState)("main"),2),M=k[0],_=k[1],A=we((0,a.useState)(Me),2),C=A[0],N=A[1];function x(e){f.MediaPageActions.reportMedia(e)}function O(){c.current.toggle()}function I(){c.current.tryToHide(),setTimeout((function(){f.PageActions.addNotification("Media Reported","reportedMedia"),S(!0),o.MediaPageStore.removeListener("reported_media",I)}),100)}return(0,a.useEffect)((function(){b||(h?o.MediaPageStore.on("reported_media",I):o.MediaPageStore.removeListener("reported_media",I))}),[h]),(0,a.useEffect)((function(){g(Object.keys(E).length&&e.allowDownload&&t.downloadMedia)}),[E]),(0,a.useEffect)((function(){var n=Me;e.allowDownload&&t.downloadMedia&&"videoDownloadOptions"===M&&(n+=" video-downloads"),1===Object.keys(E).length&&e.allowDownload&&t.downloadMedia&&(s||r)&&(n+=" visible-only-in-small"),N(n)}),[M]),(0,a.useEffect)((function(){P(ke(t,l,e.allowDownload,r,b,x,O))}),[b]),(0,a.useEffect)((function(){return P(ke(t,l,e.allowDownload,r,b,x,O)),function(){h&&!b&&o.MediaPageStore.removeListener("reported_media",I)}}),[]),h?a.createElement("div",{className:C},a.createElement(p,{contentRef:c},a.createElement("span",null,a.createElement(z.CircleIconButton,{type:"button"},a.createElement(z.MaterialIcon,{type:"more_horiz"})))),a.createElement("div",{className:"nav-page-"+M},a.createElement(d,{contentRef:c,hideCallback:function(){_("main")}},a.createElement(z.NavigationContentApp,{pageChangeCallback:function(e){_(e)},initPage:M,focusFirstItemOnPageChange:!1,pages:E,pageChangeSelector:".change-page",pageIdSelectorAttr:"data-page-id"})))):null}_e.propTypes={allowDownload:u().bool.isRequired},_e.defaultProps={allowDownload:!1};var Ae=n(17642);function Ce(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ne(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xe(e){return e.renderDate?a.createElement("label",null,a.createElement("input",{type:"checkbox",checked:e.isChecked,onChange:function(t){t.persist(),e.isChecked?f.MediaPageActions.removeMediaFromPlaylist(e.playlistId,o.MediaPageStore.get("media-id")):f.MediaPageActions.addMediaToPlaylist(e.playlistId,o.MediaPageStore.get("media-id"))}}),a.createElement("span",null,e.title)):null}function Oe(e){var t=(0,a.useRef)(null),n=(0,a.useRef)(null),r=Ce((0,a.useState)(new Date),2),i=r[0],l=r[1],s=Ce((0,a.useState)(o.MediaPageStore.get("playlists")),2),u=s[0],c=s[1],d=Ce((0,a.useState)(!1),2),m=d[0],p=d[1];function y(){w()}function h(){c(o.MediaPageStore.get("playlists")),l(new Date)}function g(){c(o.MediaPageStore.get("playlists")),l(new Date),setTimeout((function(){f.PageActions.addNotification("Media added to playlist","playlistMediaAdditionComplete")}),100)}function v(){setTimeout((function(){f.PageActions.addNotification("Media's addition to playlist failed","playlistMediaAdditionFail")}),100)}function b(){c(o.MediaPageStore.get("playlists")),l(new Date),setTimeout((function(){f.PageActions.addNotification("Media removed from playlist","playlistMediaRemovalComplete")}),100)}function S(){setTimeout((function(){f.PageActions.addNotification("Media's removal from playlist failed","playlistMediaaRemovalFail")}),100)}function w(){null!==n.current&&(n.current.style.maxHeight=window.innerHeight-74-(t.current.offsetHeight-n.current.offsetHeight)+"px")}function E(){p(!m),w()}return(0,a.useEffect)((function(){w()})),(0,a.useEffect)((function(){return o.PageStore.on("window_resize",y),o.MediaPageStore.on("playlists_load",h),o.MediaPageStore.on("media_playlist_addition_completed",g),o.MediaPageStore.on("media_playlist_addition_failed",v),o.MediaPageStore.on("media_playlist_removal_completed",b),o.MediaPageStore.on("media_playlist_removal_failed",S),function(){o.PageStore.removeListener("window_resize",y),o.MediaPageStore.removeListener("playlists_load",h),o.MediaPageStore.removeListener("media_playlist_addition_completed",g),o.MediaPageStore.removeListener("media_playlist_addition_failed",v),o.MediaPageStore.removeListener("media_playlist_removal_completed",b),o.MediaPageStore.removeListener("media_playlist_removal_failed",S)}}),[]),a.createElement("div",{ref:t,className:"saveto-popup"},a.createElement("div",{className:"saveto-title"},"Save to...",a.createElement(z.CircleIconButton,{type:"button",onClick:function(){p(!1),void 0!==e.triggerPopupClose&&e.triggerPopupClose()}},a.createElement(z.MaterialIcon,{type:"close"}))),u.length?a.createElement("div",{ref:n,className:"saveto-select"},function(){for(var e=o.MediaPageStore.get("media-id"),t=[],n=0;n<u.length;)t.push(a.createElement("div",{key:"playlist_"+u[n].playlist_id},a.createElement(xe,{renderDate:i,title:u[n].title,privacy:u[n].status,isChecked:-1<u[n].media_list.indexOf(e),playlistId:u[n].playlist_id}))),n+=1;return t}()):null,m?a.createElement("div",{className:"saveto-new-playlist"},a.createElement(Ae.A,{onCancel:E,onPlaylistSave:function(e){f.MediaPageActions.addNewPlaylist(e),E()}})):a.createElement(z.CircleIconButton,{className:"saveto-create",type:"button",onClick:E},a.createElement(z.MaterialIcon,{type:"add"}),"Create a new playlist"))}function Ie(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Te(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Te(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Te(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ve(e){var t,n=Ie((0,q.usePopup)(),3),r=n[0],i=n[1],o=n[2],l=Ie((0,a.useState)("selectPlaylist"),2),s=l[0],u=l[1];return a.createElement("div",{className:"save"},a.createElement(o,{contentRef:r},a.createElement("button",null,a.createElement(z.CircleIconButton,{type:"span"},a.createElement(z.MaterialIcon,{type:"playlist_add"})),a.createElement("span",null,(0,m.translateString)("SAVE")))),a.createElement(i,{contentRef:r},a.createElement(z.NavigationContentApp,{initPage:s,pageChangeSelector:".change-page",pageIdSelectorAttr:"data-page-id",pages:(t=function(){r.current.toggle()},{selectPlaylist:a.createElement("div",{className:"popup-fullscreen"},a.createElement(z.PopupMain,null,a.createElement("span",{className:"popup-fullscreen-overlay"}),a.createElement(Oe,{triggerPopupClose:t}))),createPlaylist:a.createElement("div",{className:"popup-fullscreen"},a.createElement(z.PopupMain,null,a.createElement("span",{className:"popup-fullscreen-overlay"})))}),focusFirstItemOnPageChange:!1,pageChangeCallback:u})))}function Le(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return je(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?je(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function je(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Re(e){var t=o.PageStore.get("config-options").embedded.video.dimensions,n=(0,a.useContext)(i.LinksContext),r=(0,a.useRef)(null),l=(0,a.useRef)(null),s=(0,a.useRef)(null),u=(0,a.useRef)(null),c=(0,a.useRef)(null),d=Le((0,a.useState)(window.innerHeight-144+56),2),m=d[0],p=d[1],y=Le((0,a.useState)(!1),2),h=y[0],g=y[1],v=Le((0,a.useState)("16:9"),2),b=v[0],S=v[1],w=Le((0,a.useState)(t.width),2),E=w[0],P=w[1],k=Le((0,a.useState)(t.widthUnit),2),M=k[0],_=k[1],A=Le((0,a.useState)(t.height),2),C=A[0],N=A[1],x=Le((0,a.useState)(t.heightUnit),2),O=x[0],I=x[1],T=Le((0,a.useState)(60),2),V=T[0],L=T[1],j=Le((0,a.useState)(60),2),R=j[0],U=j[1],B=Le((0,a.useState)([{key:"px",label:"px"},{key:"percent",label:"%"}]),2),F=B[0],q=B[1];function H(){p(window.innerHeight-144+56),L(s.current.offsetHeight),U(c.current.offsetHeight)}function W(){setTimeout((function(){f.PageActions.addNotification("Embed media code copied to clipboard","clipboardEmbedMediaCodeCopy")}),100)}return(0,a.useEffect)((function(){p(window.innerHeight-144+56),L(s.current.offsetHeight),U(c.current.offsetHeight)})),(0,a.useEffect)((function(){return o.PageStore.on("window_resize",H),o.MediaPageStore.on("copied_embed_media_code",W),function(){o.PageStore.removeListener("window_resize",H),o.MediaPageStore.removeListener("copied_embed_media_code",W)}}),[]),a.createElement("div",{className:"share-embed",style:{maxHeight:m+"px"}},a.createElement("div",{className:"share-embed-inner"},a.createElement("div",{className:"on-left"},a.createElement("div",{className:"media-embed-wrap"},a.createElement(D,{data:o.MediaPageStore.get("media-data"),inEmbed:!0}))),a.createElement("div",{ref:l,className:"on-right"},a.createElement("div",{ref:s,className:"on-right-top"},a.createElement("div",{className:"on-right-top-inner"},a.createElement("span",{className:"ttl"},"Embed Video"),a.createElement(z.CircleIconButton,{type:"button",onClick:function(){void 0!==e.triggerPopupClose&&e.triggerPopupClose()}},a.createElement(z.MaterialIcon,{type:"close"})))),a.createElement("div",{ref:u,className:"on-right-middle",style:{top:V+"px",bottom:R+"px"}},a.createElement("textarea",{readOnly:!0,value:'<iframe width="'+("percent"===M?E+"%":E)+'" height="'+("percent"===O?C+"%":C)+'" src="'+n.embed+o.MediaPageStore.get("media-id")+'" frameborder="0" allowfullscreen></iframe>'}),a.createElement("div",{className:"iframe-config"},a.createElement("div",{className:"iframe-config-options-title"},"Embed options"),a.createElement("div",{className:"iframe-config-option"},a.createElement("div",{className:"option-content"},a.createElement("div",{className:"ratio-options"},a.createElement("div",{className:"options-group"},a.createElement("label",{style:{minHeight:"36px"}},a.createElement("input",{type:"checkbox",checked:h,onChange:function(){var e=!h,t=b.split(":"),n=t[0],r=t[1];g(e),_(e?"px":M),I(e?"px":O),N(e?parseInt(E*r/n,10):C),q(e?[{key:"px",label:"px"}]:[{key:"px",label:"px"},{key:"percent",label:"%"}])}}),"Keep aspect ratio")),h?a.createElement("div",{className:"options-group"},a.createElement("select",{ref:r,onChange:function(){var e=r.current.value,t=e.split(":"),n=t[0],a=t[1];S(e),N(h?parseInt(E*a/n,10):C)},value:b},a.createElement("optgroup",{label:"Horizontal orientation"},a.createElement("option",{value:"16:9"},"16:9"),a.createElement("option",{value:"4:3"},"4:3"),a.createElement("option",{value:"3:2"},"3:2")),a.createElement("optgroup",{label:"Vertical orientation"},a.createElement("option",{value:"9:16"},"9:16"),a.createElement("option",{value:"3:4"},"3:4"),a.createElement("option",{value:"2:3"},"2:3")))):null),a.createElement("br",null),a.createElement("div",{className:"options-group"},a.createElement(z.NumericInputWithUnit,{valueCallback:function(e){e=""===e?0:e;var t=b.split(":"),n=t[0],r=t[1];P(e),N(h?parseInt(e*r/n,10):C)},unitCallback:function(e){_(e)},label:"Width",defaultValue:parseInt(E,10),defaultUnit:M,minValue:1,maxValue:99999,units:F})),a.createElement("div",{className:"options-group"},a.createElement(z.NumericInputWithUnit,{valueCallback:function(e){e=""===e?0:e;var t=b.split(":"),n=t[0],r=t[1];N(e),P(h?parseInt(e*n/r,10):E)},unitCallback:function(e){I(e)},label:"Height",defaultValue:parseInt(C,10),defaultUnit:O,minValue:1,maxValue:99999,units:F})))))),a.createElement("div",{ref:c,className:"on-right-bottom"},a.createElement("button",{onClick:function(){f.MediaPageActions.copyEmbedMediaCode(u.current.querySelector("textarea"))}},"COPY")))))}xe.propTypes={playlistId:u().string,isChecked:u().bool,title:u().string},xe.defaultProps={isChecked:!1,title:""},Oe.propTypes={triggerPopupClose:u().func},n(38833),n(10815),n(79174),Re.propTypes={triggerPopupClose:u().func},n(45777);var De=n(38770);function Ue(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Be(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Be(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Be(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Fe(e){var t=e.onClick;return a.createElement("span",{className:"next-slide"},a.createElement(z.CircleIconButton,{buttonShadow:!0,onClick:t},a.createElement("i",{className:"material-icons"},"keyboard_arrow_right")))}function qe(e){var t=e.onClick;return a.createElement("span",{className:"previous-slide"},a.createElement(z.CircleIconButton,{buttonShadow:!0,onClick:t},a.createElement("i",{className:"material-icons"},"keyboard_arrow_left")))}function ze(){return{maxFormContentHeight:window.innerHeight-196,maxPopupWidth:518>window.innerWidth-80?window.innerWidth-80:null}}function He(e){var t=(0,a.useRef)(null),n=(0,a.useRef)(null),r=o.MediaPageStore.get("media-url"),l=Ue((0,a.useState)(null),2),s=l[0],u=l[1],c=Ue((0,a.useState)({prev:!1,next:!1}),2),d=c[0],m=c[1],p=Ue((0,a.useState)(ze()),2),y=p[0],h=p[1],g=Ue((0,a.useState)(function(){var e=function(){for(var e=i.ShareOptionsContext._currentValue,t=o.MediaPageStore.get("media-url"),n=o.MediaPageStore.get("media-data").title,r={},a=0;a<e.length;){switch(e[a]){case"embed":"video"===o.MediaPageStore.get("media-data").media_type&&(r[e[a]]={});break;case"email":r[e[a]]={title:"Email",shareUrl:"mailto:?body="+t};break;case"fb":r[e[a]]={title:"Facebook",shareUrl:"https://www.facebook.com/sharer.php?u="+t};break;case"tw":r[e[a]]={title:"Twitter",shareUrl:"https://twitter.com/intent/tweet?url="+t};break;case"reddit":r[e[a]]={title:"reddit",shareUrl:"https://reddit.com/submit?url="+t+"&title="+n};break;case"tumblr":r[e[a]]={title:"Tumblr",shareUrl:"https://www.tumblr.com/widgets/share/tool?canonicalUrl="+t+"&title="+n};break;case"pinterest":r[e[a]]={title:"Pinterest",shareUrl:"http://pinterest.com/pin/create/link/?url="+t};break;case"vk":r[e[a]]={title:"ВКонтакте",shareUrl:"http://vk.com/share.php?url="+t+"&title="+n};break;case"linkedin":r[e[a]]={title:"LinkedIn",shareUrl:"https://www.linkedin.com/shareArticle?mini=true&url="+t};break;case"mix":r[e[a]]={title:"Mix",shareUrl:"https://mix.com/add?url="+t};break;case"whatsapp":r[e[a]]={title:"WhatsApp",shareUrl:"whatsapp://send?text="+t};break;case"telegram":r[e[a]]={title:"Telegram",shareUrl:"https://t.me/share/url?url="+t+"&text="+n}}a+=1}return r}(),t=[];for(var n in e)e.hasOwnProperty(n)&&("embed"===n?t.push(a.createElement("div",{key:"share-"+n,className:"sh-option share-"+n+"-opt"},a.createElement("button",{className:"sh-option change-page","data-page-id":"shareEmbed"},a.createElement("span",null,a.createElement("i",{className:"material-icons"},"code")),a.createElement("span",null,"Embed")))):"whatsapp"===n?t.push(a.createElement("div",{key:"share-"+n,className:"sh-option share-"+n},a.createElement("a",{href:e[n].shareUrl,title:"",target:"_blank","data-action":"share/whatsapp/share",rel:"noreferrer"},a.createElement("span",null),a.createElement("span",null,e[n].title)))):"email"===n?t.push(a.createElement("div",{key:"share-email",className:"sh-option share-email"},a.createElement("a",{href:e[n].shareUrl,title:""},a.createElement("span",null,a.createElement("i",{className:"material-icons"},"email")),a.createElement("span",null,e[n].title)))):t.push(a.createElement("div",{key:"share-"+n,className:"sh-option share-"+n},a.createElement("a",{href:e[n].shareUrl,title:"",target:"_blank",rel:"noreferrer"},a.createElement("span",null),a.createElement("span",null,e[n].title)))));return t}()),1)[0],v=Ue((0,a.useState)(0),2),b=v[0],S=v[1],w=Ue((0,a.useState)(0),2),E=w[0],P=w[1],k=Ue((0,a.useState)(!1),2),M=k[0],_=k[1],A=Ue((0,a.useState)(r),2),C=A[0],N=A[1];function x(){h(ze())}function O(){setTimeout((function(){f.PageActions.addNotification("Link copied to clipboard","clipboardLinkCopy")}),100)}function I(){s.scrollToCurrentSlide(),m({prev:s.hasPreviousSlide(),next:s.hasNextSlide()})}return(0,a.useEffect)((function(){u(new De.Z(n.current,".sh-option"))}),[g]),(0,a.useEffect)((function(){s&&(s.updateDataStateOnResize(g.length,!0,!0),I())}),[y,s]),(0,a.useEffect)((function(){o.PageStore.on("window_resize",x),o.MediaPageStore.on("copied_media_link",O);var e,t,n,r,a,i=null===(e=document.getElementsByTagName("video")[0])||void 0===e?void 0:e.currentTime;return S(i),P((a=(t=parseInt(i,10))-3600*(n=Math.floor(t/3600))-60*(r=Math.floor((t-3600*n)/60)),n<10&&(n="0"+n),r<10&&(r="0"+r),a<10&&(a="0"+a),n>=1?n+":"+r+":"+a:r+":"+a)),function(){o.PageStore.removeListener("window_resize",x),o.MediaPageStore.removeListener("copied_media_link",O),u(null)}}),[]),a.createElement("div",{ref:t,style:null!==y.maxPopupWidth?{maxWidth:y.maxPopupWidth+"px"}:null},a.createElement("div",{className:"scrollable-content",style:null!==y.maxFormContentHeight?{maxHeight:y.maxFormContentHeight+"px"}:null},a.createElement("div",{className:"share-popup-title"},"Share media"),g.length?a.createElement("div",{className:"share-options"},d.prev?a.createElement(qe,{onClick:function(){s.previousSlide(),I()}}):null,a.createElement("div",{ref:n,className:"share-options-inner"},g),d.next?a.createElement(Fe,{onClick:function(){s.nextSlide(),I()}}):null):null),a.createElement("div",{className:"copy-field"},a.createElement("div",null,a.createElement("input",{type:"text",readOnly:!0,value:C}),a.createElement("button",{onClick:function(){f.MediaPageActions.copyShareLink(t.current.querySelector(".copy-field input"))}},"COPY"))),a.createElement("div",{className:"start-at"},a.createElement("label",null,a.createElement("input",{type:"checkbox",name:"start-at-checkbox",id:"id-start-at-checkbox",checked:M,onChange:function(){var e;_(!M),e=M?r:r+"&t="+Math.trunc(b),N(e)}}),"Start at ",E)))}function We(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return $e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$e(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Qe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ye(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qe(Object(n),!0).forEach((function(t){Ze(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ze(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ge(){return{shareOptions:a.createElement("div",{className:"popup-fullscreen"},a.createElement(z.PopupMain,null,a.createElement("span",{className:"popup-fullscreen-overlay"}),a.createElement(He,null)))}}function Je(e){var t,n=We((0,q.usePopup)(),3),r=n[0],i=n[1],o=n[2],l=We((0,a.useState)("shareOptions"),2),s=l[0],u=l[1];return a.createElement("div",{className:"share"},a.createElement(o,{contentRef:r},a.createElement("button",null,a.createElement(z.CircleIconButton,{type:"span"},a.createElement(z.MaterialIcon,{type:"share"})),a.createElement("span",null,(0,m.translateString)("SHARE")))),a.createElement(i,{contentRef:r,hideCallback:function(){u("shareOptions")}},a.createElement(z.NavigationContentApp,{initPage:s,pageChangeSelector:".change-page",pageIdSelectorAttr:"data-page-id",pages:e.isVideo?(t=function(){r.current.toggle()},Ye(Ye({},Ge()),{},{shareEmbed:a.createElement("div",{className:"popup-fullscreen share-embed-popup"},a.createElement(z.PopupMain,null,a.createElement("span",{className:"popup-fullscreen-overlay"}),a.createElement(Re,{triggerPopupClose:t})))})):Ge(),focusFirstItemOnPageChange:!1,pageChangeCallback:function(e){u(e)}})))}function Ke(e){return a.createElement("div",{className:"download hidden-only-in-small"},a.createElement("a",{href:e.link,target:"_blank",download:e.title,title:"Download",rel:"noreferrer"},a.createElement(z.CircleIconButton,{type:"span"},a.createElement(z.MaterialIcon,{type:"arrow_downward"})),a.createElement("span",null,"DOWNLOAD")))}function Xe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return et(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?et(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function et(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function tt(){var e,t,n=o.MediaPageStore.get("media-data"),r=(n.title,n.encodings_info),a={};for(e in r)if(r.hasOwnProperty(e)&&Object.keys(r[e]).length)for(t in r[e])r[e].hasOwnProperty(t)&&"success"===r[e][t].status&&100===r[e][t].progress&&null!==r[e][t].url&&(a[r[e][t].title]={text:e+" - "+t.toUpperCase()+" ("+r[e][t].size+")",link:(0,m.formatInnerLink)(r[e][t].url,i.SiteContext._currentValue.url),linkAttr:{target:"_blank",download:n.title+"_"+e+"_"+t.toUpperCase()}});return a.original_media_url={text:"Original file ("+n.size+")",link:(0,m.formatInnerLink)(n.original_media_url,i.SiteContext._currentValue.url),linkAttr:{target:"_blank",download:n.title}},Object.values(a)}function nt(e){var t=Xe((0,q.usePopup)(),3),n=t[0],r=t[1],i=t[2],o=Xe((0,a.useState)("main"),2),l=o[0];return o[1],a.createElement("div",{className:"video-downloads hidden-only-in-small"},a.createElement(i,{contentRef:n},a.createElement("button",null,a.createElement(z.CircleIconButton,{type:"span"},a.createElement(z.MaterialIcon,{type:"arrow_downward"})),a.createElement("span",null,(0,m.translateString)("DOWNLOAD")))),a.createElement("div",{className:"nav-page-"+l},a.createElement(r,{contentRef:n},a.createElement(z.NavigationContentApp,{pageChangeCallback:null,initPage:"main",focusFirstItemOnPageChange:!1,pages:{main:a.createElement("div",{className:"main-options"},a.createElement(z.PopupMain,null,a.createElement(z.NavigationMenuList,{items:tt()})))},pageChangeSelector:".change-page",pageIdSelectorAttr:"data-page-id"}))))}function rt(e){return(rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function at(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function it(e,t){return(it=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ot(e,t){return!t||"object"!==rt(t)&&"function"!=typeof t?lt(e):t}function lt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function st(e){return(st=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Ke.propTypes={link:u().string.isRequired,title:u().string.isRequired};var ut=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&it(e,t)}(u,e);var t,n,r,l,s=(r=u,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=st(r);if(l){var n=st(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return ot(this,e)});function u(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),(t=s.call(this,e)).state={likedMedia:o.MediaPageStore.get("user-liked-media"),dislikedMedia:o.MediaPageStore.get("user-disliked-media")},t.downloadLink="video"!==o.MediaPageStore.get("media-type")?(0,m.formatInnerLink)(o.MediaPageStore.get("media-original-url"),i.SiteContext._currentValue.url):null,t.updateStateValues=t.updateStateValues.bind(lt(t)),t}return t=u,(n=[{key:"componentDidMount",value:function(){o.MediaPageStore.on("liked_media",this.updateStateValues),o.MediaPageStore.on("unliked_media",this.updateStateValues),o.MediaPageStore.on("disliked_media",this.updateStateValues),o.MediaPageStore.on("undisliked_media",this.updateStateValues);var e=document.querySelectorAll("[data-tooltip]");e.length&&e.forEach((function(e){return function(e){var t=document.body,n=document.createElement("span");function r(){var t=e.getBoundingClientRect();n.style.top=t.top-(0+n.offsetHeight)+"px",n.style.left=t.left+"px"}n.innerText=e.getAttribute("data-tooltip"),n.setAttribute("class","tooltip"),e.removeAttribute("data-tooltip"),e.addEventListener("mouseenter",(function(){var a=e.getBoundingClientRect();t.appendChild(n),n.style.top=a.top-(0+n.offsetHeight)+"px",n.style.left=a.left+"px",document.addEventListener("scroll",r)})),e.addEventListener("mouseleave",(function(){t.removeChild(n),n.style.top="",n.style.left="",document.removeEventListener("scroll",r)}))}(e)}))}},{key:"updateStateValues",value:function(){this.setState({likedMedia:o.MediaPageStore.get("user-liked-media"),dislikedMedia:o.MediaPageStore.get("user-disliked-media")})}},{key:"mediaCategories",value:function(e){if(void 0===this.props.categories||null===this.props.categories||!this.props.categories.length)return null;for(var t=0,n=[];t<this.props.categories.length;)n.push(a.createElement("span",{key:t},a.createElement("a",{href:(0,m.formatInnerLink)(this.props.categories[t].url,i.SiteContext._currentValue.url),title:this.props.categories[t].title},this.props.categories[t].title))),t+=1;return a.createElement("div",{className:"media-under-title-categories"+(e?" over-title":"")},n)}},{key:"render",value:function(){var e=o.PageStore.get("config-options").pages.media.displayViews&&void 0!==this.props.views,t=o.MediaPageStore.get("media-data").state,n="";switch(t){case"private":n="The site admins have to make its access public";break;case"unlisted":n="The site admins have to make it appear on listings"}return a.createElement("div",{className:"media-title-banner"},e&&o.PageStore.get("config-options").pages.media.categoriesWithTitle?this.mediaCategories(!0):null,void 0!==this.props.title?a.createElement("h1",null,this.props.title):null,"public"!==t?a.createElement("div",{className:"media-labels-area"},a.createElement("div",{className:"media-labels-area-inner"},a.createElement("span",{className:"media-label-state"},a.createElement("span",null,t)),a.createElement("span",{className:"helper-icon","data-tooltip":n},a.createElement("i",{className:"material-icons"},"help_outline")))):null,a.createElement("div",{className:"media-views-actions"+(this.state.likedMedia?" liked-media":"")+(this.state.dislikedMedia?" disliked-media":"")},!e&&o.PageStore.get("config-options").pages.media.categoriesWithTitle?this.mediaCategories():null,e?a.createElement("div",{className:"media-views"},(0,m.formatViewsNumber)(this.props.views,!0)," ",1>=this.props.views?"view":"views"):null,a.createElement("div",{className:"media-actions"},a.createElement("div",null,i.MemberContext._currentValue.can.likeMedia?a.createElement(ve,null):null,i.MemberContext._currentValue.can.dislikeMedia?a.createElement(ye,null):null,i.MemberContext._currentValue.can.shareMedia?a.createElement(Je,{isVideo:!1}):null,!i.MemberContext._currentValue.is.anonymous&&i.MemberContext._currentValue.can.saveMedia&&-1<i.PlaylistsContext._currentValue.mediaTypes.indexOf(o.MediaPageStore.get("media-type"))?a.createElement(Ve,null):null,this.props.allowDownload&&i.MemberContext._currentValue.can.downloadMedia?this.downloadLink?a.createElement(Ke,{link:this.downloadLink,title:this.props.title}):a.createElement(nt,null):null,a.createElement(_e,{allowDownload:this.props.allowDownload})))))}}])&&at(t.prototype,n),u}(a.PureComponent);function ct(e){return(ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function dt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ft(e,t){return(ft=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function pt(e,t){return!t||"object"!==ct(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function yt(e){return(yt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}ut.propTypes={allowDownload:u().bool.isRequired},ut.defaultProps={allowDownload:!1};var ht=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ft(e,t)}(u,e);var t,n,r,l,s=(r=u,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=yt(r);if(l){var n=yt(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return pt(this,e)});function u(){return dt(this,u),s.apply(this,arguments)}return t=u,(n=[{key:"render",value:function(){var e=o.PageStore.get("config-options").pages.media.displayViews&&void 0!==this.props.views,t=o.MediaPageStore.get("media-data").state,n="";switch(t){case"private":n="The site admins have to make its access public";break;case"unlisted":n="The site admins have to make it appear on listings"}return a.createElement("div",{className:"media-title-banner"},e&&o.PageStore.get("config-options").pages.media.categoriesWithTitle?this.mediaCategories(!0):null,void 0!==this.props.title?a.createElement("h1",null,this.props.title):null,"public"!==t?a.createElement("div",{className:"media-labels-area"},a.createElement("div",{className:"media-labels-area-inner"},a.createElement("span",{className:"media-label-state"},a.createElement("span",null,t)),a.createElement("span",{className:"helper-icon","data-tooltip":n},a.createElement("i",{className:"material-icons"},"help_outline")))):null,a.createElement("div",{className:"media-views-actions"+(this.state.likedMedia?" liked-media":"")+(this.state.dislikedMedia?" disliked-media":"")},!e&&o.PageStore.get("config-options").pages.media.categoriesWithTitle?this.mediaCategories():null,e?a.createElement("div",{className:"media-views"},(0,m.formatViewsNumber)(this.props.views,!0)," ",1>=this.props.views?(0,m.translateString)("view"):(0,m.translateString)("views")):null,a.createElement("div",{className:"media-actions"},a.createElement("div",null,i.MemberContext._currentValue.can.likeMedia?a.createElement(ve,null):null,i.MemberContext._currentValue.can.dislikeMedia?a.createElement(ye,null):null,i.MemberContext._currentValue.can.shareMedia?a.createElement(Je,{isVideo:!0}):null,!i.MemberContext._currentValue.is.anonymous&&i.MemberContext._currentValue.can.saveMedia&&-1<i.PlaylistsContext._currentValue.mediaTypes.indexOf(o.MediaPageStore.get("media-type"))?a.createElement(Ve,null):null,this.props.allowDownload&&i.MemberContext._currentValue.can.downloadMedia?this.downloadLink?a.createElement(Ke,{link:this.downloadLink,title:this.props.title}):a.createElement(nt,null):null,a.createElement(_e,{allowDownload:this.props.allowDownload})))))}}])&&mt(t.prototype,n),u}(ut);function gt(e){return(gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function vt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function bt(e,t){return(bt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function St(e,t){return!t||"object"!==gt(t)&&"function"!=typeof t?wt(e):t}function wt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Et(e){return(Et=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Pt(e){return(Pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function kt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _t(e,t){return(_t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function At(e,t){return!t||"object"!==Pt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ct(e){return(Ct=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Nt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_t(e,t)}(s,e);var t,n,r,i,l=(r=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Ct(r);if(i){var n=Ct(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return At(this,e)});function s(){return kt(this,s),l.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e,t,n,r,i,l,s=!1;return this.state.videoLoaded&&(s=void 0===(s=o.MediaPageStore.get("media-data").allow_download)||!!s,e=o.MediaPageStore.get("media-data").views,t=o.MediaPageStore.get("media-data").categories_info,n=o.MediaPageStore.get("media-data").title,r={name:o.MediaPageStore.get("media-data").author_name,url:o.MediaPageStore.get("media-data").author_profile,thumb:o.MediaPageStore.get("media-author-thumbnail-url")},i=o.MediaPageStore.get("media-data").add_date,l=o.MediaPageStore.get("media-data").description),this.state.videoLoaded?a.createElement("div",{className:"viewer-info"},a.createElement("div",{className:"viewer-info-inner"},a.createElement(ht,{title:n,views:e,categories:t,allowDownload:s}),a.createElement(me,{author:r,published:i,description:l}))):null}}])&&Mt(t.prototype,n),s}(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&bt(e,t)}(s,e);var t,n,r,i,l=(r=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Et(r);if(i){var n=Et(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return St(this,e)});function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=l.call(this,e)).state={videoLoaded:!1},t.onVideoLoad=t.onVideoLoad.bind(wt(t)),o.MediaPageStore.on("loaded_media_data",t.onVideoLoad),t}return t=s,(n=[{key:"onVideoLoad",value:function(){this.setState({videoLoaded:!0})}},{key:"render",value:function(){var e,t,n,r,i,l,s=!1;return this.state.videoLoaded&&(s=void 0===(s=o.MediaPageStore.get("media-data").allow_download)||!!s,e=o.MediaPageStore.get("media-data").views,t=o.MediaPageStore.get("media-data").categories_info,n=o.MediaPageStore.get("media-data").title,r={name:o.MediaPageStore.get("media-data").author_name,url:o.MediaPageStore.get("media-data").author_profile,thumb:o.MediaPageStore.get("media-author-thumbnail-url")},i=o.MediaPageStore.get("media-data").add_date,l=o.MediaPageStore.get("media-data").description),this.state.videoLoaded?a.createElement("div",{className:"viewer-info"},a.createElement("div",{className:"viewer-info-inner"},a.createElement(ut,{title:n,views:e,categories:t,allowDownload:s}),a.createElement(me,{author:r,published:i,description:l}))):null}}])&&vt(t.prototype,n),s}(a.PureComponent));function xt(e){return(xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ot(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function It(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Tt(e,t){return(Tt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Vt(e,t){return!t||"object"!==xt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Lt(e){return(Lt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var jt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Tt(e,t)}(s,e);var t,n,r,i,l=(r=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Lt(r);if(i){var n=Lt(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Vt(this,e)});function s(){return Ot(this,s),l.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){return a.createElement("div",{className:"viewer-container",key:"viewer-container-error"},a.createElement("div",{className:"player-container player-container-error"},a.createElement("div",{className:"player-container-inner"},a.createElement("div",{className:"error-container"},a.createElement("div",{className:"error-container-inner"},a.createElement("span",{className:"icon-wrap"},a.createElement("i",{className:"material-icons"},"error_outline")),a.createElement("span",{className:"msg-wrap"},o.MediaPageStore.get("media-load-error-message")))))))}}])&&It(t.prototype,n),s}(a.PureComponent),Rt=n(67777);function Dt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ut(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ut(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ut(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Bt(){var e=o.MediaPageStore.get("media-data");return e&&e.related_media&&e.related_media.length?e.related_media[0]:null}function Ft(e){var t=Dt((0,a.useState)(Bt()),2),n=t[0],r=t[1],i=Dt((0,a.useState)(o.PageStore.get("media-auto-play")),2),l=i[0],s=i[1];function u(){s(o.PageStore.get("media-auto-play"))}function c(){r(Bt())}return(0,a.useEffect)((function(){return o.MediaPageStore.on("loaded_media_data",c),o.PageStore.on("switched_media_auto_play",u),function(){o.MediaPageStore.removeListener("loaded_media_data",c),o.PageStore.removeListener("switched_media_auto_play",u)}}),[]),n?a.createElement("div",{className:"auto-play"},a.createElement("div",{className:"auto-play-header"},a.createElement("div",{className:"next-label"},(0,m.translateString)("Up next")),a.createElement("div",{className:"auto-play-option"},a.createElement("label",{className:"checkbox-label right-selectbox",tabIndex:0,onKeyPress:function(e){0===e.keyCode&&f.PageActions.toggleMediaAutoPlay()}},(0,m.translateString)("AUTOPLAY"),a.createElement("span",{className:"checkbox-switcher-wrap"},a.createElement("span",{className:"checkbox-switcher"},a.createElement("input",{type:"checkbox",tabIndex:-1,checked:l,onChange:f.PageActions.toggleMediaAutoPlay})))))),a.createElement(Rt.s,{className:"items-list-hor",items:[n],pageItems:1,maxItems:1,singleLinkContent:!0,horizontalItemsOrientation:!0,hideDate:!0,hideViews:!o.PageStore.get("config-media-item").displayViews,hideAuthor:!o.PageStore.get("config-media-item").displayAuthor})):null}function qt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return zt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zt(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ht(e){var t=qt((0,a.useState)(c()),2),n=t[0],r=t[1],i=qt((0,a.useState)(null),2),l=i[0],s=i[1];function u(){s(o.MediaPageStore.get("media-type")),r(c())}function c(){var e=o.MediaPageStore.get("media-data");return null!=e&&void 0!==e.related_media&&e.related_media.length?e.related_media:null}return(0,a.useEffect)((function(){return o.MediaPageStore.on("loaded_media_data",u),function(){return o.MediaPageStore.removeListener("loaded_media_data",u)}}),[]),n&&n.length?a.createElement(Rt.s,{className:"items-list-hor",items:!e.hideFirst||"video"!==l&&"audio"!==l?n:n.slice(1),pageItems:o.PageStore.get("config-options").pages.media.related.initialSize,singleLinkContent:!0,horizontalItemsOrientation:!0,hideDate:!0,hideViews:!o.PageStore.get("config-media-item").displayViews,hideAuthor:!o.PageStore.get("config-media-item").displayAuthor}):null}function Wt(e){return a.createElement(Rt.s,{className:"items-list-hor",pageItems:9999,maxItems:9999,items:e.items,hideDate:!0,hideViews:!0,hidePlaylistOrderNumber:!1,horizontalItemsOrientation:!0,inPlaylistView:!0,singleLinkContent:!0,playlistActiveItem:e.playlistActiveItem})}function $t(e){return($t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Qt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Yt(e,t){return(Yt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Zt(e,t){return!t||"object"!==$t(t)&&"function"!=typeof t?Gt(e):t}function Gt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Jt(e){return(Jt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Ht.propTypes={hideFirst:u().bool},Ht.defaultProps={hideFirst:!0},Wt.propTypes={items:u().array.isRequired,playlistActiveItem:m.PositiveIntegerOrZero},Wt.defaultProps={playlistActiveItem:1};var Kt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Yt(e,t)}(u,e);var t,n,r,l,s=(r=u,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Jt(r);if(l){var n=Jt(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Zt(this,e)});function u(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),(t=s.call(this,e)).state={expanded:!0,loopRepeat:o.PlaylistViewStore.get("enabled-loop"),shuffle:o.PlaylistViewStore.get("enabled-shuffle"),savedPlaylist:o.PlaylistViewStore.get("saved-playlist-loop"),title:e.playlistData.title,link:e.playlistData.url,authorName:e.playlistData.user,authorLink:i.LinksContext._currentValue.home+"/user/"+e.playlistData.user,activeItem:e.activeItem,totalMedia:e.playlistData.media_count,items:e.playlistData.playlist_media},t.onHeaderClick=t.onHeaderClick.bind(Gt(t)),t.onLoopClick=t.onLoopClick.bind(Gt(t)),t.onShuffleClick=t.onShuffleClick.bind(Gt(t)),t.onSaveClick=t.onSaveClick.bind(Gt(t)),t.onLoopRepeatUpdate=t.onLoopRepeatUpdate.bind(Gt(t)),t.onShuffleUpdate=t.onShuffleUpdate.bind(Gt(t)),t.onPlaylistSaveUpdate=t.onPlaylistSaveUpdate.bind(Gt(t)),o.PlaylistViewStore.on("loop-repeat-updated",t.onLoopRepeatUpdate),o.PlaylistViewStore.on("shuffle-updated",t.onShuffleUpdate),o.PlaylistViewStore.on("saved-updated",t.onPlaylistSaveUpdate),t}return t=u,(n=[{key:"onHeaderClick",value:function(e){this.setState({expanded:!this.state.expanded})}},{key:"onLoopClick",value:function(){f.PlaylistViewActions.toggleLoop()}},{key:"onShuffleClick",value:function(){f.PlaylistViewActions.toggleShuffle()}},{key:"onSaveClick",value:function(){f.PlaylistViewActions.toggleSave()}},{key:"onShuffleUpdate",value:function(){var e=this;this.setState({shuffle:o.PlaylistViewStore.get("enabled-shuffle")},(function(){e.state.shuffle?f.PageActions.addNotification("Playlist shuffle is on","shuffle-on"):f.PageActions.addNotification("Playlist shuffle is off","shuffle-off")}))}},{key:"onLoopRepeatUpdate",value:function(){var e=this;this.setState({loopRepeat:o.PlaylistViewStore.get("enabled-loop")},(function(){e.state.loopRepeat?f.PageActions.addNotification("Playlist loop is on","loop-on"):f.PageActions.addNotification("Playlist loop is off","loop-off")}))}},{key:"onPlaylistSaveUpdate",value:function(){var e=this;this.setState({savedPlaylist:o.PlaylistViewStore.get("saved-playlist")},(function(){e.state.savedPlaylist?f.PageActions.addNotification("Added to playlists library","added-to-playlists-lib"):f.PageActions.addNotification("Removed from playlists library","removed-from-playlists-lib")}))}},{key:"render",value:function(){return a.createElement("div",{className:"playlist-view-wrap"},a.createElement("div",{className:"playlist-view"+(this.state.expanded?" playlist-expanded-view":"")},a.createElement("div",{className:"playlist-header"},a.createElement("div",{className:"playlist-title"},a.createElement("a",{href:this.state.link,title:this.state.title},this.state.title)),a.createElement("div",{className:"playlist-meta"},a.createElement("span",null,a.createElement("a",{href:this.state.authorLink,title:this.state.authorName},this.state.authorName)),"  -  ",a.createElement("span",{className:"counter"},this.state.activeItem," / ",this.state.totalMedia)),a.createElement(z.CircleIconButton,{className:"toggle-playlist-view",onClick:this.onHeaderClick},this.state.expanded?a.createElement("i",{className:"material-icons"},"keyboard_arrow_up"):a.createElement("i",{className:"material-icons"},"keyboard_arrow_down"))),this.state.expanded?a.createElement("div",{className:"playlist-actions"},a.createElement(z.CircleIconButton,{className:this.state.loopRepeat?"active":"",onClick:this.onLoopClick,title:"Loop playlist"},a.createElement("i",{className:"material-icons"},"repeat"))):null,this.state.expanded&&this.state.items.length?a.createElement("div",{className:"playlist-media"},a.createElement(Wt,{items:this.state.items,playlistActiveItem:this.state.activeItem})):null))}}])&&Qt(t.prototype,n),u}(a.PureComponent);function Xt(e){return(Xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function en(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function tn(e,t){return(tn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function nn(e,t){return!t||"object"!==Xt(t)&&"function"!=typeof t?rn(e):t}function rn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function an(e){return(an=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Kt.propTypes={playlistData:u().object.isRequired,activeItem:m.PositiveIntegerOrZero},Kt.defaultProps={};var on=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&tn(e,t)}(s,e);var t,n,r,i,l=(r=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=an(r);if(i){var n=an(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return nn(this,e)});function s(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=l.call(this,e)).state={playlistData:e.playlistData,isPlaylistPage:!!e.playlistData,activeItem:0,mediaType:o.MediaPageStore.get("media-type")},e.playlistData)for(var n=0;n<e.playlistData.playlist_media.length;){if(e.mediaId===e.playlistData.playlist_media[n].friendly_token){t.state.activeItem=n+1;break}n+=1}return t.onMediaLoad=t.onMediaLoad.bind(rn(t)),t}return t=s,(n=[{key:"componentDidMount",value:function(){o.MediaPageStore.on("loaded_media_data",this.onMediaLoad)}},{key:"onMediaLoad",value:function(){this.setState({mediaType:o.MediaPageStore.get("media-type")})}},{key:"render",value:function(){return a.createElement("div",{className:"viewer-sidebar"},this.state.isPlaylistPage?a.createElement(Kt,{activeItem:this.state.activeItem,playlistData:this.props.playlistData}):"video"===this.state.mediaType||"audio"===this.state.mediaType?a.createElement(Ft,null):null,a.createElement(Ht,{hideFirst:!this.state.isPlaylistPage}))}}])&&en(t.prototype,n),s}(a.PureComponent);function ln(e){return(ln="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function sn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function un(e,t){return(un=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function cn(e,t){return!t||"object"!==ln(t)&&"function"!=typeof t?dn(e):t}function dn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mn(e){return(mn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var fn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&un(e,t)}(s,e);var t,n,r,i,l=(r=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=mn(r);if(i){var n=mn(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return cn(this,e)});function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=l.call(this,e,"media")).state={wideLayout:1216<=window.innerWidth,mediaLoaded:!1,mediaLoadFailed:!1,isVideoMedia:!1,theaterMode:!1,pagePlaylistLoaded:!1,pagePlaylistData:o.MediaPageStore.get("playlist-data")},t.onWindowResize=t.onWindowResize.bind(dn(t)),t.onMediaLoad=t.onMediaLoad.bind(dn(t)),t.onMediaLoadError=t.onMediaLoadError.bind(dn(t)),t.onPagePlaylistLoad=t.onPagePlaylistLoad.bind(dn(t)),o.MediaPageStore.on("loaded_media_data",t.onMediaLoad),o.MediaPageStore.on("loaded_media_error",t.onMediaLoadError),o.MediaPageStore.on("loaded_page_playlist_data",t.onPagePlaylistLoad),t}return t=s,(n=[{key:"componentDidMount",value:function(){f.MediaPageActions.loadMediaData(),o.PageStore.on("window_resize",this.onWindowResize)}},{key:"onWindowResize",value:function(){this.setState({wideLayout:1216<=window.innerWidth})}},{key:"onPagePlaylistLoad",value:function(){this.setState({pagePlaylistLoaded:!0,pagePlaylistData:o.MediaPageStore.get("playlist-data")})}},{key:"onMediaLoad",value:function(){var e="video"===o.MediaPageStore.get("media-type");e?(this.onViewerModeChange=this.onViewerModeChange.bind(this),o.VideoViewerStore.on("changed_viewer_mode",this.onViewerModeChange),this.setState({mediaLoaded:!0,isVideoMedia:e,theaterMode:o.VideoViewerStore.get("in-theater-mode")})):this.setState({mediaLoaded:!0,isVideoMedia:e})}},{key:"onViewerModeChange",value:function(){this.setState({theaterMode:o.VideoViewerStore.get("in-theater-mode")})}},{key:"onMediaLoadError",value:function(e){this.setState({mediaLoadFailed:!0})}},{key:"pageContent",value:function(){var e="cf viewer-section"+(this.state.theaterMode?" theater-mode":" viewer-wide"),t="viewer-section-nested"+(this.state.theaterMode?" viewer-section":"");return this.state.mediaLoadFailed?a.createElement("div",{className:e},a.createElement(jt,null)):a.createElement("div",{className:e},[a.createElement("div",{className:"viewer-container",key:"viewer-container"},this.state.mediaLoaded&&this.state.pagePlaylistLoaded?this.viewerContainerContent(o.MediaPageStore.get("media-data")):null),a.createElement("div",{key:"viewer-section-nested",className:t},!this.state.wideLayout||this.state.isVideoMedia&&this.state.theaterMode?[a.createElement(Nt,{key:"viewer-info"}),this.state.pagePlaylistLoaded?a.createElement(on,{key:"viewer-sidebar",mediaId:o.MediaPageStore.get("media-id"),playlistData:o.MediaPageStore.get("playlist-data")}):null]:[this.state.pagePlaylistLoaded?a.createElement(on,{key:"viewer-sidebar",mediaId:o.MediaPageStore.get("media-id"),playlistData:o.MediaPageStore.get("playlist-data")}):null,a.createElement(Nt,{key:"viewer-info"})])])}}])&&sn(t.prototype,n),s}(n(58204).T);function pn(e){return(pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function yn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function gn(e,t){return(gn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function vn(e,t){return!t||"object"!==pn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function bn(e){return(bn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}if(window.MediaCMS.site.devEnv){var Sn=function(){var e=null,t=null,n=window.location.search.split("?")[1];return n&&n.split("&").forEach((function(n){0===n.indexOf("m=")?e=n.split("m=")[1]:0===n.indexOf("pl=")&&(t=n.split("pl=")[1])})),{mediaId:e,playlistId:t}}(),wn=Sn.mediaId,En=Sn.playlistId;wn&&(window.MediaCMS.mediaId=wn),En&&(window.MediaCMS.playlistId=En)}var Pn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&gn(e,t)}(c,e);var t,n,r,s,u=(r=c,s=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=bn(r);if(s){var n=bn(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return vn(this,e)});function c(){return yn(this,c),u.apply(this,arguments)}return t=c,(n=[{key:"viewerContainerContent",value:function(e){switch(o.MediaPageStore.get("media-type")){case"video":return a.createElement(i.SiteConsumer,null,(function(t){return a.createElement(D,{data:e,siteUrl:t.url,inEmbed:!1})}));case"audio":return a.createElement(P,null);case"image":return a.createElement(M,null);case"pdf":var t=(0,m.formatInnerLink)(o.MediaPageStore.get("media-original-url"),i.SiteContext._currentValue.url);return a.createElement(C,{fileUrl:t})}return a.createElement(l,null)}}])&&hn(t.prototype,n),c}(fn);(0,r.X)("page-media",Pn)},84234:function(e,t,n){"use strict";n.d(t,{CircleIconButton:function(){return r.M},MaterialIcon:function(){return a.O},NavigationContentApp:function(){return i.o},NavigationMenuList:function(){return o.S},Notifications:function(){return l.T},NumericInputWithUnit:function(){return s.O},PopupMain:function(){return u.W8},PopupTop:function(){return u.HF},SpinnerLoader:function(){return c.i},UserThumbnail:function(){return d.q}});var r=n(17714),a=(n(47446),n(2915),n(2299)),i=n(72917),o=n(5671),l=n(72436),s=n(15517),u=n(60940),c=n(26309),d=n(86142)},72436:function(e,t,n){"use strict";n.d(t,{T:function(){return d}}),n(92070),n(11646),n(52004),n(28407),n(56394),n(38288),n(55677),n(92129),n(24655),n(20288),n(54458),n(23675);var r=n(35466),a=n(7959);function i(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||l(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||l(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var u=[];function c(e){var t=o((0,r.useState)(!1),2),n=t[0],a=t[1],i=o((0,r.useState)(!0),2),l=i[0],s=i[1],u=null,c=null;return(0,r.useEffect)((function(){return u=setTimeout((function(){c=setTimeout((function(){s(!1),c=null}),1e3),u=null,a(!0),e.onHide(e.id)}),5e3),function(){u&&clearTimeout(u),c&&clearTimeout(c)}}),[]),l?r.createElement("div",{className:"notification-item"+(n?" hidden":"")},r.createElement("div",null,e.children||null)):null}function d(){var e,t,n,l=o((0,r.useState)(u.length),2),s=l[0],d=l[1];function m(){d(a.default.get("notifications-size")+u.length)}function f(e){var t=[];u.map((function(n){n[0]!==e&&t.push(n)})),u=t}return(0,r.useEffect)((function(){return m(),a.default.on("added_notification",m),function(){return a.default.removeListener("added_notification",m)}}),[]),s?r.createElement("div",{className:"notifications"},r.createElement("div",null,(e=a.default.get("notifications"),t=u.map((function(e){return r.createElement(c,{key:e[0],id:e[0],onHide:f},e[1])})),n=e.map((function(e){return u.push(e),r.createElement(c,{key:e[0],id:e[0],onHide:f},e[1])})),[].concat(i(t),i(n))))," "):null}},15517:function(e,t,n){"use strict";n.d(t,{O:function(){return s}}),n(52004),n(28407),n(56394),n(38288),n(55677),n(92129),n(24655),n(20288),n(54458),n(23675);var r=n(35466),a=n(3074),i=n.n(a);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s(e){var t=(0,r.useRef)(null),n=(0,r.useRef)(null),a=o((0,r.useState)(null),2),i=a[0],l=a[1],s=o((0,r.useState)(null),2),u=s[0],c=s[1];return(0,r.useEffect)((function(){l(function(e,t,n){if(void 0!==e){var r;return r=void 0!==t&&t>e?t:e,void 0!==n&&n<r?n:r}return void 0!==t?t:void 0!==n?n:void 0}(0+e.defaultValue,e.minValue,e.maxValue)),c(function(e,t){if(!t||!t.length)return null;for(var n=0;n<t.length;){if(void 0!==t[n].key&&e===t[n].key)return t[n].key;n+=1}return t[0].key}(e.defaultUnit,e.units))})),r.createElement("div",{className:"num-value-unit"},void 0!==e.label?r.createElement("span",{className:"label"},e.label):null,r.createElement("input",{ref:t,className:"value-input",type:"number",value:null!==i?i:"",min:void 0!==e.minValue?e.minValue:null,max:void 0!==e.maxValue?e.maxValue:null,onChange:function(){l(t.current.value),void 0!==e.valueCallback&&e.valueCallback(t.current.value)}}),r.createElement("select",{ref:n,className:"value-unit",onChange:function(){c(n.current.value),void 0!==e.unitCallback&&e.unitCallback(n.current.value)},value:null!==u?u:""},function(){if(!e.units.length)return null;for(var t=[],n=0;n<e.units.length;)void 0!==e.units[n].key&&t.push(r.createElement("option",{key:e.units[n].key,value:e.units[n].key},void 0!==e.units[n].label?e.units[n].label:e.units[n].key)),n+=1;return t}()))}s.propTypes={label:i().string,units:i().array.isRequired,defaultUnit:i().string,defaultValue:i().number,minValue:i().number,maxValue:i().number,valueCallback:i().func,unitCallback:i().func}},26309:function(e,t,n){"use strict";n.d(t,{i:function(){return o}});var r=n(35466),a=n(3074),i=n.n(a);function o(e){var t="spinner-loader";switch(e.size){case"tiny":case"x-small":case"small":case"large":case"x-large":t+=" "+e.size}return r.createElement("div",{className:t},r.createElement("svg",{className:"circular",viewBox:"25 25 50 50"},r.createElement("circle",{className:"path",cx:"50",cy:"50",r:"20",fill:"none",strokeWidth:"1.5",strokeMiterlimit:"10"})))}o.propTypes={size:i().oneOf(["tiny","x-small","small","medium","large","x-large"])},o.defaultProps={size:"medium"}},86142:function(e,t,n){"use strict";n.d(t,{q:function(){return u}});var r=n(35466),a=n(3074),i=n.n(a),o=n(49747),l=n(17714),s=n(2299);function u(e){var t=(0,o.useUser)().thumbnail,n={"aria-label":"Account profile photo that opens list of options and settings pages links",className:"thumbnail"};switch(e.isButton?void 0!==e.onClick&&(n.onClick=e.onClick):n.type="span",e.size){case"small":case"large":n.className+=" "+e.size+"-thumb"}return r.createElement(l.M,n,t?r.createElement("img",{src:t,alt:""}):r.createElement(s.O,{type:"person"}))}u.propTypes={isButton:i().bool,size:i().oneOf(["small","medium","large"]),onClick:i().func},u.defaultProps={isButton:!1,size:"medium"}},36191:function(e,t,n){"use strict";n.d(t,{PageHeader:function(){return r.m},PageMain:function(){return a.r},PageSidebar:function(){return i.$}});var r=n(56006),a=n(29198),i=n(22947);n(41542)},88727:function(e,t,n){"use strict";n.d(t,{hJ:function(){return c},Y7:function(){return d}}),n(62322),n(93296),n(56394),n(64669),n(30717),n(55677),n(92129),n(24655),n(76453),n(79006);var r=n(35466),a=n(3074),i=n.n(a),o=n(50137),l=n.n(o),s=n(18009),u=n.n(s);function c(e){return r.createElement("div",{className:"error-container"},r.createElement("div",{className:"error-container-inner"},r.createElement("span",{className:"icon-wrap"},r.createElement("i",{className:"material-icons"},"error_outline")),r.createElement("span",{className:"msg-wrap"},e.errorMessage)))}function d(e){var t=(0,r.useRef)(null),n=null,a={playerVolume:e.playerVolume,playerSoundMuted:e.playerSoundMuted,videoQuality:e.videoQuality,videoPlaybackSpeed:e.videoPlaybackSpeed,inTheaterMode:e.inTheaterMode};function i(){void 0!==e.onClickNextCallback&&e.onClickNextCallback()}function o(){void 0!==e.onClickPreviousCallback&&e.onClickPreviousCallback()}function s(t){a.playerVolume!==t.volume&&(a.playerVolume=t.volume),a.playerSoundMuted!==t.soundMuted&&(a.playerSoundMuted=t.soundMuted),a.videoQuality!==t.quality&&(a.videoQuality=t.quality),a.videoPlaybackSpeed!==t.playbackSpeed&&(a.videoPlaybackSpeed=t.playbackSpeed),a.inTheaterMode!==t.theaterMode&&(a.inTheaterMode=t.theaterMode),void 0!==e.onStateUpdateCallback&&e.onStateUpdateCallback(t)}function c(){if(null===n&&null===e.errorMessage&&(e.inEmbed||(window.removeEventListener("focus",c),document.removeEventListener("visibilitychange",c)),t.current)){e.inEmbed||t.current.focus();var r,d,m,f={on:!1};if(void 0!==e.subtitlesInfo&&null!==e.subtitlesInfo&&e.subtitlesInfo.length){f.languages=[];for(var p=0;p<e.subtitlesInfo.length;)void 0!==e.subtitlesInfo[p].src&&void 0!==e.subtitlesInfo[p].srclang&&void 0!==e.subtitlesInfo[p].label&&f.languages.push({src:(r=e.subtitlesInfo[p].src,d=e.siteUrl,m=void 0,m=l()(r,{}),""!==m.origin&&"null"!==m.origin&&m.origin||(m=l()(d+"/"+r.replace(/^\//g,""),{})),m.toString()),srclang:e.subtitlesInfo[p].srclang,label:e.subtitlesInfo[p].label}),p+=1;f.languages.length&&(f.on=!0)}n=new(u())(t.current,{enabledTouchControls:!0,sources:e.sources,poster:e.poster,autoplay:e.enableAutoplay,bigPlayButton:!0,controlBar:{theaterMode:e.hasTheaterMode,pictureInPicture:!1,next:!!e.hasNextLink,previous:!!e.hasPreviousLink},subtitles:f,cornerLayers:e.cornerLayers,videoPreviewThumb:e.previewSprite},{volume:a.playerVolume,soundMuted:a.playerSoundMuted,theaterMode:a.inTheaterMode,theSelectedQuality:void 0,theSelectedPlaybackSpeed:a.videoPlaybackSpeed||1},e.info,[.25,.5,.75,1,1.25,1.5,1.75,2],s,i,o),void 0!==e.onPlayerInitCallback&&e.onPlayerInitCallback(n,t.current)}}return a.playerVolume=null===a.playerVolume?1:Math.max(Math.min(Number(a.playerVolume),1),0),a.playerSoundMuted=null!==a.playerSoundMuted&&a.playerSoundMuted,a.videoQuality=null!==a.videoQuality?a.videoQuality:"Auto",a.videoPlaybackSpeed=null!==a.videoPlaybackSpeed&&a.videoPlaybackSpeed,a.inTheaterMode=null!==a.inTheaterMode&&a.inTheaterMode,(0,r.useEffect)((function(){return e.inEmbed||document.hasFocus()||"visible"===document.visibilityState?c():(window.addEventListener("focus",c),document.addEventListener("visibilitychange",c)),n&&n.player.one("loadedmetadata",(function(){var e=new URLSearchParams(window.location.search),t=Number(e.get("t")),r=isNaN(t)?0:t;n.player.currentTime(r)})),function(){null!==n&&(videojs(t.current).dispose(),n=null),void 0!==e.onUnmountCallback&&e.onUnmountCallback()}}),[]),null===e.errorMessage?r.createElement("video",{ref:t,className:"video-js vjs-mediacms native-dimensions"}):r.createElement("div",{className:"error-container"},r.createElement("div",{className:"error-container-inner"},r.createElement("span",{className:"icon-wrap"},r.createElement("i",{className:"material-icons"},"error_outline")),r.createElement("span",{className:"msg-wrap"},e.errorMessage)))}c.propTypes={errorMessage:i().string.isRequired},d.propTypes={playerVolume:i().string,playerSoundMuted:i().bool,videoQuality:i().string,videoPlaybackSpeed:i().number,inTheaterMode:i().bool,siteId:i().string.isRequired,siteUrl:i().string.isRequired,errorMessage:i().string,cornerLayers:i().object,subtitlesInfo:i().array.isRequired,inEmbed:i().bool.isRequired,sources:i().array.isRequired,info:i().object.isRequired,enableAutoplay:i().bool.isRequired,hasTheaterMode:i().bool.isRequired,hasNextLink:i().bool.isRequired,hasPreviousLink:i().bool.isRequired,poster:i().string,previewSprite:i().object,onClickPreviousCallback:i().func,onClickNextCallback:i().func,onPlayerInitCallback:i().func,onStateUpdateCallback:i().func,onUnmountCallback:i().func},d.defaultProps={errorMessage:null,cornerLayers:{}}},70160:function(e,t,n){"use strict";n.d(t,{R:function(){return h}}),n(62322),n(49268),n(99751),n(52004),n(28407),n(56394),n(38288),n(55677),n(92129),n(24655),n(20288),n(54458),n(23675);var r=n(35466),a=n(3074),i=n.n(a),o=n(50137),l=n.n(o),s=n(43613),u=n(80473),c=n(9722),d=n(89905),m=n(88727),f=n(1283);function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function h(e){var t=(0,r.useContext)(s.ApiUrlContext),n=(0,r.useContext)(s.SiteContext),a=p((0,r.useState)(null),2),i=(a[0],a[1]),o=p((0,r.useState)(null),2),y=o[0],h=o[1],g=p((0,r.useState)(null),2),v=g[0],b=g[1],S=p((0,r.useState)([]),2),w=S[0],E=S[1],P=p((0,r.useState)({}),2),k=P[0],M=P[1],_=p((0,r.useState)([]),2),A=_[0],C=_[1],N=p((0,r.useState)({}),2),x=N[0],O=N[1],I={videoQuality:new c.BrowserCache(n.id,86400).get("video-quality")};I.videoQuality=null!==I.videoQuality?I.videoQuality:"Auto";var T,V=null,L=null,j=null,R=((T=new(l())(e.pageLink).query)?((T=T.substring(1)).split("&"),T=T.length?T.split("="):[]):T=[],T);if(R.length)for(var D=0;D<R.length;)"m"===R[D]&&(j=R[D+1]),D+=2;function U(e){if(void 0!==e&&e&&void 0!==e.data&&e.data){var t,r;L=e.data;var a=[],o=null,l=(0,d.RA)(L.encodings_info,L.hls_info),s=null,c=null;if("string"==typeof L.poster_url?o=(0,u.formatInnerLink)(L.poster_url,n.url):"string"==typeof L.thumbnail_url&&(o=(0,u.formatInnerLink)(L.thumbnail_url,n.url)),Object.keys(l).length){var m=(0,d.KC)(),p=I.videoQuality;(null===p||"Auto"===p&&void 0===l.Auto)&&(p=720);var y=(0,d.$e)(p,l);for("Auto"===p&&void 0!==l.Auto&&a.push({src:l.Auto.url[0]}),r=0;r<l[y].format.length;){if("hls"===l[y].format[r]){a.push({src:l[y].url[r]});break}r+=1}for(r in L.encodings_info[y])L.encodings_info[y].hasOwnProperty(r)&&m.support[r]&&(t=L.encodings_info[y][r].url)&&(t=(0,u.formatInnerLink)(t,n.url),a.push({src:t,encodings_status:L.encodings_info[y][r].status}))}else l=null;if(1===a.length&&"running"===a[0].encodings_status&&(s="encodingRunning",c="Media encoding is currently running. Try again in few minutes."),null!==s)switch(s){case"encodingRunning":case"encodingPending":case"encodingFailed":break;default:f.warn("VIDEO DEBUG:","Video files don't exist")}i(s),h(c),b(o),E(a),M(l),C(L.subtitles_info),O(L.sprites_url?{url:(0,u.formatInnerLink)(L.sprites_url,n.url),frame:{width:160,height:90,seconds:10}}:null);var g=document.querySelector(".feat-first-item .item .item-description > div");g&&(g.innerHTML=L.summary)}}function B(e){if(void 0!==e&&void 0!==e.type)switch(e.type){case"network":case"private":case"unavailable":i(e.type),h(void 0!==e.message?e.message:"Αn error occurred while loading the media's data")}}return null!==j&&(V=t.media+"/"+j),(0,r.useEffect)((function(){null!==V&&(0,u.getRequest)(V,!1,U,B)}),[]),w.length?r.createElement("div",{className:"video-player"},r.createElement(m.Y7,{siteId:n.id,siteUrl:n.url,info:k,sources:w,poster:v,previewSprite:x,subtitlesInfo:A,enableAutoplay:!1,inEmbed:!1,hasTheaterMode:!1,hasNextLink:!1,hasPreviousLink:!1,errorMessage:y})):null}h.propTypes={pageLink:i().string.isRequired}},58204:function(e,t,n){"use strict";n.d(t,{T:function(){return m}}),n(25101),n(13080),n(52004),n(28407),n(56394),n(38288),n(55677),n(92129),n(24655);var r=n(35466),a=n(20541),i=n(36191),o=n(84234);function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var m=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(p,e);var t,n,l,m,f=(l=p,m=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=d(l);if(m){var n=d(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return c(this,e)});function p(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,p),n=f.call(this,e),void 0!==t&&a.PageActions.initPage(t),n}return t=p,(n=[{key:"render",value:function(){return r.createElement(r.Fragment,null,r.createElement(i.PageMain,null,this.pageContent()),r.createElement(o.Notifications,null))}}])&&s(t.prototype,n),p}(r.PureComponent)},82083:function(e,t,n){var r=n(64835).Dispatcher;e.exports=new r},91450:function(e,t,n){"use strict";function r(){var e,t,n,r=null;if(document.cookie&&""!==document.cookie)for(t=document.cookie.split(";"),e=0;e<t.length;){if("csrftoken="===(n=t[e].trim()).substring(0,10)){r=decodeURIComponent(n.substring(10));break}e+=1}return r}n.d(t,{o:function(){return r}}),n(62322),n(49268),n(13233)},39039:function(e,t,n){"use strict";n.d(t,{O:function(){return o},a:function(){return l}}),n(11646),n(20288),n(52004),n(28407),n(56394),n(38288),n(55677),n(92129),n(24655),n(23675),n(54458);var r=n(24646);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function i(e,t,n){var r,i;switch(n){case TypeError:case RangeError:case SyntaxError:case ReferenceError:r=new n(t[0]);break;default:r=new Error(t[0])}return e.apply(void 0,[r.message].concat(function(e){if(Array.isArray(e))return a(e)}(i=t.slice(1))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(i)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())),r}function o(e,t){return i(r.v,e,t)}function l(e,t){return i(r.Z,e,t)}},89264:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(82083);function a(e,t){return r.register(e[t].bind(e)),e}},51397:function(e,t,n){"use strict";n.d(t,{U:function(){return i}}),n(62322),n(93296),n(56394),n(64669);var r=n(50137),a=n.n(r);function i(e,t){var n=a()(e,{});return""!==n.origin&&"null"!==n.origin&&n.origin||(n=a()(t+"/"+e.replace(/^\//g,""),{})),n.toString()}},20705:function(e,t,n){"use strict";function r(e,t){function n(e,t,n){return Number(parseFloat(e/t).toFixed(e<10*t?1:0))+n}return t?e.toLocaleString():function(e,t,r,a,i,o){for(;t>=a;)i*=r,a*=r,e+=1;return e<o.length?n(t,i,o[e]):n(t*(r*(e-(o.length-1))),i,o[o.length-1])}(0,e,1e3,1e3,1,["","K","M","B","T"])}n.d(t,{Z:function(){return r}}),n(30717),n(56660)},12161:function(e,t,n){"use strict";n.d(t,{s:function(){return r}}),n(62322),n(49268);var r=function(e){if(e){var t=e.split(".");return t[t.length-1]}}},24646:function(e,t,n){"use strict";n.d(t,{Z:function(){return l},v:function(){return s}}),n(20288),n(11646),n(52004),n(28407),n(56394),n(38288),n(55677),n(92129),n(24655),n(23675),n(54458);var r=n(1283);function a(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var o=function(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return(e=r)[n[0]].apply(e,a(n.slice(1)))},l=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return o.apply(void 0,["warn"].concat(t))},s=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return o.apply(void 0,["error"].concat(t))}},65477:function(e,t,n){"use strict";n.d(t,{g:function(){return o},n:function(){return l}}),n(52004),n(28407),n(56394),n(38288),n(55677),n(92129),n(24655);var r=n(39039),a=n(50408);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=function(e,t,n){return void 0===e[t]||(0,a.ZU)(e[t])?null:(0,r.O)(["Invalid prop `"+t+"` of type `"+i(e[t])+"` supplied to `"+(n||"N/A")+"`, expected `positive integer or zero` ("+e[t]+")."])},l=function(e,t,n){return void 0===e[t]||(0,a.aP)(e[t])?null:(0,r.O)(["Invalid prop `"+t+"` of type `"+i(e[t])+"` supplied to `"+(n||"N/A")+"`, expected `positive integer` ("+e[t]+")."])}},41024:function(e,t,n){"use strict";function r(e){for(var t in window.REPLACEMENTS)e=e.replace(t,window.REPLACEMENTS[t]);return e}n.d(t,{G:function(){return r}}),n(62322),n(93296)},40447:function(e,t,n){"use strict";n.d(t,{A_:function(){return l},j0:function(){return u},GH:function(){return d},Jl:function(){return f}}),n(77588),n(56394),n(25334);var r=n(24559),a=n.n(r);function i(e,t,n,r,a,i,o){try{var l=e[i](o),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,a)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function l(e){i(o,r,a,l,s,"next",e)}function s(e){i(o,r,a,l,s,"throw",e)}l(void 0)}))}}function l(e,t,n,r){return s.apply(this,arguments)}function s(){return(s=o(regeneratorRuntime.mark((function e(t,n,a,i){var o,l,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=function(e){if(i instanceof Function){var t=e;if(void 0===e.response)t={type:"network",error:e};else if(void 0!==e.response.status)switch(e.response.status){case 401:t={type:"private",error:e,message:"Media is private"};break;case 400:t={type:"unavailable",error:e,message:"Media is unavailable"}}i(t)}},l=function(e){a instanceof Function&&a(e)},o={timeout:null,maxContentLength:null},!n){e.next=8;break}return e.next=6,(0,r.get)(t,o).then(l).catch(s||null);case 6:e.next=9;break;case 8:(0,r.get)(t,o).then(l).catch(s||null);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function u(e,t,n,r,a,i){return c.apply(this,arguments)}function c(){return(c=o(regeneratorRuntime.mark((function e(t,n,a,i,o,l){var s,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=function(e){l instanceof Function&&l(e)},s=function(e){o instanceof Function&&o(e)},n=n||{},!i){e.next=8;break}return e.next=6,(0,r.post)(t,n,a||null).then(s).catch(u||null);case 6:e.next=9;break;case 8:(0,r.post)(t,n,a||null).then(s).catch(u||null);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function d(e,t,n,r,a,i){return m.apply(this,arguments)}function m(){return(m=o(regeneratorRuntime.mark((function e(t,n,a,i,o,l){var s,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=function(e){l instanceof Function&&l(e)},s=function(e){o instanceof Function&&o(e)},n=n||{},!i){e.next=8;break}return e.next=6,(0,r.put)(t,n,a||null).then(s).catch(u||null);case 6:e.next=9;break;case 8:(0,r.put)(t,n,a||null).then(s).catch(u||null);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function f(e,t,n,r,a){return p.apply(this,arguments)}function p(){return(p=o(regeneratorRuntime.mark((function e(t,n,r,i,o){var l,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=function(e){o instanceof Function&&o(e)},l=function(e){i instanceof Function&&i(e)},n=n||{},!r){e.next=8;break}return e.next=6,a().delete(t,n||null).then(l).catch(s||null);case 6:e.next=9;break;case 8:a().delete(t,n||null).then(l).catch(s||null);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},7959:function(e,t,n){"use strict";n.r(t),n(55677),n(56394),n(60506),n(53224),n(50597),n(43543),n(35210),n(95785),n(30091),n(29595),n(23357),n(91816),n(2161),n(47445),n(84875),n(71608),n(72994),n(284),n(30601),n(39494),n(66229),n(19149),n(79503),n(9617),n(91962),n(8097),n(62322),n(93296),n(64669),n(67441),n(92070),n(23675),n(92129),n(49268),n(52004),n(28407),n(38288),n(24655),n(20288),n(54458),n(25101),n(13080);var r,a=n(41590),i=n.n(a),o=n(9722),l=n(80473),s=n(39479);function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t){return!t||"object"!==u(t)&&"function"!=typeof t?f(e):t}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var h=null,g=null,v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(v,e);var t,n,a,i,u=(a=v,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=p(a);if(i){var n=p(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return m(this,e)});function v(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,v),t=u.call(this),g=(0,s.v)(window.MediaCMS),r=new o.BrowserCache(g.site.id,86400),(h={mediaAutoPlay:r.get("media-auto-play")}).mediaAutoPlay=null===h.mediaAutoPlay||h.mediaAutoPlay,t.browserEvents=(0,l.BrowserEvents)(),t.browserEvents.doc(t.onDocumentVisibilityChange.bind(f(t))),t.browserEvents.win(t.onWindowResize.bind(f(t)),t.onWindowScroll.bind(f(t))),t.notifications=function(e){var t=[];function n(e){var n;"string"==typeof e&&t.push([(n=new Uint32Array(3),window.crypto.getRandomValues(n),(performance.now().toString(36)+Array.from(n).map((function(e){return e.toString(36)})).join("")).replace(/./g,""+Math.random()+Intl.DateTimeFormat().resolvedOptions().timeZone+Date.now())),e])}return e.map(n),{size:function(){return t.length},push:n,clear:function(){t=[]},messages:function(){return function(e){if(Array.isArray(e))return y(e)}(e=t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();var e}}}(void 0!==window.MediaCMS&&void 0!==window.MediaCMS.notifications?window.MediaCMS.notifications:[]),t}return t=v,(n=[{key:"onDocumentVisibilityChange",value:function(){this.emit("document_visibility_change")}},{key:"onWindowScroll",value:function(){this.emit("window_scroll")}},{key:"onWindowResize",value:function(){this.emit("window_resize")}},{key:"initPage",value:function(e){h.currentPage=e}},{key:"get",value:function(e){var t,n;switch(e){case"browser-cache":t=r;break;case"media-auto-play":t=h.mediaAutoPlay;break;case"config-contents":t=g.contents;break;case"config-enabled":t=g.enabled;break;case"config-media-item":t=g.media.item;break;case"config-options":t=g.options;break;case"config-site":t=g.site;break;case"api-playlists":n=e.split("-")[1],t=g.api[n]||null;break;case"notifications-size":t=this.notifications.size();break;case"notifications":t=this.notifications.messages(),this.notifications.clear();break;case"current-page":t=h.currentPage}return t}},{key:"actions_handler",value:function(e){switch(e.type){case"INIT_PAGE":this.initPage(e.page),this.emit("page_init");break;case"TOGGLE_AUTO_PLAY":h.mediaAutoPlay=!h.mediaAutoPlay,r.set("media-auto-play",h.mediaAutoPlay),this.emit("switched_media_auto_play");break;case"ADD_NOTIFICATION":this.notifications.push(e.notification),this.emit("added_notification")}}}])&&c(t.prototype,n),v}(i());t.default=(0,l.exportStore)(new v,"actions_handler")},20541:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return a(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.VideoViewerActions=t.SearchFieldActions=t.ProfilePageActions=t.PlaylistViewActions=t.PlaylistPageActions=t.PageActions=t.MediaPageActions=void 0,t.MediaPageActions=i(n(20979)),t.PageActions=i(n(76613)),t.PlaylistPageActions=i(n(75880)),t.PlaylistViewActions=i(n(29660)),t.ProfilePageActions=i(n(22472)),t.SearchFieldActions=i(n(52600)),t.VideoViewerActions=i(n(25464))},98578:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VideoViewerStore=t.SearchFieldStore=t.ProfilePageStore=t.PlaylistViewStore=t.PlaylistPageStore=t.PageStore=t.MediaPageStore=void 0;var a=r(n(70337));t.MediaPageStore=a.default;var i=r(n(7959));t.PageStore=i.default;var o=r(n(71566));t.PlaylistPageStore=o.default;var l=r(n(71439));t.PlaylistViewStore=l.default;var s=r(n(78024));t.ProfilePageStore=s.default;var u=r(n(47359));t.SearchFieldStore=u.default;var c=r(n(45641));t.VideoViewerStore=c.default},93414:function(){},70172:function(){},2001:function(){},33779:function(){},66558:function(){},82258:function(){}},n={};function r(e){var a=n[e];if(void 0!==a)return a.exports;var i=n[e]={exports:{}};return t[e].call(i.exports,i,i.exports,r),i.exports}r.m=t,r.amdO={},e=[],r.O=function(t,n,a,i){if(!n){var o=1/0;for(u=0;u<e.length;u++){n=e[u][0],a=e[u][1],i=e[u][2];for(var l=!0,s=0;s<n.length;s++)(!1&i||o>=i)&&Object.keys(r.O).every((function(e){return r.O[e](n[s])}))?n.splice(s--,1):(l=!1,i<o&&(o=i));l&&(e.splice(u--,1),t=a())}return t}i=i||0;for(var u=e.length;u>0&&e[u-1][2]>i;u--)e[u]=e[u-1];e[u]=[n,a,i]},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.j=411,function(){var e={411:0};r.O.j=function(t){return 0===e[t]};var t=function(t,n){var a,i,o=n[0],l=n[1],s=n[2],u=0;for(a in l)r.o(l,a)&&(r.m[a]=l[a]);if(s)var c=s(r);for(t&&t(n);u<o.length;u++)i=o[u],r.o(e,i)&&e[i]&&e[i][0](),e[o[u]]=0;return r.O(c)},n=self.webpackChunkmediacms_frontend=self.webpackChunkmediacms_frontend||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}();var a=r.O(void 0,[431],(function(){return r(3683)}));a=r.O(a)}();