"use strict";(globalThis["webpackChunksynclounge"]=globalThis["webpackChunksynclounge"]||[]).push([[3857],{3857:(e,t,n)=>{n.r(t),n.d(t,{default:()=>m});var s=n(7179),o=n(4437),c=n(5057),r=n(5294),i=n(2680),a=function(){var e=this,t=e._self._c;return e.onDeck.length?t("div",[e._t("preHeader"),t(r.Z,{attrs:{"no-gutters":""}},[t(o.Z,[t(i.Z,[e._t("header",(function(){return[e._v(" On Deck ")]}))],2)],1),t(o.Z,{staticClass:"ml-auto",attrs:{cols:"auto"}},[t(s.Z,{style:e.onDeckDownStyle,attrs:{icon:""},on:{click:e.onDeckDown}},[t(c.Z,[e._v("navigate_before")])],1),t(s.Z,{style:e.onDeckUpStyle,attrs:{icon:""},on:{click:e.onDeckUp}},[t(c.Z,[e._v("navigate_next")])],1)],1)],1),t(r.Z,e._l(e.subsetOnDeck,(function(e){return t(o.Z,{key:e.key,attrs:{cols:"12",sm:"4",md:"3",xl:"2"}},[t("PlexThumbnail",{attrs:{content:e,type:"art",cols:"12",sm:"4",md:"3",xl:"2"}})],1)})),1)],2):e._e()},l=[],h=n(629);const k={name:"PlexOnDeck",components:{PlexThumbnail:()=>Promise.all([n.e(7482),n.e(8735),n.e(6125)]).then(n.bind(n,8735))},props:{machineIdentifier:{type:String,required:!0}},data:()=>({onDeck:[],onDeckOffset:0,abortController:null}),computed:{onDeckItemsPer(){switch(this.$vuetify.breakpoint.name){case"xs":return 1;case"sm":return 3;case"md":case"lg":return 4;default:return 6}},onDeckUpStyle(){return this.onDeckOffset+this.onDeckItemsPer>=this.onDeck.length?{opacity:.5}:{}},onDeckDownStyle(){return 0===this.onDeckOffest?{opacity:.5}:{}},subsetOnDeck(){return this.onDeck.slice(this.onDeckOffset,this.onDeckOffset+this.onDeckItemsPer)}},watch:{machineIdentifier:{handler(){return this.onDeck=[],this.onDeckOffset=0,this.fetchOnDeck()},immediate:!0}},beforeDestroy(){this.abortRequests()},methods:{...(0,h.nv)("plexservers",["FETCH_ON_DECK"]),abortRequests(){this.abortController&&(this.abortController.abort(),this.abortController=null)},onDeckDown(){this.onDeckOffset-this.onDeckItemsPer<0?this.onDeckOffset=0:this.onDeckOffset-=4},onDeckUp(){this.onDeckOffset+this.onDeckItemsPer>=this.onDeck.length||(this.onDeckOffset+=this.onDeckItemsPer)},async fetchOnDeckCriticalSection(e){this.onDeck=await this.FETCH_ON_DECK({machineIdentifier:this.machineIdentifier,start:0,size:10,signal:e})},async fetchOnDeck(){this.abortRequests();const e=new AbortController;this.abortController=e;try{await this.fetchOnDeckCriticalSection(e.signal)}catch(t){if(!e.signal.aborted)throw t}}}},D=k;var f=n(1001),u=(0,f.Z)(D,a,l,!1,null,null,null);const m=u.exports}}]);
//# sourceMappingURL=3857.95ecf62c.js.map