import{Ft as e,G as t,Rt as n,U as r,Y as i,_t as a,mt as o,xt as s,zt as c}from"./dom-CdSnbvZ6.js";import{d as l,t as u}from"./settings-BF7JcItU.js";import{p as d}from"./index-_dGt2VRU.js";import{t as f}from"./director-CPAw3I6Y.js";import{n as p}from"./QPage-DW5fWlLu.js";function m(e){return[...String(e??``)].reduce((e,t)=>e*33+t.charCodeAt(0)>>>0,5381)}var h=[{background:`#1976D2`,text:`#FFFFFF`,border:`#1565C0`},{background:`#00897B`,text:`#FFFFFF`,border:`#00695C`},{background:`#EF6C00`,text:`#FFFFFF`,border:`#E65100`},{background:`#8E24AA`,text:`#FFFFFF`,border:`#6A1B9A`},{background:`#039BE5`,text:`#FFFFFF`,border:`#0277BD`},{background:`#C2185B`,text:`#FFFFFF`,border:`#880E4F`},{background:`#7CB342`,text:`#FFFFFF`,border:`#558B2F`},{background:`#546E7A`,text:`#FFFFFF`,border:`#37474F`}];function g(e){return[...new Set((e??[]).map(e=>String(e??``).trim()).filter(Boolean))]}function _(e,t=[]){let n=String(e??``).trim();if(!n)return{background:`#ECEFF1`,text:`#37474F`,border:`#B0BEC5`};let r=g(t).indexOf(n);return r>=0?h[r%h.length]:h[m(n)%h.length]}var v={__name:`DirectorBadge`,props:{director:{type:String,required:!0},icon:{type:String,default:null},dense:{type:Boolean,default:!0},square:{type:Boolean,default:!0},clickable:{type:Boolean,default:!1},removable:{type:Boolean,default:!1},size:{type:String,default:null}},emits:[`remove`],setup(m){let h=m,g=l(),v=d(),y=u(),b=r(()=>f({availableDirectors:v.availableDirectors,selectedDirectors:y.selectedDirectors,currentDirector:g.user?.director,fallbackDirector:y.directorName}).map(e=>e.value)),x=r(()=>{let e=_(h.director,b.value);return{backgroundColor:e.background,color:e.text,border:`1px solid ${e.border}`}});return(r,l)=>(o(),t(p,{dense:m.dense,square:m.square,size:m.size,icon:m.icon||void 0,clickable:m.clickable,removable:m.removable,style:n(x.value),onRemove:l[0]||=e=>r.$emit(`remove`)},{default:s(()=>[a(r.$slots,`default`,{},()=>[i(c(e(v)),1)])]),_:3},8,[`dense`,`square`,`size`,`icon`,`clickable`,`removable`,`style`]))}};export{_ as n,v as t};