import{d as $,ak as P,r as n,x as V,b as v,P as S,c as T,h as U,f as a,w as r,g as s,W as i,t as d,u as _}from"./index-CLKg64ON.js";import{b as B,V as N,a as q}from"./VCardText-BAUfdzDA.js";import{V as w}from"./VList-BvG6-yh2.js";import{a as F,V as f}from"./VForm-Cft_KNdc.js";import{V as j}from"./VTextField-C1QkMZRy.js";import{s as g}from"./VListItem-B_TSjQ1y.js";import"./VCheckboxBtn-DXJHHMHd.js";import"./VMenu-CLSWQG_U.js";import"./VVirtualScroll-DKBgr9yN.js";const A={style:{"margin-left":"-5px","margin-right":"-5px"}},H=$({__name:"AddPlayerGroup",setup(D){const b=P(),u=n("universal"),m=n(""),o=n([]),p=n(!1),y=V(()=>[{name:"Universal",instance_id:"universal"},...Object.values(v.providers).filter(l=>l.supported_features.includes(S.SYNC_PLAYERS))]),k=V(()=>Object.values(v.players).filter(l=>l.available&&!l.provider.startsWith("player_group")&&(l.provider==u.value||u.value=="universal"))),C=async function(){v.createPlayerGroup(u.value,m.value,o.value),b.push({name:"playersettings"})};return(l,e)=>(T(),U("section",null,[a(B,null,{default:r(()=>[s("div",A,[a(N,null,{default:r(()=>[i(d(l.$t("settings.add_group_player")),1)]),_:1}),a(q,{style:{"white-space":"break-spaces"}},{default:r(()=>[i(d(l.$t("settings.add_group_player_desc")),1)]),_:1}),e[6]||(e[6]=s("br",null,null,-1)),a(w),e[7]||(e[7]=s("br",null,null,-1)),e[8]||(e[8]=s("br",null,null,-1)),a(F,{ref:"form",modelValue:p.value,"onUpdate:modelValue":e[3]||(e[3]=t=>p.value=t),style:{"margin-right":"10px"}},{default:r(()=>[a(f,{modelValue:u.value,"onUpdate:modelValue":e[0]||(e[0]=t=>u.value=t),clearable:"",items:y.value,"item-title":"name","item-value":"instance_id",label:l.$t("settings.group_type"),required:"",disabled:o.value.length>0},null,8,["modelValue","items","label","disabled"]),a(j,{modelValue:m.value,"onUpdate:modelValue":e[1]||(e[1]=t=>m.value=t),label:l.$t("settings.player_name"),variant:"outlined",clearable:"",required:""},null,8,["modelValue","label"]),a(f,{modelValue:o.value,"onUpdate:modelValue":e[2]||(e[2]=t=>o.value=t),clearable:"",multiple:"",items:k.value,"item-title":"display_name","item-value":"player_id",label:l.$t("settings.group_members"),required:""},null,8,["modelValue","items","label"]),e[5]||(e[5]=s("br",null,null,-1)),a(g,{block:"",color:"primary",disabled:!p.value||o.value.length==0,onClick:C},{default:r(()=>[i(d(l.$t("settings.save")),1)]),_:1},8,["disabled"])]),_:1},8,["modelValue"]),e[9]||(e[9]=s("br",null,null,-1)),a(g,{block:"",onClick:e[4]||(e[4]=t=>_(b).back())},{default:r(()=>[i(d(l.$t("close")),1)]),_:1})])]),_:1})]))}});export{H as default};
