mediacms/static/js/embed.js

44 wiersze
26 KiB
JavaScript

!function(){var e={5486:function(e,t,n){"use strict";var r=n(9087),i=n(5466);n(2880),n(4426),n(6157),n(6394),n(2322),n(4669),n(9006),n(3233),n(6116),n(1589),n(2331),n(4830),n(2947),n(2836),n(7207);i.PureComponent,n(5101),n(9808);var o={switch:(0,n(4547).v)(window.MediaCMS).theme.switch},a=i.createContext(o),s=(a.Provider,a.Consumer,n(8349));n(6498),n(8680),n(3702),n(8534),n(3562),n(2431);i.PureComponent,n(3074),n(365),n(4030),n(8024),n(2070),n(3296),n(137),n(5024);var l=n(9518),c=n(2276),u=n(3699);function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}(e,t)||function(e,t){if(e){if("string"==typeof e)return f(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)?f(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 f(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(e,t){if(void 0!==t){var n=document.getElementById(e);null!==n&&r.Z.display(n,t,{},e)}}("page-embed",(function(){var e=d((0,i.useState)(!1),2),t=e[0],n=e[1],r=d((0,i.useState)(!1),2),o=r[0],a=r[1];function f(){n(!0)}function p(){a(!0)}return s.df("embed"),(0,i.useEffect)((function(){return c.Z.on("loaded_video_data",f),c.Z.on("loaded_media_error",p),u.loadMediaData(),function(){c.Z.removeListener("loaded_video_data",f),c.Z.removeListener("loaded_media_error",p)}}),[]),i.createElement("div",{className:"embed-wrap"},o?i.createElement("div",{className:"player-container player-container-error"},i.createElement("div",{className:"player-container-inner"},i.createElement("div",{className:"error-container"},i.createElement("div",{className:"error-container-inner"},i.createElement("span",{className:"icon-wrap"},i.createElement("i",{className:"material-icons"},"error_outline")),i.createElement("span",{className:"msg-wrap"},c.Z.get("media-load-error-message")))))):null,t?i.createElement(l.Z,{data:c.Z.get("media-data")}):null)}))},6498:function(e,t,n){"use strict";n.d(t,{n:function(){return o}});var r=n(8416),i=n.n(r);function o(e){i().dispatch({type:"CHANGE_MOBILE_SEARCH_VISIBILITY",visible:e})}},4860:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}}),n(7228),n(9751);var r=n(6228);function i(){var e="test-slug";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}}function o(e,t){return t=parseInt(t,10)||3600,i||console.warn(["Current browser does not support localStorage."]),e?{prefix:e,seconds:t,set:function(n,o,a,s){if(i){(a=a||t)||(s=(0,r.a)(["Invalid cache expiration value",a]));try{localStorage.setItem(e+"["+n+"]",JSON.stringify({value:o,expire:(new Date).getTime()+1e3*a})),s=!0}catch(e){s=(0,r.a)([e])}}return s},get:function(t,n){return null!==(n=(n=i?localStorage.getItem(e+"["+t+"]"):null)?JSON.parse(n):null)?void 0!==n.expire&&n.expire>(new Date).getTime()?n.value:null:n},clear:function(){var t;if(i&&Object.keys(localStorage).length)for(t in localStorage)localStorage.hasOwnProperty(t)&&0===t.indexOf(e)&&localStorage.removeItem(t);return!0}}:(0,r.O)(["Cache object prefix is required"])}},8416:function(e,t,n){var r=n(4835).Dispatcher;e.exports=new r},6146:function(e,t,n){"use strict";n.d(t,{Y:function(){return d}}),n(717);var r=n(5466),i=n(3074),o=n.n(i),a=n(365),s=n(920),l=n.n(s),c=(n(4426),n(4860)),u=n(9688);function d(e){var t=(0,r.useContext)(a.Z),n=(0,r.useRef)(null),i=null,o=new c.Z(t.id,86400),s={playerVolume:o.get("player-volume"),playerSoundMuted:o.get("player-sound-muted"),videoQuality:o.get("video-quality"),videoPlaybackSpeed:o.get("video-playback-speed"),inTheaterMode:o.get("in-theater-mode")};function d(){void 0!==e.onClickNextCallback&&e.onClickNextCallback()}function f(){void 0!==e.onClickPreviousCallback&&e.onClickPreviousCallback()}function p(t){s.playerVolume!==t.volume&&(s.playerVolume=t.volume),s.playerSoundMuted!==t.soundMuted&&(s.playerSoundMuted=t.soundMuted),s.videoQuality!==t.quality&&(s.videoQuality=t.quality),s.videoPlaybackSpeed!==t.playbackSpeed&&(s.videoPlaybackSpeed=t.playbackSpeed),s.inTheaterMode!==t.theaterMode&&(s.inTheaterMode=t.theaterMode),void 0!==e.onStateUpdateCallback&&e.onStateUpdateCallback(t)}function h(){if(null===i&&null===e.errorMessage&&(e.inEmbed||(window.removeEventListener("focus",h),document.removeEventListener("visibilitychange",h)),n.current)){e.inEmbed||n.current.focus();var r={on:!1};if(void 0!==e.subtitlesInfo&&null!==e.subtitlesInfo&&e.subtitlesInfo.length){r.languages=[];for(var o=0;o<e.subtitlesInfo.length;)void 0!==e.subtitlesInfo[o].src&&void 0!==e.subtitlesInfo[o].srclang&&void 0!==e.subtitlesInfo[o].label&&r.languages.push({src:(0,u.U)(e.subtitlesInfo[o].src,t.url),srclang:e.subtitlesInfo[o].srclang,label:e.subtitlesInfo[o].label}),o+=1;r.languages.length&&(r.on=!0)}i=new(l())(n.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:r,cornerLayers:e.cornerLayers,videoPreviewThumb:e.previewSprite},{volume:s.playerVolume,soundMuted:s.playerSoundMuted,theaterMode:s.inTheaterMode,theSelectedQuality:void 0,theSelectedPlaybackSpeed:s.videoPlaybackSpeed||1},e.info,[.25,.5,.75,1,1.25,1.5,1.75,2],p,d,f),void 0!==e.onPlayerInitCallback&&e.onPlayerInitCallback(i,n.current)}}return s.playerVolume=null===s.playerVolume?1:Math.max(Math.min(Number(s.playerVolume),1),0),s.playerSoundMuted=null!==s.playerSoundMuted&&s.playerSoundMuted,s.videoQuality=null!==s.videoQuality?s.videoQuality:"Auto",s.videoPlaybackSpeed=null!==s.videoPlaybackSpeed&&s.videoPlaybackSpeed,s.inTheaterMode=null!==s.inTheaterMode&&s.inTheaterMode,(0,r.useEffect)((function(){return e.inEmbed||document.hasFocus()||"visible"===document.visibilityState?h():(window.addEventListener("focus",h),document.addEventListener("visibilitychange",h)),function(){null!==i&&(videojs(n.current).dispose(),i=null),void 0!==e.onUnmountCallback&&e.onUnmountCallback()}}),[]),null===e.errorMessage?r.createElement("video",{ref:n,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)))}d.propTypes={errorMessage:o().string,cornerLayers:o().object,subtitlesInfo:o().array.isRequired,inEmbed:o().bool.isRequired,sources:o().array.isRequired,info:o().object.isRequired,enableAutoplay:o().bool.isRequired,hasTheaterMode:o().bool.isRequired,hasNextLink:o().bool.isRequired,hasPreviousLink:o().bool.isRequired,poster:o().string,previewSprite:o().object,onClickPreviousCallback:o().func,onClickNextCallback:o().func,onPlayerInitCallback:o().func,onStateUpdateCallback:o().func,onUnmountCallback:o().func},d.defaultProps={errorMessage:null,cornerLayers:{}}},5024:function(e,t,n){"use strict";n.d(t,{E:function(){return s}});var r=n(5466),i=n(4030),o=n(8329);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 s(){var e,t,n=(e=(0,r.useState)(i.Z.get("mode")),t=2,function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}(e,t)||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}}(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.")}()),s=n[0],l=n[1];function c(){l(i.Z.get("mode"))}return(0,r.useEffect)((function(){return i.Z.on("mode-change",c),function(){return i.Z.removeListener("mode-change",c)}}),[]),[s,function(){o.b()}]}},1395:function(e,t,n){"use strict";function r(e,t,n){return e.scrollLeft?1+Math.ceil(e.scrollLeft/t):n}function i(e,t){void 0!==e&&(this.data={dom:{wrapper:e,firstItem:e.querySelector(t)},item:{width:null}},this.data.item.width=this.data.dom.firstItem.offsetWidth,this.state={initedAllStateValues:!1,currentSlide:1,maxSlideIndex:null,slideItemsFit:null,slideItems:null,totalItems:null,wrapper:{width:null,scrollWidth:null}})}n.d(t,{Z:function(){return i}}),i.prototype.updateDataStateOnResize=function(e,t){this.data.item.width=this.data.dom.firstItem.offsetWidth,this.state.wrapper.width=this.data.dom.wrapper.offsetWidth,this.state.wrapper.scrollWidth=this.data.dom.wrapper.scrollWidth,this.state.slideItemsFit=Math.floor(this.state.wrapper.width/this.data.item.width),this.state.slideItems=Math.max(1,this.state.slideItemsFit),t&&this.state.slideItems<=this.state.slideItems&&(this.state.itemsLengthFit=this.state.slideItems),this.state.totalItems=e,this.state.maxSlideIndex=Math.max(this.state.totalItems-this.state.slideItemsFit+1),this.state.currentSlide=Math.min(this.state.currentSlide,this.state.maxSlideIndex||1)},i.prototype.updateDataState=function(e,t,n){!n&&this.state.initedAllStateValues||(this.state.initedAllStateValues=!0,this.state.wrapper.width=this.data.dom.wrapper.offsetWidth,this.state.wrapper.scrollWidth=this.data.dom.wrapper.scrollWidth,this.state.slideItemsFit=Math.floor(this.state.wrapper.width/this.data.item.width),this.state.slideItems=Math.max(1,this.state.slideItemsFit),t&&this.state.slideItems<=this.state.slideItems&&(this.state.itemsLengthFit=this.state.slideItems)),this.state.totalItems=e,this.state.maxSlideIndex=Math.max(1,this.state.totalItems-this.state.slideItemsFit+1),this.state.currentSlide=Math.min(this.state.currentSlide,this.state.maxSlideIndex)},i.prototype.nextSlide=function(){this.state.currentSlide=Math.min(r(this.data.dom.wrapper,this.data.item.width,this.state.currentSlide)+this.state.slideItems,this.state.maxSlideIndex)},i.prototype.previousSlide=function(){this.state.currentSlide=Math.max(1,r(this.data.dom.wrapper,this.data.item.width,this.state.currentSlide)-this.state.slideItems)},i.prototype.scrollToCurrentSlide=function(){this.data.dom.wrapper.scrollLeft=this.data.item.width*(this.state.currentSlide-1)},i.prototype.hasNextSlide=function(){return this.state.currentSlide<this.state.maxSlideIndex},i.prototype.hasPreviousSlide=function(){return 1<this.state.currentSlide},i.prototype.currentSlide=function(){return this.state.currentSlide},i.prototype.loadItemsToFit=function(){return 2*this.state.slideItemsFit>this.state.totalItems},i.prototype.loadMoreItems=function(){return this.state.currentSlide+this.state.slideItemsFit>=this.state.maxSlideIndex},i.prototype.itemsFit=function(){return this.state.slideItemsFit}},792:function(e,t,n){"use strict";n.d(t,{KC:function(){return s},RA:function(){return l},$e:function(){return c}}),n(7228),n(9751),n(2322),n(9268),n(4426);var r=n(365),i=n(9688),o=["hls","h265","vp9","h264","vp8","mp4","theora"];function a(e,t){var n=null,r=document.createElement("video");if(r.canPlayType)try{switch(e){case"hls":n=!0;break;case"h265":n="probably"===r.canPlayType('video/mp4; codecs="hvc1.1.L0.0"')||"probably"===r.canPlayType('video/mp4; codecs="hev1.1.L0.0"');break;case"h264":n="probably"===r.canPlayType('video/mp4; codecs="avc1.42E01E"')||"probably"===r.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"');break;case"vp9":n="probably"===r.canPlayType('video/webm; codecs="vp9"');break;case"vp8":n="probably"===r.canPlayType('video/webm; codecs="vp8, vorbis"');break;case"theora":n="probably"===r.canPlayType('video/ogg; codecs="theora"');break;case"mp4":n=!0}if(t=(t instanceof Boolean||0===t||1==t)&&t){if("no"===r.canPlayType("video/nonsense")&&console.warn('BUGGY: Codec detection bug in Firefox 3.5.0 - 3.5.1 and Safari 4.0.0 - 4.0.4 that answer "no" to unknown codecs instead of an empty string'),"probably"===r.canPlayType("video/webm")&&console.warn('BUGGY: Codec detection bug that Firefox 27 and earlier always says "probably" when asked about WebM, even when the codecs string is not present'),"maybe"===r.canPlayType('video/mp4; codecs="avc1.42E01E"'))switch(r.canPlayType("video/mp4")){case"probably":console.warn('BUGGY: Codec detection bug in iOS 4.1 and earlier that switches "maybe" and "probably" around');break;case"maybe":console.warn('BUGGY: Codec detection bug in Android where no better answer than "maybe" is given')}"probably"===r.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')&&"probably"!==r.canPlayType('video/mp4; codecs="avc1.42E01E"')&&console.warn("BUGGY: Codec detection bug in Internet Explorer 9 that requires both audio and video codec on test")}}catch(e){console.warn(e)}return n}function s(e){var t=[],n={},r=document.createElement("video");return r.canPlayType&&(n.hls=!0,t.push("hls"),(r.canPlayType('video/mp4; codecs="hvc1.1.L0.0"')||"probably"===r.canPlayType('video/mp4; codecs="hev1.1.L0.0"'))&&(n.h265=!0,t.push("h265")),"probably"===r.canPlayType('video/mp4; codecs="avc1.42E01E"')&&(n.h264=!0,t.push("h264")),"probably"===r.canPlayType('video/webm; codecs="vp9"')&&(n.vp9=!0,t.push("vp9")),e&&("probably"===r.canPlayType('video/webm; codecs="vp8, vorbis"')&&(n.vp8=!0,t.push("vp8")),"probably"===r.canPlayType('video/ogg; codecs="theora"')&&(n.theora=!0,t.push("theora"))),"probably"===r.canPlayType('video/mp4; codecs="mp4v.20.8"')&&(n.mp4=!0,t.push("mp4"))),{order:t,support:n}}function l(e,t,n){var l,c,u,d={};n=void 0===n?s():n;var f={hls:["m3u8"],h265:["mp4","webm"],h264:["mp4","webm"],vp9:["mp4","webm"],vp8:["mp4","webm"],theora:["ogg"],mp4:["mp4"]};for(l in t)t.hasOwnProperty(l)&&(c=null,null!==(c="master_file"===l?"Auto":2===(c=l.split("_playlist")).length?c[0]:null)&&(d[c]=void 0===d[c]?{format:[],url:[]}:d[c],d[c].format.push("hls"),d[c].url.push((0,i.U)(t[l],r.Z._currentValue.url))));for(c in e)if(e.hasOwnProperty(c)&&Object.keys(e[c]).length&&(1080>=parseInt(c,10)||1080<window.screen.width&&1080<window.screen.height))for(l=0;l<o.length;)void 0!==e[c][o[l]]&&a(o[l],!1)&&e[c][o[l]]&&e[c][o[l]].url&&(100!==e[c][o[l]].progress&&console.warn("VIDEO DEBUG:","PROGRESS value is",e[c][o[l]].progress),"success"!==e[c][o[l]].status&&console.warn("VIDEO DEBUG:","STATUS value is",e[c][o[l]].status),(u=e[c][o[l]].url.split(".")).length&&0<=f[o[l]].indexOf(u[u.length-1])&&(d[c]=void 0===d[c]?{format:[],url:[]}:d[c],d[c].format.push(o[l]),d[c].url.push((0,i.U)(e[c][o[l]].url,r.Z._currentValue.url)))),l+=1;return d}function c(e,t){var n,r=Object.keys(t);if(void 0!==t[e])return e;if(parseInt(e,10)>=parseInt(r[r.length-1],10))return r[r.length-1];if(parseInt(e,10)<=parseInt(r[0],10))return r[0];for(n=r.length-1;n>=0;){if(parseInt(e,10)>=parseInt(r[n],10))return r[n+1];n-=1}}},365:function(e,t,n){"use strict";var r=n(5466),i=n(4547),o=r.createContext((0,i.v)(window.MediaCMS).site);o.Consumer,t.Z=o},2880:function(e,t,n){"use strict";var r=n(5466),i=n(4547),o=r.createContext((0,i.v)(window.MediaCMS).member);o.Consumer,t.Z=o},8024:function(e,t,n){"use strict";function r(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," ")}function i(e,t){e.classList?e.classList.add(t):e.className+=" "+t}n.d(t,{dt:function(){return r},Ec:function(){return i}}),n(7441),n(7390),n(2322),n(4669),n(3296),n(9268)},3140:function(e,t,n){"use strict";n(2322),n(9268)},9688:function(e,t,n){"use strict";n.d(t,{U:function(){return o}}),n(6394),n(2322),n(4669),n(3296);var r=n(137),i=n.n(r);function o(e,t){var n=i()(e,{});return""!==n.origin&&"null"!==n.origin&&n.origin||(n=i()(t+"/"+e.replace(/^\//g,""),{})),n.toString()}},4135: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,i,o,a){for(;t>=i;)o*=r,i*=r,e+=1;return e<a.length?n(t,o,a[e]):n(t*(r*(e-(a.length-1))),o,a[a.length-1])}(0,e,1e3,1e3,1,["","K","M","B","T"])}n.d(t,{Z:function(){return r}}),n(717),n(6660)},8420:function(e,t,n){"use strict";n.d(t,{A_:function(){return r.Z},j0:function(){return i.Z},GH:function(){return o.Z},Jl:function(){return a.Z},v$:function(){return s.Z},uf:function(){return l.Z},UN:function(){return c.Z},$A:function(){return u.Z},m5:function(){return d.Z},vo:function(){return f.ZP}});var r=n(1712),i=n(9752),o=n(84),a=n(9009),s=n(1438),l=n(4135),c=(n(3140),n(1752),n(7514),n(4582)),u=n(4845),d=(n(1569),n(6203)),f=n(7188)},2186:function(e,t,n){"use strict";function r(e){return function(e){return e===Math.trunc(e)}(e)&&(function(e){return function(e,t){return e>0}(e)}(e)||function(e){return 0===e}(e))}n.d(t,{ZU:function(){return r}}),n(5777)},3699:function(e,t,n){"use strict";n.d(t,{loadMediaData:function(){return o}}),n(2322),n(3296);var r=n(8416),i=n.n(r);function o(){i().dispatch({type:"LOAD_MEDIA_DATA"})}},8349:function(e,t,n){"use strict";n.d(t,{df:function(){return o}});var r=n(8416),i=n.n(r);function o(e){i().dispatch({type:"INIT_PAGE",page:e})}},6157:function(e,t,n){"use strict";n(5101),n(5466);var r,i=n(1590),o=n.n(i),a=n(4860),s=n(8420),l=n(8024),c=n(4547),u=n(4426);function d(e){return(d="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 f(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 p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?m(e):t}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var y=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&&p(e,t)}(d,e);var t,n,i,o,s=(i=d,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=b(i);if(o){var n=b(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return h(this,e)});function d(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d),e=s.call(this);var t=(0,c.v)(window.MediaCMS);return e.cache=new a.Z("MediaCMS["+t.site.id+"][layout]",86400),e.state={enabledSidebar:!(!document.getElementById("app-sidebar")&&!document.querySelector(".page-sidebar")),visibleSidebar:e.cache.get("visible-sidebar"),visibleMobileSearch:!1},"media"===u.Z.get("current-page")?e.state.visibleSidebar=!1:e.state.visibleSidebar=1023<window.innerWidth&&(null===e.state.visibleSidebar||e.state.visibleSidebar),e.state.visibleSidebar?(0,l.Ec)(document.body,"visible-sidebar"):(0,l.dt)(document.body,"visible-sidebar"),u.Z.once("page_init",function(){"media"===u.Z.get("current-page")&&(e.state.visibleSidebar=!1,(0,l.dt)(document.body,"visible-sidebar"))}.bind(m(e))),e}return t=d,(n=[{key:"get",value:function(e){switch(e){case"enabled-sidebar":return this.state.enabledSidebar;case"visible-sidebar":return this.state.visibleSidebar;case"visible-mobile-search":return this.state.visibleMobileSearch;case"container-width":return window.innerWidth;case"container-height":return window.innerHeight}}},{key:"actions_handler",value:function(e){switch(e.type){case"TOGGLE_SIDEBAR":this.state.visibleSidebar=!this.state.visibleSidebar,t=this.state.visibleSidebar,clearTimeout(r),(0,l.Ec)(document.body,"sliding-sidebar"),r=setTimeout((function(){"media"===u.Z.get("current-page")?t?(0,l.Ec)(document.body,"overflow-hidden"):(0,l.dt)(document.body,"overflow-hidden"):!t||767<window.innerWidth?(0,l.dt)(document.body,"overflow-hidden"):(0,l.Ec)(document.body,"overflow-hidden"),t?(0,l.Ec)(document.body,"visible-sidebar"):(0,l.dt)(document.body,"visible-sidebar"),r=setTimeout((function(){r=null,(0,l.dt)(document.body,"sliding-sidebar")}),220)}),20),this.cache.set("visible-sidebar",this.state.visibleSidebar),this.emit("sidebar-visibility-change");break;case"CHANGE_MOBILE_SEARCH_VISIBILITY":this.state.visibleMobileSearch=e.visible,this.emit("mobile-search-visibility-change")}var t}}])&&f(t.prototype,n),d}(o());t.Z=(0,s.v$)(new y,"actions_handler")},4030:function(e,t,n){"use strict";n(5101),n(5466);var r=n(1590),i=n.n(r),o=n(4860),a=n(8420),s=n(8024),l=n(4547),c=n(291);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 d(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 f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e,t){return!t||"object"!==u(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 h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e){"dark"===e?(0,s.Ec)(document.body,"dark_theme"):(0,s.dt)(document.body,"dark_theme")}var b=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&&f(e,t)}(s,e);var t,n,r,i,a=(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=h(r);if(i){var n=h(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return p(this,e)});function s(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),e=a.call(this);var t,n,r,i,u,d=(0,l.v)(window.MediaCMS);return e.cache=new o.Z("MediaCMS["+d.site.id+"][theme]",86400),e.logos=(n=null,r=null,void 0!==(t=d.theme.logo).darkMode&&((0,c.J)()&&void 0!==t.darkMode.svg&&""!==t.darkMode.svg?r=t.darkMode.svg:void 0!==t.darkMode.img&&""!==t.darkMode.img&&(r=t.darkMode.img)),void 0!==t.lightMode&&((0,c.J)()&&void 0!==t.lightMode.svg&&""!==t.lightMode.svg?n=t.lightMode.svg:void 0!==t.lightMode.img&&""!==t.lightMode.img&&(n=t.lightMode.img)),null===n&&null===r||(null===n?n=r:null===r&&(r=n)),{light:n,dark:r}),e.state={mode:(i=e.cache.get("mode"),u=d.theme.mode,"light"===i||"dark"===i?i:u)},m(e.state.mode),e}return t=s,(n=[{key:"get",value:function(e){switch(e){case"logo":return this.logos[this.state.mode];case"mode":return this.state.mode}}},{key:"actions_handler",value:function(e){switch(e.type){case"TOGGLE_MODE":this.state.mode="light"===this.state.mode?"dark":"light",m(this.state.mode),this.cache.set("mode",this.state.mode),this.emit("mode-change")}}}])&&d(t.prototype,n),s}(i());t.Z=(0,a.v$)(new b,"actions_handler")}},t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.m=e,n.x=function(){},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.j=991,function(){var e={991:0},t=[[5486,431]],r=function(){},i=function(i,o){for(var a,s,l=o[0],c=o[1],u=o[2],d=o[3],f=0,p=[];f<l.length;f++)s=l[f],n.o(e,s)&&e[s]&&p.push(e[s][0]),e[s]=0;for(a in c)n.o(c,a)&&(n.m[a]=c[a]);for(u&&u(n),i&&i(o);p.length;)p.shift()();return d&&t.push.apply(t,d),r()},o=self.webpackChunk_mediacms_frontend=self.webpackChunk_mediacms_frontend||[];function a(){for(var r,i=0;i<t.length;i++){for(var o=t[i],a=!0,s=1;s<o.length;s++){var l=o[s];0!==e[l]&&(a=!1)}a&&(t.splice(i--,1),r=n(n.s=o[0]))}return 0===t.length&&(n.x(),n.x=function(){}),r}o.forEach(i.bind(null,0)),o.push=i.bind(null,o.push.bind(o));var s=n.x;n.x=function(){return n.x=s||function(){},(r=a)()}}(),n.x()}();
// callback executed when canvas was found
function findGetParameter(parameterName) {
var result = null,
tmp = [];
var items = location.search.substr(1).split("&");
for (var index = 0; index < items.length; index++) {
tmp = items[index].split("=");
if (tmp[0] === parameterName) result = decodeURIComponent(tmp[1]);
}
return result;
}
function handleCanvas() {
var Player = videojs(document.getElementById('vjs_video_3_html5_api'));
Player.playsinline(true);
//Player.controls(false);
if(findGetParameter("muted")==1){
Player.muted(true);
}
if(findGetParameter("time")>=0){
Player.currentTime(findGetParameter("time"));
}
if(findGetParameter("autoplay")==1){
Player.play();
}
}
// set up the mutation observer
var observer = new MutationObserver(function (mutations, me) {
// `mutations` is an array of mutations that occurred
// `me` is the MutationObserver instance
var canvas = document.getElementById('vjs_video_3_html5_api');
if (canvas) {
handleCanvas();
me.disconnect(); // stop observing
return;
}
});
// start observing
observer.observe(document, {
childList: true,
subtree: true
});