"use strict";(globalThis["webpackChunksynclounge"]=globalThis["webpackChunksynclounge"]||[]).push([[9935],{9935:(t,e,s)=>{s.r(e),s.d(e,{default:()=>g});var n=s(2202),i=s(7179),l=s(4437),o=s(5057),r=s(248),a=s(2776),h=s(5294),c=s(2680),d=function(){var t=this,e=t._self._c;return e(r.Z,{attrs:{dense:""}},[t.error?e(n.Z,{attrs:{prominent:"",type:"error"}},[e(h.Z,{attrs:{align:"center"}},[e(l.Z,[t._v(" Unable to connect to client. ")]),t.isHttps?e(l.Z,{attrs:{cols:"auto"}},[t._v(" Try with http "),e(i.Z,{staticClass:"ml-1",attrs:{href:t.httpLink,color:"warning"}},[t._v(" Try ")])],1):t._e()],1)],1):t._e(),e(c.Z,[t._v(" Plex Players "),e(i.Z,{attrs:{icon:"","x-small":""},on:{click:t.FETCH_PLEX_DEVICES}},[e(o.Z,[t._v("refresh")])],1)],1),e(a.Z,{attrs:{mandatory:"",value:t.GET_CHOSEN_CLIENT_ID},on:{change:t.onClientClicked}},t._l(t.GET_PLEX_CLIENT_IDS_SORTED_BY_LAST_SEEN,(function(t){return e("PlexClient",{key:t,attrs:{value:t,"client-id":t}})})),1)],1)},u=[],_=s(629);const p={name:"PlexClientPicker",components:{PlexClient:()=>Promise.all([s.e(6031),s.e(1646),s.e(3151),s.e(1676)]).then(s.bind(s,3151))},data:()=>({error:!1,abortController:null}),computed:{...(0,_.Se)("plexclients",["GET_CHOSEN_CLIENT_ID","GET_PLEX_CLIENT_IDS_SORTED_BY_LAST_SEEN"]),isHttps(){return"https:"===window.location.protocol},httpLink(){return`http:${window.location.href.substring(window.location.protocol.length)}`}},beforeDestroy(){this.cancelRequests()},methods:{...(0,_.nv)("plex",["FETCH_PLEX_DEVICES"]),...(0,_.nv)("plexclients",["FIND_AND_SET_CONNECTION"]),...(0,_.OI)("plexclients",["SET_CHOSEN_CLIENT_ID"]),cancelRequests(){this.abortController&&(this.abortController.abort(),this.abortController=null)},async onClientClicked(t){this.cancelRequests();const e=new AbortController;this.abortController=e,this.$emit("loading-change",!0),this.$emit("client-connectable-change",!1),this.error=!1;try{await this.FIND_AND_SET_CONNECTION({clientIdentifier:t,signal:e.signal}),this.SET_CHOSEN_CLIENT_ID(t),this.$emit("client-connectable-change",!0)}catch(s){if(e.signal.aborted)return;console.error(s),this.error=!0}this.abortController=null,this.$emit("loading-chnage",!1)}}},C=p;var v=s(1001),E=(0,v.Z)(C,d,u,!1,null,null,null);const g=E.exports},248:(t,e,s)=>{s.d(e,{Z:()=>i});s(7658);var n=s(9868);const i=n.Z.extend().extend({name:"v-list",provide(){return{isInList:!0,list:this}},inject:{isInMenu:{default:!1},isInNav:{default:!1}},props:{dense:Boolean,disabled:Boolean,expand:Boolean,flat:Boolean,nav:Boolean,rounded:Boolean,subheader:Boolean,threeLine:Boolean,twoLine:Boolean},data:()=>({groups:[]}),computed:{classes(){return{...n.Z.options.computed.classes.call(this),"v-list--dense":this.dense,"v-list--disabled":this.disabled,"v-list--flat":this.flat,"v-list--nav":this.nav,"v-list--rounded":this.rounded,"v-list--subheader":this.subheader,"v-list--two-line":this.twoLine,"v-list--three-line":this.threeLine}}},methods:{register(t){this.groups.push(t)},unregister(t){const e=this.groups.findIndex((e=>e._uid===t._uid));e>-1&&this.groups.splice(e,1)},listClick(t){if(!this.expand)for(const e of this.groups)e.toggle(t)}},render(t){const e={staticClass:"v-list",class:this.classes,style:this.styles,attrs:{role:this.isInNav||this.isInMenu?void 0:"list",...this.attrs$}};return t(this.tag,this.setBackgroundColor(this.color,e),[this.$slots.default])}})},2776:(t,e,s)=>{s.d(e,{Z:()=>o});var n=s(2021),i=s(8914),l=s(4987);const o=(0,l.Z)(n.y,i.Z).extend({name:"v-list-item-group",provide(){return{isInGroup:!0,listItemGroup:this}},computed:{classes(){return{...n.y.options.computed.classes.call(this),"v-list-item-group":!0}}},methods:{genData(){return this.setTextColor(this.color,{...n.y.options.methods.genData.call(this),attrs:{role:"listbox"}})}}})},2680:(t,e,s)=>{s.d(e,{Z:()=>l});var n=s(3276),i=s(4987);const l=(0,i.Z)(n.Z).extend({name:"v-subheader",props:{inset:Boolean},render(t){return t("div",{staticClass:"v-subheader",class:{"v-subheader--inset":this.inset,...this.themeClasses},attrs:this.$attrs,on:this.$listeners},this.$slots.default)}})}}]);
//# sourceMappingURL=9935.d4188cac.js.map