import{x as B,aA as P,r as n,c as y,I as b,P as U,y as w,D as A,n as a,A as r,B as s,S as m,J as d,G as f,aB as N}from"./index-Dvn4b3kE.js";import{b as q,V as D,a as g}from"./VCardText-CXkKR7ML.js";import{V as F}from"./VList-BFxH2oe3.js";import{V as G}from"./VForm-3D0lQdNE.js";import{a as k,V as H}from"./VSwitch-BjWr2FW1.js";import{V as L}from"./VTextField-CNfw_aKz.js";import{v as $}from"./VListItem-XlHdRn90.js";import"./VCheckboxBtn-B2R62I44.js";import"./VMenu-BxZEtUbH.js";import"./VVirtualScroll-DezxvIhI.js";import"./VChip-BKGA7XXZ.js";const _={style:{"margin-left":"-5px","margin-right":"-5px"}},K=B({__name:"AddPlayerGroup",setup(j){const V=P(),o=n("universal"),p=n(""),u=n([]),i=n(!1),v=n(!1),C=y(()=>[{name:"Universal",lookup_key:"universal"},...Object.values(b.providers).filter(l=>l.supported_features.includes(U.SYNC_PLAYERS))]),S=y(()=>Object.values(b.players).filter(l=>l.available&&!l.provider.startsWith("player_group")&&(l.provider==o.value||o.value=="universal"))),T=async function(){b.createPlayerGroup(o.value,p.value,u.value,i.value),V.push({name:"playersettings"})};return(l,e)=>(w(),A("section",null,[a(q,null,{default:r(()=>[s("div",_,[a(D,null,{default:r(()=>[m(d(l.$t("settings.add_group_player")),1)]),_:1}),a(g,{style:{"white-space":"break-spaces"},innerHTML:f(N)(l.$t("settings.add_group_player_desc"))},null,8,["innerHTML"]),e[7]||(e[7]=s("br",null,null,-1)),a(F),e[8]||(e[8]=s("br",null,null,-1)),e[9]||(e[9]=s("br",null,null,-1)),a(G,{ref:"form",modelValue:v.value,"onUpdate:modelValue":e[4]||(e[4]=t=>v.value=t),style:{"margin-right":"10px"}},{default:r(()=>[a(k,{modelValue:o.value,"onUpdate:modelValue":e[0]||(e[0]=t=>o.value=t),clearable:"",items:C.value,"item-title":"name","item-value":"lookup_key",label:l.$t("settings.group_type"),required:"",disabled:u.value.length>0},null,8,["modelValue","items","label","disabled"]),a(H,{modelValue:i.value,"onUpdate:modelValue":e[1]||(e[1]=t=>i.value=t),color:"primary",label:l.$t("settings.dynamic_members.label")},null,8,["modelValue","label"]),a(g,{style:{"white-space":"break-spaces","padding-left":"0","margin-top":"-25px","margin-bottom":"35px"}},{default:r(()=>[m(d(l.$t("settings.dynamic_members.description")),1)]),_:1}),a(L,{modelValue:p.value,"onUpdate:modelValue":e[2]||(e[2]=t=>p.value=t),label:l.$t("settings.player_name"),variant:"outlined",clearable:"",required:""},null,8,["modelValue","label"]),a(k,{modelValue:u.value,"onUpdate:modelValue":e[3]||(e[3]=t=>u.value=t),clearable:"",multiple:"",items:S.value,"item-title":"display_name","item-value":"player_id",label:l.$t("settings.group_members"),required:""},null,8,["modelValue","items","label"]),e[6]||(e[6]=s("br",null,null,-1)),a($,{block:"",color:"primary",disabled:!v.value||u.value.length==0&&!i.value,onClick:T},{default:r(()=>[m(d(l.$t("settings.save")),1)]),_:1},8,["disabled"])]),_:1},8,["modelValue"]),e[10]||(e[10]=s("br",null,null,-1)),a($,{block:"",onClick:e[5]||(e[5]=t=>f(V).back())},{default:r(()=>[m(d(l.$t("close")),1)]),_:1})])]),_:1})]))}});export{K as default};
