/*! JW Player version 8.34.1 Copyright (c) 2024, JW Player, All Rights Reserved This source code and its use and distribution is subject to the terms and conditions of the applicable license agreement. https://www.jwplayer.com/tos/ This product includes portions of other software. For the full text of licenses, see https://ssl.p.jwpcdn.com/player/v/8.34.1/notice.txt */ (self.webpackChunkjwplayer=self.webpackChunkjwplayer||[]).push([[365],{7191:(e,t,i)=>{"use strict";i.d(t,{W:()=>he,o:()=>ce});var l=i(147),a=i.n(l),s=i(4886),r=i.n(s),n=i(4777),o=i.n(n),d=i(6084),h=i.n(d),c=i(2521),w=i.n(c),p=i(6207),m=i.n(p),j=i(6641),g=i.n(j),u=i(3498),f=i.n(u),v=i(3918),y=i.n(v),x=i(3356),b=i.n(x),k=i(8157),C=i.n(k),I=i(5806),S=i.n(I),z=i(7766),M=i.n(z),L=i(4851),P=i.n(L),T=i(3207),E=i.n(T),V=i(7938),B=i.n(V),A=i(4060),U=i.n(A),$=i(4119),D=i.n($),R=i(9992),O=i.n(R),H=i(6038),q=i.n(H),N=i(5058),F=i.n(N),Z=i(7459),W=i.n(Z),_=i(4606),X=i.n(_),Y=i(1438),K=i.n(Y),J=i(5147),G=i.n(J),Q=i(9863),ee=i.n(Q),te=i(2494),ie=i.n(te),le=i(544),ae=i.n(le),se=i(4667);let re=null;const ne=function(){return re||(re=(0,se.Z)(`${a()}${r()}${o()}${h()}${w()}${m()}${g()}${f()}${y()}${b()}${C()}${S()}${M()}${P()}${E()}${B()}${U()}${D()}${O()}${q()}${F()}${K()}${G()}${W()}${X()}${ee()}${ie()}${ae()}`)),re},oe=function(e){return`.jw-svg-icon-${e}`},de=function(e){return e.cloneNode(!0)},he=function(e){const t=ne().querySelector(oe(e));return t?de(t):null},ce=function(e){const t=ne().querySelectorAll(e.split(",").map(oe).join(","));return Array.prototype.map.call(t,(e=>de(e)))}},3092:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>Ve});var l=i(6886),a=i(6769),s=i(4446);const r=302e3,n=302621,o=e=>{let t;try{var i;if(null!=e&&null!=(i=e.responseXML)&&i.firstChild){const i=(0,a.Z)(e.responseXML.firstChild);t=Object.assign({playlist:i},i.feedData)}else t=JSON.parse(e.responseText),Array.isArray(t)&&(t={playlist:t})}catch(e){t=null}return t},d=function(e){this.items=this.currentRequest=this.lastResponseText=null,this.requestOptions=e};d.prototype.load=function(e,t,i,a){this.currentRequest&&this.abort();const d=this.requestOptions;if(null!=d&&d.queryParams){const t=Object.keys(d.queryParams).map((function(e){return`${e}=${encodeURIComponent(d.queryParams[e])}`})),i=e.indexOf("?")>0?"&":"?";e=e+i+t.join("&")}this.currentRequest=(0,l.h)(e,(l=>{this.currentRequest=null;const r=this.lastResponseText===l.responseText,d=o(l);if(a&&r){const t=Object.assign({},d);a(this.items,t,e)}else if(d){this.lastResponseText=l.responseText,this.items=d.playlist;const i=Object.assign({},d);delete i.playlist,t(this.items,i,e)}else this.lastResponseText=null,i(new s.rG(null,n))}),((e,t,l,a)=>{i((0,s.l9)(a,r))}))},d.prototype.loadRecommendation=function(e,t,i,a,d){this.currentRequest&&this.abort();this.currentRequest=(0,l.h)(e,(e=>{this.currentRequest=null;const l=o(e);if(!l)return void a(new s.rG(null,n));const r=l.file||t;r?this.load(r,i,a,d):a(new s.rG(null,302650,l))}),((e,t,i,l)=>{a((0,s.l9)(l,r))}))},d.prototype.clearCache=function(){this.lastResponseText=null},d.prototype.abort=function(){this.currentRequest.onload=null,this.currentRequest.onreadystatechange=null,this.currentRequest.onerror=null,this.currentRequest.abort&&this.currentRequest.abort(),this.currentRequest=null,this.lastResponseText=null};const h=d;var c=i(8348),w=i(3296),p=i(2977);const m=class{constructor(e){this.videoThumbnails=[],this.activeThumbnailMobile=null,this.model=e,this.onMobileFeedShown=this.onMobileFeedShown.bind(this),this.init()}getVideosForThumb(e){const{images:t}=e;return(0,p.Cz)(t)}create(e,t,i,l,a){const s=this.getVideosForThumb(i);if(!s)return!1;i.videoThumbnail=s[0].src;const r=new w.Z(e,t,i,l,a);return this.push(r),r.init(),r}push(e){this.videoThumbnails.push(e)}flush(){this.videoThumbnails.forEach((e=>{e.isDestroyed()||e.destroy()})),this.videoThumbnails=[]}onMobileFeedShown(e){if(1!==e.itemsShown.length)return this.model.off("mobileFeedShown",this.onMobileFeedShown);const t=e.itemsShown[0];if(!t)return;const i=this.videoThumbnails.filter((e=>e.item.videoThumbnail===t.videoThumbnail&&"overlayItem"===e.type))[0];this.activeThumbnailMobile&&!this.activeThumbnailMobile.isDestroyed()&&(this.activeThumbnailMobile.onPause(),this.activeThumbnailMobile=null),i&&!i.isDestroyed()&&(i.onPlay(),this.activeThumbnailMobile=i)}init(){c.OS.mobile&&this.model&&this.model.on("feedShown",this.onMobileFeedShown)}},j=function(e){this.handlers=[],this.el=e};j.prototype.add=function(e){this.handlers.push(e)},j.prototype.del=function(e){e||(this.handlers=[]);for(let t=this.handlers.length;t>=0;t--)this.handlers[t]===e&&this.handlers.splice(t,1)},j.prototype.dispatch=function(...e){for(let t=0,i=this.handlers.length;t{const i=new j(e);return i.add(t),i},u=function(e,t){this.element="string"==typeof e?document.querySelector(e):e,this.start=this.start.bind(this),this.move=this.move.bind(this),this.end=this.end.bind(this),this.cancel=this.cancel.bind(this);const{passiveEvents:i}=c.Features,l=!!i&&{passive:!1},a=!!i&&{passive:!0};this.element.addEventListener("touchstart",this.start,l),this.element.addEventListener("touchmove",this.move,l),this.element.addEventListener("touchend",this.end,a),this.element.addEventListener("touchcancel",this.cancel,a),this.preV={x:null,y:null};const s=function(){};this.touchStart=g(this.element,t.touchStart||s),this.swipe=g(this.element,t.swipe||s),this.touchMove=g(this.element,t.touchMove||s),this.touchEnd=g(this.element,t.touchEnd||s),this.touchCancel=g(this.element,t.touchCancel||s),this._cancelAllHandler=this.cancelAll.bind(this),window.removeEventListener("scroll",this._cancelAllHandler),window.addEventListener("scroll",this._cancelAllHandler),this.delta=null,this.last=null,this.now=null,this.swipeTimeout=null,this.x1=null,this.x2=null,this.y1=null,this.y2=null};u.prototype={start(e){if(!e.touches)return;this.now=Date.now(),this.x1=e.touches[0].pageX,this.y1=e.touches[0].pageY,this.delta=this.now-(this.last||this.now),this.touchStart.dispatch(e),this.last=this.now;const t=this.preV;if(e.touches.length>1){const i={x:e.touches[1].pageX-this.x1,y:e.touches[1].pageY-this.y1};t.x=i.x,t.y=i.y}},move(e){if(!e.touches)return;const t=this.preV,i=e.touches.length,l=e.touches[0].pageX,a=e.touches[0].pageY;if(i>1){const i=e.touches[1].pageX,s=e.touches[1].pageY,r={x:e.touches[1].pageX-l,y:e.touches[1].pageY-a};t.x=r.x,t.y=r.y,null!==this.x2&&null!==this.sx2?(e.deltaX=(l-this.x2+i-this.sx2)/2,e.deltaY=(a-this.y2+s-this.sy2)/2):(e.deltaX=0,e.deltaY=0),this.sx2=i,this.sy2=s}else null!==this.x2?(e.deltaX=l-this.x2,e.deltaY=a-this.y2):(e.deltaX=0,e.deltaY=0);this.touchMove.dispatch(e),this.x2=l,this.y2=a,e.preventDefault()},end(e){if(!e.changedTouches)return;const t=this;(this.x2&&Math.abs(this.x1-this.x2)>30||this.y2&&Math.abs(this.y1-this.y2)>30)&&(e.direction=this._swipeDirection(this.x1,this.x2,this.y1,this.y2),this.swipeTimeout=setTimeout((function(){t.swipe.dispatch(e)}),0)),this.touchEnd.dispatch(e),this.preV.x=0,this.preV.y=0,this.x1=this.x2=this.y1=this.y2=null},cancelAll(){clearTimeout(this.swipeTimeout)},cancel(e){this.cancelAll(),this.touchCancel.dispatch(e)},_swipeDirection:(e,t,i,l)=>Math.abs(e-t)>=Math.abs(i-l)?e-t>0?"Left":"Right":i-l>0?"Up":"Down",on(e,t){this[e]&&this[e].add(t)},off(e,t){this[e]&&this[e].del(t)},destroy(){return this.swipeTimeout&&clearTimeout(this.swipeTimeout),this.element.removeEventListener("touchstart",this.start),this.element.removeEventListener("touchmove",this.move),this.element.removeEventListener("touchend",this.end),this.element.removeEventListener("touchcancel",this.cancel),this.swipe.del(),this.delta=null,this.last=null,this.now=null,this.preV=null,this.swipe=null,this.swipeTimeout=null,this.touchStart=null,this.touchMove=null,this.touchEnd=null,this.touchCancel=null,this.x1=null,this.x2=null,this.y1=null,this.y2=null,null}};const f=u;var v=i(2995),y=i.n(v),x=i(5947),b=i.n(x),k=i(1212),C=i.n(k),I=i(7191),S=i(5646),z=i(4667),M=i(2799),L=i(9888),P=i(2957);function T(e,t,i){this.element=e,this.item=t,this.ui=(0,S.Z)(e,(()=>i(t)))}let E=!0;const V=()=>{E&&(E=!1,i(4516))};let B;const A=e=>(B||(B=(0,z.Z)(`${y()}${b()}${C()}`)),B.querySelector(`.jw-svg-icon-${e}`).cloneNode(!0)),U=(e,t,i,l)=>{const a=document.createElement("div");return a.className=`jw-reset jw-icon jw-icon-inline ${e}${l?"":" jw-button-color"}`,a.appendChild(t),a.setAttribute("role","button"),a.setAttribute("tabindex","0"),(0,S.Z)(a,i),a},$=(e,t,i)=>{const l=A(`arrow-${e}`),a=U(`jw-related-page jw-related-page-${e}`,l);return a.setAttribute("aria-label",i),(0,S.Z)(a,(()=>t(e))),a},D=(e,t,i)=>{const l=i?A("arrow-down"):(0,I.W)("close"),a=U("jw-related-close",l,t,i);return a.setAttribute("aria-label",e),a},R=(e,t,i)=>{const l=(0,M.az)((({index:e,duration:t="",title:i=""},l)=>{const a="playlist"===l?`${e+1}. `:"";return``})(e,i));return l.querySelector(".jw-related-item-play").appendChild((0,I.W)("play")),(0,S.Z)(l,(()=>t(e))),l},O=(e,t,i,l)=>{const a="shelfWidget"===i;let s;if(l){l.ui.destroy(),s=l.element;const t=e.title;if(s.setAttribute("aria-label",`Video - ${t||"Untitled Video"}`),s.setAttribute("data-jw-index",e.index),(0,M.nh)(s.querySelector(".jw-related-shelf-item-title"),t?(0,M.az)(t).textContent:""),a)(0,M.L_)(s,/jw-related-(load(ed|ing)|displayed)/,"jw-related-loading"),s.querySelector(".jw-related-shelf-item-image").removeAttribute("style");else{const t=e.duration;(0,M.nh)(s.querySelector(".jw-related-shelf-item-duration"),t?`${(0,L.timeFormat)((0,P.m9)(t))}`:""),s.removeAttribute("style")}}else a?(s=(0,M.az)((({title:e="",index:t})=>``)(e)),s.querySelector(".jw-related-shelf-item-image").appendChild((0,I.W)("play"))):s=(0,M.az)((({duration:e="",title:t="",index:i})=>``)(e));return new T(s,e,t)},H=(e,t,i,l)=>{if(!t)return;const a=(0,M.az)(((e,{duration:t="",title:i="",description:l=""},a="")=>``)(e,t,i));return a.querySelector(".jw-related-item-play").appendChild((0,I.W)("play")),(0,S.Z)(a,(()=>l(t))),a},q=function(){this.timer=null,this.interval=null,this.countdownActive=!1};q.prototype.start=function(e,t,i,l){this.timer=window.setTimeout((()=>{this.clear(),i(e)}),1e3*t),this.secondsRemaining=t,this.currentTimeout=t;let a=this.secondsRemaining;this.interval=window.setInterval((function(){l(Math.max(0,a-=1))}),1e3),this.countdownActive=!0,l(Math.max(0,t))},q.prototype.clear=function(){window.clearTimeout(this.timer),window.clearInterval(this.interval),this.secondsRemaining=null,this.currentTimeout=null,this.countdownActive=!1};const N=q;var F=i(974);class Z{constructor(e,t,i,l){this.player=e,this.model=t,this.parentElement=l,this.container=null,this.isOpen=!1,this.feedType=i,V()}setupInterface(){if(this.container)return;const{localization:e}=this.model,t=document.createElement("div");t.className="jw-reset jw-related jw-overlay";const i=D(e.close,(e=>this.model.trigger("close","interaction",e)));t.appendChild(i),this.pageLeft=$("left",(()=>this.paginate("left")),e.prev),t.appendChild(this.pageLeft);const l=document.createElement("div");l.className="jw-reset jw-related-container";const a=e.related.heading,s=document.createElement("div");s.className="jw-related-title jw-reset-text",(0,M.nh)(s,a),s.setAttribute("aria-label",a),s.setAttribute("dir","auto"),t.appendChild(s);const r=document.createElement("div");r.className="jw-reset jw-related-item-group",l.appendChild(r),t.appendChild(l),this.pageRight=$("right",(()=>this.paginate("right")),e.next),t.appendChild(this.pageRight),this.container=t,this.attachInterface()}destroyInterface(){this.container&&((0,M.EU)(this.container),this.player.getControls()&&this.detachInterface(),this.container=null)}toggle(e=!this.isOpen){const t=this.player.getContainer();(0,M.og)(this.parentElement,"jw-plugin-related-open",e),(0,M.og)(t,"jw-flag-overlay-open-related",e),this.isOpen=e}visibility(e){this.container&&(0,F.oB)(this.container,e?{display:""}:{display:"none"})}attachInterface(){const{container:e,parentElement:t}=this;t&&(t.appendChild(e),(0,M.og)(this.parentElement,"jw-plugin-related",!0))}detachInterface(){const{container:e,parentElement:t}=this;null!=e&&e.parentNode&&e.parentNode.removeChild(e),t&&(0,M.og)(t,"jw-plugin-related",!1)}paginate(e){this.model.trigger("overlayPaged",e)}getButtons(){return{left:this.pageLeft,right:this.pageRight}}}const W=(e,t,i)=>{const l=e.onItemSelect;return i&&(t.relatedFile=i),t.onclick="play"===l?"play":"link",t},_=(e,t,{feedItems:i,feedData:l,feedUri:a},s)=>{const r=W(e,{visible:s,method:t},a);s&&(r.feed=a,r.items=i,r.autoplay="autoplay"===e.onComplete,r.feedData=l),e.trigger("analytics",s?"open":"close",r)},X=(e,t,i,l,a,s,r,{feedData:n,feedUri:o,feedShownId:d})=>{const{nextUp:h,onComplete:c,autoplayTimer:w}=e,p=h&&"autoplay"===c&&"complete"===t,m="recs"===i?"discovery":"playlist";e.trigger("analytics","feedShown",W(e,{mode:m,feedData:n,feedShownId:d,itemsShown:s,page:a,reason:t,autoTimer:p&&w>=0?w:-1,ui:l,viewable:r},o))},Y=(e,t,i,l,a,s,{feedData:r,feedUri:n,feedShownId:o},d,h)=>{d.off("change:viewable",null,h),d.change("viewable",((c,w)=>{X(e,t,i,l,a,s,w,{feedData:r,feedUri:n,feedShownId:o}),w?d.off("change:viewable",null,h):t="inView"}),h)},K=(e,t,i,l,a,s,r,n,{feedData:o,feedUri:d,feedShownId:h})=>{const c="recs"===i?"discovery":"playlist";e.trigger("analytics","feedClick",W(e,{mode:c,feedData:o,feedShownId:h,itemsShown:s,reason:t,target:r,index:s.indexOf(r)+1,page:a,ui:l,viewable:n},d))},J=(e,t,i,l,a,s,r,{feedData:n,feedUri:o,feedShownId:d}={})=>{a||(a=[s]);const h={mode:"recs"===t?"discovery":"playlist",itemsShown:a,index:a.indexOf(s)+1,page:l,feedData:n||s.feedData,feedShownId:d||s.feedShownId,target:s,ui:i,viewable:r};e.trigger("analytics","videoThumbFirstFrame",W(e,h,o))};var G=i(6234);class Q{constructor(e,t,i){this.element=e,this.item=t,i&&(this.width=i)}setSrc(){if(this.styled)return;const{element:e,item:t}=this;if(t.image){const t=this.thumbnailUrl();t&&(e.style.backgroundImage=`url(${t})`),this.styled=!0}}thumbnailUrl(){const{item:e,element:t}=this,i=this.width?(0,p.IJ)(this.width):(0,p.IJ)(t.clientWidth);return(0,p.Bf)(e,i)}setWidth(e){this.width=e}}const ee=class{constructor(e,t,i,l){this.player=e,this.model=t,this.playerModel=i,this.feedItems=[],this.feedData={},this.feedShownId="",this.feedUri="",this.feedType=l,this.currentPageNumber=0,this.lastResizeBreakpoint=this.model.breakpoint,this.videoThumbnails=new m(this.player.getPlugin("related")),this.container=this.model.pluginContainer,this.view=new Z(e,t,l,this.container),this.open=this.open.bind(this),this.newPages=!1,c.OS.mobile&&this.enableSwipe(),this.onNextUp=(e,t)=>this.setNextUp(t),this.onPaged=e=>this.paginate(e,"paged"),"autoplay"!==this.model.onComplete&&"none"!==this.model.onComplete||(this.autoplay=new N),this.keyEventHandler=e=>{this.keyDownHandler(e)},this.container.removeEventListener("keydown",this.keyEventHandler),this.container.addEventListener("keydown",this.keyEventHandler),this.model.on("overlayPaged",this.onPaged,this),this.model.change("nextUp",this.onNextUp,this)}getCurrentItem(){const e=this.player.getPlaylistIndex();return this.player.getPlaylistItem(e)}loadItems(e,t,i){this.playerModel.off("change:viewable",null,this),this.feedItems=e,this.feedData=t,this.feedUri=i,this.nextItem=e[0],this.newPages=!0,this.generatePages()}setNextUp(e){this.nextItem=e,this.newPages=!0,this.generatePages()}onBeforePlay(){this.isOpen&&this.close("play")}open(e,t){const{container:i,view:l,nextItem:a,nextUpPage:s,autoplay:r}=this;l.container||l.setupInterface(),this.generatePages(),this.goToPage(s,e),t&&"enter"===t.type&&a&&i.addEventListener("animationend",(function(){const e=i.querySelector(".jw-related-item");e&&e.focus()}),{once:!0}),"playing"===this.player.getState()&&(this.unpausePlayer=!0),this.player.pause({reason:"recs"===this.feedType?"related-interaction":"interaction"}),this.view.toggle(!0),r&&"complete"===e&&this.playerModel.get("nextUp")&&this.autoAdvance(),this.player.on("beforePlay",this.onBeforePlay,this),_(this.model,e,this,!0)}close(e){this.player.off("beforePlay",this.onBeforePlay,this),this.playerModel.off("change:viewable",null,this),this.autoplay&&(this.autoplay.clear(),this.resetAutoplay()),this.unpausePlayer&&(this.player.play({reason:"recs"===this.feedType?"related-interaction":"interaction"}),this.unpausePlayer=!1),this.feedShownId="",this.view.toggle(!1),_(this.model,e,this,!1)}enableSwipe(){return new f(this.container,{swipe:e=>{const t=this.pages[this.currentPageNumber+1],i=this.pages[this.currentPageNumber-1];"Left"===e.direction&&t?this.paginate("right","paged_swiped"):"Right"===e.direction&&i&&this.paginate("left","paged_swiped")}})}goToPage(e,t){const{container:i,pages:l,nextUpPage:a,smallPlayer:s,model:r}=this;if(!i||!l.length)return;const n=i.querySelector(".jw-related-item-next-up");n&&n.parentElement.removeChild(n);const o=i.querySelector(".jw-related-item-group");(0,M.EU)(o),l[e].forEach(((t,i)=>{const r=t.element;if(e===a&&0===i?o.parentElement.insertBefore(r,o):o.appendChild(r),s){if(l[e-1]){const t=l[e-1][0].element;o.appendChild(t),(0,M.og)(t,"jw-related-active-item",!1),t.setAttribute("tabindex","-1")}if(o.appendChild(r),l[e+1]){const t=l[e+1][0].element;o.appendChild(t),(0,M.og)(t,"jw-related-active-item",!1),t.setAttribute("tabindex","-1")}if(0!==e&&(o.style.transitionDuration="0s",e{r&&r.focus(),o.removeEventListener("transitionend",e),o.removeEventListener("animationend",e)};o.addEventListener("transitionend",e),o.addEventListener("animationend",e)}setTimeout((()=>{0!==e?(o.style.transitionDuration="150ms",o.style.transform="translateX(-100%)"):o.style.transform="",(0,M.og)(r,"jw-related-active-item",!0)}),0)}else e===a&&0===i?o.parentElement.insertBefore(r,o):o.appendChild(r),o.style.transform=""})),this.currentPageNumber=e,this.refreshButtons(),this.lastShownReason=t,this.visibleItems=l[e].map((e=>e.source)),this.feedShownId=(0,G.B)(G.F),Y(r,t,this.feedType,"overlay",e-a,this.visibleItems,this,this.playerModel,this)}generatePages(){const e=this.model.localization.nextUp,t=this.videoThumbnails,i=[];let l=[],a=!1;this.newPages&&(this.newPages=!1,t.flush(),this.feedItems.forEach(((s,r)=>{const n=Object.assign({},s,{index:r});let o;if(s===this.nextItem||!this.nextItem&&0===r)l.length>0&&(i.push(l),l=[]),o=H(this.player.id,n,e,(()=>this.itemSelected(n))),this.nextUpPage=i.length,a=!0;else{o=R(n,(()=>this.itemSelected(n)),this.feedType,this.playerModel);let e=this.numItemsPerPage;a&&(e-=this.nextUpDisplacement),l.length>=e&&(i.push(l),l=[],a=!1)}t.create("overlayItem",o,s,null,(()=>this.itemViewed(n)));const d=new Q(o.querySelector(".jw-related-item-poster"),s),h=this.view.player.getSafeRegion().width/this.rowSize;d.setWidth(h),d.setSrc(),l.push({source:n,element:o})})),l.length>0&&i.push(l),this.pages=i,this.currentPageNumber=this.nextUpPage)}itemSelected(e,t){const{lastShownReason:i,feedData:l,feedUri:a,feedType:s,visibleItems:r,nextUpPage:n,currentPageNumber:o,model:d}=this;if(t)((e,t,i,l,a,{feedData:s,feedUri:r,feedShownId:n})=>{const o="recs"===t?"discovery":"playlist";e.trigger("analytics","feedAutoAdvance",W(e,{mode:o,feedData:s,feedShownId:n,itemsShown:l,target:a,ui:i},r))})(d,s,"overlay",r,e,this);else{K(d,i,s,"overlay",o-n,r,e,this.playerModel.get("viewable"),this)}this.countdownEl=null;const h="playlist"===s?"playlistItemSelected":"recsItemSelected";d.trigger(h,{item:e,feedData:l,feedUri:a},t?"related-auto":"related-interaction")}itemViewed(e){const{feedType:t,visibleItems:i,nextUpPage:l,currentPageNumber:a,model:s}=this;J(s,t,"overlay",a-l,i,e,this.playerModel.get("viewable"),this)}paginate(e,t){switch(this.autoplay&&(this.autoplay.clear(),this.resetAutoplay()),e){case"left":return void this.goToPage(this.currentPageNumber-1,t);case"right":this.goToPage(this.currentPageNumber+1,t)}}autoAdvance(){const{model:e,autoplay:t,container:i,nextItem:l}=this,a=e.autoplayTimer,s=e.autoplayMessage.replace(/__title__/i,l.title);this.countdownEl=i.querySelector(".jw-related-next-up-text");t.start(l,a,(()=>this.itemSelected(l,!0)),(e=>{this.countdownEl&&(0,M.nh)(this.countdownEl,s.replace(/xx/i,e))})),setTimeout((()=>{this.renderAutoplayAnimation(Math.max(0,a-.25))}),250)}refreshButtons(){const e=this.view.getButtons();(0,M.og)(e.left,"jw-hidden",0===this.currentPageNumber),(0,M.og)(e.right,"jw-hidden",this.currentPageNumber===this.pages.length-1)}keyDownHandler(e){if(!e)return;const t=this.pages[this.currentPageNumber+1],i=this.pages[this.currentPageNumber-1];switch(e.keyCode){case 39:t&&this.paginate("right","paged"),e.stopPropagation();break;case 37:i&&this.paginate("left","paged"),e.stopPropagation()}}renderAutoplayAnimation(e){const t=this.container.querySelector(".jw-related-item-content");if(!t)return;const i=(0,M.az)(''),l=i.querySelector(".jw-related-autoplay-frame-progress");t.appendChild(i),this.resizeAutoplay(l),l.style.animation=`${e}s linear forwards jw-dash`}resetAutoplay(){const e=this.container.querySelector(".jw-related-next-up-text");e&&(0,M.nh)(e,this.model.localization.nextUp);const t=this.container.querySelector(".jw-related-autoplay-frame-progress");t&&t.parentNode.removeChild(t)}resizeAutoplay(e){if(!e)return;const t=e.getBoundingClientRect(),i=2*t.height+2*t.width;e.style.strokeDasharray=i;const l=this.autoplay.secondsRemaining?1-this.autoplay.secondsRemaining/this.autoplay.currentTimeout:0;e.style.strokeDashoffset=i-l*i}resize(){var e;(this.view.container||this.view.setupInterface(),this.newPages=!0,this.generatePages(),!this.isOpen||this.model.breakpoint===this.lastResizeBreakpoint&&this.currentPageNumber===this.nextUpPage)||(this.goToPage(this.nextUpPage,"resized"),this.lastResizeBreakpoint=this.model.breakpoint,null!=(e=this.autoplay)&&e.countdownActive&&setTimeout((()=>{this.countdownEl=this.container.querySelector(".jw-related-next-up-text"),this.renderAutoplayAnimation(Math.max(0,this.autoplay.secondsRemaining))}),250))}destroy(){this.container.removeEventListener("keydown",this.keyEventHandler),this.model.off(null,null,this),this.playerModel.off(null,null,this),this.player.off(null,null,this),(0,M.EU)(this.container)}get isOpen(){return this.view.isOpen}get smallPlayer(){return this.model.breakpoint<2}get numItemsPerPage(){switch(this.model.breakpoint){case 7:case 6:case 5:case 4:return 9;case 3:return 6;case 2:return 4;default:return 1}}get rowSize(){switch(this.model.breakpoint){case 7:case 6:case 5:case 4:case 3:return 3;case 2:return 2;default:return 1}}get nextUpDisplacement(){switch(this.numItemsPerPage){case 9:return 2;case 6:case 4:return 1;default:return 0}}},te=(e="",t="",i="jw-reset ")=>``;class ie{constructor(e,t,i){this.player=e,this.model=t,this.container=null,this.isOpen=!1,this.title=i,this.toggleEnded=this.onToggleAnimationEnd.bind(this),V(),this.setup()}setup(){const{localization:e}=this.model,t=(0,M.az)('