{"version":3,"file":"CopilotChatSuggestionPill.cjs","names":["React","cn","Loader2"],"sources":["../../../src/components/chat/CopilotChatSuggestionPill.tsx"],"sourcesContent":["import React from \"react\";\nimport { Loader2 } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface CopilotChatSuggestionPillProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n  /** Optional icon to render on the left side when not loading. */\n  icon?: React.ReactNode;\n  /** Whether the pill should display a loading spinner. */\n  isLoading?: boolean;\n}\n\nconst baseClasses =\n  \"group cpk:inline-flex cpk:h-7 cpk:sm:h-8 cpk:items-center cpk:gap-1 cpk:sm:gap-1.5 cpk:rounded-full cpk:border cpk:border-border/60 cpk:bg-background cpk:px-2.5 cpk:sm:px-3 cpk:text-[11px] cpk:sm:text-xs cpk:leading-none cpk:text-foreground cpk:transition-colors cpk:cursor-pointer cpk:hover:bg-accent/60 cpk:hover:text-foreground cpk:focus-visible:outline-none cpk:focus-visible:ring-2 cpk:focus-visible:ring-ring cpk:focus-visible:ring-offset-2 cpk:focus-visible:ring-offset-background cpk:disabled:cursor-not-allowed cpk:disabled:text-muted-foreground cpk:disabled:hover:bg-background cpk:disabled:hover:text-muted-foreground cpk:pointer-events-auto\";\n\nconst labelClasses = \"cpk:whitespace-nowrap cpk:font-medium cpk:leading-none\";\n\nexport const CopilotChatSuggestionPill = React.forwardRef<\n  HTMLButtonElement,\n  CopilotChatSuggestionPillProps\n>(function CopilotChatSuggestionPill(\n  { className, children, icon, isLoading, type, ...props },\n  ref,\n) {\n  const showIcon = !isLoading && icon;\n\n  return (\n    <button\n      ref={ref}\n      data-copilotkit\n      data-testid=\"copilot-suggestion\"\n      data-slot=\"suggestion-pill\"\n      className={cn(baseClasses, className)}\n      type={type ?? \"button\"}\n      aria-busy={isLoading || undefined}\n      disabled={isLoading || props.disabled}\n      {...props}\n    >\n      {isLoading ? (\n        <span className=\"cpk:flex cpk:h-3.5 cpk:sm:h-4 cpk:w-3.5 cpk:sm:w-4 cpk:items-center cpk:justify-center cpk:text-muted-foreground\">\n          <Loader2\n            className=\"cpk:h-3.5 cpk:sm:h-4 cpk:w-3.5 cpk:sm:w-4 cpk:animate-spin\"\n            aria-hidden=\"true\"\n          />\n        </span>\n      ) : (\n        showIcon && (\n          <span className=\"cpk:flex cpk:h-3.5 cpk:sm:h-4 cpk:w-3.5 cpk:sm:w-4 cpk:items-center cpk:justify-center cpk:text-muted-foreground\">\n            {icon}\n          </span>\n        )\n      )}\n      <span className={labelClasses}>{children}</span>\n    </button>\n  );\n});\n\nCopilotChatSuggestionPill.displayName = \"CopilotChatSuggestionPill\";\n\nexport default CopilotChatSuggestionPill;\n"],"mappings":";;;;;;;;AAWA,MAAM,cACJ;AAEF,MAAM,eAAe;AAErB,MAAa,4BAA4BA,cAAM,WAG7C,SAAS,0BACT,EAAE,WAAW,UAAU,MAAM,WAAW,MAAM,GAAG,SACjD,KACA;CACA,MAAM,WAAW,CAAC,aAAa;AAE/B,QACE,4CAAC;EACM;EACL;EACA,eAAY;EACZ,aAAU;EACV,WAAWC,iBAAG,aAAa,UAAU;EACrC,MAAM,QAAQ;EACd,aAAW,aAAa;EACxB,UAAU,aAAa,MAAM;EAC7B,GAAI;aAEH,YACC,2CAAC;GAAK,WAAU;aACd,2CAACC;IACC,WAAU;IACV,eAAY;KACZ;IACG,GAEP,YACE,2CAAC;GAAK,WAAU;aACb;IACI,EAGX,2CAAC;GAAK,WAAW;GAAe;IAAgB;GACzC;EAEX;AAEF,0BAA0B,cAAc"}