@sonamu-kit/react-components 0.3.9 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-components.es.js","names":[],"sources":["../src/hooks/use-toast.ts","../src/lib/utils.ts","../src/components/ui/accordion.tsx","../src/components/ui/alert.tsx","../src/components/ui/button.tsx","../src/components/ui/alert-dialog.tsx","../src/components/ui/aspect-ratio.tsx","../src/components/ui/avatar.tsx","../src/components/ui/badge.tsx","../src/components/ui/breadcrumb.tsx","../src/components/ui/calendar.tsx","../src/components/ui/card.tsx","../src/components/ui/carousel.tsx","../src/components/ui/checkbox.tsx","../src/components/ui/collapsible.tsx","../src/i18n/rc-keys.ts","../src/contexts/sonamu-context.tsx","../src/components/ui/dialog.tsx","../src/components/ui/command.tsx","../src/components/ui/popover.tsx","../src/components/ui/combobox.tsx","../src/components/ui/common-modal.tsx","../src/components/ui/context-menu.tsx","../src/components/ui/input.tsx","../src/components/ui/date-input.tsx","../src/components/ui/date-picker.tsx","../src/components/ui/drawer.tsx","../src/components/ui/dropdown-menu.tsx","../src/components/ui/file-input.tsx","../src/components/ui/label.tsx","../src/components/ui/form.tsx","../src/components/ui/hover-card.tsx","../src/components/ui/input-otp.tsx","../src/components/ui/menubar.tsx","../src/components/ui/separator.tsx","../src/components/ui/select/select.tsx","../src/components/ui/month-picker-multiple.tsx","../src/components/ui/navigation-menu.tsx","../src/components/ui/pagination.tsx","../src/components/ui/progress.tsx","../src/components/ui/radio-group.tsx","../src/components/ui/range-number-input.tsx","../src/components/ui/resizable.tsx","../src/components/ui/scroll-area.tsx","../src/components/ui/select/enum-select.tsx","../src/components/ui/select/id-async-select.tsx","../src/components/ui/sheet.tsx","../src/lib/use-mobile.ts","../src/components/ui/skeleton.tsx","../src/components/ui/tooltip.tsx","../src/components/ui/sidebar.tsx","../src/components/ui/slider.tsx","../src/lib/types.ts","../src/components/ui/sonamu-filter/constants.ts","../src/components/ui/tag-input.tsx","../src/components/ui/sonamu-filter/value-input.tsx","../src/components/ui/sonamu-filter/rule-row-input.tsx","../src/components/ui/sonamu-filter/utils.ts","../src/components/ui/sonamu-filter/sonamu-filter-modal.tsx","../src/lib/caster.ts","../src/lib/base-helpers.ts","../src/lib/form-helpers.ts","../src/lib/list-helpers.ts","../src/lib/modal-helpers.ts","../src/components/ui/sonamu-filter/sonamu-filter-popover.tsx","../src/components/ui/switch.tsx","../src/components/ui/table.tsx","../src/components/ui/tabs.tsx","../src/components/ui/textarea.tsx","../src/components/ui/toast.tsx","../src/components/ui/toaster.tsx","../src/components/ui/toggle.tsx","../src/components/ui/toggle-group.tsx"],"sourcesContent":["\"use client\";\n\n// Inspired by react-hot-toast library\nimport * as React from \"react\";\n\nimport { type ToastActionElement, type ToastProps } from \"../components/ui/toast\";\n\nconst TOAST_LIMIT = 1;\nconst TOAST_REMOVE_DELAY = 1000000;\n\ntype ToasterToast = ToastProps & {\n id: string;\n title?: React.ReactNode;\n description?: React.ReactNode;\n action?: ToastActionElement;\n};\n\nconst actionTypes = {\n ADD_TOAST: \"ADD_TOAST\",\n UPDATE_TOAST: \"UPDATE_TOAST\",\n DISMISS_TOAST: \"DISMISS_TOAST\",\n REMOVE_TOAST: \"REMOVE_TOAST\",\n} as const;\n\nlet count = 0;\n\nfunction genId() {\n count = (count + 1) % Number.MAX_SAFE_INTEGER;\n return count.toString();\n}\n\ntype ActionType = typeof actionTypes;\n\ntype Action =\n | {\n type: ActionType[\"ADD_TOAST\"];\n toast: ToasterToast;\n }\n | {\n type: ActionType[\"UPDATE_TOAST\"];\n toast: Partial<ToasterToast>;\n }\n | {\n type: ActionType[\"DISMISS_TOAST\"];\n toastId?: ToasterToast[\"id\"];\n }\n | {\n type: ActionType[\"REMOVE_TOAST\"];\n toastId?: ToasterToast[\"id\"];\n };\n\ninterface State {\n toasts: ToasterToast[];\n}\n\nconst toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>();\n\nconst addToRemoveQueue = (toastId: string) => {\n if (toastTimeouts.has(toastId)) {\n return;\n }\n\n const timeout = setTimeout(() => {\n toastTimeouts.delete(toastId);\n dispatch({\n type: \"REMOVE_TOAST\",\n toastId: toastId,\n });\n }, TOAST_REMOVE_DELAY);\n\n toastTimeouts.set(toastId, timeout);\n};\n\nexport const reducer = (state: State, action: Action): State => {\n switch (action.type) {\n case \"ADD_TOAST\":\n return {\n ...state,\n toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),\n };\n\n case \"UPDATE_TOAST\":\n return {\n ...state,\n toasts: state.toasts.map((t) => (t.id === action.toast.id ? { ...t, ...action.toast } : t)),\n };\n\n case \"DISMISS_TOAST\": {\n const { toastId } = action;\n\n // ! Side effects ! - This could be extracted into a dismissToast() action,\n // but I'll keep it here for simplicity\n if (toastId) {\n addToRemoveQueue(toastId);\n } else {\n state.toasts.forEach((toast) => {\n addToRemoveQueue(toast.id);\n });\n }\n\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === toastId || toastId === undefined\n ? {\n ...t,\n open: false,\n }\n : t,\n ),\n };\n }\n case \"REMOVE_TOAST\":\n if (action.toastId === undefined) {\n return {\n ...state,\n toasts: [],\n };\n }\n return {\n ...state,\n toasts: state.toasts.filter((t) => t.id !== action.toastId),\n };\n }\n};\n\nconst listeners: Array<(state: State) => void> = [];\n\nlet memoryState: State = { toasts: [] };\n\nfunction dispatch(action: Action) {\n memoryState = reducer(memoryState, action);\n listeners.forEach((listener) => {\n listener(memoryState);\n });\n}\n\ntype Toast = Omit<ToasterToast, \"id\">;\n\nfunction toast({ ...props }: Toast) {\n const id = genId();\n\n const update = (props: ToasterToast) =>\n dispatch({\n type: \"UPDATE_TOAST\",\n toast: { ...props, id },\n });\n const dismiss = () => dispatch({ type: \"DISMISS_TOAST\", toastId: id });\n\n dispatch({\n type: \"ADD_TOAST\",\n toast: {\n ...props,\n id,\n open: true,\n onOpenChange: (open) => {\n if (!open) dismiss();\n },\n },\n });\n\n return {\n id: id,\n dismiss,\n update,\n };\n}\n\nfunction useToast() {\n const [state, setState] = React.useState(memoryState);\n\n React.useEffect(() => {\n listeners.push(setState);\n return () => {\n const index = listeners.indexOf(setState);\n if (index > -1) {\n listeners.splice(index, 1);\n }\n };\n }, []);\n\n return {\n ...state,\n toast,\n dismiss: (toastId?: string) => dispatch({ type: \"DISMISS_TOAST\", toastId }),\n };\n}\n\nexport { useToast, toast };\n","import { clsx } from \"clsx\";\nimport { type ClassValue } from \"clsx\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\n/**\n * 값을 배열로 정규화합니다.\n * 이미 배열이면 그대로 반환하고, 단일 값이면 배열로 감싸서 반환합니다.\n *\n * @param value - 정규화할 값 (단일 값 또는 배열)\n * @returns 배열로 정규화된 값 (undefined면 undefined 반환)\n *\n * @example\n * normalizeToArray(50) // [50]\n * normalizeToArray([20, 80]) // [20, 80]\n * normalizeToArray(undefined) // undefined\n */\nexport function normalizeToArray<T>(value: T | T[] | undefined): T[] | undefined {\n return value === undefined ? undefined : Array.isArray(value) ? value : [value];\n}\n\n/**\n * useObjectUrls 훅\n *\n * 로컬 File 객체 배열을 받아서 브라우저 메모리 기반 미리보기용 Object URL을 생성하고,\n * 컴포넌트가 언마운트되거나 파일이 변경될 때 자동으로 메모리를 해제합니다.\n *\n * **동작 방식**:\n * 1. File 배열을 받아서 각 파일마다 `URL.createObjectURL()`로 임시 URL 생성\n * 2. 생성된 URL은 `blob:http://...` 형태로, 브라우저 메모리를 직접 참조\n * 3. 컴포넌트 언마운트나 파일 변경 시 cleanup 함수가 `URL.revokeObjectURL()`로 메모리 해제\n *\n * @param files - 미리보기할 File 객체 배열\n * @returns 생성된 Object URL 문자열 배열\n */\nexport function useObjectUrls(files: File[]): string[] {\n const [urls, setUrls] = useState<string[]>([]);\n\n // File 객체의 내용 기반 서명 생성 (참조 비교가 아닌 값 비교)\n const signature = useMemo(\n () => files.map((f) => `${f.name}:${f.size}:${f.lastModified}`).join(\"|\"),\n [files],\n );\n\n useEffect(() => {\n // Object URL 생성\n const created = files.map((f) => URL.createObjectURL(f));\n setUrls(created);\n\n // Cleanup: 메모리 누수 방지를 위해 생성된 URL 해제\n return () => {\n for (const url of created) {\n URL.revokeObjectURL(url);\n }\n };\n }, [signature]);\n\n return urls;\n}\n","\"use client\";\n\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\";\nimport * as React from \"react\";\nimport ChevronDownIcon from \"~icons/lucide/chevron-down\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Accordion = AccordionPrimitive.Root;\n\nconst AccordionItem = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <AccordionPrimitive.Item ref={ref} className={cn(\"border-b\", className)} {...props} />\n));\nAccordionItem.displayName = \"AccordionItem\";\n\nconst AccordionTrigger = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronDownIcon className=\"h-4 w-4 shrink-0 transition-transform duration-200\" />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n));\nAccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;\n\nconst AccordionContent = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Content\n ref={ref}\n className=\"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down\"\n {...props}\n >\n <div className={cn(\"pb-4 pt-0\", className)}>{children}</div>\n </AccordionPrimitive.Content>\n));\n\nAccordionContent.displayName = AccordionPrimitive.Content.displayName;\n\nexport { Accordion, AccordionItem, AccordionTrigger, AccordionContent };\n","import { cva } from \"class-variance-authority\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst alertVariantsConfig = {\n variant: {\n default: \"bg-background text-foreground\",\n destructive:\n \"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive\",\n },\n} as const;\n\nconst alertVariants = cva(\n \"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground\",\n {\n variants: alertVariantsConfig,\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\nconst Alert = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>\n>(({ className, variant, ...props }, ref) => (\n <div ref={ref} role=\"alert\" className={cn(alertVariants({ variant }), className)} {...props} />\n));\nAlert.displayName = \"Alert\";\n\nconst AlertTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(\n ({ className, ...props }, ref) => (\n <h5\n ref={ref}\n className={cn(\"mb-1 font-medium leading-none tracking-tight\", className)}\n {...props}\n />\n ),\n);\nAlertTitle.displayName = \"AlertTitle\";\n\nconst AlertDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"text-sm [&_p]:leading-relaxed\", className)} {...props} />\n));\nAlertDescription.displayName = \"AlertDescription\";\n\nexport { Alert, alertVariantsConfig, AlertTitle, AlertDescription };\n","import { Slot } from \"@radix-ui/react-slot\";\nimport { cva } from \"class-variance-authority\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\nimport LoaderIcon from \"~icons/lucide/loader-2\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst buttonVariantsConfig = {\n variant: {\n // semantic variants (shadcn/ui 기본)\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n outline:\n \"border bg-background text-foreground hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50\",\n link: \"text-primary underline-offset-4 hover:underline\",\n\n // solid color variants\n red: \"bg-red-500 text-white hover:bg-red-600\",\n yellow: \"bg-yellow-500 text-white hover:bg-yellow-600\",\n green: \"bg-green-500 text-white hover:bg-green-600\",\n blue: \"bg-blue-500 text-white hover:bg-blue-600\",\n cyan: \"bg-cyan-500 text-white hover:bg-cyan-600\",\n purple: \"bg-purple-500 text-white hover:bg-purple-600\",\n pink: \"bg-pink-500 text-white hover:bg-pink-600\",\n orange: \"bg-orange-500 text-white hover:bg-orange-600\",\n },\n size: {\n // button sizes\n // - 아이콘만 있는 버튼: 정사각형 (px-0 aspect-square)\n // - 텍스트 / 아이콘 + 텍스트 버튼: 일반 패딩 유지 (가로 자동 확장)\n xs: \"h-6 px-2 py-1 text-xs [&_svg]:size-3 has-[>svg]:px-1.5 has-[>svg:only-child]:px-0 has-[>svg:only-child]:aspect-square\",\n sm: \"h-7 px-3 py-1.5 text-xs [&_svg]:size-3.5 has-[>svg]:px-2 has-[>svg:only-child]:px-0 has-[>svg:only-child]:aspect-square\",\n default:\n \"h-9 px-4 py-2 [&_svg]:size-4 has-[>svg]:px-3 has-[>svg:only-child]:px-0 has-[>svg:only-child]:aspect-square\",\n lg: \"h-11 px-6 py-3 text-base [&_svg]:size-5 has-[>svg]:px-4 has-[>svg:only-child]:px-0 has-[>svg:only-child]:aspect-square\",\n xl: \"h-13 px-8 py-4 text-lg [&_svg]:size-6 has-[>svg]:px-6 has-[>svg:only-child]:px-0 has-[>svg:only-child]:aspect-square\",\n },\n} as const;\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-button text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer\",\n {\n variants: buttonVariantsConfig,\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\ntype ButtonProps = React.ComponentProps<\"button\"> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean;\n icon?: React.ReactElement;\n loading?: boolean;\n };\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n { className, variant, size, icon, children, loading, disabled, asChild = false, ...props },\n ref,\n ) => {\n const Comp = asChild ? Slot : \"button\";\n\n const iconOnly = React.Children.count(children) === 0;\n\n const leadingIcon = loading ? <LoaderIcon className=\"animate-spin\" /> : icon;\n\n return (\n <Comp\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n disabled={disabled || loading}\n {...props}\n >\n {iconOnly ? (\n leadingIcon\n ) : leadingIcon ? (\n <span className=\"contents\">\n {leadingIcon}\n {children}\n </span>\n ) : (\n children\n )}\n </Comp>\n );\n },\n);\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants, buttonVariantsConfig, type ButtonProps };\n","import * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\nimport { buttonVariants } from \"./button\";\n\nconst AlertDialog = AlertDialogPrimitive.Root;\n\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger;\n\nconst AlertDialogPortal = AlertDialogPrimitive.Portal;\n\nconst AlertDialogOverlay = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Overlay\n className={cn(\n \"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className,\n )}\n {...props}\n ref={ref}\n />\n));\nAlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;\n\nconst AlertDialogContent = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <AlertDialogPortal>\n <AlertDialogOverlay />\n <AlertDialogPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg\",\n className,\n )}\n {...props}\n />\n </AlertDialogPortal>\n));\nAlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;\n\nconst AlertDialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn(\"flex flex-col space-y-2 text-center sm:text-left\", className)} {...props} />\n);\nAlertDialogHeader.displayName = \"AlertDialogHeader\";\n\nconst AlertDialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\", className)}\n {...props}\n />\n);\nAlertDialogFooter.displayName = \"AlertDialogFooter\";\n\nconst AlertDialogTitle = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold\", className)}\n {...props}\n />\n));\nAlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;\n\nconst AlertDialogDescription = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nAlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;\n\nconst AlertDialogAction = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Action>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Action ref={ref} className={cn(buttonVariants(), className)} {...props} />\n));\nAlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;\n\nconst AlertDialogCancel = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Cancel>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Cancel\n ref={ref}\n className={cn(buttonVariants({ variant: \"outline\" }), \"mt-2 sm:mt-0\", className)}\n {...props}\n />\n));\nAlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;\n\nexport {\n AlertDialog,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogTrigger,\n AlertDialogContent,\n AlertDialogHeader,\n AlertDialogFooter,\n AlertDialogTitle,\n AlertDialogDescription,\n AlertDialogAction,\n AlertDialogCancel,\n};\n","import * as AspectRatioPrimitive from \"@radix-ui/react-aspect-ratio\";\n\nconst AspectRatio = AspectRatioPrimitive.Root;\n\nexport { AspectRatio };\n","import * as AvatarPrimitive from \"@radix-ui/react-avatar\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Avatar = React.forwardRef<\n React.ComponentRef<typeof AvatarPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Root\n ref={ref}\n className={cn(\"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full\", className)}\n {...props}\n />\n));\nAvatar.displayName = AvatarPrimitive.Root.displayName;\n\nconst AvatarImage = React.forwardRef<\n React.ComponentRef<typeof AvatarPrimitive.Image>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Image\n ref={ref}\n className={cn(\"aspect-square h-full w-full\", className)}\n {...props}\n />\n));\nAvatarImage.displayName = AvatarPrimitive.Image.displayName;\n\nconst AvatarFallback = React.forwardRef<\n React.ComponentRef<typeof AvatarPrimitive.Fallback>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Fallback\n ref={ref}\n className={cn(\n \"flex h-full w-full items-center justify-center rounded-full bg-muted\",\n className,\n )}\n {...props}\n />\n));\nAvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;\n\nexport { Avatar, AvatarImage, AvatarFallback };\n","import { Slot } from \"@radix-ui/react-slot\";\nimport { cva } from \"class-variance-authority\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport type * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst badgeVariantsConfig = {\n variant: {\n default: \"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90\",\n secondary:\n \"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90\",\n destructive:\n \"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n outline: \"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground\",\n },\n} as const;\n\nconst badgeVariants = cva(\n \"inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden\",\n {\n variants: badgeVariantsConfig,\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\nfunction Badge({\n className,\n variant,\n asChild = false,\n ...props\n}: React.ComponentProps<\"span\"> & VariantProps<typeof badgeVariants> & { asChild?: boolean }) {\n const Comp = asChild ? Slot : \"span\";\n return (\n <Comp data-slot=\"badge\" className={cn(badgeVariants({ variant }), className)} {...props} />\n );\n}\n\nexport { Badge, badgeVariants, badgeVariantsConfig };\n","import { Slot } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\nimport ChevronRightIcon from \"~icons/lucide/chevron-right\";\nimport MoreHorizontalIcon from \"~icons/lucide/more-horizontal\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Breadcrumb = React.forwardRef<\n HTMLElement,\n React.ComponentPropsWithoutRef<\"nav\"> & {\n separator?: React.ReactNode;\n }\n>(({ ...props }, ref) => <nav ref={ref} aria-label=\"breadcrumb\" {...props} />);\nBreadcrumb.displayName = \"Breadcrumb\";\n\nconst BreadcrumbList = React.forwardRef<HTMLOListElement, React.ComponentPropsWithoutRef<\"ol\">>(\n ({ className, ...props }, ref) => (\n <ol\n ref={ref}\n className={cn(\n \"flex flex-wrap items-center gap-1.5 overflow-wrap-anywhere text-sm text-muted-foreground sm:gap-2.5\",\n className,\n )}\n {...props}\n />\n ),\n);\nBreadcrumbList.displayName = \"BreadcrumbList\";\n\nconst BreadcrumbItem = React.forwardRef<HTMLLIElement, React.ComponentPropsWithoutRef<\"li\">>(\n ({ className, ...props }, ref) => (\n <li ref={ref} className={cn(\"inline-flex items-center gap-1.5\", className)} {...props} />\n ),\n);\nBreadcrumbItem.displayName = \"BreadcrumbItem\";\n\nconst BreadcrumbLink = React.forwardRef<\n HTMLAnchorElement,\n React.ComponentPropsWithoutRef<\"a\"> & {\n asChild?: boolean;\n }\n>(({ asChild, className, ...props }, ref) => {\n const Comp = asChild ? Slot : \"a\";\n\n return (\n <Comp\n ref={ref}\n className={cn(\"transition-colors hover:text-foreground\", className)}\n {...props}\n />\n );\n});\nBreadcrumbLink.displayName = \"BreadcrumbLink\";\n\nconst BreadcrumbPage = React.forwardRef<HTMLSpanElement, React.ComponentPropsWithoutRef<\"span\">>(\n ({ className, ...props }, ref) => (\n <span\n ref={ref}\n role=\"link\"\n aria-disabled=\"true\"\n aria-current=\"page\"\n className={cn(\"font-normal text-foreground\", className)}\n {...props}\n />\n ),\n);\nBreadcrumbPage.displayName = \"BreadcrumbPage\";\n\nconst BreadcrumbSeparator = ({ children, className, ...props }: React.ComponentProps<\"li\">) => (\n <li\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"[&>svg]:w-3.5 [&>svg]:h-3.5\", className)}\n {...props}\n >\n {children ?? <ChevronRightIcon />}\n </li>\n);\nBreadcrumbSeparator.displayName = \"BreadcrumbSeparator\";\n\nconst BreadcrumbEllipsis = ({ className, ...props }: React.ComponentProps<\"span\">) => (\n <span\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"flex h-9 w-9 items-center justify-center\", className)}\n {...props}\n >\n <MoreHorizontalIcon className=\"h-4 w-4\" />\n <span className=\"sr-only\">More</span>\n </span>\n);\nBreadcrumbEllipsis.displayName = \"BreadcrumbElipssis\";\n\nexport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbPage,\n BreadcrumbSeparator,\n BreadcrumbEllipsis,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport { DayPicker } from \"react-day-picker\";\nimport { type DateRange } from \"react-day-picker\";\nimport ChevronLeftIcon from \"~icons/lucide/chevron-left\";\nimport ChevronRightIcon from \"~icons/lucide/chevron-right\";\n\nimport { cn } from \"../../lib/utils\";\nimport { buttonVariants } from \"./button\";\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n ...props\n}: React.ComponentProps<typeof DayPicker>) {\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\"p-3\", className)}\n classNames={{\n months: \"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0\",\n month: \"space-y-4\",\n caption: \"flex justify-center pt-1 relative items-center w-full\",\n caption_label: \"text-sm font-medium\",\n nav: \"space-x-1 flex items-center\",\n nav_button: cn(\n buttonVariants({ variant: \"outline\" }),\n \"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100\",\n ),\n nav_button_previous: \"absolute left-1\",\n nav_button_next: \"absolute right-1\",\n table: \"w-full border-collapse space-y-1\",\n head_row: \"flex\",\n head_cell: \"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]\",\n row: \"flex w-full mt-2\",\n cell: cn(\n \"h-9 w-9 text-center text-sm p-0 relative focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent/10\",\n props.mode === \"range\"\n ? \"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md\"\n : \"[&:has([aria-selected])]:rounded-md\",\n ),\n day: cn(\n buttonVariants({ variant: \"ghost\" }),\n \"h-9 w-9 p-0 font-normal aria-selected:opacity-100\",\n ),\n day_range_start: \"day-range-start\",\n day_range_end: \"day-range-end\",\n day_selected:\n \"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground\",\n day_today: \"bg-accent/10 text-foreground\",\n day_outside:\n \"day-outside text-muted-foreground opacity-50 aria-selected:bg-transparent aria-selected:opacity-100 aria-selected:text-foreground\",\n day_disabled: \"text-muted-foreground opacity-50\",\n day_range_middle: \"aria-selected:bg-transparent aria-selected:text-foreground\",\n day_hidden: \"invisible\",\n ...classNames,\n }}\n components={{\n IconLeft: () => <ChevronLeftIcon className=\"h-4 w-4\" />,\n IconRight: () => <ChevronRightIcon className=\"h-4 w-4\" />,\n }}\n {...props}\n />\n );\n}\n\nexport { Calendar };\nexport type { DateRange };\n","import type * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nfunction Card({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card\"\n className={cn(\n \"bg-card text-card-foreground flex flex-col gap-6 rounded-card border\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CardHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n \"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 pt-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CardTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return <h4 data-slot=\"card-title\" className={cn(\"leading-none\", className)} {...props} />;\n}\n\nfunction CardDescription({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <p data-slot=\"card-description\" className={cn(\"text-muted-foreground\", className)} {...props} />\n );\n}\n\nfunction CardAction({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-action\"\n className={cn(\"col-start-2 row-span-2 row-start-1 self-start justify-self-end\", className)}\n {...props}\n />\n );\n}\n\nfunction CardContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div data-slot=\"card-content\" className={cn(\"px-6 last:pb-6\", className)} {...props} />;\n}\n\nfunction CardFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-footer\"\n className={cn(\"flex items-center px-6 pb-6 [.border-t]:pt-6\", className)}\n {...props}\n />\n );\n}\n\nexport { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };\n","\"use client\";\n\nimport useEmblaCarousel from \"embla-carousel-react\";\nimport { type UseEmblaCarouselType } from \"embla-carousel-react\";\nimport * as React from \"react\";\nimport ArrowLeftIcon from \"~icons/lucide/arrow-left\";\nimport ArrowRightIcon from \"~icons/lucide/arrow-right\";\n\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"./button\";\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ntype CarouselProps = {\n opts?: CarouselOptions;\n plugins?: CarouselPlugin;\n orientation?: \"horizontal\" | \"vertical\";\n setApi?: (api: CarouselApi) => void;\n};\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: ReturnType<typeof useEmblaCarousel>[1];\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n} & CarouselProps;\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null);\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext);\n\n if (!context) {\n throw new Error(\"useCarousel must be used within a <Carousel />\");\n }\n\n return context;\n}\n\nconst Carousel = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & CarouselProps\n>(({ orientation = \"horizontal\", opts, setApi, plugins, className, children, ...props }, ref) => {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === \"horizontal\" ? \"x\" : \"y\",\n },\n plugins,\n );\n const [canScrollPrev, setCanScrollPrev] = React.useState(false);\n const [canScrollNext, setCanScrollNext] = React.useState(false);\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) {\n return;\n }\n\n setCanScrollPrev(api.canScrollPrev());\n setCanScrollNext(api.canScrollNext());\n }, []);\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext();\n }, [api]);\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === \"ArrowRight\") {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext],\n );\n\n React.useEffect(() => {\n if (!api || !setApi) {\n return;\n }\n\n setApi(api);\n }, [api, setApi]);\n\n React.useEffect(() => {\n if (!api) {\n return;\n }\n\n onSelect(api);\n api.on(\"reInit\", onSelect);\n api.on(\"select\", onSelect);\n\n return () => {\n api?.off(\"select\", onSelect);\n };\n }, [api, onSelect]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation: orientation || (opts?.axis === \"y\" ? \"vertical\" : \"horizontal\"),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <div\n ref={ref}\n onKeyDownCapture={handleKeyDown}\n className={cn(\"relative\", className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n});\nCarousel.displayName = \"Carousel\";\n\nconst CarouselContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const { carouselRef, orientation } = useCarousel();\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\">\n <div\n ref={ref}\n className={cn(\n \"flex\",\n orientation === \"horizontal\" ? \"-ml-4\" : \"-mt-4 flex-col\",\n className,\n )}\n {...props}\n />\n </div>\n );\n },\n);\nCarouselContent.displayName = \"CarouselContent\";\n\nconst CarouselItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const { orientation } = useCarousel();\n\n return (\n <div\n ref={ref}\n role=\"group\"\n aria-roledescription=\"slide\"\n className={cn(\n \"min-w-0 shrink-0 grow-0 basis-full\",\n orientation === \"horizontal\" ? \"pl-4\" : \"pt-4\",\n className,\n )}\n {...props}\n />\n );\n },\n);\nCarouselItem.displayName = \"CarouselItem\";\n\nconst CarouselPrevious = React.forwardRef<HTMLButtonElement, React.ComponentProps<typeof Button>>(\n ({ className, variant = \"outline\", size = \"default\", ...props }, ref) => {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n\n return (\n <Button\n ref={ref}\n variant={variant}\n size={size}\n className={cn(\n \"absolute h-8 w-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"-left-12 top-1/2 -translate-y-1/2\"\n : \"-top-12 left-1/2 -translate-x-1/2 rotate-90\",\n className,\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <ArrowLeftIcon className=\"h-4 w-4\" />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n );\n },\n);\nCarouselPrevious.displayName = \"CarouselPrevious\";\n\nconst CarouselNext = React.forwardRef<HTMLButtonElement, React.ComponentProps<typeof Button>>(\n ({ className, variant = \"outline\", size = \"default\", ...props }, ref) => {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n\n return (\n <Button\n ref={ref}\n variant={variant}\n size={size}\n className={cn(\n \"absolute h-8 w-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"-right-12 top-1/2 -translate-y-1/2\"\n : \"-bottom-12 left-1/2 -translate-x-1/2 rotate-90\",\n className,\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <ArrowRightIcon className=\"h-4 w-4\" />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n );\n },\n);\nCarouselNext.displayName = \"CarouselNext\";\n\nexport {\n type CarouselApi,\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselPrevious,\n CarouselNext,\n};\n","\"use client\";\n\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport * as React from \"react\";\nimport CheckIcon from \"~icons/lucide/check\";\n\nimport { type Override } from \"../../lib/types\";\nimport { cn } from \"../../lib/utils\";\n\ntype CheckboxProps = Override<\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>,\n {\n name?: string;\n value?: boolean;\n onValueChange?: (checked: boolean) => void;\n onBlur?: React.FocusEventHandler<HTMLInputElement>;\n label?: React.ReactNode;\n labelClassName?: string;\n }\n>;\n\nconst Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(\n (\n {\n className,\n name,\n checked,\n value,\n defaultChecked,\n onValueChange,\n onBlur,\n label,\n labelClassName,\n disabled,\n ...props\n },\n ref,\n ) => {\n // value prop이 있으면 checked보다 우선 (useTypeForm 호환)\n const effectiveChecked = value !== undefined ? value : checked;\n const inputRef = React.useRef<HTMLInputElement>(null);\n const checkboxRef = React.useRef<HTMLButtonElement>(null);\n const labelId = React.useId();\n\n // oxlint-disable-next-line @typescript-eslint/no-non-null-assertion -- useImperativeHandle은 ref가 할당된 후 실행되므로 안전함\n React.useImperativeHandle(ref, () => inputRef.current!);\n\n const handleCheckedChange = (newChecked: boolean | \"indeterminate\") => {\n const boolValue = newChecked === \"indeterminate\" ? false : newChecked;\n onValueChange?.(boolValue);\n };\n\n const handleLabelClick = (e: React.MouseEvent) => {\n e.preventDefault();\n if (disabled) return;\n checkboxRef.current?.click();\n };\n\n const checkboxElement = (\n <>\n <input\n type=\"checkbox\"\n ref={inputRef}\n name={name}\n defaultChecked={defaultChecked === true}\n onBlur={onBlur}\n className=\"sr-only\"\n tabIndex={-1}\n aria-hidden=\"true\"\n />\n <CheckboxPrimitive.Root\n ref={checkboxRef}\n data-slot=\"checkbox\"\n checked={effectiveChecked}\n defaultChecked={defaultChecked}\n onCheckedChange={handleCheckedChange}\n disabled={disabled}\n aria-labelledby={label ? labelId : undefined}\n className={cn(\n \"peer border border-muted-foreground/30 bg-input-background dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"flex items-center justify-center text-current transition-none\"\n >\n <CheckIcon className=\"size-3.5\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n </>\n );\n\n if (label) {\n return (\n <div className=\"flex items-center gap-2\">\n {checkboxElement}\n <label\n id={labelId}\n className={cn(\n \"text-sm cursor-pointer select-none\",\n disabled && \"cursor-not-allowed opacity-50\",\n labelClassName,\n )}\n onClick={handleLabelClick}\n >\n {label}\n </label>\n </div>\n );\n }\n\n return checkboxElement;\n },\n);\n\nCheckbox.displayName = \"Checkbox\";\n\nexport { Checkbox };\n","import * as CollapsiblePrimitive from \"@radix-ui/react-collapsible\";\n\nconst Collapsible = CollapsiblePrimitive.Root;\n\nconst CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;\n\nconst CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;\n\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent };\n","/**\n * React Components i18n Keys\n *\n * react-components의 i18n 키를 관리하는 Single Source of Truth\n *\n */\nexport const rcKeysKo = {\n // AsyncSelect Component\n \"rc.asyncSelect.loading\": \"로딩 중...\",\n \"rc.asyncSelect.noOptions\": \"옵션이 없습니다\",\n \"rc.asyncSelect.noResults\": \"검색 결과가 없습니다\",\n \"rc.asyncSelect.selectPlaceholder\": \"선택하세요...\",\n\n // Combobox Component\n \"rc.combobox.noResults\": \"검색 결과가 없습니다\",\n \"rc.combobox.selectPlaceholder\": \"선택하세요...\",\n\n // DatePicker Component\n \"rc.datePicker.pickDate\": \"날짜 선택\",\n \"rc.datePicker.placeholder\": \"날짜 선택\",\n \"rc.datePicker.selectDate\": \"날짜 선택\",\n\n // DateSelectorMultiple Component\n \"rc.dateSelectorMultiple.addDate\": \"날짜 추가\",\n \"rc.dateSelectorMultiple.dateRange\": \"기간\",\n \"rc.dateSelectorMultiple.placeholder\": \"날짜 선택\",\n \"rc.dateSelectorMultiple.singleDate\": \"단일\",\n\n // FileInput Component\n \"rc.fileInput.browseFiles\": \"파일 찾기\",\n \"rc.fileInput.dropZone\": \"파일을 드래그하거나 클릭하여 업로드\",\n \"rc.fileInput.filePlaceholder\": \"파일\",\n \"rc.fileInput.imagePlaceholder\": \"이미지\",\n \"rc.fileInput.maxFilesExceeded\": (maxFiles: number) =>\n `최대 ${maxFiles}개 파일만 업로드 가능합니다`,\n \"rc.fileInput.pending\": \"대기 중\",\n \"rc.fileInput.remove\": \"제거\",\n \"rc.fileInput.uploadFailed\": \"업로드 실패\",\n \"rc.fileInput.uploading\": \"업로드 중...\",\n\n // MonthPickerMultiple Component\n \"rc.monthPickerMultiple.addMonth\": \"월 추가\",\n \"rc.monthPickerMultiple.dateRange\": \"기간\",\n \"rc.monthPickerMultiple.endDate\": \"종료일\",\n \"rc.monthPickerMultiple.placeholder\": \"월 선택\",\n \"rc.monthPickerMultiple.singleDate\": \"단일\",\n \"rc.monthPickerMultiple.startDate\": \"시작일\",\n\n // MultiSelect Component\n \"rc.multiSelect.clear\": \"전체 해제\",\n \"rc.multiSelect.close\": \"닫기\",\n \"rc.multiSelect.moreItems\": (count: number) => `+${count}개 더보기`,\n \"rc.multiSelect.noOptions\": \"옵션이 없습니다\",\n \"rc.multiSelect.noOptionsSelected\": \"선택된 옵션이 없습니다\",\n \"rc.multiSelect.noResults\": \"검색 결과가 없습니다\",\n \"rc.multiSelect.optionsCount\": (count: number) => `${count}개 옵션`,\n \"rc.multiSelect.selectAll\": \"전체 선택\",\n \"rc.multiSelect.selectPlaceholder\": \"선택하세요...\",\n\n // Pagination Component\n \"rc.pagination.next\": \"다음\",\n \"rc.pagination.previous\": \"이전\",\n \"rc.pagination.showing\": (start: number, end: number, total: number) =>\n `${total}개 중 ${start}-${end}`,\n\n // Calendar Component\n \"rc.calendar.month.0\": \"1월\",\n \"rc.calendar.month.1\": \"2월\",\n \"rc.calendar.month.2\": \"3월\",\n \"rc.calendar.month.3\": \"4월\",\n \"rc.calendar.month.4\": \"5월\",\n \"rc.calendar.month.5\": \"6월\",\n \"rc.calendar.month.6\": \"7월\",\n \"rc.calendar.month.7\": \"8월\",\n \"rc.calendar.month.8\": \"9월\",\n \"rc.calendar.month.9\": \"10월\",\n \"rc.calendar.month.10\": \"11월\",\n \"rc.calendar.month.11\": \"12월\",\n\n // Sonamu Filter Component\n \"rc.sonamuFilter.title\": \"소나무 필터\",\n \"rc.sonamuFilter.apply\": \"적용\",\n \"rc.sonamuFilter.reset\": \"초기화\",\n \"rc.sonamuFilter.addRule\": \"규칙 추가\",\n \"rc.sonamuFilter.noRulesYet\": '아직 규칙이 없습니다. \"+ 규칙 추가\"를 클릭하여 시작하세요.',\n \"rc.sonamuFilter.selectField\": \"필드 선택\",\n \"rc.sonamuFilter.selectOperator\": \"연산자 선택\",\n \"rc.sonamuFilter.selectOperatorFirst\": \"먼저 연산자를 선택하세요\",\n \"rc.sonamuFilter.enterValue\": \"값 입력\",\n \"rc.sonamuFilter.enterNumber\": \"숫자 입력\",\n \"rc.sonamuFilter.notSupported\": \"지원하지 않음\",\n \"rc.sonamuFilter.startDate\": \"시작일\",\n \"rc.sonamuFilter.endDate\": \"종료일\",\n \"rc.sonamuFilter.appliedFilters\": \"🌲 적용된 소나무 필터\",\n\n // Common\n \"rc.common.cancel\": \"취소\",\n \"rc.common.save\": \"저장\",\n};\n\nexport type RCKeys = typeof rcKeysKo;\nexport type RCKeyName = keyof RCKeys;\n\nexport const rcKeysEn = {\n // AsyncSelect Component\n \"rc.asyncSelect.loading\": \"Loading...\",\n \"rc.asyncSelect.noOptions\": \"No options\",\n \"rc.asyncSelect.noResults\": \"No results\",\n \"rc.asyncSelect.selectPlaceholder\": \"Select...\",\n\n // Combobox Component\n \"rc.combobox.noResults\": \"No results\",\n \"rc.combobox.selectPlaceholder\": \"Select...\",\n\n // DatePicker Component\n \"rc.datePicker.pickDate\": \"Pick date\",\n \"rc.datePicker.placeholder\": \"Pick date\",\n \"rc.datePicker.selectDate\": \"Select date\",\n\n // DateSelectorMultiple Component\n \"rc.dateSelectorMultiple.addDate\": \"Add date\",\n \"rc.dateSelectorMultiple.dateRange\": \"Range\",\n \"rc.dateSelectorMultiple.placeholder\": \"Pick date\",\n \"rc.dateSelectorMultiple.singleDate\": \"Single\",\n\n // FileInput Component\n \"rc.fileInput.browseFiles\": \"Browse files\",\n \"rc.fileInput.dropZone\": \"Drag files here or click to upload\",\n \"rc.fileInput.filePlaceholder\": \"File\",\n \"rc.fileInput.imagePlaceholder\": \"Image\",\n \"rc.fileInput.maxFilesExceeded\": (maxFiles: number) => `Maximum ${maxFiles} files allowed`,\n \"rc.fileInput.pending\": \"Pending\",\n \"rc.fileInput.remove\": \"Remove\",\n \"rc.fileInput.uploadFailed\": \"Upload failed\",\n \"rc.fileInput.uploading\": \"Uploading...\",\n\n // MonthPickerMultiple Component\n \"rc.monthPickerMultiple.addMonth\": \"Add month\",\n \"rc.monthPickerMultiple.dateRange\": \"Range\",\n \"rc.monthPickerMultiple.endDate\": \"End date\",\n \"rc.monthPickerMultiple.placeholder\": \"Pick month\",\n \"rc.monthPickerMultiple.singleDate\": \"Single\",\n \"rc.monthPickerMultiple.startDate\": \"Start date\",\n\n // MultiSelect Component\n \"rc.multiSelect.clear\": \"Clear all\",\n \"rc.multiSelect.close\": \"Close\",\n \"rc.multiSelect.moreItems\": (count: number) => `+${count} more`,\n \"rc.multiSelect.noOptions\": \"No options\",\n \"rc.multiSelect.noOptionsSelected\": \"No options selected\",\n \"rc.multiSelect.noResults\": \"No results\",\n \"rc.multiSelect.optionsCount\": (count: number) => `${count} options`,\n \"rc.multiSelect.selectAll\": \"Select all\",\n \"rc.multiSelect.selectPlaceholder\": \"Select...\",\n\n // Pagination Component\n \"rc.pagination.next\": \"Next\",\n \"rc.pagination.previous\": \"Previous\",\n \"rc.pagination.showing\": (start: number, end: number, total: number) =>\n `Showing ${start}-${end} of ${total}`,\n\n // Calendar Component\n \"rc.calendar.month.0\": \"January\",\n \"rc.calendar.month.1\": \"February\",\n \"rc.calendar.month.2\": \"March\",\n \"rc.calendar.month.3\": \"April\",\n \"rc.calendar.month.4\": \"May\",\n \"rc.calendar.month.5\": \"June\",\n \"rc.calendar.month.6\": \"July\",\n \"rc.calendar.month.7\": \"August\",\n \"rc.calendar.month.8\": \"September\",\n \"rc.calendar.month.9\": \"October\",\n \"rc.calendar.month.10\": \"November\",\n \"rc.calendar.month.11\": \"December\",\n\n // Sonamu Filter Component\n \"rc.sonamuFilter.title\": \"Sonamu Filter\",\n \"rc.sonamuFilter.apply\": \"Apply\",\n \"rc.sonamuFilter.reset\": \"Reset\",\n \"rc.sonamuFilter.addRule\": \"Add Rule\",\n \"rc.sonamuFilter.noRulesYet\": 'No rules yet. Click \"+ Add Rule\" to start.',\n \"rc.sonamuFilter.selectField\": \"Select field\",\n \"rc.sonamuFilter.selectOperator\": \"Operator\",\n \"rc.sonamuFilter.selectOperatorFirst\": \"Select operator first\",\n \"rc.sonamuFilter.enterValue\": \"Enter value\",\n \"rc.sonamuFilter.enterNumber\": \"Enter number\",\n \"rc.sonamuFilter.notSupported\": \"Not supported\",\n \"rc.sonamuFilter.startDate\": \"Start date\",\n \"rc.sonamuFilter.endDate\": \"End date\",\n \"rc.sonamuFilter.appliedFilters\": \"🌲 Applied SonamuFilters\",\n\n // Common\n \"rc.common.cancel\": \"Cancel\",\n \"rc.common.save\": \"Save\",\n} satisfies RCKeys;\n","/* oxlint-disable @typescript-eslint/no-explicit-any */ // 제네릭 기본값으로 any 사용\n\nimport { type BetterAuthClientOptions } from \"better-auth/client\";\nimport { createAuthClient } from \"better-auth/react\";\nimport { createContext, useContext, useRef } from \"react\";\nimport { type ReactNode } from \"react\";\n\nimport { rcKeysEn } from \"../i18n/rc-keys\";\nimport { type RCKeyName, type RCKeys } from \"../i18n/rc-keys\";\nimport { type Dictionary, type SDReturnType, type SonamuFile } from \"./types\";\n\n/** createAuthClient의 반환 타입을 옵션으로부터 추론하는 유틸리티 타입 */\nexport type SonamuAuthClient<O extends BetterAuthClientOptions> = ReturnType<\n typeof createAuthClient<O>\n>;\n\nexport interface SonamuContextValue<\n D extends Dictionary = Dictionary,\n O extends BetterAuthClientOptions = BetterAuthClientOptions,\n> {\n uploader?: (files: File[]) => Promise<SonamuFile[]>;\n auth?: SonamuAuthClient<O>;\n SD?: <K extends keyof D>(key: K) => SDReturnType<D, K>;\n}\n\nexport interface SonamuProviderProps<\n D extends Dictionary = Dictionary,\n O extends BetterAuthClientOptions = BetterAuthClientOptions,\n> extends SonamuContextValue<D, O> {\n children: ReactNode;\n authOptions?: O;\n}\n\nconst SONAMU_CONTEXT_ERROR_MESSAGE = (key: string) =>\n `[SonamuProvider] ${key} is not configured. Please provide ${key} configuration to SonamuProvider.`;\n\nconst createUploaderFallback = () => {\n return () => {\n throw new Error(SONAMU_CONTEXT_ERROR_MESSAGE(\"uploader\"));\n };\n};\n\nconst createSDFallback = <D extends Dictionary = RCKeys>() => {\n return <K extends keyof D>(key: K): SDReturnType<D, K> => {\n const value = rcKeysEn[key as unknown as RCKeyName];\n return value as unknown as SDReturnType<D, K>;\n };\n};\n\nconst SonamuContext = createContext({} as SonamuContextValue);\n\nexport function SonamuProvider<\n D extends Dictionary = Dictionary,\n O extends BetterAuthClientOptions = BetterAuthClientOptions,\n>({ children, authOptions, ...value }: SonamuProviderProps<D, O>) {\n const authRef = useRef<SonamuAuthClient<O> | undefined>(undefined);\n if (authOptions && !authRef.current) {\n authRef.current = createAuthClient(authOptions);\n }\n\n const normalizedValue: SonamuContextValue<D, O> = {\n uploader: value.uploader ?? createUploaderFallback(),\n auth: value.auth ?? authRef.current,\n SD: value.SD ?? createSDFallback<D>(),\n };\n\n return <SonamuContext.Provider value={normalizedValue}>{children}</SonamuContext.Provider>;\n}\n\n/**\n * 타입이 지정된 useSonamuContext를 만들기 위한 베이스 훅\n *\n * @example\n * // contexts/sonamu-provider.tsx\n * export function useSonamuContext() {\n * return useSonamuBaseContext<MergedDictionary>();\n * }\n */\nexport function useSonamuBaseContext<\n D extends Dictionary = Dictionary,\n O extends BetterAuthClientOptions = BetterAuthClientOptions,\n>(): Required<SonamuContextValue<D, O>> {\n return useContext(SonamuContext) as unknown as Required<SonamuContextValue<D, O>>;\n}\n","\"use client\";\n\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport * as React from \"react\";\nimport XIcon from \"~icons/lucide/x\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Dialog = DialogPrimitive.Root;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = DialogPrimitive.Portal;\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n \"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className,\n )}\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nconst DialogContent = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg\",\n className,\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close className=\"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground\">\n <XIcon className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn(\"flex flex-col space-y-1.5 text-center sm:text-left\", className)} {...props} />\n);\nDialogHeader.displayName = \"DialogHeader\";\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\", className)}\n {...props}\n />\n);\nDialogFooter.displayName = \"DialogFooter\";\n\nconst DialogTitle = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n};\n","\"use client\";\n\nimport { type DialogProps } from \"@radix-ui/react-dialog\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport * as React from \"react\";\nimport SearchIcon from \"~icons/lucide/search\";\n\nimport { cn } from \"../../lib/utils\";\nimport { Dialog, DialogContent } from \"./dialog\";\n\nconst Command = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n \"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground\",\n className,\n )}\n {...props}\n />\n));\nCommand.displayName = CommandPrimitive.displayName;\n\ntype CommandDialogProps = DialogProps & {\n commandProps?: React.ComponentPropsWithoutRef<typeof CommandPrimitive>;\n};\n\nconst CommandDialog = ({ children, commandProps, ...props }: CommandDialogProps) => {\n const { className: commandClassName, ...restCommandProps } = commandProps ?? {};\n return (\n <Dialog {...props}>\n <DialogContent className=\"overflow-hidden p-0 shadow-lg\">\n <Command\n className={cn(\n \"**:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 **:[[cmdk-group]]:px-2 **:[[cmdk-input-wrapper]_svg]:size-5 **:[[cmdk-input]]:h-12 **:[[cmdk-item]]:px-2 **:[[cmdk-item]]:py-3 **:[[cmdk-item]_svg]:size-5\",\n commandClassName,\n )}\n {...restCommandProps}\n >\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n};\n\nconst CommandInput = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Input>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>\n>(({ className, ...props }, ref) => (\n <div className=\"flex items-center border-b px-3\" cmdk-input-wrapper=\"\">\n <SearchIcon className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n \"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n />\n </div>\n));\n\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\nconst CommandList = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\"max-h-[300px] overflow-y-auto overflow-x-hidden\", className)}\n {...props}\n />\n));\n\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nconst CommandEmpty = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => (\n <CommandPrimitive.Empty ref={ref} className=\"py-6 text-center text-sm\" {...props} />\n));\n\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nconst CommandGroup = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n \"overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground\",\n className,\n )}\n {...props}\n />\n));\n\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nconst CommandSeparator = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 h-px bg-border\", className)}\n {...props}\n />\n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\nconst CommandItem = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 **:[svg]:pointer-events-none **:[svg]:size-4 **:[svg]:shrink-0\",\n className,\n )}\n {...props}\n />\n));\n\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nconst CommandShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\"ml-auto text-xs tracking-widest text-muted-foreground\", className)}\n {...props}\n />\n );\n};\nCommandShortcut.displayName = \"CommandShortcut\";\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n};\n","\"use client\";\n\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport type * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nfunction Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>) {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />;\n}\n\nfunction PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {\n return <PopoverPrimitive.Trigger data-slot=\"popover-trigger\" {...props} />;\n}\n\nfunction PopoverContent({\n className,\n align = \"center\",\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Content>) {\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n data-slot=\"popover-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden\",\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n );\n}\n\nfunction PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {\n return <PopoverPrimitive.Anchor data-slot=\"popover-anchor\" {...props} />;\n}\n\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };\n","\"use client\";\n\nimport * as React from \"react\";\nimport CheckIcon from \"~icons/lucide/check\";\nimport ChevronsUpDownIcon from \"~icons/lucide/chevrons-up-down\";\nimport XCircleIcon from \"~icons/lucide/x-circle\";\n\nimport { useSonamuBaseContext } from \"@/contexts\";\n\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"./button\";\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from \"./command\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\";\n\nexport interface ComboboxOption {\n value: string;\n label: string;\n}\n\ninterface ComboboxProps {\n options: ComboboxOption[];\n name?: string;\n value?: string;\n onValueChange?: (value: string | undefined) => void;\n onBlur?: React.FocusEventHandler<HTMLInputElement>;\n placeholder?: string;\n searchPlaceholder?: string;\n emptyText?: string;\n disabled?: boolean;\n className?: string;\n clearable?: boolean;\n}\n\nconst Combobox = React.forwardRef<HTMLInputElement, ComboboxProps>(\n (\n {\n options,\n name,\n value,\n onValueChange,\n onBlur,\n placeholder,\n searchPlaceholder,\n emptyText,\n disabled = false,\n className,\n clearable = false,\n },\n ref,\n ) => {\n const { SD } = useSonamuBaseContext();\n const [open, setOpen] = React.useState(false);\n const inputRef = React.useRef<HTMLInputElement>(null);\n\n // SD 기본값 설정\n const finalPlaceholder = placeholder ?? SD(\"rc.combobox.selectPlaceholder\");\n const finalSearchPlaceholder = searchPlaceholder ?? SD(\"common.searchPlaceholder\");\n const finalEmptyText = emptyText ?? SD(\"rc.combobox.noResults\");\n\n // oxlint-disable-next-line @typescript-eslint/no-non-null-assertion -- useImperativeHandle은 ref가 할당된 후 실행되므로 안전함\n React.useImperativeHandle(ref, () => inputRef.current!);\n\n const handleSelect = (currentValue: string) => {\n const newValue = currentValue === value ? \"\" : currentValue;\n onValueChange?.(newValue || undefined);\n setOpen(false);\n };\n\n const handleClear = (e: React.MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n onValueChange?.(undefined);\n setOpen(false);\n };\n\n const hasValue = Boolean(value);\n\n return (\n <>\n <input type=\"hidden\" ref={inputRef} name={name} value={value || \"\"} onBlur={onBlur} />\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n role=\"combobox\"\n aria-expanded={open}\n disabled={disabled}\n className={cn(\"w-full justify-between\", className)}\n >\n <span className=\"flex-1 truncate text-left\">\n {value ? options.find((option) => option.value === value)?.label : finalPlaceholder}\n </span>\n <div className=\"flex items-center gap-1 shrink-0 pl-2\">\n {clearable && hasValue && (\n <span\n className=\"flex items-center justify-center\"\n onMouseDown={(e) => e.stopPropagation()}\n onClick={handleClear}\n >\n <XCircleIcon className=\"h-4 w-4 cursor-pointer opacity-50 hover:opacity-100 transition-opacity\" />\n </span>\n )}\n <ChevronsUpDownIcon className=\"h-4 w-4 opacity-50\" />\n </div>\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-full p-0\">\n <Command>\n <CommandInput placeholder={finalSearchPlaceholder} className=\"h-9\" />\n <CommandList>\n <CommandEmpty>{finalEmptyText}</CommandEmpty>\n <CommandGroup>\n {options.map((option) => (\n <CommandItem key={option.value} value={option.value} onSelect={handleSelect}>\n {option.label}\n <CheckIcon\n className={cn(\n \"ml-auto\",\n value === option.value ? \"opacity-100\" : \"opacity-0\",\n )}\n />\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n </>\n );\n },\n);\n\nCombobox.displayName = \"Combobox\";\n\nexport { Combobox };\n","\"use client\";\n\nimport { atom, useAtom } from \"jotai\";\nimport type * as React from \"react\";\nimport { useEffect } from \"react\";\n\nimport { cn } from \"../../lib/utils\";\nimport { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from \"./dialog\";\n\ntype ExtendedModalProps = {\n title?: string;\n description?: string;\n className?: string;\n onCompleted?: (data?: unknown) => void;\n onControlledOpen?: () => void;\n onControlledClose?: () => void;\n};\n\nexport const commonModalAtom = atom<\n {\n open: boolean;\n reactNode: React.ReactNode | null;\n } & ExtendedModalProps\n>({\n open: false,\n reactNode: null,\n});\n\ntype CommonModalProps = {\n className?: string;\n};\n\nexport function CommonModal({ className }: CommonModalProps) {\n const [atomValue, setAtomValue] = useAtom(commonModalAtom);\n const {\n open,\n reactNode,\n title,\n description,\n className: modalClassName,\n onControlledOpen,\n onControlledClose,\n } = atomValue;\n\n const closeAndClear = () => {\n if (onControlledClose) {\n onControlledClose();\n }\n setAtomValue({\n open: false,\n reactNode: null,\n });\n };\n\n useEffect(() => {\n if (open && onControlledOpen) {\n onControlledOpen();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open]);\n\n return (\n <Dialog\n open={open}\n onOpenChange={(isOpen) => {\n if (!isOpen) {\n closeAndClear();\n }\n }}\n >\n <DialogContent className={cn(\"max-w-4xl\", modalClassName, className)}>\n <DialogHeader>\n <DialogTitle className={!title ? \"sr-only\" : undefined}>{title || \"Modal\"}</DialogTitle>\n <DialogDescription className={!description ? \"sr-only\" : undefined}>\n {description || \"Modal content\"}\n </DialogDescription>\n </DialogHeader>\n {reactNode}\n </DialogContent>\n </Dialog>\n );\n}\n\nexport function useCommonModal() {\n const [atomValue, setAtomValue] = useAtom(commonModalAtom);\n const { open, reactNode, onCompleted } = atomValue;\n\n const openModal = (reactNode: React.ReactNode, props?: ExtendedModalProps) => {\n setAtomValue({\n open: true,\n reactNode,\n ...props,\n });\n };\n\n const closeModal = () => {\n setAtomValue({\n open: false,\n reactNode: null,\n });\n };\n\n const doneModal = (data?: unknown) => {\n closeModal();\n if (onCompleted) {\n onCompleted(data);\n }\n };\n\n return {\n open,\n reactNode,\n openModal,\n closeModal,\n doneModal,\n };\n}\n","import * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\";\nimport * as React from \"react\";\nimport CheckIcon from \"~icons/lucide/check\";\nimport ChevronRightIcon from \"~icons/lucide/chevron-right\";\nimport CircleIcon from \"~icons/lucide/circle\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst ContextMenu = ContextMenuPrimitive.Root;\n\nconst ContextMenuTrigger = ContextMenuPrimitive.Trigger;\n\nconst ContextMenuGroup = ContextMenuPrimitive.Group;\n\nconst ContextMenuPortal = ContextMenuPrimitive.Portal;\n\nconst ContextMenuSub = ContextMenuPrimitive.Sub;\n\nconst ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;\n\nconst ContextMenuSubTrigger = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <ContextMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto h-4 w-4\" />\n </ContextMenuPrimitive.SubTrigger>\n));\nContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;\n\nconst ContextMenuSubContent = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]\",\n className,\n )}\n {...props}\n />\n));\nContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;\n\nconst ContextMenuContent = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Content\n ref={ref}\n className={cn(\n \"z-50 max-h-[--radix-context-menu-content-available-height] min-w-32 overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]\",\n className,\n )}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n));\nContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;\n\nconst ContextMenuItem = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n));\nContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;\n\nconst ContextMenuCheckboxItem = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <ContextMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"h-4 w-4\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n));\nContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;\n\nconst ContextMenuRadioItem = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <ContextMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"h-2 w-2 fill-current\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n));\nContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;\n\nconst ContextMenuLabel = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Label\n ref={ref}\n className={cn(\"px-2 py-1.5 text-sm font-semibold text-foreground\", inset && \"pl-8\", className)}\n {...props}\n />\n));\nContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;\n\nconst ContextMenuSeparator = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-border\", className)}\n {...props}\n />\n));\nContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;\n\nconst ContextMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\"ml-auto text-xs tracking-widest text-muted-foreground\", className)}\n {...props}\n />\n );\n};\nContextMenuShortcut.displayName = \"ContextMenuShortcut\";\n\nexport {\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuContent,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioItem,\n ContextMenuLabel,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuGroup,\n ContextMenuPortal,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuRadioGroup,\n};\n","import * as React from \"react\";\n\nimport { type Override } from \"../../lib/types\";\nimport { cn } from \"../../lib/utils\";\n\nexport type InputProps = Override<\n React.ComponentProps<\"input\">,\n {\n onValueChange?: (value: string) => void;\n }\n>;\n\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, type, onValueChange, onChange, ...props }, ref) => {\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n onValueChange?.(e.target.value);\n onChange?.(e);\n };\n\n return (\n <input\n type={type}\n data-slot=\"input\"\n className={cn(\n \"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n \"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]\",\n \"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n className,\n )}\n ref={ref}\n {...props}\n onChange={handleChange}\n />\n );\n },\n);\nInput.displayName = \"Input\";\n\nexport { Input };\n","import { type Override } from \"../../lib/types\";\nimport { Input } from \"./input\";\n\ntype DateInputProps = Override<\n React.ComponentProps<\"input\">,\n {\n value: Date | null;\n onValueChange: (value: Date | null) => void;\n }\n>;\nfunction DateInput({ value, onValueChange, ...props }: DateInputProps) {\n // value가 문자열이거나 빈 문자열인 경우 처리\n const dateValue = !value\n ? \"\"\n : value instanceof Date\n ? value.toISOString().slice(0, 16)\n : new Date(value).toISOString().slice(0, 16);\n\n return (\n <Input\n type=\"datetime-local\"\n value={dateValue}\n onChange={(e) => onValueChange(e.target.value ? new Date(e.target.value) : null)}\n {...props}\n />\n );\n}\n\nexport { DateInput, type DateInputProps };\n","\"use client\";\n\nimport { format } from \"date-fns\";\nimport * as React from \"react\";\nimport { type DateRange } from \"react-day-picker\";\nimport CalendarIcon from \"~icons/lucide/calendar\";\n\nimport { useSonamuBaseContext } from \"@/contexts\";\n\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"./button\";\nimport { Calendar } from \"./calendar\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\";\n\n// ============================================================================\n// DatePicker — 단일 날짜 선택\n// ============================================================================\n\ninterface DatePickerProps {\n value?: Date;\n onValueChange?: (date: Date | undefined) => void;\n placeholder?: string;\n disabled?: boolean;\n className?: string;\n}\n\nexport function DatePicker({\n value,\n onValueChange,\n placeholder,\n disabled = false,\n className,\n}: DatePickerProps) {\n const { SD } = useSonamuBaseContext();\n const finalPlaceholder = placeholder ?? SD(\"rc.datePicker.pickDate\");\n\n return (\n <Popover>\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n disabled={disabled}\n data-empty={!value}\n className={cn(\n \"w-full justify-start text-left font-normal\",\n \"data-[empty=true]:text-muted-foreground\",\n className,\n )}\n >\n <CalendarIcon />\n {value ? format(value, \"PPP\") : <span>{finalPlaceholder}</span>}\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0\" align=\"start\">\n <Calendar\n mode=\"single\"\n selected={value}\n onSelect={(date) => {\n onValueChange?.(date);\n }}\n initialFocus\n />\n </PopoverContent>\n </Popover>\n );\n}\n\n// ============================================================================\n// DatePickerWithDropdown — 월/년 드롭다운 포함\n// ============================================================================\n\nexport function DatePickerWithDropdown({\n value,\n onValueChange,\n placeholder,\n disabled = false,\n className,\n}: DatePickerProps) {\n const { SD } = useSonamuBaseContext();\n const finalPlaceholder = placeholder ?? SD(\"rc.datePicker.selectDate\");\n const [open, setOpen] = React.useState(false);\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n disabled={disabled}\n className={cn(\n \"w-full justify-between font-normal\",\n !value && \"text-muted-foreground\",\n className,\n )}\n >\n {value ? value.toLocaleDateString() : finalPlaceholder}\n <CalendarIcon />\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto overflow-hidden p-0\" align=\"start\">\n <Calendar\n mode=\"single\"\n selected={value}\n captionLayout=\"dropdown\"\n onSelect={(selectedDate) => {\n onValueChange?.(selectedDate);\n setOpen(false);\n }}\n />\n </PopoverContent>\n </Popover>\n );\n}\n\n// ============================================================================\n// DatePickerWithRange — 날짜 범위 선택\n// ============================================================================\n\ninterface DatePickerWithRangeProps {\n CalendarIcon: React.ComponentType<{ className?: string }>;\n value?: DateRange;\n onValueChange?: (value: DateRange | undefined) => void;\n placeholder?: string;\n dateFormat?: string;\n className?: string;\n numberOfMonths?: number;\n maxDate?: Date;\n minDate?: Date;\n}\n\nexport function DatePickerWithRange({\n CalendarIcon: CalendarIconProp,\n value,\n onValueChange,\n placeholder = \"Pick a date\",\n dateFormat = \"yyyy/MM/dd\",\n className = \"\",\n numberOfMonths = 2,\n maxDate,\n minDate,\n}: DatePickerWithRangeProps) {\n const [isOpen, setIsOpen] = React.useState(false);\n\n const displayText = React.useMemo(() => {\n if (!value?.from && !value?.to) {\n return placeholder;\n }\n const fromStr = value?.from ? format(value.from, dateFormat) : \"\";\n const toStr = value?.to ? format(value.to, dateFormat) : \"\";\n if (fromStr && toStr) {\n return `${fromStr} - ${toStr}`;\n }\n if (toStr) {\n return `- ${toStr}`;\n }\n return `${fromStr} -`;\n }, [value, dateFormat, placeholder]);\n\n const disabledMatcher = React.useMemo(() => {\n if (!maxDate && !minDate) {\n return undefined;\n }\n return (date: Date): boolean => {\n if (maxDate && date > maxDate) {\n return true;\n }\n if (minDate && date < minDate) {\n return true;\n }\n return false;\n };\n }, [maxDate, minDate]);\n\n return (\n <Popover open={isOpen} onOpenChange={setIsOpen}>\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n className={`justify-start gap-2 h-8 px-3 text-xs font-normal ${className}`}\n >\n <CalendarIconProp className=\"h-4 w-4 shrink-0\" />\n <span className=\"truncate\">{displayText}</span>\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0\" align=\"start\">\n <Calendar\n mode=\"range\"\n defaultMonth={\n value?.from ??\n (value?.to ? new Date(value.to.getFullYear(), value.to.getMonth() - 1, 1) : undefined)\n }\n selected={value}\n onSelect={onValueChange}\n numberOfMonths={numberOfMonths}\n disabled={disabledMatcher}\n />\n </PopoverContent>\n </Popover>\n );\n}\n\nexport type { DatePickerProps, DatePickerWithRangeProps, DateRange };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Drawer = ({\n shouldScaleBackground = true,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Root>) => (\n <DrawerPrimitive.Root shouldScaleBackground={shouldScaleBackground} {...props} />\n);\nDrawer.displayName = \"Drawer\";\n\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\nconst DrawerPortal = DrawerPrimitive.Portal;\n\nconst DrawerClose = DrawerPrimitive.Close;\n\nconst DrawerOverlay = React.forwardRef<\n React.ComponentRef<typeof DrawerPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Overlay\n ref={ref}\n className={cn(\"fixed inset-0 z-50 bg-black/80\", className)}\n {...props}\n />\n));\nDrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;\n\nconst DrawerContent = React.forwardRef<\n React.ComponentRef<typeof DrawerPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DrawerPortal>\n <DrawerOverlay />\n <DrawerPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background\",\n className,\n )}\n {...props}\n >\n <div className=\"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n));\nDrawerContent.displayName = \"DrawerContent\";\n\nconst DrawerHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn(\"grid gap-1.5 p-4 text-center sm:text-left\", className)} {...props} />\n);\nDrawerHeader.displayName = \"DrawerHeader\";\n\nconst DrawerFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)} {...props} />\n);\nDrawerFooter.displayName = \"DrawerFooter\";\n\nconst DrawerTitle = React.forwardRef<\n React.ComponentRef<typeof DrawerPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n));\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\nconst DrawerDescription = React.forwardRef<\n React.ComponentRef<typeof DrawerPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n};\n","\"use client\";\n\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport * as React from \"react\";\nimport CheckIcon from \"~icons/lucide/check\";\nimport ChevronRightIcon from \"~icons/lucide/chevron-right\";\nimport CircleIcon from \"~icons/lucide/circle\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst DropdownMenu = DropdownMenuPrimitive.Root;\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\n\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\n\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\n\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\n\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;\n\nconst DropdownMenuContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-32 overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]\",\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"h-2 w-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\"px-2 py-1.5 text-sm font-semibold\", inset && \"pl-8\", className)}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span className={cn(\"ml-auto text-xs tracking-widest opacity-60\", className)} {...props} />\n );\n};\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\";\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n};\n","import type React from \"react\";\nimport { useCallback, useRef, useState } from \"react\";\nimport FileIcon from \"~icons/lucide/file\";\nimport ImageIcon from \"~icons/lucide/image\";\nimport Loader2Icon from \"~icons/lucide/loader2\";\nimport UploadIcon from \"~icons/lucide/upload\";\nimport XIcon from \"~icons/lucide/x\";\n\nimport { type SonamuFile } from \"@/contexts\";\nimport { useSonamuBaseContext } from \"@/contexts\";\nimport { cn, useObjectUrls } from \"@/lib/utils\";\n\nimport { Button } from \"./button\";\n\nexport type PreviewSize = \"sm\" | \"md\" | \"lg\" | \"xl\";\n\n// 이미지용: 정사각형\nconst imageSizeClasses: Record<PreviewSize, string> = {\n sm: \"w-20 h-20\",\n md: \"w-32 h-32\",\n lg: \"w-40 h-40\",\n xl: \"w-48 h-48\",\n};\n\n// 파일용: 가로로 긴 직사각형\nconst fileSizeClasses: Record<PreviewSize, string> = {\n sm: \"w-48 h-12\",\n md: \"w-80 h-16\",\n lg: \"w-96 h-20\",\n xl: \"w-[28rem] h-24\",\n};\n\ntype BaseProps = {\n uploadMode: \"eager\" | \"lazy\";\n viewMode: \"image\" | \"file\";\n placeholder?: string;\n accept?: string;\n disabled?: boolean;\n className?: string;\n previewSize?: PreviewSize;\n onBlur?: React.FocusEventHandler<HTMLInputElement>;\n};\n\ntype SingleModeProps = BaseProps & {\n multiple?: false;\n value: SonamuFile | File | null;\n onValueChange?: (value: SonamuFile | File | null) => void;\n};\n\ntype MultipleModeProps = BaseProps & {\n multiple: true;\n value: (SonamuFile | File)[] | null;\n onValueChange?: (value: (SonamuFile | File)[]) => void;\n maxFiles?: number;\n};\n\nexport type FileInputProps = SingleModeProps | MultipleModeProps;\n\nexport function FileInput(props: FileInputProps) {\n const {\n placeholder,\n disabled = false,\n className,\n previewSize = \"md\",\n uploadMode,\n viewMode,\n onBlur,\n } = props;\n\n const { uploader, SD } = useSonamuBaseContext();\n\n const isMultiple = props.multiple ?? false;\n const isImageView = viewMode === \"image\";\n\n // viewMode에 따라 accept 자동 설정\n const accept = props.accept ?? (isImageView ? \"image/*\" : \"*/*\");\n\n const inputRef = useRef<HTMLInputElement>(null);\n const [isUploading, setIsUploading] = useState(false);\n const [dragOver, setDragOver] = useState(false);\n\n // 기본 placeholder 설정\n const defaultPlaceholder =\n placeholder ??\n `${isImageView ? SD(\"rc.fileInput.imagePlaceholder\") : SD(\"rc.fileInput.filePlaceholder\")} URL${isMultiple ? \"S\" : \"\"}`;\n\n // 입력 정규화: 내부적으로 배열로 통일\n const values = (() => {\n if (!isMultiple) {\n const singleValue = (props as SingleModeProps).value;\n return singleValue ? [singleValue] : [];\n }\n\n const multiValue = (props as MultipleModeProps).value || [];\n\n return multiValue;\n })();\n\n // File 객체만 추출\n const fileObjects = values.filter((v): v is File => v instanceof File);\n\n // File 객체는 useObjectUrls로 안전하게 blob URL 생성 (자동 메모리 해제)\n const blobUrls = useObjectUrls(fileObjects);\n\n // 최종 display 데이터: 원래 순서를 유지하면서 File은 blob URL로, SonamuFile은 그대로\n const displayItems = values.map((v) => {\n if (v instanceof File) {\n const index = fileObjects.indexOf(v);\n return {\n url: blobUrls[index],\n name: v.name,\n isPending: true,\n };\n }\n // SonamuFile\n return {\n url: v.url,\n name: v.name,\n isPending: false,\n };\n });\n\n const maxFiles = isMultiple ? ((props as MultipleModeProps).maxFiles ?? 10) : 1;\n const totalCount = values.length;\n const canAddMore = totalCount < maxFiles;\n\n const handleFilesChange = useCallback(\n async (files: File[]) => {\n if (files.length === 0 || disabled) return;\n\n // maxFiles 체크\n const remainingSlots = maxFiles - totalCount;\n if (remainingSlots <= 0) {\n alert(\n (SD(\"rc.fileInput.maxFilesExceeded\") as unknown as (maxFiles: number) => string)(\n maxFiles,\n ),\n );\n return;\n }\n\n const filesToAdd = files.slice(0, remainingSlots);\n\n // Eager 모드: 즉시 업로드\n if (uploadMode === \"eager\") {\n setIsUploading(true);\n try {\n // uploader는 File[] 배열을 받아서 SonamuFile[] 배열을 반환해야 합니다\n const uploadedFiles = await uploader(filesToAdd);\n\n if (isMultiple) {\n // Multiple 파일 업로드\n const finalValues = [...values, ...uploadedFiles];\n (props.onValueChange as ((v: (SonamuFile | File)[]) => void) | undefined)?.(\n finalValues,\n );\n } else {\n // Single 파일 업로드\n (props.onValueChange as ((v: SonamuFile | File) => void) | undefined)?.(\n uploadedFiles[0],\n );\n }\n } catch (error) {\n console.error(\"Upload failed:\", error);\n alert(SD(\"rc.fileInput.uploadFailed\"));\n } finally {\n setIsUploading(false);\n }\n } else {\n // Lazy 모드: File 객체 그대로 전달\n if (isMultiple) {\n const finalValues = [...values, ...filesToAdd];\n (props.onValueChange as ((v: (SonamuFile | File)[]) => void) | undefined)?.(finalValues);\n } else {\n (props.onValueChange as ((v: SonamuFile | File) => void) | undefined)?.(filesToAdd[0]);\n }\n }\n },\n [disabled, totalCount, maxFiles, isMultiple, uploadMode, values, props, uploader],\n );\n\n const handleInputChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const files = Array.from(e.target.files || []);\n handleFilesChange(files);\n // input 초기화\n if (inputRef.current) {\n inputRef.current.value = \"\";\n }\n },\n [handleFilesChange],\n );\n\n const handleDrop = useCallback(\n (e: React.DragEvent) => {\n e.preventDefault();\n setDragOver(false);\n if (disabled || isUploading) return;\n\n const files = Array.from(e.dataTransfer.files);\n handleFilesChange(files);\n },\n [handleFilesChange, disabled, isUploading],\n );\n\n const handleRemove = useCallback(\n (index: number) => (e: React.MouseEvent) => {\n e.stopPropagation();\n\n if (!isMultiple) {\n (props.onValueChange as ((v: SonamuFile | File | null) => void) | undefined)?.(null);\n } else {\n const newValue = values.filter((_, i) => i !== index);\n (props.onValueChange as ((v: (SonamuFile | File)[]) => void) | undefined)?.(newValue);\n }\n },\n [values, isMultiple, props.onValueChange],\n );\n\n const handleClick = () => {\n if (!disabled && !isUploading) {\n inputRef.current?.click();\n }\n };\n\n // viewMode에 따라 적절한 사이즈 클래스 선택\n const sizeClasses = isImageView ? imageSizeClasses : fileSizeClasses;\n\n // Single 모드 렌더링\n if (!isMultiple && displayItems.length > 0) {\n const item = displayItems[0];\n return (\n <div className={cn(\"relative inline-block\", className)}>\n <input\n ref={inputRef}\n type=\"file\"\n accept={accept}\n onChange={handleInputChange}\n onBlur={onBlur}\n disabled={disabled || isUploading}\n className=\"sr-only\"\n />\n\n <div\n onClick={handleClick}\n onDrop={handleDrop}\n onDragOver={(e) => {\n e.preventDefault();\n !disabled && !isUploading && setDragOver(true);\n }}\n onDragLeave={(e) => {\n e.preventDefault();\n setDragOver(false);\n }}\n className={cn(\n \"relative flex items-center justify-center rounded-lg border-2 cursor-pointer transition-all\",\n sizeClasses[previewSize],\n isImageView\n ? \"border-transparent\"\n : \"border-dashed border-muted-foreground/25 hover:border-muted-foreground/50\",\n dragOver && \"border-primary bg-primary/5\",\n disabled && \"opacity-50 cursor-not-allowed\",\n isUploading && \"cursor-wait\",\n )}\n >\n {isUploading ? (\n <div className=\"flex flex-col items-center gap-2 text-muted-foreground\">\n <Loader2Icon className=\"h-6 w-6 animate-spin\" />\n <span className=\"text-xs\">{SD(\"rc.fileInput.uploading\")}</span>\n </div>\n ) : (\n <>\n {isImageView ? (\n <img\n src={item.url}\n alt=\"Preview\"\n className=\"h-full w-full object-cover rounded-lg overflow-hidden\"\n />\n ) : (\n <div className=\"flex items-center gap-2 px-3 h-full w-full min-w-0 overflow-hidden\">\n <FileIcon className=\"h-6 w-6 text-muted-foreground shrink-0\" />\n <span\n className={cn(\n \"text-xs truncate min-w-0\",\n item.isPending ? \"w-[140px] shrink-0\" : \"flex-1\",\n )}\n >\n {item.name}\n </span>\n {item.isPending && (\n <span className=\"px-2 py-0.5 bg-yellow-500/90 text-white text-xs rounded whitespace-nowrap shrink-0\">\n {SD(\"rc.fileInput.pending\")}\n </span>\n )}\n </div>\n )}\n {!disabled && (\n <Button\n type=\"button\"\n variant=\"destructive\"\n size=\"xs\"\n className=\"absolute -top-2 -right-2 h-6 w-6 rounded-full p-0\"\n onClick={handleRemove(0)}\n icon={<XIcon />}\n />\n )}\n {/* 이미지 모드일 때만 하단에 대기중 배지 표시 */}\n {isImageView && item.isPending && (\n <div className=\"absolute bottom-2 left-2 right-2 mx-auto max-w-[calc(100%-1rem)] px-2 py-1 bg-yellow-500/90 text-white text-xs rounded text-center truncate\">\n {SD(\"rc.fileInput.pending\")}\n </div>\n )}\n </>\n )}\n </div>\n </div>\n );\n }\n\n // Multiple 모드 또는 빈 Single 모드 렌더링\n return (\n <div className={cn(\"flex flex-wrap gap-3\", className)}>\n <input\n ref={inputRef}\n type=\"file\"\n accept={accept}\n multiple={isMultiple}\n onChange={handleInputChange}\n onBlur={onBlur}\n disabled={disabled || isUploading}\n className=\"sr-only\"\n />\n\n {/* 업로드된 파일들 */}\n {displayItems.map((item, index) => (\n <div key={`${item.url}-${index}`} className={cn(\"relative\", sizeClasses[previewSize])}>\n {isImageView ? (\n <div className=\"h-full w-full rounded-lg border overflow-hidden\">\n <img\n src={item.url}\n alt={`Uploaded ${index + 1}`}\n className=\"h-full w-full object-cover\"\n />\n </div>\n ) : (\n <div\n className={cn(\n \"relative flex items-center gap-2 px-3 rounded-lg border-2 min-w-0 overflow-hidden\",\n \"border-dashed border-muted-foreground/25\",\n \"h-full w-full\",\n )}\n >\n <FileIcon className=\"h-6 w-6 text-muted-foreground shrink-0\" />\n <span\n className={cn(\n \"text-xs truncate min-w-0\",\n item.isPending ? \"w-[140px] shrink-0\" : \"flex-1\",\n )}\n >\n {item.name}\n </span>\n {item.isPending && (\n <span className=\"px-2 py-0.5 bg-yellow-500/90 text-white text-xs rounded whitespace-nowrap shrink-0\">\n {SD(\"rc.fileInput.pending\")}\n </span>\n )}\n </div>\n )}\n {!disabled && (\n <Button\n type=\"button\"\n variant=\"destructive\"\n size=\"xs\"\n className=\"absolute -top-2 -right-2 h-6 w-6 rounded-full p-0\"\n onClick={handleRemove(index)}\n icon={<XIcon />}\n />\n )}\n {/* 이미지 모드일 때만 하단에 대기중 배지 표시 */}\n {isImageView && item.isPending && (\n <div className=\"absolute bottom-2 left-2 right-2 mx-auto max-w-[calc(100%-1rem)] px-2 py-1 bg-yellow-500/90 text-white text-xs rounded text-center truncate\">\n {SD(\"rc.fileInput.pending\")}\n </div>\n )}\n </div>\n ))}\n\n {/* 추가 버튼 */}\n {canAddMore && (\n <div\n onClick={handleClick}\n onDrop={handleDrop}\n onDragOver={(e) => {\n e.preventDefault();\n !disabled && !isUploading && setDragOver(true);\n }}\n onDragLeave={(e) => {\n e.preventDefault();\n setDragOver(false);\n }}\n className={cn(\n \"flex items-center justify-center rounded-lg border-2 border-dashed cursor-pointer transition-all\",\n sizeClasses[previewSize],\n dragOver\n ? \"border-primary bg-primary/5\"\n : \"border-muted-foreground/25 hover:border-muted-foreground/50\",\n disabled && \"opacity-50 cursor-not-allowed\",\n isUploading && \"cursor-wait\",\n )}\n >\n {isUploading ? (\n <div className=\"flex flex-col items-center gap-2 text-muted-foreground\">\n <Loader2Icon className=\"h-6 w-6 animate-spin\" />\n <span className=\"text-xs\">{SD(\"rc.fileInput.uploading\")}</span>\n </div>\n ) : (\n <div className=\"flex flex-col items-center gap-2 text-muted-foreground p-2\">\n {isImageView ? <ImageIcon className=\"h-6 w-6\" /> : <UploadIcon className=\"h-6 w-6\" />}\n <span className=\"text-xs text-center\">{defaultPlaceholder}</span>\n </div>\n )}\n </div>\n )}\n </div>\n );\n}\n","import * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { cva } from \"class-variance-authority\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst labelVariants = cva(\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\",\n);\n\nconst Label = React.forwardRef<\n React.ComponentRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & VariantProps<typeof labelVariants>\n>(({ className, ...props }, ref) => (\n <LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props} />\n));\nLabel.displayName = LabelPrimitive.Root.displayName;\n\nexport { Label };\n","import type * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\nimport { Controller, FormProvider, useFormContext } from \"react-hook-form\";\nimport { type ControllerProps, type FieldPath, type FieldValues } from \"react-hook-form\";\n\nimport { cn } from \"../../lib/utils\";\nimport { Label } from \"./label\";\n\nconst Form = FormProvider;\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = {\n name: TName;\n};\n\nconst FormFieldContext = React.createContext<FormFieldContextValue | null>(null);\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n};\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState, formState } = useFormContext();\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\");\n }\n\n if (!itemContext) {\n throw new Error(\"useFormField should be used within <FormItem>\");\n }\n\n const fieldState = getFieldState(fieldContext.name, formState);\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n};\n\ntype FormItemContextValue = {\n id: string;\n};\n\nconst FormItemContext = React.createContext<FormItemContextValue | null>(null);\n\nconst FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const id = React.useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn(\"space-y-2\", className)} {...props} />\n </FormItemContext.Provider>\n );\n },\n);\nFormItem.displayName = \"FormItem\";\n\nconst FormLabel = React.forwardRef<\n React.ComponentRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n\n return (\n <Label\n ref={ref}\n className={cn(error && \"text-destructive\", className)}\n htmlFor={formItemId}\n {...props}\n />\n );\n});\nFormLabel.displayName = \"FormLabel\";\n\nconst FormControl = React.forwardRef<\n React.ComponentRef<typeof Slot>,\n React.ComponentPropsWithoutRef<typeof Slot>\n>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n );\n});\nFormControl.displayName = \"FormControl\";\n\nconst FormDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n );\n});\nFormDescription.displayName = \"FormDescription\";\n\nconst FormMessage = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error?.message ?? \"\") : children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn(\"text-sm font-medium text-destructive\", className)}\n {...props}\n >\n {body}\n </p>\n );\n});\nFormMessage.displayName = \"FormMessage\";\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n};\n","import * as HoverCardPrimitive from \"@radix-ui/react-hover-card\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst HoverCard = HoverCardPrimitive.Root;\n\nconst HoverCardTrigger = HoverCardPrimitive.Trigger;\n\nconst HoverCardContent = React.forwardRef<\n React.ComponentRef<typeof HoverCardPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Content>\n>(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => (\n <HoverCardPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-hover-card-content-transform-origin]\",\n className,\n )}\n {...props}\n />\n));\nHoverCardContent.displayName = HoverCardPrimitive.Content.displayName;\n\nexport { HoverCard, HoverCardTrigger, HoverCardContent };\n","import { OTPInput, OTPInputContext } from \"input-otp\";\nimport * as React from \"react\";\nimport DotIcon from \"~icons/lucide/dot\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst InputOTP = React.forwardRef<\n React.ComponentRef<typeof OTPInput>,\n React.ComponentPropsWithoutRef<typeof OTPInput>\n>(({ className, containerClassName, ...props }, ref) => (\n <OTPInput\n ref={ref}\n containerClassName={cn(\n \"flex items-center gap-2 has-[:disabled]:opacity-50\",\n containerClassName,\n )}\n className={cn(\"disabled:cursor-not-allowed\", className)}\n {...props}\n />\n));\nInputOTP.displayName = \"InputOTP\";\n\nconst InputOTPGroup = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"flex items-center\", className)} {...props} />\n));\nInputOTPGroup.displayName = \"InputOTPGroup\";\n\nconst InputOTPSlot = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\"> & { index: number }\n>(({ index, className, ...props }, ref) => {\n const inputOTPContext = React.useContext(OTPInputContext);\n const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];\n\n return (\n <div\n ref={ref}\n className={cn(\n \"relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md\",\n isActive && \"z-10 ring-2 ring-ring ring-offset-background\",\n className,\n )}\n {...props}\n >\n {char}\n {hasFakeCaret && (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"h-4 w-px animate-caret-blink bg-foreground duration-1000\" />\n </div>\n )}\n </div>\n );\n});\nInputOTPSlot.displayName = \"InputOTPSlot\";\n\nconst InputOTPSeparator = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ ...props }, ref) => (\n <div ref={ref} role=\"separator\" {...props}>\n <DotIcon />\n </div>\n));\nInputOTPSeparator.displayName = \"InputOTPSeparator\";\n\nexport { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };\n","import * as MenubarPrimitive from \"@radix-ui/react-menubar\";\nimport * as React from \"react\";\nimport CheckIcon from \"~icons/lucide/check\";\nimport ChevronRightIcon from \"~icons/lucide/chevron-right\";\nimport CircleIcon from \"~icons/lucide/circle\";\n\nimport { cn } from \"../../lib/utils\";\n\nfunction MenubarMenu({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Menu>) {\n return <MenubarPrimitive.Menu {...props} />;\n}\n\nfunction MenubarGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Group>) {\n return <MenubarPrimitive.Group {...props} />;\n}\n\nfunction MenubarPortal({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Portal>) {\n return <MenubarPrimitive.Portal {...props} />;\n}\n\nfunction MenubarRadioGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.RadioGroup>) {\n return <MenubarPrimitive.RadioGroup {...props} />;\n}\n\nfunction MenubarSub({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Sub>) {\n return <MenubarPrimitive.Sub data-slot=\"menubar-sub\" {...props} />;\n}\n\nconst Menubar = React.forwardRef<\n React.ComponentRef<typeof MenubarPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Root\n ref={ref}\n className={cn(\n \"flex h-10 items-center space-x-1 rounded-md border bg-background p-1\",\n className,\n )}\n {...props}\n />\n));\nMenubar.displayName = MenubarPrimitive.Root.displayName;\n\nconst MenubarTrigger = React.forwardRef<\n React.ComponentRef<typeof MenubarPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground\",\n className,\n )}\n {...props}\n />\n));\nMenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;\n\nconst MenubarSubTrigger = React.forwardRef<\n React.ComponentRef<typeof MenubarPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <MenubarPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto h-4 w-4\" />\n </MenubarPrimitive.SubTrigger>\n));\nMenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;\n\nconst MenubarSubContent = React.forwardRef<\n React.ComponentRef<typeof MenubarPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.SubContent\n ref={ref}\n className={cn(\n \"z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-menubar-content-transform-origin]\",\n className,\n )}\n {...props}\n />\n));\nMenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;\n\nconst MenubarContent = React.forwardRef<\n React.ComponentRef<typeof MenubarPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>\n>(({ className, align = \"start\", alignOffset = -4, sideOffset = 8, ...props }, ref) => (\n <MenubarPrimitive.Portal>\n <MenubarPrimitive.Content\n ref={ref}\n align={align}\n alignOffset={alignOffset}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 min-w-48 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-menubar-content-transform-origin]\",\n className,\n )}\n {...props}\n />\n </MenubarPrimitive.Portal>\n));\nMenubarContent.displayName = MenubarPrimitive.Content.displayName;\n\nconst MenubarItem = React.forwardRef<\n React.ComponentRef<typeof MenubarPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <MenubarPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n));\nMenubarItem.displayName = MenubarPrimitive.Item.displayName;\n\nconst MenubarCheckboxItem = React.forwardRef<\n React.ComponentRef<typeof MenubarPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <MenubarPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <MenubarPrimitive.ItemIndicator>\n <CheckIcon className=\"h-4 w-4\" />\n </MenubarPrimitive.ItemIndicator>\n </span>\n {children}\n </MenubarPrimitive.CheckboxItem>\n));\nMenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;\n\nconst MenubarRadioItem = React.forwardRef<\n React.ComponentRef<typeof MenubarPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <MenubarPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <MenubarPrimitive.ItemIndicator>\n <CircleIcon className=\"h-2 w-2 fill-current\" />\n </MenubarPrimitive.ItemIndicator>\n </span>\n {children}\n </MenubarPrimitive.RadioItem>\n));\nMenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;\n\nconst MenubarLabel = React.forwardRef<\n React.ComponentRef<typeof MenubarPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <MenubarPrimitive.Label\n ref={ref}\n className={cn(\"px-2 py-1.5 text-sm font-semibold\", inset && \"pl-8\", className)}\n {...props}\n />\n));\nMenubarLabel.displayName = MenubarPrimitive.Label.displayName;\n\nconst MenubarSeparator = React.forwardRef<\n React.ComponentRef<typeof MenubarPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n));\nMenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;\n\nconst MenubarShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\"ml-auto text-xs tracking-widest text-muted-foreground\", className)}\n {...props}\n />\n );\n};\nMenubarShortcut.displayname = \"MenubarShortcut\";\n\nexport {\n Menubar,\n MenubarMenu,\n MenubarTrigger,\n MenubarContent,\n MenubarItem,\n MenubarSeparator,\n MenubarLabel,\n MenubarCheckboxItem,\n MenubarRadioGroup,\n MenubarRadioItem,\n MenubarPortal,\n MenubarSubContent,\n MenubarSubTrigger,\n MenubarGroup,\n MenubarSub,\n MenubarShortcut,\n};\n","import * as SeparatorPrimitive from \"@radix-ui/react-separator\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Separator = React.forwardRef<\n React.ComponentRef<typeof SeparatorPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(({ className, orientation = \"horizontal\", decorative = true, ...props }, ref) => (\n <SeparatorPrimitive.Root\n ref={ref}\n decorative={decorative}\n orientation={orientation}\n className={cn(\n \"shrink-0 bg-border\",\n orientation === \"horizontal\" ? \"h-px w-full\" : \"h-full w-px\",\n className,\n )}\n {...props}\n />\n));\nSeparator.displayName = SeparatorPrimitive.Root.displayName;\n\nexport { Separator };\n","import * as React from \"react\";\nimport { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from \"react\";\nimport CheckIcon from \"~icons/lucide/check\";\nimport ChevronDownIcon from \"~icons/lucide/chevron-down\";\nimport Loader2Icon from \"~icons/lucide/loader2\";\nimport XIcon from \"~icons/lucide/x\";\nimport XCircleIcon from \"~icons/lucide/x-circle\";\n\nimport { useSonamuBaseContext } from \"@/contexts\";\n\nimport { cn } from \"../../../lib/utils\";\nimport { Badge } from \"../badge\";\nimport { Button } from \"../button\";\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from \"../command\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../popover\";\nimport { Separator } from \"../separator\";\n\n// ============================================================================\n// Type Definition\n// ============================================================================\n\n// 아이템 요소에서 value 타입 추출\ntype ExtractValue<Item> = Item extends { value: infer V } ? V : Item;\n\n// 아이템 정의: 값만 넘기거나 { value, label, disabled } 형태로 넘길 수 있음\ntype SelectItemDef<V> = V | { value: V; label?: React.ReactNode; disabled?: boolean };\n\n// 정규화된 아이템 타입\ntype NormalizedItem<V> = { value: V; label?: React.ReactNode; disabled?: boolean };\n\n// 기본 Props\ninterface SelectPropsBase<Item> {\n items: Item[];\n placeholder?: string;\n clearable?: boolean;\n disabled?: boolean;\n className?: string;\n contentClassName?: string;\n renderItem?: (value: ExtractValue<Item>) => React.ReactNode;\n name?: string;\n onBlur?: React.FocusEventHandler<HTMLSelectElement>;\n}\n\n// valueKey 조건부 필수화: string | number일 때는 선택적, 그 외에는 필수\ntype SelectPropsWithValueKey<Item> =\n ExtractValue<Item> extends string | number\n ? { valueKey?: (value: ExtractValue<Item>) => string }\n : { valueKey: (value: ExtractValue<Item>) => string };\n\n// Single-Sync Props\ninterface SingleSyncProps<Item> {\n multiple?: false;\n async?: false;\n value?: ExtractValue<Item>;\n onValueChange?: (value: ExtractValue<Item> | undefined) => void;\n searchable?: boolean;\n}\n\n// Single-Async Props\ninterface SingleAsyncProps<Item> {\n multiple?: false;\n async: true;\n value?: ExtractValue<Item>;\n onValueChange?: (value: ExtractValue<Item> | undefined) => void;\n loading?: boolean;\n error?: Error;\n onSearch: (keyword: string) => void;\n searchDebounce?: number;\n}\n\n// Multi-Sync Props\ninterface MultiSyncProps<Item> {\n multiple: true;\n async?: false;\n value: ExtractValue<Item>[];\n onValueChange: (value: ExtractValue<Item>[]) => void;\n maxCount?: number;\n hideSelectAll?: boolean;\n searchable?: boolean;\n}\n\n// Multi-Async Props\ninterface MultiAsyncProps<Item> {\n multiple: true;\n async: true;\n value: ExtractValue<Item>[];\n onValueChange: (value: ExtractValue<Item>[]) => void;\n loading?: boolean;\n error?: Error;\n onSearch: (keyword: string) => void;\n searchDebounce?: number;\n maxCount?: number;\n hideSelectAll?: boolean;\n}\n\n// 통합 타입\ntype SelectProps<Item> = SelectPropsBase<Item> &\n SelectPropsWithValueKey<Item> &\n (SingleSyncProps<Item> | SingleAsyncProps<Item> | MultiSyncProps<Item> | MultiAsyncProps<Item>);\n\n// ============================================================================\n// Internal Types\n// ============================================================================\n\ntype CommonState<Item> = {\n // multi 모드 플래그\n isMultiple: boolean;\n // async 모드 플래그\n isAsync: boolean;\n // 숨겨진 native select ref\n selectRef: React.RefObject<HTMLSelectElement | null>;\n // Popover 상태\n isPopoverOpen: boolean;\n setIsPopoverOpen: React.Dispatch<React.SetStateAction<boolean>>;\n // 검색 상태\n searchValue: string;\n handleSearchChange: (value: string) => void;\n // 렌더링 옵션 (async: reserved 포함)\n filteredOptions: NormalizedItem<ExtractValue<Item>>[];\n // 입력 아이템 정규화 결과\n normalizedItems: NormalizedItem<ExtractValue<Item>>[];\n // 값 → 키 변환\n getKeyForValue: (val: ExtractValue<Item>) => string;\n // 키 → 값 변환\n valueByKey: Map<string, ExtractValue<Item>>;\n // 값 → 라벨 변환\n getItemLabel: (value: ExtractValue<Item>) => React.ReactNode;\n};\n\ntype CommandBasedSelectProps<Item> = {\n props: (\n | SingleSyncProps<Item>\n | SingleAsyncProps<Item>\n | MultiSyncProps<Item>\n | MultiAsyncProps<Item>\n ) &\n SelectPropsBase<Item> &\n SelectPropsWithValueKey<Item>;\n isMultiple: boolean;\n isAsync: boolean;\n isPopoverOpen: boolean;\n setIsPopoverOpen: React.Dispatch<React.SetStateAction<boolean>>;\n searchValue: string;\n handleSearchChange: (value: string) => void;\n filteredOptions: NormalizedItem<ExtractValue<Item>>[];\n getKeyForValue: (val: ExtractValue<Item>) => string;\n getItemLabel: (value: ExtractValue<Item>) => React.ReactNode;\n};\n\n// ============================================================================\n// Type Guard\n// ============================================================================\n\n// 아이템이 { value, label, disabled } 형태인지 확인\nfunction isItemObject<V>(\n item: V | { value: V; label?: React.ReactNode; disabled?: boolean },\n): item is { value: V; label?: React.ReactNode; disabled?: boolean } {\n return item !== null && typeof item === \"object\" && \"value\" in item;\n}\n\n// ============================================================================\n// Hooks & Renderers\n// ============================================================================\n\nfunction useSelectCommon<Item>(\n props: SelectProps<Item>,\n ref: React.ForwardedRef<HTMLSelectElement>,\n): CommonState<Item> {\n type Value = ExtractValue<Item>;\n\n // 모드 파생\n const isMultiple = props.multiple === true;\n const isAsync = props.async === true;\n\n // native select 연결\n const selectRef = useRef<HTMLSelectElement>(null);\n useImperativeHandle(ref, () => selectRef.current as HTMLSelectElement);\n\n // popover + 검색 상태\n const [isPopoverOpen, setIsPopoverOpen] = useState(false);\n const [searchValue, setSearchValue] = useState(\"\");\n // async 모드에서 선택된 옵션 캐시\n const [reservedOptions, setReservedOptions] = useState(new Map());\n\n // 값 → 키 변환\n const getKeyForValue = useCallback(\n (val: Value): string => {\n if (val === undefined || val === null) return \"\";\n if (props.valueKey) return props.valueKey(val);\n return String(val);\n },\n [props.valueKey],\n );\n\n // 아이템 정규화\n const normalizedItems = useMemo(() => {\n return props.items.map(\n (item): NormalizedItem<Value> =>\n isItemObject(item) ? (item as NormalizedItem<Value>) : { value: item as Value },\n );\n }, [props.items]);\n\n // 키 → 값 매핑 (Single-Sync 모드용)\n const valueByKey = useMemo(() => {\n const mapping = new Map<string, Value>();\n for (const item of normalizedItems) {\n mapping.set(getKeyForValue(item.value), item.value);\n }\n return mapping;\n }, [normalizedItems, getKeyForValue]);\n\n // 값 → 라벨 렌더링\n const getItemLabel = useCallback(\n (value: Value): React.ReactNode => {\n // renderItem이 있으면 바로 사용 (대부분의 경우 여기서 종료)\n if (props.renderItem) {\n return props.renderItem(value);\n }\n\n // label 찾기: normalizedItems에서 먼저 확인\n const item = normalizedItems.find((i) => i.value === value);\n if (item?.label !== undefined) {\n return item.label;\n }\n\n // async 모드면 reservedOptions에서도 확인\n if (isAsync) {\n const cached = reservedOptions.get(getKeyForValue(value));\n if (cached?.label !== undefined) {\n return cached.label;\n }\n }\n\n // 마지막 폴백: String 변환\n return String(value);\n },\n [props.renderItem, normalizedItems, isAsync, reservedOptions, getKeyForValue],\n );\n\n // Async 모드: 선택된 옵션을 캐시에 저장\n useEffect(() => {\n if (!isAsync) return;\n\n // 현재 선택된 값들 추출\n const values = isMultiple\n ? (props as MultiAsyncProps<Item>).value\n : [(props as SingleAsyncProps<Item>).value as Value].filter(Boolean);\n\n const next = new Map<string, NormalizedItem<Value>>();\n\n // 선택된 값들만 캐시에 저장\n for (const val of values) {\n const key = getKeyForValue(val);\n const item = normalizedItems.find((item) => item.value === val);\n if (item) {\n next.set(key, item);\n }\n }\n\n setReservedOptions(next);\n }, [isAsync, isMultiple, props, normalizedItems, getKeyForValue]);\n\n // 검색어 변경\n const handleSearchChange = useCallback((value: string) => {\n setSearchValue(value);\n }, []);\n\n // 검색 디바운스\n const onSearchFn = isAsync && \"onSearch\" in props ? props.onSearch : undefined;\n const searchDebounceTime =\n isAsync && \"searchDebounce\" in props && props.searchDebounce !== undefined\n ? props.searchDebounce\n : 300;\n\n useEffect(() => {\n if (!onSearchFn) return;\n\n // 빈 문자열(검색어 삭제 / 팝오버 닫힘으로 인한 초기화)은 즉시 전파하여\n // 부모의 keyword state를 리셋합니다. 이렇게 해야 \"검색어 비움 → 초기 리스트\"와\n // \"선택 후 재오픈 → 초기 리스트\" 동작이 성립합니다. 비어 있지 않은 입력만\n // 디바운스합니다.\n const timer = setTimeout(\n () => {\n onSearchFn(searchValue);\n },\n searchValue === \"\" ? 0 : searchDebounceTime,\n );\n\n return () => clearTimeout(timer);\n }, [searchValue, onSearchFn, searchDebounceTime]);\n\n // 표시할 옵션: async는 검색 결과 + reserved, sync는 로컬 필터링\n const filteredOptions = useMemo(() => {\n if (isAsync) {\n const combined = new Map<string, NormalizedItem<Value>>();\n\n for (const [key, item] of reservedOptions) {\n combined.set(key, item);\n }\n\n for (const item of normalizedItems) {\n combined.set(getKeyForValue(item.value), item);\n }\n\n return Array.from(combined.values());\n } else {\n if (!searchValue) return normalizedItems;\n\n return normalizedItems.filter((item) => {\n const label = getItemLabel(item.value);\n return String(label).toLowerCase().includes(searchValue.toLowerCase());\n });\n }\n }, [isAsync, normalizedItems, reservedOptions, searchValue, getKeyForValue, getItemLabel]);\n\n // Popover 닫힐 때 검색어 초기화\n useEffect(() => {\n if (!isPopoverOpen) {\n setSearchValue(\"\");\n }\n }, [isPopoverOpen]);\n\n return {\n isMultiple,\n isAsync,\n selectRef,\n isPopoverOpen,\n setIsPopoverOpen,\n searchValue,\n handleSearchChange,\n filteredOptions,\n normalizedItems,\n getKeyForValue,\n valueByKey,\n getItemLabel,\n };\n}\n\n// ============================================================================\n// CommandBasedSelect\n// - 모든 모드를 처리하는 통합 Command Popover UI\n// ============================================================================\nfunction highlightMatch(label: React.ReactNode, searchTerm: string): React.ReactNode {\n if (!searchTerm || typeof label !== \"string\") {\n return label;\n }\n\n const lowerLabel = label.toLowerCase();\n const lowerSearch = searchTerm.toLowerCase();\n const idx = lowerLabel.indexOf(lowerSearch);\n\n if (idx === -1) {\n return label;\n }\n\n const before = label.slice(0, idx);\n const match = label.slice(idx, idx + searchTerm.length);\n const after = label.slice(idx + searchTerm.length);\n\n return (\n <>\n {before}\n <strong className=\"font-bold\">{match}</strong>\n {after}\n </>\n );\n}\n\nfunction CommandBasedSelect<Item>({\n props,\n isMultiple,\n isAsync,\n isPopoverOpen,\n setIsPopoverOpen,\n searchValue,\n handleSearchChange,\n filteredOptions,\n getKeyForValue,\n getItemLabel,\n}: CommandBasedSelectProps<Item>) {\n type Value = ExtractValue<Item>;\n const { SD } = useSonamuBaseContext();\n const commandListRef = useRef<HTMLDivElement>(null);\n\n // 검색 가능 여부 판단: Async면 무조건 true, Sync면 searchable 값 사용\n const isSearchable = isAsync || (\"searchable\" in props && props.searchable === true);\n\n // Wheel 이벤트 핸들러\n const handleWheel = useCallback((e: React.WheelEvent<HTMLDivElement>) => {\n const target = commandListRef.current;\n if (!target) return;\n\n const canScrollDown = target.scrollTop < target.scrollHeight - target.clientHeight;\n const canScrollUp = target.scrollTop > 0;\n\n if ((e.deltaY > 0 && canScrollDown) || (e.deltaY < 0 && canScrollUp)) {\n e.stopPropagation();\n }\n }, []);\n\n // 선택 토글 (single/multi 공용)\n const toggleOption = useCallback(\n (value: Value) => {\n if (props.disabled) return;\n\n if (isMultiple) {\n const currentValues = (props as MultiSyncProps<Item> | MultiAsyncProps<Item>).value;\n const newValues = currentValues.includes(value)\n ? currentValues.filter((v) => v !== value)\n : [...currentValues, value];\n (props as MultiSyncProps<Item> | MultiAsyncProps<Item>).onValueChange(newValues);\n } else {\n (props as SingleSyncProps<Item> | SingleAsyncProps<Item>).onValueChange?.(value);\n setIsPopoverOpen(false);\n }\n },\n [isMultiple, props, setIsPopoverOpen],\n );\n\n // 전체 선택 토글 (multi만)\n const toggleAll = useCallback(() => {\n if (!isMultiple || props.disabled) return;\n\n const allOptions = filteredOptions.filter((option) => !option.disabled);\n const currentValues = (props as MultiSyncProps<Item> | MultiAsyncProps<Item>).value;\n\n if (currentValues.length === allOptions.length) {\n (props as MultiSyncProps<Item> | MultiAsyncProps<Item>).onValueChange([]);\n } else {\n const allValues = allOptions.map((option) => option.value);\n (props as MultiSyncProps<Item> | MultiAsyncProps<Item>).onValueChange(allValues);\n }\n }, [isMultiple, props, filteredOptions]);\n\n // Clear 처리\n const handleClear = useCallback(() => {\n if (props.disabled) return;\n\n if (isMultiple) {\n (props as MultiSyncProps<Item> | MultiAsyncProps<Item>).onValueChange([]);\n } else {\n (props as SingleSyncProps<Item> | SingleAsyncProps<Item>).onValueChange?.(undefined);\n }\n }, [isMultiple, props]);\n\n // 선택 여부 확인\n const isSelected = useCallback(\n (value: Value): boolean => {\n if (isMultiple) {\n return (props as MultiSyncProps<Item> | MultiAsyncProps<Item>).value.includes(value);\n } else {\n return (props as SingleSyncProps<Item> | SingleAsyncProps<Item>).value === value;\n }\n },\n [isMultiple, props],\n );\n\n // async 상태\n const loading = isAsync && \"loading\" in props ? props.loading : false;\n const error = isAsync && \"error\" in props ? props.error : undefined;\n const hasValue = isMultiple\n ? (props as MultiSyncProps<Item> | MultiAsyncProps<Item>).value.length > 0\n : (props as SingleSyncProps<Item> | SingleAsyncProps<Item>).value !== undefined &&\n (props as SingleSyncProps<Item> | SingleAsyncProps<Item>).value !== null &&\n (props as SingleSyncProps<Item> | SingleAsyncProps<Item>).value !== \"\";\n\n // Badge 렌더링 헬퍼 (multi 모드 전용)\n const renderBadges = () => {\n if (!isMultiple) return null;\n\n const values = (props as MultiSyncProps<Item> | MultiAsyncProps<Item>).value;\n\n return (\n <>\n {values.map((value) => {\n const key = getKeyForValue(value);\n return (\n <Badge\n key={key}\n variant=\"outline\"\n className=\"m-1 transition-all duration-300 ease-in-out\"\n >\n {getItemLabel(value)}\n <XCircleIcon\n className=\"ml-2 h-3 w-3 cursor-pointer\"\n onClick={(e) => {\n e.stopPropagation();\n toggleOption(value);\n }}\n />\n </Badge>\n );\n })}\n </>\n );\n };\n\n return (\n <Popover open={isPopoverOpen} onOpenChange={setIsPopoverOpen}>\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n role=\"combobox\"\n aria-expanded={isPopoverOpen}\n disabled={props.disabled || loading}\n className={cn(\n \"flex p-1 rounded-md border border-input min-h-10 h-auto items-center justify-between bg-white hover:bg-white hover:text-inherit [&_svg]:pointer-events-auto w-full\",\n props.className,\n )}\n >\n {isMultiple && hasValue ? (\n <div className=\"flex justify-between items-center w-full\">\n <div className=\"flex items-center gap-1 flex-wrap\">{renderBadges()}</div>\n <div className=\"flex items-center justify-between\">\n {props.clearable && (\n <div\n role=\"button\"\n tabIndex={0}\n onClick={(e) => {\n e.stopPropagation();\n handleClear();\n }}\n className=\"flex items-center justify-center h-4 w-4 mx-2 cursor-pointer text-muted-foreground hover:text-foreground\"\n >\n <XIcon className=\"h-4 w-4\" />\n </div>\n )}\n <Separator orientation=\"vertical\" className=\"flex min-h-6 h-full\" />\n <ChevronDownIcon className=\"h-4 mx-2 cursor-pointer text-muted-foreground\" />\n </div>\n </div>\n ) : !isMultiple && hasValue ? (\n <div className=\"flex justify-between items-center w-full px-2 py-1\">\n {(() => {\n const value = (props as SingleSyncProps<Item> | SingleAsyncProps<Item>).value;\n return value !== undefined && value !== null ? (\n <span className=\"flex-1 truncate text-left text-sm\">{getItemLabel(value)}</span>\n ) : null;\n })()}\n <div className=\"flex items-center gap-1 shrink-0\">\n {props.clearable && hasValue && (\n <XCircleIcon\n className=\"h-4 w-4 cursor-pointer opacity-50 hover:opacity-100 transition-opacity\"\n onPointerDownCapture={handleClear}\n onMouseDownCapture={handleClear}\n />\n )}\n <ChevronDownIcon className=\"h-4 w-4 opacity-50\" />\n </div>\n </div>\n ) : (\n <div className=\"flex items-center justify-between w-full px-2 py-1\">\n <span className=\"text-sm text-muted-foreground flex-1 truncate text-left\">\n {props.placeholder}\n </span>\n <ChevronDownIcon className=\"h-4 cursor-pointer text-muted-foreground\" />\n </div>\n )}\n </Button>\n </PopoverTrigger>\n <PopoverContent\n className=\"min-w-40 p-0\"\n align=\"start\"\n style={{ width: \"var(--radix-popover-trigger-width)\" }}\n >\n <Command shouldFilter={false}>\n {isSearchable && (\n <CommandInput\n placeholder={SD(\"common.searchPlaceholder\")}\n value={searchValue}\n onValueChange={handleSearchChange}\n />\n )}\n <CommandList ref={commandListRef} onWheel={handleWheel}>\n {loading ? (\n <CommandEmpty>\n <div className=\"flex items-center justify-center\">\n <Loader2Icon className=\"h-4 w-4 animate-spin mr-2\" />\n </div>\n </CommandEmpty>\n ) : error ? (\n <CommandEmpty>Error: {error.message}</CommandEmpty>\n ) : filteredOptions.length === 0 ? (\n <CommandEmpty>{SD(\"rc.multiSelect.noResults\")}</CommandEmpty>\n ) : (\n <>\n {isMultiple && !(\"hideSelectAll\" in props && props.hideSelectAll) && (\n <CommandGroup>\n <CommandItem onSelect={toggleAll} className=\"cursor-pointer\">\n <div\n className={cn(\n \"mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary\",\n (props as MultiSyncProps<Item> | MultiAsyncProps<Item>).value.length ===\n filteredOptions.filter((opt) => !opt.disabled).length\n ? \"bg-primary text-primary-foreground\"\n : \"opacity-50 [&_svg]:invisible\",\n )}\n >\n <CheckIcon className=\"h-4 w-4\" />\n </div>\n <span>({SD(\"rc.multiSelect.selectAll\")})</span>\n </CommandItem>\n </CommandGroup>\n )}\n <CommandGroup>\n {filteredOptions.map((option) => {\n const key = getKeyForValue(option.value);\n const selected = isSelected(option.value);\n\n return (\n <CommandItem\n key={key}\n onSelect={() => toggleOption(option.value)}\n disabled={option.disabled}\n className={cn(\n \"cursor-pointer\",\n option.disabled && \"opacity-50 cursor-not-allowed\",\n )}\n >\n {isMultiple && (\n <div\n className={cn(\n \"mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary\",\n selected\n ? \"bg-primary text-primary-foreground\"\n : \"opacity-50 [&_svg]:invisible\",\n )}\n >\n <CheckIcon className=\"h-4 w-4\" />\n </div>\n )}\n {!isMultiple && (\n <CheckIcon\n className={cn(\"mr-2 h-4 w-4\", selected ? \"opacity-100\" : \"opacity-0\")}\n />\n )}\n <span>{highlightMatch(getItemLabel(option.value), searchValue)}</span>\n </CommandItem>\n );\n })}\n </CommandGroup>\n </>\n )}\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n );\n}\n\n// ============================================================================\n// Main Component & Export\n// ============================================================================\n\nexport const Select = React.forwardRef(function Select<Item>(\n props: SelectProps<Item>,\n ref: React.ForwardedRef<HTMLSelectElement>,\n) {\n // 공통 상태/유틸\n const common = useSelectCommon(props, ref);\n\n // 모든 모드를 CommandBasedSelect로 통합\n const commandProps = props as (\n | SingleSyncProps<Item>\n | SingleAsyncProps<Item>\n | MultiSyncProps<Item>\n | MultiAsyncProps<Item>\n ) &\n SelectPropsBase<Item> &\n SelectPropsWithValueKey<Item>;\n\n return (\n <CommandBasedSelect\n props={commandProps}\n isMultiple={common.isMultiple}\n isAsync={common.isAsync}\n isPopoverOpen={common.isPopoverOpen}\n setIsPopoverOpen={common.setIsPopoverOpen}\n searchValue={common.searchValue}\n handleSearchChange={common.handleSearchChange}\n filteredOptions={common.filteredOptions}\n getKeyForValue={common.getKeyForValue}\n getItemLabel={common.getItemLabel}\n />\n );\n}) as <Item>(\n props: SelectProps<Item> & React.RefAttributes<HTMLSelectElement>,\n) => React.ReactElement;\n\nexport type { SelectProps, SelectItemDef, ExtractValue };\n","\"use client\";\n\nimport { format } from \"date-fns\";\nimport * as React from \"react\";\nimport { type DateRange } from \"react-day-picker\";\n\nimport { useSonamuBaseContext } from \"@/contexts\";\n\nimport { Button } from \"./button\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\";\nimport { Select } from \"./select/select\";\n\n/** 단일 월 또는 월 범위 값 */\nexport type MonthPickerValue =\n | { type: \"single\"; date: Date }\n | { type: \"range\"; from: Date; to: Date };\n\ninterface MonthPickerMultipleProps {\n /** Calendar icon component */\n CalendarIcon: React.ComponentType<{ className?: string }>;\n /** ChevronDown icon component */\n ChevronDownIcon: React.ComponentType<{ className?: string }>;\n /** Current value */\n value?: MonthPickerValue;\n /** Callback when value changes */\n onValueChange?: (value: MonthPickerValue | undefined) => void;\n /** Placeholder text when no value */\n placeholder?: string;\n /** Date format string for display */\n dateFormat?: string;\n /** Custom className for trigger button */\n className?: string;\n /** Year range for selection */\n yearRange?: { start: number; end: number };\n /** Default to range mode when opening */\n defaultRangeMode?: boolean;\n}\n\nconst MONTHS = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n\nexport function MonthPickerMultiple({\n CalendarIcon,\n ChevronDownIcon,\n value,\n onValueChange,\n placeholder,\n dateFormat = \"MMM/yyyy\",\n className = \"\",\n yearRange = { start: 2020, end: 2030 },\n defaultRangeMode = false,\n}: MonthPickerMultipleProps) {\n const { SD } = useSonamuBaseContext();\n\n // Popover open state\n const [isOpen, setIsOpen] = React.useState(false);\n\n // Temp states (managed internally)\n const [tempIsRangeMode, setTempIsRangeMode] = React.useState(defaultRangeMode);\n const [tempDate, setTempDate] = React.useState<Date | undefined>();\n const [tempDateRange, setTempDateRange] = React.useState<DateRange | undefined>();\n const [tempYear, setTempYear] = React.useState(new Date().getFullYear());\n const [tempRangeStartYear, setTempRangeStartYear] = React.useState(new Date().getFullYear());\n const [tempRangeEndYear, setTempRangeEndYear] = React.useState(new Date().getFullYear());\n\n const years = React.useMemo(\n () =>\n Array.from({ length: yearRange.end - yearRange.start + 1 }, (_, i) => yearRange.start + i),\n [yearRange.start, yearRange.end],\n );\n\n // Initialize temp states when popover opens\n React.useEffect(() => {\n if (isOpen) {\n if (value?.type === \"range\") {\n setTempIsRangeMode(true);\n setTempDateRange({ from: value.from, to: value.to });\n setTempDate(undefined);\n setTempRangeStartYear(value.from.getFullYear());\n setTempRangeEndYear(value.to.getFullYear());\n } else if (value?.type === \"single\") {\n setTempIsRangeMode(false);\n setTempDate(value.date);\n setTempDateRange(undefined);\n setTempYear(value.date.getFullYear());\n } else {\n setTempIsRangeMode(defaultRangeMode);\n setTempDate(undefined);\n setTempDateRange(undefined);\n setTempYear(new Date().getFullYear());\n setTempRangeStartYear(new Date().getFullYear());\n setTempRangeEndYear(new Date().getFullYear());\n }\n }\n }, [isOpen, value, defaultRangeMode]);\n\n const getDisplayDate = () => {\n if (!value) {\n return placeholder ?? `- ${format(new Date(), dateFormat)}`;\n }\n if (value.type === \"single\") {\n return format(value.date, dateFormat);\n }\n return `${format(value.from, dateFormat)} - ${format(value.to, dateFormat)}`;\n };\n\n const handleModeChange = (isRangeMode: boolean) => {\n setTempIsRangeMode(isRangeMode);\n if (isRangeMode) {\n setTempDate(undefined);\n } else {\n setTempDateRange(undefined);\n }\n };\n\n const handleSave = () => {\n let newValue: MonthPickerValue | undefined;\n\n if (tempIsRangeMode && tempDateRange?.from && tempDateRange?.to) {\n newValue = {\n type: \"range\",\n from: tempDateRange.from,\n to: tempDateRange.to,\n };\n } else if (!tempIsRangeMode && tempDate) {\n newValue = { type: \"single\", date: tempDate };\n }\n\n onValueChange?.(newValue);\n setIsOpen(false);\n };\n\n const handleCancel = () => {\n setIsOpen(false);\n };\n\n return (\n <div className=\"flex items-center gap-4\">\n <Popover open={isOpen} onOpenChange={setIsOpen}>\n <PopoverTrigger asChild>\n <Button variant=\"outline\" className={`gap-2 h-8 text-xs ${className}`}>\n <CalendarIcon className=\"h-4 w-4\" />\n {getDisplayDate()}\n <ChevronDownIcon className=\"h-4 w-4\" />\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0\" align=\"start\">\n <div className=\"p-3 border-b space-y-2\">\n <div className=\"flex gap-2\">\n <Button\n variant={!tempIsRangeMode ? \"default\" : \"outline\"}\n size=\"sm\"\n onClick={() => handleModeChange(false)}\n className=\"flex-1 h-7 text-xs\"\n >\n {SD(\"rc.monthPickerMultiple.singleDate\")}\n </Button>\n <Button\n variant={tempIsRangeMode ? \"default\" : \"outline\"}\n size=\"sm\"\n onClick={() => handleModeChange(true)}\n className=\"flex-1 h-7 text-xs\"\n >\n {SD(\"rc.monthPickerMultiple.dateRange\")}\n </Button>\n </div>\n </div>\n {tempIsRangeMode ? (\n <div className=\"flex\">\n {/* Start Date */}\n <div className=\"p-4 space-y-2\">\n <div className=\"text-xs text-muted-foreground\">\n {SD(\"rc.monthPickerMultiple.startDate\")}\n </div>\n <Select\n value={tempRangeStartYear}\n onValueChange={(value) => {\n if (value !== undefined) setTempRangeStartYear(value);\n }}\n items={years.map((year) => ({\n value: year,\n label: String(year),\n disabled: tempDateRange?.to ? year > tempDateRange.to.getFullYear() : false,\n }))}\n className=\"h-8 text-xs\"\n />\n <div className=\"grid grid-cols-3 gap-2\">\n {MONTHS.map((month, idx) => {\n const isDisabled = tempDateRange?.to\n ? tempRangeStartYear > tempDateRange.to.getFullYear() ||\n (tempRangeStartYear === tempDateRange.to.getFullYear() &&\n idx > tempDateRange.to.getMonth())\n : false;\n return (\n <Button\n key={month}\n variant={\n tempDateRange?.from?.getMonth() === idx &&\n tempDateRange?.from?.getFullYear() === tempRangeStartYear\n ? \"default\"\n : \"outline\"\n }\n size=\"sm\"\n onClick={() => {\n const newDate = new Date(tempRangeStartYear, idx, 1);\n // 이미 선택된 시작 월을 다시 클릭하면 해제\n if (\n tempDateRange?.from?.getMonth() === idx &&\n tempDateRange?.from?.getFullYear() === tempRangeStartYear\n ) {\n setTempDateRange({ from: undefined, to: tempDateRange?.to });\n } else {\n setTempDateRange({ from: newDate, to: tempDateRange?.to });\n }\n }}\n disabled={isDisabled}\n className=\"h-8 text-xs\"\n >\n {month}\n </Button>\n );\n })}\n </div>\n </div>\n {/* Divider */}\n <div className=\"border-r\" />\n {/* End Date */}\n <div className=\"p-4 space-y-2\">\n <div className=\"text-xs text-muted-foreground\">\n {SD(\"rc.monthPickerMultiple.endDate\")}\n </div>\n <Select\n value={tempRangeEndYear}\n onValueChange={(value) => {\n if (value !== undefined) setTempRangeEndYear(value);\n }}\n items={years.map((year) => ({\n value: year,\n label: String(year),\n disabled: tempDateRange?.from ? year < tempDateRange.from.getFullYear() : false,\n }))}\n className=\"h-8 text-xs\"\n />\n <div className=\"grid grid-cols-3 gap-2\">\n {MONTHS.map((month, idx) => {\n const isDisabled = tempDateRange?.from\n ? tempRangeEndYear < tempDateRange.from.getFullYear() ||\n (tempRangeEndYear === tempDateRange.from.getFullYear() &&\n idx < tempDateRange.from.getMonth())\n : false;\n return (\n <Button\n key={month}\n variant={\n tempDateRange?.to?.getMonth() === idx &&\n tempDateRange?.to?.getFullYear() === tempRangeEndYear\n ? \"default\"\n : \"outline\"\n }\n size=\"sm\"\n onClick={() => {\n const newDate = new Date(tempRangeEndYear, idx, 1);\n // 이미 선택된 종료 월을 다시 클릭하면 해제\n if (\n tempDateRange?.to?.getMonth() === idx &&\n tempDateRange?.to?.getFullYear() === tempRangeEndYear\n ) {\n setTempDateRange({ from: tempDateRange?.from, to: undefined });\n } else {\n setTempDateRange({ from: tempDateRange?.from, to: newDate });\n }\n }}\n disabled={isDisabled}\n className=\"h-8 text-xs\"\n >\n {month}\n </Button>\n );\n })}\n </div>\n </div>\n </div>\n ) : (\n <div className=\"p-4 space-y-2\">\n <Select\n value={tempYear}\n onValueChange={(value) => {\n if (value !== undefined) setTempYear(value);\n }}\n items={years.map((year) => ({ value: year, label: String(year) }))}\n className=\"h-8 text-xs\"\n />\n <div className=\"grid grid-cols-3 gap-2\">\n {MONTHS.map((month, idx) => (\n <Button\n key={month}\n variant={\n tempDate?.getMonth() === idx && tempDate?.getFullYear() === tempYear\n ? \"default\"\n : \"outline\"\n }\n size=\"sm\"\n onClick={() => {\n const newDate = new Date(tempYear, idx, 1);\n // 이미 선택된 월을 다시 클릭하면 해제\n if (tempDate?.getMonth() === idx && tempDate?.getFullYear() === tempYear) {\n setTempDate(undefined);\n } else {\n setTempDate(newDate);\n }\n }}\n className=\"h-8 text-xs\"\n >\n {month}\n </Button>\n ))}\n </div>\n </div>\n )}\n <div className=\"p-3 border-t flex justify-end gap-2\">\n <Button variant=\"outline\" size=\"sm\" onClick={handleCancel} className=\"h-8 text-xs\">\n {SD(\"rc.common.cancel\")}\n </Button>\n <Button variant=\"default\" size=\"sm\" onClick={handleSave} className=\"h-8 text-xs\">\n {SD(\"rc.common.save\")}\n </Button>\n </div>\n </PopoverContent>\n </Popover>\n </div>\n );\n}\n","import * as NavigationMenuPrimitive from \"@radix-ui/react-navigation-menu\";\nimport { cva } from \"class-variance-authority\";\nimport * as React from \"react\";\nimport ChevronDownIcon from \"~icons/lucide/chevron-down\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst NavigationMenu = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>\n>(({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Root\n ref={ref}\n className={cn(\"relative z-10 flex max-w-max flex-1 items-center justify-center\", className)}\n {...props}\n >\n {children}\n <NavigationMenuViewport />\n </NavigationMenuPrimitive.Root>\n));\nNavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;\n\nconst NavigationMenuList = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.List\n ref={ref}\n className={cn(\"group flex flex-1 list-none items-center justify-center space-x-1\", className)}\n {...props}\n />\n));\nNavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;\n\nconst NavigationMenuItem = NavigationMenuPrimitive.Item;\n\nconst navigationMenuTriggerStyle = cva(\n \"group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:text-accent-foreground data-[state=open]:bg-accent/50 data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent\",\n);\n\nconst NavigationMenuTrigger = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Trigger\n ref={ref}\n className={cn(navigationMenuTriggerStyle(), \"group\", className)}\n {...props}\n >\n {children}{\" \"}\n <ChevronDownIcon\n className=\"relative top-px ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180\"\n aria-hidden=\"true\"\n />\n </NavigationMenuPrimitive.Trigger>\n));\nNavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;\n\nconst NavigationMenuContent = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Content\n ref={ref}\n className={cn(\n \"left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto \",\n className,\n )}\n {...props}\n />\n));\nNavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;\n\nconst NavigationMenuLink = NavigationMenuPrimitive.Link;\n\nconst NavigationMenuViewport = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Viewport>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>\n>(({ className, ...props }, ref) => (\n <div className={cn(\"absolute left-0 top-full flex justify-center\")}>\n <NavigationMenuPrimitive.Viewport\n className={cn(\n \"origin-top-center relative mt-1.5 h-(--radix-navigation-menu-viewport-height) w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-(--radix-navigation-menu-viewport-width)\",\n className,\n )}\n ref={ref}\n {...props}\n />\n </div>\n));\nNavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;\n\nconst NavigationMenuIndicator = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Indicator>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Indicator\n ref={ref}\n className={cn(\n \"top-full z-1 flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in\",\n className,\n )}\n {...props}\n >\n <div className=\"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md\" />\n </NavigationMenuPrimitive.Indicator>\n));\nNavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;\n\nexport {\n navigationMenuTriggerStyle,\n NavigationMenu,\n NavigationMenuList,\n NavigationMenuItem,\n NavigationMenuContent,\n NavigationMenuTrigger,\n NavigationMenuLink,\n NavigationMenuIndicator,\n NavigationMenuViewport,\n};\n","import * as React from \"react\";\n\nimport { useSonamuBaseContext } from \"../../contexts\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"./button\";\n\nexport interface PaginationProps {\n value: number;\n onValueChange: (page: number) => void;\n total: number;\n itemsPerPage: number;\n className?: string;\n maxVisible?: number;\n}\n\nexport const Pagination = React.forwardRef<HTMLDivElement, PaginationProps>(\n ({ value, onValueChange, total, itemsPerPage, className, maxVisible = 6 }, ref) => {\n const { SD } = useSonamuBaseContext();\n const totalPages = Math.ceil(total / itemsPerPage);\n const currentPage = value;\n const startItem = (currentPage - 1) * itemsPerPage + 1;\n const endItem = Math.min(currentPage * itemsPerPage, total);\n\n return (\n <div ref={ref} className={cn(\"flex items-center justify-between pt-6\", className)}>\n <div className=\"text-xs text-muted-foreground\">\n {(\n SD(\"rc.pagination.showing\") as unknown as (\n start: number,\n end: number,\n total: number,\n ) => string\n )(startItem, endItem, total)}\n </div>\n <div className=\"flex items-center gap-2\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"h-8 px-3 text-xs\"\n disabled={currentPage === 1}\n onClick={() => onValueChange(currentPage - 1)}\n >\n {SD(\"rc.pagination.previous\")}\n </Button>\n <div className=\"flex items-center gap-1\">\n {(() => {\n let startPage = Math.max(1, currentPage - Math.floor(maxVisible / 2));\n const endPage = Math.min(totalPages, startPage + maxVisible - 1);\n if (endPage - startPage + 1 < maxVisible) {\n startPage = Math.max(1, endPage - maxVisible + 1);\n }\n return Array.from({ length: endPage - startPage + 1 }, (_, i) => startPage + i).map(\n (page) => (\n <Button\n key={page}\n variant=\"outline\"\n size=\"sm\"\n className={`h-8 w-8 text-xs ${page === currentPage ? \"bg-primary text-primary-foreground\" : \"\"}`}\n onClick={() => onValueChange(page)}\n >\n {page}\n </Button>\n ),\n );\n })()}\n </div>\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"h-8 px-3 text-xs\"\n disabled={currentPage === totalPages}\n onClick={() => onValueChange(currentPage + 1)}\n >\n {SD(\"rc.pagination.next\")}\n </Button>\n </div>\n </div>\n );\n },\n);\n\nPagination.displayName = \"Pagination\";\n","\"use client\";\n\nimport * as ProgressPrimitive from \"@radix-ui/react-progress\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Progress = React.forwardRef<\n React.ComponentRef<typeof ProgressPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>\n>(({ className, value, ...props }, ref) => (\n <ProgressPrimitive.Root\n ref={ref}\n className={cn(\"relative h-4 w-full overflow-hidden rounded-full bg-secondary\", className)}\n {...props}\n >\n <ProgressPrimitive.Indicator\n className=\"h-full w-full flex-1 bg-primary transition-all\"\n style={{ transform: `translateX(-${100 - (value || 0)}%)` }}\n />\n </ProgressPrimitive.Root>\n));\nProgress.displayName = ProgressPrimitive.Root.displayName;\n\nexport { Progress };\n","\"use client\";\n\nimport * as RadioGroupPrimitive from \"@radix-ui/react-radio-group\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst RadioGroup = React.forwardRef<\n React.ComponentRef<typeof RadioGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>\n>(({ className, ...props }, ref) => {\n return <RadioGroupPrimitive.Root className={cn(\"grid gap-2\", className)} {...props} ref={ref} />;\n});\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName;\n\nconst RadioGroupItem = React.forwardRef<\n React.ComponentRef<typeof RadioGroupPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>\n>(({ className, ...props }, ref) => {\n return (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cn(\n \"aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"flex items-center justify-center\">\n <div className=\"h-2 w-2 rounded-full bg-current\" />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n );\n});\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;\n\nexport { RadioGroup, RadioGroupItem };\n","import { Input } from \"./input\";\n\nexport type RangeNumberInputProps = {\n value?: [number | undefined, number | undefined];\n onChange?: (value: [number | undefined, number | undefined]) => void;\n placeholder?: [string, string];\n disabled?: boolean;\n className?: string;\n};\n\n/**\n * Range Number Input 컴포넌트\n *\n * between 연산자에서 사용\n * [min, max] 두 개의 숫자 입력\n */\nexport function RangeNumberInput({\n value = [undefined, undefined],\n onChange,\n placeholder = [\"최소값\", \"최대값\"],\n disabled,\n className,\n}: RangeNumberInputProps) {\n const [min, max] = value;\n\n const handleMinChange = (v: string) => {\n const newMin = v === \"\" ? undefined : Number(v);\n onChange?.([newMin, max]);\n };\n\n const handleMaxChange = (v: string) => {\n const newMax = v === \"\" ? undefined : Number(v);\n onChange?.([min, newMax]);\n };\n\n return (\n <div className={`flex items-center gap-2 ${className}`}>\n <Input\n type=\"number\"\n value={min === undefined ? \"\" : String(min)}\n onValueChange={handleMinChange}\n placeholder={placeholder[0]}\n disabled={disabled}\n className=\"flex-1\"\n />\n <span className=\"text-muted-foreground\">~</span>\n <Input\n type=\"number\"\n value={max === undefined ? \"\" : String(max)}\n onValueChange={handleMaxChange}\n placeholder={placeholder[1]}\n disabled={disabled}\n className=\"flex-1\"\n />\n </div>\n );\n}\n","\"use client\";\n\nimport * as ResizablePrimitive from \"react-resizable-panels\";\nimport GripVerticalIcon from \"~icons/lucide/grip-vertical\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst ResizablePanelGroup = ({\n className,\n ...props\n}: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => (\n <ResizablePrimitive.PanelGroup\n className={cn(\"flex h-full w-full data-[panel-group-direction=vertical]:flex-col\", className)}\n {...props}\n />\n);\n\nconst ResizablePanel = ResizablePrimitive.Panel;\n\nconst ResizableHandle = ({\n withHandle,\n className,\n ...props\n}: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {\n withHandle?: boolean;\n}) => (\n <ResizablePrimitive.PanelResizeHandle\n className={cn(\n \"relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90\",\n className,\n )}\n {...props}\n >\n {withHandle && (\n <div className=\"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border\">\n <GripVerticalIcon className=\"h-2.5 w-2.5\" />\n </div>\n )}\n </ResizablePrimitive.PanelResizeHandle>\n);\n\nexport { ResizablePanelGroup, ResizablePanel, ResizableHandle };\n","\"use client\";\n\nimport * as ScrollAreaPrimitive from \"@radix-ui/react-scroll-area\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst ScrollArea = React.forwardRef<\n React.ComponentRef<typeof ScrollAreaPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>\n>(({ className, children, ...props }, ref) => (\n <ScrollAreaPrimitive.Root\n ref={ref}\n className={cn(\"relative overflow-hidden\", className)}\n {...props}\n >\n <ScrollAreaPrimitive.Viewport className=\"h-full w-full rounded-[inherit]\">\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n));\nScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;\n\nconst ScrollBar = React.forwardRef<\n React.ComponentRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>\n>(({ className, orientation = \"vertical\", ...props }, ref) => (\n <ScrollAreaPrimitive.ScrollAreaScrollbar\n ref={ref}\n orientation={orientation}\n className={cn(\n \"flex touch-none select-none transition-colors\",\n orientation === \"vertical\" && \"h-full w-2.5 border-l border-l-transparent p-px\",\n orientation === \"horizontal\" && \"h-2.5 flex-col border-t border-t-transparent p-px\",\n className,\n )}\n {...props}\n >\n <ScrollAreaPrimitive.ScrollAreaThumb className=\"relative flex-1 rounded-full bg-border\" />\n </ScrollAreaPrimitive.ScrollAreaScrollbar>\n));\nScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;\n\nexport { ScrollArea, ScrollBar };\n","import * as React from \"react\";\n\nimport { Select } from \"./select\";\n\n// ============================================================================\n// Type Definition\n// ============================================================================\n\n// EnumSelect Props\nexport type EnumSelectProps<TValue extends string = string> = {\n enum: { options: readonly TValue[] };\n labels: Record<TValue, string>;\n value?: TValue | TValue[] | \"\";\n onValueChange?: (value: TValue | TValue[] | \"\" | null | undefined) => void;\n placeholder?: string;\n textPrefix?: string;\n clearable?: boolean;\n disabled?: boolean;\n className?: string;\n multiple?: boolean;\n};\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport function EnumSelect<TValue extends string = string>({\n enum: zodEnum,\n labels,\n value,\n onValueChange,\n placeholder,\n textPrefix = \"\",\n clearable = false,\n disabled = false,\n className,\n multiple = false,\n}: EnumSelectProps<TValue>) {\n // Zod enum에서 options 추출 (빈 문자열 필터링 - Radix UI 제약)\n const validOptions = React.useMemo(() => {\n return zodEnum.options.filter((key: unknown) => (key as string) !== \"\");\n }, [zodEnum]);\n\n // items 구성\n const items = React.useMemo(() => {\n return validOptions.map((key) => ({\n value: key as string,\n label: textPrefix + labels[key],\n }));\n }, [validOptions, labels, textPrefix]);\n\n // Single 모드\n if (!multiple) {\n return (\n <Select\n items={items}\n value={(value as TValue | \"\" | undefined) ?? \"\"}\n onValueChange={(newValue: string | undefined) => {\n onValueChange?.(newValue as TValue | \"\" | null | undefined);\n }}\n placeholder={placeholder}\n clearable={clearable}\n disabled={disabled}\n className={className}\n multiple={false}\n async={false}\n />\n );\n }\n\n // Multiple 모드\n return (\n <Select\n items={items}\n value={(value as TValue[]) ?? []}\n onValueChange={(newValue: string[]) => {\n onValueChange?.(newValue as TValue[]);\n }}\n placeholder={placeholder}\n clearable={clearable}\n disabled={disabled}\n className={className}\n multiple={true}\n async={false}\n />\n );\n}\n","/* oxlint-disable @typescript-eslint/no-explicit-any */ // AsyncIdConfig의 useList params는 contravariance 때문에 any 필요 (unknown 사용시 구체적 타입 전달 불가)\n\nimport { type UseQueryResult } from \"@tanstack/react-query\";\nimport { useCallback, useMemo, useState } from \"react\";\n\nimport { useSonamuBaseContext } from \"@/contexts\";\n\nimport { Select } from \"./select\";\n\n// ============================================================================\n// Type Definition\n// ============================================================================\n\n// AsyncIdConfig 타입\n// services.generated.ts에서 생성되는 config와 호환됨\n// _TSubsetMapping은 onRowChange의 타입 추론에 사용됨\n// _TListParams는 baseListParams의 타입 추론에 사용됨\nexport type AsyncIdConfig<\n TSubsetKey extends string = string,\n _TSubsetMapping = Record<string, unknown>,\n _TListParams extends Record<string, unknown> = Record<string, unknown>,\n> = {\n placeholderKey: string;\n useList: <T extends TSubsetKey>(\n subset: T,\n params?: any,\n options?: { enabled?: boolean },\n ) => UseQueryResult<Record<string, unknown>>;\n};\n\n// SubsetMapping에서 선택된 subset의 필드 키를 추출하는 유틸리티 타입\ntype SubsetFieldKeys<\n TSubsetKey extends string,\n TSubsetMapping,\n> = TSubsetKey extends keyof TSubsetMapping\n ? TSubsetMapping[TSubsetKey] extends Record<string, unknown>\n ? string & keyof TSubsetMapping[TSubsetKey]\n : string\n : string;\n\n// SubsetMapping에서 선택된 subset의 row 타입을 추출하는 유틸리티 타입\ntype SubsetRow<TSubsetKey extends string, TSubsetMapping> = TSubsetKey extends keyof TSubsetMapping\n ? TSubsetMapping[TSubsetKey]\n : Record<string, unknown>;\n\n// displayField: 필드명 또는 row 콜백 함수\ntype DisplayFieldAsString<TSubsetKey extends string, TSubsetMapping> = {\n displayField?: SubsetFieldKeys<TSubsetKey, TSubsetMapping>;\n};\ntype DisplayFieldAsCallback<TSubsetKey extends string, TSubsetMapping> = {\n displayField: (row: SubsetRow<TSubsetKey, TSubsetMapping>) => string;\n};\n\n// onRowChange의 row 파라미터 타입\ntype OnRowChangeType<\n TSubsetKey extends string,\n TSubsetMapping,\n> = TSubsetKey extends keyof TSubsetMapping\n ? TSubsetMapping[TSubsetKey] | TSubsetMapping[TSubsetKey][] | undefined\n : unknown;\n\n// IdAsyncSelect 공통 Props (displayField 제외)\ntype IdAsyncSelectBaseProps<\n TSubsetKey extends string = string,\n TSubsetMapping = Record<string, unknown>,\n TValue extends string | number = string,\n TListParams extends Record<string, unknown> = Record<string, unknown>,\n TSubset extends TSubsetKey = TSubsetKey,\n> = {\n // Entity Async ID Config\n config: AsyncIdConfig<TSubsetKey, TSubsetMapping, TListParams>;\n // Entity subset key\n subset: TSubset;\n // 검색/조회 시 적용될 파라미터\n baseListParams?: Partial<Omit<TListParams, \"keyword\" | \"page\">>;\n // 실제 저장/전송될 값의 필드명 (기본값: \"id\")\n valueField?: SubsetFieldKeys<TSubset, TSubsetMapping>;\n // 기본 Select Props\n placeholder?: string;\n clearable?: boolean;\n disabled?: boolean;\n className?: string;\n /** true이면 키워드 없이도 마운트 시 전체 목록을 즉시 로드 (소규모 데이터셋에 적합) */\n preload?: boolean;\n /** true이면 드롭다운 내 클라이언트 사이드 검색 필터를 표시 */\n searchable?: boolean;\n // Single/Multi 모드\n multiple?: boolean;\n value?: TValue | TValue[] | null;\n onValueChange?: (value: TValue | TValue[] | undefined) => void;\n onRowChange?: (row: OnRowChangeType<TSubset, TSubsetMapping>) => void;\n};\n\n// IdAsyncSelect Total Props\nexport type IdAsyncSelectProps<\n TSubsetKey extends string = string,\n TSubsetMapping = Record<string, unknown>,\n TValue extends string | number = string,\n TListParams extends Record<string, unknown> = Record<string, unknown>,\n TSubset extends TSubsetKey = TSubsetKey,\n> = IdAsyncSelectBaseProps<TSubsetKey, TSubsetMapping, TValue, TListParams, TSubset> &\n (DisplayFieldAsString<TSubset, TSubsetMapping> | DisplayFieldAsCallback<TSubset, TSubsetMapping>);\n\n// ============================================================================\n// Component\n// ============================================================================\n\n// name-like 컨럼을 찾기 위한 후보 필드명 (우선순위 순)\nconst NAME_LIKE_FIELDS = [\"name\", \"title\", \"label\", \"display_name\", \"username\"];\n\n/**\n * row 데이터에서 name-like 필드를 자동 탐지\n */\nfunction detectDisplayField(row: Record<string, unknown>): string {\n // 1) name-like 필드 찾기\n for (const field of NAME_LIKE_FIELDS) {\n if (Object.keys(row).includes(field)) {\n return field;\n }\n }\n // 2) string 타입인 첫 번째 컨럼 (id 제외)\n for (const [key, val] of Object.entries(row)) {\n if (key !== \"id\" && typeof val === \"string\") {\n return key;\n }\n }\n // 3) fallback\n return \"id\";\n}\n\nexport function IdAsyncSelect<\n TSubsetKey extends string = string,\n TSubsetMapping = Record<string, unknown>,\n TValue extends string | number = string,\n TListParams extends Record<string, unknown> = Record<string, unknown>,\n TSubset extends TSubsetKey = TSubsetKey,\n>({\n config,\n subset,\n baseListParams,\n displayField,\n valueField = \"id\" as SubsetFieldKeys<TSubset, TSubsetMapping>,\n placeholder,\n clearable,\n disabled,\n className,\n multiple = false,\n preload = false,\n searchable,\n value,\n onValueChange,\n onRowChange,\n}: IdAsyncSelectProps<TSubsetKey, TSubsetMapping, TValue, TListParams, TSubset>) {\n const { SD } = useSonamuBaseContext();\n\n // onRowChange의 파라미터 타입\n type RowChangeParam = Parameters<NonNullable<typeof onRowChange>>[0];\n\n // ============================================================\n // displayField 해석: 콜백 / 필드명 / 자동탐지 분리\n // ============================================================\n const isDisplayFieldCallback = typeof displayField === \"function\";\n\n // row에서 label을 추출하는 함수\n const getLabel = useCallback(\n (row: Record<string, unknown>): string => {\n if (isDisplayFieldCallback) {\n return (displayField as (row: any) => string)(row);\n }\n const field = typeof displayField === \"string\" ? displayField : detectDisplayField(row);\n return String(row[field] ?? \"\");\n },\n [displayField, isDisplayFieldCallback],\n );\n\n // ============================================================\n // keyword 상태 관리 (사용자 입력 검색어만 관리)\n // baseListParams는 외부에서 주입되므로 별도 state 불필요\n // ============================================================\n const [keyword, setKeyword] = useState<string | undefined>(undefined);\n\n // ============================================================\n // handleSearch 로직\n // ============================================================\n const handleSearch = useCallback((kw: string) => {\n setKeyword(kw || undefined);\n }, []);\n\n // ============================================================\n // 리스트 로드\n // ============================================================\n const isNotEmpty = (val: unknown): boolean => {\n if (val == null || val === \"\") return false;\n if (typeof val === \"number\") return val !== 0 && !Number.isNaN(val);\n return true;\n };\n\n // baseListParams에 search/orderBy/queryMode 외의 의미 있는 필터값이 있는지 확인\n const IGNORED_FILTER_KEYS = new Set([\"search\", \"orderBy\", \"queryMode\", \"num\", \"page\", \"keyword\"]);\n const hasBaseFilter =\n baseListParams != null &&\n Object.entries(baseListParams).some(([k, v]) => !IGNORED_FILTER_KEYS.has(k) && isNotEmpty(v));\n\n // preload 또는 baseFilter가 있으면 sync 드롭다운으로 렌더링\n const isDropdown = preload || hasBaseFilter;\n\n // 실제 쿼리 파라미터: baseListParams(외부 필터) + keyword(사용자 검색어) 병합\n const queryParams = {\n ...baseListParams,\n ...(keyword ? { keyword } : {}),\n };\n\n const shouldLoadList =\n isDropdown ||\n (typeof keyword === \"string\" && keyword.length > 0) ||\n (multiple && Array.isArray(value) && value.length > 0);\n\n const {\n data,\n isLoading: listLoading,\n error,\n } = config.useList(subset, queryParams, {\n enabled: shouldLoadList,\n });\n\n const rows = (data?.rows ?? []) as Record<string, unknown>[];\n\n // ============================================================\n // Single 모드: 선택된 값 로드\n // ============================================================\n const singleValue = !multiple && isNotEmpty(value) ? (value as TValue) : null;\n\n // 먼저 현재 rows에서 찾기\n const selectedInRows = useMemo(\n () => rows.find((row) => row[valueField] === singleValue),\n [rows, singleValue, valueField],\n );\n\n // rows에 없으면 id로 조회 (검색 중에도 selectedRow 유지 위해)\n const shouldLoadById = singleValue != null && !selectedInRows;\n const selectedQuery = config.useList(\n subset,\n { id: singleValue, num: 1, page: 1 },\n { enabled: shouldLoadById },\n );\n\n // selectedQuery로 로드한 데이터가 있으면 우선 사용, 없으면 현재 rows에서 찾기\n const selectedRow =\n (selectedQuery.data?.rows as Record<string, unknown>[] | undefined)?.[0] || selectedInRows;\n\n // ============================================================\n // Multi 모드: 선택된 값들 로드\n // ============================================================\n const multiValues = multiple && Array.isArray(value) ? value : [];\n\n // 먼저 현재 rows에서 찾기\n const selectedMultiInRows = useMemo(\n () => multiValues.map((val) => rows.find((row) => row[valueField] === val)).filter(Boolean),\n [rows, multiValues, valueField],\n );\n\n // rows에 없는 항목들을 id로 조회\n const selectedMultiIds = useMemo(() => {\n const foundIds = new Set(selectedMultiInRows.map((row) => row?.[valueField]));\n return multiValues.filter((val) => !foundIds.has(val));\n }, [multiValues, selectedMultiInRows, valueField]);\n\n const shouldLoadByIds = selectedMultiIds.length > 0;\n const multiSelectedQuery = config.useList(\n subset,\n { id: selectedMultiIds, num: selectedMultiIds.length, page: 1 },\n { enabled: shouldLoadByIds },\n );\n\n // 최종 선택된 rows (rows에서 찾은 것 + query로 로드한 것)\n const multiSelectedRows = useMemo(() => {\n const queryRows = (multiSelectedQuery.data?.rows ?? []) as Record<string, unknown>[];\n return [...selectedMultiInRows, ...queryRows] as Record<string, unknown>[];\n }, [selectedMultiInRows, multiSelectedQuery.data]);\n\n const isLoading =\n listLoading ||\n (shouldLoadById && selectedQuery.isLoading) ||\n (shouldLoadByIds && multiSelectedQuery.isLoading);\n\n // ============================================================\n // itemMap + rowMap\n // ============================================================\n const { items, rowMap } = useMemo(() => {\n const rowMap = new Map<TValue, Record<string, unknown>>();\n const itemMap = new Map<TValue, { value: TValue; label: string }>();\n\n // Single 모드: 선택된 항목 추가\n if (!multiple && selectedRow && singleValue != null) {\n rowMap.set(singleValue, selectedRow);\n itemMap.set(singleValue, {\n value: singleValue,\n label: getLabel(selectedRow),\n });\n }\n\n // Multi 모드: 선택된 항목들 추가\n if (multiple && multiSelectedRows.length > 0) {\n for (const row of multiSelectedRows) {\n const val = row[valueField] as TValue;\n rowMap.set(val, row);\n itemMap.set(val, {\n value: val,\n label: getLabel(row),\n });\n }\n }\n\n // 검색 결과 추가\n for (const row of rows) {\n const val = row[valueField] as TValue;\n rowMap.set(val, row);\n itemMap.set(val, {\n value: val,\n label: getLabel(row),\n });\n }\n\n return {\n items: Array.from(itemMap.values()),\n rowMap,\n };\n }, [rows, selectedRow, singleValue, multiSelectedRows, multiple, getLabel, valueField]);\n\n // ============================================================\n // Select 렌더링\n // ============================================================\n const valueKey = (v: TValue) => String(v);\n\n // isDropdown 모드: sync 드롭다운 (검색창 없이 목록 즉시 표시)\n // searchable이면 async 경로로 빠져서 초기 데이터 + 서버 검색 하이브리드 동작\n if (isDropdown && !searchable) {\n if (!multiple) {\n return (\n <Select\n items={items}\n valueKey={valueKey}\n value={singleValue ?? undefined}\n onValueChange={(newValue: TValue | undefined) => {\n onValueChange?.(newValue);\n onRowChange?.((newValue ? rowMap.get(newValue) : undefined) as RowChangeParam);\n }}\n placeholder={placeholder ?? SD(config.placeholderKey)}\n clearable={clearable}\n disabled={disabled}\n className={className}\n multiple={false}\n />\n );\n }\n\n return (\n <Select\n items={items}\n valueKey={valueKey}\n value={(value as TValue[]) ?? []}\n onValueChange={(newValue: TValue[]) => {\n onValueChange?.(newValue);\n onRowChange?.(newValue.map((val) => rowMap.get(val)).filter(Boolean) as RowChangeParam);\n }}\n placeholder={placeholder ?? SD(config.placeholderKey)}\n clearable={clearable}\n disabled={disabled}\n className={className}\n multiple={true}\n />\n );\n }\n\n if (!multiple) {\n return (\n <Select\n items={items}\n value={singleValue ?? undefined}\n onValueChange={(newValue: TValue | undefined) => {\n onValueChange?.(newValue);\n onRowChange?.((newValue ? rowMap.get(newValue) : undefined) as RowChangeParam);\n }}\n placeholder={placeholder ?? SD(config.placeholderKey)}\n clearable={clearable}\n disabled={disabled}\n className={className}\n multiple={false}\n async={true}\n loading={isLoading}\n error={error ?? undefined}\n onSearch={handleSearch}\n />\n );\n }\n\n return (\n <Select\n items={items}\n value={(value as TValue[]) ?? []}\n onValueChange={(newValue: TValue[]) => {\n onValueChange?.(newValue);\n onRowChange?.(newValue.map((val) => rowMap.get(val)).filter(Boolean) as RowChangeParam);\n }}\n placeholder={placeholder ?? SD(config.placeholderKey)}\n clearable={clearable}\n disabled={disabled}\n className={className}\n multiple={true}\n async={true}\n loading={isLoading}\n error={error ?? undefined}\n onSearch={handleSearch}\n />\n );\n}\n","import * as SheetPrimitive from \"@radix-ui/react-dialog\";\nimport { cva } from \"class-variance-authority\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\nimport XIcon from \"~icons/lucide/x\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Sheet = SheetPrimitive.Root;\n\nconst SheetTrigger = SheetPrimitive.Trigger;\n\nconst SheetClose = SheetPrimitive.Close;\n\nconst SheetPortal = SheetPrimitive.Portal;\n\nconst SheetOverlay = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Overlay\n className={cn(\n \"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className,\n )}\n {...props}\n ref={ref}\n />\n));\nSheetOverlay.displayName = SheetPrimitive.Overlay.displayName;\n\nconst sheetVariantsConfig = {\n side: {\n top: \"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top\",\n bottom:\n \"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom\",\n left: \"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm\",\n right:\n \"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm\",\n },\n} as const;\n\nconst sheetVariants = cva(\n \"fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500\",\n {\n variants: sheetVariantsConfig,\n defaultVariants: {\n side: \"right\",\n },\n },\n);\n\ninterface SheetContentProps\n extends\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,\n VariantProps<typeof sheetVariants> {}\n\nconst SheetContent = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Content>,\n SheetContentProps\n>(({ side = \"right\", className, children, ...props }, ref) => (\n <SheetPortal>\n <SheetOverlay />\n <SheetPrimitive.Content ref={ref} className={cn(sheetVariants({ side }), className)} {...props}>\n {children}\n <SheetPrimitive.Close className=\"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary\">\n <XIcon className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n </SheetPrimitive.Content>\n </SheetPortal>\n));\nSheetContent.displayName = SheetPrimitive.Content.displayName;\n\nconst SheetHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn(\"flex flex-col space-y-2 text-center sm:text-left\", className)} {...props} />\n);\nSheetHeader.displayName = \"SheetHeader\";\n\nconst SheetFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\", className)}\n {...props}\n />\n);\nSheetFooter.displayName = \"SheetFooter\";\n\nconst SheetTitle = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold text-foreground\", className)}\n {...props}\n />\n));\nSheetTitle.displayName = SheetPrimitive.Title.displayName;\n\nconst SheetDescription = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nSheetDescription.displayName = SheetPrimitive.Description.displayName;\n\nexport {\n Sheet,\n SheetPortal,\n SheetOverlay,\n SheetTrigger,\n SheetClose,\n SheetContent,\n sheetVariantsConfig,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n};\n","import * as React from \"react\";\n\nconst MOBILE_BREAKPOINT = 768;\n\nexport function useIsMobile() {\n const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined);\n\n React.useEffect(() => {\n const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);\n const onChange = () => {\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n };\n mql.addEventListener(\"change\", onChange);\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n return () => mql.removeEventListener(\"change\", onChange);\n }, []);\n\n return !!isMobile;\n}\n","import { cn } from \"../../lib/utils\";\n\nfunction Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n return <div className={cn(\"animate-pulse rounded-md bg-muted\", className)} {...props} />;\n}\n\nexport { Skeleton };\n","import * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst TooltipProvider = TooltipPrimitive.Provider;\n\nconst Tooltip = TooltipPrimitive.Root;\n\nconst TooltipTrigger = TooltipPrimitive.Trigger;\n\nconst TooltipContent = React.forwardRef<\n React.ComponentRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]\",\n className,\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\n","\"use client\";\n\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva } from \"class-variance-authority\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\nimport PanelLeftIcon from \"~icons/lucide/panel-left\";\n\nimport { useIsMobile } from \"../../lib/use-mobile\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"./button\";\nimport { Input } from \"./input\";\nimport { Separator } from \"./separator\";\nimport { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from \"./sheet\";\nimport { Skeleton } from \"./skeleton\";\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from \"./tooltip\";\n\nconst SIDEBAR_WIDTH = \"16rem\";\nconst SIDEBAR_WIDTH_MOBILE = \"18rem\";\nconst SIDEBAR_WIDTH_ICON = \"3rem\";\nconst SIDEBAR_KEYBOARD_SHORTCUT = \"b\";\n\ntype SidebarContextProps = {\n state: \"expanded\" | \"collapsed\";\n open: boolean;\n setOpen: (open: boolean) => void;\n openMobile: boolean;\n setOpenMobile: (open: boolean) => void;\n isMobile: boolean;\n toggleSidebar: () => void;\n};\n\nconst SidebarContext = React.createContext<SidebarContextProps | null>(null);\n\nfunction useSidebar() {\n const context = React.useContext(SidebarContext);\n if (!context) {\n throw new Error(\"useSidebar must be used within a SidebarProvider.\");\n }\n\n return context;\n}\n\nfunction SidebarProvider({\n defaultOpen = true,\n open: openProp,\n onOpenChange: setOpenProp,\n className,\n style,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & {\n defaultOpen?: boolean;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n}) {\n const isMobile = useIsMobile();\n const [openMobile, setOpenMobile] = React.useState(false);\n\n // This is the internal state of the sidebar.\n // We use openProp and setOpenProp for control from outside the component.\n const [_open, _setOpen] = React.useState(defaultOpen);\n const open = openProp ?? _open;\n const setOpen = React.useCallback(\n (value: boolean | ((value: boolean) => boolean)) => {\n const openState = typeof value === \"function\" ? value(open) : value;\n if (setOpenProp) {\n setOpenProp(openState);\n } else {\n _setOpen(openState);\n }\n },\n [setOpenProp, open],\n );\n\n // Helper to toggle the sidebar.\n const toggleSidebar = React.useCallback(() => {\n return isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open);\n }, [isMobile, setOpen, setOpenMobile]);\n\n // Adds a keyboard shortcut to toggle the sidebar.\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {\n event.preventDefault();\n toggleSidebar();\n }\n };\n\n window.addEventListener(\"keydown\", handleKeyDown);\n return () => window.removeEventListener(\"keydown\", handleKeyDown);\n }, [toggleSidebar]);\n\n // We add a state so that we can do data-state=\"expanded\" or \"collapsed\".\n // This makes it easier to style the sidebar with Tailwind classes.\n const state = open ? \"expanded\" : \"collapsed\";\n\n const contextValue = React.useMemo<SidebarContextProps>(\n () => ({\n state,\n open,\n setOpen,\n isMobile,\n openMobile,\n setOpenMobile,\n toggleSidebar,\n }),\n [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar],\n );\n\n return (\n <SidebarContext.Provider value={contextValue}>\n <TooltipProvider delayDuration={0}>\n <div\n data-slot=\"sidebar-wrapper\"\n style={\n {\n \"--sidebar-width\": SIDEBAR_WIDTH,\n \"--sidebar-width-icon\": SIDEBAR_WIDTH_ICON,\n ...style,\n } as React.CSSProperties\n }\n className={cn(\n \"group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full\",\n className,\n )}\n {...props}\n >\n {children}\n </div>\n </TooltipProvider>\n </SidebarContext.Provider>\n );\n}\n\nfunction Sidebar({\n side = \"left\",\n variant = \"sidebar\",\n collapsible = \"offcanvas\",\n className,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & {\n side?: \"left\" | \"right\";\n variant?: \"sidebar\" | \"floating\" | \"inset\";\n collapsible?: \"offcanvas\" | \"icon\" | \"none\";\n}) {\n const { isMobile, state, openMobile, setOpenMobile } = useSidebar();\n\n if (collapsible === \"none\") {\n return (\n <div\n data-slot=\"sidebar\"\n className={cn(\n \"bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col\",\n className,\n )}\n {...props}\n >\n {children}\n </div>\n );\n }\n\n if (isMobile) {\n return (\n <Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>\n <SheetContent\n data-sidebar=\"sidebar\"\n data-slot=\"sidebar\"\n data-mobile=\"true\"\n className=\"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden\"\n style={\n {\n \"--sidebar-width\": SIDEBAR_WIDTH_MOBILE,\n } as React.CSSProperties\n }\n side={side}\n >\n <SheetHeader className=\"sr-only\">\n <SheetTitle>Sidebar</SheetTitle>\n <SheetDescription>Displays the mobile sidebar.</SheetDescription>\n </SheetHeader>\n <div className=\"flex h-full w-full flex-col\">{children}</div>\n </SheetContent>\n </Sheet>\n );\n }\n\n return (\n <div\n className=\"group peer text-sidebar-foreground hidden md:block\"\n data-state={state}\n data-collapsible={state === \"collapsed\" ? collapsible : \"\"}\n data-variant={variant}\n data-side={side}\n data-slot=\"sidebar\"\n >\n {/* This is what handles the sidebar gap on desktop */}\n <div\n data-slot=\"sidebar-gap\"\n className={cn(\n \"relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear\",\n \"group-data-[collapsible=offcanvas]:w-0\",\n \"group-data-[side=right]:rotate-180\",\n variant === \"floating\" || variant === \"inset\"\n ? \"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+1rem)]\"\n : \"group-data-[collapsible=icon]:w-(--sidebar-width-icon)\",\n )}\n />\n <div\n data-slot=\"sidebar-container\"\n className={cn(\n \"fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex\",\n side === \"left\"\n ? \"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]\"\n : \"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]\",\n // Adjust the padding for floating and inset variants.\n variant === \"floating\" || variant === \"inset\"\n ? \"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+1rem+2px)]\"\n : \"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l\",\n className,\n )}\n {...props}\n >\n <div\n data-sidebar=\"sidebar\"\n data-slot=\"sidebar-inner\"\n className=\"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm\"\n >\n {children}\n </div>\n </div>\n </div>\n );\n}\n\nfunction SidebarTrigger({ className, onClick, ...props }: React.ComponentProps<typeof Button>) {\n const { toggleSidebar } = useSidebar();\n\n return (\n <Button\n data-sidebar=\"trigger\"\n data-slot=\"sidebar-trigger\"\n variant=\"ghost\"\n className={cn(\"size-7\", className)}\n onClick={(event) => {\n onClick?.(event);\n toggleSidebar();\n }}\n {...props}\n >\n <PanelLeftIcon />\n <span className=\"sr-only\">Toggle Sidebar</span>\n </Button>\n );\n}\n\nfunction SidebarRail({ className, ...props }: React.ComponentProps<\"button\">) {\n const { toggleSidebar } = useSidebar();\n\n return (\n <button\n data-sidebar=\"rail\"\n data-slot=\"sidebar-rail\"\n aria-label=\"Toggle Sidebar\"\n tabIndex={-1}\n onClick={toggleSidebar}\n title=\"Toggle Sidebar\"\n className={cn(\n \"hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex\",\n \"in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize\",\n \"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize\",\n \"hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full\",\n \"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2\",\n \"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarInset({ className, ...props }: React.ComponentProps<\"main\">) {\n return (\n <main\n data-slot=\"sidebar-inset\"\n className={cn(\n \"bg-background relative flex w-full flex-1 flex-col\",\n \"md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarInput({ className, ...props }: React.ComponentProps<typeof Input>) {\n return (\n <Input\n data-slot=\"sidebar-input\"\n data-sidebar=\"input\"\n className={cn(\"bg-background h-8 w-full shadow-none\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-header\"\n data-sidebar=\"header\"\n className={cn(\"flex shrink-0 flex-col gap-2 p-2\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-footer\"\n data-sidebar=\"footer\"\n className={cn(\"flex shrink-0 flex-col gap-2 p-2\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarSeparator({ className, ...props }: React.ComponentProps<typeof Separator>) {\n return (\n <Separator\n data-slot=\"sidebar-separator\"\n data-sidebar=\"separator\"\n className={cn(\"bg-sidebar-border mx-2 w-auto\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-content\"\n data-sidebar=\"content\"\n className={cn(\n \"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-group\"\n data-sidebar=\"group\"\n className={cn(\"relative flex w-full min-w-0 flex-col p-2\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarGroupLabel({\n className,\n asChild = false,\n ...props\n}: React.ComponentProps<\"div\"> & { asChild?: boolean }) {\n const Comp = asChild ? Slot : \"div\";\n\n return (\n <Comp\n data-slot=\"sidebar-group-label\"\n data-sidebar=\"group-label\"\n className={cn(\n \"text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-none transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n \"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarGroupAction({\n className,\n asChild = false,\n ...props\n}: React.ComponentProps<\"button\"> & { asChild?: boolean }) {\n const Comp = asChild ? Slot : \"button\";\n\n return (\n <Comp\n data-slot=\"sidebar-group-action\"\n data-sidebar=\"group-action\"\n className={cn(\n \"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-none transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n // Increases the hit area of the button on mobile.\n \"after:absolute after:-inset-2 md:after:hidden\",\n \"group-data-[collapsible=icon]:hidden\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarGroupContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-group-content\"\n data-sidebar=\"group-content\"\n className={cn(\"w-full text-sm\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarMenu({ className, ...props }: React.ComponentProps<\"ul\">) {\n return (\n <ul\n data-slot=\"sidebar-menu\"\n data-sidebar=\"menu\"\n className={cn(\"flex w-full min-w-0 flex-col gap-1\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuItem({ className, ...props }: React.ComponentProps<\"li\">) {\n return (\n <li\n data-slot=\"sidebar-menu-item\"\n data-sidebar=\"menu-item\"\n className={cn(\"group/menu-item relative\", className)}\n {...props}\n />\n );\n}\n\nconst sidebarMenuButtonVariants = cva(\n \"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground\",\n outline:\n \"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]\",\n },\n size: {\n default: \"h-8 text-sm\",\n sm: \"h-7 text-xs\",\n lg: \"h-12 text-sm group-data-[collapsible=icon]:!p-0\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nfunction SidebarMenuButton({\n asChild = false,\n isActive = false,\n variant = \"default\",\n size = \"default\",\n tooltip,\n className,\n ...props\n}: React.ComponentProps<\"button\"> & {\n asChild?: boolean;\n isActive?: boolean;\n tooltip?: string | React.ComponentProps<typeof TooltipContent>;\n} & VariantProps<typeof sidebarMenuButtonVariants>) {\n const Comp = asChild ? Slot : \"button\";\n const { isMobile, state } = useSidebar();\n\n const button = (\n <Comp\n data-slot=\"sidebar-menu-button\"\n data-sidebar=\"menu-button\"\n data-size={size}\n data-active={isActive}\n className={cn(sidebarMenuButtonVariants({ variant, size }), className)}\n {...props}\n />\n );\n\n if (!tooltip) {\n return button;\n }\n\n if (typeof tooltip === \"string\") {\n tooltip = {\n children: tooltip,\n };\n }\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>{button}</TooltipTrigger>\n <TooltipContent\n side=\"right\"\n align=\"center\"\n hidden={state !== \"collapsed\" || isMobile}\n {...tooltip}\n />\n </Tooltip>\n );\n}\n\nfunction SidebarMenuAction({\n className,\n asChild = false,\n showOnHover = false,\n ...props\n}: React.ComponentProps<\"button\"> & {\n asChild?: boolean;\n showOnHover?: boolean;\n}) {\n const Comp = asChild ? Slot : \"button\";\n\n return (\n <Comp\n data-slot=\"sidebar-menu-action\"\n data-sidebar=\"menu-action\"\n className={cn(\n \"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-none transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n // Increases the hit area of the button on mobile.\n \"after:absolute after:-inset-2 md:after:hidden\",\n \"peer-data-[size=sm]/menu-button:top-1\",\n \"peer-data-[size=default]/menu-button:top-1.5\",\n \"peer-data-[size=lg]/menu-button:top-2.5\",\n \"group-data-[collapsible=icon]:hidden\",\n showOnHover &&\n \"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuBadge({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-menu-badge\"\n data-sidebar=\"menu-badge\"\n className={cn(\n \"text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none\",\n \"peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground\",\n \"peer-data-[size=sm]/menu-button:top-1\",\n \"peer-data-[size=default]/menu-button:top-1.5\",\n \"peer-data-[size=lg]/menu-button:top-2.5\",\n \"group-data-[collapsible=icon]:hidden\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuSkeleton({\n className,\n showIcon = false,\n ...props\n}: React.ComponentProps<\"div\"> & {\n showIcon?: boolean;\n}) {\n // Random width between 50 to 90%.\n const width = React.useMemo(() => {\n return `${Math.floor(Math.random() * 40) + 50}%`;\n }, []);\n\n return (\n <div\n data-slot=\"sidebar-menu-skeleton\"\n data-sidebar=\"menu-skeleton\"\n className={cn(\"flex h-8 items-center gap-2 rounded-md px-2\", className)}\n {...props}\n >\n {showIcon && <Skeleton className=\"size-4 rounded-md\" data-sidebar=\"menu-skeleton-icon\" />}\n <Skeleton\n className=\"h-4 max-w-(--skeleton-width) flex-1\"\n data-sidebar=\"menu-skeleton-text\"\n style={\n {\n \"--skeleton-width\": width,\n } as React.CSSProperties\n }\n />\n </div>\n );\n}\n\nfunction SidebarMenuSub({ className, ...props }: React.ComponentProps<\"ul\">) {\n return (\n <ul\n data-slot=\"sidebar-menu-sub\"\n data-sidebar=\"menu-sub\"\n className={cn(\n \"border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5\",\n \"group-data-[collapsible=icon]:hidden\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuSubItem({ className, ...props }: React.ComponentProps<\"li\">) {\n return (\n <li\n data-slot=\"sidebar-menu-sub-item\"\n data-sidebar=\"menu-sub-item\"\n className={cn(\"group/menu-sub-item relative\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuSubButton({\n asChild = false,\n size = \"md\",\n isActive = false,\n className,\n ...props\n}: React.ComponentProps<\"a\"> & {\n asChild?: boolean;\n size?: \"sm\" | \"md\";\n isActive?: boolean;\n}) {\n const Comp = asChild ? Slot : \"a\";\n\n return (\n <Comp\n data-slot=\"sidebar-menu-sub-button\"\n data-sidebar=\"menu-sub-button\"\n data-size={size}\n data-active={isActive}\n className={cn(\n \"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0\",\n \"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground\",\n size === \"sm\" && \"text-xs\",\n size === \"md\" && \"text-sm\",\n \"group-data-[collapsible=icon]:hidden\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupAction,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarInput,\n SidebarInset,\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSkeleton,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n SidebarProvider,\n SidebarRail,\n SidebarSeparator,\n SidebarTrigger,\n useSidebar,\n};\n","import * as SliderPrimitive from \"@radix-ui/react-slider\";\nimport * as React from \"react\";\n\nimport { type Override } from \"../../lib/types\";\nimport { cn, normalizeToArray } from \"../../lib/utils\";\n\ntype SliderProps = Override<\n React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>,\n {\n name?: string;\n onValueChange?: (value: number) => void;\n onBlur?: React.FocusEventHandler<HTMLInputElement>;\n }\n>;\n\nconst Slider = React.forwardRef<HTMLInputElement, SliderProps>(\n ({ className, name, value, defaultValue, onValueChange, onBlur, ...props }, ref) => {\n const inputRef = React.useRef<HTMLInputElement>(null);\n\n // oxlint-disable-next-line @typescript-eslint/no-non-null-assertion -- useImperativeHandle은 ref가 할당된 후 실행되므로 안전함\n React.useImperativeHandle(ref, () => inputRef.current!);\n\n const handleValueChange = (values: number[]) => {\n onValueChange?.(values[0]);\n };\n\n // value를 배열로 변환 (Radix UI Slider는 배열을 요구함)\n const valueAsArray = normalizeToArray(value);\n const defaultValueAsArray = normalizeToArray(defaultValue);\n\n return (\n <>\n <input\n type=\"range\"\n ref={inputRef}\n name={name}\n defaultValue={defaultValueAsArray?.[0]}\n onBlur={onBlur}\n className=\"sr-only\"\n tabIndex={-1}\n aria-hidden=\"true\"\n />\n <SliderPrimitive.Root\n value={valueAsArray}\n defaultValue={defaultValueAsArray}\n onValueChange={handleValueChange}\n className={cn(\"relative flex w-full touch-none select-none items-center\", className)}\n {...props}\n >\n <SliderPrimitive.Track className=\"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary\">\n <SliderPrimitive.Range className=\"absolute h-full bg-primary\" />\n </SliderPrimitive.Track>\n <SliderPrimitive.Thumb className=\"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\" />\n </SliderPrimitive.Root>\n </>\n );\n },\n);\n\nSlider.displayName = \"Slider\";\n\nexport { Slider };\n","import { type ReactElement } from \"react\";\n\nexport type PaginationProps = {\n activePage?: number;\n totalPages?: number;\n};\n\nexport type TableColumnWidth = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16;\n\nexport type ErrorObj = {\n content: string;\n pointing?: \"above\" | \"below\" | \"left\" | \"right\";\n};\n\nexport type ControlledModalProps = {\n open: boolean;\n close: () => void;\n};\n\nexport type SonamuCol<T> = {\n label: string;\n th?: ReactElement;\n tc: (row: T, index: number) => ReactElement;\n className?: string;\n collapsing?: boolean;\n width?: TableColumnWidth;\n hidden?: boolean;\n parentLabel?: string;\n};\n\n// Union 타입을 분배하여 각각에 Omit을 적용하는 유틸리티 타입\nexport type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;\n\nexport type Override<T, U> = Omit<T, keyof U> & U;\n\n/**\n * Sonamu Filter 관련 타입 정의\n */\n\n// Prop 타입별 허용 연산자\nexport const operatorsByPropType = {\n string: [\"eq\", \"ne\", \"contains\", \"startsWith\", \"endsWith\", \"in\", \"notIn\", \"isNull\", \"isNotNull\"],\n integer: [\"eq\", \"ne\", \"gt\", \"gte\", \"lt\", \"lte\", \"in\", \"notIn\", \"between\", \"isNull\", \"isNotNull\"],\n numeric: [\"eq\", \"ne\", \"gt\", \"gte\", \"lt\", \"lte\", \"in\", \"notIn\", \"between\", \"isNull\", \"isNotNull\"],\n boolean: [\"eq\", \"ne\", \"isNull\", \"isNotNull\"],\n date: [\"eq\", \"ne\", \"before\", \"after\", \"between\", \"isNull\", \"isNotNull\"],\n datetime: [\"eq\", \"ne\", \"before\", \"after\", \"between\", \"isNull\", \"isNotNull\"],\n enum: [\"eq\", \"ne\", \"in\", \"notIn\", \"isNull\", \"isNotNull\"],\n json: [\"isNull\", \"isNotNull\"],\n} as const;\n\n// Prop 타입별 기본 연산자\nexport const defaultOperatorByPropType = {\n string: \"contains\",\n integer: \"eq\",\n numeric: \"eq\",\n boolean: \"eq\",\n date: \"eq\",\n datetime: \"eq\",\n enum: \"eq\",\n json: \"isNull\",\n} as const;\n\n// operatorsByPropType에서 파생되는 타입들\nexport type FilterPropType = keyof typeof operatorsByPropType;\nexport type FilterOperator = (typeof operatorsByPropType)[keyof typeof operatorsByPropType][number];\n","import { type FilterOperator, type FilterPropType } from \"../../../lib/types\";\n\n/**\n * Operator UI 라벨\n */\nexport const operatorLabels: Record<FilterOperator, string> = {\n eq: \"=\",\n ne: \"≠\",\n gt: \">\",\n gte: \"≥\",\n lt: \"<\",\n lte: \"≤\",\n contains: \"contains\",\n startsWith: \"starts with\",\n endsWith: \"ends with\",\n in: \"in\",\n notIn: \"not in\",\n between: \"between\",\n before: \"before\",\n after: \"after\",\n isNull: \"null\",\n isNotNull: \"not null\",\n};\n\n/**\n * Zod 타입 이름 정의\n */\nexport const zodTypeToFilterPropTypeMap: Record<string, FilterPropType> = {\n string: \"string\",\n number: \"integer\",\n boolean: \"boolean\",\n date: \"datetime\",\n enum: \"enum\",\n array: \"json\",\n object: \"json\",\n};\n","import { useState } from \"react\";\nimport XIcon from \"~icons/lucide/x\";\n\nimport { Badge } from \"./badge\";\n\nexport type TagInputProps = {\n value?: string[];\n onChange?: (value: string[]) => void;\n type?: \"text\" | \"number\";\n placeholder?: string;\n disabled?: boolean;\n className?: string;\n};\n\n/**\n * Tag Input 컴포넌트\n *\n * 콤마 또는 Enter로 태그 추가\n * X 버튼으로 태그 제거\n */\nexport function TagInput({\n value = [],\n onChange,\n type = \"text\",\n placeholder,\n disabled,\n className,\n}: TagInputProps) {\n const [inputValue, setInputValue] = useState(\"\");\n\n const addTag = (tagValue: string) => {\n const trimmed = tagValue.trim();\n if (!trimmed) return;\n\n // 숫자 타입인 경우 검증\n if (type === \"number\") {\n if (!/^-?\\d+(\\.\\d+)?$/.test(trimmed)) {\n return; // 숫자가 아니면 무시\n }\n }\n\n // 중복 방지\n if (value.includes(trimmed)) {\n setInputValue(\"\");\n return;\n }\n\n onChange?.([...value, trimmed]);\n setInputValue(\"\");\n };\n\n const removeTag = (index: number) => {\n onChange?.(value.filter((_, i) => i !== index));\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === \"Enter\") {\n e.preventDefault();\n addTag(inputValue);\n } else if (e.key === \"Backspace\" && !inputValue && value.length > 0) {\n // Backspace로 마지막 태그 제거\n removeTag(value.length - 1);\n }\n };\n\n const handleBlur = () => {\n // blur 시 입력값이 있으면 태그로 추가\n if (inputValue.trim()) {\n addTag(inputValue);\n }\n };\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n\n // 콤마 입력 시 태그 추가\n if (newValue.includes(\",\")) {\n const parts = newValue.split(\",\");\n parts.slice(0, -1).map((part) => addTag(part));\n setInputValue(parts[parts.length - 1]);\n return;\n }\n\n setInputValue(newValue);\n };\n\n return (\n <div\n className={`flex flex-wrap gap-1 items-center border rounded-md p-2 min-h-[40px] ${\n disabled ? \"bg-gray-100 cursor-not-allowed\" : \"bg-white\"\n } ${className}`}\n >\n {/* Tags */}\n {value.map((tag, index) => (\n <Badge key={index} variant=\"secondary\" className=\"flex items-center gap-1 px-2 py-1\">\n <span>{tag}</span>\n {!disabled && (\n <button\n type=\"button\"\n onClick={() => removeTag(index)}\n className=\"hover:bg-gray-300 rounded-full p-0.5\"\n >\n <XIcon />\n </button>\n )}\n </Badge>\n ))}\n\n {/* Input */}\n {!disabled && (\n <input\n type=\"text\"\n value={inputValue}\n onChange={handleInputChange}\n onKeyDown={handleKeyDown}\n onBlur={handleBlur}\n placeholder={value.length === 0 ? (placeholder ?? \"Enter 또는 콤마로 구분...\") : \"\"}\n className=\"flex-1 min-w-[120px] outline-none bg-transparent text-sm\"\n disabled={disabled}\n />\n )}\n </div>\n );\n}\n","import { useSonamuBaseContext } from \"@/contexts\";\n\nimport { DateInput, DatePicker, Input } from \"../..\";\nimport { RangeNumberInput } from \"../range-number-input\";\nimport { EnumSelect } from \"../select/enum-select\";\nimport { TagInput } from \"../tag-input\";\nimport { type ValueInputProps } from \"./types\";\n\n// Boolean enum 상수\nconst BOOLEAN_ENUM = {\n options: [\"true\", \"false\"] as const,\n labels: { true: \"True\", false: \"False\" },\n};\n\n/**\n * ValueInput 컴포넌트\n * operator와 propType에 따라 적절한 입력 UI 렌더링\n */\nexport function ValueInput({ propType, operator, value, onChange, fieldMeta }: ValueInputProps) {\n const { SD } = useSonamuBaseContext();\n // isNull/isNotNull: Boolean select (true/false)\n if (operator === \"isNull\" || operator === \"isNotNull\") {\n return (\n <EnumSelect\n enum={{ options: BOOLEAN_ENUM.options }}\n labels={BOOLEAN_ENUM.labels}\n value={value === undefined ? \"\" : String(value)}\n onValueChange={(v) => v && onChange(v === \"true\")}\n className=\"w-full\"\n />\n );\n }\n\n // in/notIn: 다중 값 입력\n if (operator === \"in\" || operator === \"notIn\") {\n if (propType === \"enum\" && fieldMeta?.enumData) {\n return (\n <EnumSelect\n enum={{ options: fieldMeta.enumData.options }}\n labels={fieldMeta.enumData.labels}\n value={(value as string[]) ?? []}\n onValueChange={onChange}\n multiple={true}\n />\n );\n }\n // string/number: TagInput\n return (\n <TagInput\n value={(value as string[]) ?? []}\n onChange={onChange}\n type={propType === \"integer\" || propType === \"numeric\" ? \"number\" : \"text\"}\n />\n );\n }\n\n // between: 범위 입력\n if (operator === \"between\") {\n if (propType === \"integer\" || propType === \"numeric\") {\n return (\n <RangeNumberInput\n value={(value as [number, number]) ?? [undefined, undefined]}\n onChange={onChange}\n />\n );\n }\n if (propType === \"date\" || propType === \"datetime\") {\n // DateInput 2개로 범위 입력 (간단 버전)\n const [start, end] = (value as [Date, Date]) ?? [undefined, undefined];\n return (\n <div className=\"flex items-center gap-2\">\n <DateInput\n value={start ?? null}\n onValueChange={(v) => onChange([v ?? undefined, end])}\n placeholder={SD(\"rc.sonamuFilter.startDate\")}\n className=\"flex-1\"\n />\n <span className=\"text-muted-foreground\">~</span>\n <DateInput\n value={end ?? null}\n onValueChange={(v) => onChange([start, v ?? undefined])}\n placeholder={SD(\"rc.sonamuFilter.endDate\")}\n className=\"flex-1\"\n />\n </div>\n );\n }\n }\n\n // enum: EnumSelect (단일)\n if (propType === \"enum\" && fieldMeta?.enumData) {\n return (\n <EnumSelect\n enum={{ options: fieldMeta.enumData.options }}\n labels={fieldMeta.enumData.labels}\n value={(value as string) ?? \"\"}\n onValueChange={onChange}\n />\n );\n }\n\n // date/datetime: DatePicker\n if (propType === \"date\" || propType === \"datetime\") {\n return <DatePicker value={(value as Date) ?? undefined} onValueChange={onChange} />;\n }\n\n // string: text input\n if (propType === \"string\") {\n return (\n <Input\n type=\"text\"\n value={(value as string) ?? \"\"}\n onValueChange={onChange}\n placeholder={SD(\"rc.sonamuFilter.enterValue\")}\n />\n );\n }\n\n // integer/numeric: number input\n if (propType === \"integer\" || propType === \"numeric\") {\n return (\n <Input\n type=\"number\"\n value={value === undefined ? \"\" : String(value)}\n onValueChange={(v) => onChange(v === \"\" ? undefined : Number(v))}\n placeholder={SD(\"rc.sonamuFilter.enterNumber\")}\n />\n );\n }\n\n // boolean: true/false select\n if (propType === \"boolean\") {\n return (\n <EnumSelect\n enum={{ options: BOOLEAN_ENUM.options }}\n labels={BOOLEAN_ENUM.labels}\n value={value === undefined ? \"\" : String(value)}\n onValueChange={(v) => v && onChange(v === \"true\")}\n className=\"w-full\"\n />\n );\n }\n\n // json 타입은 isNull/isNotNull만 지원\n return <Input type=\"text\" value=\"\" placeholder={SD(\"rc.sonamuFilter.notSupported\")} disabled />;\n}\n","import TrashIcon from \"~icons/lucide/trash-2\";\n\nimport { useSonamuBaseContext } from \"@/contexts\";\n\nimport { Button, Input, Select } from \"../..\";\nimport { type FilterOperator } from \"../../../lib/types\";\nimport { operatorsByPropType } from \"../../../lib/types\";\nimport { operatorLabels } from \"./constants\";\nimport { type RuleRowProps } from \"./types\";\nimport { ValueInput } from \"./value-input\";\n\n/**\n * Rule Row Input 컴포넌트\n */\nexport function RuleRowInput({ rule, fieldMeta, onUpdate, onRemove }: RuleRowProps) {\n const { SD } = useSonamuBaseContext();\n const fields = Object.keys(fieldMeta);\n const selectedFieldMeta = rule.field ? fieldMeta[rule.field] : null;\n const allowedOperators = selectedFieldMeta ? operatorsByPropType[selectedFieldMeta.propType] : [];\n\n const handleFieldChange = (newField: string | null | undefined) => {\n // Field 변경 시 operator/value 초기화\n onUpdate({\n field: newField ?? null,\n operator: null,\n value: undefined,\n });\n };\n\n const handleOperatorChange = (newOperator: string | null | undefined) => {\n // operator 변경 시 value도 초기화\n onUpdate({\n operator: (newOperator as FilterOperator) ?? null,\n value: undefined,\n });\n };\n\n return (\n <div className=\"flex items-start gap-2 p-3 border rounded-lg bg-gray-50\">\n {/* Field Select */}\n <div className=\"flex-1 min-w-[150px]\">\n <Select\n items={fields}\n value={rule.field ?? \"\"}\n onValueChange={handleFieldChange}\n placeholder={SD(\"rc.sonamuFilter.selectField\")}\n />\n </div>\n\n {/* Operator Select */}\n <div className=\"flex-1 min-w-[120px]\">\n <Select\n items={allowedOperators.map((op) => ({\n value: op,\n label: operatorLabels[op],\n }))}\n value={rule.operator ?? undefined}\n onValueChange={handleOperatorChange}\n disabled={!rule.field}\n placeholder={SD(\"rc.sonamuFilter.selectOperator\")}\n />\n </div>\n\n {/* Value Input */}\n <div className=\"flex-1 min-w-[150px]\">\n {rule.operator && selectedFieldMeta ? (\n <ValueInput\n propType={selectedFieldMeta.propType}\n operator={rule.operator}\n value={rule.value}\n onChange={(newValue) => onUpdate({ value: newValue })}\n fieldMeta={selectedFieldMeta}\n />\n ) : (\n <Input type=\"text\" disabled placeholder={SD(\"rc.sonamuFilter.selectOperatorFirst\")} />\n )}\n </div>\n\n {/* Remove Button */}\n <Button variant=\"ghost\" size=\"sm\" onClick={onRemove} className=\"shrink-0 h-10 px-3\">\n <TrashIcon />\n </Button>\n </div>\n );\n}\n","/* oxlint-disable @typescript-eslint/no-explicit-any */ // Zod 타입 접근\nimport { type z } from \"zod\";\n\nimport { type FilterPropType } from \"../../../lib/types\";\nimport { zodTypeToFilterPropTypeMap } from \"./constants\";\nimport { type FieldMeta, type ZodWithDef } from \"./types\";\n\n/**\n * ZodNullable, ZodOptional 등의 래퍼를 벗겨내고 내부 타입을 반환\n * nullable/optional 여부도 함께 반환\n */\nexport function unwrapZodType(zodType: z.ZodTypeAny): {\n innerType: z.ZodTypeAny;\n nullable: boolean;\n} {\n let current = zodType as ZodWithDef;\n let nullable = false;\n\n while (current._def.type === \"nullable\" || current._def.type === \"optional\") {\n if (current._def.type === \"nullable\") {\n nullable = true;\n }\n current = current._def.innerType as ZodWithDef;\n }\n\n return { innerType: current, nullable };\n}\n\n/**\n * Zod 타입 이름을 FilterPropType으로 변환\n */\nexport function zodTypeNameToPropType(typeName: string): FilterPropType {\n return zodTypeToFilterPropTypeMap[typeName] ?? \"string\";\n}\n\n/**\n * Zod enum에서 options와 labels를 추출\n * SD 함수를 사용하여 enum.{EnumName}.{value} 형태로 라벨 조회\n */\nexport function extractEnumData(\n zodEnum: z.ZodTypeAny,\n SD: (key: string) => string,\n): FieldMeta[\"enumData\"] {\n // options 추출\n const options = (zodEnum as any).options\n ? (Array.from((zodEnum as any).options) as string[])\n : undefined;\n\n if (!options) {\n return undefined;\n }\n\n // labels 추출 (SD 함수 사용: enum.{EnumName}.{value})\n const enumDescription = (zodEnum as any)._def?.description || (zodEnum as any).description;\n const labels: Record<string, string> = {};\n\n if (enumDescription) {\n for (const option of options) {\n const dictKey = `enum.${enumDescription}.${option}`;\n labels[option] = SD(dictKey);\n }\n }\n\n return { options, labels };\n}\n\n/**\n * Zod 스키마에서 각 필드의 타입 정보를 추출하여 FieldMeta 형태로 변환\n */\nexport function extractFieldMetaFromSchema(\n schema: z.ZodObject<z.ZodRawShape>,\n SD: (key: string) => string,\n): Record<string, FieldMeta> {\n const shape = schema.shape;\n const fieldMeta: Record<string, FieldMeta> = {};\n\n for (const [fieldName, zodSchema] of Object.entries(shape)) {\n // virtual, textsearchable로 시작하는 필드는 제외\n if (fieldName.startsWith(\"virtual\") || fieldName.startsWith(\"textsearchable\")) {\n continue;\n }\n\n // nullable/optional 벗겨내기\n const { innerType, nullable } = unwrapZodType(zodSchema as z.ZodTypeAny);\n\n // 메타 SonamuPropType 체크 (numeric 등)\n const meta = (zodSchema as any).meta?.();\n const sonamuPropType = meta?.SonamuPropType;\n const isNumeric = sonamuPropType === \"numeric\";\n\n // propType 결정\n const innerWithDef = innerType as ZodWithDef;\n const propType: FilterPropType = isNumeric\n ? \"numeric\"\n : zodTypeNameToPropType(innerWithDef._def.type);\n\n // enum 타입인 경우 추가 정보 추출\n const enumData = propType === \"enum\" ? extractEnumData(innerType, SD) : undefined;\n\n fieldMeta[fieldName] = {\n propType,\n nullable,\n enumData,\n };\n }\n\n return fieldMeta;\n}\n","/* oxlint-disable @typescript-eslint/no-explicit-any */ // Zod 타입 접근\n\nimport { useEffect, useState } from \"react\";\nimport PlusIcon from \"~icons/lucide/plus\";\n\nimport { Button, Dialog, DialogContent, DialogHeader, DialogTitle } from \"../..\";\nimport { useSonamuBaseContext } from \"../../../contexts/sonamu-context\";\nimport { RuleRowInput } from \"./rule-row-input\";\nimport { type Rule, type SonamuFilterModalProps } from \"./types\";\nimport { extractFieldMetaFromSchema } from \"./utils\";\n\n/**\n * SonamuFilterModal\n *\n * Zod 스키마 기반 필터 UI 생성\n */\nexport function SonamuFilterModal({\n baseSchema,\n open,\n onOpenChange,\n initialRules = [],\n onApply,\n}: SonamuFilterModalProps) {\n const { SD } = useSonamuBaseContext();\n\n // Apply된 최종 상태\n const [appliedRules, setAppliedRules] = useState(initialRules);\n // 작업 중 상태\n const [rules, setRules] = useState<Rule[]>([]);\n\n // initialRules가 변경되면 appliedRules에 동기화\n useEffect(() => {\n setAppliedRules(initialRules);\n }, [initialRules]);\n\n // 모달이 열릴 때마다 appliedRules를 rules로 복사\n useEffect(() => {\n if (open) {\n setRules(appliedRules.map((rule) => ({ ...rule })));\n }\n }, [open, appliedRules]);\n\n // baseSchema에서 동적으로 FieldMeta 추출\n const fieldMeta = extractFieldMetaFromSchema(baseSchema, SD);\n\n // Rule 추가\n const addRule = () => {\n setRules([\n ...rules,\n {\n id: crypto.randomUUID(),\n field: null,\n operator: null,\n value: undefined,\n },\n ]);\n };\n\n // Rule 삭제\n const removeRule = (id: string) => {\n setRules(rules.filter((rule) => rule.id !== id));\n };\n\n // Rule 업데이트\n const updateRule = (id: string, updates: Partial<Rule>) => {\n setRules(rules.map((rule) => (rule.id === id ? { ...rule, ...updates } : rule)));\n };\n\n // FilterQuery로 변환\n const buildFilterQuery = (): Record<string, unknown> => {\n const filters: Record<string, unknown> = {};\n\n for (const rule of rules) {\n if (!rule.field || !rule.operator) continue;\n\n // isNull/isNotNull은 객체 형태로\n if (rule.operator === \"isNull\" || rule.operator === \"isNotNull\") {\n filters[rule.field] = { [rule.operator]: rule.value };\n } else {\n // 다른 연산자들\n filters[rule.field] = { [rule.operator]: rule.value };\n }\n }\n\n return filters;\n };\n\n // Apply 버튼 클릭\n const handleApply = () => {\n const filters = buildFilterQuery();\n const confirmedRules = rules.map((rule) => ({ ...rule }));\n // 현재 rules를 확정 상태로 저장\n setAppliedRules(confirmedRules);\n onApply?.(filters, confirmedRules);\n onOpenChange(false);\n };\n\n // Reset 버튼 클릭 (모든 rule 제거)\n const handleReset = () => {\n setRules([]);\n };\n\n // Cancel 버튼 클릭 (작업 내용 버림)\n const handleCancel = () => {\n // rules 변경사항을 버리고 appliedRules로 복원\n setRules(appliedRules.map((rule) => ({ ...rule })));\n onOpenChange(false);\n };\n\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent className=\"max-w-4xl max-h-[90vh] overflow-hidden flex flex-col\">\n <DialogHeader>\n <DialogTitle>{SD(\"rc.sonamuFilter.title\")}</DialogTitle>\n </DialogHeader>\n\n <div className=\"flex-1 overflow-auto space-y-4 py-4\">\n {/* Rules */}\n {rules.length === 0 ? (\n <div className=\"text-center py-8 text-muted-foreground\">\n <p className=\"text-sm\">{SD(\"rc.sonamuFilter.noRulesYet\")}</p>\n </div>\n ) : (\n <div className=\"space-y-2\">\n {rules.map((rule) => (\n <RuleRowInput\n key={rule.id}\n rule={rule}\n fieldMeta={fieldMeta}\n onUpdate={(updates) => updateRule(rule.id, updates)}\n onRemove={() => removeRule(rule.id)}\n />\n ))}\n </div>\n )}\n\n {/* Add Rule Button */}\n <div className=\"flex gap-2\">\n <Button variant=\"outline\" onClick={addRule} className=\"flex-1\">\n <PlusIcon />\n {SD(\"rc.sonamuFilter.addRule\")}\n </Button>\n {rules.length > 0 && (\n <Button variant=\"outline\" onClick={handleReset} className=\"flex-1\">\n {SD(\"rc.sonamuFilter.reset\")}\n </Button>\n )}\n </div>\n\n {/* Preview JSON */}\n {rules.length > 0 && (\n <div className=\"border rounded-lg p-4 bg-muted/50\">\n <h4 className=\"text-sm font-semibold mb-2\">Preview (JSON)</h4>\n <pre className=\"text-xs overflow-auto max-h-[200px] bg-background p-3 rounded border\">\n {JSON.stringify(buildFilterQuery(), null, 2)}\n </pre>\n </div>\n )}\n </div>\n\n {/* Footer Buttons */}\n <div className=\"flex justify-end gap-2 pt-4 border-t\">\n <Button variant=\"outline\" onClick={handleCancel}>\n {SD(\"rc.common.cancel\")}\n </Button>\n <Button onClick={handleApply}>{SD(\"rc.sonamuFilter.apply\")}</Button>\n </div>\n </DialogContent>\n </Dialog>\n );\n}\n","/* oxlint-disable @typescript-eslint/no-explicit-any */ // caster 함수에는 any가 필요함\nimport { z } from \"zod\";\n\n// optional, nullable 무관하게 ZodNumber 체크\nfunction isZodNumberAnyway(zodType: z.ZodType<any>) {\n if (zodType instanceof z.ZodNumber) {\n return true;\n } else if (zodType instanceof z.ZodNullable && zodType._def.innerType instanceof z.ZodNumber) {\n return true;\n } else if (zodType instanceof z.ZodOptional && zodType._def.innerType instanceof z.ZodNumber) {\n return true;\n } else if (\n zodType instanceof z.ZodOptional &&\n zodType._def.innerType instanceof z.ZodOptional &&\n (zodType._def.innerType as any)._def.innerType instanceof z.ZodNumber\n ) {\n return true;\n }\n\n return false;\n}\n\n// ZodType을 이용해 raw를 Type Coercing\nexport function caster(zodType: z.ZodType<any>, raw: any): any {\n if (isZodNumberAnyway(zodType) && typeof raw === \"string\") {\n // number\n return Number(raw);\n } else if (zodType instanceof z.ZodUnion) {\n const options = zodType.options as z.ZodType<any>[];\n if (options.some((opt) => isZodNumberAnyway(opt))) {\n // zArrayable Number 케이스 처리\n if (Array.isArray(raw)) {\n const numType = options.find((opt) => opt instanceof z.ZodNumber);\n if (!numType) {\n throw new Error(\"Expected to find a number type in union\");\n }\n return raw.map((elem: any) => caster(numType, elem));\n } else {\n return Number(raw);\n }\n }\n } else if (zodType instanceof z.ZodBoolean && (raw === \"true\" || raw === \"false\")) {\n // boolean\n return raw === \"true\";\n } else if (zodType instanceof z.ZodArray) {\n // array\n return raw.map((elem: any) => caster(zodType.element as z.ZodType<any>, elem));\n } else if (zodType instanceof z.ZodObject && typeof raw === \"object\") {\n // object\n return Object.keys(raw).reduce((r, rawKey) => {\n r[rawKey] = caster(zodType.shape[rawKey], raw[rawKey]);\n return r;\n }, {} as any);\n } else if (zodType instanceof z.ZodOptional) {\n return caster(zodType._def.innerType as z.ZodType<any>, raw);\n }\n\n // 나머지는 처리 안함\n return raw;\n}\n\nexport function fastifyCaster(schema: z.ZodObject<any>) {\n return z.preprocess((raw: any) => {\n return caster(schema, raw);\n }, schema);\n}\n","/* oxlint-disable @typescript-eslint/no-explicit-any */ // 파싱 결과이므로 any 허용\n\nimport qs from \"qs\";\nimport { isObject } from \"radashi\";\nimport { type z } from \"zod\";\n\nimport { caster } from \"./caster\";\n\n// ============================================================================\n// UI Utilities\n// ============================================================================\n\nexport function hidden(condition: boolean | undefined): string {\n return condition === true ? \"hidden\" : \"\";\n}\n\n// ============================================================================\n// URL / Search Params Conversion\n// ============================================================================\n\nexport function searchParamsToParams<T extends z.ZodType<any>>(\n searchParams: URLSearchParams,\n paramsSchema: T,\n): z.infer<T> {\n const obj = qs.parse(searchParams.toString());\n return caster(paramsSchema, obj);\n}\n\nexport function paramsToSearchParams<T>(params: T): {\n [key in string]: string | string[];\n} {\n return Object.fromEntries(\n // oxlint-disable-next-line unicorn/prefer-array-flat-map -- 여기는 flatMap 사용하면 깨짐\n Object.entries(params as any)\n .filter(([, value]) => {\n return value !== undefined;\n })\n .map(([key, value]) => {\n if (Array.isArray(value)) {\n return [[`${key}[]`, value]];\n } else if (isObject(value)) {\n return Object.keys(value).map((subKey) => {\n return [`${key}[${subKey}]`, String(value[subKey as keyof typeof value])];\n });\n } else {\n return [[key, String(value)]];\n }\n })\n .flat(),\n );\n}\n\n// ============================================================================\n// Formatting Utilities\n// ============================================================================\n\nexport function sqlDateToDateString(sqlDateString: string | null) {\n if (sqlDateString === null) {\n return null;\n } else {\n return sqlDateString.slice(0, 10);\n }\n}\n\nexport function numF(num: number | null | undefined): string | number | undefined | null {\n return num && new Intl.NumberFormat().format(num);\n}\n\nexport function dateF(dateValue: string | Date | null | undefined): string | null {\n if (dateValue === null || dateValue === undefined) {\n return null;\n } else if (dateValue instanceof Date) {\n return dateValue.toISOString().slice(0, 10);\n } else {\n return dateValue.slice(0, 10);\n }\n}\n\nexport function datetimeF(dateValue: string | Date | null | undefined): string | null {\n if (dateValue === null || dateValue === undefined) {\n return null;\n } else if (dateValue instanceof Date) {\n return dateValue.toISOString().slice(0, 19).replace(\"T\", \" \");\n } else {\n return dateValue.slice(0, 19);\n }\n}\n\n// ============================================================================\n// Array Utilities\n// ============================================================================\n\nexport function arrayableToArray<T extends number | string | boolean>(\n val: T | T[] | undefined,\n): T[] {\n return val ? (Array.isArray(val) ? val : [val]) : [];\n}\n\n// ============================================================================\n// Function Reference Utilities\n// ============================================================================\n\nexport function caller<T extends Function>() {\n let savedFunc: T | null = null;\n return {\n set: (func: T) => {\n savedFunc = func;\n },\n call: ((...args: unknown[]) => {\n if (savedFunc) {\n savedFunc.call(args);\n }\n }) as unknown as T,\n };\n}\n","/* oxlint-disable @typescript-eslint/no-explicit-any */ // 파싱 결과이므로 any 허용\n\nimport { get, set } from \"radashi\";\nimport { useState } from \"react\";\nimport { z } from \"zod\";\n\nimport { type SonamuFile } from \"@/contexts\";\nimport { useSonamuBaseContext } from \"@/contexts\";\n\nimport { type ErrorObj } from \"./types\";\n\n/**\n * FormRegisterReturn\n *\n * register 함수의 반환 타입입니다.\n */\nexport type FormRegisterReturn = {\n value: any;\n onValueChange: (value: any) => void;\n onRowChange?: (row: any) => void;\n error?: ErrorObj;\n};\n\n/**\n * traverseAndUploadFiles\n *\n * 폼 데이터 안에 중첩되어 있는 File 객체들을 재귀적으로 찾아서 업로드하고,\n * File 객체를 업로드된 SonamuFile 객체로 변환하는 헬퍼 함수입니다.\n *\n * @param value - 검사할 값 (원시값, File, 배열, 객체 등 모든 타입 가능)\n * @param uploader - File 배열을 받아서 업로드된 SonamuFile 배열을 반환하는 함수\n * @returns 변환된 값 (File 객체는 SonamuFile 객체로, 나머지는 원본 구조 유지)\n */\nasync function traverseAndUploadFiles(\n value: any,\n uploader: (files: File[]) => Promise<SonamuFile[]>,\n): Promise<any> {\n // 1. File 객체를 발견한 경우\n if (value instanceof File) {\n const [sonamuFile] = await uploader([value]);\n return sonamuFile;\n }\n\n // 2. 배열을 발견한 경우\n if (Array.isArray(value)) {\n // 2-1. 배열의 모든 요소가 File이면 일괄 업로드 (성능 최적화)\n if (value.length > 0 && value.every((item) => item instanceof File)) {\n return await uploader(value);\n }\n // 2-2. 배열에 File이 아닌 요소가 섞여 있으면 각 요소를 재귀적으로 처리\n return await Promise.all(value.map((item) => traverseAndUploadFiles(item, uploader)));\n }\n\n // 3. 일반 객체를 발견한 경우 (null, Date, RegExp 등 특수 객체 제외)\n if (\n value !== null &&\n typeof value === \"object\" &&\n Object.prototype.toString.call(value) === \"[object Object]\"\n ) {\n // 객체의 각 속성을 재귀적으로 순회하며 File 객체를 찾아서 업로드\n const result: any = {};\n for (const [key, val] of Object.entries(value)) {\n result[key] = await traverseAndUploadFiles(val, uploader);\n }\n return result;\n }\n\n // 4. 원시값(string, number, boolean 등)은 변환 없이 그대로 반환\n return value;\n}\n\nexport function useTypeForm<T extends z.ZodObject<any> | z.ZodArray<any>, U extends z.infer<T>>(\n zType: T,\n defaultValue: U,\n) {\n const [form, setForm] = useState<z.infer<T>>(defaultValue);\n const [errorObjs, setErrorObjs] = useState(new Map());\n const { uploader } = useSonamuBaseContext();\n\n function getEmptyStringTo(zType: T, objPath: string): \"normal\" | \"nullable\" | \"optional\" {\n const zTypeObjPath = objPath\n .replace(/\\./g, \".shape.\")\n .replace(/\\[[^\\]]+\\]/g, \".element\")\n .replace(/^\\.element/, \"element\");\n\n let targetZType: unknown;\n if (zType instanceof z.ZodObject) {\n targetZType = get(zType.shape, zTypeObjPath);\n } else if (zType instanceof z.ZodArray) {\n targetZType = get(zType, zTypeObjPath);\n }\n\n if (targetZType === undefined) {\n return \"normal\";\n } else if (targetZType instanceof z.ZodOptional) {\n return \"optional\";\n } else if (targetZType instanceof z.ZodNullable) {\n return \"nullable\";\n }\n return \"normal\";\n }\n\n return {\n form,\n setForm,\n register: (\n objPath: string,\n _emptyStringTo?: \"normal\" | \"nullable\" | \"optional\",\n ): FormRegisterReturn => {\n const emptyStringTo = _emptyStringTo ?? getEmptyStringTo(zType, objPath);\n const srcValue = get(form, objPath) as unknown;\n\n const error = errorObjs.get(objPath);\n\n // value 업데이트 로직\n const updateValue = (newValue: any) => {\n if (error !== undefined) {\n setErrorObjs((p) => {\n const newP = new Map(p);\n newP.delete(objPath);\n return newP;\n });\n }\n\n let processedValue = newValue;\n if (emptyStringTo === \"nullable\") {\n processedValue = newValue === \"\" ? null : newValue;\n } else if (emptyStringTo === \"optional\") {\n processedValue = newValue === \"\" ? undefined : newValue;\n }\n\n // 최상위 속성인지 확인\n const isTopLevelPath = objPath.indexOf(\".\") === -1 && objPath.indexOf(\"[\") === -1;\n\n // radashi의 set은 undefined 값을 처리하지 못하므로, 최상위 속성은 직접 설정\n // 관련 이슈: https://github.com/sodiray/radash/issues/432\n if (processedValue === undefined && isTopLevelPath) {\n setForm({ ...form, [objPath]: undefined });\n } else {\n setForm(set(form, objPath, processedValue));\n }\n };\n\n const result: FormRegisterReturn = {\n value: srcValue === undefined || srcValue === null ? \"\" : srcValue,\n onValueChange: updateValue,\n };\n\n // error가 있으면 추가\n if (error) {\n result.error = error;\n }\n\n return result;\n },\n submit:\n <R>(callback: (formData: z.infer<T>) => Promise<R>) =>\n async () => {\n const transformedForm = await traverseAndUploadFiles(form, uploader);\n setForm(transformedForm);\n return await callback(transformedForm);\n },\n addError: (objPath: string, errorMessage: string | ErrorObj): void => {\n setErrorObjs((p) => {\n const newP = new Map(p);\n newP.set(\n objPath,\n typeof errorMessage === \"string\" ? { content: errorMessage } : errorMessage,\n );\n return newP;\n });\n },\n removeError: (objPath: string): void => {\n setErrorObjs((p) => {\n const newP = new Map(p);\n newP.delete(objPath);\n return newP;\n });\n },\n clearError: (): void => {\n setErrorObjs(new Map());\n },\n reset: (): void => {\n setForm(defaultValue);\n },\n };\n}\n","/* oxlint-disable @typescript-eslint/no-explicit-any */ // 파싱 결과이므로 any 허용\n\nimport { useNavigate, useSearch } from \"@tanstack/react-router\";\nimport equal from \"fast-deep-equal\";\nimport { unique } from \"radashi\";\nimport type React from \"react\";\nimport { useEffect, useState } from \"react\";\nimport { type z } from \"zod\";\n\n// radashi에 intersection이 없으므로 직접 구현\nfunction intersection<T>(arr1: T[], arr2: T[]): T[] {\n return arr1.filter((item) => arr2.includes(item));\n}\n\ntype ZodKeys<T extends z.ZodType<any>> = keyof z.infer<T>;\n\nexport function useListParams<U extends z.ZodType<any>, T extends Partial<z.infer<U>>>(\n zType: U,\n defaultValue: T,\n options?: {\n disableSearchParams?: boolean;\n },\n) {\n const search = useSearch({ strict: false }) as Record<string, unknown>;\n const navigate = useNavigate();\n\n // URL에서 파라미터 파싱\n const listParams = (() => {\n if (options?.disableSearchParams) {\n return defaultValue;\n }\n\n const parsed = zType.safeParse(search);\n if (parsed.success) {\n return { ...defaultValue, ...parsed.data };\n }\n return defaultValue;\n })();\n\n const setListParams = (newParams: T) => {\n if (equal(listParams, newParams)) {\n return;\n }\n\n navigate({\n search: newParams as any,\n });\n };\n\n function register(name: ZodKeys<U>): any {\n const currentValue = (listParams as any)[name];\n const defaultVal = (defaultValue as any)[name];\n\n return {\n value: currentValue ?? defaultVal ?? (name === \"page\" ? 1 : \"\"),\n onValueChange: (value: any) => {\n if (name === \"page\") {\n setListParams({ ...listParams, page: value } as T);\n } else {\n setListParams({\n ...listParams,\n page: 1,\n [name]: value === \"\" ? undefined : value,\n } as T);\n }\n },\n };\n }\n\n return {\n listParams,\n setListParams,\n register,\n };\n}\n\nexport function useSelection<T>(allKeys: T[], defaultSelectedKeys: T[] = []) {\n const [selection, setSelection] = useState(\n new Map(allKeys.map((key) => [key, defaultSelectedKeys.includes(key)])),\n );\n const [lastIndex, setLastIndex] = useState(0);\n\n // 전체 키가 바뀔 때마다 validation하여 갱신된 전체 키에 포함된 키만 유지\n useEffect(() => {\n const selectionKeys = Array.from(selection.keys());\n if (intersection(allKeys, selectionKeys).length === selectionKeys.length) {\n return;\n }\n\n setSelection(new Map(Array.from(selection).filter(([key, _value]) => allKeys.includes(key))));\n }, [allKeys, selection]);\n\n const selectedKeys = Array.from(selection)\n .filter(([key, value]) => allKeys.includes(key) && value)\n .map(([key]) => key);\n\n return {\n getSelected: (key: T) => selection.get(key) ?? false,\n toggle: (key: T) => {\n setSelection((selection) => {\n return new Map([...selection, [key, !(selection.get(key) ?? false)]]);\n });\n },\n selectedKeys,\n deselectAll: () => setSelection(new Map(allKeys.map((key) => [key, false]))),\n selectAll: () => setSelection(new Map(allKeys.map((key) => [key, true]))),\n isAllSelected: selectedKeys.length === allKeys.length,\n handleCheckboxClick: (e: React.MouseEvent<HTMLInputElement>, index: number) => {\n const input = e.currentTarget.getElementsByTagName(\"input\");\n if (e.shiftKey && !input[0]?.checked) {\n const [begin, end] = (() => {\n if (lastIndex < index) {\n return [lastIndex, index];\n } else {\n return [index + 1, lastIndex];\n }\n })();\n setSelection(\n new Map(unique([...selectedKeys, ...allKeys.slice(begin, end)]).map((k: T) => [k, true])),\n );\n } else {\n setLastIndex(index);\n }\n },\n };\n}\n","import React, { useState } from \"react\";\n\nimport { type ControlledModalProps } from \"./types\";\n\nexport function useModal<T extends object>(\n ModalComponent: (props: T & ControlledModalProps) => React.ReactElement,\n defaultProps: T,\n) {\n const [modalProps, setModalProps] = useState<T & { open: boolean }>({\n ...defaultProps,\n open: false,\n });\n\n const close = () => {\n setModalProps({\n ...modalProps,\n open: false,\n });\n };\n\n return {\n open: (newProps: T) => {\n setModalProps({\n ...newProps,\n open: true,\n close,\n });\n },\n modal: React.createElement(ModalComponent, {\n ...modalProps,\n close,\n }),\n };\n}\n","import { Popover, PopoverContent, PopoverTrigger } from \"../..\";\nimport { useSonamuBaseContext } from \"../../../contexts/sonamu-context\";\nimport { datetimeF, numF } from \"../../../lib\";\nimport { type FilterOperator } from \"../../../lib/types\";\nimport { operatorLabels } from \"./constants\";\nimport { type Rule, type SonamuFilterPopoverProps } from \"./types\";\n\n/**\n * SonamuFilterPopover\n *\n * 필터 버튼에 적용된 필터를 Popover로 표시하는 컴포넌트\n * 필터가 적용되어 있으면 hover 없이도 항상 보임\n */\nexport function SonamuFilterPopover({\n rules,\n fieldMeta,\n children,\n side = \"bottom\",\n align = \"start\",\n}: SonamuFilterPopoverProps) {\n const { SD } = useSonamuBaseContext();\n\n // Operator 라벨 가져오기\n const getOperatorLabel = (operator: FilterOperator | null): string => {\n if (!operator) return \"\";\n return operatorLabels[operator];\n };\n\n // Value 포맷팅\n const formatValue = (rule: Rule): string => {\n const { value, field, operator } = rule;\n\n // isNull/isNotNull은 value 표시하지 않음\n if (operator === \"isNull\" || operator === \"isNotNull\") {\n return \"\";\n }\n\n if (!field || value === undefined || value === null) {\n return \"\";\n }\n\n const meta = fieldMeta[field];\n if (!meta) return String(value);\n\n // Enum인 경우 라벨 표시\n if (meta.propType === \"enum\" && meta.enumData) {\n if (Array.isArray(value)) {\n return value.map((v) => meta.enumData?.labels[v] || v).join(\", \");\n }\n return meta.enumData.labels[value as string] || String(value);\n }\n\n // 날짜/시간인 경우\n if (meta.propType === \"date\" || meta.propType === \"datetime\") {\n if (Array.isArray(value)) {\n return value.map((v) => datetimeF(v as string | Date) ?? \"\").join(\" ~ \");\n }\n return datetimeF(value as string | Date) ?? \"\";\n }\n\n // 숫자인 경우\n if (meta.propType === \"integer\" || meta.propType === \"numeric\") {\n if (Array.isArray(value)) {\n return value.map((v) => String(numF(v as number) ?? \"\")).join(\" ~ \");\n }\n return String(numF(value as number) ?? \"\");\n }\n\n // 배열인 경우\n if (Array.isArray(value)) {\n return value.join(\", \");\n }\n\n return String(value);\n };\n\n // 필터가 없으면 children만 반환\n if (rules.length === 0) {\n return <>{children}</>;\n }\n\n return (\n <Popover open={true}>\n <PopoverTrigger asChild>{children}</PopoverTrigger>\n <PopoverContent\n side={side}\n align={align}\n sideOffset={5}\n className=\"p-3\"\n style={{ width: \"var(--radix-popover-trigger-width)\" }}\n >\n <div>\n <div className=\"text-xs font-semibold mb-2\">{SD(\"rc.sonamuFilter.appliedFilters\")}</div>\n <ul className=\"space-y-1.5 text-xs\">\n {rules.map((rule) => {\n if (!rule.field || !rule.operator) return null;\n\n const operatorLabel = getOperatorLabel(rule.operator);\n const valueStr = formatValue(rule);\n\n return (\n <li key={rule.id} className=\"flex items-start gap-1\">\n <span className=\"text-muted-foreground\">•</span>\n <div>\n <span className=\"font-medium\">{rule.field}</span>{\" \"}\n <span className=\"text-muted-foreground\">{operatorLabel}</span>{\" \"}\n {valueStr && <span>{valueStr}</span>}\n </div>\n </li>\n );\n })}\n </ul>\n </div>\n </PopoverContent>\n </Popover>\n );\n}\n","\"use client\";\n\nimport * as SwitchPrimitives from \"@radix-ui/react-switch\";\nimport * as React from \"react\";\n\nimport { type Override } from \"../../lib/types\";\nimport { cn } from \"../../lib/utils\";\n\ntype SwitchProps = Override<\n React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>,\n {\n name?: string;\n value?: boolean;\n onValueChange?: (checked: boolean) => void;\n onBlur?: React.FocusEventHandler<HTMLInputElement>;\n }\n>;\n\nconst Switch = React.forwardRef<HTMLInputElement, SwitchProps>(\n ({ className, name, checked, value, defaultChecked, onValueChange, onBlur, ...props }, ref) => {\n const effectiveChecked = value !== undefined ? value : checked;\n const inputRef = React.useRef<HTMLInputElement>(null);\n\n // oxlint-disable-next-line @typescript-eslint/no-non-null-assertion -- useImperativeHandle은 ref가 할당된 후 실행되므로 안전함\n React.useImperativeHandle(ref, () => inputRef.current!);\n\n const handleCheckedChange = (newChecked: boolean) => {\n onValueChange?.(newChecked);\n };\n\n return (\n <>\n <input\n type=\"checkbox\"\n ref={inputRef}\n name={name}\n defaultChecked={defaultChecked}\n onBlur={onBlur}\n className=\"sr-only\"\n tabIndex={-1}\n aria-hidden=\"true\"\n />\n <SwitchPrimitives.Root\n checked={effectiveChecked}\n defaultChecked={defaultChecked}\n onCheckedChange={handleCheckedChange}\n className={cn(\n \"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input\",\n className,\n )}\n {...props}\n >\n <SwitchPrimitives.Thumb\n className={cn(\n \"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0\",\n )}\n />\n </SwitchPrimitives.Root>\n </>\n );\n },\n);\n\nSwitch.displayName = \"Switch\";\n\nexport { Switch };\n","\"use client\";\n\nimport type * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\ntype TableAlign = \"left\" | \"center\" | \"right\";\n\ntype TableCol<T> = {\n label: string | React.ReactNode;\n tc: (row: T, rowIndex?: number) => React.ReactNode;\n fit?: boolean;\n className?: string;\n align?: TableAlign;\n};\n\nfunction Table({\n className,\n containerClassName,\n ...props\n}: React.ComponentProps<\"table\"> & { containerClassName?: string }) {\n return (\n <div\n data-slot=\"table-container\"\n className={cn(\"relative w-full overflow-x-auto\", containerClassName)}\n >\n <table\n data-slot=\"table\"\n className={cn(\"w-full caption-bottom text-sm\", className)}\n {...props}\n />\n </div>\n );\n}\n\nfunction TableHeader({ className, ...props }: React.ComponentProps<\"thead\">) {\n return <thead data-slot=\"table-header\" className={cn(\"[&_tr]:border-b\", className)} {...props} />;\n}\n\nfunction TableBody({ className, ...props }: React.ComponentProps<\"tbody\">) {\n return (\n <tbody\n data-slot=\"table-body\"\n className={cn(\"[&_tr:last-child]:border-0\", className)}\n {...props}\n />\n );\n}\n\nfunction TableFooter({ className, ...props }: React.ComponentProps<\"tfoot\">) {\n return (\n <tfoot\n data-slot=\"table-footer\"\n className={cn(\"bg-muted/50 border-t font-medium [&>tr]:last:border-b-0\", className)}\n {...props}\n />\n );\n}\n\nfunction TableRow({ className, ...props }: React.ComponentProps<\"tr\">) {\n return (\n <tr\n data-slot=\"table-row\"\n className={cn(\n \"hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction TableHead({\n className,\n fit,\n align,\n ...props\n}: React.ComponentProps<\"th\"> & {\n fit?: boolean;\n align?: TableAlign;\n}) {\n return (\n <th\n data-slot=\"table-head\"\n className={cn(\n \"text-foreground h-10 px-2 text-left font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 *:[[role=checkbox]]:translate-y-[2px]\",\n fit && \"w-px\",\n align === \"center\" && \"text-center\",\n align === \"right\" && \"text-right\",\n className,\n )}\n style={{ verticalAlign: \"middle\" }}\n {...props}\n />\n );\n}\n\nfunction TableCell({\n className,\n fit,\n align,\n ...props\n}: React.ComponentProps<\"td\"> & {\n fit?: boolean;\n align?: TableAlign;\n}) {\n return (\n <td\n data-slot=\"table-cell\"\n className={cn(\n \"p-2 whitespace-nowrap [&:has([role=checkbox])]:pr-0 *:[[role=checkbox]]:translate-y-[2px]\",\n fit && \"w-px\",\n align === \"center\" && \"text-center\",\n align === \"right\" && \"text-right\",\n className,\n )}\n style={{ verticalAlign: \"middle\" }}\n {...props}\n />\n );\n}\n\nfunction TableCaption({ className, ...props }: React.ComponentProps<\"caption\">) {\n return (\n <caption\n data-slot=\"table-caption\"\n className={cn(\"text-muted-foreground mt-4 text-sm\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCaption,\n type TableCol,\n};\n","import * as TabsPrimitive from \"@radix-ui/react-tabs\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Tabs = TabsPrimitive.Root;\n\nconst TabsList = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.List\n ref={ref}\n className={cn(\n \"inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground\",\n className,\n )}\n {...props}\n />\n));\nTabsList.displayName = TabsPrimitive.List.displayName;\n\nconst TabsTrigger = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n \"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm\",\n className,\n )}\n {...props}\n />\n));\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName;\n\nconst TabsContent = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Content\n ref={ref}\n className={cn(\n \"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n className,\n )}\n {...props}\n />\n));\nTabsContent.displayName = TabsPrimitive.Content.displayName;\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent };\n","import * as React from \"react\";\n\nimport { type Override } from \"../../lib/types\";\nimport { cn } from \"../../lib/utils\";\n\nexport type TextareaProps = Override<\n React.ComponentProps<\"textarea\">,\n {\n onValueChange?: (value: string) => void;\n }\n>;\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n ({ className, onValueChange, onChange, ...props }, ref) => {\n const handleChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n onValueChange?.(e.target.value);\n onChange?.(e);\n };\n\n return (\n <textarea\n className={cn(\n \"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n className,\n )}\n ref={ref}\n {...props}\n onChange={handleChange}\n />\n );\n },\n);\nTextarea.displayName = \"Textarea\";\n\nexport { Textarea };\n","import * as ToastPrimitives from \"@radix-ui/react-toast\";\nimport { cva } from \"class-variance-authority\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\nimport XIcon from \"~icons/lucide/x\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst ToastProvider = ToastPrimitives.Provider;\n\nconst ToastViewport = React.forwardRef<\n React.ComponentRef<typeof ToastPrimitives.Viewport>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Viewport\n ref={ref}\n className={cn(\n \"fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]\",\n className,\n )}\n {...props}\n />\n));\nToastViewport.displayName = ToastPrimitives.Viewport.displayName;\n\nconst toastVariantsConfig = {\n variant: {\n default: \"border bg-background text-foreground\",\n destructive: \"destructive group border-destructive bg-destructive text-destructive-foreground\",\n },\n} as const;\n\nconst toastVariants = cva(\n \"group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full\",\n {\n variants: toastVariantsConfig,\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\nconst Toast = React.forwardRef<\n React.ComponentRef<typeof ToastPrimitives.Root>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root> & VariantProps<typeof toastVariants>\n>(({ className, variant, ...props }, ref) => {\n return (\n <ToastPrimitives.Root\n ref={ref}\n className={cn(toastVariants({ variant }), className)}\n {...props}\n />\n );\n});\nToast.displayName = ToastPrimitives.Root.displayName;\n\nconst ToastAction = React.forwardRef<\n React.ComponentRef<typeof ToastPrimitives.Action>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Action>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Action\n ref={ref}\n className={cn(\n \"inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive\",\n className,\n )}\n {...props}\n />\n));\nToastAction.displayName = ToastPrimitives.Action.displayName;\n\nconst ToastClose = React.forwardRef<\n React.ComponentRef<typeof ToastPrimitives.Close>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Close>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Close\n ref={ref}\n className={cn(\n \"absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600\",\n className,\n )}\n toast-close=\"\"\n {...props}\n >\n <XIcon className=\"h-4 w-4\" />\n </ToastPrimitives.Close>\n));\nToastClose.displayName = ToastPrimitives.Close.displayName;\n\nconst ToastTitle = React.forwardRef<\n React.ComponentRef<typeof ToastPrimitives.Title>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Title>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Title ref={ref} className={cn(\"text-sm font-semibold\", className)} {...props} />\n));\nToastTitle.displayName = ToastPrimitives.Title.displayName;\n\nconst ToastDescription = React.forwardRef<\n React.ComponentRef<typeof ToastPrimitives.Description>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Description>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Description\n ref={ref}\n className={cn(\"text-sm opacity-90\", className)}\n {...props}\n />\n));\nToastDescription.displayName = ToastPrimitives.Description.displayName;\n\ntype ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;\n\ntype ToastActionElement = React.ReactElement<typeof ToastAction>;\n\nexport {\n type ToastProps,\n type ToastActionElement,\n ToastProvider,\n ToastViewport,\n Toast,\n toastVariantsConfig,\n ToastTitle,\n ToastDescription,\n ToastClose,\n ToastAction,\n};\n","import { useToast } from \"../../hooks/use-toast\";\nimport {\n Toast,\n ToastClose,\n ToastDescription,\n ToastProvider,\n ToastTitle,\n ToastViewport,\n} from \"./toast\";\n\nexport function Toaster() {\n const { toasts } = useToast();\n\n return (\n <ToastProvider>\n {toasts.map(({ id, title, description, action, ...props }) => (\n <Toast key={id} {...props}>\n <div className=\"grid gap-1\">\n {title && <ToastTitle>{title}</ToastTitle>}\n {description && <ToastDescription>{description}</ToastDescription>}\n </div>\n {action}\n <ToastClose />\n </Toast>\n ))}\n <ToastViewport />\n </ToastProvider>\n );\n}\n","import * as TogglePrimitive from \"@radix-ui/react-toggle\";\nimport { cva } from \"class-variance-authority\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { type Override } from \"../../lib/types\";\nimport { cn } from \"../../lib/utils\";\n\nconst toggleVariantsConfig = {\n variant: {\n default: \"bg-transparent\",\n outline: \"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground\",\n },\n size: {\n default: \"h-10 px-3 min-w-10\",\n sm: \"h-9 px-2.5 min-w-9\",\n lg: \"h-11 px-5 min-w-11\",\n },\n} as const;\n\nconst toggleVariants = cva(\n \"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2\",\n {\n variants: toggleVariantsConfig,\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\ntype ToggleProps = Override<\n React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>,\n { value?: boolean; onValueChange?: (pressed: boolean) => void }\n>;\n\nconst Toggle = React.forwardRef<React.ComponentRef<typeof TogglePrimitive.Root>, ToggleProps>(\n ({ className, variant, size, value, pressed, onValueChange, onPressedChange, ...props }, ref) => {\n const effectivePressed = value !== undefined ? value : pressed;\n\n const handlePressedChange = (newPressed: boolean) => {\n onValueChange?.(newPressed);\n onPressedChange?.(newPressed);\n };\n\n return (\n <TogglePrimitive.Root\n ref={ref}\n pressed={effectivePressed}\n onPressedChange={handlePressedChange}\n className={cn(toggleVariants({ variant, size, className }))}\n {...props}\n />\n );\n },\n);\n\nToggle.displayName = TogglePrimitive.Root.displayName;\n\nexport { Toggle, toggleVariants, toggleVariantsConfig };\n","import * as ToggleGroupPrimitive from \"@radix-ui/react-toggle-group\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\nimport { toggleVariants } from \"./toggle\";\n\nconst ToggleGroupContext = React.createContext<VariantProps<typeof toggleVariants>>({\n size: \"default\",\n variant: \"default\",\n});\n\nconst ToggleGroup = React.forwardRef<\n React.ComponentRef<typeof ToggleGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> &\n VariantProps<typeof toggleVariants>\n>(({ className, variant, size, children, ...props }, ref) => (\n <ToggleGroupPrimitive.Root\n ref={ref}\n className={cn(\"flex items-center justify-center gap-1\", className)}\n {...props}\n >\n <ToggleGroupContext.Provider value={{ variant, size }}>{children}</ToggleGroupContext.Provider>\n </ToggleGroupPrimitive.Root>\n));\n\nToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;\n\nconst ToggleGroupItem = React.forwardRef<\n React.ComponentRef<typeof ToggleGroupPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> &\n VariantProps<typeof toggleVariants>\n>(({ className, children, variant, size, ...props }, ref) => {\n const context = React.useContext(ToggleGroupContext);\n\n return (\n <ToggleGroupPrimitive.Item\n ref={ref}\n className={cn(\n toggleVariants({\n variant: context.variant || variant,\n size: context.size || size,\n }),\n className,\n )}\n {...props}\n >\n {children}\n </ToggleGroupPrimitive.Item>\n );\n});\n\nToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;\n\nexport { ToggleGroup, ToggleGroupItem };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,IAAM,KAAc,GACd,KAAqB,KAgBvB,KAAQ;AAEZ,SAAS,KAAQ;AAEf,QADA,MAAS,KAAQ,oBACV,GAAM,UAAU;;AA2BzB,IAAM,qBAAgB,IAAI,KAA4C,EAEhE,MAAoB,MAAoB;AAC5C,KAAI,GAAc,IAAI,EAAQ,CAC5B;CAGF,IAAM,IAAU,iBAAiB;AAE/B,EADA,GAAc,OAAO,EAAQ,EAC7B,GAAS;GACP,MAAM;GACG;GACV,CAAC;IACD,GAAmB;AAEtB,IAAc,IAAI,GAAS,EAAQ;GAGxB,MAAW,GAAc,MAA0B;AAC9D,SAAQ,EAAO,MAAf;EACE,KAAK,YACH,QAAO;GACL,GAAG;GACH,QAAQ,CAAC,EAAO,OAAO,GAAG,EAAM,OAAO,CAAC,MAAM,GAAG,GAAY;GAC9D;EAEH,KAAK,eACH,QAAO;GACL,GAAG;GACH,QAAQ,EAAM,OAAO,KAAK,MAAO,E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AAC;EAC3D,GAAI;EACJ,CAAA;EAGP;AAED,GAAO,cAAc,GAAgB,KAAK;;;AClD1C,IAAM,KAAqB,EAAM,cAAmD;CAClF,MAAM;CACN,SAAS;CACV,CAAC,EAEI,KAAc,EAAM,YAIvB,EAAE,cAAW,YAAS,SAAM,aAAU,GAAG,KAAS,MACnD,kBAAC,GAAqB,MAAtB;CACO;CACL,WAAW,EAAG,0CAA0C,EAAU;CAClE,GAAI;WAEJ,kBAAC,GAAmB,UAApB;EAA6B,OAAO;GAAE;GAAS;GAAM;EAAG;EAAuC,CAAA;CACrE,CAAA,CAC5B;AAEF,GAAY,cAAc,GAAqB,KAAK;AAEpD,IAAM,KAAkB,EAAM,YAI3B,EAAE,cAAW,aAAU,YAAS,SAAM,GAAG,KAAS,MAAQ;CAC3D,IAAM,IAAU,EAAM,WAAW,GAAmB;AAEpD,QACE,kBAAC,GAAqB,MAAtB;EACO;EACL,WAAW,EACT,GAAe;GACb,SAAS,EAAQ,WAAW;GAC5B,MAAM,EAAQ,QAAQ;GACvB,CAAC,EACF,EACD;EACD,GAAI;EAEH;EACyB,CAAA;EAE9B;AAEF,GAAgB,cAAc,GAAqB,KAAK"}
|
|
1
|
+
{"version":3,"file":"react-components.es.js","names":[],"sources":["../src/hooks/use-toast.ts","../src/lib/utils.ts","../src/components/ui/accordion.tsx","../src/components/ui/alert.tsx","../src/components/ui/button.tsx","../src/components/ui/alert-dialog.tsx","../src/components/ui/aspect-ratio.tsx","../src/components/ui/avatar.tsx","../src/components/ui/badge.tsx","../src/components/ui/breadcrumb.tsx","../src/components/ui/calendar.tsx","../src/components/ui/card.tsx","../src/components/ui/carousel.tsx","../src/components/ui/checkbox.tsx","../src/components/ui/collapsible.tsx","../src/i18n/rc-keys.ts","../src/contexts/sonamu-context.tsx","../src/components/ui/dialog.tsx","../src/components/ui/command.tsx","../src/components/ui/popover.tsx","../src/components/ui/combobox.tsx","../src/components/ui/common-modal.tsx","../src/components/ui/context-menu.tsx","../src/components/ui/input.tsx","../src/components/ui/date-input.tsx","../src/components/ui/date-picker.tsx","../src/components/ui/drawer.tsx","../src/components/ui/dropdown-menu.tsx","../src/components/ui/file-input.tsx","../src/components/ui/label.tsx","../src/components/ui/form.tsx","../src/components/ui/hover-card.tsx","../src/components/ui/input-otp.tsx","../src/components/ui/menubar.tsx","../src/components/ui/separator.tsx","../src/components/ui/select/select.tsx","../src/components/ui/month-picker-multiple.tsx","../src/components/ui/navigation-menu.tsx","../src/components/ui/pagination.tsx","../src/components/ui/progress.tsx","../src/components/ui/radio-group.tsx","../src/components/ui/range-number-input.tsx","../src/components/ui/resizable.tsx","../src/components/ui/scroll-area.tsx","../src/components/ui/select/enum-select.tsx","../src/components/ui/select/id-async-select.tsx","../src/components/ui/sheet.tsx","../src/lib/use-mobile.ts","../src/components/ui/skeleton.tsx","../src/components/ui/tooltip.tsx","../src/components/ui/sidebar.tsx","../src/components/ui/slider.tsx","../src/lib/types.ts","../src/components/ui/sonamu-filter/constants.ts","../src/components/ui/tag-input.tsx","../src/components/ui/sonamu-filter/value-input.tsx","../src/components/ui/sonamu-filter/rule-row-input.tsx","../src/components/ui/sonamu-filter/utils.ts","../src/components/ui/sonamu-filter/sonamu-filter-modal.tsx","../src/lib/caster.ts","../src/lib/base-helpers.ts","../src/lib/form-helpers.ts","../src/lib/list-helpers.ts","../src/lib/modal-helpers.ts","../src/components/ui/sonamu-filter/sonamu-filter-popover.tsx","../src/components/ui/switch.tsx","../src/components/ui/table.tsx","../src/components/ui/tabs.tsx","../src/components/ui/textarea.tsx","../src/components/ui/toast.tsx","../src/components/ui/toaster.tsx","../src/components/ui/toggle.tsx","../src/components/ui/toggle-group.tsx"],"sourcesContent":["\"use client\";\n\n// Inspired by react-hot-toast library\nimport * as React from \"react\";\n\nimport { type ToastActionElement, type ToastProps } from \"../components/ui/toast\";\n\nconst TOAST_LIMIT = 1;\nconst TOAST_REMOVE_DELAY = 1000000;\n\ntype ToasterToast = ToastProps & {\n id: string;\n title?: React.ReactNode;\n description?: React.ReactNode;\n action?: ToastActionElement;\n};\n\nconst actionTypes = {\n ADD_TOAST: \"ADD_TOAST\",\n UPDATE_TOAST: \"UPDATE_TOAST\",\n DISMISS_TOAST: \"DISMISS_TOAST\",\n REMOVE_TOAST: \"REMOVE_TOAST\",\n} as const;\n\nlet count = 0;\n\nfunction genId() {\n count = (count + 1) % Number.MAX_SAFE_INTEGER;\n return count.toString();\n}\n\ntype ActionType = typeof actionTypes;\n\ntype Action =\n | {\n type: ActionType[\"ADD_TOAST\"];\n toast: ToasterToast;\n }\n | {\n type: ActionType[\"UPDATE_TOAST\"];\n toast: Partial<ToasterToast>;\n }\n | {\n type: ActionType[\"DISMISS_TOAST\"];\n toastId?: ToasterToast[\"id\"];\n }\n | {\n type: ActionType[\"REMOVE_TOAST\"];\n toastId?: ToasterToast[\"id\"];\n };\n\ninterface State {\n toasts: ToasterToast[];\n}\n\nconst toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>();\n\nconst addToRemoveQueue = (toastId: string) => {\n if (toastTimeouts.has(toastId)) {\n return;\n }\n\n const timeout = setTimeout(() => {\n toastTimeouts.delete(toastId);\n dispatch({\n type: \"REMOVE_TOAST\",\n toastId: toastId,\n });\n }, TOAST_REMOVE_DELAY);\n\n toastTimeouts.set(toastId, timeout);\n};\n\nexport const reducer = (state: State, action: Action): State => {\n switch (action.type) {\n case \"ADD_TOAST\":\n return {\n ...state,\n toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),\n };\n\n case \"UPDATE_TOAST\":\n return {\n ...state,\n toasts: state.toasts.map((t) => (t.id === action.toast.id ? { ...t, ...action.toast } : t)),\n };\n\n case \"DISMISS_TOAST\": {\n const { toastId } = action;\n\n // ! Side effects ! - This could be extracted into a dismissToast() action,\n // but I'll keep it here for simplicity\n if (toastId) {\n addToRemoveQueue(toastId);\n } else {\n state.toasts.forEach((toast) => {\n addToRemoveQueue(toast.id);\n });\n }\n\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === toastId || toastId === undefined\n ? {\n ...t,\n open: false,\n }\n : t,\n ),\n };\n }\n case \"REMOVE_TOAST\":\n if (action.toastId === undefined) {\n return {\n ...state,\n toasts: [],\n };\n }\n return {\n ...state,\n toasts: state.toasts.filter((t) => t.id !== action.toastId),\n };\n }\n};\n\nconst listeners: Array<(state: State) => void> = [];\n\nlet memoryState: State = { toasts: [] };\n\nfunction dispatch(action: Action) {\n memoryState = reducer(memoryState, action);\n listeners.forEach((listener) => {\n listener(memoryState);\n });\n}\n\ntype Toast = Omit<ToasterToast, \"id\">;\n\nfunction toast({ ...props }: Toast) {\n const id = genId();\n\n const update = (props: ToasterToast) =>\n dispatch({\n type: \"UPDATE_TOAST\",\n toast: { ...props, id },\n });\n const dismiss = () => dispatch({ type: \"DISMISS_TOAST\", toastId: id });\n\n dispatch({\n type: \"ADD_TOAST\",\n toast: {\n ...props,\n id,\n open: true,\n onOpenChange: (open) => {\n if (!open) dismiss();\n },\n },\n });\n\n return {\n id: id,\n dismiss,\n update,\n };\n}\n\nfunction useToast() {\n const [state, setState] = React.useState(memoryState);\n\n React.useEffect(() => {\n listeners.push(setState);\n return () => {\n const index = listeners.indexOf(setState);\n if (index > -1) {\n listeners.splice(index, 1);\n }\n };\n }, []);\n\n return {\n ...state,\n toast,\n dismiss: (toastId?: string) => dispatch({ type: \"DISMISS_TOAST\", toastId }),\n };\n}\n\nexport { useToast, toast };\n","import { clsx } from \"clsx\";\nimport { type ClassValue } from \"clsx\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\n/**\n * 값을 배열로 정규화합니다.\n * 이미 배열이면 그대로 반환하고, 단일 값이면 배열로 감싸서 반환합니다.\n *\n * @param value - 정규화할 값 (단일 값 또는 배열)\n * @returns 배열로 정규화된 값 (undefined면 undefined 반환)\n *\n * @example\n * normalizeToArray(50) // [50]\n * normalizeToArray([20, 80]) // [20, 80]\n * normalizeToArray(undefined) // undefined\n */\nexport function normalizeToArray<T>(value: T | T[] | undefined): T[] | undefined {\n return value === undefined ? undefined : Array.isArray(value) ? value : [value];\n}\n\n/**\n * useObjectUrls 훅\n *\n * 로컬 File 객체 배열을 받아서 브라우저 메모리 기반 미리보기용 Object URL을 생성하고,\n * 컴포넌트가 언마운트되거나 파일이 변경될 때 자동으로 메모리를 해제합니다.\n *\n * **동작 방식**:\n * 1. File 배열을 받아서 각 파일마다 `URL.createObjectURL()`로 임시 URL 생성\n * 2. 생성된 URL은 `blob:http://...` 형태로, 브라우저 메모리를 직접 참조\n * 3. 컴포넌트 언마운트나 파일 변경 시 cleanup 함수가 `URL.revokeObjectURL()`로 메모리 해제\n *\n * @param files - 미리보기할 File 객체 배열\n * @returns 생성된 Object URL 문자열 배열\n */\nexport function useObjectUrls(files: File[]): string[] {\n const [urls, setUrls] = useState<string[]>([]);\n\n // File 객체의 내용 기반 서명 생성 (참조 비교가 아닌 값 비교)\n const signature = useMemo(\n () => files.map((f) => `${f.name}:${f.size}:${f.lastModified}`).join(\"|\"),\n [files],\n );\n\n useEffect(() => {\n // Object URL 생성\n const created = files.map((f) => URL.createObjectURL(f));\n setUrls(created);\n\n // Cleanup: 메모리 누수 방지를 위해 생성된 URL 해제\n return () => {\n for (const url of created) {\n URL.revokeObjectURL(url);\n }\n };\n }, [signature]);\n\n return urls;\n}\n","\"use client\";\n\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\";\nimport * as React from \"react\";\nimport ChevronDownIcon from \"~icons/lucide/chevron-down\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Accordion = AccordionPrimitive.Root;\n\nconst AccordionItem = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <AccordionPrimitive.Item ref={ref} className={cn(\"border-b\", className)} {...props} />\n));\nAccordionItem.displayName = \"AccordionItem\";\n\nconst AccordionTrigger = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronDownIcon className=\"h-4 w-4 shrink-0 transition-transform duration-200\" />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n));\nAccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;\n\nconst AccordionContent = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Content\n ref={ref}\n className=\"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down\"\n {...props}\n >\n <div className={cn(\"pb-4 pt-0\", className)}>{children}</div>\n </AccordionPrimitive.Content>\n));\n\nAccordionContent.displayName = AccordionPrimitive.Content.displayName;\n\nexport { Accordion, AccordionItem, AccordionTrigger, AccordionContent };\n","import { cva } from \"class-variance-authority\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst alertVariantsConfig = {\n variant: {\n default: \"bg-background text-foreground\",\n destructive:\n \"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive\",\n },\n} as const;\n\nconst alertVariants = cva(\n \"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground\",\n {\n variants: alertVariantsConfig,\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\nconst Alert = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>\n>(({ className, variant, ...props }, ref) => (\n <div ref={ref} role=\"alert\" className={cn(alertVariants({ variant }), className)} {...props} />\n));\nAlert.displayName = \"Alert\";\n\nconst AlertTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(\n ({ className, ...props }, ref) => (\n <h5\n ref={ref}\n className={cn(\"mb-1 font-medium leading-none tracking-tight\", className)}\n {...props}\n />\n ),\n);\nAlertTitle.displayName = \"AlertTitle\";\n\nconst AlertDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"text-sm [&_p]:leading-relaxed\", className)} {...props} />\n));\nAlertDescription.displayName = \"AlertDescription\";\n\nexport { Alert, alertVariantsConfig, AlertTitle, AlertDescription };\n","import { Slot } from \"@radix-ui/react-slot\";\nimport { cva } from \"class-variance-authority\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\nimport LoaderIcon from \"~icons/lucide/loader-2\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst buttonVariantsConfig = {\n variant: {\n // semantic variants (shadcn/ui 기본)\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n outline:\n \"border bg-background text-foreground hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50\",\n link: \"text-primary underline-offset-4 hover:underline\",\n\n // solid color variants\n red: \"bg-red-500 text-white hover:bg-red-600\",\n yellow: \"bg-yellow-500 text-white hover:bg-yellow-600\",\n green: \"bg-green-500 text-white hover:bg-green-600\",\n blue: \"bg-blue-500 text-white hover:bg-blue-600\",\n cyan: \"bg-cyan-500 text-white hover:bg-cyan-600\",\n purple: \"bg-purple-500 text-white hover:bg-purple-600\",\n pink: \"bg-pink-500 text-white hover:bg-pink-600\",\n orange: \"bg-orange-500 text-white hover:bg-orange-600\",\n },\n size: {\n // button sizes\n // - 아이콘만 있는 버튼: 정사각형 (px-0 aspect-square)\n // - 텍스트 / 아이콘 + 텍스트 버튼: 일반 패딩 유지 (가로 자동 확장)\n xs: \"h-6 px-2 py-1 text-xs [&_svg]:size-3 has-[>svg]:px-1.5 has-[>svg:only-child]:px-0 has-[>svg:only-child]:aspect-square\",\n sm: \"h-7 px-3 py-1.5 text-xs [&_svg]:size-3.5 has-[>svg]:px-2 has-[>svg:only-child]:px-0 has-[>svg:only-child]:aspect-square\",\n default:\n \"h-9 px-4 py-2 [&_svg]:size-4 has-[>svg]:px-3 has-[>svg:only-child]:px-0 has-[>svg:only-child]:aspect-square\",\n lg: \"h-11 px-6 py-3 text-base [&_svg]:size-5 has-[>svg]:px-4 has-[>svg:only-child]:px-0 has-[>svg:only-child]:aspect-square\",\n xl: \"h-13 px-8 py-4 text-lg [&_svg]:size-6 has-[>svg]:px-6 has-[>svg:only-child]:px-0 has-[>svg:only-child]:aspect-square\",\n },\n} as const;\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-button text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer\",\n {\n variants: buttonVariantsConfig,\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\ntype ButtonProps = React.ComponentProps<\"button\"> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean;\n icon?: React.ReactElement;\n loading?: boolean;\n };\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n { className, variant, size, icon, children, loading, disabled, asChild = false, ...props },\n ref,\n ) => {\n const Comp = asChild ? Slot : \"button\";\n\n const iconOnly = React.Children.count(children) === 0;\n\n const leadingIcon = loading ? <LoaderIcon className=\"animate-spin\" /> : icon;\n\n return (\n <Comp\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n disabled={disabled || loading}\n {...props}\n >\n {iconOnly ? (\n leadingIcon\n ) : leadingIcon ? (\n <span className=\"contents\">\n {leadingIcon}\n {children}\n </span>\n ) : (\n children\n )}\n </Comp>\n );\n },\n);\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants, buttonVariantsConfig, type ButtonProps };\n","import * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\nimport { buttonVariants } from \"./button\";\n\nconst AlertDialog = AlertDialogPrimitive.Root;\n\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger;\n\nconst AlertDialogPortal = AlertDialogPrimitive.Portal;\n\nconst AlertDialogOverlay = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Overlay\n className={cn(\n \"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className,\n )}\n {...props}\n ref={ref}\n />\n));\nAlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;\n\nconst AlertDialogContent = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <AlertDialogPortal>\n <AlertDialogOverlay />\n <AlertDialogPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg\",\n className,\n )}\n {...props}\n />\n </AlertDialogPortal>\n));\nAlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;\n\nconst AlertDialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn(\"flex flex-col space-y-2 text-center sm:text-left\", className)} {...props} />\n);\nAlertDialogHeader.displayName = \"AlertDialogHeader\";\n\nconst AlertDialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\", className)}\n {...props}\n />\n);\nAlertDialogFooter.displayName = \"AlertDialogFooter\";\n\nconst AlertDialogTitle = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold\", className)}\n {...props}\n />\n));\nAlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;\n\nconst AlertDialogDescription = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nAlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;\n\nconst AlertDialogAction = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Action>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Action ref={ref} className={cn(buttonVariants(), className)} {...props} />\n));\nAlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;\n\nconst AlertDialogCancel = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Cancel>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Cancel\n ref={ref}\n className={cn(buttonVariants({ variant: \"outline\" }), \"mt-2 sm:mt-0\", className)}\n {...props}\n />\n));\nAlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;\n\nexport {\n AlertDialog,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogTrigger,\n AlertDialogContent,\n AlertDialogHeader,\n AlertDialogFooter,\n AlertDialogTitle,\n AlertDialogDescription,\n AlertDialogAction,\n AlertDialogCancel,\n};\n","import * as AspectRatioPrimitive from \"@radix-ui/react-aspect-ratio\";\n\nconst AspectRatio = AspectRatioPrimitive.Root;\n\nexport { AspectRatio };\n","import * as AvatarPrimitive from \"@radix-ui/react-avatar\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Avatar = React.forwardRef<\n React.ComponentRef<typeof AvatarPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Root\n ref={ref}\n className={cn(\"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full\", className)}\n {...props}\n />\n));\nAvatar.displayName = AvatarPrimitive.Root.displayName;\n\nconst AvatarImage = React.forwardRef<\n React.ComponentRef<typeof AvatarPrimitive.Image>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Image\n ref={ref}\n className={cn(\"aspect-square h-full w-full\", className)}\n {...props}\n />\n));\nAvatarImage.displayName = AvatarPrimitive.Image.displayName;\n\nconst AvatarFallback = React.forwardRef<\n React.ComponentRef<typeof AvatarPrimitive.Fallback>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Fallback\n ref={ref}\n className={cn(\n \"flex h-full w-full items-center justify-center rounded-full bg-muted\",\n className,\n )}\n {...props}\n />\n));\nAvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;\n\nexport { Avatar, AvatarImage, AvatarFallback };\n","import { Slot } from \"@radix-ui/react-slot\";\nimport { cva } from \"class-variance-authority\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport type * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst badgeVariantsConfig = {\n variant: {\n default: \"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90\",\n secondary:\n \"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90\",\n destructive:\n \"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n outline: \"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground\",\n },\n} as const;\n\nconst badgeVariants = cva(\n \"inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden\",\n {\n variants: badgeVariantsConfig,\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\nfunction Badge({\n className,\n variant,\n asChild = false,\n ...props\n}: React.ComponentProps<\"span\"> & VariantProps<typeof badgeVariants> & { asChild?: boolean }) {\n const Comp = asChild ? Slot : \"span\";\n return (\n <Comp data-slot=\"badge\" className={cn(badgeVariants({ variant }), className)} {...props} />\n );\n}\n\nexport { Badge, badgeVariants, badgeVariantsConfig };\n","import { Slot } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\nimport ChevronRightIcon from \"~icons/lucide/chevron-right\";\nimport MoreHorizontalIcon from \"~icons/lucide/more-horizontal\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Breadcrumb = React.forwardRef<\n HTMLElement,\n React.ComponentPropsWithoutRef<\"nav\"> & {\n separator?: React.ReactNode;\n }\n>(({ ...props }, ref) => <nav ref={ref} aria-label=\"breadcrumb\" {...props} />);\nBreadcrumb.displayName = \"Breadcrumb\";\n\nconst BreadcrumbList = React.forwardRef<HTMLOListElement, React.ComponentPropsWithoutRef<\"ol\">>(\n ({ className, ...props }, ref) => (\n <ol\n ref={ref}\n className={cn(\n \"flex flex-wrap items-center gap-1.5 overflow-wrap-anywhere text-sm text-muted-foreground sm:gap-2.5\",\n className,\n )}\n {...props}\n />\n ),\n);\nBreadcrumbList.displayName = \"BreadcrumbList\";\n\nconst BreadcrumbItem = React.forwardRef<HTMLLIElement, React.ComponentPropsWithoutRef<\"li\">>(\n ({ className, ...props }, ref) => (\n <li ref={ref} className={cn(\"inline-flex items-center gap-1.5\", className)} {...props} />\n ),\n);\nBreadcrumbItem.displayName = \"BreadcrumbItem\";\n\nconst BreadcrumbLink = React.forwardRef<\n HTMLAnchorElement,\n React.ComponentPropsWithoutRef<\"a\"> & {\n asChild?: boolean;\n }\n>(({ asChild, className, ...props }, ref) => {\n const Comp = asChild ? Slot : \"a\";\n\n return (\n <Comp\n ref={ref}\n className={cn(\"transition-colors hover:text-foreground\", className)}\n {...props}\n />\n );\n});\nBreadcrumbLink.displayName = \"BreadcrumbLink\";\n\nconst BreadcrumbPage = React.forwardRef<HTMLSpanElement, React.ComponentPropsWithoutRef<\"span\">>(\n ({ className, ...props }, ref) => (\n <span\n ref={ref}\n role=\"link\"\n aria-disabled=\"true\"\n aria-current=\"page\"\n className={cn(\"font-normal text-foreground\", className)}\n {...props}\n />\n ),\n);\nBreadcrumbPage.displayName = \"BreadcrumbPage\";\n\nconst BreadcrumbSeparator = ({ children, className, ...props }: React.ComponentProps<\"li\">) => (\n <li\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"[&>svg]:w-3.5 [&>svg]:h-3.5\", className)}\n {...props}\n >\n {children ?? <ChevronRightIcon />}\n </li>\n);\nBreadcrumbSeparator.displayName = \"BreadcrumbSeparator\";\n\nconst BreadcrumbEllipsis = ({ className, ...props }: React.ComponentProps<\"span\">) => (\n <span\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"flex h-9 w-9 items-center justify-center\", className)}\n {...props}\n >\n <MoreHorizontalIcon className=\"h-4 w-4\" />\n <span className=\"sr-only\">More</span>\n </span>\n);\nBreadcrumbEllipsis.displayName = \"BreadcrumbElipssis\";\n\nexport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbPage,\n BreadcrumbSeparator,\n BreadcrumbEllipsis,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport { DayPicker } from \"react-day-picker\";\nimport { type DateRange } from \"react-day-picker\";\nimport ChevronLeftIcon from \"~icons/lucide/chevron-left\";\nimport ChevronRightIcon from \"~icons/lucide/chevron-right\";\n\nimport { cn } from \"../../lib/utils\";\nimport { buttonVariants } from \"./button\";\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n ...props\n}: React.ComponentProps<typeof DayPicker>) {\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\"p-3\", className)}\n classNames={{\n months: \"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0\",\n month: \"space-y-4\",\n caption: \"flex justify-center pt-1 relative items-center w-full\",\n caption_label: \"text-sm font-medium\",\n nav: \"space-x-1 flex items-center\",\n nav_button: cn(\n buttonVariants({ variant: \"outline\" }),\n \"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100\",\n ),\n nav_button_previous: \"absolute left-1\",\n nav_button_next: \"absolute right-1\",\n table: \"w-full border-collapse space-y-1\",\n head_row: \"flex\",\n head_cell: \"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]\",\n row: \"flex w-full mt-2\",\n cell: cn(\n \"h-9 w-9 text-center text-sm p-0 relative focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent/10\",\n props.mode === \"range\"\n ? \"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md\"\n : \"[&:has([aria-selected])]:rounded-md\",\n ),\n day: cn(\n buttonVariants({ variant: \"ghost\" }),\n \"h-9 w-9 p-0 font-normal aria-selected:opacity-100\",\n ),\n day_range_start: \"day-range-start\",\n day_range_end: \"day-range-end\",\n day_selected:\n \"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground\",\n day_today: \"bg-accent/10 text-foreground\",\n day_outside:\n \"day-outside text-muted-foreground opacity-50 aria-selected:bg-transparent aria-selected:opacity-100 aria-selected:text-foreground\",\n day_disabled: \"text-muted-foreground opacity-50\",\n day_range_middle: \"aria-selected:bg-transparent aria-selected:text-foreground\",\n day_hidden: \"invisible\",\n ...classNames,\n }}\n components={{\n IconLeft: () => <ChevronLeftIcon className=\"h-4 w-4\" />,\n IconRight: () => <ChevronRightIcon className=\"h-4 w-4\" />,\n }}\n {...props}\n />\n );\n}\n\nexport { Calendar };\nexport type { DateRange };\n","import type * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nfunction Card({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card\"\n className={cn(\n \"bg-card text-card-foreground flex flex-col gap-6 rounded-card border\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CardHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n \"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 pt-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CardTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return <h4 data-slot=\"card-title\" className={cn(\"leading-none\", className)} {...props} />;\n}\n\nfunction CardDescription({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <p data-slot=\"card-description\" className={cn(\"text-muted-foreground\", className)} {...props} />\n );\n}\n\nfunction CardAction({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-action\"\n className={cn(\"col-start-2 row-span-2 row-start-1 self-start justify-self-end\", className)}\n {...props}\n />\n );\n}\n\nfunction CardContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div data-slot=\"card-content\" className={cn(\"px-6 last:pb-6\", className)} {...props} />;\n}\n\nfunction CardFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-footer\"\n className={cn(\"flex items-center px-6 pb-6 [.border-t]:pt-6\", className)}\n {...props}\n />\n );\n}\n\nexport { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };\n","\"use client\";\n\nimport useEmblaCarousel from \"embla-carousel-react\";\nimport { type UseEmblaCarouselType } from \"embla-carousel-react\";\nimport * as React from \"react\";\nimport ArrowLeftIcon from \"~icons/lucide/arrow-left\";\nimport ArrowRightIcon from \"~icons/lucide/arrow-right\";\n\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"./button\";\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ntype CarouselProps = {\n opts?: CarouselOptions;\n plugins?: CarouselPlugin;\n orientation?: \"horizontal\" | \"vertical\";\n setApi?: (api: CarouselApi) => void;\n};\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: ReturnType<typeof useEmblaCarousel>[1];\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n} & CarouselProps;\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null);\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext);\n\n if (!context) {\n throw new Error(\"useCarousel must be used within a <Carousel />\");\n }\n\n return context;\n}\n\nconst Carousel = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & CarouselProps\n>(({ orientation = \"horizontal\", opts, setApi, plugins, className, children, ...props }, ref) => {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === \"horizontal\" ? \"x\" : \"y\",\n },\n plugins,\n );\n const [canScrollPrev, setCanScrollPrev] = React.useState(false);\n const [canScrollNext, setCanScrollNext] = React.useState(false);\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) {\n return;\n }\n\n setCanScrollPrev(api.canScrollPrev());\n setCanScrollNext(api.canScrollNext());\n }, []);\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext();\n }, [api]);\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === \"ArrowRight\") {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext],\n );\n\n React.useEffect(() => {\n if (!api || !setApi) {\n return;\n }\n\n setApi(api);\n }, [api, setApi]);\n\n React.useEffect(() => {\n if (!api) {\n return;\n }\n\n onSelect(api);\n api.on(\"reInit\", onSelect);\n api.on(\"select\", onSelect);\n\n return () => {\n api?.off(\"select\", onSelect);\n };\n }, [api, onSelect]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation: orientation || (opts?.axis === \"y\" ? \"vertical\" : \"horizontal\"),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <div\n ref={ref}\n onKeyDownCapture={handleKeyDown}\n className={cn(\"relative\", className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n});\nCarousel.displayName = \"Carousel\";\n\nconst CarouselContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const { carouselRef, orientation } = useCarousel();\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\">\n <div\n ref={ref}\n className={cn(\n \"flex\",\n orientation === \"horizontal\" ? \"-ml-4\" : \"-mt-4 flex-col\",\n className,\n )}\n {...props}\n />\n </div>\n );\n },\n);\nCarouselContent.displayName = \"CarouselContent\";\n\nconst CarouselItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const { orientation } = useCarousel();\n\n return (\n <div\n ref={ref}\n role=\"group\"\n aria-roledescription=\"slide\"\n className={cn(\n \"min-w-0 shrink-0 grow-0 basis-full\",\n orientation === \"horizontal\" ? \"pl-4\" : \"pt-4\",\n className,\n )}\n {...props}\n />\n );\n },\n);\nCarouselItem.displayName = \"CarouselItem\";\n\nconst CarouselPrevious = React.forwardRef<HTMLButtonElement, React.ComponentProps<typeof Button>>(\n ({ className, variant = \"outline\", size = \"default\", ...props }, ref) => {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n\n return (\n <Button\n ref={ref}\n variant={variant}\n size={size}\n className={cn(\n \"absolute h-8 w-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"-left-12 top-1/2 -translate-y-1/2\"\n : \"-top-12 left-1/2 -translate-x-1/2 rotate-90\",\n className,\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <ArrowLeftIcon className=\"h-4 w-4\" />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n );\n },\n);\nCarouselPrevious.displayName = \"CarouselPrevious\";\n\nconst CarouselNext = React.forwardRef<HTMLButtonElement, React.ComponentProps<typeof Button>>(\n ({ className, variant = \"outline\", size = \"default\", ...props }, ref) => {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n\n return (\n <Button\n ref={ref}\n variant={variant}\n size={size}\n className={cn(\n \"absolute h-8 w-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"-right-12 top-1/2 -translate-y-1/2\"\n : \"-bottom-12 left-1/2 -translate-x-1/2 rotate-90\",\n className,\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <ArrowRightIcon className=\"h-4 w-4\" />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n );\n },\n);\nCarouselNext.displayName = \"CarouselNext\";\n\nexport {\n type CarouselApi,\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselPrevious,\n CarouselNext,\n};\n","\"use client\";\n\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport * as React from \"react\";\nimport CheckIcon from \"~icons/lucide/check\";\n\nimport { type Override } from \"../../lib/types\";\nimport { cn } from \"../../lib/utils\";\n\ntype CheckboxProps = Override<\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>,\n {\n name?: string;\n value?: boolean;\n onValueChange?: (checked: boolean) => void;\n onBlur?: React.FocusEventHandler<HTMLInputElement>;\n label?: React.ReactNode;\n labelClassName?: string;\n }\n>;\n\nconst Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(\n (\n {\n className,\n name,\n checked,\n value,\n defaultChecked,\n onValueChange,\n onBlur,\n label,\n labelClassName,\n disabled,\n ...props\n },\n ref,\n ) => {\n // value prop이 있으면 checked보다 우선 (useTypeForm 호환)\n const effectiveChecked = value !== undefined ? value : checked;\n const inputRef = React.useRef<HTMLInputElement>(null);\n const checkboxRef = React.useRef<HTMLButtonElement>(null);\n const labelId = React.useId();\n\n // oxlint-disable-next-line @typescript-eslint/no-non-null-assertion -- useImperativeHandle은 ref가 할당된 후 실행되므로 안전함\n React.useImperativeHandle(ref, () => inputRef.current!);\n\n const handleCheckedChange = (newChecked: boolean | \"indeterminate\") => {\n const boolValue = newChecked === \"indeterminate\" ? false : newChecked;\n onValueChange?.(boolValue);\n };\n\n const handleLabelClick = (e: React.MouseEvent) => {\n e.preventDefault();\n if (disabled) return;\n checkboxRef.current?.click();\n };\n\n const checkboxElement = (\n <>\n <input\n type=\"checkbox\"\n ref={inputRef}\n name={name}\n defaultChecked={defaultChecked === true}\n onBlur={onBlur}\n className=\"sr-only\"\n tabIndex={-1}\n aria-hidden=\"true\"\n />\n <CheckboxPrimitive.Root\n ref={checkboxRef}\n data-slot=\"checkbox\"\n checked={effectiveChecked}\n defaultChecked={defaultChecked}\n onCheckedChange={handleCheckedChange}\n disabled={disabled}\n aria-labelledby={label ? labelId : undefined}\n className={cn(\n \"peer border border-muted-foreground/30 bg-input-background dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"flex items-center justify-center text-current transition-none\"\n >\n <CheckIcon className=\"size-3.5\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n </>\n );\n\n if (label) {\n return (\n <div className=\"flex items-center gap-2\">\n {checkboxElement}\n <label\n id={labelId}\n className={cn(\n \"text-sm cursor-pointer select-none\",\n disabled && \"cursor-not-allowed opacity-50\",\n labelClassName,\n )}\n onClick={handleLabelClick}\n >\n {label}\n </label>\n </div>\n );\n }\n\n return checkboxElement;\n },\n);\n\nCheckbox.displayName = \"Checkbox\";\n\nexport { Checkbox };\n","import * as CollapsiblePrimitive from \"@radix-ui/react-collapsible\";\n\nconst Collapsible = CollapsiblePrimitive.Root;\n\nconst CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;\n\nconst CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;\n\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent };\n","/**\n * React Components i18n Keys\n *\n * react-components의 i18n 키를 관리하는 Single Source of Truth\n *\n */\nexport const rcKeysKo = {\n // AsyncSelect Component\n \"rc.asyncSelect.loading\": \"로딩 중...\",\n \"rc.asyncSelect.noOptions\": \"옵션이 없습니다\",\n \"rc.asyncSelect.noResults\": \"검색 결과가 없습니다\",\n \"rc.asyncSelect.selectPlaceholder\": \"선택하세요...\",\n\n // Combobox Component\n \"rc.combobox.noResults\": \"검색 결과가 없습니다\",\n \"rc.combobox.selectPlaceholder\": \"선택하세요...\",\n\n // DatePicker Component\n \"rc.datePicker.pickDate\": \"날짜 선택\",\n \"rc.datePicker.placeholder\": \"날짜 선택\",\n \"rc.datePicker.selectDate\": \"날짜 선택\",\n\n // DateSelectorMultiple Component\n \"rc.dateSelectorMultiple.addDate\": \"날짜 추가\",\n \"rc.dateSelectorMultiple.dateRange\": \"기간\",\n \"rc.dateSelectorMultiple.placeholder\": \"날짜 선택\",\n \"rc.dateSelectorMultiple.singleDate\": \"단일\",\n\n // FileInput Component\n \"rc.fileInput.browseFiles\": \"파일 찾기\",\n \"rc.fileInput.dropZone\": \"파일을 드래그하거나 클릭하여 업로드\",\n \"rc.fileInput.filePlaceholder\": \"파일\",\n \"rc.fileInput.imagePlaceholder\": \"이미지\",\n \"rc.fileInput.maxFilesExceeded\": (maxFiles: number) =>\n `최대 ${maxFiles}개 파일만 업로드 가능합니다`,\n \"rc.fileInput.pending\": \"대기 중\",\n \"rc.fileInput.remove\": \"제거\",\n \"rc.fileInput.uploadFailed\": \"업로드 실패\",\n \"rc.fileInput.uploading\": \"업로드 중...\",\n\n // MonthPickerMultiple Component\n \"rc.monthPickerMultiple.addMonth\": \"월 추가\",\n \"rc.monthPickerMultiple.dateRange\": \"기간\",\n \"rc.monthPickerMultiple.endDate\": \"종료일\",\n \"rc.monthPickerMultiple.placeholder\": \"월 선택\",\n \"rc.monthPickerMultiple.singleDate\": \"단일\",\n \"rc.monthPickerMultiple.startDate\": \"시작일\",\n\n // MultiSelect Component\n \"rc.multiSelect.clear\": \"전체 해제\",\n \"rc.multiSelect.close\": \"닫기\",\n \"rc.multiSelect.moreItems\": (count: number) => `+${count}개 더보기`,\n \"rc.multiSelect.noOptions\": \"옵션이 없습니다\",\n \"rc.multiSelect.noOptionsSelected\": \"선택된 옵션이 없습니다\",\n \"rc.multiSelect.noResults\": \"검색 결과가 없습니다\",\n \"rc.multiSelect.optionsCount\": (count: number) => `${count}개 옵션`,\n \"rc.multiSelect.selectAll\": \"전체 선택\",\n \"rc.multiSelect.selectPlaceholder\": \"선택하세요...\",\n\n // Pagination Component\n \"rc.pagination.next\": \"다음\",\n \"rc.pagination.previous\": \"이전\",\n \"rc.pagination.showing\": (start: number, end: number, total: number) =>\n `${total}개 중 ${start}-${end}`,\n\n // Calendar Component\n \"rc.calendar.month.0\": \"1월\",\n \"rc.calendar.month.1\": \"2월\",\n \"rc.calendar.month.2\": \"3월\",\n \"rc.calendar.month.3\": \"4월\",\n \"rc.calendar.month.4\": \"5월\",\n \"rc.calendar.month.5\": \"6월\",\n \"rc.calendar.month.6\": \"7월\",\n \"rc.calendar.month.7\": \"8월\",\n \"rc.calendar.month.8\": \"9월\",\n \"rc.calendar.month.9\": \"10월\",\n \"rc.calendar.month.10\": \"11월\",\n \"rc.calendar.month.11\": \"12월\",\n\n // Sonamu Filter Component\n \"rc.sonamuFilter.title\": \"소나무 필터\",\n \"rc.sonamuFilter.apply\": \"적용\",\n \"rc.sonamuFilter.reset\": \"초기화\",\n \"rc.sonamuFilter.addRule\": \"규칙 추가\",\n \"rc.sonamuFilter.noRulesYet\": '아직 규칙이 없습니다. \"+ 규칙 추가\"를 클릭하여 시작하세요.',\n \"rc.sonamuFilter.selectField\": \"필드 선택\",\n \"rc.sonamuFilter.selectOperator\": \"연산자 선택\",\n \"rc.sonamuFilter.selectOperatorFirst\": \"먼저 연산자를 선택하세요\",\n \"rc.sonamuFilter.enterValue\": \"값 입력\",\n \"rc.sonamuFilter.enterNumber\": \"숫자 입력\",\n \"rc.sonamuFilter.notSupported\": \"지원하지 않음\",\n \"rc.sonamuFilter.startDate\": \"시작일\",\n \"rc.sonamuFilter.endDate\": \"종료일\",\n \"rc.sonamuFilter.appliedFilters\": \"🌲 적용된 소나무 필터\",\n\n // Common\n \"rc.common.cancel\": \"취소\",\n \"rc.common.save\": \"저장\",\n};\n\nexport type RCKeys = typeof rcKeysKo;\nexport type RCKeyName = keyof RCKeys;\n\nexport const rcKeysEn = {\n // AsyncSelect Component\n \"rc.asyncSelect.loading\": \"Loading...\",\n \"rc.asyncSelect.noOptions\": \"No options\",\n \"rc.asyncSelect.noResults\": \"No results\",\n \"rc.asyncSelect.selectPlaceholder\": \"Select...\",\n\n // Combobox Component\n \"rc.combobox.noResults\": \"No results\",\n \"rc.combobox.selectPlaceholder\": \"Select...\",\n\n // DatePicker Component\n \"rc.datePicker.pickDate\": \"Pick date\",\n \"rc.datePicker.placeholder\": \"Pick date\",\n \"rc.datePicker.selectDate\": \"Select date\",\n\n // DateSelectorMultiple Component\n \"rc.dateSelectorMultiple.addDate\": \"Add date\",\n \"rc.dateSelectorMultiple.dateRange\": \"Range\",\n \"rc.dateSelectorMultiple.placeholder\": \"Pick date\",\n \"rc.dateSelectorMultiple.singleDate\": \"Single\",\n\n // FileInput Component\n \"rc.fileInput.browseFiles\": \"Browse files\",\n \"rc.fileInput.dropZone\": \"Drag files here or click to upload\",\n \"rc.fileInput.filePlaceholder\": \"File\",\n \"rc.fileInput.imagePlaceholder\": \"Image\",\n \"rc.fileInput.maxFilesExceeded\": (maxFiles: number) => `Maximum ${maxFiles} files allowed`,\n \"rc.fileInput.pending\": \"Pending\",\n \"rc.fileInput.remove\": \"Remove\",\n \"rc.fileInput.uploadFailed\": \"Upload failed\",\n \"rc.fileInput.uploading\": \"Uploading...\",\n\n // MonthPickerMultiple Component\n \"rc.monthPickerMultiple.addMonth\": \"Add month\",\n \"rc.monthPickerMultiple.dateRange\": \"Range\",\n \"rc.monthPickerMultiple.endDate\": \"End date\",\n \"rc.monthPickerMultiple.placeholder\": \"Pick month\",\n \"rc.monthPickerMultiple.singleDate\": \"Single\",\n \"rc.monthPickerMultiple.startDate\": \"Start date\",\n\n // MultiSelect Component\n \"rc.multiSelect.clear\": \"Clear all\",\n \"rc.multiSelect.close\": \"Close\",\n \"rc.multiSelect.moreItems\": (count: number) => `+${count} more`,\n \"rc.multiSelect.noOptions\": \"No options\",\n \"rc.multiSelect.noOptionsSelected\": \"No options selected\",\n \"rc.multiSelect.noResults\": \"No results\",\n \"rc.multiSelect.optionsCount\": (count: number) => `${count} options`,\n \"rc.multiSelect.selectAll\": \"Select all\",\n \"rc.multiSelect.selectPlaceholder\": \"Select...\",\n\n // Pagination Component\n \"rc.pagination.next\": \"Next\",\n \"rc.pagination.previous\": \"Previous\",\n \"rc.pagination.showing\": (start: number, end: number, total: number) =>\n `Showing ${start}-${end} of ${total}`,\n\n // Calendar Component\n \"rc.calendar.month.0\": \"January\",\n \"rc.calendar.month.1\": \"February\",\n \"rc.calendar.month.2\": \"March\",\n \"rc.calendar.month.3\": \"April\",\n \"rc.calendar.month.4\": \"May\",\n \"rc.calendar.month.5\": \"June\",\n \"rc.calendar.month.6\": \"July\",\n \"rc.calendar.month.7\": \"August\",\n \"rc.calendar.month.8\": \"September\",\n \"rc.calendar.month.9\": \"October\",\n \"rc.calendar.month.10\": \"November\",\n \"rc.calendar.month.11\": \"December\",\n\n // Sonamu Filter Component\n \"rc.sonamuFilter.title\": \"Sonamu Filter\",\n \"rc.sonamuFilter.apply\": \"Apply\",\n \"rc.sonamuFilter.reset\": \"Reset\",\n \"rc.sonamuFilter.addRule\": \"Add Rule\",\n \"rc.sonamuFilter.noRulesYet\": 'No rules yet. Click \"+ Add Rule\" to start.',\n \"rc.sonamuFilter.selectField\": \"Select field\",\n \"rc.sonamuFilter.selectOperator\": \"Operator\",\n \"rc.sonamuFilter.selectOperatorFirst\": \"Select operator first\",\n \"rc.sonamuFilter.enterValue\": \"Enter value\",\n \"rc.sonamuFilter.enterNumber\": \"Enter number\",\n \"rc.sonamuFilter.notSupported\": \"Not supported\",\n \"rc.sonamuFilter.startDate\": \"Start date\",\n \"rc.sonamuFilter.endDate\": \"End date\",\n \"rc.sonamuFilter.appliedFilters\": \"🌲 Applied SonamuFilters\",\n\n // Common\n \"rc.common.cancel\": \"Cancel\",\n \"rc.common.save\": \"Save\",\n} satisfies RCKeys;\n","/* oxlint-disable @typescript-eslint/no-explicit-any */ // 제네릭 기본값으로 any 사용\n\nimport { type BetterAuthClientOptions } from \"better-auth/client\";\nimport { createAuthClient } from \"better-auth/react\";\nimport { createContext, useContext, useRef } from \"react\";\nimport { type ReactNode } from \"react\";\n\nimport { rcKeysEn } from \"../i18n/rc-keys\";\nimport { type RCKeyName, type RCKeys } from \"../i18n/rc-keys\";\nimport { type Dictionary, type SDReturnType, type SonamuFile } from \"./types\";\n\n/** createAuthClient의 반환 타입을 옵션으로부터 추론하는 유틸리티 타입 */\nexport type SonamuAuthClient<O extends BetterAuthClientOptions> = ReturnType<\n typeof createAuthClient<O>\n>;\n\nexport interface SonamuContextValue<\n D extends Dictionary = Dictionary,\n O extends BetterAuthClientOptions = BetterAuthClientOptions,\n> {\n uploader?: (files: File[]) => Promise<SonamuFile[]>;\n auth?: SonamuAuthClient<O>;\n SD?: <K extends keyof D>(key: K) => SDReturnType<D, K>;\n}\n\nexport interface SonamuProviderProps<\n D extends Dictionary = Dictionary,\n O extends BetterAuthClientOptions = BetterAuthClientOptions,\n> extends SonamuContextValue<D, O> {\n children: ReactNode;\n authOptions?: O;\n}\n\nconst SONAMU_CONTEXT_ERROR_MESSAGE = (key: string) =>\n `[SonamuProvider] ${key} is not configured. Please provide ${key} configuration to SonamuProvider.`;\n\nconst createUploaderFallback = () => {\n return () => {\n throw new Error(SONAMU_CONTEXT_ERROR_MESSAGE(\"uploader\"));\n };\n};\n\nconst createSDFallback = <D extends Dictionary = RCKeys>() => {\n return <K extends keyof D>(key: K): SDReturnType<D, K> => {\n const value = rcKeysEn[key as unknown as RCKeyName];\n return value as unknown as SDReturnType<D, K>;\n };\n};\n\nconst SonamuContext = createContext({} as SonamuContextValue);\n\nexport function SonamuProvider<\n D extends Dictionary = Dictionary,\n O extends BetterAuthClientOptions = BetterAuthClientOptions,\n>({ children, authOptions, ...value }: SonamuProviderProps<D, O>) {\n const authRef = useRef<SonamuAuthClient<O> | undefined>(undefined);\n if (authOptions && !authRef.current) {\n authRef.current = createAuthClient(authOptions);\n }\n\n const normalizedValue: SonamuContextValue<D, O> = {\n uploader: value.uploader ?? createUploaderFallback(),\n auth: value.auth ?? authRef.current,\n SD: value.SD ?? createSDFallback<D>(),\n };\n\n return <SonamuContext.Provider value={normalizedValue}>{children}</SonamuContext.Provider>;\n}\n\n/**\n * 타입이 지정된 useSonamuContext를 만들기 위한 베이스 훅\n *\n * @example\n * // contexts/sonamu-provider.tsx\n * export function useSonamuContext() {\n * return useSonamuBaseContext<MergedDictionary>();\n * }\n */\nexport function useSonamuBaseContext<\n D extends Dictionary = Dictionary,\n O extends BetterAuthClientOptions = BetterAuthClientOptions,\n>(): Required<SonamuContextValue<D, O>> {\n return useContext(SonamuContext) as unknown as Required<SonamuContextValue<D, O>>;\n}\n","\"use client\";\n\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport * as React from \"react\";\nimport XIcon from \"~icons/lucide/x\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Dialog = DialogPrimitive.Root;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = DialogPrimitive.Portal;\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n \"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className,\n )}\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nconst DialogContent = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg\",\n className,\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close className=\"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground\">\n <XIcon className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn(\"flex flex-col space-y-1.5 text-center sm:text-left\", className)} {...props} />\n);\nDialogHeader.displayName = \"DialogHeader\";\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\", className)}\n {...props}\n />\n);\nDialogFooter.displayName = \"DialogFooter\";\n\nconst DialogTitle = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n};\n","\"use client\";\n\nimport { type DialogProps } from \"@radix-ui/react-dialog\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport * as React from \"react\";\nimport SearchIcon from \"~icons/lucide/search\";\n\nimport { cn } from \"../../lib/utils\";\nimport { Dialog, DialogContent } from \"./dialog\";\n\nconst Command = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n \"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground\",\n className,\n )}\n {...props}\n />\n));\nCommand.displayName = CommandPrimitive.displayName;\n\ntype CommandDialogProps = DialogProps & {\n commandProps?: React.ComponentPropsWithoutRef<typeof CommandPrimitive>;\n};\n\nconst CommandDialog = ({ children, commandProps, ...props }: CommandDialogProps) => {\n const { className: commandClassName, ...restCommandProps } = commandProps ?? {};\n return (\n <Dialog {...props}>\n <DialogContent className=\"overflow-hidden p-0 shadow-lg\">\n <Command\n className={cn(\n \"**:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 **:[[cmdk-group]]:px-2 **:[[cmdk-input-wrapper]_svg]:size-5 **:[[cmdk-input]]:h-12 **:[[cmdk-item]]:px-2 **:[[cmdk-item]]:py-3 **:[[cmdk-item]_svg]:size-5\",\n commandClassName,\n )}\n {...restCommandProps}\n >\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n};\n\nconst CommandInput = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Input>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>\n>(({ className, ...props }, ref) => (\n <div className=\"flex items-center border-b px-3\" cmdk-input-wrapper=\"\">\n <SearchIcon className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n \"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n />\n </div>\n));\n\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\nconst CommandList = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\"max-h-[300px] overflow-y-auto overflow-x-hidden\", className)}\n {...props}\n />\n));\n\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nconst CommandEmpty = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => (\n <CommandPrimitive.Empty ref={ref} className=\"py-6 text-center text-sm\" {...props} />\n));\n\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nconst CommandGroup = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n \"overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground\",\n className,\n )}\n {...props}\n />\n));\n\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nconst CommandSeparator = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 h-px bg-border\", className)}\n {...props}\n />\n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\nconst CommandItem = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 **:[svg]:pointer-events-none **:[svg]:size-4 **:[svg]:shrink-0\",\n className,\n )}\n {...props}\n />\n));\n\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nconst CommandShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\"ml-auto text-xs tracking-widest text-muted-foreground\", className)}\n {...props}\n />\n );\n};\nCommandShortcut.displayName = \"CommandShortcut\";\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n};\n","\"use client\";\n\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport type * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nfunction Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>) {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />;\n}\n\nfunction PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {\n return <PopoverPrimitive.Trigger data-slot=\"popover-trigger\" {...props} />;\n}\n\nfunction PopoverContent({\n className,\n align = \"center\",\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Content>) {\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n data-slot=\"popover-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden\",\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n );\n}\n\nfunction PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {\n return <PopoverPrimitive.Anchor data-slot=\"popover-anchor\" {...props} />;\n}\n\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };\n","\"use client\";\n\nimport * as React from \"react\";\nimport CheckIcon from \"~icons/lucide/check\";\nimport ChevronsUpDownIcon from \"~icons/lucide/chevrons-up-down\";\nimport XCircleIcon from \"~icons/lucide/x-circle\";\n\nimport { useSonamuBaseContext } from \"@/contexts\";\n\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"./button\";\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from \"./command\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\";\n\nexport interface ComboboxOption {\n value: string;\n label: string;\n}\n\ninterface ComboboxProps {\n options: ComboboxOption[];\n name?: string;\n value?: string;\n onValueChange?: (value: string | undefined) => void;\n onBlur?: React.FocusEventHandler<HTMLInputElement>;\n placeholder?: string;\n searchPlaceholder?: string;\n emptyText?: string;\n disabled?: boolean;\n className?: string;\n clearable?: boolean;\n}\n\nconst Combobox = React.forwardRef<HTMLInputElement, ComboboxProps>(\n (\n {\n options,\n name,\n value,\n onValueChange,\n onBlur,\n placeholder,\n searchPlaceholder,\n emptyText,\n disabled = false,\n className,\n clearable = false,\n },\n ref,\n ) => {\n const { SD } = useSonamuBaseContext();\n const [open, setOpen] = React.useState(false);\n const inputRef = React.useRef<HTMLInputElement>(null);\n\n // SD 기본값 설정\n const finalPlaceholder = placeholder ?? SD(\"rc.combobox.selectPlaceholder\");\n const finalSearchPlaceholder = searchPlaceholder ?? SD(\"common.searchPlaceholder\");\n const finalEmptyText = emptyText ?? SD(\"rc.combobox.noResults\");\n\n // oxlint-disable-next-line @typescript-eslint/no-non-null-assertion -- useImperativeHandle은 ref가 할당된 후 실행되므로 안전함\n React.useImperativeHandle(ref, () => inputRef.current!);\n\n const handleSelect = (currentValue: string) => {\n const newValue = currentValue === value ? \"\" : currentValue;\n onValueChange?.(newValue || undefined);\n setOpen(false);\n };\n\n const handleClear = (e: React.MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n onValueChange?.(undefined);\n setOpen(false);\n };\n\n const hasValue = Boolean(value);\n\n return (\n <>\n <input type=\"hidden\" ref={inputRef} name={name} value={value || \"\"} onBlur={onBlur} />\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n role=\"combobox\"\n aria-expanded={open}\n disabled={disabled}\n className={cn(\"w-full justify-between\", className)}\n >\n <span className=\"flex-1 truncate text-left\">\n {value ? options.find((option) => option.value === value)?.label : finalPlaceholder}\n </span>\n <div className=\"flex items-center gap-1 shrink-0 pl-2\">\n {clearable && hasValue && (\n <span\n className=\"flex items-center justify-center\"\n onMouseDown={(e) => e.stopPropagation()}\n onClick={handleClear}\n >\n <XCircleIcon className=\"h-4 w-4 cursor-pointer opacity-50 hover:opacity-100 transition-opacity\" />\n </span>\n )}\n <ChevronsUpDownIcon className=\"h-4 w-4 opacity-50\" />\n </div>\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-full p-0\">\n <Command>\n <CommandInput placeholder={finalSearchPlaceholder} className=\"h-9\" />\n <CommandList>\n <CommandEmpty>{finalEmptyText}</CommandEmpty>\n <CommandGroup>\n {options.map((option) => (\n <CommandItem key={option.value} value={option.value} onSelect={handleSelect}>\n {option.label}\n <CheckIcon\n className={cn(\n \"ml-auto\",\n value === option.value ? \"opacity-100\" : \"opacity-0\",\n )}\n />\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n </>\n );\n },\n);\n\nCombobox.displayName = \"Combobox\";\n\nexport { Combobox };\n","\"use client\";\n\nimport { atom, useAtom } from \"jotai\";\nimport type * as React from \"react\";\nimport { useEffect } from \"react\";\n\nimport { cn } from \"../../lib/utils\";\nimport { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from \"./dialog\";\n\ntype ExtendedModalProps = {\n title?: string;\n description?: string;\n className?: string;\n onCompleted?: (data?: unknown) => void;\n onControlledOpen?: () => void;\n onControlledClose?: () => void;\n};\n\nexport const commonModalAtom = atom<\n {\n open: boolean;\n reactNode: React.ReactNode | null;\n } & ExtendedModalProps\n>({\n open: false,\n reactNode: null,\n});\n\ntype CommonModalProps = {\n className?: string;\n};\n\nexport function CommonModal({ className }: CommonModalProps) {\n const [atomValue, setAtomValue] = useAtom(commonModalAtom);\n const {\n open,\n reactNode,\n title,\n description,\n className: modalClassName,\n onControlledOpen,\n onControlledClose,\n } = atomValue;\n\n const closeAndClear = () => {\n if (onControlledClose) {\n onControlledClose();\n }\n setAtomValue({\n open: false,\n reactNode: null,\n });\n };\n\n useEffect(() => {\n if (open && onControlledOpen) {\n onControlledOpen();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open]);\n\n return (\n <Dialog\n open={open}\n onOpenChange={(isOpen) => {\n if (!isOpen) {\n closeAndClear();\n }\n }}\n >\n <DialogContent className={cn(\"max-w-4xl\", modalClassName, className)}>\n <DialogHeader>\n <DialogTitle className={!title ? \"sr-only\" : undefined}>{title || \"Modal\"}</DialogTitle>\n <DialogDescription className={!description ? \"sr-only\" : undefined}>\n {description || \"Modal content\"}\n </DialogDescription>\n </DialogHeader>\n {reactNode}\n </DialogContent>\n </Dialog>\n );\n}\n\nexport function useCommonModal() {\n const [atomValue, setAtomValue] = useAtom(commonModalAtom);\n const { open, reactNode, onCompleted } = atomValue;\n\n const openModal = (reactNode: React.ReactNode, props?: ExtendedModalProps) => {\n setAtomValue({\n open: true,\n reactNode,\n ...props,\n });\n };\n\n const closeModal = () => {\n setAtomValue({\n open: false,\n reactNode: null,\n });\n };\n\n const doneModal = (data?: unknown) => {\n closeModal();\n if (onCompleted) {\n onCompleted(data);\n }\n };\n\n return {\n open,\n reactNode,\n openModal,\n closeModal,\n doneModal,\n };\n}\n","import * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\";\nimport * as React from \"react\";\nimport CheckIcon from \"~icons/lucide/check\";\nimport ChevronRightIcon from \"~icons/lucide/chevron-right\";\nimport CircleIcon from \"~icons/lucide/circle\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst ContextMenu = ContextMenuPrimitive.Root;\n\nconst ContextMenuTrigger = ContextMenuPrimitive.Trigger;\n\nconst ContextMenuGroup = ContextMenuPrimitive.Group;\n\nconst ContextMenuPortal = ContextMenuPrimitive.Portal;\n\nconst ContextMenuSub = ContextMenuPrimitive.Sub;\n\nconst ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;\n\nconst ContextMenuSubTrigger = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <ContextMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto h-4 w-4\" />\n </ContextMenuPrimitive.SubTrigger>\n));\nContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;\n\nconst ContextMenuSubContent = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]\",\n className,\n )}\n {...props}\n />\n));\nContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;\n\nconst ContextMenuContent = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Content\n ref={ref}\n className={cn(\n \"z-50 max-h-[--radix-context-menu-content-available-height] min-w-32 overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-context-menu-content-transform-origin]\",\n className,\n )}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n));\nContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;\n\nconst ContextMenuItem = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n));\nContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;\n\nconst ContextMenuCheckboxItem = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <ContextMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"h-4 w-4\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n));\nContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;\n\nconst ContextMenuRadioItem = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <ContextMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"h-2 w-2 fill-current\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n));\nContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;\n\nconst ContextMenuLabel = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Label\n ref={ref}\n className={cn(\"px-2 py-1.5 text-sm font-semibold text-foreground\", inset && \"pl-8\", className)}\n {...props}\n />\n));\nContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;\n\nconst ContextMenuSeparator = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-border\", className)}\n {...props}\n />\n));\nContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;\n\nconst ContextMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\"ml-auto text-xs tracking-widest text-muted-foreground\", className)}\n {...props}\n />\n );\n};\nContextMenuShortcut.displayName = \"ContextMenuShortcut\";\n\nexport {\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuContent,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioItem,\n ContextMenuLabel,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuGroup,\n ContextMenuPortal,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuRadioGroup,\n};\n","import * as React from \"react\";\n\nimport { type Override } from \"../../lib/types\";\nimport { cn } from \"../../lib/utils\";\n\nexport type InputProps = Override<\n React.ComponentProps<\"input\">,\n {\n onValueChange?: (value: string) => void;\n }\n>;\n\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, type, onValueChange, onChange, ...props }, ref) => {\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n onValueChange?.(e.target.value);\n onChange?.(e);\n };\n\n return (\n <input\n type={type}\n data-slot=\"input\"\n className={cn(\n \"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n \"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]\",\n \"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n className,\n )}\n ref={ref}\n {...props}\n onChange={handleChange}\n />\n );\n },\n);\nInput.displayName = \"Input\";\n\nexport { Input };\n","import { type Override } from \"../../lib/types\";\nimport { Input } from \"./input\";\n\ntype DateInputProps = Override<\n React.ComponentProps<\"input\">,\n {\n value: Date | null;\n onValueChange: (value: Date | null) => void;\n }\n>;\nfunction DateInput({ value, onValueChange, ...props }: DateInputProps) {\n // value가 문자열이거나 빈 문자열인 경우 처리\n const dateValue = !value\n ? \"\"\n : value instanceof Date\n ? value.toISOString().slice(0, 16)\n : new Date(value).toISOString().slice(0, 16);\n\n return (\n <Input\n type=\"datetime-local\"\n value={dateValue}\n onChange={(e) => onValueChange(e.target.value ? new Date(e.target.value) : null)}\n {...props}\n />\n );\n}\n\nexport { DateInput, type DateInputProps };\n","\"use client\";\n\nimport { format } from \"date-fns\";\nimport * as React from \"react\";\nimport { type DateRange } from \"react-day-picker\";\nimport CalendarIcon from \"~icons/lucide/calendar\";\n\nimport { useSonamuBaseContext } from \"@/contexts\";\n\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"./button\";\nimport { Calendar } from \"./calendar\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\";\n\n// ============================================================================\n// DatePicker — 단일 날짜 선택\n// ============================================================================\n\ninterface DatePickerProps {\n value?: Date;\n onValueChange?: (date: Date | undefined) => void;\n placeholder?: string;\n disabled?: boolean;\n className?: string;\n}\n\nexport function DatePicker({\n value,\n onValueChange,\n placeholder,\n disabled = false,\n className,\n}: DatePickerProps) {\n const { SD } = useSonamuBaseContext();\n const finalPlaceholder = placeholder ?? SD(\"rc.datePicker.pickDate\");\n\n return (\n <Popover>\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n disabled={disabled}\n data-empty={!value}\n className={cn(\n \"w-full justify-start text-left font-normal\",\n \"data-[empty=true]:text-muted-foreground\",\n className,\n )}\n >\n <CalendarIcon />\n {value ? format(value, \"PPP\") : <span>{finalPlaceholder}</span>}\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0\" align=\"start\">\n <Calendar\n mode=\"single\"\n selected={value}\n onSelect={(date) => {\n onValueChange?.(date);\n }}\n initialFocus\n />\n </PopoverContent>\n </Popover>\n );\n}\n\n// ============================================================================\n// DatePickerWithDropdown — 월/년 드롭다운 포함\n// ============================================================================\n\nexport function DatePickerWithDropdown({\n value,\n onValueChange,\n placeholder,\n disabled = false,\n className,\n}: DatePickerProps) {\n const { SD } = useSonamuBaseContext();\n const finalPlaceholder = placeholder ?? SD(\"rc.datePicker.selectDate\");\n const [open, setOpen] = React.useState(false);\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n disabled={disabled}\n className={cn(\n \"w-full justify-between font-normal\",\n !value && \"text-muted-foreground\",\n className,\n )}\n >\n {value ? value.toLocaleDateString() : finalPlaceholder}\n <CalendarIcon />\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto overflow-hidden p-0\" align=\"start\">\n <Calendar\n mode=\"single\"\n selected={value}\n captionLayout=\"dropdown\"\n onSelect={(selectedDate) => {\n onValueChange?.(selectedDate);\n setOpen(false);\n }}\n />\n </PopoverContent>\n </Popover>\n );\n}\n\n// ============================================================================\n// DatePickerWithRange — 날짜 범위 선택\n// ============================================================================\n\ninterface DatePickerWithRangeProps {\n CalendarIcon: React.ComponentType<{ className?: string }>;\n value?: DateRange;\n onValueChange?: (value: DateRange | undefined) => void;\n placeholder?: string;\n dateFormat?: string;\n className?: string;\n numberOfMonths?: number;\n maxDate?: Date;\n minDate?: Date;\n}\n\nexport function DatePickerWithRange({\n CalendarIcon: CalendarIconProp,\n value,\n onValueChange,\n placeholder = \"Pick a date\",\n dateFormat = \"yyyy/MM/dd\",\n className = \"\",\n numberOfMonths = 2,\n maxDate,\n minDate,\n}: DatePickerWithRangeProps) {\n const [isOpen, setIsOpen] = React.useState(false);\n\n const displayText = React.useMemo(() => {\n if (!value?.from && !value?.to) {\n return placeholder;\n }\n const fromStr = value?.from ? format(value.from, dateFormat) : \"\";\n const toStr = value?.to ? format(value.to, dateFormat) : \"\";\n if (fromStr && toStr) {\n return `${fromStr} - ${toStr}`;\n }\n if (toStr) {\n return `- ${toStr}`;\n }\n return `${fromStr} -`;\n }, [value, dateFormat, placeholder]);\n\n const disabledMatcher = React.useMemo(() => {\n if (!maxDate && !minDate) {\n return undefined;\n }\n return (date: Date): boolean => {\n if (maxDate && date > maxDate) {\n return true;\n }\n if (minDate && date < minDate) {\n return true;\n }\n return false;\n };\n }, [maxDate, minDate]);\n\n return (\n <Popover open={isOpen} onOpenChange={setIsOpen}>\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n className={`justify-start gap-2 h-8 px-3 text-xs font-normal ${className}`}\n >\n <CalendarIconProp className=\"h-4 w-4 shrink-0\" />\n <span className=\"truncate\">{displayText}</span>\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0\" align=\"start\">\n <Calendar\n mode=\"range\"\n defaultMonth={\n value?.from ??\n (value?.to ? new Date(value.to.getFullYear(), value.to.getMonth() - 1, 1) : undefined)\n }\n selected={value}\n onSelect={onValueChange}\n numberOfMonths={numberOfMonths}\n disabled={disabledMatcher}\n />\n </PopoverContent>\n </Popover>\n );\n}\n\nexport type { DatePickerProps, DatePickerWithRangeProps, DateRange };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Drawer = ({\n shouldScaleBackground = true,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Root>) => (\n <DrawerPrimitive.Root shouldScaleBackground={shouldScaleBackground} {...props} />\n);\nDrawer.displayName = \"Drawer\";\n\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\nconst DrawerPortal = DrawerPrimitive.Portal;\n\nconst DrawerClose = DrawerPrimitive.Close;\n\nconst DrawerOverlay = React.forwardRef<\n React.ComponentRef<typeof DrawerPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Overlay\n ref={ref}\n className={cn(\"fixed inset-0 z-50 bg-black/80\", className)}\n {...props}\n />\n));\nDrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;\n\nconst DrawerContent = React.forwardRef<\n React.ComponentRef<typeof DrawerPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DrawerPortal>\n <DrawerOverlay />\n <DrawerPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background\",\n className,\n )}\n {...props}\n >\n <div className=\"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n));\nDrawerContent.displayName = \"DrawerContent\";\n\nconst DrawerHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn(\"grid gap-1.5 p-4 text-center sm:text-left\", className)} {...props} />\n);\nDrawerHeader.displayName = \"DrawerHeader\";\n\nconst DrawerFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)} {...props} />\n);\nDrawerFooter.displayName = \"DrawerFooter\";\n\nconst DrawerTitle = React.forwardRef<\n React.ComponentRef<typeof DrawerPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n));\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\nconst DrawerDescription = React.forwardRef<\n React.ComponentRef<typeof DrawerPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n};\n","\"use client\";\n\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport * as React from \"react\";\nimport CheckIcon from \"~icons/lucide/check\";\nimport ChevronRightIcon from \"~icons/lucide/chevron-right\";\nimport CircleIcon from \"~icons/lucide/circle\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst DropdownMenu = DropdownMenuPrimitive.Root;\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\n\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\n\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\n\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\n\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;\n\nconst DropdownMenuContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-32 overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]\",\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"h-2 w-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\"px-2 py-1.5 text-sm font-semibold\", inset && \"pl-8\", className)}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span className={cn(\"ml-auto text-xs tracking-widest opacity-60\", className)} {...props} />\n );\n};\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\";\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n};\n","import type React from \"react\";\nimport { useCallback, useRef, useState } from \"react\";\nimport FileIcon from \"~icons/lucide/file\";\nimport ImageIcon from \"~icons/lucide/image\";\nimport Loader2Icon from \"~icons/lucide/loader2\";\nimport UploadIcon from \"~icons/lucide/upload\";\nimport XIcon from \"~icons/lucide/x\";\n\nimport { type SonamuFile } from \"@/contexts\";\nimport { useSonamuBaseContext } from \"@/contexts\";\nimport { cn, useObjectUrls } from \"@/lib/utils\";\n\nimport { Button } from \"./button\";\n\nexport type PreviewSize = \"sm\" | \"md\" | \"lg\" | \"xl\";\n\n// 이미지용: 정사각형\nconst imageSizeClasses: Record<PreviewSize, string> = {\n sm: \"w-20 h-20\",\n md: \"w-32 h-32\",\n lg: \"w-40 h-40\",\n xl: \"w-48 h-48\",\n};\n\n// 파일용: 가로로 긴 직사각형\nconst fileSizeClasses: Record<PreviewSize, string> = {\n sm: \"w-48 h-12\",\n md: \"w-80 h-16\",\n lg: \"w-96 h-20\",\n xl: \"w-[28rem] h-24\",\n};\n\ntype BaseProps = {\n uploadMode: \"eager\" | \"lazy\";\n viewMode: \"image\" | \"file\";\n placeholder?: string;\n accept?: string;\n disabled?: boolean;\n className?: string;\n previewSize?: PreviewSize;\n onBlur?: React.FocusEventHandler<HTMLInputElement>;\n};\n\ntype SingleModeProps = BaseProps & {\n multiple?: false;\n value: SonamuFile | File | null;\n onValueChange?: (value: SonamuFile | File | null) => void;\n};\n\ntype MultipleModeProps = BaseProps & {\n multiple: true;\n value: (SonamuFile | File)[] | null;\n onValueChange?: (value: (SonamuFile | File)[]) => void;\n maxFiles?: number;\n};\n\nexport type FileInputProps = SingleModeProps | MultipleModeProps;\n\nexport function FileInput(props: FileInputProps) {\n const {\n placeholder,\n disabled = false,\n className,\n previewSize = \"md\",\n uploadMode,\n viewMode,\n onBlur,\n } = props;\n\n const { uploader, SD } = useSonamuBaseContext();\n\n const isMultiple = props.multiple ?? false;\n const isImageView = viewMode === \"image\";\n\n // viewMode에 따라 accept 자동 설정\n const accept = props.accept ?? (isImageView ? \"image/*\" : \"*/*\");\n\n const inputRef = useRef<HTMLInputElement>(null);\n const [isUploading, setIsUploading] = useState(false);\n const [dragOver, setDragOver] = useState(false);\n\n // 기본 placeholder 설정\n const defaultPlaceholder =\n placeholder ??\n `${isImageView ? SD(\"rc.fileInput.imagePlaceholder\") : SD(\"rc.fileInput.filePlaceholder\")} URL${isMultiple ? \"S\" : \"\"}`;\n\n // 입력 정규화: 내부적으로 배열로 통일\n const values = (() => {\n if (!isMultiple) {\n const singleValue = (props as SingleModeProps).value;\n return singleValue ? [singleValue] : [];\n }\n\n const multiValue = (props as MultipleModeProps).value || [];\n\n return multiValue;\n })();\n\n // File 객체만 추출\n const fileObjects = values.filter((v): v is File => v instanceof File);\n\n // File 객체는 useObjectUrls로 안전하게 blob URL 생성 (자동 메모리 해제)\n const blobUrls = useObjectUrls(fileObjects);\n\n // 최종 display 데이터: 원래 순서를 유지하면서 File은 blob URL로, SonamuFile은 그대로\n const displayItems = values.map((v) => {\n if (v instanceof File) {\n const index = fileObjects.indexOf(v);\n return {\n url: blobUrls[index],\n name: v.name,\n isPending: true,\n };\n }\n // SonamuFile\n return {\n url: v.url,\n name: v.name,\n isPending: false,\n };\n });\n\n const maxFiles = isMultiple ? ((props as MultipleModeProps).maxFiles ?? 10) : 1;\n const totalCount = values.length;\n const canAddMore = totalCount < maxFiles;\n\n const handleFilesChange = useCallback(\n async (files: File[]) => {\n if (files.length === 0 || disabled) return;\n\n // maxFiles 체크\n const remainingSlots = maxFiles - totalCount;\n if (remainingSlots <= 0) {\n alert(\n (SD(\"rc.fileInput.maxFilesExceeded\") as unknown as (maxFiles: number) => string)(\n maxFiles,\n ),\n );\n return;\n }\n\n const filesToAdd = files.slice(0, remainingSlots);\n\n // Eager 모드: 즉시 업로드\n if (uploadMode === \"eager\") {\n setIsUploading(true);\n try {\n // uploader는 File[] 배열을 받아서 SonamuFile[] 배열을 반환해야 합니다\n const uploadedFiles = await uploader(filesToAdd);\n\n if (isMultiple) {\n // Multiple 파일 업로드\n const finalValues = [...values, ...uploadedFiles];\n (props.onValueChange as ((v: (SonamuFile | File)[]) => void) | undefined)?.(\n finalValues,\n );\n } else {\n // Single 파일 업로드\n (props.onValueChange as ((v: SonamuFile | File) => void) | undefined)?.(\n uploadedFiles[0],\n );\n }\n } catch (error) {\n console.error(\"Upload failed:\", error);\n alert(SD(\"rc.fileInput.uploadFailed\"));\n } finally {\n setIsUploading(false);\n }\n } else {\n // Lazy 모드: File 객체 그대로 전달\n if (isMultiple) {\n const finalValues = [...values, ...filesToAdd];\n (props.onValueChange as ((v: (SonamuFile | File)[]) => void) | undefined)?.(finalValues);\n } else {\n (props.onValueChange as ((v: SonamuFile | File) => void) | undefined)?.(filesToAdd[0]);\n }\n }\n },\n [disabled, totalCount, maxFiles, isMultiple, uploadMode, values, props, uploader],\n );\n\n const handleInputChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const files = Array.from(e.target.files || []);\n handleFilesChange(files);\n // input 초기화\n if (inputRef.current) {\n inputRef.current.value = \"\";\n }\n },\n [handleFilesChange],\n );\n\n const handleDrop = useCallback(\n (e: React.DragEvent) => {\n e.preventDefault();\n setDragOver(false);\n if (disabled || isUploading) return;\n\n const files = Array.from(e.dataTransfer.files);\n handleFilesChange(files);\n },\n [handleFilesChange, disabled, isUploading],\n );\n\n const handleRemove = useCallback(\n (index: number) => (e: React.MouseEvent) => {\n e.stopPropagation();\n\n if (!isMultiple) {\n (props.onValueChange as ((v: SonamuFile | File | null) => void) | undefined)?.(null);\n } else {\n const newValue = values.filter((_, i) => i !== index);\n (props.onValueChange as ((v: (SonamuFile | File)[]) => void) | undefined)?.(newValue);\n }\n },\n [values, isMultiple, props.onValueChange],\n );\n\n const handleClick = () => {\n if (!disabled && !isUploading) {\n inputRef.current?.click();\n }\n };\n\n // viewMode에 따라 적절한 사이즈 클래스 선택\n const sizeClasses = isImageView ? imageSizeClasses : fileSizeClasses;\n\n // Single 모드 렌더링\n if (!isMultiple && displayItems.length > 0) {\n const item = displayItems[0];\n return (\n <div className={cn(\"relative inline-block\", className)}>\n <input\n ref={inputRef}\n type=\"file\"\n accept={accept}\n onChange={handleInputChange}\n onBlur={onBlur}\n disabled={disabled || isUploading}\n className=\"sr-only\"\n />\n\n <div\n onClick={handleClick}\n onDrop={handleDrop}\n onDragOver={(e) => {\n e.preventDefault();\n !disabled && !isUploading && setDragOver(true);\n }}\n onDragLeave={(e) => {\n e.preventDefault();\n setDragOver(false);\n }}\n className={cn(\n \"relative flex items-center justify-center rounded-lg border-2 cursor-pointer transition-all\",\n sizeClasses[previewSize],\n isImageView\n ? \"border-transparent\"\n : \"border-dashed border-muted-foreground/25 hover:border-muted-foreground/50\",\n dragOver && \"border-primary bg-primary/5\",\n disabled && \"opacity-50 cursor-not-allowed\",\n isUploading && \"cursor-wait\",\n )}\n >\n {isUploading ? (\n <div className=\"flex flex-col items-center gap-2 text-muted-foreground\">\n <Loader2Icon className=\"h-6 w-6 animate-spin\" />\n <span className=\"text-xs\">{SD(\"rc.fileInput.uploading\")}</span>\n </div>\n ) : (\n <>\n {isImageView ? (\n <img\n src={item.url}\n alt=\"Preview\"\n className=\"h-full w-full object-cover rounded-lg overflow-hidden\"\n />\n ) : (\n <div className=\"flex items-center gap-2 px-3 h-full w-full min-w-0 overflow-hidden\">\n <FileIcon className=\"h-6 w-6 text-muted-foreground shrink-0\" />\n <span\n className={cn(\n \"text-xs truncate min-w-0\",\n item.isPending ? \"w-[140px] shrink-0\" : \"flex-1\",\n )}\n >\n {item.name}\n </span>\n {item.isPending && (\n <span className=\"px-2 py-0.5 bg-yellow-500/90 text-white text-xs rounded whitespace-nowrap shrink-0\">\n {SD(\"rc.fileInput.pending\")}\n </span>\n )}\n </div>\n )}\n {!disabled && (\n <Button\n type=\"button\"\n variant=\"destructive\"\n size=\"xs\"\n className=\"absolute -top-2 -right-2 h-6 w-6 rounded-full p-0\"\n onClick={handleRemove(0)}\n icon={<XIcon />}\n />\n )}\n {/* 이미지 모드일 때만 하단에 대기중 배지 표시 */}\n {isImageView && item.isPending && (\n <div className=\"absolute bottom-2 left-2 right-2 mx-auto max-w-[calc(100%-1rem)] px-2 py-1 bg-yellow-500/90 text-white text-xs rounded text-center truncate\">\n {SD(\"rc.fileInput.pending\")}\n </div>\n )}\n </>\n )}\n </div>\n </div>\n );\n }\n\n // Multiple 모드 또는 빈 Single 모드 렌더링\n return (\n <div className={cn(\"flex flex-wrap gap-3\", className)}>\n <input\n ref={inputRef}\n type=\"file\"\n accept={accept}\n multiple={isMultiple}\n onChange={handleInputChange}\n onBlur={onBlur}\n disabled={disabled || isUploading}\n className=\"sr-only\"\n />\n\n {/* 업로드된 파일들 */}\n {displayItems.map((item, index) => (\n <div key={`${item.url}-${index}`} className={cn(\"relative\", sizeClasses[previewSize])}>\n {isImageView ? (\n <div className=\"h-full w-full rounded-lg border overflow-hidden\">\n <img\n src={item.url}\n alt={`Uploaded ${index + 1}`}\n className=\"h-full w-full object-cover\"\n />\n </div>\n ) : (\n <div\n className={cn(\n \"relative flex items-center gap-2 px-3 rounded-lg border-2 min-w-0 overflow-hidden\",\n \"border-dashed border-muted-foreground/25\",\n \"h-full w-full\",\n )}\n >\n <FileIcon className=\"h-6 w-6 text-muted-foreground shrink-0\" />\n <span\n className={cn(\n \"text-xs truncate min-w-0\",\n item.isPending ? \"w-[140px] shrink-0\" : \"flex-1\",\n )}\n >\n {item.name}\n </span>\n {item.isPending && (\n <span className=\"px-2 py-0.5 bg-yellow-500/90 text-white text-xs rounded whitespace-nowrap shrink-0\">\n {SD(\"rc.fileInput.pending\")}\n </span>\n )}\n </div>\n )}\n {!disabled && (\n <Button\n type=\"button\"\n variant=\"destructive\"\n size=\"xs\"\n className=\"absolute -top-2 -right-2 h-6 w-6 rounded-full p-0\"\n onClick={handleRemove(index)}\n icon={<XIcon />}\n />\n )}\n {/* 이미지 모드일 때만 하단에 대기중 배지 표시 */}\n {isImageView && item.isPending && (\n <div className=\"absolute bottom-2 left-2 right-2 mx-auto max-w-[calc(100%-1rem)] px-2 py-1 bg-yellow-500/90 text-white text-xs rounded text-center truncate\">\n {SD(\"rc.fileInput.pending\")}\n </div>\n )}\n </div>\n ))}\n\n {/* 추가 버튼 */}\n {canAddMore && (\n <div\n onClick={handleClick}\n onDrop={handleDrop}\n onDragOver={(e) => {\n e.preventDefault();\n !disabled && !isUploading && setDragOver(true);\n }}\n onDragLeave={(e) => {\n e.preventDefault();\n setDragOver(false);\n }}\n className={cn(\n \"flex items-center justify-center rounded-lg border-2 border-dashed cursor-pointer transition-all\",\n sizeClasses[previewSize],\n dragOver\n ? \"border-primary bg-primary/5\"\n : \"border-muted-foreground/25 hover:border-muted-foreground/50\",\n disabled && \"opacity-50 cursor-not-allowed\",\n isUploading && \"cursor-wait\",\n )}\n >\n {isUploading ? (\n <div className=\"flex flex-col items-center gap-2 text-muted-foreground\">\n <Loader2Icon className=\"h-6 w-6 animate-spin\" />\n <span className=\"text-xs\">{SD(\"rc.fileInput.uploading\")}</span>\n </div>\n ) : (\n <div className=\"flex flex-col items-center gap-2 text-muted-foreground p-2\">\n {isImageView ? <ImageIcon className=\"h-6 w-6\" /> : <UploadIcon className=\"h-6 w-6\" />}\n <span className=\"text-xs text-center\">{defaultPlaceholder}</span>\n </div>\n )}\n </div>\n )}\n </div>\n );\n}\n","import * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { cva } from \"class-variance-authority\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst labelVariants = cva(\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\",\n);\n\nconst Label = React.forwardRef<\n React.ComponentRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & VariantProps<typeof labelVariants>\n>(({ className, ...props }, ref) => (\n <LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props} />\n));\nLabel.displayName = LabelPrimitive.Root.displayName;\n\nexport { Label };\n","import type * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\nimport { Controller, FormProvider, useFormContext } from \"react-hook-form\";\nimport { type ControllerProps, type FieldPath, type FieldValues } from \"react-hook-form\";\n\nimport { cn } from \"../../lib/utils\";\nimport { Label } from \"./label\";\n\nconst Form = FormProvider;\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = {\n name: TName;\n};\n\nconst FormFieldContext = React.createContext<FormFieldContextValue | null>(null);\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n};\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState, formState } = useFormContext();\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\");\n }\n\n if (!itemContext) {\n throw new Error(\"useFormField should be used within <FormItem>\");\n }\n\n const fieldState = getFieldState(fieldContext.name, formState);\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n};\n\ntype FormItemContextValue = {\n id: string;\n};\n\nconst FormItemContext = React.createContext<FormItemContextValue | null>(null);\n\nconst FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const id = React.useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn(\"space-y-2\", className)} {...props} />\n </FormItemContext.Provider>\n );\n },\n);\nFormItem.displayName = \"FormItem\";\n\nconst FormLabel = React.forwardRef<\n React.ComponentRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n\n return (\n <Label\n ref={ref}\n className={cn(error && \"text-destructive\", className)}\n htmlFor={formItemId}\n {...props}\n />\n );\n});\nFormLabel.displayName = \"FormLabel\";\n\nconst FormControl = React.forwardRef<\n React.ComponentRef<typeof Slot>,\n React.ComponentPropsWithoutRef<typeof Slot>\n>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n );\n});\nFormControl.displayName = \"FormControl\";\n\nconst FormDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n\n return (\n <p\n ref={ref}\n id={formDescriptionId}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n );\n});\nFormDescription.displayName = \"FormDescription\";\n\nconst FormMessage = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error?.message ?? \"\") : children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p\n ref={ref}\n id={formMessageId}\n className={cn(\"text-sm font-medium text-destructive\", className)}\n {...props}\n >\n {body}\n </p>\n );\n});\nFormMessage.displayName = \"FormMessage\";\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n};\n","import * as HoverCardPrimitive from \"@radix-ui/react-hover-card\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst HoverCard = HoverCardPrimitive.Root;\n\nconst HoverCardTrigger = HoverCardPrimitive.Trigger;\n\nconst HoverCardContent = React.forwardRef<\n React.ComponentRef<typeof HoverCardPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Content>\n>(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => (\n <HoverCardPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-hover-card-content-transform-origin]\",\n className,\n )}\n {...props}\n />\n));\nHoverCardContent.displayName = HoverCardPrimitive.Content.displayName;\n\nexport { HoverCard, HoverCardTrigger, HoverCardContent };\n","import { OTPInput, OTPInputContext } from \"input-otp\";\nimport * as React from \"react\";\nimport DotIcon from \"~icons/lucide/dot\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst InputOTP = React.forwardRef<\n React.ComponentRef<typeof OTPInput>,\n React.ComponentPropsWithoutRef<typeof OTPInput>\n>(({ className, containerClassName, ...props }, ref) => (\n <OTPInput\n ref={ref}\n containerClassName={cn(\n \"flex items-center gap-2 has-[:disabled]:opacity-50\",\n containerClassName,\n )}\n className={cn(\"disabled:cursor-not-allowed\", className)}\n {...props}\n />\n));\nInputOTP.displayName = \"InputOTP\";\n\nconst InputOTPGroup = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"flex items-center\", className)} {...props} />\n));\nInputOTPGroup.displayName = \"InputOTPGroup\";\n\nconst InputOTPSlot = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\"> & { index: number }\n>(({ index, className, ...props }, ref) => {\n const inputOTPContext = React.useContext(OTPInputContext);\n const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];\n\n return (\n <div\n ref={ref}\n className={cn(\n \"relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md\",\n isActive && \"z-10 ring-2 ring-ring ring-offset-background\",\n className,\n )}\n {...props}\n >\n {char}\n {hasFakeCaret && (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"h-4 w-px animate-caret-blink bg-foreground duration-1000\" />\n </div>\n )}\n </div>\n );\n});\nInputOTPSlot.displayName = \"InputOTPSlot\";\n\nconst InputOTPSeparator = React.forwardRef<\n React.ElementRef<\"div\">,\n React.ComponentPropsWithoutRef<\"div\">\n>(({ ...props }, ref) => (\n <div ref={ref} role=\"separator\" {...props}>\n <DotIcon />\n </div>\n));\nInputOTPSeparator.displayName = \"InputOTPSeparator\";\n\nexport { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };\n","import * as MenubarPrimitive from \"@radix-ui/react-menubar\";\nimport * as React from \"react\";\nimport CheckIcon from \"~icons/lucide/check\";\nimport ChevronRightIcon from \"~icons/lucide/chevron-right\";\nimport CircleIcon from \"~icons/lucide/circle\";\n\nimport { cn } from \"../../lib/utils\";\n\nfunction MenubarMenu({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Menu>) {\n return <MenubarPrimitive.Menu {...props} />;\n}\n\nfunction MenubarGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Group>) {\n return <MenubarPrimitive.Group {...props} />;\n}\n\nfunction MenubarPortal({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Portal>) {\n return <MenubarPrimitive.Portal {...props} />;\n}\n\nfunction MenubarRadioGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.RadioGroup>) {\n return <MenubarPrimitive.RadioGroup {...props} />;\n}\n\nfunction MenubarSub({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Sub>) {\n return <MenubarPrimitive.Sub data-slot=\"menubar-sub\" {...props} />;\n}\n\nconst Menubar = React.forwardRef<\n React.ComponentRef<typeof MenubarPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Root\n ref={ref}\n className={cn(\n \"flex h-10 items-center space-x-1 rounded-md border bg-background p-1\",\n className,\n )}\n {...props}\n />\n));\nMenubar.displayName = MenubarPrimitive.Root.displayName;\n\nconst MenubarTrigger = React.forwardRef<\n React.ComponentRef<typeof MenubarPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground\",\n className,\n )}\n {...props}\n />\n));\nMenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;\n\nconst MenubarSubTrigger = React.forwardRef<\n React.ComponentRef<typeof MenubarPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <MenubarPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto h-4 w-4\" />\n </MenubarPrimitive.SubTrigger>\n));\nMenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;\n\nconst MenubarSubContent = React.forwardRef<\n React.ComponentRef<typeof MenubarPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.SubContent\n ref={ref}\n className={cn(\n \"z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-menubar-content-transform-origin]\",\n className,\n )}\n {...props}\n />\n));\nMenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;\n\nconst MenubarContent = React.forwardRef<\n React.ComponentRef<typeof MenubarPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>\n>(({ className, align = \"start\", alignOffset = -4, sideOffset = 8, ...props }, ref) => (\n <MenubarPrimitive.Portal>\n <MenubarPrimitive.Content\n ref={ref}\n align={align}\n alignOffset={alignOffset}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 min-w-48 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-menubar-content-transform-origin]\",\n className,\n )}\n {...props}\n />\n </MenubarPrimitive.Portal>\n));\nMenubarContent.displayName = MenubarPrimitive.Content.displayName;\n\nconst MenubarItem = React.forwardRef<\n React.ComponentRef<typeof MenubarPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <MenubarPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n));\nMenubarItem.displayName = MenubarPrimitive.Item.displayName;\n\nconst MenubarCheckboxItem = React.forwardRef<\n React.ComponentRef<typeof MenubarPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <MenubarPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <MenubarPrimitive.ItemIndicator>\n <CheckIcon className=\"h-4 w-4\" />\n </MenubarPrimitive.ItemIndicator>\n </span>\n {children}\n </MenubarPrimitive.CheckboxItem>\n));\nMenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;\n\nconst MenubarRadioItem = React.forwardRef<\n React.ComponentRef<typeof MenubarPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <MenubarPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <MenubarPrimitive.ItemIndicator>\n <CircleIcon className=\"h-2 w-2 fill-current\" />\n </MenubarPrimitive.ItemIndicator>\n </span>\n {children}\n </MenubarPrimitive.RadioItem>\n));\nMenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;\n\nconst MenubarLabel = React.forwardRef<\n React.ComponentRef<typeof MenubarPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <MenubarPrimitive.Label\n ref={ref}\n className={cn(\"px-2 py-1.5 text-sm font-semibold\", inset && \"pl-8\", className)}\n {...props}\n />\n));\nMenubarLabel.displayName = MenubarPrimitive.Label.displayName;\n\nconst MenubarSeparator = React.forwardRef<\n React.ComponentRef<typeof MenubarPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n));\nMenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;\n\nconst MenubarShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\"ml-auto text-xs tracking-widest text-muted-foreground\", className)}\n {...props}\n />\n );\n};\nMenubarShortcut.displayname = \"MenubarShortcut\";\n\nexport {\n Menubar,\n MenubarMenu,\n MenubarTrigger,\n MenubarContent,\n MenubarItem,\n MenubarSeparator,\n MenubarLabel,\n MenubarCheckboxItem,\n MenubarRadioGroup,\n MenubarRadioItem,\n MenubarPortal,\n MenubarSubContent,\n MenubarSubTrigger,\n MenubarGroup,\n MenubarSub,\n MenubarShortcut,\n};\n","import * as SeparatorPrimitive from \"@radix-ui/react-separator\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Separator = React.forwardRef<\n React.ComponentRef<typeof SeparatorPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(({ className, orientation = \"horizontal\", decorative = true, ...props }, ref) => (\n <SeparatorPrimitive.Root\n ref={ref}\n decorative={decorative}\n orientation={orientation}\n className={cn(\n \"shrink-0 bg-border\",\n orientation === \"horizontal\" ? \"h-px w-full\" : \"h-full w-px\",\n className,\n )}\n {...props}\n />\n));\nSeparator.displayName = SeparatorPrimitive.Root.displayName;\n\nexport { Separator };\n","import * as React from \"react\";\nimport { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from \"react\";\nimport CheckIcon from \"~icons/lucide/check\";\nimport ChevronDownIcon from \"~icons/lucide/chevron-down\";\nimport Loader2Icon from \"~icons/lucide/loader2\";\nimport XIcon from \"~icons/lucide/x\";\nimport XCircleIcon from \"~icons/lucide/x-circle\";\n\nimport { useSonamuBaseContext } from \"@/contexts\";\n\nimport { cn } from \"../../../lib/utils\";\nimport { Badge } from \"../badge\";\nimport { Button } from \"../button\";\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from \"../command\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../popover\";\nimport { Separator } from \"../separator\";\n\n// ============================================================================\n// Type Definition\n// ============================================================================\n\n// 아이템 요소에서 value 타입 추출\ntype ExtractValue<Item> = Item extends { value: infer V } ? V : Item;\n\n// 아이템 정의: 값만 넘기거나 { value, label, disabled } 형태로 넘길 수 있음\ntype SelectItemDef<V> = V | { value: V; label?: React.ReactNode; disabled?: boolean };\n\n// 정규화된 아이템 타입\ntype NormalizedItem<V> = { value: V; label?: React.ReactNode; disabled?: boolean };\n\n// 기본 Props\ninterface SelectPropsBase<Item> {\n items: Item[];\n placeholder?: string;\n clearable?: boolean;\n disabled?: boolean;\n className?: string;\n contentClassName?: string;\n renderItem?: (value: ExtractValue<Item>) => React.ReactNode;\n name?: string;\n onBlur?: React.FocusEventHandler<HTMLSelectElement>;\n}\n\n// valueKey 조건부 필수화: string | number일 때는 선택적, 그 외에는 필수\ntype SelectPropsWithValueKey<Item> =\n ExtractValue<Item> extends string | number\n ? { valueKey?: (value: ExtractValue<Item>) => string }\n : { valueKey: (value: ExtractValue<Item>) => string };\n\n// Single-Sync Props\ninterface SingleSyncProps<Item> {\n multiple?: false;\n async?: false;\n value?: ExtractValue<Item>;\n onValueChange?: (value: ExtractValue<Item> | undefined) => void;\n searchable?: boolean;\n}\n\n// Single-Async Props\ninterface SingleAsyncProps<Item> {\n multiple?: false;\n async: true;\n value?: ExtractValue<Item>;\n onValueChange?: (value: ExtractValue<Item> | undefined) => void;\n loading?: boolean;\n error?: Error;\n onSearch: (keyword: string) => void;\n searchDebounce?: number;\n // 검색창 노출 여부. 기본은 true (async의 기존 UX 유지). false면 CommandInput을 숨깁니다.\n searchable?: boolean;\n // Popover/무한스크롤 훅: async 사용처에서만 의미가 있어 async props로 한정합니다.\n onOpenChange?: (open: boolean) => void;\n onLoadMore?: () => void;\n hasMore?: boolean;\n isLoadingMore?: boolean;\n}\n\n// Multi-Sync Props\ninterface MultiSyncProps<Item> {\n multiple: true;\n async?: false;\n value: ExtractValue<Item>[];\n onValueChange: (value: ExtractValue<Item>[]) => void;\n maxCount?: number;\n hideSelectAll?: boolean;\n searchable?: boolean;\n}\n\n// Multi-Async Props\ninterface MultiAsyncProps<Item> {\n multiple: true;\n async: true;\n value: ExtractValue<Item>[];\n onValueChange: (value: ExtractValue<Item>[]) => void;\n loading?: boolean;\n error?: Error;\n onSearch: (keyword: string) => void;\n searchDebounce?: number;\n maxCount?: number;\n hideSelectAll?: boolean;\n // 검색창 노출 여부. 기본은 true (async의 기존 UX 유지). false면 CommandInput을 숨깁니다.\n searchable?: boolean;\n // Popover/무한스크롤 훅: async 사용처에서만 의미가 있어 async props로 한정합니다.\n onOpenChange?: (open: boolean) => void;\n onLoadMore?: () => void;\n hasMore?: boolean;\n isLoadingMore?: boolean;\n}\n\n// 통합 타입\ntype SelectProps<Item> = SelectPropsBase<Item> &\n SelectPropsWithValueKey<Item> &\n (SingleSyncProps<Item> | SingleAsyncProps<Item> | MultiSyncProps<Item> | MultiAsyncProps<Item>);\n\n// ============================================================================\n// Internal Types\n// ============================================================================\n\ntype CommonState<Item> = {\n // multi 모드 플래그\n isMultiple: boolean;\n // async 모드 플래그\n isAsync: boolean;\n // 숨겨진 native select ref\n selectRef: React.RefObject<HTMLSelectElement | null>;\n // Popover 상태\n isPopoverOpen: boolean;\n setIsPopoverOpen: React.Dispatch<React.SetStateAction<boolean>>;\n // 검색 상태\n searchValue: string;\n handleSearchChange: (value: string) => void;\n // 렌더링 옵션 (async: reserved 포함)\n filteredOptions: NormalizedItem<ExtractValue<Item>>[];\n // 입력 아이템 정규화 결과\n normalizedItems: NormalizedItem<ExtractValue<Item>>[];\n // 값 → 키 변환\n getKeyForValue: (val: ExtractValue<Item>) => string;\n // 키 → 값 변환\n valueByKey: Map<string, ExtractValue<Item>>;\n // 값 → 라벨 변환\n getItemLabel: (value: ExtractValue<Item>) => React.ReactNode;\n};\n\ntype CommandBasedSelectProps<Item> = {\n props: (\n | SingleSyncProps<Item>\n | SingleAsyncProps<Item>\n | MultiSyncProps<Item>\n | MultiAsyncProps<Item>\n ) &\n SelectPropsBase<Item> &\n SelectPropsWithValueKey<Item>;\n isMultiple: boolean;\n isAsync: boolean;\n isPopoverOpen: boolean;\n setIsPopoverOpen: React.Dispatch<React.SetStateAction<boolean>>;\n searchValue: string;\n handleSearchChange: (value: string) => void;\n filteredOptions: NormalizedItem<ExtractValue<Item>>[];\n getKeyForValue: (val: ExtractValue<Item>) => string;\n getItemLabel: (value: ExtractValue<Item>) => React.ReactNode;\n};\n\n// ============================================================================\n// Type Guard\n// ============================================================================\n\n// 아이템이 { value, label, disabled } 형태인지 확인\nfunction isItemObject<V>(\n item: V | { value: V; label?: React.ReactNode; disabled?: boolean },\n): item is { value: V; label?: React.ReactNode; disabled?: boolean } {\n return item !== null && typeof item === \"object\" && \"value\" in item;\n}\n\n// ============================================================================\n// Hooks & Renderers\n// ============================================================================\n\nfunction useSelectCommon<Item>(\n props: SelectProps<Item>,\n ref: React.ForwardedRef<HTMLSelectElement>,\n): CommonState<Item> {\n type Value = ExtractValue<Item>;\n\n // 모드 파생\n const isMultiple = props.multiple === true;\n const isAsync = props.async === true;\n\n // native select 연결\n const selectRef = useRef<HTMLSelectElement>(null);\n useImperativeHandle(ref, () => selectRef.current as HTMLSelectElement);\n\n // popover + 검색 상태\n const [isPopoverOpen, setIsPopoverOpen] = useState(false);\n const [searchValue, setSearchValue] = useState(\"\");\n // async 모드에서 선택된 옵션 캐시\n const [reservedOptions, setReservedOptions] = useState(new Map());\n\n // Popover 열림/닫힘 전이 감지해 외부 onOpenChange 콜백 발사. async 모드에서만 의미가 있습니다.\n // 실제 값 변화가 있을 때만 트리거하여 불필요한 호출을 피합니다.\n const onOpenChangeExternal = isAsync && \"onOpenChange\" in props ? props.onOpenChange : undefined;\n const prevOpenRef = useRef(isPopoverOpen);\n useEffect(() => {\n if (prevOpenRef.current !== isPopoverOpen) {\n if (onOpenChangeExternal) {\n onOpenChangeExternal(isPopoverOpen);\n }\n prevOpenRef.current = isPopoverOpen;\n }\n }, [isPopoverOpen, onOpenChangeExternal]);\n\n // 값 → 키 변환\n const getKeyForValue = useCallback(\n (val: Value): string => {\n if (val === undefined || val === null) return \"\";\n if (props.valueKey) return props.valueKey(val);\n return String(val);\n },\n [props.valueKey],\n );\n\n // 아이템 정규화\n const normalizedItems = useMemo(() => {\n return props.items.map(\n (item): NormalizedItem<Value> =>\n isItemObject(item) ? (item as NormalizedItem<Value>) : { value: item as Value },\n );\n }, [props.items]);\n\n // 키 → 값 매핑 (Single-Sync 모드용)\n const valueByKey = useMemo(() => {\n const mapping = new Map<string, Value>();\n for (const item of normalizedItems) {\n mapping.set(getKeyForValue(item.value), item.value);\n }\n return mapping;\n }, [normalizedItems, getKeyForValue]);\n\n // 값 → 라벨 렌더링\n const getItemLabel = useCallback(\n (value: Value): React.ReactNode => {\n // renderItem이 있으면 바로 사용 (대부분의 경우 여기서 종료)\n if (props.renderItem) {\n return props.renderItem(value);\n }\n\n // label 찾기: normalizedItems에서 먼저 확인\n const item = normalizedItems.find((i) => i.value === value);\n if (item?.label !== undefined) {\n return item.label;\n }\n\n // async 모드면 reservedOptions에서도 확인\n if (isAsync) {\n const cached = reservedOptions.get(getKeyForValue(value));\n if (cached?.label !== undefined) {\n return cached.label;\n }\n }\n\n // 마지막 폴백: String 변환\n return String(value);\n },\n [props.renderItem, normalizedItems, isAsync, reservedOptions, getKeyForValue],\n );\n\n // Async 모드: 선택된 옵션을 캐시에 저장\n useEffect(() => {\n if (!isAsync) return;\n\n // 현재 선택된 값들 추출\n const values = isMultiple\n ? (props as MultiAsyncProps<Item>).value\n : [(props as SingleAsyncProps<Item>).value as Value].filter(Boolean);\n\n const next = new Map<string, NormalizedItem<Value>>();\n\n // 선택된 값들만 캐시에 저장\n for (const val of values) {\n const key = getKeyForValue(val);\n const item = normalizedItems.find((item) => item.value === val);\n if (item) {\n next.set(key, item);\n }\n }\n\n setReservedOptions(next);\n }, [isAsync, isMultiple, props, normalizedItems, getKeyForValue]);\n\n // 검색어 변경\n const handleSearchChange = useCallback((value: string) => {\n setSearchValue(value);\n }, []);\n\n // 검색 디바운스\n const onSearchFn = isAsync && \"onSearch\" in props ? props.onSearch : undefined;\n const searchDebounceTime =\n isAsync && \"searchDebounce\" in props && props.searchDebounce !== undefined\n ? props.searchDebounce\n : 300;\n\n useEffect(() => {\n if (!onSearchFn) return;\n\n // 빈 문자열(검색어 삭제 / 팝오버 닫힘으로 인한 초기화)은 즉시 전파하여\n // 부모의 keyword state를 리셋합니다. 이렇게 해야 \"검색어 비움 → 초기 리스트\"와\n // \"선택 후 재오픈 → 초기 리스트\" 동작이 성립합니다. 비어 있지 않은 입력만\n // 디바운스합니다.\n const timer = setTimeout(\n () => {\n onSearchFn(searchValue);\n },\n searchValue === \"\" ? 0 : searchDebounceTime,\n );\n\n return () => clearTimeout(timer);\n }, [searchValue, onSearchFn, searchDebounceTime]);\n\n // 표시할 옵션: async는 검색 결과 + reserved, sync는 로컬 필터링\n const filteredOptions = useMemo(() => {\n if (isAsync) {\n const combined = new Map<string, NormalizedItem<Value>>();\n\n for (const [key, item] of reservedOptions) {\n combined.set(key, item);\n }\n\n for (const item of normalizedItems) {\n combined.set(getKeyForValue(item.value), item);\n }\n\n return Array.from(combined.values());\n } else {\n if (!searchValue) return normalizedItems;\n\n return normalizedItems.filter((item) => {\n const label = getItemLabel(item.value);\n return String(label).toLowerCase().includes(searchValue.toLowerCase());\n });\n }\n }, [isAsync, normalizedItems, reservedOptions, searchValue, getKeyForValue, getItemLabel]);\n\n // Popover 닫힐 때 검색어 초기화\n useEffect(() => {\n if (!isPopoverOpen) {\n setSearchValue(\"\");\n }\n }, [isPopoverOpen]);\n\n return {\n isMultiple,\n isAsync,\n selectRef,\n isPopoverOpen,\n setIsPopoverOpen,\n searchValue,\n handleSearchChange,\n filteredOptions,\n normalizedItems,\n getKeyForValue,\n valueByKey,\n getItemLabel,\n };\n}\n\n// ============================================================================\n// CommandBasedSelect\n// - 모든 모드를 처리하는 통합 Command Popover UI\n// ============================================================================\nfunction highlightMatch(label: React.ReactNode, searchTerm: string): React.ReactNode {\n if (!searchTerm || typeof label !== \"string\") {\n return label;\n }\n\n const lowerLabel = label.toLowerCase();\n const lowerSearch = searchTerm.toLowerCase();\n const idx = lowerLabel.indexOf(lowerSearch);\n\n if (idx === -1) {\n return label;\n }\n\n const before = label.slice(0, idx);\n const match = label.slice(idx, idx + searchTerm.length);\n const after = label.slice(idx + searchTerm.length);\n\n return (\n <>\n {before}\n <strong className=\"font-bold\">{match}</strong>\n {after}\n </>\n );\n}\n\nfunction CommandBasedSelect<Item>({\n props,\n isMultiple,\n isAsync,\n isPopoverOpen,\n setIsPopoverOpen,\n searchValue,\n handleSearchChange,\n filteredOptions,\n getKeyForValue,\n getItemLabel,\n}: CommandBasedSelectProps<Item>) {\n type Value = ExtractValue<Item>;\n const { SD } = useSonamuBaseContext();\n\n // Popover portal 마운트 타이밍 때문에 ref 콜백 + state 조합으로 DOM 노드를 구독합니다.\n // useRef만 쓰면 첫 렌더 시 null이고 이후 재렌더 트리거가 없어 IntersectionObserver effect가\n // 등록되지 않습니다.\n const [listEl, setListEl] = useState<HTMLDivElement | null>(null);\n const listRefCallback = useCallback((node: HTMLDivElement | null) => {\n setListEl(node);\n }, []);\n const [sentinelEl, setSentinelEl] = useState<HTMLDivElement | null>(null);\n const sentinelRefCallback = useCallback((node: HTMLDivElement | null) => {\n setSentinelEl(node);\n }, []);\n\n // 무한스크롤 관련 props 추출. async 전용 prop이므로 async 모드에서만 끌어옵니다.\n const onLoadMore = isAsync && \"onLoadMore\" in props ? props.onLoadMore : undefined;\n const hasMore = isAsync && \"hasMore\" in props ? (props.hasMore ?? false) : false;\n const isLoadingMore =\n isAsync && \"isLoadingMore\" in props ? (props.isLoadingMore ?? false) : false;\n // 센티넬 렌더 여부: async + 호출자가 onLoadMore를 제공했을 때만 DOM을 붙이고 관찰합니다.\n const hasInfiniteScroll = isAsync && onLoadMore !== undefined;\n\n // 센티넬이 뷰포트(listEl)에 진입하면 onLoadMore 호출. 로딩 중이거나 더 불러올 게 없으면 관찰하지 않습니다.\n useEffect(() => {\n if (!onLoadMore || !hasMore || isLoadingMore) {\n return;\n }\n if (!sentinelEl || !listEl) {\n return;\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n onLoadMore();\n }\n }\n },\n { root: listEl, threshold: 0 },\n );\n observer.observe(sentinelEl);\n return () => observer.disconnect();\n }, [sentinelEl, listEl, onLoadMore, hasMore, isLoadingMore]);\n\n // 검색창 노출 여부: searchable을 async/sync와 직교 축으로 다룹니다.\n // 명시되지 않으면 기존 동작(async=true이면 true, sync면 false)을 유지합니다.\n const isSearchable = props.searchable ?? isAsync;\n\n // Wheel 이벤트 핸들러\n const handleWheel = useCallback(\n (e: React.WheelEvent<HTMLDivElement>) => {\n const target = listEl;\n if (!target) {\n return;\n }\n\n const canScrollDown = target.scrollTop < target.scrollHeight - target.clientHeight;\n const canScrollUp = target.scrollTop > 0;\n\n if ((e.deltaY > 0 && canScrollDown) || (e.deltaY < 0 && canScrollUp)) {\n e.stopPropagation();\n }\n },\n [listEl],\n );\n\n // 선택 토글 (single/multi 공용)\n const toggleOption = useCallback(\n (value: Value) => {\n if (props.disabled) return;\n\n if (isMultiple) {\n const currentValues = (props as MultiSyncProps<Item> | MultiAsyncProps<Item>).value;\n const newValues = currentValues.includes(value)\n ? currentValues.filter((v) => v !== value)\n : [...currentValues, value];\n (props as MultiSyncProps<Item> | MultiAsyncProps<Item>).onValueChange(newValues);\n } else {\n (props as SingleSyncProps<Item> | SingleAsyncProps<Item>).onValueChange?.(value);\n setIsPopoverOpen(false);\n }\n },\n [isMultiple, props, setIsPopoverOpen],\n );\n\n // 전체 선택 토글 (multi만)\n const toggleAll = useCallback(() => {\n if (!isMultiple || props.disabled) return;\n\n const allOptions = filteredOptions.filter((option) => !option.disabled);\n const currentValues = (props as MultiSyncProps<Item> | MultiAsyncProps<Item>).value;\n\n if (currentValues.length === allOptions.length) {\n (props as MultiSyncProps<Item> | MultiAsyncProps<Item>).onValueChange([]);\n } else {\n const allValues = allOptions.map((option) => option.value);\n (props as MultiSyncProps<Item> | MultiAsyncProps<Item>).onValueChange(allValues);\n }\n }, [isMultiple, props, filteredOptions]);\n\n // Clear 처리\n const handleClear = useCallback(() => {\n if (props.disabled) return;\n\n if (isMultiple) {\n (props as MultiSyncProps<Item> | MultiAsyncProps<Item>).onValueChange([]);\n } else {\n (props as SingleSyncProps<Item> | SingleAsyncProps<Item>).onValueChange?.(undefined);\n }\n }, [isMultiple, props]);\n\n // 선택 여부 확인\n const isSelected = useCallback(\n (value: Value): boolean => {\n if (isMultiple) {\n return (props as MultiSyncProps<Item> | MultiAsyncProps<Item>).value.includes(value);\n } else {\n return (props as SingleSyncProps<Item> | SingleAsyncProps<Item>).value === value;\n }\n },\n [isMultiple, props],\n );\n\n // async 상태\n const loading = isAsync && \"loading\" in props ? props.loading : false;\n const error = isAsync && \"error\" in props ? props.error : undefined;\n const hasValue = isMultiple\n ? (props as MultiSyncProps<Item> | MultiAsyncProps<Item>).value.length > 0\n : (props as SingleSyncProps<Item> | SingleAsyncProps<Item>).value !== undefined &&\n (props as SingleSyncProps<Item> | SingleAsyncProps<Item>).value !== null &&\n (props as SingleSyncProps<Item> | SingleAsyncProps<Item>).value !== \"\";\n\n // Badge 렌더링 헬퍼 (multi 모드 전용)\n const renderBadges = () => {\n if (!isMultiple) return null;\n\n const values = (props as MultiSyncProps<Item> | MultiAsyncProps<Item>).value;\n\n return (\n <>\n {values.map((value) => {\n const key = getKeyForValue(value);\n return (\n <Badge\n key={key}\n variant=\"outline\"\n className=\"m-1 transition-all duration-300 ease-in-out\"\n >\n {getItemLabel(value)}\n <XCircleIcon\n className=\"ml-2 h-3 w-3 cursor-pointer\"\n onClick={(e) => {\n e.stopPropagation();\n toggleOption(value);\n }}\n />\n </Badge>\n );\n })}\n </>\n );\n };\n\n return (\n <Popover open={isPopoverOpen} onOpenChange={setIsPopoverOpen}>\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n role=\"combobox\"\n aria-expanded={isPopoverOpen}\n disabled={props.disabled || loading}\n className={cn(\n \"flex p-1 rounded-md border border-input min-h-10 h-auto items-center justify-between bg-white hover:bg-white hover:text-inherit [&_svg]:pointer-events-auto w-full\",\n props.className,\n )}\n >\n {isMultiple && hasValue ? (\n <div className=\"flex justify-between items-center w-full\">\n <div className=\"flex items-center gap-1 flex-wrap\">{renderBadges()}</div>\n <div className=\"flex items-center justify-between\">\n {props.clearable && (\n <div\n role=\"button\"\n tabIndex={0}\n onClick={(e) => {\n e.stopPropagation();\n handleClear();\n }}\n className=\"flex items-center justify-center h-4 w-4 mx-2 cursor-pointer text-muted-foreground hover:text-foreground\"\n >\n <XIcon className=\"h-4 w-4\" />\n </div>\n )}\n <Separator orientation=\"vertical\" className=\"flex min-h-6 h-full\" />\n <ChevronDownIcon className=\"h-4 mx-2 cursor-pointer text-muted-foreground\" />\n </div>\n </div>\n ) : !isMultiple && hasValue ? (\n <div className=\"flex justify-between items-center w-full px-2 py-1\">\n {(() => {\n const value = (props as SingleSyncProps<Item> | SingleAsyncProps<Item>).value;\n return value !== undefined && value !== null ? (\n <span className=\"flex-1 truncate text-left text-sm\">{getItemLabel(value)}</span>\n ) : null;\n })()}\n <div className=\"flex items-center gap-1 shrink-0\">\n {props.clearable && hasValue && (\n <XCircleIcon\n className=\"h-4 w-4 cursor-pointer opacity-50 hover:opacity-100 transition-opacity\"\n onPointerDownCapture={handleClear}\n onMouseDownCapture={handleClear}\n />\n )}\n <ChevronDownIcon className=\"h-4 w-4 opacity-50\" />\n </div>\n </div>\n ) : (\n <div className=\"flex items-center justify-between w-full px-2 py-1\">\n <span className=\"text-sm text-muted-foreground flex-1 truncate text-left\">\n {props.placeholder}\n </span>\n <ChevronDownIcon className=\"h-4 cursor-pointer text-muted-foreground\" />\n </div>\n )}\n </Button>\n </PopoverTrigger>\n <PopoverContent\n className=\"min-w-40 p-0\"\n align=\"start\"\n style={{ width: \"var(--radix-popover-trigger-width)\" }}\n >\n <Command shouldFilter={false}>\n {isSearchable && (\n <CommandInput\n placeholder={SD(\"common.searchPlaceholder\")}\n value={searchValue}\n onValueChange={handleSearchChange}\n />\n )}\n <CommandList ref={listRefCallback} onWheel={handleWheel}>\n {loading ? (\n <CommandEmpty>\n <div className=\"flex items-center justify-center\">\n <Loader2Icon className=\"h-4 w-4 animate-spin mr-2\" />\n </div>\n </CommandEmpty>\n ) : error ? (\n <CommandEmpty>Error: {error.message}</CommandEmpty>\n ) : filteredOptions.length === 0 ? (\n <CommandEmpty>{SD(\"rc.multiSelect.noResults\")}</CommandEmpty>\n ) : (\n <>\n {isMultiple && !(\"hideSelectAll\" in props && props.hideSelectAll) && (\n <CommandGroup>\n <CommandItem onSelect={toggleAll} className=\"cursor-pointer\">\n <div\n className={cn(\n \"mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary\",\n (props as MultiSyncProps<Item> | MultiAsyncProps<Item>).value.length ===\n filteredOptions.filter((opt) => !opt.disabled).length\n ? \"bg-primary text-primary-foreground\"\n : \"opacity-50 [&_svg]:invisible\",\n )}\n >\n <CheckIcon className=\"h-4 w-4\" />\n </div>\n <span>({SD(\"rc.multiSelect.selectAll\")})</span>\n </CommandItem>\n </CommandGroup>\n )}\n <CommandGroup>\n {filteredOptions.map((option) => {\n const key = getKeyForValue(option.value);\n const selected = isSelected(option.value);\n\n return (\n <CommandItem\n key={key}\n onSelect={() => toggleOption(option.value)}\n disabled={option.disabled}\n className={cn(\n \"cursor-pointer\",\n option.disabled && \"opacity-50 cursor-not-allowed\",\n )}\n >\n {isMultiple && (\n <div\n className={cn(\n \"mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary\",\n selected\n ? \"bg-primary text-primary-foreground\"\n : \"opacity-50 [&_svg]:invisible\",\n )}\n >\n <CheckIcon className=\"h-4 w-4\" />\n </div>\n )}\n {!isMultiple && (\n <CheckIcon\n className={cn(\"mr-2 h-4 w-4\", selected ? \"opacity-100\" : \"opacity-0\")}\n />\n )}\n <span>{highlightMatch(getItemLabel(option.value), searchValue)}</span>\n </CommandItem>\n );\n })}\n </CommandGroup>\n {hasInfiniteScroll && (\n <div\n ref={sentinelRefCallback}\n className=\"flex items-center justify-center py-2 text-xs text-muted-foreground\"\n >\n {isLoadingMore ? <Loader2Icon className=\"h-3 w-3 animate-spin\" /> : null}\n </div>\n )}\n </>\n )}\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n );\n}\n\n// ============================================================================\n// Main Component & Export\n// ============================================================================\n\nexport const Select = React.forwardRef(function Select<Item>(\n props: SelectProps<Item>,\n ref: React.ForwardedRef<HTMLSelectElement>,\n) {\n // 공통 상태/유틸\n const common = useSelectCommon(props, ref);\n\n // 모든 모드를 CommandBasedSelect로 통합\n const commandProps = props as (\n | SingleSyncProps<Item>\n | SingleAsyncProps<Item>\n | MultiSyncProps<Item>\n | MultiAsyncProps<Item>\n ) &\n SelectPropsBase<Item> &\n SelectPropsWithValueKey<Item>;\n\n return (\n <CommandBasedSelect\n props={commandProps}\n isMultiple={common.isMultiple}\n isAsync={common.isAsync}\n isPopoverOpen={common.isPopoverOpen}\n setIsPopoverOpen={common.setIsPopoverOpen}\n searchValue={common.searchValue}\n handleSearchChange={common.handleSearchChange}\n filteredOptions={common.filteredOptions}\n getKeyForValue={common.getKeyForValue}\n getItemLabel={common.getItemLabel}\n />\n );\n}) as <Item>(\n props: SelectProps<Item> & React.RefAttributes<HTMLSelectElement>,\n) => React.ReactElement;\n\nexport type { SelectProps, SelectItemDef, ExtractValue };\n","\"use client\";\n\nimport { format } from \"date-fns\";\nimport * as React from \"react\";\nimport { type DateRange } from \"react-day-picker\";\n\nimport { useSonamuBaseContext } from \"@/contexts\";\n\nimport { Button } from \"./button\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\";\nimport { Select } from \"./select/select\";\n\n/** 단일 월 또는 월 범위 값 */\nexport type MonthPickerValue =\n | { type: \"single\"; date: Date }\n | { type: \"range\"; from: Date; to: Date };\n\ninterface MonthPickerMultipleProps {\n /** Calendar icon component */\n CalendarIcon: React.ComponentType<{ className?: string }>;\n /** ChevronDown icon component */\n ChevronDownIcon: React.ComponentType<{ className?: string }>;\n /** Current value */\n value?: MonthPickerValue;\n /** Callback when value changes */\n onValueChange?: (value: MonthPickerValue | undefined) => void;\n /** Placeholder text when no value */\n placeholder?: string;\n /** Date format string for display */\n dateFormat?: string;\n /** Custom className for trigger button */\n className?: string;\n /** Year range for selection */\n yearRange?: { start: number; end: number };\n /** Default to range mode when opening */\n defaultRangeMode?: boolean;\n}\n\nconst MONTHS = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n\nexport function MonthPickerMultiple({\n CalendarIcon,\n ChevronDownIcon,\n value,\n onValueChange,\n placeholder,\n dateFormat = \"MMM/yyyy\",\n className = \"\",\n yearRange = { start: 2020, end: 2030 },\n defaultRangeMode = false,\n}: MonthPickerMultipleProps) {\n const { SD } = useSonamuBaseContext();\n\n // Popover open state\n const [isOpen, setIsOpen] = React.useState(false);\n\n // Temp states (managed internally)\n const [tempIsRangeMode, setTempIsRangeMode] = React.useState(defaultRangeMode);\n const [tempDate, setTempDate] = React.useState<Date | undefined>();\n const [tempDateRange, setTempDateRange] = React.useState<DateRange | undefined>();\n const [tempYear, setTempYear] = React.useState(new Date().getFullYear());\n const [tempRangeStartYear, setTempRangeStartYear] = React.useState(new Date().getFullYear());\n const [tempRangeEndYear, setTempRangeEndYear] = React.useState(new Date().getFullYear());\n\n const years = React.useMemo(\n () =>\n Array.from({ length: yearRange.end - yearRange.start + 1 }, (_, i) => yearRange.start + i),\n [yearRange.start, yearRange.end],\n );\n\n // Initialize temp states when popover opens\n React.useEffect(() => {\n if (isOpen) {\n if (value?.type === \"range\") {\n setTempIsRangeMode(true);\n setTempDateRange({ from: value.from, to: value.to });\n setTempDate(undefined);\n setTempRangeStartYear(value.from.getFullYear());\n setTempRangeEndYear(value.to.getFullYear());\n } else if (value?.type === \"single\") {\n setTempIsRangeMode(false);\n setTempDate(value.date);\n setTempDateRange(undefined);\n setTempYear(value.date.getFullYear());\n } else {\n setTempIsRangeMode(defaultRangeMode);\n setTempDate(undefined);\n setTempDateRange(undefined);\n setTempYear(new Date().getFullYear());\n setTempRangeStartYear(new Date().getFullYear());\n setTempRangeEndYear(new Date().getFullYear());\n }\n }\n }, [isOpen, value, defaultRangeMode]);\n\n const getDisplayDate = () => {\n if (!value) {\n return placeholder ?? `- ${format(new Date(), dateFormat)}`;\n }\n if (value.type === \"single\") {\n return format(value.date, dateFormat);\n }\n return `${format(value.from, dateFormat)} - ${format(value.to, dateFormat)}`;\n };\n\n const handleModeChange = (isRangeMode: boolean) => {\n setTempIsRangeMode(isRangeMode);\n if (isRangeMode) {\n setTempDate(undefined);\n } else {\n setTempDateRange(undefined);\n }\n };\n\n const handleSave = () => {\n let newValue: MonthPickerValue | undefined;\n\n if (tempIsRangeMode && tempDateRange?.from && tempDateRange?.to) {\n newValue = {\n type: \"range\",\n from: tempDateRange.from,\n to: tempDateRange.to,\n };\n } else if (!tempIsRangeMode && tempDate) {\n newValue = { type: \"single\", date: tempDate };\n }\n\n onValueChange?.(newValue);\n setIsOpen(false);\n };\n\n const handleCancel = () => {\n setIsOpen(false);\n };\n\n return (\n <div className=\"flex items-center gap-4\">\n <Popover open={isOpen} onOpenChange={setIsOpen}>\n <PopoverTrigger asChild>\n <Button variant=\"outline\" className={`gap-2 h-8 text-xs ${className}`}>\n <CalendarIcon className=\"h-4 w-4\" />\n {getDisplayDate()}\n <ChevronDownIcon className=\"h-4 w-4\" />\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0\" align=\"start\">\n <div className=\"p-3 border-b space-y-2\">\n <div className=\"flex gap-2\">\n <Button\n variant={!tempIsRangeMode ? \"default\" : \"outline\"}\n size=\"sm\"\n onClick={() => handleModeChange(false)}\n className=\"flex-1 h-7 text-xs\"\n >\n {SD(\"rc.monthPickerMultiple.singleDate\")}\n </Button>\n <Button\n variant={tempIsRangeMode ? \"default\" : \"outline\"}\n size=\"sm\"\n onClick={() => handleModeChange(true)}\n className=\"flex-1 h-7 text-xs\"\n >\n {SD(\"rc.monthPickerMultiple.dateRange\")}\n </Button>\n </div>\n </div>\n {tempIsRangeMode ? (\n <div className=\"flex\">\n {/* Start Date */}\n <div className=\"p-4 space-y-2\">\n <div className=\"text-xs text-muted-foreground\">\n {SD(\"rc.monthPickerMultiple.startDate\")}\n </div>\n <Select\n value={tempRangeStartYear}\n onValueChange={(value) => {\n if (value !== undefined) setTempRangeStartYear(value);\n }}\n items={years.map((year) => ({\n value: year,\n label: String(year),\n disabled: tempDateRange?.to ? year > tempDateRange.to.getFullYear() : false,\n }))}\n className=\"h-8 text-xs\"\n />\n <div className=\"grid grid-cols-3 gap-2\">\n {MONTHS.map((month, idx) => {\n const isDisabled = tempDateRange?.to\n ? tempRangeStartYear > tempDateRange.to.getFullYear() ||\n (tempRangeStartYear === tempDateRange.to.getFullYear() &&\n idx > tempDateRange.to.getMonth())\n : false;\n return (\n <Button\n key={month}\n variant={\n tempDateRange?.from?.getMonth() === idx &&\n tempDateRange?.from?.getFullYear() === tempRangeStartYear\n ? \"default\"\n : \"outline\"\n }\n size=\"sm\"\n onClick={() => {\n const newDate = new Date(tempRangeStartYear, idx, 1);\n // 이미 선택된 시작 월을 다시 클릭하면 해제\n if (\n tempDateRange?.from?.getMonth() === idx &&\n tempDateRange?.from?.getFullYear() === tempRangeStartYear\n ) {\n setTempDateRange({ from: undefined, to: tempDateRange?.to });\n } else {\n setTempDateRange({ from: newDate, to: tempDateRange?.to });\n }\n }}\n disabled={isDisabled}\n className=\"h-8 text-xs\"\n >\n {month}\n </Button>\n );\n })}\n </div>\n </div>\n {/* Divider */}\n <div className=\"border-r\" />\n {/* End Date */}\n <div className=\"p-4 space-y-2\">\n <div className=\"text-xs text-muted-foreground\">\n {SD(\"rc.monthPickerMultiple.endDate\")}\n </div>\n <Select\n value={tempRangeEndYear}\n onValueChange={(value) => {\n if (value !== undefined) setTempRangeEndYear(value);\n }}\n items={years.map((year) => ({\n value: year,\n label: String(year),\n disabled: tempDateRange?.from ? year < tempDateRange.from.getFullYear() : false,\n }))}\n className=\"h-8 text-xs\"\n />\n <div className=\"grid grid-cols-3 gap-2\">\n {MONTHS.map((month, idx) => {\n const isDisabled = tempDateRange?.from\n ? tempRangeEndYear < tempDateRange.from.getFullYear() ||\n (tempRangeEndYear === tempDateRange.from.getFullYear() &&\n idx < tempDateRange.from.getMonth())\n : false;\n return (\n <Button\n key={month}\n variant={\n tempDateRange?.to?.getMonth() === idx &&\n tempDateRange?.to?.getFullYear() === tempRangeEndYear\n ? \"default\"\n : \"outline\"\n }\n size=\"sm\"\n onClick={() => {\n const newDate = new Date(tempRangeEndYear, idx, 1);\n // 이미 선택된 종료 월을 다시 클릭하면 해제\n if (\n tempDateRange?.to?.getMonth() === idx &&\n tempDateRange?.to?.getFullYear() === tempRangeEndYear\n ) {\n setTempDateRange({ from: tempDateRange?.from, to: undefined });\n } else {\n setTempDateRange({ from: tempDateRange?.from, to: newDate });\n }\n }}\n disabled={isDisabled}\n className=\"h-8 text-xs\"\n >\n {month}\n </Button>\n );\n })}\n </div>\n </div>\n </div>\n ) : (\n <div className=\"p-4 space-y-2\">\n <Select\n value={tempYear}\n onValueChange={(value) => {\n if (value !== undefined) setTempYear(value);\n }}\n items={years.map((year) => ({ value: year, label: String(year) }))}\n className=\"h-8 text-xs\"\n />\n <div className=\"grid grid-cols-3 gap-2\">\n {MONTHS.map((month, idx) => (\n <Button\n key={month}\n variant={\n tempDate?.getMonth() === idx && tempDate?.getFullYear() === tempYear\n ? \"default\"\n : \"outline\"\n }\n size=\"sm\"\n onClick={() => {\n const newDate = new Date(tempYear, idx, 1);\n // 이미 선택된 월을 다시 클릭하면 해제\n if (tempDate?.getMonth() === idx && tempDate?.getFullYear() === tempYear) {\n setTempDate(undefined);\n } else {\n setTempDate(newDate);\n }\n }}\n className=\"h-8 text-xs\"\n >\n {month}\n </Button>\n ))}\n </div>\n </div>\n )}\n <div className=\"p-3 border-t flex justify-end gap-2\">\n <Button variant=\"outline\" size=\"sm\" onClick={handleCancel} className=\"h-8 text-xs\">\n {SD(\"rc.common.cancel\")}\n </Button>\n <Button variant=\"default\" size=\"sm\" onClick={handleSave} className=\"h-8 text-xs\">\n {SD(\"rc.common.save\")}\n </Button>\n </div>\n </PopoverContent>\n </Popover>\n </div>\n );\n}\n","import * as NavigationMenuPrimitive from \"@radix-ui/react-navigation-menu\";\nimport { cva } from \"class-variance-authority\";\nimport * as React from \"react\";\nimport ChevronDownIcon from \"~icons/lucide/chevron-down\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst NavigationMenu = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>\n>(({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Root\n ref={ref}\n className={cn(\"relative z-10 flex max-w-max flex-1 items-center justify-center\", className)}\n {...props}\n >\n {children}\n <NavigationMenuViewport />\n </NavigationMenuPrimitive.Root>\n));\nNavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;\n\nconst NavigationMenuList = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.List\n ref={ref}\n className={cn(\"group flex flex-1 list-none items-center justify-center space-x-1\", className)}\n {...props}\n />\n));\nNavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;\n\nconst NavigationMenuItem = NavigationMenuPrimitive.Item;\n\nconst navigationMenuTriggerStyle = cva(\n \"group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:text-accent-foreground data-[state=open]:bg-accent/50 data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent\",\n);\n\nconst NavigationMenuTrigger = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Trigger\n ref={ref}\n className={cn(navigationMenuTriggerStyle(), \"group\", className)}\n {...props}\n >\n {children}{\" \"}\n <ChevronDownIcon\n className=\"relative top-px ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180\"\n aria-hidden=\"true\"\n />\n </NavigationMenuPrimitive.Trigger>\n));\nNavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;\n\nconst NavigationMenuContent = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Content\n ref={ref}\n className={cn(\n \"left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto \",\n className,\n )}\n {...props}\n />\n));\nNavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;\n\nconst NavigationMenuLink = NavigationMenuPrimitive.Link;\n\nconst NavigationMenuViewport = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Viewport>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>\n>(({ className, ...props }, ref) => (\n <div className={cn(\"absolute left-0 top-full flex justify-center\")}>\n <NavigationMenuPrimitive.Viewport\n className={cn(\n \"origin-top-center relative mt-1.5 h-(--radix-navigation-menu-viewport-height) w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-(--radix-navigation-menu-viewport-width)\",\n className,\n )}\n ref={ref}\n {...props}\n />\n </div>\n));\nNavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;\n\nconst NavigationMenuIndicator = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Indicator>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Indicator\n ref={ref}\n className={cn(\n \"top-full z-1 flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in\",\n className,\n )}\n {...props}\n >\n <div className=\"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md\" />\n </NavigationMenuPrimitive.Indicator>\n));\nNavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;\n\nexport {\n navigationMenuTriggerStyle,\n NavigationMenu,\n NavigationMenuList,\n NavigationMenuItem,\n NavigationMenuContent,\n NavigationMenuTrigger,\n NavigationMenuLink,\n NavigationMenuIndicator,\n NavigationMenuViewport,\n};\n","import * as React from \"react\";\n\nimport { useSonamuBaseContext } from \"../../contexts\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"./button\";\n\nexport interface PaginationProps {\n value: number;\n onValueChange: (page: number) => void;\n total: number;\n itemsPerPage: number;\n className?: string;\n maxVisible?: number;\n}\n\nexport const Pagination = React.forwardRef<HTMLDivElement, PaginationProps>(\n ({ value, onValueChange, total, itemsPerPage, className, maxVisible = 6 }, ref) => {\n const { SD } = useSonamuBaseContext();\n const totalPages = Math.ceil(total / itemsPerPage);\n const currentPage = value;\n const startItem = (currentPage - 1) * itemsPerPage + 1;\n const endItem = Math.min(currentPage * itemsPerPage, total);\n\n return (\n <div ref={ref} className={cn(\"flex items-center justify-between pt-6\", className)}>\n <div className=\"text-xs text-muted-foreground\">\n {(\n SD(\"rc.pagination.showing\") as unknown as (\n start: number,\n end: number,\n total: number,\n ) => string\n )(startItem, endItem, total)}\n </div>\n <div className=\"flex items-center gap-2\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"h-8 px-3 text-xs\"\n disabled={currentPage === 1}\n onClick={() => onValueChange(currentPage - 1)}\n >\n {SD(\"rc.pagination.previous\")}\n </Button>\n <div className=\"flex items-center gap-1\">\n {(() => {\n let startPage = Math.max(1, currentPage - Math.floor(maxVisible / 2));\n const endPage = Math.min(totalPages, startPage + maxVisible - 1);\n if (endPage - startPage + 1 < maxVisible) {\n startPage = Math.max(1, endPage - maxVisible + 1);\n }\n return Array.from({ length: endPage - startPage + 1 }, (_, i) => startPage + i).map(\n (page) => (\n <Button\n key={page}\n variant=\"outline\"\n size=\"sm\"\n className={`h-8 w-8 text-xs ${page === currentPage ? \"bg-primary text-primary-foreground\" : \"\"}`}\n onClick={() => onValueChange(page)}\n >\n {page}\n </Button>\n ),\n );\n })()}\n </div>\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"h-8 px-3 text-xs\"\n disabled={currentPage === totalPages}\n onClick={() => onValueChange(currentPage + 1)}\n >\n {SD(\"rc.pagination.next\")}\n </Button>\n </div>\n </div>\n );\n },\n);\n\nPagination.displayName = \"Pagination\";\n","\"use client\";\n\nimport * as ProgressPrimitive from \"@radix-ui/react-progress\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Progress = React.forwardRef<\n React.ComponentRef<typeof ProgressPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>\n>(({ className, value, ...props }, ref) => (\n <ProgressPrimitive.Root\n ref={ref}\n className={cn(\"relative h-4 w-full overflow-hidden rounded-full bg-secondary\", className)}\n {...props}\n >\n <ProgressPrimitive.Indicator\n className=\"h-full w-full flex-1 bg-primary transition-all\"\n style={{ transform: `translateX(-${100 - (value || 0)}%)` }}\n />\n </ProgressPrimitive.Root>\n));\nProgress.displayName = ProgressPrimitive.Root.displayName;\n\nexport { Progress };\n","\"use client\";\n\nimport * as RadioGroupPrimitive from \"@radix-ui/react-radio-group\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst RadioGroup = React.forwardRef<\n React.ComponentRef<typeof RadioGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>\n>(({ className, ...props }, ref) => {\n return <RadioGroupPrimitive.Root className={cn(\"grid gap-2\", className)} {...props} ref={ref} />;\n});\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName;\n\nconst RadioGroupItem = React.forwardRef<\n React.ComponentRef<typeof RadioGroupPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>\n>(({ className, ...props }, ref) => {\n return (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cn(\n \"aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"flex items-center justify-center\">\n <div className=\"h-2 w-2 rounded-full bg-current\" />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n );\n});\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;\n\nexport { RadioGroup, RadioGroupItem };\n","import { Input } from \"./input\";\n\nexport type RangeNumberInputProps = {\n value?: [number | undefined, number | undefined];\n onChange?: (value: [number | undefined, number | undefined]) => void;\n placeholder?: [string, string];\n disabled?: boolean;\n className?: string;\n};\n\n/**\n * Range Number Input 컴포넌트\n *\n * between 연산자에서 사용\n * [min, max] 두 개의 숫자 입력\n */\nexport function RangeNumberInput({\n value = [undefined, undefined],\n onChange,\n placeholder = [\"최소값\", \"최대값\"],\n disabled,\n className,\n}: RangeNumberInputProps) {\n const [min, max] = value;\n\n const handleMinChange = (v: string) => {\n const newMin = v === \"\" ? undefined : Number(v);\n onChange?.([newMin, max]);\n };\n\n const handleMaxChange = (v: string) => {\n const newMax = v === \"\" ? undefined : Number(v);\n onChange?.([min, newMax]);\n };\n\n return (\n <div className={`flex items-center gap-2 ${className}`}>\n <Input\n type=\"number\"\n value={min === undefined ? \"\" : String(min)}\n onValueChange={handleMinChange}\n placeholder={placeholder[0]}\n disabled={disabled}\n className=\"flex-1\"\n />\n <span className=\"text-muted-foreground\">~</span>\n <Input\n type=\"number\"\n value={max === undefined ? \"\" : String(max)}\n onValueChange={handleMaxChange}\n placeholder={placeholder[1]}\n disabled={disabled}\n className=\"flex-1\"\n />\n </div>\n );\n}\n","\"use client\";\n\nimport * as ResizablePrimitive from \"react-resizable-panels\";\nimport GripVerticalIcon from \"~icons/lucide/grip-vertical\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst ResizablePanelGroup = ({\n className,\n ...props\n}: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => (\n <ResizablePrimitive.PanelGroup\n className={cn(\"flex h-full w-full data-[panel-group-direction=vertical]:flex-col\", className)}\n {...props}\n />\n);\n\nconst ResizablePanel = ResizablePrimitive.Panel;\n\nconst ResizableHandle = ({\n withHandle,\n className,\n ...props\n}: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {\n withHandle?: boolean;\n}) => (\n <ResizablePrimitive.PanelResizeHandle\n className={cn(\n \"relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90\",\n className,\n )}\n {...props}\n >\n {withHandle && (\n <div className=\"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border\">\n <GripVerticalIcon className=\"h-2.5 w-2.5\" />\n </div>\n )}\n </ResizablePrimitive.PanelResizeHandle>\n);\n\nexport { ResizablePanelGroup, ResizablePanel, ResizableHandle };\n","\"use client\";\n\nimport * as ScrollAreaPrimitive from \"@radix-ui/react-scroll-area\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst ScrollArea = React.forwardRef<\n React.ComponentRef<typeof ScrollAreaPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>\n>(({ className, children, ...props }, ref) => (\n <ScrollAreaPrimitive.Root\n ref={ref}\n className={cn(\"relative overflow-hidden\", className)}\n {...props}\n >\n <ScrollAreaPrimitive.Viewport className=\"h-full w-full rounded-[inherit]\">\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n));\nScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;\n\nconst ScrollBar = React.forwardRef<\n React.ComponentRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>\n>(({ className, orientation = \"vertical\", ...props }, ref) => (\n <ScrollAreaPrimitive.ScrollAreaScrollbar\n ref={ref}\n orientation={orientation}\n className={cn(\n \"flex touch-none select-none transition-colors\",\n orientation === \"vertical\" && \"h-full w-2.5 border-l border-l-transparent p-px\",\n orientation === \"horizontal\" && \"h-2.5 flex-col border-t border-t-transparent p-px\",\n className,\n )}\n {...props}\n >\n <ScrollAreaPrimitive.ScrollAreaThumb className=\"relative flex-1 rounded-full bg-border\" />\n </ScrollAreaPrimitive.ScrollAreaScrollbar>\n));\nScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;\n\nexport { ScrollArea, ScrollBar };\n","import * as React from \"react\";\n\nimport { Select } from \"./select\";\n\n// ============================================================================\n// Type Definition\n// ============================================================================\n\n// EnumSelect Props\nexport type EnumSelectProps<TValue extends string = string> = {\n enum: { options: readonly TValue[] };\n labels: Record<TValue, string>;\n value?: TValue | TValue[] | \"\";\n onValueChange?: (value: TValue | TValue[] | \"\" | null | undefined) => void;\n placeholder?: string;\n textPrefix?: string;\n clearable?: boolean;\n disabled?: boolean;\n className?: string;\n multiple?: boolean;\n};\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport function EnumSelect<TValue extends string = string>({\n enum: zodEnum,\n labels,\n value,\n onValueChange,\n placeholder,\n textPrefix = \"\",\n clearable = false,\n disabled = false,\n className,\n multiple = false,\n}: EnumSelectProps<TValue>) {\n // Zod enum에서 options 추출 (빈 문자열 필터링 - Radix UI 제약)\n const validOptions = React.useMemo(() => {\n return zodEnum.options.filter((key: unknown) => (key as string) !== \"\");\n }, [zodEnum]);\n\n // items 구성\n const items = React.useMemo(() => {\n return validOptions.map((key) => ({\n value: key as string,\n label: textPrefix + labels[key],\n }));\n }, [validOptions, labels, textPrefix]);\n\n // Single 모드\n if (!multiple) {\n return (\n <Select\n items={items}\n value={(value as TValue | \"\" | undefined) ?? \"\"}\n onValueChange={(newValue: string | undefined) => {\n onValueChange?.(newValue as TValue | \"\" | null | undefined);\n }}\n placeholder={placeholder}\n clearable={clearable}\n disabled={disabled}\n className={className}\n multiple={false}\n async={false}\n />\n );\n }\n\n // Multiple 모드\n return (\n <Select\n items={items}\n value={(value as TValue[]) ?? []}\n onValueChange={(newValue: string[]) => {\n onValueChange?.(newValue as TValue[]);\n }}\n placeholder={placeholder}\n clearable={clearable}\n disabled={disabled}\n className={className}\n multiple={true}\n async={false}\n />\n );\n}\n","/* oxlint-disable @typescript-eslint/no-explicit-any */ // AsyncIdConfig의 useList params는 contravariance 때문에 any 필요 (unknown 사용시 구체적 타입 전달 불가)\n\nimport {\n type InfiniteData,\n type UseInfiniteQueryResult,\n type UseQueryResult,\n useQueryClient,\n} from \"@tanstack/react-query\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\n\nimport { useSonamuBaseContext } from \"@/contexts\";\n\nimport { Select } from \"./select\";\n\n// ============================================================================\n// Type Definition\n// ============================================================================\n\n// AsyncIdConfig 타입\n// services.generated.ts에서 생성되는 config와 호환됨\n// _TSubsetMapping은 onRowChange의 타입 추론에 사용됨\n// _TListParams는 baseListParams의 타입 추론에 사용됨\nexport type AsyncIdConfig<\n TSubsetKey extends string = string,\n _TSubsetMapping = Record<string, unknown>,\n _TListParams extends Record<string, unknown> = Record<string, unknown>,\n> = {\n placeholderKey: string;\n useList: <T extends TSubsetKey>(\n subset: T,\n params?: any,\n options?: { enabled?: boolean },\n ) => UseQueryResult<Record<string, unknown>>;\n // 무한스크롤용. sonamu services 생성기가 항상 주입합니다.\n // select로 rows/total이 평탄화되어 내려옵니다.\n useListInfinite: <T extends TSubsetKey>(\n subset: T,\n params?: any,\n options?: { enabled?: boolean },\n ) => UseInfiniteQueryResult<\n InfiniteData<{ rows: Record<string, unknown>[]; total: number }> & {\n rows: Record<string, unknown>[];\n total: number;\n },\n Error\n >;\n};\n\n// SubsetMapping에서 선택된 subset의 필드 키를 추출하는 유틸리티 타입\ntype SubsetFieldKeys<\n TSubsetKey extends string,\n TSubsetMapping,\n> = TSubsetKey extends keyof TSubsetMapping\n ? TSubsetMapping[TSubsetKey] extends Record<string, unknown>\n ? string & keyof TSubsetMapping[TSubsetKey]\n : string\n : string;\n\n// SubsetMapping에서 선택된 subset의 row 타입을 추출하는 유틸리티 타입\ntype SubsetRow<TSubsetKey extends string, TSubsetMapping> = TSubsetKey extends keyof TSubsetMapping\n ? TSubsetMapping[TSubsetKey]\n : Record<string, unknown>;\n\n// displayField: 필드명 또는 row 콜백 함수\ntype DisplayFieldAsString<TSubsetKey extends string, TSubsetMapping> = {\n displayField?: SubsetFieldKeys<TSubsetKey, TSubsetMapping>;\n};\ntype DisplayFieldAsCallback<TSubsetKey extends string, TSubsetMapping> = {\n displayField: (row: SubsetRow<TSubsetKey, TSubsetMapping>) => string;\n};\n\n// onRowChange의 row 파라미터 타입\ntype OnRowChangeType<\n TSubsetKey extends string,\n TSubsetMapping,\n> = TSubsetKey extends keyof TSubsetMapping\n ? TSubsetMapping[TSubsetKey] | TSubsetMapping[TSubsetKey][] | undefined\n : unknown;\n\n// IdAsyncSelect 공통 Props (displayField 제외)\ntype IdAsyncSelectBaseProps<\n TSubsetKey extends string = string,\n TSubsetMapping = Record<string, unknown>,\n TValue extends string | number = string,\n TListParams extends Record<string, unknown> = Record<string, unknown>,\n TSubset extends TSubsetKey = TSubsetKey,\n> = {\n // Entity Async ID Config\n config: AsyncIdConfig<TSubsetKey, TSubsetMapping, TListParams>;\n // Entity subset key\n subset: TSubset;\n // 검색/조회 시 적용될 파라미터\n baseListParams?: Partial<Omit<TListParams, \"keyword\" | \"page\">>;\n // 실제 저장/전송될 값의 필드명 (기본값: \"id\")\n valueField?: SubsetFieldKeys<TSubset, TSubsetMapping>;\n // 기본 Select Props\n placeholder?: string;\n clearable?: boolean;\n disabled?: boolean;\n className?: string;\n /** true이면 키워드 없이도 마운트 시 전체 목록을 즉시 로드 (소규모 데이터셋에 적합) */\n preload?: boolean;\n /** true이면 드롭다운 내 클라이언트 사이드 검색 필터를 표시 */\n searchable?: boolean;\n // Single/Multi 모드\n multiple?: boolean;\n value?: TValue | TValue[] | null;\n onValueChange?: (value: TValue | TValue[] | undefined) => void;\n onRowChange?: (row: OnRowChangeType<TSubset, TSubsetMapping>) => void;\n};\n\n// IdAsyncSelect Total Props\nexport type IdAsyncSelectProps<\n TSubsetKey extends string = string,\n TSubsetMapping = Record<string, unknown>,\n TValue extends string | number = string,\n TListParams extends Record<string, unknown> = Record<string, unknown>,\n TSubset extends TSubsetKey = TSubsetKey,\n> = IdAsyncSelectBaseProps<TSubsetKey, TSubsetMapping, TValue, TListParams, TSubset> &\n (DisplayFieldAsString<TSubset, TSubsetMapping> | DisplayFieldAsCallback<TSubset, TSubsetMapping>);\n\n// ============================================================================\n// Component\n// ============================================================================\n\n// name-like 컨럼을 찾기 위한 후보 필드명 (우선순위 순)\nconst NAME_LIKE_FIELDS = [\"name\", \"title\", \"label\", \"display_name\", \"username\"];\n\n/**\n * row 데이터에서 name-like 필드를 자동 탐지\n */\nfunction detectDisplayField(row: Record<string, unknown>): string {\n // 1) name-like 필드 찾기\n for (const field of NAME_LIKE_FIELDS) {\n if (Object.keys(row).includes(field)) {\n return field;\n }\n }\n // 2) string 타입인 첫 번째 컨럼 (id 제외)\n for (const [key, val] of Object.entries(row)) {\n if (key !== \"id\" && typeof val === \"string\") {\n return key;\n }\n }\n // 3) fallback\n return \"id\";\n}\n\nexport function IdAsyncSelect<\n TSubsetKey extends string = string,\n TSubsetMapping = Record<string, unknown>,\n TValue extends string | number = string,\n TListParams extends Record<string, unknown> = Record<string, unknown>,\n TSubset extends TSubsetKey = TSubsetKey,\n>({\n config,\n subset,\n baseListParams,\n displayField,\n valueField = \"id\" as SubsetFieldKeys<TSubset, TSubsetMapping>,\n placeholder,\n clearable,\n disabled,\n className,\n multiple = false,\n preload = false,\n searchable,\n value,\n onValueChange,\n onRowChange,\n}: IdAsyncSelectProps<TSubsetKey, TSubsetMapping, TValue, TListParams, TSubset>) {\n const { SD } = useSonamuBaseContext();\n const queryClient = useQueryClient();\n\n // onRowChange의 파라미터 타입\n type RowChangeParam = Parameters<NonNullable<typeof onRowChange>>[0];\n\n // displayField 해석: 콜백 / 필드명 / 자동탐지\n const isDisplayFieldCallback = typeof displayField === \"function\";\n\n // row에서 label을 추출하는 함수\n const getLabel = useCallback(\n (row: Record<string, unknown>): string => {\n if (isDisplayFieldCallback) {\n return (displayField as (row: any) => string)(row);\n }\n const field = typeof displayField === \"string\" ? displayField : detectDisplayField(row);\n return String(row[field] ?? \"\");\n },\n [displayField, isDisplayFieldCallback],\n );\n\n // keyword 상태 관리 (사용자 입력 검색어만 관리)\n const [keyword, setKeyword] = useState<string | undefined>(undefined);\n\n // handleSearch는 keyword state만 갱신합니다.\n // 캐시 삭제 오버로딩 금지: backspace로 검색어를 전부 지운 케이스와 드롭다운 닫힘을 구분할 수 없으면\n // multi 모드에서 영구 빈 상태에 빠집니다. 닫힘 신호는 오직 onOpenChange로 받습니다.\n const handleSearch = useCallback((kw: string) => {\n setKeyword(kw || undefined);\n }, []);\n\n // 유틸\n const isNotEmpty = (val: unknown): boolean => {\n if (val == null || val === \"\") {\n return false;\n }\n if (typeof val === \"number\") {\n return val !== 0 && !Number.isNaN(val);\n }\n return true;\n };\n\n // baseListParams에 search/orderBy/queryMode 외의 의미 있는 필터값이 있는지 확인\n const IGNORED_FILTER_KEYS = new Set([\"search\", \"orderBy\", \"queryMode\", \"num\", \"page\", \"keyword\"]);\n const hasBaseFilter =\n baseListParams != null &&\n Object.entries(baseListParams).some(([k, v]) => !IGNORED_FILTER_KEYS.has(k) && isNotEmpty(v));\n\n // preload 또는 baseFilter가 있으면 드롭다운 모드로 취급 (비검색 상태에서도 목록 즉시 노출)\n const isDropdown = preload || hasBaseFilter;\n\n // 리스트 조회는 항상 useListInfinite 단일 경로\n // baseListParams(외부 필터) + keyword(사용자 검색어) 병합\n const queryParams = {\n ...baseListParams,\n ...(keyword ? { keyword } : {}),\n };\n\n const infiniteEnabled =\n isDropdown ||\n (typeof keyword === \"string\" && keyword.length > 0) ||\n (multiple && Array.isArray(value) && value.length > 0);\n\n const infiniteQuery = config.useListInfinite(subset, queryParams, {\n enabled: infiniteEnabled,\n });\n\n const rows = (infiniteQuery.data?.rows ?? []) as Record<string, unknown>[];\n const listLoading = infiniteQuery.isLoading;\n const error = infiniteQuery.error ?? undefined;\n\n // Single 모드: 선택된 값 로드 (라벨 미리보기용, useList 단건 조회로 캐시 공유)\n const singleValue = !multiple && isNotEmpty(value) ? (value as TValue) : null;\n\n const selectedInRows = useMemo(\n () => rows.find((row) => row[valueField] === singleValue),\n [rows, singleValue, valueField],\n );\n\n const shouldLoadById = singleValue != null && !selectedInRows;\n const selectedQuery = config.useList(\n subset,\n { id: singleValue, num: 1, page: 1 },\n { enabled: shouldLoadById },\n );\n\n const selectedRow =\n (selectedQuery.data?.rows as Record<string, unknown>[] | undefined)?.[0] || selectedInRows;\n\n // Multi 모드: 선택된 값들 로드 (라벨 미리보기용)\n const multiValues = multiple && Array.isArray(value) ? value : [];\n\n const selectedMultiInRows = useMemo(\n () => multiValues.map((val) => rows.find((row) => row[valueField] === val)).filter(Boolean),\n [rows, multiValues, valueField],\n );\n\n const selectedMultiIds = useMemo(() => {\n const foundIds = new Set(selectedMultiInRows.map((row) => row?.[valueField]));\n return multiValues.filter((val) => !foundIds.has(val));\n }, [multiValues, selectedMultiInRows, valueField]);\n\n const shouldLoadByIds = selectedMultiIds.length > 0;\n const multiSelectedQuery = config.useList(\n subset,\n { id: selectedMultiIds, num: selectedMultiIds.length, page: 1 },\n { enabled: shouldLoadByIds },\n );\n\n const multiSelectedRows = useMemo(() => {\n const queryRows = (multiSelectedQuery.data?.rows ?? []) as Record<string, unknown>[];\n return [...selectedMultiInRows, ...queryRows] as Record<string, unknown>[];\n }, [selectedMultiInRows, multiSelectedQuery.data]);\n\n const isLoading =\n listLoading ||\n (shouldLoadById && selectedQuery.isLoading) ||\n (shouldLoadByIds && multiSelectedQuery.isLoading);\n\n // 캐시 제어\n // 드롭다운이 닫힐 때 이 subset의 모든 infinite 쿼리를 reset하여\n // 재오픈 시 첫 페이지부터 fresh하게 시작하도록 합니다.\n const resetAllInfiniteQueriesForSubset = useCallback(() => {\n queryClient.resetQueries({\n predicate: (q) => {\n const key = q.queryKey as unknown[];\n return Array.isArray(key) && key[2] === \"infinite\" && key[3] === subset;\n },\n });\n }, [queryClient, subset]);\n\n // 이전 keyword의 infinite 쿼리를 제거하여 메모리 누수를 줄입니다.\n const removeInfiniteQueriesForKeyword = useCallback(\n (targetKeyword: string | undefined) => {\n queryClient.removeQueries({\n predicate: (q) => {\n const key = q.queryKey as unknown[];\n if (!Array.isArray(key) || key[2] !== \"infinite\" || key[3] !== subset) {\n return false;\n }\n const params = key[4] as { keyword?: unknown } | undefined;\n return params?.keyword === targetKeyword;\n },\n });\n },\n [queryClient, subset],\n );\n\n const prevKeywordRef = useRef<string | undefined>(undefined);\n useEffect(() => {\n const prev = prevKeywordRef.current;\n if (prev !== keyword) {\n // 첫 마운트 때(prev === undefined, keyword === undefined)는 아무것도 제거하지 않도록\n // prev !== keyword 판단만으로 충분하지만, undefined → undefined는 등식이 성립하므로 자연 스킵됩니다.\n removeInfiniteQueriesForKeyword(prev);\n }\n prevKeywordRef.current = keyword;\n }, [keyword, removeInfiniteQueriesForKeyword]);\n\n const handleOpenChange = useCallback(\n (open: boolean) => {\n if (!open) {\n resetAllInfiniteQueriesForSubset();\n }\n },\n [resetAllInfiniteQueriesForSubset],\n );\n\n const handleLoadMore = useCallback(() => {\n if (infiniteQuery.hasNextPage && !infiniteQuery.isFetchingNextPage) {\n infiniteQuery.fetchNextPage();\n }\n }, [infiniteQuery]);\n\n // itemMap + rowMap\n const { items, rowMap } = useMemo(() => {\n const rowMap = new Map<TValue, Record<string, unknown>>();\n const itemMap = new Map<TValue, { value: TValue; label: string }>();\n\n // Single 모드: 선택된 항목 추가\n if (!multiple && selectedRow && singleValue != null) {\n rowMap.set(singleValue, selectedRow);\n itemMap.set(singleValue, {\n value: singleValue,\n label: getLabel(selectedRow),\n });\n }\n\n // Multi 모드: 선택된 항목들 추가\n if (multiple && multiSelectedRows.length > 0) {\n for (const row of multiSelectedRows) {\n const val = row[valueField] as TValue;\n rowMap.set(val, row);\n itemMap.set(val, {\n value: val,\n label: getLabel(row),\n });\n }\n }\n\n // 검색 결과 추가\n for (const row of rows) {\n const val = row[valueField] as TValue;\n rowMap.set(val, row);\n itemMap.set(val, {\n value: val,\n label: getLabel(row),\n });\n }\n\n return {\n items: Array.from(itemMap.values()),\n rowMap,\n };\n }, [rows, selectedRow, singleValue, multiSelectedRows, multiple, getLabel, valueField]);\n\n // Select 렌더링\n const valueKey = (v: TValue) => String(v);\n const hasMore = !!infiniteQuery.hasNextPage;\n const isLoadingMore = !!infiniteQuery.isFetchingNextPage;\n\n // isDropdown 모드는 검색창 없이 목록을 즉시 노출하는 UX가 기본입니다.\n // 데이터 소스는 어느 모드든 동일하게 서버(useListInfinite)이므로 async=true 경로로 통일하고,\n // 검색창 노출 여부만 searchable 축으로 제어합니다. 기본값은 isDropdown일 때 false, 그 외는 true이며\n // 호출자가 searchable을 명시하면 명시값이 우선합니다.\n const searchableDefault = !isDropdown;\n const isSearchableVisible = searchable ?? searchableDefault;\n\n if (!multiple) {\n return (\n <Select\n items={items}\n valueKey={valueKey}\n value={singleValue ?? undefined}\n onValueChange={(newValue: TValue | undefined) => {\n onValueChange?.(newValue);\n onRowChange?.((newValue ? rowMap.get(newValue) : undefined) as RowChangeParam);\n }}\n placeholder={placeholder ?? SD(config.placeholderKey)}\n clearable={clearable}\n disabled={disabled}\n className={className}\n multiple={false}\n async={true}\n searchable={isSearchableVisible}\n loading={isLoading}\n error={error}\n onSearch={handleSearch}\n onOpenChange={handleOpenChange}\n onLoadMore={handleLoadMore}\n hasMore={hasMore}\n isLoadingMore={isLoadingMore}\n />\n );\n }\n\n return (\n <Select\n items={items}\n valueKey={valueKey}\n value={(value as TValue[]) ?? []}\n onValueChange={(newValue: TValue[]) => {\n onValueChange?.(newValue);\n onRowChange?.(newValue.map((val) => rowMap.get(val)).filter(Boolean) as RowChangeParam);\n }}\n placeholder={placeholder ?? SD(config.placeholderKey)}\n clearable={clearable}\n disabled={disabled}\n className={className}\n multiple={true}\n async={true}\n searchable={isSearchableVisible}\n loading={isLoading}\n error={error}\n onSearch={handleSearch}\n onOpenChange={handleOpenChange}\n onLoadMore={handleLoadMore}\n hasMore={hasMore}\n isLoadingMore={isLoadingMore}\n />\n );\n}\n","import * as SheetPrimitive from \"@radix-ui/react-dialog\";\nimport { cva } from \"class-variance-authority\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\nimport XIcon from \"~icons/lucide/x\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Sheet = SheetPrimitive.Root;\n\nconst SheetTrigger = SheetPrimitive.Trigger;\n\nconst SheetClose = SheetPrimitive.Close;\n\nconst SheetPortal = SheetPrimitive.Portal;\n\nconst SheetOverlay = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Overlay\n className={cn(\n \"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className,\n )}\n {...props}\n ref={ref}\n />\n));\nSheetOverlay.displayName = SheetPrimitive.Overlay.displayName;\n\nconst sheetVariantsConfig = {\n side: {\n top: \"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top\",\n bottom:\n \"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom\",\n left: \"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm\",\n right:\n \"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm\",\n },\n} as const;\n\nconst sheetVariants = cva(\n \"fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500\",\n {\n variants: sheetVariantsConfig,\n defaultVariants: {\n side: \"right\",\n },\n },\n);\n\ninterface SheetContentProps\n extends\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,\n VariantProps<typeof sheetVariants> {}\n\nconst SheetContent = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Content>,\n SheetContentProps\n>(({ side = \"right\", className, children, ...props }, ref) => (\n <SheetPortal>\n <SheetOverlay />\n <SheetPrimitive.Content ref={ref} className={cn(sheetVariants({ side }), className)} {...props}>\n {children}\n <SheetPrimitive.Close className=\"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary\">\n <XIcon className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n </SheetPrimitive.Content>\n </SheetPortal>\n));\nSheetContent.displayName = SheetPrimitive.Content.displayName;\n\nconst SheetHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn(\"flex flex-col space-y-2 text-center sm:text-left\", className)} {...props} />\n);\nSheetHeader.displayName = \"SheetHeader\";\n\nconst SheetFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\", className)}\n {...props}\n />\n);\nSheetFooter.displayName = \"SheetFooter\";\n\nconst SheetTitle = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold text-foreground\", className)}\n {...props}\n />\n));\nSheetTitle.displayName = SheetPrimitive.Title.displayName;\n\nconst SheetDescription = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nSheetDescription.displayName = SheetPrimitive.Description.displayName;\n\nexport {\n Sheet,\n SheetPortal,\n SheetOverlay,\n SheetTrigger,\n SheetClose,\n SheetContent,\n sheetVariantsConfig,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n};\n","import * as React from \"react\";\n\nconst MOBILE_BREAKPOINT = 768;\n\nexport function useIsMobile() {\n const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined);\n\n React.useEffect(() => {\n const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);\n const onChange = () => {\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n };\n mql.addEventListener(\"change\", onChange);\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n return () => mql.removeEventListener(\"change\", onChange);\n }, []);\n\n return !!isMobile;\n}\n","import { cn } from \"../../lib/utils\";\n\nfunction Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n return <div className={cn(\"animate-pulse rounded-md bg-muted\", className)} {...props} />;\n}\n\nexport { Skeleton };\n","import * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst TooltipProvider = TooltipPrimitive.Provider;\n\nconst Tooltip = TooltipPrimitive.Root;\n\nconst TooltipTrigger = TooltipPrimitive.Trigger;\n\nconst TooltipContent = React.forwardRef<\n React.ComponentRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]\",\n className,\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\n","\"use client\";\n\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva } from \"class-variance-authority\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\nimport PanelLeftIcon from \"~icons/lucide/panel-left\";\n\nimport { useIsMobile } from \"../../lib/use-mobile\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"./button\";\nimport { Input } from \"./input\";\nimport { Separator } from \"./separator\";\nimport { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from \"./sheet\";\nimport { Skeleton } from \"./skeleton\";\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from \"./tooltip\";\n\nconst SIDEBAR_WIDTH = \"16rem\";\nconst SIDEBAR_WIDTH_MOBILE = \"18rem\";\nconst SIDEBAR_WIDTH_ICON = \"3rem\";\nconst SIDEBAR_KEYBOARD_SHORTCUT = \"b\";\n\ntype SidebarContextProps = {\n state: \"expanded\" | \"collapsed\";\n open: boolean;\n setOpen: (open: boolean) => void;\n openMobile: boolean;\n setOpenMobile: (open: boolean) => void;\n isMobile: boolean;\n toggleSidebar: () => void;\n};\n\nconst SidebarContext = React.createContext<SidebarContextProps | null>(null);\n\nfunction useSidebar() {\n const context = React.useContext(SidebarContext);\n if (!context) {\n throw new Error(\"useSidebar must be used within a SidebarProvider.\");\n }\n\n return context;\n}\n\nfunction SidebarProvider({\n defaultOpen = true,\n open: openProp,\n onOpenChange: setOpenProp,\n className,\n style,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & {\n defaultOpen?: boolean;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n}) {\n const isMobile = useIsMobile();\n const [openMobile, setOpenMobile] = React.useState(false);\n\n // This is the internal state of the sidebar.\n // We use openProp and setOpenProp for control from outside the component.\n const [_open, _setOpen] = React.useState(defaultOpen);\n const open = openProp ?? _open;\n const setOpen = React.useCallback(\n (value: boolean | ((value: boolean) => boolean)) => {\n const openState = typeof value === \"function\" ? value(open) : value;\n if (setOpenProp) {\n setOpenProp(openState);\n } else {\n _setOpen(openState);\n }\n },\n [setOpenProp, open],\n );\n\n // Helper to toggle the sidebar.\n const toggleSidebar = React.useCallback(() => {\n return isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open);\n }, [isMobile, setOpen, setOpenMobile]);\n\n // Adds a keyboard shortcut to toggle the sidebar.\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {\n event.preventDefault();\n toggleSidebar();\n }\n };\n\n window.addEventListener(\"keydown\", handleKeyDown);\n return () => window.removeEventListener(\"keydown\", handleKeyDown);\n }, [toggleSidebar]);\n\n // We add a state so that we can do data-state=\"expanded\" or \"collapsed\".\n // This makes it easier to style the sidebar with Tailwind classes.\n const state = open ? \"expanded\" : \"collapsed\";\n\n const contextValue = React.useMemo<SidebarContextProps>(\n () => ({\n state,\n open,\n setOpen,\n isMobile,\n openMobile,\n setOpenMobile,\n toggleSidebar,\n }),\n [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar],\n );\n\n return (\n <SidebarContext.Provider value={contextValue}>\n <TooltipProvider delayDuration={0}>\n <div\n data-slot=\"sidebar-wrapper\"\n style={\n {\n \"--sidebar-width\": SIDEBAR_WIDTH,\n \"--sidebar-width-icon\": SIDEBAR_WIDTH_ICON,\n ...style,\n } as React.CSSProperties\n }\n className={cn(\n \"group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full\",\n className,\n )}\n {...props}\n >\n {children}\n </div>\n </TooltipProvider>\n </SidebarContext.Provider>\n );\n}\n\nfunction Sidebar({\n side = \"left\",\n variant = \"sidebar\",\n collapsible = \"offcanvas\",\n className,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & {\n side?: \"left\" | \"right\";\n variant?: \"sidebar\" | \"floating\" | \"inset\";\n collapsible?: \"offcanvas\" | \"icon\" | \"none\";\n}) {\n const { isMobile, state, openMobile, setOpenMobile } = useSidebar();\n\n if (collapsible === \"none\") {\n return (\n <div\n data-slot=\"sidebar\"\n className={cn(\n \"bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col\",\n className,\n )}\n {...props}\n >\n {children}\n </div>\n );\n }\n\n if (isMobile) {\n return (\n <Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>\n <SheetContent\n data-sidebar=\"sidebar\"\n data-slot=\"sidebar\"\n data-mobile=\"true\"\n className=\"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden\"\n style={\n {\n \"--sidebar-width\": SIDEBAR_WIDTH_MOBILE,\n } as React.CSSProperties\n }\n side={side}\n >\n <SheetHeader className=\"sr-only\">\n <SheetTitle>Sidebar</SheetTitle>\n <SheetDescription>Displays the mobile sidebar.</SheetDescription>\n </SheetHeader>\n <div className=\"flex h-full w-full flex-col\">{children}</div>\n </SheetContent>\n </Sheet>\n );\n }\n\n return (\n <div\n className=\"group peer text-sidebar-foreground hidden md:block\"\n data-state={state}\n data-collapsible={state === \"collapsed\" ? collapsible : \"\"}\n data-variant={variant}\n data-side={side}\n data-slot=\"sidebar\"\n >\n {/* This is what handles the sidebar gap on desktop */}\n <div\n data-slot=\"sidebar-gap\"\n className={cn(\n \"relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear\",\n \"group-data-[collapsible=offcanvas]:w-0\",\n \"group-data-[side=right]:rotate-180\",\n variant === \"floating\" || variant === \"inset\"\n ? \"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+1rem)]\"\n : \"group-data-[collapsible=icon]:w-(--sidebar-width-icon)\",\n )}\n />\n <div\n data-slot=\"sidebar-container\"\n className={cn(\n \"fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex\",\n side === \"left\"\n ? \"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]\"\n : \"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]\",\n // Adjust the padding for floating and inset variants.\n variant === \"floating\" || variant === \"inset\"\n ? \"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+1rem+2px)]\"\n : \"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l\",\n className,\n )}\n {...props}\n >\n <div\n data-sidebar=\"sidebar\"\n data-slot=\"sidebar-inner\"\n className=\"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm\"\n >\n {children}\n </div>\n </div>\n </div>\n );\n}\n\nfunction SidebarTrigger({ className, onClick, ...props }: React.ComponentProps<typeof Button>) {\n const { toggleSidebar } = useSidebar();\n\n return (\n <Button\n data-sidebar=\"trigger\"\n data-slot=\"sidebar-trigger\"\n variant=\"ghost\"\n className={cn(\"size-7\", className)}\n onClick={(event) => {\n onClick?.(event);\n toggleSidebar();\n }}\n {...props}\n >\n <PanelLeftIcon />\n <span className=\"sr-only\">Toggle Sidebar</span>\n </Button>\n );\n}\n\nfunction SidebarRail({ className, ...props }: React.ComponentProps<\"button\">) {\n const { toggleSidebar } = useSidebar();\n\n return (\n <button\n data-sidebar=\"rail\"\n data-slot=\"sidebar-rail\"\n aria-label=\"Toggle Sidebar\"\n tabIndex={-1}\n onClick={toggleSidebar}\n title=\"Toggle Sidebar\"\n className={cn(\n \"hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex\",\n \"in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize\",\n \"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize\",\n \"hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full\",\n \"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2\",\n \"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarInset({ className, ...props }: React.ComponentProps<\"main\">) {\n return (\n <main\n data-slot=\"sidebar-inset\"\n className={cn(\n \"bg-background relative flex w-full flex-1 flex-col\",\n \"md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarInput({ className, ...props }: React.ComponentProps<typeof Input>) {\n return (\n <Input\n data-slot=\"sidebar-input\"\n data-sidebar=\"input\"\n className={cn(\"bg-background h-8 w-full shadow-none\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-header\"\n data-sidebar=\"header\"\n className={cn(\"flex shrink-0 flex-col gap-2 p-2\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-footer\"\n data-sidebar=\"footer\"\n className={cn(\"flex shrink-0 flex-col gap-2 p-2\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarSeparator({ className, ...props }: React.ComponentProps<typeof Separator>) {\n return (\n <Separator\n data-slot=\"sidebar-separator\"\n data-sidebar=\"separator\"\n className={cn(\"bg-sidebar-border mx-2 w-auto\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-content\"\n data-sidebar=\"content\"\n className={cn(\n \"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-group\"\n data-sidebar=\"group\"\n className={cn(\"relative flex w-full min-w-0 flex-col p-2\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarGroupLabel({\n className,\n asChild = false,\n ...props\n}: React.ComponentProps<\"div\"> & { asChild?: boolean }) {\n const Comp = asChild ? Slot : \"div\";\n\n return (\n <Comp\n data-slot=\"sidebar-group-label\"\n data-sidebar=\"group-label\"\n className={cn(\n \"text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-none transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n \"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarGroupAction({\n className,\n asChild = false,\n ...props\n}: React.ComponentProps<\"button\"> & { asChild?: boolean }) {\n const Comp = asChild ? Slot : \"button\";\n\n return (\n <Comp\n data-slot=\"sidebar-group-action\"\n data-sidebar=\"group-action\"\n className={cn(\n \"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-none transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n // Increases the hit area of the button on mobile.\n \"after:absolute after:-inset-2 md:after:hidden\",\n \"group-data-[collapsible=icon]:hidden\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarGroupContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-group-content\"\n data-sidebar=\"group-content\"\n className={cn(\"w-full text-sm\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarMenu({ className, ...props }: React.ComponentProps<\"ul\">) {\n return (\n <ul\n data-slot=\"sidebar-menu\"\n data-sidebar=\"menu\"\n className={cn(\"flex w-full min-w-0 flex-col gap-1\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuItem({ className, ...props }: React.ComponentProps<\"li\">) {\n return (\n <li\n data-slot=\"sidebar-menu-item\"\n data-sidebar=\"menu-item\"\n className={cn(\"group/menu-item relative\", className)}\n {...props}\n />\n );\n}\n\nconst sidebarMenuButtonVariants = cva(\n \"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground\",\n outline:\n \"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]\",\n },\n size: {\n default: \"h-8 text-sm\",\n sm: \"h-7 text-xs\",\n lg: \"h-12 text-sm group-data-[collapsible=icon]:!p-0\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nfunction SidebarMenuButton({\n asChild = false,\n isActive = false,\n variant = \"default\",\n size = \"default\",\n tooltip,\n className,\n ...props\n}: React.ComponentProps<\"button\"> & {\n asChild?: boolean;\n isActive?: boolean;\n tooltip?: string | React.ComponentProps<typeof TooltipContent>;\n} & VariantProps<typeof sidebarMenuButtonVariants>) {\n const Comp = asChild ? Slot : \"button\";\n const { isMobile, state } = useSidebar();\n\n const button = (\n <Comp\n data-slot=\"sidebar-menu-button\"\n data-sidebar=\"menu-button\"\n data-size={size}\n data-active={isActive}\n className={cn(sidebarMenuButtonVariants({ variant, size }), className)}\n {...props}\n />\n );\n\n if (!tooltip) {\n return button;\n }\n\n if (typeof tooltip === \"string\") {\n tooltip = {\n children: tooltip,\n };\n }\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>{button}</TooltipTrigger>\n <TooltipContent\n side=\"right\"\n align=\"center\"\n hidden={state !== \"collapsed\" || isMobile}\n {...tooltip}\n />\n </Tooltip>\n );\n}\n\nfunction SidebarMenuAction({\n className,\n asChild = false,\n showOnHover = false,\n ...props\n}: React.ComponentProps<\"button\"> & {\n asChild?: boolean;\n showOnHover?: boolean;\n}) {\n const Comp = asChild ? Slot : \"button\";\n\n return (\n <Comp\n data-slot=\"sidebar-menu-action\"\n data-sidebar=\"menu-action\"\n className={cn(\n \"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-none transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n // Increases the hit area of the button on mobile.\n \"after:absolute after:-inset-2 md:after:hidden\",\n \"peer-data-[size=sm]/menu-button:top-1\",\n \"peer-data-[size=default]/menu-button:top-1.5\",\n \"peer-data-[size=lg]/menu-button:top-2.5\",\n \"group-data-[collapsible=icon]:hidden\",\n showOnHover &&\n \"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuBadge({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-menu-badge\"\n data-sidebar=\"menu-badge\"\n className={cn(\n \"text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none\",\n \"peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground\",\n \"peer-data-[size=sm]/menu-button:top-1\",\n \"peer-data-[size=default]/menu-button:top-1.5\",\n \"peer-data-[size=lg]/menu-button:top-2.5\",\n \"group-data-[collapsible=icon]:hidden\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuSkeleton({\n className,\n showIcon = false,\n ...props\n}: React.ComponentProps<\"div\"> & {\n showIcon?: boolean;\n}) {\n // Random width between 50 to 90%.\n const width = React.useMemo(() => {\n return `${Math.floor(Math.random() * 40) + 50}%`;\n }, []);\n\n return (\n <div\n data-slot=\"sidebar-menu-skeleton\"\n data-sidebar=\"menu-skeleton\"\n className={cn(\"flex h-8 items-center gap-2 rounded-md px-2\", className)}\n {...props}\n >\n {showIcon && <Skeleton className=\"size-4 rounded-md\" data-sidebar=\"menu-skeleton-icon\" />}\n <Skeleton\n className=\"h-4 max-w-(--skeleton-width) flex-1\"\n data-sidebar=\"menu-skeleton-text\"\n style={\n {\n \"--skeleton-width\": width,\n } as React.CSSProperties\n }\n />\n </div>\n );\n}\n\nfunction SidebarMenuSub({ className, ...props }: React.ComponentProps<\"ul\">) {\n return (\n <ul\n data-slot=\"sidebar-menu-sub\"\n data-sidebar=\"menu-sub\"\n className={cn(\n \"border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5\",\n \"group-data-[collapsible=icon]:hidden\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuSubItem({ className, ...props }: React.ComponentProps<\"li\">) {\n return (\n <li\n data-slot=\"sidebar-menu-sub-item\"\n data-sidebar=\"menu-sub-item\"\n className={cn(\"group/menu-sub-item relative\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuSubButton({\n asChild = false,\n size = \"md\",\n isActive = false,\n className,\n ...props\n}: React.ComponentProps<\"a\"> & {\n asChild?: boolean;\n size?: \"sm\" | \"md\";\n isActive?: boolean;\n}) {\n const Comp = asChild ? Slot : \"a\";\n\n return (\n <Comp\n data-slot=\"sidebar-menu-sub-button\"\n data-sidebar=\"menu-sub-button\"\n data-size={size}\n data-active={isActive}\n className={cn(\n \"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0\",\n \"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground\",\n size === \"sm\" && \"text-xs\",\n size === \"md\" && \"text-sm\",\n \"group-data-[collapsible=icon]:hidden\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupAction,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarInput,\n SidebarInset,\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSkeleton,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n SidebarProvider,\n SidebarRail,\n SidebarSeparator,\n SidebarTrigger,\n useSidebar,\n};\n","import * as SliderPrimitive from \"@radix-ui/react-slider\";\nimport * as React from \"react\";\n\nimport { type Override } from \"../../lib/types\";\nimport { cn, normalizeToArray } from \"../../lib/utils\";\n\ntype SliderProps = Override<\n React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>,\n {\n name?: string;\n onValueChange?: (value: number) => void;\n onBlur?: React.FocusEventHandler<HTMLInputElement>;\n }\n>;\n\nconst Slider = React.forwardRef<HTMLInputElement, SliderProps>(\n ({ className, name, value, defaultValue, onValueChange, onBlur, ...props }, ref) => {\n const inputRef = React.useRef<HTMLInputElement>(null);\n\n // oxlint-disable-next-line @typescript-eslint/no-non-null-assertion -- useImperativeHandle은 ref가 할당된 후 실행되므로 안전함\n React.useImperativeHandle(ref, () => inputRef.current!);\n\n const handleValueChange = (values: number[]) => {\n onValueChange?.(values[0]);\n };\n\n // value를 배열로 변환 (Radix UI Slider는 배열을 요구함)\n const valueAsArray = normalizeToArray(value);\n const defaultValueAsArray = normalizeToArray(defaultValue);\n\n return (\n <>\n <input\n type=\"range\"\n ref={inputRef}\n name={name}\n defaultValue={defaultValueAsArray?.[0]}\n onBlur={onBlur}\n className=\"sr-only\"\n tabIndex={-1}\n aria-hidden=\"true\"\n />\n <SliderPrimitive.Root\n value={valueAsArray}\n defaultValue={defaultValueAsArray}\n onValueChange={handleValueChange}\n className={cn(\"relative flex w-full touch-none select-none items-center\", className)}\n {...props}\n >\n <SliderPrimitive.Track className=\"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary\">\n <SliderPrimitive.Range className=\"absolute h-full bg-primary\" />\n </SliderPrimitive.Track>\n <SliderPrimitive.Thumb className=\"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\" />\n </SliderPrimitive.Root>\n </>\n );\n },\n);\n\nSlider.displayName = \"Slider\";\n\nexport { Slider };\n","import { type ReactElement } from \"react\";\n\nexport type PaginationProps = {\n activePage?: number;\n totalPages?: number;\n};\n\nexport type TableColumnWidth = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16;\n\nexport type ErrorObj = {\n content: string;\n pointing?: \"above\" | \"below\" | \"left\" | \"right\";\n};\n\nexport type ControlledModalProps = {\n open: boolean;\n close: () => void;\n};\n\nexport type SonamuCol<T> = {\n label: string;\n th?: ReactElement;\n tc: (row: T, index: number) => ReactElement;\n className?: string;\n collapsing?: boolean;\n width?: TableColumnWidth;\n hidden?: boolean;\n parentLabel?: string;\n};\n\n// Union 타입을 분배하여 각각에 Omit을 적용하는 유틸리티 타입\nexport type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;\n\nexport type Override<T, U> = Omit<T, keyof U> & U;\n\n/**\n * Sonamu Filter 관련 타입 정의\n */\n\n// Prop 타입별 허용 연산자\nexport const operatorsByPropType = {\n string: [\"eq\", \"ne\", \"contains\", \"startsWith\", \"endsWith\", \"in\", \"notIn\", \"isNull\", \"isNotNull\"],\n integer: [\"eq\", \"ne\", \"gt\", \"gte\", \"lt\", \"lte\", \"in\", \"notIn\", \"between\", \"isNull\", \"isNotNull\"],\n numeric: [\"eq\", \"ne\", \"gt\", \"gte\", \"lt\", \"lte\", \"in\", \"notIn\", \"between\", \"isNull\", \"isNotNull\"],\n boolean: [\"eq\", \"ne\", \"isNull\", \"isNotNull\"],\n date: [\"eq\", \"ne\", \"before\", \"after\", \"between\", \"isNull\", \"isNotNull\"],\n datetime: [\"eq\", \"ne\", \"before\", \"after\", \"between\", \"isNull\", \"isNotNull\"],\n enum: [\"eq\", \"ne\", \"in\", \"notIn\", \"isNull\", \"isNotNull\"],\n json: [\"isNull\", \"isNotNull\"],\n} as const;\n\n// Prop 타입별 기본 연산자\nexport const defaultOperatorByPropType = {\n string: \"contains\",\n integer: \"eq\",\n numeric: \"eq\",\n boolean: \"eq\",\n date: \"eq\",\n datetime: \"eq\",\n enum: \"eq\",\n json: \"isNull\",\n} as const;\n\n// operatorsByPropType에서 파생되는 타입들\nexport type FilterPropType = keyof typeof operatorsByPropType;\nexport type FilterOperator = (typeof operatorsByPropType)[keyof typeof operatorsByPropType][number];\n","import { type FilterOperator, type FilterPropType } from \"../../../lib/types\";\n\n/**\n * Operator UI 라벨\n */\nexport const operatorLabels: Record<FilterOperator, string> = {\n eq: \"=\",\n ne: \"≠\",\n gt: \">\",\n gte: \"≥\",\n lt: \"<\",\n lte: \"≤\",\n contains: \"contains\",\n startsWith: \"starts with\",\n endsWith: \"ends with\",\n in: \"in\",\n notIn: \"not in\",\n between: \"between\",\n before: \"before\",\n after: \"after\",\n isNull: \"null\",\n isNotNull: \"not null\",\n};\n\n/**\n * Zod 타입 이름 정의\n */\nexport const zodTypeToFilterPropTypeMap: Record<string, FilterPropType> = {\n string: \"string\",\n number: \"integer\",\n boolean: \"boolean\",\n date: \"datetime\",\n enum: \"enum\",\n array: \"json\",\n object: \"json\",\n};\n","import { useState } from \"react\";\nimport XIcon from \"~icons/lucide/x\";\n\nimport { Badge } from \"./badge\";\n\nexport type TagInputProps = {\n value?: string[];\n onChange?: (value: string[]) => void;\n type?: \"text\" | \"number\";\n placeholder?: string;\n disabled?: boolean;\n className?: string;\n};\n\n/**\n * Tag Input 컴포넌트\n *\n * 콤마 또는 Enter로 태그 추가\n * X 버튼으로 태그 제거\n */\nexport function TagInput({\n value = [],\n onChange,\n type = \"text\",\n placeholder,\n disabled,\n className,\n}: TagInputProps) {\n const [inputValue, setInputValue] = useState(\"\");\n\n const addTag = (tagValue: string) => {\n const trimmed = tagValue.trim();\n if (!trimmed) return;\n\n // 숫자 타입인 경우 검증\n if (type === \"number\") {\n if (!/^-?\\d+(\\.\\d+)?$/.test(trimmed)) {\n return; // 숫자가 아니면 무시\n }\n }\n\n // 중복 방지\n if (value.includes(trimmed)) {\n setInputValue(\"\");\n return;\n }\n\n onChange?.([...value, trimmed]);\n setInputValue(\"\");\n };\n\n const removeTag = (index: number) => {\n onChange?.(value.filter((_, i) => i !== index));\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === \"Enter\") {\n e.preventDefault();\n addTag(inputValue);\n } else if (e.key === \"Backspace\" && !inputValue && value.length > 0) {\n // Backspace로 마지막 태그 제거\n removeTag(value.length - 1);\n }\n };\n\n const handleBlur = () => {\n // blur 시 입력값이 있으면 태그로 추가\n if (inputValue.trim()) {\n addTag(inputValue);\n }\n };\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n\n // 콤마 입력 시 태그 추가\n if (newValue.includes(\",\")) {\n const parts = newValue.split(\",\");\n parts.slice(0, -1).map((part) => addTag(part));\n setInputValue(parts[parts.length - 1]);\n return;\n }\n\n setInputValue(newValue);\n };\n\n return (\n <div\n className={`flex flex-wrap gap-1 items-center border rounded-md p-2 min-h-[40px] ${\n disabled ? \"bg-gray-100 cursor-not-allowed\" : \"bg-white\"\n } ${className}`}\n >\n {/* Tags */}\n {value.map((tag, index) => (\n <Badge key={index} variant=\"secondary\" className=\"flex items-center gap-1 px-2 py-1\">\n <span>{tag}</span>\n {!disabled && (\n <button\n type=\"button\"\n onClick={() => removeTag(index)}\n className=\"hover:bg-gray-300 rounded-full p-0.5\"\n >\n <XIcon />\n </button>\n )}\n </Badge>\n ))}\n\n {/* Input */}\n {!disabled && (\n <input\n type=\"text\"\n value={inputValue}\n onChange={handleInputChange}\n onKeyDown={handleKeyDown}\n onBlur={handleBlur}\n placeholder={value.length === 0 ? (placeholder ?? \"Enter 또는 콤마로 구분...\") : \"\"}\n className=\"flex-1 min-w-[120px] outline-none bg-transparent text-sm\"\n disabled={disabled}\n />\n )}\n </div>\n );\n}\n","import { useSonamuBaseContext } from \"@/contexts\";\n\nimport { DateInput, DatePicker, Input } from \"../..\";\nimport { RangeNumberInput } from \"../range-number-input\";\nimport { EnumSelect } from \"../select/enum-select\";\nimport { TagInput } from \"../tag-input\";\nimport { type ValueInputProps } from \"./types\";\n\n// Boolean enum 상수\nconst BOOLEAN_ENUM = {\n options: [\"true\", \"false\"] as const,\n labels: { true: \"True\", false: \"False\" },\n};\n\n/**\n * ValueInput 컴포넌트\n * operator와 propType에 따라 적절한 입력 UI 렌더링\n */\nexport function ValueInput({ propType, operator, value, onChange, fieldMeta }: ValueInputProps) {\n const { SD } = useSonamuBaseContext();\n // isNull/isNotNull: Boolean select (true/false)\n if (operator === \"isNull\" || operator === \"isNotNull\") {\n return (\n <EnumSelect\n enum={{ options: BOOLEAN_ENUM.options }}\n labels={BOOLEAN_ENUM.labels}\n value={value === undefined ? \"\" : String(value)}\n onValueChange={(v) => v && onChange(v === \"true\")}\n className=\"w-full\"\n />\n );\n }\n\n // in/notIn: 다중 값 입력\n if (operator === \"in\" || operator === \"notIn\") {\n if (propType === \"enum\" && fieldMeta?.enumData) {\n return (\n <EnumSelect\n enum={{ options: fieldMeta.enumData.options }}\n labels={fieldMeta.enumData.labels}\n value={(value as string[]) ?? []}\n onValueChange={onChange}\n multiple={true}\n />\n );\n }\n // string/number: TagInput\n return (\n <TagInput\n value={(value as string[]) ?? []}\n onChange={onChange}\n type={propType === \"integer\" || propType === \"numeric\" ? \"number\" : \"text\"}\n />\n );\n }\n\n // between: 범위 입력\n if (operator === \"between\") {\n if (propType === \"integer\" || propType === \"numeric\") {\n return (\n <RangeNumberInput\n value={(value as [number, number]) ?? [undefined, undefined]}\n onChange={onChange}\n />\n );\n }\n if (propType === \"date\" || propType === \"datetime\") {\n // DateInput 2개로 범위 입력 (간단 버전)\n const [start, end] = (value as [Date, Date]) ?? [undefined, undefined];\n return (\n <div className=\"flex items-center gap-2\">\n <DateInput\n value={start ?? null}\n onValueChange={(v) => onChange([v ?? undefined, end])}\n placeholder={SD(\"rc.sonamuFilter.startDate\")}\n className=\"flex-1\"\n />\n <span className=\"text-muted-foreground\">~</span>\n <DateInput\n value={end ?? null}\n onValueChange={(v) => onChange([start, v ?? undefined])}\n placeholder={SD(\"rc.sonamuFilter.endDate\")}\n className=\"flex-1\"\n />\n </div>\n );\n }\n }\n\n // enum: EnumSelect (단일)\n if (propType === \"enum\" && fieldMeta?.enumData) {\n return (\n <EnumSelect\n enum={{ options: fieldMeta.enumData.options }}\n labels={fieldMeta.enumData.labels}\n value={(value as string) ?? \"\"}\n onValueChange={onChange}\n />\n );\n }\n\n // date/datetime: DatePicker\n if (propType === \"date\" || propType === \"datetime\") {\n return <DatePicker value={(value as Date) ?? undefined} onValueChange={onChange} />;\n }\n\n // string: text input\n if (propType === \"string\") {\n return (\n <Input\n type=\"text\"\n value={(value as string) ?? \"\"}\n onValueChange={onChange}\n placeholder={SD(\"rc.sonamuFilter.enterValue\")}\n />\n );\n }\n\n // integer/numeric: number input\n if (propType === \"integer\" || propType === \"numeric\") {\n return (\n <Input\n type=\"number\"\n value={value === undefined ? \"\" : String(value)}\n onValueChange={(v) => onChange(v === \"\" ? undefined : Number(v))}\n placeholder={SD(\"rc.sonamuFilter.enterNumber\")}\n />\n );\n }\n\n // boolean: true/false select\n if (propType === \"boolean\") {\n return (\n <EnumSelect\n enum={{ options: BOOLEAN_ENUM.options }}\n labels={BOOLEAN_ENUM.labels}\n value={value === undefined ? \"\" : String(value)}\n onValueChange={(v) => v && onChange(v === \"true\")}\n className=\"w-full\"\n />\n );\n }\n\n // json 타입은 isNull/isNotNull만 지원\n return <Input type=\"text\" value=\"\" placeholder={SD(\"rc.sonamuFilter.notSupported\")} disabled />;\n}\n","import TrashIcon from \"~icons/lucide/trash-2\";\n\nimport { useSonamuBaseContext } from \"@/contexts\";\n\nimport { Button, Input, Select } from \"../..\";\nimport { type FilterOperator } from \"../../../lib/types\";\nimport { operatorsByPropType } from \"../../../lib/types\";\nimport { operatorLabels } from \"./constants\";\nimport { type RuleRowProps } from \"./types\";\nimport { ValueInput } from \"./value-input\";\n\n/**\n * Rule Row Input 컴포넌트\n */\nexport function RuleRowInput({ rule, fieldMeta, onUpdate, onRemove }: RuleRowProps) {\n const { SD } = useSonamuBaseContext();\n const fields = Object.keys(fieldMeta);\n const selectedFieldMeta = rule.field ? fieldMeta[rule.field] : null;\n const allowedOperators = selectedFieldMeta ? operatorsByPropType[selectedFieldMeta.propType] : [];\n\n const handleFieldChange = (newField: string | null | undefined) => {\n // Field 변경 시 operator/value 초기화\n onUpdate({\n field: newField ?? null,\n operator: null,\n value: undefined,\n });\n };\n\n const handleOperatorChange = (newOperator: string | null | undefined) => {\n // operator 변경 시 value도 초기화\n onUpdate({\n operator: (newOperator as FilterOperator) ?? null,\n value: undefined,\n });\n };\n\n return (\n <div className=\"flex items-start gap-2 p-3 border rounded-lg bg-gray-50\">\n {/* Field Select */}\n <div className=\"flex-1 min-w-[150px]\">\n <Select\n items={fields}\n value={rule.field ?? \"\"}\n onValueChange={handleFieldChange}\n placeholder={SD(\"rc.sonamuFilter.selectField\")}\n />\n </div>\n\n {/* Operator Select */}\n <div className=\"flex-1 min-w-[120px]\">\n <Select\n items={allowedOperators.map((op) => ({\n value: op,\n label: operatorLabels[op],\n }))}\n value={rule.operator ?? undefined}\n onValueChange={handleOperatorChange}\n disabled={!rule.field}\n placeholder={SD(\"rc.sonamuFilter.selectOperator\")}\n />\n </div>\n\n {/* Value Input */}\n <div className=\"flex-1 min-w-[150px]\">\n {rule.operator && selectedFieldMeta ? (\n <ValueInput\n propType={selectedFieldMeta.propType}\n operator={rule.operator}\n value={rule.value}\n onChange={(newValue) => onUpdate({ value: newValue })}\n fieldMeta={selectedFieldMeta}\n />\n ) : (\n <Input type=\"text\" disabled placeholder={SD(\"rc.sonamuFilter.selectOperatorFirst\")} />\n )}\n </div>\n\n {/* Remove Button */}\n <Button variant=\"ghost\" size=\"sm\" onClick={onRemove} className=\"shrink-0 h-10 px-3\">\n <TrashIcon />\n </Button>\n </div>\n );\n}\n","/* oxlint-disable @typescript-eslint/no-explicit-any */ // Zod 타입 접근\nimport { type z } from \"zod\";\n\nimport { type FilterPropType } from \"../../../lib/types\";\nimport { zodTypeToFilterPropTypeMap } from \"./constants\";\nimport { type FieldMeta, type ZodWithDef } from \"./types\";\n\n/**\n * ZodNullable, ZodOptional 등의 래퍼를 벗겨내고 내부 타입을 반환\n * nullable/optional 여부도 함께 반환\n */\nexport function unwrapZodType(zodType: z.ZodTypeAny): {\n innerType: z.ZodTypeAny;\n nullable: boolean;\n} {\n let current = zodType as ZodWithDef;\n let nullable = false;\n\n while (current._def.type === \"nullable\" || current._def.type === \"optional\") {\n if (current._def.type === \"nullable\") {\n nullable = true;\n }\n current = current._def.innerType as ZodWithDef;\n }\n\n return { innerType: current, nullable };\n}\n\n/**\n * Zod 타입 이름을 FilterPropType으로 변환\n */\nexport function zodTypeNameToPropType(typeName: string): FilterPropType {\n return zodTypeToFilterPropTypeMap[typeName] ?? \"string\";\n}\n\n/**\n * Zod enum에서 options와 labels를 추출\n * SD 함수를 사용하여 enum.{EnumName}.{value} 형태로 라벨 조회\n */\nexport function extractEnumData(\n zodEnum: z.ZodTypeAny,\n SD: (key: string) => string,\n): FieldMeta[\"enumData\"] {\n // options 추출\n const options = (zodEnum as any).options\n ? (Array.from((zodEnum as any).options) as string[])\n : undefined;\n\n if (!options) {\n return undefined;\n }\n\n // labels 추출 (SD 함수 사용: enum.{EnumName}.{value})\n const enumDescription = (zodEnum as any)._def?.description || (zodEnum as any).description;\n const labels: Record<string, string> = {};\n\n if (enumDescription) {\n for (const option of options) {\n const dictKey = `enum.${enumDescription}.${option}`;\n labels[option] = SD(dictKey);\n }\n }\n\n return { options, labels };\n}\n\n/**\n * Zod 스키마에서 각 필드의 타입 정보를 추출하여 FieldMeta 형태로 변환\n */\nexport function extractFieldMetaFromSchema(\n schema: z.ZodObject<z.ZodRawShape>,\n SD: (key: string) => string,\n): Record<string, FieldMeta> {\n const shape = schema.shape;\n const fieldMeta: Record<string, FieldMeta> = {};\n\n for (const [fieldName, zodSchema] of Object.entries(shape)) {\n // virtual, textsearchable로 시작하는 필드는 제외\n if (fieldName.startsWith(\"virtual\") || fieldName.startsWith(\"textsearchable\")) {\n continue;\n }\n\n // nullable/optional 벗겨내기\n const { innerType, nullable } = unwrapZodType(zodSchema as z.ZodTypeAny);\n\n // 메타 SonamuPropType 체크 (numeric 등)\n const meta = (zodSchema as any).meta?.();\n const sonamuPropType = meta?.SonamuPropType;\n const isNumeric = sonamuPropType === \"numeric\";\n\n // propType 결정\n const innerWithDef = innerType as ZodWithDef;\n const propType: FilterPropType = isNumeric\n ? \"numeric\"\n : zodTypeNameToPropType(innerWithDef._def.type);\n\n // enum 타입인 경우 추가 정보 추출\n const enumData = propType === \"enum\" ? extractEnumData(innerType, SD) : undefined;\n\n fieldMeta[fieldName] = {\n propType,\n nullable,\n enumData,\n };\n }\n\n return fieldMeta;\n}\n","/* oxlint-disable @typescript-eslint/no-explicit-any */ // Zod 타입 접근\n\nimport { useEffect, useState } from \"react\";\nimport PlusIcon from \"~icons/lucide/plus\";\n\nimport { Button, Dialog, DialogContent, DialogHeader, DialogTitle } from \"../..\";\nimport { useSonamuBaseContext } from \"../../../contexts/sonamu-context\";\nimport { RuleRowInput } from \"./rule-row-input\";\nimport { type Rule, type SonamuFilterModalProps } from \"./types\";\nimport { extractFieldMetaFromSchema } from \"./utils\";\n\n/**\n * SonamuFilterModal\n *\n * Zod 스키마 기반 필터 UI 생성\n */\nexport function SonamuFilterModal({\n baseSchema,\n open,\n onOpenChange,\n initialRules = [],\n onApply,\n}: SonamuFilterModalProps) {\n const { SD } = useSonamuBaseContext();\n\n // Apply된 최종 상태\n const [appliedRules, setAppliedRules] = useState(initialRules);\n // 작업 중 상태\n const [rules, setRules] = useState<Rule[]>([]);\n\n // initialRules가 변경되면 appliedRules에 동기화\n useEffect(() => {\n setAppliedRules(initialRules);\n }, [initialRules]);\n\n // 모달이 열릴 때마다 appliedRules를 rules로 복사\n useEffect(() => {\n if (open) {\n setRules(appliedRules.map((rule) => ({ ...rule })));\n }\n }, [open, appliedRules]);\n\n // baseSchema에서 동적으로 FieldMeta 추출\n const fieldMeta = extractFieldMetaFromSchema(baseSchema, SD);\n\n // Rule 추가\n const addRule = () => {\n setRules([\n ...rules,\n {\n id: crypto.randomUUID(),\n field: null,\n operator: null,\n value: undefined,\n },\n ]);\n };\n\n // Rule 삭제\n const removeRule = (id: string) => {\n setRules(rules.filter((rule) => rule.id !== id));\n };\n\n // Rule 업데이트\n const updateRule = (id: string, updates: Partial<Rule>) => {\n setRules(rules.map((rule) => (rule.id === id ? { ...rule, ...updates } : rule)));\n };\n\n // FilterQuery로 변환\n const buildFilterQuery = (): Record<string, unknown> => {\n const filters: Record<string, unknown> = {};\n\n for (const rule of rules) {\n if (!rule.field || !rule.operator) continue;\n\n // isNull/isNotNull은 객체 형태로\n if (rule.operator === \"isNull\" || rule.operator === \"isNotNull\") {\n filters[rule.field] = { [rule.operator]: rule.value };\n } else {\n // 다른 연산자들\n filters[rule.field] = { [rule.operator]: rule.value };\n }\n }\n\n return filters;\n };\n\n // Apply 버튼 클릭\n const handleApply = () => {\n const filters = buildFilterQuery();\n const confirmedRules = rules.map((rule) => ({ ...rule }));\n // 현재 rules를 확정 상태로 저장\n setAppliedRules(confirmedRules);\n onApply?.(filters, confirmedRules);\n onOpenChange(false);\n };\n\n // Reset 버튼 클릭 (모든 rule 제거)\n const handleReset = () => {\n setRules([]);\n };\n\n // Cancel 버튼 클릭 (작업 내용 버림)\n const handleCancel = () => {\n // rules 변경사항을 버리고 appliedRules로 복원\n setRules(appliedRules.map((rule) => ({ ...rule })));\n onOpenChange(false);\n };\n\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent className=\"max-w-4xl max-h-[90vh] overflow-hidden flex flex-col\">\n <DialogHeader>\n <DialogTitle>{SD(\"rc.sonamuFilter.title\")}</DialogTitle>\n </DialogHeader>\n\n <div className=\"flex-1 overflow-auto space-y-4 py-4\">\n {/* Rules */}\n {rules.length === 0 ? (\n <div className=\"text-center py-8 text-muted-foreground\">\n <p className=\"text-sm\">{SD(\"rc.sonamuFilter.noRulesYet\")}</p>\n </div>\n ) : (\n <div className=\"space-y-2\">\n {rules.map((rule) => (\n <RuleRowInput\n key={rule.id}\n rule={rule}\n fieldMeta={fieldMeta}\n onUpdate={(updates) => updateRule(rule.id, updates)}\n onRemove={() => removeRule(rule.id)}\n />\n ))}\n </div>\n )}\n\n {/* Add Rule Button */}\n <div className=\"flex gap-2\">\n <Button variant=\"outline\" onClick={addRule} className=\"flex-1\">\n <PlusIcon />\n {SD(\"rc.sonamuFilter.addRule\")}\n </Button>\n {rules.length > 0 && (\n <Button variant=\"outline\" onClick={handleReset} className=\"flex-1\">\n {SD(\"rc.sonamuFilter.reset\")}\n </Button>\n )}\n </div>\n\n {/* Preview JSON */}\n {rules.length > 0 && (\n <div className=\"border rounded-lg p-4 bg-muted/50\">\n <h4 className=\"text-sm font-semibold mb-2\">Preview (JSON)</h4>\n <pre className=\"text-xs overflow-auto max-h-[200px] bg-background p-3 rounded border\">\n {JSON.stringify(buildFilterQuery(), null, 2)}\n </pre>\n </div>\n )}\n </div>\n\n {/* Footer Buttons */}\n <div className=\"flex justify-end gap-2 pt-4 border-t\">\n <Button variant=\"outline\" onClick={handleCancel}>\n {SD(\"rc.common.cancel\")}\n </Button>\n <Button onClick={handleApply}>{SD(\"rc.sonamuFilter.apply\")}</Button>\n </div>\n </DialogContent>\n </Dialog>\n );\n}\n","/* oxlint-disable @typescript-eslint/no-explicit-any */ // caster 함수에는 any가 필요함\nimport { z } from \"zod\";\n\n// optional, nullable 무관하게 ZodNumber 체크\nfunction isZodNumberAnyway(zodType: z.ZodType<any>) {\n if (zodType instanceof z.ZodNumber) {\n return true;\n } else if (zodType instanceof z.ZodNullable && zodType._def.innerType instanceof z.ZodNumber) {\n return true;\n } else if (zodType instanceof z.ZodOptional && zodType._def.innerType instanceof z.ZodNumber) {\n return true;\n } else if (\n zodType instanceof z.ZodOptional &&\n zodType._def.innerType instanceof z.ZodOptional &&\n (zodType._def.innerType as any)._def.innerType instanceof z.ZodNumber\n ) {\n return true;\n }\n\n return false;\n}\n\n// ZodType을 이용해 raw를 Type Coercing\nexport function caster(zodType: z.ZodType<any>, raw: any): any {\n if (isZodNumberAnyway(zodType) && typeof raw === \"string\") {\n // number\n return Number(raw);\n } else if (zodType instanceof z.ZodUnion) {\n const options = zodType.options as z.ZodType<any>[];\n if (options.some((opt) => isZodNumberAnyway(opt))) {\n // zArrayable Number 케이스 처리\n if (Array.isArray(raw)) {\n const numType = options.find((opt) => opt instanceof z.ZodNumber);\n if (!numType) {\n throw new Error(\"Expected to find a number type in union\");\n }\n return raw.map((elem: any) => caster(numType, elem));\n } else {\n return Number(raw);\n }\n }\n } else if (zodType instanceof z.ZodBoolean && (raw === \"true\" || raw === \"false\")) {\n // boolean\n return raw === \"true\";\n } else if (zodType instanceof z.ZodArray) {\n // array\n return raw.map((elem: any) => caster(zodType.element as z.ZodType<any>, elem));\n } else if (zodType instanceof z.ZodObject && typeof raw === \"object\") {\n // object\n return Object.keys(raw).reduce((r, rawKey) => {\n r[rawKey] = caster(zodType.shape[rawKey], raw[rawKey]);\n return r;\n }, {} as any);\n } else if (zodType instanceof z.ZodOptional) {\n return caster(zodType._def.innerType as z.ZodType<any>, raw);\n }\n\n // 나머지는 처리 안함\n return raw;\n}\n\nexport function fastifyCaster(schema: z.ZodObject<any>) {\n return z.preprocess((raw: any) => {\n return caster(schema, raw);\n }, schema);\n}\n","/* oxlint-disable @typescript-eslint/no-explicit-any */ // 파싱 결과이므로 any 허용\n\nimport qs from \"qs\";\nimport { isObject } from \"radashi\";\nimport { type z } from \"zod\";\n\nimport { caster } from \"./caster\";\n\n// ============================================================================\n// UI Utilities\n// ============================================================================\n\nexport function hidden(condition: boolean | undefined): string {\n return condition === true ? \"hidden\" : \"\";\n}\n\n// ============================================================================\n// URL / Search Params Conversion\n// ============================================================================\n\nexport function searchParamsToParams<T extends z.ZodType<any>>(\n searchParams: URLSearchParams,\n paramsSchema: T,\n): z.infer<T> {\n const obj = qs.parse(searchParams.toString());\n return caster(paramsSchema, obj);\n}\n\nexport function paramsToSearchParams<T>(params: T): {\n [key in string]: string | string[];\n} {\n return Object.fromEntries(\n // oxlint-disable-next-line unicorn/prefer-array-flat-map -- 여기는 flatMap 사용하면 깨짐\n Object.entries(params as any)\n .filter(([, value]) => {\n return value !== undefined;\n })\n .map(([key, value]) => {\n if (Array.isArray(value)) {\n return [[`${key}[]`, value]];\n } else if (isObject(value)) {\n return Object.keys(value).map((subKey) => {\n return [`${key}[${subKey}]`, String(value[subKey as keyof typeof value])];\n });\n } else {\n return [[key, String(value)]];\n }\n })\n .flat(),\n );\n}\n\n// ============================================================================\n// Formatting Utilities\n// ============================================================================\n\nexport function sqlDateToDateString(sqlDateString: string | null) {\n if (sqlDateString === null) {\n return null;\n } else {\n return sqlDateString.slice(0, 10);\n }\n}\n\nexport function numF(num: number | null | undefined): string | number | undefined | null {\n return num && new Intl.NumberFormat().format(num);\n}\n\nexport function dateF(dateValue: string | Date | null | undefined): string | null {\n if (dateValue === null || dateValue === undefined) {\n return null;\n } else if (dateValue instanceof Date) {\n return dateValue.toISOString().slice(0, 10);\n } else {\n return dateValue.slice(0, 10);\n }\n}\n\nexport function datetimeF(dateValue: string | Date | null | undefined): string | null {\n if (dateValue === null || dateValue === undefined) {\n return null;\n } else if (dateValue instanceof Date) {\n return dateValue.toISOString().slice(0, 19).replace(\"T\", \" \");\n } else {\n return dateValue.slice(0, 19);\n }\n}\n\n// ============================================================================\n// Array Utilities\n// ============================================================================\n\nexport function arrayableToArray<T extends number | string | boolean>(\n val: T | T[] | undefined,\n): T[] {\n return val ? (Array.isArray(val) ? val : [val]) : [];\n}\n\n// ============================================================================\n// Function Reference Utilities\n// ============================================================================\n\nexport function caller<T extends Function>() {\n let savedFunc: T | null = null;\n return {\n set: (func: T) => {\n savedFunc = func;\n },\n call: ((...args: unknown[]) => {\n if (savedFunc) {\n savedFunc.call(args);\n }\n }) as unknown as T,\n };\n}\n","/* oxlint-disable @typescript-eslint/no-explicit-any */ // 파싱 결과이므로 any 허용\n\nimport { get, set } from \"radashi\";\nimport { useState } from \"react\";\nimport { z } from \"zod\";\n\nimport { type SonamuFile } from \"@/contexts\";\nimport { useSonamuBaseContext } from \"@/contexts\";\n\nimport { type ErrorObj } from \"./types\";\n\n/**\n * FormRegisterReturn\n *\n * register 함수의 반환 타입입니다.\n */\nexport type FormRegisterReturn = {\n value: any;\n onValueChange: (value: any) => void;\n onRowChange?: (row: any) => void;\n error?: ErrorObj;\n};\n\n/**\n * traverseAndUploadFiles\n *\n * 폼 데이터 안에 중첩되어 있는 File 객체들을 재귀적으로 찾아서 업로드하고,\n * File 객체를 업로드된 SonamuFile 객체로 변환하는 헬퍼 함수입니다.\n *\n * @param value - 검사할 값 (원시값, File, 배열, 객체 등 모든 타입 가능)\n * @param uploader - File 배열을 받아서 업로드된 SonamuFile 배열을 반환하는 함수\n * @returns 변환된 값 (File 객체는 SonamuFile 객체로, 나머지는 원본 구조 유지)\n */\nasync function traverseAndUploadFiles(\n value: any,\n uploader: (files: File[]) => Promise<SonamuFile[]>,\n): Promise<any> {\n // 1. File 객체를 발견한 경우\n if (value instanceof File) {\n const [sonamuFile] = await uploader([value]);\n return sonamuFile;\n }\n\n // 2. 배열을 발견한 경우\n if (Array.isArray(value)) {\n // 2-1. 배열의 모든 요소가 File이면 일괄 업로드 (성능 최적화)\n if (value.length > 0 && value.every((item) => item instanceof File)) {\n return await uploader(value);\n }\n // 2-2. 배열에 File이 아닌 요소가 섞여 있으면 각 요소를 재귀적으로 처리\n return await Promise.all(value.map((item) => traverseAndUploadFiles(item, uploader)));\n }\n\n // 3. 일반 객체를 발견한 경우 (null, Date, RegExp 등 특수 객체 제외)\n if (\n value !== null &&\n typeof value === \"object\" &&\n Object.prototype.toString.call(value) === \"[object Object]\"\n ) {\n // 객체의 각 속성을 재귀적으로 순회하며 File 객체를 찾아서 업로드\n const result: any = {};\n for (const [key, val] of Object.entries(value)) {\n result[key] = await traverseAndUploadFiles(val, uploader);\n }\n return result;\n }\n\n // 4. 원시값(string, number, boolean 등)은 변환 없이 그대로 반환\n return value;\n}\n\nexport function useTypeForm<T extends z.ZodObject<any> | z.ZodArray<any>, U extends z.infer<T>>(\n zType: T,\n defaultValue: U,\n) {\n const [form, setForm] = useState<z.infer<T>>(defaultValue);\n const [errorObjs, setErrorObjs] = useState(new Map());\n const { uploader } = useSonamuBaseContext();\n\n function getEmptyStringTo(zType: T, objPath: string): \"normal\" | \"nullable\" | \"optional\" {\n const zTypeObjPath = objPath\n .replace(/\\./g, \".shape.\")\n .replace(/\\[[^\\]]+\\]/g, \".element\")\n .replace(/^\\.element/, \"element\");\n\n let targetZType: unknown;\n if (zType instanceof z.ZodObject) {\n targetZType = get(zType.shape, zTypeObjPath);\n } else if (zType instanceof z.ZodArray) {\n targetZType = get(zType, zTypeObjPath);\n }\n\n if (targetZType === undefined) {\n return \"normal\";\n } else if (targetZType instanceof z.ZodOptional) {\n return \"optional\";\n } else if (targetZType instanceof z.ZodNullable) {\n return \"nullable\";\n }\n return \"normal\";\n }\n\n return {\n form,\n setForm,\n register: (\n objPath: string,\n _emptyStringTo?: \"normal\" | \"nullable\" | \"optional\",\n ): FormRegisterReturn => {\n const emptyStringTo = _emptyStringTo ?? getEmptyStringTo(zType, objPath);\n const srcValue = get(form, objPath) as unknown;\n\n const error = errorObjs.get(objPath);\n\n // value 업데이트 로직\n const updateValue = (newValue: any) => {\n if (error !== undefined) {\n setErrorObjs((p) => {\n const newP = new Map(p);\n newP.delete(objPath);\n return newP;\n });\n }\n\n let processedValue = newValue;\n if (emptyStringTo === \"nullable\") {\n processedValue = newValue === \"\" ? null : newValue;\n } else if (emptyStringTo === \"optional\") {\n processedValue = newValue === \"\" ? undefined : newValue;\n }\n\n // 최상위 속성인지 확인\n const isTopLevelPath = objPath.indexOf(\".\") === -1 && objPath.indexOf(\"[\") === -1;\n\n // radashi의 set은 undefined 값을 처리하지 못하므로, 최상위 속성은 직접 설정\n // 관련 이슈: https://github.com/sodiray/radash/issues/432\n if (processedValue === undefined && isTopLevelPath) {\n setForm({ ...form, [objPath]: undefined });\n } else {\n setForm(set(form, objPath, processedValue));\n }\n };\n\n const result: FormRegisterReturn = {\n value: srcValue === undefined || srcValue === null ? \"\" : srcValue,\n onValueChange: updateValue,\n };\n\n // error가 있으면 추가\n if (error) {\n result.error = error;\n }\n\n return result;\n },\n submit:\n <R>(callback: (formData: z.infer<T>) => Promise<R>) =>\n async () => {\n const transformedForm = await traverseAndUploadFiles(form, uploader);\n setForm(transformedForm);\n return await callback(transformedForm);\n },\n addError: (objPath: string, errorMessage: string | ErrorObj): void => {\n setErrorObjs((p) => {\n const newP = new Map(p);\n newP.set(\n objPath,\n typeof errorMessage === \"string\" ? { content: errorMessage } : errorMessage,\n );\n return newP;\n });\n },\n removeError: (objPath: string): void => {\n setErrorObjs((p) => {\n const newP = new Map(p);\n newP.delete(objPath);\n return newP;\n });\n },\n clearError: (): void => {\n setErrorObjs(new Map());\n },\n reset: (): void => {\n setForm(defaultValue);\n },\n };\n}\n","/* oxlint-disable @typescript-eslint/no-explicit-any */ // 파싱 결과이므로 any 허용\n\nimport { useNavigate, useSearch } from \"@tanstack/react-router\";\nimport equal from \"fast-deep-equal\";\nimport { unique } from \"radashi\";\nimport type React from \"react\";\nimport { useEffect, useState } from \"react\";\nimport { type z } from \"zod\";\n\n// radashi에 intersection이 없으므로 직접 구현\nfunction intersection<T>(arr1: T[], arr2: T[]): T[] {\n return arr1.filter((item) => arr2.includes(item));\n}\n\ntype ZodKeys<T extends z.ZodType<any>> = keyof z.infer<T>;\n\nexport function useListParams<U extends z.ZodType<any>, T extends Partial<z.infer<U>>>(\n zType: U,\n defaultValue: T,\n options?: {\n disableSearchParams?: boolean;\n },\n) {\n const search = useSearch({ strict: false }) as Record<string, unknown>;\n const navigate = useNavigate();\n\n // URL에서 파라미터 파싱\n const listParams = (() => {\n if (options?.disableSearchParams) {\n return defaultValue;\n }\n\n const parsed = zType.safeParse(search);\n if (parsed.success) {\n return { ...defaultValue, ...parsed.data };\n }\n return defaultValue;\n })();\n\n const setListParams = (newParams: T) => {\n if (equal(listParams, newParams)) {\n return;\n }\n\n navigate({\n search: newParams as any,\n });\n };\n\n function register(name: ZodKeys<U>): any {\n const currentValue = (listParams as any)[name];\n const defaultVal = (defaultValue as any)[name];\n\n return {\n value: currentValue ?? defaultVal ?? (name === \"page\" ? 1 : \"\"),\n onValueChange: (value: any) => {\n if (name === \"page\") {\n setListParams({ ...listParams, page: value } as T);\n } else {\n setListParams({\n ...listParams,\n page: 1,\n [name]: value === \"\" ? undefined : value,\n } as T);\n }\n },\n };\n }\n\n return {\n listParams,\n setListParams,\n register,\n };\n}\n\nexport function useSelection<T>(allKeys: T[], defaultSelectedKeys: T[] = []) {\n const [selection, setSelection] = useState(\n new Map(allKeys.map((key) => [key, defaultSelectedKeys.includes(key)])),\n );\n const [lastIndex, setLastIndex] = useState(0);\n\n // 전체 키가 바뀔 때마다 validation하여 갱신된 전체 키에 포함된 키만 유지\n useEffect(() => {\n const selectionKeys = Array.from(selection.keys());\n if (intersection(allKeys, selectionKeys).length === selectionKeys.length) {\n return;\n }\n\n setSelection(new Map(Array.from(selection).filter(([key, _value]) => allKeys.includes(key))));\n }, [allKeys, selection]);\n\n const selectedKeys = Array.from(selection)\n .filter(([key, value]) => allKeys.includes(key) && value)\n .map(([key]) => key);\n\n return {\n getSelected: (key: T) => selection.get(key) ?? false,\n toggle: (key: T) => {\n setSelection((selection) => {\n return new Map([...selection, [key, !(selection.get(key) ?? false)]]);\n });\n },\n selectedKeys,\n deselectAll: () => setSelection(new Map(allKeys.map((key) => [key, false]))),\n selectAll: () => setSelection(new Map(allKeys.map((key) => [key, true]))),\n isAllSelected: selectedKeys.length === allKeys.length,\n handleCheckboxClick: (e: React.MouseEvent<HTMLInputElement>, index: number) => {\n const input = e.currentTarget.getElementsByTagName(\"input\");\n if (e.shiftKey && !input[0]?.checked) {\n const [begin, end] = (() => {\n if (lastIndex < index) {\n return [lastIndex, index];\n } else {\n return [index + 1, lastIndex];\n }\n })();\n setSelection(\n new Map(unique([...selectedKeys, ...allKeys.slice(begin, end)]).map((k: T) => [k, true])),\n );\n } else {\n setLastIndex(index);\n }\n },\n };\n}\n","import React, { useState } from \"react\";\n\nimport { type ControlledModalProps } from \"./types\";\n\nexport function useModal<T extends object>(\n ModalComponent: (props: T & ControlledModalProps) => React.ReactElement,\n defaultProps: T,\n) {\n const [modalProps, setModalProps] = useState<T & { open: boolean }>({\n ...defaultProps,\n open: false,\n });\n\n const close = () => {\n setModalProps({\n ...modalProps,\n open: false,\n });\n };\n\n return {\n open: (newProps: T) => {\n setModalProps({\n ...newProps,\n open: true,\n close,\n });\n },\n modal: React.createElement(ModalComponent, {\n ...modalProps,\n close,\n }),\n };\n}\n","import { Popover, PopoverContent, PopoverTrigger } from \"../..\";\nimport { useSonamuBaseContext } from \"../../../contexts/sonamu-context\";\nimport { datetimeF, numF } from \"../../../lib\";\nimport { type FilterOperator } from \"../../../lib/types\";\nimport { operatorLabels } from \"./constants\";\nimport { type Rule, type SonamuFilterPopoverProps } from \"./types\";\n\n/**\n * SonamuFilterPopover\n *\n * 필터 버튼에 적용된 필터를 Popover로 표시하는 컴포넌트\n * 필터가 적용되어 있으면 hover 없이도 항상 보임\n */\nexport function SonamuFilterPopover({\n rules,\n fieldMeta,\n children,\n side = \"bottom\",\n align = \"start\",\n}: SonamuFilterPopoverProps) {\n const { SD } = useSonamuBaseContext();\n\n // Operator 라벨 가져오기\n const getOperatorLabel = (operator: FilterOperator | null): string => {\n if (!operator) return \"\";\n return operatorLabels[operator];\n };\n\n // Value 포맷팅\n const formatValue = (rule: Rule): string => {\n const { value, field, operator } = rule;\n\n // isNull/isNotNull은 value 표시하지 않음\n if (operator === \"isNull\" || operator === \"isNotNull\") {\n return \"\";\n }\n\n if (!field || value === undefined || value === null) {\n return \"\";\n }\n\n const meta = fieldMeta[field];\n if (!meta) return String(value);\n\n // Enum인 경우 라벨 표시\n if (meta.propType === \"enum\" && meta.enumData) {\n if (Array.isArray(value)) {\n return value.map((v) => meta.enumData?.labels[v] || v).join(\", \");\n }\n return meta.enumData.labels[value as string] || String(value);\n }\n\n // 날짜/시간인 경우\n if (meta.propType === \"date\" || meta.propType === \"datetime\") {\n if (Array.isArray(value)) {\n return value.map((v) => datetimeF(v as string | Date) ?? \"\").join(\" ~ \");\n }\n return datetimeF(value as string | Date) ?? \"\";\n }\n\n // 숫자인 경우\n if (meta.propType === \"integer\" || meta.propType === \"numeric\") {\n if (Array.isArray(value)) {\n return value.map((v) => String(numF(v as number) ?? \"\")).join(\" ~ \");\n }\n return String(numF(value as number) ?? \"\");\n }\n\n // 배열인 경우\n if (Array.isArray(value)) {\n return value.join(\", \");\n }\n\n return String(value);\n };\n\n // 필터가 없으면 children만 반환\n if (rules.length === 0) {\n return <>{children}</>;\n }\n\n return (\n <Popover open={true}>\n <PopoverTrigger asChild>{children}</PopoverTrigger>\n <PopoverContent\n side={side}\n align={align}\n sideOffset={5}\n className=\"p-3\"\n style={{ width: \"var(--radix-popover-trigger-width)\" }}\n >\n <div>\n <div className=\"text-xs font-semibold mb-2\">{SD(\"rc.sonamuFilter.appliedFilters\")}</div>\n <ul className=\"space-y-1.5 text-xs\">\n {rules.map((rule) => {\n if (!rule.field || !rule.operator) return null;\n\n const operatorLabel = getOperatorLabel(rule.operator);\n const valueStr = formatValue(rule);\n\n return (\n <li key={rule.id} className=\"flex items-start gap-1\">\n <span className=\"text-muted-foreground\">•</span>\n <div>\n <span className=\"font-medium\">{rule.field}</span>{\" \"}\n <span className=\"text-muted-foreground\">{operatorLabel}</span>{\" \"}\n {valueStr && <span>{valueStr}</span>}\n </div>\n </li>\n );\n })}\n </ul>\n </div>\n </PopoverContent>\n </Popover>\n );\n}\n","\"use client\";\n\nimport * as SwitchPrimitives from \"@radix-ui/react-switch\";\nimport * as React from \"react\";\n\nimport { type Override } from \"../../lib/types\";\nimport { cn } from \"../../lib/utils\";\n\ntype SwitchProps = Override<\n React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>,\n {\n name?: string;\n value?: boolean;\n onValueChange?: (checked: boolean) => void;\n onBlur?: React.FocusEventHandler<HTMLInputElement>;\n }\n>;\n\nconst Switch = React.forwardRef<HTMLInputElement, SwitchProps>(\n ({ className, name, checked, value, defaultChecked, onValueChange, onBlur, ...props }, ref) => {\n const effectiveChecked = value !== undefined ? value : checked;\n const inputRef = React.useRef<HTMLInputElement>(null);\n\n // oxlint-disable-next-line @typescript-eslint/no-non-null-assertion -- useImperativeHandle은 ref가 할당된 후 실행되므로 안전함\n React.useImperativeHandle(ref, () => inputRef.current!);\n\n const handleCheckedChange = (newChecked: boolean) => {\n onValueChange?.(newChecked);\n };\n\n return (\n <>\n <input\n type=\"checkbox\"\n ref={inputRef}\n name={name}\n defaultChecked={defaultChecked}\n onBlur={onBlur}\n className=\"sr-only\"\n tabIndex={-1}\n aria-hidden=\"true\"\n />\n <SwitchPrimitives.Root\n checked={effectiveChecked}\n defaultChecked={defaultChecked}\n onCheckedChange={handleCheckedChange}\n className={cn(\n \"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input\",\n className,\n )}\n {...props}\n >\n <SwitchPrimitives.Thumb\n className={cn(\n \"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0\",\n )}\n />\n </SwitchPrimitives.Root>\n </>\n );\n },\n);\n\nSwitch.displayName = \"Switch\";\n\nexport { Switch };\n","\"use client\";\n\nimport type * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\ntype TableAlign = \"left\" | \"center\" | \"right\";\n\ntype TableCol<T> = {\n label: string | React.ReactNode;\n tc: (row: T, rowIndex?: number) => React.ReactNode;\n fit?: boolean;\n className?: string;\n align?: TableAlign;\n};\n\nfunction Table({\n className,\n containerClassName,\n ...props\n}: React.ComponentProps<\"table\"> & { containerClassName?: string }) {\n return (\n <div\n data-slot=\"table-container\"\n className={cn(\"relative w-full overflow-x-auto\", containerClassName)}\n >\n <table\n data-slot=\"table\"\n className={cn(\"w-full caption-bottom text-sm\", className)}\n {...props}\n />\n </div>\n );\n}\n\nfunction TableHeader({ className, ...props }: React.ComponentProps<\"thead\">) {\n return <thead data-slot=\"table-header\" className={cn(\"[&_tr]:border-b\", className)} {...props} />;\n}\n\nfunction TableBody({ className, ...props }: React.ComponentProps<\"tbody\">) {\n return (\n <tbody\n data-slot=\"table-body\"\n className={cn(\"[&_tr:last-child]:border-0\", className)}\n {...props}\n />\n );\n}\n\nfunction TableFooter({ className, ...props }: React.ComponentProps<\"tfoot\">) {\n return (\n <tfoot\n data-slot=\"table-footer\"\n className={cn(\"bg-muted/50 border-t font-medium [&>tr]:last:border-b-0\", className)}\n {...props}\n />\n );\n}\n\nfunction TableRow({ className, ...props }: React.ComponentProps<\"tr\">) {\n return (\n <tr\n data-slot=\"table-row\"\n className={cn(\n \"hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction TableHead({\n className,\n fit,\n align,\n ...props\n}: React.ComponentProps<\"th\"> & {\n fit?: boolean;\n align?: TableAlign;\n}) {\n return (\n <th\n data-slot=\"table-head\"\n className={cn(\n \"text-foreground h-10 px-2 text-left font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 *:[[role=checkbox]]:translate-y-[2px]\",\n fit && \"w-px\",\n align === \"center\" && \"text-center\",\n align === \"right\" && \"text-right\",\n className,\n )}\n style={{ verticalAlign: \"middle\" }}\n {...props}\n />\n );\n}\n\nfunction TableCell({\n className,\n fit,\n align,\n ...props\n}: React.ComponentProps<\"td\"> & {\n fit?: boolean;\n align?: TableAlign;\n}) {\n return (\n <td\n data-slot=\"table-cell\"\n className={cn(\n \"p-2 whitespace-nowrap [&:has([role=checkbox])]:pr-0 *:[[role=checkbox]]:translate-y-[2px]\",\n fit && \"w-px\",\n align === \"center\" && \"text-center\",\n align === \"right\" && \"text-right\",\n className,\n )}\n style={{ verticalAlign: \"middle\" }}\n {...props}\n />\n );\n}\n\nfunction TableCaption({ className, ...props }: React.ComponentProps<\"caption\">) {\n return (\n <caption\n data-slot=\"table-caption\"\n className={cn(\"text-muted-foreground mt-4 text-sm\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCaption,\n type TableCol,\n};\n","import * as TabsPrimitive from \"@radix-ui/react-tabs\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Tabs = TabsPrimitive.Root;\n\nconst TabsList = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.List\n ref={ref}\n className={cn(\n \"inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground\",\n className,\n )}\n {...props}\n />\n));\nTabsList.displayName = TabsPrimitive.List.displayName;\n\nconst TabsTrigger = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n \"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm\",\n className,\n )}\n {...props}\n />\n));\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName;\n\nconst TabsContent = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Content\n ref={ref}\n className={cn(\n \"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n className,\n )}\n {...props}\n />\n));\nTabsContent.displayName = TabsPrimitive.Content.displayName;\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent };\n","import * as React from \"react\";\n\nimport { type Override } from \"../../lib/types\";\nimport { cn } from \"../../lib/utils\";\n\nexport type TextareaProps = Override<\n React.ComponentProps<\"textarea\">,\n {\n onValueChange?: (value: string) => void;\n }\n>;\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n ({ className, onValueChange, onChange, ...props }, ref) => {\n const handleChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n onValueChange?.(e.target.value);\n onChange?.(e);\n };\n\n return (\n <textarea\n className={cn(\n \"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n className,\n )}\n ref={ref}\n {...props}\n onChange={handleChange}\n />\n );\n },\n);\nTextarea.displayName = \"Textarea\";\n\nexport { Textarea };\n","import * as ToastPrimitives from \"@radix-ui/react-toast\";\nimport { cva } from \"class-variance-authority\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\nimport XIcon from \"~icons/lucide/x\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst ToastProvider = ToastPrimitives.Provider;\n\nconst ToastViewport = React.forwardRef<\n React.ComponentRef<typeof ToastPrimitives.Viewport>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Viewport\n ref={ref}\n className={cn(\n \"fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]\",\n className,\n )}\n {...props}\n />\n));\nToastViewport.displayName = ToastPrimitives.Viewport.displayName;\n\nconst toastVariantsConfig = {\n variant: {\n default: \"border bg-background text-foreground\",\n destructive: \"destructive group border-destructive bg-destructive text-destructive-foreground\",\n },\n} as const;\n\nconst toastVariants = cva(\n \"group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full\",\n {\n variants: toastVariantsConfig,\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\nconst Toast = React.forwardRef<\n React.ComponentRef<typeof ToastPrimitives.Root>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root> & VariantProps<typeof toastVariants>\n>(({ className, variant, ...props }, ref) => {\n return (\n <ToastPrimitives.Root\n ref={ref}\n className={cn(toastVariants({ variant }), className)}\n {...props}\n />\n );\n});\nToast.displayName = ToastPrimitives.Root.displayName;\n\nconst ToastAction = React.forwardRef<\n React.ComponentRef<typeof ToastPrimitives.Action>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Action>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Action\n ref={ref}\n className={cn(\n \"inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive\",\n className,\n )}\n {...props}\n />\n));\nToastAction.displayName = ToastPrimitives.Action.displayName;\n\nconst ToastClose = React.forwardRef<\n React.ComponentRef<typeof ToastPrimitives.Close>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Close>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Close\n ref={ref}\n className={cn(\n \"absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600\",\n className,\n )}\n toast-close=\"\"\n {...props}\n >\n <XIcon className=\"h-4 w-4\" />\n </ToastPrimitives.Close>\n));\nToastClose.displayName = ToastPrimitives.Close.displayName;\n\nconst ToastTitle = React.forwardRef<\n React.ComponentRef<typeof ToastPrimitives.Title>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Title>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Title ref={ref} className={cn(\"text-sm font-semibold\", className)} {...props} />\n));\nToastTitle.displayName = ToastPrimitives.Title.displayName;\n\nconst ToastDescription = React.forwardRef<\n React.ComponentRef<typeof ToastPrimitives.Description>,\n React.ComponentPropsWithoutRef<typeof ToastPrimitives.Description>\n>(({ className, ...props }, ref) => (\n <ToastPrimitives.Description\n ref={ref}\n className={cn(\"text-sm opacity-90\", className)}\n {...props}\n />\n));\nToastDescription.displayName = ToastPrimitives.Description.displayName;\n\ntype ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;\n\ntype ToastActionElement = React.ReactElement<typeof ToastAction>;\n\nexport {\n type ToastProps,\n type ToastActionElement,\n ToastProvider,\n ToastViewport,\n Toast,\n toastVariantsConfig,\n ToastTitle,\n ToastDescription,\n ToastClose,\n ToastAction,\n};\n","import { useToast } from \"../../hooks/use-toast\";\nimport {\n Toast,\n ToastClose,\n ToastDescription,\n ToastProvider,\n ToastTitle,\n ToastViewport,\n} from \"./toast\";\n\nexport function Toaster() {\n const { toasts } = useToast();\n\n return (\n <ToastProvider>\n {toasts.map(({ id, title, description, action, ...props }) => (\n <Toast key={id} {...props}>\n <div className=\"grid gap-1\">\n {title && <ToastTitle>{title}</ToastTitle>}\n {description && <ToastDescription>{description}</ToastDescription>}\n </div>\n {action}\n <ToastClose />\n </Toast>\n ))}\n <ToastViewport />\n </ToastProvider>\n );\n}\n","import * as TogglePrimitive from \"@radix-ui/react-toggle\";\nimport { cva } from \"class-variance-authority\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { type Override } from \"../../lib/types\";\nimport { cn } from \"../../lib/utils\";\n\nconst toggleVariantsConfig = {\n variant: {\n default: \"bg-transparent\",\n outline: \"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground\",\n },\n size: {\n default: \"h-10 px-3 min-w-10\",\n sm: \"h-9 px-2.5 min-w-9\",\n lg: \"h-11 px-5 min-w-11\",\n },\n} as const;\n\nconst toggleVariants = cva(\n \"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2\",\n {\n variants: toggleVariantsConfig,\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\ntype ToggleProps = Override<\n React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>,\n { value?: boolean; onValueChange?: (pressed: boolean) => void }\n>;\n\nconst Toggle = React.forwardRef<React.ComponentRef<typeof TogglePrimitive.Root>, ToggleProps>(\n ({ className, variant, size, value, pressed, onValueChange, onPressedChange, ...props }, ref) => {\n const effectivePressed = value !== undefined ? value : pressed;\n\n const handlePressedChange = (newPressed: boolean) => {\n onValueChange?.(newPressed);\n onPressedChange?.(newPressed);\n };\n\n return (\n <TogglePrimitive.Root\n ref={ref}\n pressed={effectivePressed}\n onPressedChange={handlePressedChange}\n className={cn(toggleVariants({ variant, size, className }))}\n {...props}\n />\n );\n },\n);\n\nToggle.displayName = TogglePrimitive.Root.displayName;\n\nexport { Toggle, toggleVariants, toggleVariantsConfig };\n","import * as ToggleGroupPrimitive from \"@radix-ui/react-toggle-group\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\nimport { toggleVariants } from \"./toggle\";\n\nconst ToggleGroupContext = React.createContext<VariantProps<typeof toggleVariants>>({\n size: \"default\",\n variant: \"default\",\n});\n\nconst ToggleGroup = React.forwardRef<\n React.ComponentRef<typeof ToggleGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> &\n VariantProps<typeof toggleVariants>\n>(({ className, variant, size, children, ...props }, ref) => (\n <ToggleGroupPrimitive.Root\n ref={ref}\n className={cn(\"flex items-center justify-center gap-1\", className)}\n {...props}\n >\n <ToggleGroupContext.Provider value={{ variant, size }}>{children}</ToggleGroupContext.Provider>\n </ToggleGroupPrimitive.Root>\n));\n\nToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;\n\nconst ToggleGroupItem = React.forwardRef<\n React.ComponentRef<typeof ToggleGroupPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> &\n VariantProps<typeof toggleVariants>\n>(({ className, children, variant, size, ...props }, ref) => {\n const context = React.useContext(ToggleGroupContext);\n\n return (\n <ToggleGroupPrimitive.Item\n ref={ref}\n className={cn(\n toggleVariants({\n variant: context.variant || variant,\n size: context.size || size,\n }),\n className,\n )}\n {...props}\n >\n {children}\n </ToggleGroupPrimitive.Item>\n );\n});\n\nToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;\n\nexport { ToggleGroup, ToggleGroupItem };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,IAAM,KAAc,GACd,KAAqB,KAgBvB,KAAQ;AAEZ,SAAS,KAAQ;AAEf,QADA,MAAS,KAAQ,oBACV,GAAM,UAAU;;AA2BzB,IAAM,qBAAgB,IAAI,KAA4C,EAEhE,MAAoB,MAAoB;AAC5C,KAAI,GAAc,IAAI,EAAQ,CAC5B;CAGF,IAAM,IAAU,iBAAiB;AAE/B,EADA,GAAc,OAAO,EAAQ,EAC7B,GAAS;GACP,MAAM;GACG;GACV,CAAC;IACD,GAAmB;AAEtB,IAAc,IAAI,GAAS,EAAQ;GAGxB,MAAW,GAAc,MAA0B;AAC9D,SAAQ,EAAO,MAAf;EACE,KAAK,YACH,QAAO;GACL,GAAG;GACH,QAAQ,CAAC,EAAO,OAAO,GAAG,EAAM,OAAO,CAAC,MAAM,GAAG,GAAY;GAC9D;EAEH,KAAK,eACH,QAAO;GACL,GAAG;GACH,QAAQ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