1import{r as u,j as e}from"./app-DkXnh3us.js";import{B as j}from"./badge-slBZeyN7.js";import{B as o}from"./button-EcHs8ZEk.js";import{a as f,b as N,c as C}from"./tooltip-B2dpBpea.js";import{g as T}from"./tag-helpers-CnVh8WEs.js";import{UserTagsDialog as x}from"./user-tags-dialog-As9fMpXP.js";import n from"./tag-i4bAE59j.js";/* empty css */import"./index-pU-cdsF3.js";import"./index-DhXnAMyA.js";import"./utils-DBwg5IJ2.js";import"./index-CpIFypxQ.js";import"./index-DGmcryqY.js";import"./index-BIX0Iv31.js";import"./index-BnGoBzI_.js";import"./index-iwpbji1u.js";import"./index-v5F7psb5.js";import"./index-CdyOyO7G.js";import"./index-BXf7tClM.js";import"./index-DVx5sUYL.js";import"./index-B0Nuj8oA.js";import"./checkbox-Dsae48bo.js";import"./index-D1CqRP8V.js";import"./check-CTtdibuw.js";import"./createLucideIcon-BuS3t6ux.js";import"./dialog-BdYVPbr6.js";import"./index-FJD0-OMo.js";import"./x-DXxm2mYj.js";import"./input-Cq_DHc9b.js";function Z({tags:t,user:a,allTags:m,displayMode:d="compact",maxVisible:p=3}){const[l,r]=u.useState(!1);if(d==="expanded"){const s=t.slice(0,p),h=Math.max(0,t.length-p);return e.jsxs("div",{className:"flex max-w-96 flex-wrap items-center gap-1",children:[s.map(i=>e.jsx(j,{className:`cursor-pointer text-xs transition-opacity hover:opacity-80 ${T(i.color)}`,onClick:()=>r(!0),variant:"outline",children:i.name},i.id)),h>0&&e.jsxs(o,{className:"h-5 px-1 text-xs",onClick:()=>r(!0),size:"sm",variant:"ghost",children:["+",h," more"]}),t.length>0&&e.jsxs(o,{className:"h-5 w-5 p-0",onClick:()=>r(!0),size:"sm",variant:"ghost",children:[e.jsx(n,{className:"h-3 w-3"}),e.jsx("span",{className:"sr-only",children:"Manage tags"})]}),t.length===0&&e.jsxs(o,{className:"h-6 px-2",onClick:()=>r(!0),size:"sm",variant:"ghost",children:[e.jsx(n,{className:"mr-1 h-3 w-3"}),"No tags"]}),e.jsx(x,{allTags:m,onOpenChange:r,open:l,user:{...a,tags:t}})]})}const g=()=>t.length===0?"No tags":t.length===1?"One tag":`${t.length} tags`,c=e.jsxs(o,{className:"h-6 px-2",onClick:()=>r(!0),size:"sm",variant:"ghost",children:[e.jsx(n,{className:"mr-1 h-3 w-3"}),g()]});return e.jsxs("div",{className:"flex items-center",children:[t.length>0?e.jsxs(f,{children:[e.jsx(N,{asChild:!0,children:c}),e.jsx(C,{children:t.map(s=>s.name).join(", ")})]}):c,e.jsx(x,{allTags:m,onOpenChange:r,open:l,user:{...a,tags:t}})]})}export{Z as UserTagsBadge};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.