import{x as I,r as M,w as T,D as g,l as y,A as d,z as n,J as s,B as u,y as p,G as a,I as r,S as m,K as i,aV as D,a4 as N,aD as S}from"./index-DKhfhZyI.js";import{E}from"./EditConfig-DFaTC7uJ.js";import{b as U,V as G,a as v}from"./VCardText-PK-MK26S.js";import{V as C}from"./VList-BsIdJYb-.js";import{V as O}from"./VTextField-C_1U2QFr.js";import{V as R}from"./VSwitch-DSjDgzWI.js";import{v as j}from"./VListItem-DG7fZYqG.js";import"./VForm-D1aN7gmd.js";import"./VCheckboxBtn-SjULh2vZ.js";import"./VMenu-BTA9m0lg.js";import"./VExpansionPanels-DOptlIBH.js";import"./VAlert-EFQTLSCo.js";import"./VSlider-B8oLe2Mv.js";import"./VVirtualScroll-DrLqMq8M.js";import"./VChip-Bt-2eXUN.js";import"./VDialog-zzdXdu7l.js";import"./VCard-AQsAsy9j.js";import"./VSpacer-lTIuHyc5.js";/* empty css              */import"./_plugin-vue_export-helper-DlAUqK2U.js";const z={key:0,style:{"margin-left":"-5px","margin-right":"-5px"}},oe=I({__name:"EditPlayer",props:{playerId:{}},setup(P){const b=S(),e=M(),f=P;T(()=>f.playerId,async l=>{l&&(e.value=await r.getPlayerConfig(l))},{immediate:!0});const w=async function(l){l.enabled=e.value.enabled,l.name=e.value.name||null,r.savePlayerConfig(f.playerId,l),b.push({name:"playersettings"})},B=function(){b.push(`/settings/editplayer/${f.playerId}/dsp`)};return(l,t)=>(n(),g("section",null,[y(U,null,{default:d(()=>{var V,_,k;return[e.value&&a(r).getProviderManifest(e.value.provider).domain in a(r).providerManifests?(n(),g("div",z,[y(G,null,{default:d(()=>{var o;return[m(i(l.$t("settings.config_player",[e.value.name||((o=a(r).players[e.value.player_id])==null?void 0:o.name)||e.value.default_name])),1)]}),_:1}),y(v,null,{default:d(()=>[u("b",null,i(l.$t("settings.player_id"))+": ",1),m(i(e.value.player_id),1)]),_:1}),y(v,null,{default:d(()=>{var o,$;return[u("b",null,i(l.$t("settings.player_provider"))+": ",1),m(i((o=a(r).getProviderManifest(e.value.provider))==null?void 0:o.name)+" ",1),($=a(r).getProviderManifest(e.value.provider))!=null&&$.documentation?(n(),g("a",{key:0,onClick:t[0]||(t[0]=A=>{var c;return a(D)((c=a(r).getProviderManifest(e.value.provider))==null?void 0:c.documentation)})}," ["+i(l.$t("settings.check_docs"))+"]",1)):s("",!0)]}),_:1}),a(r).players[e.value.player_id]?(n(),p(v,{key:0},{default:d(()=>[u("b",null,i(l.$t("settings.player_model"))+": ",1),m(i(a(r).players[e.value.player_id].device_info.manufacturer)+" / "+i(a(r).players[e.value.player_id].device_info.model),1)]),_:1})):s("",!0),(V=a(r).players[e.value.player_id])!=null&&V.device_info.ip_address?(n(),p(v,{key:1},{default:d(()=>[u("b",null,i(l.$t("settings.player_address"))+": ",1),m(i(a(r).players[e.value.player_id].device_info.ip_address),1)]),_:1})):s("",!0),a(r).players[e.value.player_id]?(n(),p(v,{key:2},{default:d(()=>[u("b",null,i(l.$t("settings.player_type_label"))+": ",1),m(i(l.$t(`player_type.${a(r).players[e.value.player_id].type}`)),1)]),_:1})):s("",!0),t[3]||(t[3]=u("br",null,null,-1)),y(C),t[4]||(t[4]=u("br",null,null,-1)),t[5]||(t[5]=u("br",null,null,-1)),"name"in e.value?(n(),p(O,{key:3,modelValue:e.value.name,"onUpdate:modelValue":t[1]||(t[1]=o=>e.value.name=o),placeholder:(_=e.value)==null?void 0:_.name,label:l.$t("settings.player_name"),variant:"outlined",clearable:"",class:"configcolumnleft",style:{"margin-right":"25px"}},null,8,["modelValue","placeholder","label"])):s("",!0),"enabled"in e.value?(n(),p(R,{key:4,modelValue:e.value.enabled,"onUpdate:modelValue":t[2]||(t[2]=o=>e.value.enabled=o),label:l.$t("settings.enable_player"),color:"primary",disabled:(k=a(r).getProviderManifest(e.value.provider))==null?void 0:k.builtin},null,8,["modelValue","label","disabled"])):s("",!0),a(r).players[e.value.player_id].type!==a(N).GROUP?(n(),p(j,{key:5,onClick:B},{default:d(()=>[m(i(l.$t("open_dsp_settings")),1)]),_:1})):s("",!0)])):s("",!0),t[6]||(t[6]=u("br",null,null,-1)),y(C),e.value?(n(),p(E,{key:1,disabled:!e.value.enabled,"config-entries":Object.values(e.value.values),onSubmit:w},null,8,["disabled","config-entries"])):s("",!0)]}),_:1})]))}});export{oe as default};
