import{d as w,an as N,r as B,N as E,c as n,g as f,f as o,w as s,u as t,Y as p,t as r,i,j as d,e as m,b as l}from"./index-5e5d70f8.js";import{V as S,E as T}from"./EditConfig-3f19f4c9.js";import{V as I,a as v,b as j}from"./VCardText-bdfad4e5.js";import{V as $}from"./VList-1bffb8df.js";import{V as D}from"./VTextField-fa7e9a48.js";import"./VExpansionPanels-be177469.js";import"./VListItem-a276ed14.js";import"./VCheckboxBtn-d41d6adf.js";import"./VMenu-4ca080f5.js";import"./VForm-b8a697a6.js";import"./VVirtualScroll-a35573be.js";import"./VCard-35632c3b.js";import"./VSpacer-3df5a092.js";/* empty css              */import"./VDialog-8fad6ca7.js";import"./VAlert-8c135db5.js";import"./_plugin-vue_export-helper-c27b6911.js";const U={key:0,style:{"margin-left":"-5px","margin-right":"-5px"}},F=["href"],O=i("br",null,null,-1),R=i("br",null,null,-1),Y=i("br",null,null,-1),q=i("br",null,null,-1),ie=w({__name:"EditPlayer",props:{playerId:{}},setup(C){const P=N(),e=B(),c=C;E(()=>c.playerId,async a=>{a&&(e.value=await l.getPlayerConfig(a))},{immediate:!0});const M=async function(a){a.enabled=e.value.enabled,a.name=e.value.name||null,l.savePlayerConfig(c.playerId,a),P.push({name:"playersettings"})};return(a,y)=>(n(),f("section",null,[o(j,null,{default:s(()=>{var _,b,g;return[e.value&&t(l).getProviderManifest(e.value.provider).domain in t(l).providerManifests?(n(),f("div",U,[o(I,null,{default:s(()=>[p(r(a.$t("settings.config_player",[e.value.name||t(l).players[e.value.player_id].name])),1)]),_:1}),o(v,null,{default:s(()=>[i("b",null,r(a.$t("settings.player_id"))+": ",1),p(r(e.value.player_id),1)]),_:1}),o(v,null,{default:s(()=>{var u,V,h,k;return[i("b",null,r(a.$t("settings.player_provider"))+": ",1),p(r((u=t(l).getProviderManifest(e.value.provider))==null?void 0:u.name)+" ( "+r((V=t(l).getProviderManifest(e.value.provider))==null?void 0:V.description)+") ",1),(h=t(l).getProviderManifest(e.value.provider))!=null&&h.documentation?(n(),f("a",{key:0,href:(k=t(l).getProviderManifest(e.value.provider))==null?void 0:k.documentation,target:"_blank"},r(a.$t("settings.check_docs")),9,F)):d("",!0)]}),_:1}),t(l).players[e.value.player_id]?(n(),m(v,{key:0},{default:s(()=>[i("b",null,r(a.$t("settings.player_model"))+": ",1),p(r(t(l).players[e.value.player_id].device_info.manufacturer)+" / "+r(t(l).players[e.value.player_id].device_info.model),1)]),_:1})):d("",!0),(_=t(l).players[e.value.player_id])!=null&&_.device_info.address?(n(),m(v,{key:1},{default:s(()=>[i("b",null,r(a.$t("settings.player_address"))+": ",1),p(r(t(l).players[e.value.player_id].device_info.address),1)]),_:1})):d("",!0),o(v,null,{default:s(()=>[i("b",null,r(a.$t("settings.player_type_label"))+": ",1),p(r(a.$t(`player_type.${t(l).players[e.value.player_id].type}`)),1)]),_:1}),O,o($),R,Y,"name"in e.value?(n(),m(D,{key:2,modelValue:e.value.name,"onUpdate:modelValue":y[0]||(y[0]=u=>e.value.name=u),placeholder:(b=e.value)==null?void 0:b.name,label:a.$t("settings.player_name"),variant:"outlined",clearable:"",class:"configcolumnleft",style:{"margin-right":"25px"}},null,8,["modelValue","placeholder","label"])):d("",!0),"enabled"in e.value?(n(),m(S,{key:3,modelValue:e.value.enabled,"onUpdate:modelValue":y[1]||(y[1]=u=>e.value.enabled=u),label:a.$t("settings.enable_player"),color:"primary",disabled:(g=t(l).getProviderManifest(e.value.provider))==null?void 0:g.builtin},null,8,["modelValue","label","disabled"])):d("",!0)])):d("",!0),q,o($),e.value?(n(),m(T,{key:1,disabled:!e.value.enabled,"config-entries":Object.values(e.value.values),onSubmit:M},null,8,["disabled","config-entries"])):d("",!0)]}),_:1})]))}});export{ie as default};
