import{Q as B,x as M,w as I,Z as b,B as y,U as d,bm as N,S as i,a9 as o,W as u,R as p,a0 as l,a4 as t,aU as S,al as m,aa as n,aV as v,bT as U,Y as C,ay as E,bn as D}from"./index-orrnp8a1.js";import{E as R}from"./EditConfig-B4rbu_aP.js";import{V as O}from"./VTextField-DaF8PfrV.js";import{V as j}from"./VSwitch-Cg3DDPQB.js";import{a as F}from"./VBtn-BJolvyKt.js";import"./VForm-BDfEPrwE.js";import"./VCheckboxBtn-CICj8ZxL.js";import"./VExpansionPanels-CT7PNnnx.js";import"./VAlert-BhQ3L7Kc.js";import"./VSlider-G4xlE4rG.js";import"./VVirtualScroll-Q9Rc10mA.js";import"./VChip-DzIcRFdM.js";import"./VDialog-oxeMlk6d.js";import"./VSpacer-FMK5QbR9.js";/* empty css              */import"./_plugin-vue_export-helper-DlAUqK2U.js";const G={key:0,style:{"margin-left":"-5px","margin-right":"-5px"}},te=B({__name:"EditPlayer",props:{playerId:{}},setup(P){const g=D(),e=M(),f=P;I(()=>f.playerId,async a=>{a&&(e.value=await t.getPlayerConfig(a))},{immediate:!0});const T=async function(a){a.enabled=e.value.enabled,a.name=e.value.name||null,t.savePlayerConfig(f.playerId,a),g.push({name:"playersettings"})},w=function(){g.push(`/settings/editplayer/${f.playerId}/dsp`)};return(a,r)=>(i(),b("section",null,[y(N,null,{default:d(()=>{var _,V,k;return[e.value&&l(t).getProviderManifest(e.value.provider).domain in l(t).providerManifests?(i(),b("div",G,[y(S,null,{default:d(()=>{var s;return[m(n(a.$t("settings.config_player",[e.value.name||((s=l(t).players[e.value.player_id])==null?void 0:s.name)||e.value.default_name])),1)]}),_:1}),y(v,null,{default:d(()=>[u("b",null,n(a.$t("settings.player_id"))+": ",1),m(n(e.value.player_id),1)]),_:1}),y(v,null,{default:d(()=>{var s,$;return[u("b",null,n(a.$t("settings.player_provider"))+": ",1),m(n((s=l(t).getProviderManifest(e.value.provider))==null?void 0:s.name)+" ",1),($=l(t).getProviderManifest(e.value.provider))!=null&&$.documentation?(i(),b("a",{key:0,onClick:r[0]||(r[0]=L=>{var c;return l(U)((c=l(t).getProviderManifest(e.value.provider))==null?void 0:c.documentation)})}," ["+n(a.$t("settings.check_docs"))+"]",1)):o("",!0)]}),_:1}),l(t).players[e.value.player_id]?(i(),p(v,{key:0},{default:d(()=>[u("b",null,n(a.$t("settings.player_model"))+": ",1),m(n(l(t).players[e.value.player_id].device_info.manufacturer)+" / "+n(l(t).players[e.value.player_id].device_info.model),1)]),_:1})):o("",!0),(_=l(t).players[e.value.player_id])!=null&&_.device_info.ip_address?(i(),p(v,{key:1},{default:d(()=>[u("b",null,n(a.$t("settings.player_address"))+": ",1),m(n(l(t).players[e.value.player_id].device_info.ip_address),1)]),_:1})):o("",!0),l(t).players[e.value.player_id]?(i(),p(v,{key:2},{default:d(()=>[u("b",null,n(a.$t("settings.player_type_label"))+": ",1),m(n(a.$t(`player_type.${l(t).players[e.value.player_id].type}`)),1)]),_:1})):o("",!0),r[3]||(r[3]=u("br",null,null,-1)),y(C),r[4]||(r[4]=u("br",null,null,-1)),r[5]||(r[5]=u("br",null,null,-1)),"name"in e.value?(i(),p(O,{key:3,modelValue:e.value.name,"onUpdate:modelValue":r[1]||(r[1]=s=>e.value.name=s),placeholder:(V=e.value)==null?void 0:V.name,label:a.$t("settings.player_name"),variant:"outlined",clearable:"",class:"configcolumnleft",style:{"margin-right":"25px"}},null,8,["modelValue","placeholder","label"])):o("",!0),"enabled"in e.value?(i(),p(j,{key:4,modelValue:e.value.enabled,"onUpdate:modelValue":r[2]||(r[2]=s=>e.value.enabled=s),label:a.$t("settings.enable_player"),color:"primary",disabled:(k=l(t).getProviderManifest(e.value.provider))==null?void 0:k.builtin},null,8,["modelValue","label","disabled"])):o("",!0),l(t).players[e.value.player_id].type!==l(E).GROUP?(i(),p(F,{key:5,onClick:w},{default:d(()=>[m(n(a.$t("open_dsp_settings")),1)]),_:1})):o("",!0)])):o("",!0),r[6]||(r[6]=u("br",null,null,-1)),y(C),e.value?(i(),p(R,{key:1,disabled:!e.value.enabled,"config-entries":Object.values(e.value.values),onSubmit:T},null,8,["disabled","config-entries"])):o("",!0)]}),_:1})]))}});export{te as default};
