import{d as B,r as i,O as T,v as g,bg as H,c as S,b as t,w as r,bJ as U,o as d,a as s,h as V,b4 as L,b5 as p,t as m,u as f,bF as C,b6 as k,y as M,e as N,f as D}from"./index-CD7iYaFT.js";import{V as F}from"./VForm-CSOJ83b-.js";import{V as G}from"./VTextField-CVfOZKc3.js";import{a as O,V as R}from"./VSwitch-Bf96mRby.js";import{V as w}from"./VBtn-B0XatuYF.js";import"./VInput-DDFZ8lhb.js";import"./VVirtualScroll-BREm3RjH.js";const j={style:{"margin-left":"-5px","margin-right":"-5px"}},Q=B({__name:"AddPlayerGroup",props:{provider:{}},setup(c){const $=D(),v=i(""),o=i([]),n=i(!0),b=i(!1),y=c,u=T(()=>g.getProvider(y.provider)),P=T(()=>Object.values(g.players).filter(l=>l.available&&l.type!=H.GROUP&&(l.provider==u.value?.lookup_key||y.provider==="universal_group"))),_=async function(){g.createPlayerGroup(y.provider,v.value,o.value,n.value),$.push({name:"playersettings"})};return(l,e)=>(d(),S("section",null,[t(U,null,{default:r(()=>[s("div",j,[t(L,null,{default:r(()=>[p(m(l.$t("settings.add_group_player")),1)]),_:1}),u.value?.lookup_key==="universal_group"?(d(),V(k,{key:0,style:{"white-space":"break-spaces"},innerHTML:f(C)(l.$t("settings.add_group_player_desc_universal"))},null,8,["innerHTML"])):(d(),V(k,{key:1,style:{"white-space":"break-spaces"},innerHTML:f(C)(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(F,{ref:"form",modelValue:b.value,"onUpdate:modelValue":e[3]||(e[3]=a=>b.value=a),style:{"margin-right":"10px"}},{default:r(()=>[t(G,{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>0||l.$t("settings.invalid_input")]},null,8,["modelValue","label","rules"]),t(O,{modelValue:o.value,"onUpdate:modelValue":e[1]||(e[1]=a=>o.value=a),clearable:"",multiple:"",items:P.value,"item-title":"display_name","item-value":"player_id",label:l.$t("settings.group_members")},null,8,["modelValue","items","label"]),t(R,{modelValue:n.value,"onUpdate:modelValue":e[2]||(e[2]=a=>n.value=a),color:"primary",label:l.$t("settings.dynamic_members.label")},null,8,["modelValue","label"]),u.value?.lookup_key!=="universal_group"?(d(),V(k,{key:0,style:{"white-space":"break-spaces","padding-left":"0","margin-top":"-25px","margin-bottom":"35px"}},{default:r(()=>[p(m(l.$t("settings.dynamic_members.description")),1)]),_:1})):N("",!0),e[5]||(e[5]=s("br",null,null,-1)),t(w,{block:"",color:"primary",disabled:!b.value||o.value.length==0&&!n.value,onClick:_},{default:r(()=>[p(m(l.$t("settings.save")),1)]),_:1},8,["disabled"])]),_:1},8,["modelValue"]),e[9]||(e[9]=s("br",null,null,-1)),t(w,{block:"",onClick:e[4]||(e[4]=a=>f($).back())},{default:r(()=>[p(m(l.$t("close")),1)]),_:1})])]),_:1})]))}});export{Q as default};
