import{U as S,x as i,c as C,a6 as y,a0 as U,X as d,F as t,Y as r,bG as _,E as s,W as g,b1 as L,as as m,ad as p,a2 as V,bC as T,b2 as f,$ as M,ab as N,bH as P}from"./index-B-lUZalq.js";import{V as D}from"./VForm-C-dO2GIE.js";import{V as F}from"./VTextField-B-d5Pe9I.js";import{a as G,V as E}from"./VSwitch-Bhk7qcAi.js";import{a as c}from"./VBtn-BPJ1JKW-.js";import"./VInput-BWBQqjuk.js";import"./VVirtualScroll-CceW16X7.js";const j={style:{"margin-left":"-5px","margin-right":"-5px"}},Y=S({__name:"AddPlayerGroup",props:{provider:{}},setup(w){const k=P(),v=i(""),n=i([]),o=i(!0),b=i(!1),$=w,u=C(()=>y.getProvider($.provider)),H=C(()=>Object.values(y.players).filter(l=>l.available&&l.provider==u.value?.lookup_key)),B=async function(){y.createPlayerGroup($.provider,v.value,n.value,o.value),k.push({name:"playersettings"})};return(l,e)=>(d(),U("section",null,[t(_,null,{default:r(()=>[s("div",j,[t(L,null,{default:r(()=>[m(p(l.$t("settings.add_group_player")),1)]),_:1}),u.value?.lookup_key==="universal_group"?(d(),g(f,{key:0,style:{"white-space":"break-spaces"},innerHTML:V(T)(l.$t("settings.add_group_player_desc_universal"))},null,8,["innerHTML"])):(d(),g(f,{key:1,style:{"white-space":"break-spaces"},innerHTML:V(T)(l.$t("settings.add_group_player_desc",[u.value?.name]))},null,8,["innerHTML"])),e[6]||(e[6]=s("br",null,null,-1)),t(M),e[7]||(e[7]=s("br",null,null,-1)),e[8]||(e[8]=s("br",null,null,-1)),t(D,{ref:"form",modelValue:b.value,"onUpdate:modelValue":e[3]||(e[3]=a=>b.value=a),style:{"margin-right":"10px"}},{default:r(()=>[t(F,{modelValue:v.value,"onUpdate:modelValue":e[0]||(e[0]=a=>v.value=a),label:l.$t("settings.player_name"),variant:"outlined",clearable:"",required:"",rules:[a=>a.length||l.$t("settings.invalid_input")]},null,8,["modelValue","label","rules"]),t(G,{modelValue:n.value,"onUpdate:modelValue":e[1]||(e[1]=a=>n.value=a),clearable:"",multiple:"",items:H.value,"item-title":"display_name","item-value":"player_id",label:l.$t("settings.group_members")},null,8,["modelValue","items","label"]),t(E,{modelValue:o.value,"onUpdate:modelValue":e[2]||(e[2]=a=>o.value=a),color:"primary",label:l.$t("settings.dynamic_members.label")},null,8,["modelValue","label"]),u.value?.lookup_key!=="universal_group"?(d(),g(f,{key:0,style:{"white-space":"break-spaces","padding-left":"0","margin-top":"-25px","margin-bottom":"35px"}},{default:r(()=>[m(p(l.$t("settings.dynamic_members.description")),1)]),_:1})):N("",!0),e[5]||(e[5]=s("br",null,null,-1)),t(c,{block:"",color:"primary",disabled:!b.value||n.value.length==0&&!o.value,onClick:B},{default:r(()=>[m(p(l.$t("settings.save")),1)]),_:1},8,["disabled"])]),_:1},8,["modelValue"]),e[9]||(e[9]=s("br",null,null,-1)),t(c,{block:"",onClick:e[4]||(e[4]=a=>V(k).back())},{default:r(()=>[m(p(l.$t("close")),1)]),_:1})])]),_:1})]))}});export{Y as default};
