1"use strict";(self.webpackChunkredbarrelsgames=self.webpackChunkredbarrelsgames||[]).push([["src_js_modules_pb-row-featured-games_index_js"],{
1"./src/js/components/Video.js":(t,e,i)=>{i.d(e,{Z:()=>u});var n=i("./src/js/core/power-mode.js"),s=i("./src/js/utils/breakpoint.js"),o=i("./src/js/utils/viewport.js");function r(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var l=["(min-width: 768px)","(min-width: 1200px)"];const u=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.el=e,this._action=this.el.paused?"pause":"play",this._src=this.el.dataset.src||this.el.src,this._src_mobile=this.el.dataset.srcMobile,this._src_tablet=this.el.dataset.srcTablet,this._poster=this.el.dataset.poster,this._powerModeLow=n.Z.low&&!1===i,this._onBreakpointChange=this._onBreakpointChange.bind(this),this._powerModeLow||this._src&&(this._src_mobile||this._src_tablet)&&(this._bp=new s.Z(l,this._onBreakpointChange)),this.init()}var e,i,u;return e=t,i=[{key:"init",value:function(){this._bindEvents(),this._powerModeLow?this._poster&&this.el.setAttribute("poster",this._poster):(this._bp||this._src)&&this.el.src!==this.src&&(this.el.setAttribute("src",this.src),this["play"===this._action?"play":"pause"]())}},{key:"destroy",value:function(){this._unbindEvents(),this._bp&&this._bp.dispose(),this.el=null,this._action=null,this._playPromise=null,this._src=null,this._src_mobile=null,this._src_tablet=null,this._poster=null,this._bp=null,this._powerModeLow=null,this._onBreakpointChange=null}},{key:"play",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=this;this.el&&(this._powerModeLow||"play"===this._action&&!1===e||(this._action="play",this._playPromise||(this._playPromise=null===(t=this.el)||void 0===t?void 0:t.play(),this._playPromise.finally((function(){i._playPromise=null})),this._playPromise.catch((function(){i._action=null})))))}},{key:"pause",value:function(){var t,e=this;this.el&&(this._powerModeLow||"pause"!==this._action&&(this._action="pause",this._playPromise?this._playPromise.then((function(){var t;return null===(t=e.el)||void 0===t?void 0:t.pause()})):null===(t=this.el)||void 0===t||t.pause()))}},{key:"seek",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.el&&(this.el.currentTime=t)}},{key:"_bindEvents",value:function(){var t;null===(t=this._bp)||void 0===t||t.on()}},{key:"_unbindEvents",value:function(){var t;null===(t=this._bp)||void 0===t||t.off()}},{key:"_onBreakpointChange",value:function(){this.src!==this.el.src&&(this._powerModeLow||("play"===this._action&&this.el.pause(),this.el.setAttribute("src",this.src)),"play"===this._action&&this.play(!0))}},{key:"playing",get:function(){return"play"===this._action}},{key:"src",get:function(){return this._src_mobile||this._src_tablet?o.Z.width<768?this._src_mobile?this._src_mobile:this._src_tablet:o.Z.width<1200&&this._src_tablet?this._src_tablet:this._src:this._src}}],i&&r(e.prototype,i),u&&r(e,u),t}()},
1"./src/js/modules/pb-row-featured-games/index.js":(t,e,i)=>{i.r(e),i.d(e,{default:()=>g});var n=i("./node_modules/eventemitter2/lib/eventemitter2.js"),s=i.n(n),o=i("./src/js/components/Video.js"),r=i("./src/js/utils/dom.js"),l=i("./src/js/utils/listener.js");function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function a(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function _(t,e,i){return e&&h(t.prototype,e),i&&h(t,i),t}function p(t){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},p(t)}function f(t,e){return!e||"object"!=((i=e)&&"undefined"!=typeof Symbol&&i.constructor===Symbol?"symbol":typeof i)&&"function"!=typeof e?a(t):e;var i}function d(t,e){return d=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},d(t,e)}function v(t){return function(t){if(Array.isArray(t))return u(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return u(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(i);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return u(t,e)}(t)||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 m(t){var e=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(t){return!1}}();return function(){var i,n=p(t);if(e){var s=p(this).constructor;i=Reflect.construct(n,arguments,s)}else i=n.apply(this,arguments);return f(this,i)}}var y="--js-game-over",b=function(){function t(e,i){c(this,t),this.el=e,this.emitter=i,this.games=v((0,r.$$)(".pb-row-featured-games__game",this.el)).map((function(t){return new w(t)})),this.previews=(0,r.$)(".pb-row-featured-games__previews",this.el),this._onGameOver=this._onGameOver.bind(this),this._onGameOut=this._onGameOut.bind(this)}return _(t,[{key:"init",value:function(){this.previews&&(this.previews=new k(this.previews)),this._bindEvents()}},{key:"destroy",value:function(){this._unbindEvents(),this.games&&this.games.forEach((function(t){return t.destroy()})),this.previews&&this.previews.destroy(),this.el=null,this.emitter=null,this.games=null,this.previews=null,this._onGameOver=null,this._onGameOut=null}},{key:"_bindEvents",value:function(){var t=this;this.games.forEach((function(e){e.on("over",t._onGameOver),e.on("out",t._onGameOut)}))}},{key:"_unbindEvents",value:function(){var t=this;this.games.forEach((function(e){e.off("over",t._onGameOver),e.off("out",t._onGameOut)}))}},{key:"_onGameOver",value:function(t){this.previews&&this.previews.play(t.previewVideo),this.el.classList.add(y)}},{key:"_onGameOut",value:function(){this.previews&&this.previews.stop(),this.el.classList.remove(y)}}]),t}(),w=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&d(t,e)}(i,t);var e=m(i);function i(t){var n;return c(this,i),(n=e.call(this)).el=t,n.cta=(0,r.$)("[data-pb-row-featured-games-game-cta]",n.el),n.previewVideo=n.el.dataset.pbRowFeaturedGamesPreviewVideo,n._clicked=!1,n._onRollover=n._onRollover.bind(a(n)),n._onRollout=n._onRollout.bind(a(n)),n._onClick=n._onClick.bind(a(n)),n._bindEvents(),n}return _(i,[{key:"destroy",value:function(){this._unbindEvents(),this.el=null,this.cta=null,this.previewVideo=null,this._onRollover=null,this._onRollout=null}},{key:"_bindEvents",value:function(){this.cta&&this.previewVideo&&((0,l.on)(this.cta,"mouseenter",this._onRollover),(0,l.on)(this.cta,"mouseleave",this._onRollout),(0,l.on)(this.cta,"click",this._onClick))}},{key:"_unbindEvents",value:function(){this.cta&&((0,l.S1)(this.cta,"mouseenter",this._onRollover),(0,l.S1)(this.cta,"mouseleave",this._onRollout),(0,l.S1)(this.cta,"click",this._onClick))}}
1,{key:"_onRollover",value:function(){this.emit("over",this)}},{key:"_onRollout",value:function(){this._clicked||this.emit("out",this)}},{key:"_onClick",value:function(){this._clicked=!0}}]),i}(s()),k=function(){function t(e){c(this,t),this.el=e,this.wrap=(0,r.$)(".pb-row-featured-games__previewsWrap",this.el),this.items=v((0,r.$$)(".pb-row-featured-games__preview",this.el)).map((function(t){return{id:t.dataset.pbRowFeaturedGamesPreviewVideo,el:t,video:new o.Z((0,r.$)("video",t))}})),this._currentItem=null,this._playing=!1,this._onFadeOutCompleted=this._onFadeOutCompleted.bind(this),this._bindEvents()}return _(t,[{key:"destroy",value:function(){this._unbindEvents(),this.items&&this.items.forEach((function(t){return t.video.destroy()})),this.el=null,this.wrap=null,this.items=null,this._currentItem=null,this._playing=null,this._onFadeOutCompleted=null}},{key:"play",value:function(t){var e=this.items.find((function(e){return e.id===t}));e&&(this._playing=!0,this._currentItem=e,this._currentItem.el.setAttribute("aria-hidden",!1),this._currentItem.video.play())}},{key:"stop",value:function(){this._playing=!1}},{key:"_bindEvents",value:function(){(0,l.on)(this.wrap,"transitionend",this._onFadeOutCompleted)}},{key:"_unbindEvents",value:function(){(0,l.S1)(this.wrap,"transitionend",this._onFadeOutCompleted)}},{key:"_onFadeOutCompleted",value:function(){var t=this;this.items.forEach((function(e){t._playing&&e===t._currentItem||(e.el.setAttribute("aria-hidden",!0),e.video.pause(),e.video.seek(0))})),this._currentItem=null}}]),t}();const g=b},
1"./src/js/utils/breakpoint.js":(t,e,i)=>{i.d(e,{Z:()=>n});const n=function(t,e){var i,n=function(t){i=t,o||(requestAnimationFrame(r),o=!0)},s=t.map((function(t){return window.matchMedia(t)})),o=!1,r=function(){e(i),o=!1};return{dispose:function(){o=!0,i=null,s=null},on:function(){s.forEach((function(t){return t.addListener(n)}))},off:function(){s.forEach((function(t){return t.removeListener(n)}))},run:r}}}
1}]); 2//# sourceMappingURL=src_js_modules_pb-row-featured-games_index_js.3ba266324a8abdb2aad3.bundle.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.