"use strict";const o=require("react"),u=require("./index-2wUhd9Lu.js"),e=require("lucide-react"),d={getAll:()=>u.api.get("/administration/tenants/type-settings"),update:(t,s)=>u.api.put(`/administration/tenants/type-settings/${t}`,s)};let i=null,r=null;const b={Personal:{icon:"User",iconType:"Lucide",color:"violet"},Business:{icon:"Building2",iconType:"Lucide",color:"blue"},System:{icon:"Server",iconType:"Lucide",color:"gray"}};function v(){const[t,s]=o.useState(i??[]),[y,g]=o.useState(!i),[x,c]=o.useState(null),l=o.useCallback(async()=>{try{g(!0),c(null),r||(r=d.getAll());const a=await r,n=Array.isArray(a)?a:[];i=n,r=null,s(n)}catch{r=null,c("Failed to load tenant type settings")}finally{g(!1)}},[]);o.useEffect(()=>{i||l()},[l]);const m=o.useCallback(a=>{const n=(t??[]).find(C=>C.type===a);return n?{icon:n.icon,iconType:n.iconType,color:n.color}:b[a]??b.Business},[t]),S=o.useCallback(async()=>{i=null,r=null,await l()},[l]);return{settings:t,loading:y,error:x,getIconForType:m,reload:S}}const p={Building2:e.Building2,User:e.User,Server:e.Server,Building:e.Building,Home:e.Home,Briefcase:e.Briefcase,Globe:e.Globe,Shield:e.Shield,Users:e.Users,Crown:e.Crown,Warehouse:e.Warehouse,Store:e.Store,Factory:e.Factory,Landmark:e.Landmark,HardDrive:e.HardDrive,Cloud:e.Cloud,Database:e.Database,Monitor:e.Monitor,Laptop:e.Laptop},A=t=>p[t]??e.Building2,L=()=>Object.keys(p),T=t=>({blue:{bg:"bg-blue-500/10",text:"text-blue-500"},violet:{bg:"bg-violet-500/10",text:"text-violet-500"},gray:{bg:"bg-gray-500/10",text:"text-gray-500"},green:{bg:"bg-green-500/10",text:"text-green-500"},red:{bg:"bg-red-500/10",text:"text-red-500"},amber:{bg:"bg-amber-500/10",text:"text-amber-500"},purple:{bg:"bg-purple-500/10",text:"text-purple-500"},cyan:{bg:"bg-cyan-500/10",text:"text-cyan-500"},pink:{bg:"bg-pink-500/10",text:"text-pink-500"},emerald:{bg:"bg-emerald-500/10",text:"text-emerald-500"},orange:{bg:"bg-orange-500/10",text:"text-orange-500"},indigo:{bg:"bg-indigo-500/10",text:"text-indigo-500"}})[t]??{bg:"bg-gray-500/10",text:"text-gray-500"},f=()=>["blue","violet","gray","green","red","amber","purple","cyan","pink","emerald","orange","indigo"];exports.getAvailableColors=f;exports.getAvailableIconNames=L;exports.getColorClasses=T;exports.getLucideIcon=A;exports.tenantTypeSettingsApi=d;exports.useTenantTypeSettings=v;
//# sourceMappingURL=tenantIconMap-DtdUgvJO.js.map
