import{c as u,d as h}from"./chunk-6B6CBPYV.js";import{e as s}from"./chunk-ADEKKGI2.js";var i,m=s(()=>{i=(function(o){return o[o.None=0]="None",o[o.External=1]="External",o[o.Privileged=2]="Privileged",o[o.Contractor=4]="Contractor",o})(i||{});(function(o){function t(){return"SystemUserTags"}o.getClass=t;function n(e){let r="";return typeof o.getClass=="function"&&(r=o.getClass()),r+"_"+o[e]}o.getEnumKey=n})(i||(i={}))});var a,f=s(()=>{h();a=class o{constructor(t=null,n=null,e){this.clone=()=>new o(null,null,this),this.name=t??u.manageDefaultValue(e,"name","")??"",this.theme=n??u.manageDefaultValue(e,"theme","")??""}}});var l,p,g=s(()=>{m();f();l=class l{constructor(){}static getTheme(t){let n=Number.isInteger(t)?i.getEnumKey(t):t;return this.THEME_MAP.get(n)}static setupTagObserver(t,n){let e=document.querySelector(t);if(!e)return null;let r=new MutationObserver(()=>{l.applyTagClasses(n)});return r.observe(e,{childList:!0,subtree:!0}),l.applyTagClasses(n),r}static applyTagClasses(t){Array.from(document.getElementsByClassName("p-multiselect-chip")).forEach((e,r)=>{if(r<t.length){let c=l.getTheme(i.getEnumKey(t[r]));c&&!e.classList.contains(c)&&e.classList.add(c)}})}static applyColorToLastTag(t){let n=Array.from(document.querySelectorAll("div.p-multiselect-token"));if(n.length===0)return;let e=n[n.length-1],r=l.getTheme(i.getEnumKey(t));r&&e.classList.add(r)}static toInt(t){return t.reduce((n,e)=>n|e,0)}static fromInt(t){let n=[],e=1;for(;t>0;)t&e&&(n.push(e),t^=e),e<<=1;return n}static toVMTags(t){let n=()=>l.fromInt(t.systemTags).map(e=>new a(String(e),l.getTheme(i.getEnumKey(e))));return t?n():null}};l.THEME_MAP=new Map([["SystemUserTags_Contractor","contractor"],["SystemUserTags_External","external"],["SystemUserTags_Privileged","privileged"]]);p=l});export{i as a,m as b,p as c,g as d};
