"use client";
import {
  Button,
  Checkbox,
  DropdownMenu,
  DropdownMenuContent,
  DropdownMenuItem,
  DropdownMenuSeparator,
  DropdownMenuTrigger,
  Input,
  Skeleton,
  init_button2 as init_button
} from "../../../chunk-MX5MIFWA.js";
import {
  cn,
  init_cn
} from "../../../chunk-KSOOKNBG.js";
import {
  SearchIcon
} from "../../../chunk-6U3IUD57.js";
import "../../../chunk-OHPI2HRK.js";
import "../../../chunk-GGWZFCYS.js";

// src/components/ui/file-manager/file-manager.tsx
init_cn();
import { useMemo as useMemo2 } from "react";

// src/components/ui/file-manager/file-manager-breadcrumb.tsx
init_cn();
import React from "react";
import { ChevronRight } from "lucide-react";
import { jsx, jsxs } from "react/jsx-runtime";
function FileManagerBreadcrumb({
  items,
  onItemClick,
  className
}) {
  return /* @__PURE__ */ jsx("nav", { className: cn(
    "flex flex-wrap items-center gap-x-1 gap-y-1 text-sm break-words",
    className
  ), children: items.map((item, index) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
    index > 0 && /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4 text-ods-text-tertiary flex-shrink-0" }),
    /* @__PURE__ */ jsx(
      "button",
      {
        onClick: () => onItemClick?.(item.path),
        className: cn(
          "shrink-0 px-1 py-0.5 rounded hover:bg-ods-bg-secondary transition-colors",
          "text-ods-text-primary hover:text-ods-accent text-left break-all",
          index === items.length - 1 && "font-medium"
        ),
        children: item.label
      }
    )
  ] }, item.path)) });
}

// src/components/ui/file-manager/file-manager-action-bar.tsx
init_button();
init_cn();
import { FolderPlus, Clipboard, Upload, CheckSquare, Copy, Scissors } from "lucide-react";
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
function FileManagerActionBar({
  canPaste = false,
  hasSelection = false,
  onNewFolder,
  onPaste,
  onCopy,
  onCut,
  onUpload,
  onSelectAll,
  className
}) {
  return /* @__PURE__ */ jsxs2("div", { className: cn("flex items-center gap-4 flex-wrap md:justify-end", className), children: [
    /* @__PURE__ */ jsx2(
      Button,
      {
        variant: "outline",
        size: "small-legacy",
        onClick: onNewFolder,
        leftIcon: /* @__PURE__ */ jsx2(FolderPlus, { className: "h-4 w-4" }),
        children: "New Folder"
      }
    ),
    /* @__PURE__ */ jsx2(
      Button,
      {
        variant: "outline",
        size: "small-legacy",
        onClick: onCopy,
        disabled: !hasSelection,
        leftIcon: /* @__PURE__ */ jsx2(Copy, { className: "h-4 w-4" }),
        children: "Copy"
      }
    ),
    /* @__PURE__ */ jsx2(
      Button,
      {
        variant: "outline",
        size: "small-legacy",
        onClick: onCut,
        disabled: !hasSelection,
        leftIcon: /* @__PURE__ */ jsx2(Scissors, { className: "h-4 w-4" }),
        children: "Cut"
      }
    ),
    /* @__PURE__ */ jsx2(
      Button,
      {
        variant: "outline",
        size: "small-legacy",
        onClick: onPaste,
        disabled: !canPaste,
        leftIcon: /* @__PURE__ */ jsx2(Clipboard, { className: "h-4 w-4" }),
        children: "Paste"
      }
    ),
    /* @__PURE__ */ jsx2(
      Button,
      {
        variant: "outline",
        size: "small-legacy",
        onClick: onUpload,
        leftIcon: /* @__PURE__ */ jsx2(Upload, { className: "h-4 w-4" }),
        children: "Upload"
      }
    ),
    /* @__PURE__ */ jsx2(
      Button,
      {
        variant: "outline",
        size: "small-legacy",
        onClick: onSelectAll,
        leftIcon: /* @__PURE__ */ jsx2(CheckSquare, { className: "h-4 w-4" }),
        children: "Select All"
      }
    )
  ] });
}

// src/components/ui/file-manager/file-manager-table.tsx
import { useLayoutEffect, useMemo, useRef, useState as useState2 } from "react";
init_cn();

// src/components/ui/file-manager/file-manager-table-row.tsx
import { useState } from "react";
import { ChevronRight as ChevronRight2, MoreHorizontal as MoreHorizontal2 } from "lucide-react";
init_button();
init_cn();

// src/components/ui/file-manager/file-icon.tsx
init_cn();
import { Folder, File, FileText, Image, FileVideo, FileAudio, FileCode, FileArchive } from "lucide-react";
import { jsx as jsx3 } from "react/jsx-runtime";
var sizeMap = {
  sm: "h-4 w-4",
  md: "h-5 w-5",
  lg: "h-6 w-6"
};
var getFileIcon = (extension) => {
  if (!extension) return File;
  const ext = extension.toLowerCase();
  if (["txt", "doc", "docx", "pdf", "rtf"].includes(ext)) return FileText;
  if (["jpg", "jpeg", "png", "gif", "svg", "webp", "bmp"].includes(ext)) return Image;
  if (["mp4", "avi", "mov", "wmv", "flv", "mkv"].includes(ext)) return FileVideo;
  if (["mp3", "wav", "flac", "aac", "ogg", "wma"].includes(ext)) return FileAudio;
  if (["js", "ts", "jsx", "tsx", "py", "java", "c", "cpp", "cs", "html", "css", "json", "xml"].includes(ext)) return FileCode;
  if (["zip", "rar", "7z", "tar", "gz", "bz2"].includes(ext)) return FileArchive;
  return File;
};
function FileIcon({ type, extension, className, size = "md" }) {
  const Icon = type === "folder" ? Folder : getFileIcon(extension);
  return /* @__PURE__ */ jsx3(
    Icon,
    {
      className: cn(
        sizeMap[size],
        type === "folder" ? "text-ods-accent" : "text-ods-text-secondary",
        className
      )
    }
  );
}

// src/components/ui/file-manager/file-manager-context-menu.tsx
import React2 from "react";
import { Download, Copy as Copy2, Edit2, Scissors as Scissors2, Trash2, MoreHorizontal } from "lucide-react";
init_button();
init_cn();
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
function FileManagerContextMenu({
  open,
  onOpenChange,
  onAction,
  fileType = "file",
  hasSelection = false,
  trigger,
  className
}) {
  const menuItems = [
    {
      action: "download",
      label: "Download",
      icon: Download,
      show: fileType === "file" || hasSelection
    },
    {
      action: "copy",
      label: "Copy",
      icon: Copy2,
      show: true
    },
    {
      action: "rename",
      label: "Rename",
      icon: Edit2,
      show: !hasSelection
    },
    {
      action: "cut",
      label: "Cut",
      icon: Scissors2,
      show: true
    },
    {
      action: "delete",
      label: "Delete",
      icon: Trash2,
      show: true,
      separator: true
    }
  ];
  const visibleItems = menuItems.filter((item) => item.show);
  return /* @__PURE__ */ jsxs3(DropdownMenu, { open, onOpenChange, children: [
    /* @__PURE__ */ jsx4(DropdownMenuTrigger, { asChild: true, children: trigger || /* @__PURE__ */ jsx4(
      Button,
      {
        variant: "transparent",
        size: "small-legacy",
        className: "h-8 w-8 p-0",
        children: /* @__PURE__ */ jsx4(MoreHorizontal, { className: "h-4 w-4" })
      }
    ) }),
    /* @__PURE__ */ jsx4(
      DropdownMenuContent,
      {
        align: "end",
        className: cn("w-56", className),
        onClick: (e) => e.stopPropagation(),
        children: visibleItems.map((item, index) => /* @__PURE__ */ jsxs3(React2.Fragment, { children: [
          item.separator && index > 0 && /* @__PURE__ */ jsx4(DropdownMenuSeparator, {}),
          /* @__PURE__ */ jsxs3(
            DropdownMenuItem,
            {
              onClick: (e) => {
                e.stopPropagation();
                onAction(item.action);
              },
              className: "cursor-pointer",
              children: [
                /* @__PURE__ */ jsx4(item.icon, { className: "mr-3 h-4 w-4" }),
                /* @__PURE__ */ jsx4("span", { children: item.label })
              ]
            }
          )
        ] }, item.action))
      }
    )
  ] });
}

// src/components/ui/file-manager/file-manager-table-row.tsx
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
function FileManagerTableRow({
  file,
  isSelected = false,
  showCheckbox = true,
  showPath = false,
  onSelect,
  onClick,
  onDoubleClick,
  onContextMenu,
  onActionClick,
  className
}) {
  const [contextMenuOpen, setContextMenuOpen] = useState(false);
  const handleRowClick = (e) => {
    if (e.target.closest("[data-no-row-click]")) {
      return;
    }
    onClick?.();
  };
  const handleCheckboxChange = (checked) => {
    onSelect?.(checked);
  };
  const handleContextAction = (action) => {
    onActionClick?.(action);
    setContextMenuOpen(false);
  };
  const fileExtension = file.type === "file" ? file.name.split(".").pop() : void 0;
  return /* @__PURE__ */ jsxs4(
    "div",
    {
      className: cn(
        "bg-ods-card group flex items-center h-16 px-4 border-ods-border",
        "hover:bg-ods-bg-secondary transition-colors cursor-pointer",
        isSelected && "bg-ods-bg-secondary",
        className
      ),
      onClick: handleRowClick,
      onDoubleClick,
      onContextMenu: (e) => {
        e.preventDefault();
        onContextMenu?.(e);
      },
      children: [
        showCheckbox && /* @__PURE__ */ jsx5("div", { className: "mr-4", "data-no-row-click": true, children: /* @__PURE__ */ jsx5(
          Checkbox,
          {
            checked: isSelected,
            onCheckedChange: handleCheckboxChange,
            className: "h-5 w-5"
          }
        ) }),
        /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-3 flex-1 min-w-0", children: [
          /* @__PURE__ */ jsx5(
            FileIcon,
            {
              type: file.type,
              extension: fileExtension,
              size: "md"
            }
          ),
          /* @__PURE__ */ jsxs4("div", { className: "flex flex-col min-w-0", children: [
            /* @__PURE__ */ jsx5("span", { className: "text-sm text-ods-text-primary truncate", title: file.name, children: file.name }),
            showPath && file.path && /* @__PURE__ */ jsx5("span", { className: "text-xs text-ods-text-secondary truncate", title: file.path, children: file.path })
          ] })
        ] }),
        /* @__PURE__ */ jsx5("div", { className: "w-24 shrink-0 pr-4 text-sm text-ods-text-secondary", children: file.size || "" }),
        /* @__PURE__ */ jsx5("div", { className: "w-36 shrink-0 pl-4 text-sm text-ods-text-secondary", children: file.modified }),
        /* @__PURE__ */ jsxs4("div", { className: "w-48 shrink-0 pl-4 flex items-center justify-end gap-1", "data-no-row-click": true, children: [
          /* @__PURE__ */ jsx5(
            FileManagerContextMenu,
            {
              open: contextMenuOpen,
              onOpenChange: setContextMenuOpen,
              onAction: handleContextAction,
              fileType: file.type,
              trigger: /* @__PURE__ */ jsx5(
                Button,
                {
                  variant: "transparent",
                  size: "small-legacy",
                  className: "h-8 w-8 p-0 opacity-0 group-hover:opacity-100 transition-opacity",
                  onClick: (e) => {
                    e.stopPropagation();
                  },
                  children: /* @__PURE__ */ jsx5(MoreHorizontal2, { className: "h-4 w-4" })
                }
              )
            }
          ),
          file.type === "folder" ? /* @__PURE__ */ jsx5(
            Button,
            {
              variant: "transparent",
              size: "small-legacy",
              className: "h-8 w-8 p-0",
              onClick: (e) => {
                e.stopPropagation();
                onDoubleClick?.();
              },
              children: /* @__PURE__ */ jsx5(ChevronRight2, { className: "h-4 w-4" })
            }
          ) : /* @__PURE__ */ jsx5("div", { className: "w-8" })
        ] })
      ]
    }
  );
}

// src/components/ui/file-manager/file-manager-empty.tsx
init_button();
init_cn();
import { FolderOpen } from "lucide-react";
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
function FileManagerEmpty({
  message = "No files or folders found",
  description = "This folder is empty. Create a new folder or upload files to get started.",
  action,
  className
}) {
  return /* @__PURE__ */ jsxs5("div", { className: cn(
    "flex flex-col items-center justify-center py-20 px-4",
    className
  ), children: [
    /* @__PURE__ */ jsx6("div", { className: "p-4 bg-ods-bg-secondary rounded-full mb-6", children: /* @__PURE__ */ jsx6(FolderOpen, { className: "h-12 w-12 text-ods-text-tertiary" }) }),
    /* @__PURE__ */ jsx6("h3", { className: "text-lg font-medium text-ods-text-primary mb-2", children: message }),
    /* @__PURE__ */ jsx6("p", { className: "text-sm text-ods-text-secondary text-center max-w-md mb-6", children: description }),
    action && /* @__PURE__ */ jsx6(
      Button,
      {
        variant: "accent",
        size: "small-legacy",
        onClick: action.onClick,
        children: action.label
      }
    )
  ] });
}

// src/components/ui/file-manager/file-manager-table.tsx
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
function FileManagerTable({
  files,
  selectedFiles,
  showCheckboxes = true,
  loading = false,
  isSearchResult = false,
  onSelectFile,
  onSelectAll,
  onFileClick,
  onFolderOpen,
  onFileAction,
  className
}) {
  const allSelected = useMemo(() => {
    return files.length > 0 && selectedFiles.length === files.length;
  }, [files.length, selectedFiles.length]);
  const someSelected = useMemo(() => {
    return selectedFiles.length > 0 && selectedFiles.length < files.length;
  }, [files.length, selectedFiles.length]);
  const containerRef = useRef(null);
  const [tableHeight, setTableHeight] = useState2(null);
  useLayoutEffect(() => {
    if (loading || files.length === 0) {
      setTableHeight(null);
      return;
    }
    const handleResize = () => {
      const node = containerRef.current;
      if (!node) return;
      const rect = node.getBoundingClientRect();
      const availableHeight = window.innerHeight - rect.top;
      setTableHeight(availableHeight > 0 ? availableHeight : null);
    };
    handleResize();
    window.addEventListener("resize", handleResize);
    window.addEventListener("scroll", handleResize, true);
    const resizeObserver = new ResizeObserver(handleResize);
    const parent = containerRef.current?.parentElement;
    if (parent) {
      resizeObserver.observe(parent);
    } else if (containerRef.current) {
      resizeObserver.observe(containerRef.current);
    }
    return () => {
      window.removeEventListener("resize", handleResize);
      window.removeEventListener("scroll", handleResize, true);
      resizeObserver.disconnect();
    };
  }, [loading, files.length]);
  const handleSelectAll = (checked) => {
    onSelectAll?.(checked);
  };
  if (loading) {
    const skeletonRows = 8;
    return /* @__PURE__ */ jsxs6("div", { className: cn("bg-ods-bg border border-ods-border rounded-lg flex flex-col", className), children: [
      /* @__PURE__ */ jsxs6("div", { className: "flex items-center h-12 px-4 bg-ods-bg-secondary border-b border-ods-border rounded-t-lg", children: [
        showCheckboxes && /* @__PURE__ */ jsx7("div", { className: "mr-4", children: /* @__PURE__ */ jsx7(Skeleton, { className: "h-5 w-5 rounded" }) }),
        /* @__PURE__ */ jsx7("div", { className: "flex items-center gap-3 flex-1 min-w-0 text-sm font-medium text-ods-text-secondary", children: "NAME" }),
        /* @__PURE__ */ jsx7("div", { className: "w-24 shrink-0 pr-4 text-sm font-medium text-ods-text-secondary", children: "SIZE" }),
        /* @__PURE__ */ jsx7("div", { className: "w-36 shrink-0 pl-4 text-sm font-medium text-ods-text-secondary", children: "EDITED" }),
        /* @__PURE__ */ jsx7("div", { className: "w-48 shrink-0 pl-4 flex justify-end" })
      ] }),
      /* @__PURE__ */ jsx7("div", { className: "divide-y divide-ods-border rounded-b-lg flex-1 overflow-auto", children: Array.from({ length: skeletonRows }).map((_, idx) => /* @__PURE__ */ jsxs6("div", { className: "bg-ods-card group flex items-center h-16 px-4 border-ods-border", children: [
        showCheckboxes && /* @__PURE__ */ jsx7("div", { className: "mr-4", children: /* @__PURE__ */ jsx7(Skeleton, { className: "h-5 w-5 rounded" }) }),
        /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-3 flex-1 min-w-0", children: [
          /* @__PURE__ */ jsx7(Skeleton, { className: "h-6 w-6 rounded" }),
          /* @__PURE__ */ jsxs6("div", { className: "flex flex-col min-w-0", children: [
            /* @__PURE__ */ jsx7(Skeleton, { className: "h-4 w-32" }),
            isSearchResult && /* @__PURE__ */ jsx7(Skeleton, { className: "h-3 w-48 mt-1" })
          ] })
        ] }),
        /* @__PURE__ */ jsx7("div", { className: "w-24 shrink-0 pr-4", children: /* @__PURE__ */ jsx7(Skeleton, { className: "h-4 w-16" }) }),
        /* @__PURE__ */ jsx7("div", { className: "w-36 shrink-0 pl-4", children: /* @__PURE__ */ jsx7(Skeleton, { className: "h-4 w-24" }) }),
        /* @__PURE__ */ jsxs6("div", { className: "w-48 shrink-0 pl-4 flex items-center justify-end gap-1", children: [
          /* @__PURE__ */ jsx7(Skeleton, { className: "h-8 w-8 rounded" }),
          /* @__PURE__ */ jsx7(Skeleton, { className: "h-8 w-8 rounded" })
        ] })
      ] }, idx)) })
    ] });
  }
  if (files.length === 0) {
    return /* @__PURE__ */ jsx7(FileManagerEmpty, {});
  }
  return /* @__PURE__ */ jsxs6(
    "div",
    {
      ref: containerRef,
      className: cn("bg-ods-bg border border-ods-border rounded-lg flex flex-col", className),
      style: tableHeight ? { height: `${tableHeight}px` } : void 0,
      children: [
        /* @__PURE__ */ jsxs6("div", { className: "flex items-center h-12 px-4 bg-ods-bg-secondary border-b border-ods-border rounded-t-lg", children: [
          showCheckboxes && /* @__PURE__ */ jsx7("div", { className: "mr-4", children: /* @__PURE__ */ jsx7(
            Checkbox,
            {
              checked: allSelected || someSelected,
              onCheckedChange: handleSelectAll,
              className: "h-5 w-5"
            }
          ) }),
          /* @__PURE__ */ jsx7("div", { className: "flex items-center gap-3 flex-1 min-w-0 text-sm font-medium text-ods-text-secondary", children: "NAME" }),
          /* @__PURE__ */ jsx7("div", { className: "w-24 shrink-0 pr-4 text-sm font-medium text-ods-text-secondary", children: "SIZE" }),
          /* @__PURE__ */ jsx7("div", { className: "w-36 shrink-0 pl-4 text-sm font-medium text-ods-text-secondary", children: "EDITED" }),
          /* @__PURE__ */ jsx7("div", { className: "w-48 shrink-0 pl-4 flex justify-end" })
        ] }),
        /* @__PURE__ */ jsx7("div", { className: "divide-y divide-ods-border rounded-b-lg flex-1 overflow-auto", children: files.map((file) => /* @__PURE__ */ jsx7(
          FileManagerTableRow,
          {
            file,
            isSelected: selectedFiles.includes(file.id),
            showCheckbox: showCheckboxes,
            showPath: isSearchResult,
            onSelect: (selected) => onSelectFile?.(file.id, selected),
            onClick: () => {
              if (isSearchResult) {
                onFileClick?.(file);
              } else if (file.type === "folder") {
                onFolderOpen?.(file);
              }
            },
            onDoubleClick: () => {
              if (file.type === "folder" && !isSearchResult) {
                onFolderOpen?.(file);
              }
            },
            onActionClick: (action) => onFileAction?.(action, file.id)
          },
          file.id
        )) })
      ]
    }
  );
}

// src/components/ui/file-manager/file-manager.tsx
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
function FileManager({
  files,
  currentPath,
  selectedFiles,
  searchQuery,
  loading = false,
  isSearching,
  showCheckboxes = true,
  showSearch = true,
  showActions = true,
  canPaste = false,
  disableSearch = false,
  resultsCount,
  onNavigate,
  onBreadcrumbClick,
  onSearch,
  onSelectFile,
  onSelectAll,
  onFileAction,
  onFileClick,
  onFolderOpen,
  className
}) {
  const breadcrumbItems = useMemo2(() => {
    const items = [];
    items.push({ label: "Root", path: "" });
    if (!currentPath || currentPath === "" || currentPath === "/") {
      return items;
    }
    const isWindowsPath = currentPath.includes("\\") || /^[A-Za-z]:/.test(currentPath);
    const separator = isWindowsPath ? "\\" : "/";
    const parts = currentPath.split(separator).filter(Boolean);
    let startIndex = 0;
    if (isWindowsPath && parts.length > 0) {
      const driveMatch = parts[0].match(/^([A-Za-z]:)/);
      if (driveMatch) {
        items.push({
          label: driveMatch[1],
          path: driveMatch[1] + separator
        });
        if (parts[0] === driveMatch[1]) {
          startIndex = 1;
        } else {
          parts[0] = parts[0].substring(driveMatch[1].length);
        }
      }
    }
    let accumulatedPath = "";
    if (isWindowsPath && items.length > 1) {
      accumulatedPath = items[items.length - 1].path;
    }
    for (let i = startIndex; i < parts.length; i++) {
      const part = parts[i];
      if (!part) continue;
      if (isWindowsPath) {
        accumulatedPath = accumulatedPath.endsWith(separator) ? accumulatedPath + part : accumulatedPath + separator + part;
      } else {
        accumulatedPath = accumulatedPath === "" || accumulatedPath === "/" ? "/" + part : accumulatedPath + "/" + part;
      }
      items.push({
        label: part,
        path: accumulatedPath
      });
    }
    return items;
  }, [currentPath]);
  const handleBreadcrumbClick = (path) => {
    onBreadcrumbClick?.(path);
    onNavigate?.(path);
  };
  const handleFolderOpen = (file) => {
    let newPath;
    if (!currentPath || currentPath === "") {
      if (file.name && /^[A-Za-z]:/.test(file.name)) {
        newPath = file.name + (file.name.endsWith("\\") ? "" : "\\");
      } else {
        newPath = file.name;
      }
    } else {
      const separator = currentPath.includes("\\") ? "\\" : "/";
      if (currentPath === "/") {
        newPath = "/" + file.name;
      } else if (currentPath.endsWith(separator)) {
        newPath = currentPath + file.name;
      } else {
        newPath = currentPath + separator + file.name;
      }
    }
    onFolderOpen?.(file);
    onNavigate?.(newPath);
  };
  const handleSelectAll = (selected) => {
    onSelectAll?.(selected);
  };
  const handleSelectFile = (fileId, selected) => {
    onSelectFile?.(fileId, selected);
  };
  return /* @__PURE__ */ jsx8("div", { className: cn("flex flex-col h-full bg-ods-bg", className), children: /* @__PURE__ */ jsxs7("div", { className: "flex-1 flex flex-col py-2 space-y-6 min-h-0", children: [
    /* @__PURE__ */ jsxs7("div", { className: "flex flex-col justify-between gap-4 mb-4 md:flex-row", children: [
      /* @__PURE__ */ jsx8(
        FileManagerBreadcrumb,
        {
          items: breadcrumbItems,
          onItemClick: handleBreadcrumbClick
        }
      ),
      showActions && /* @__PURE__ */ jsx8(
        FileManagerActionBar,
        {
          canPaste,
          hasSelection: selectedFiles.length > 0,
          onNewFolder: () => onFileAction?.("new-folder"),
          onPaste: () => onFileAction?.("paste"),
          onCopy: () => onFileAction?.("copy"),
          onCut: () => onFileAction?.("cut"),
          onUpload: () => onFileAction?.("upload"),
          onSelectAll: () => handleSelectAll(true)
        }
      )
    ] }),
    showSearch && /* @__PURE__ */ jsx8(
      Input,
      {
        value: searchQuery,
        onChange: (e) => onSearch?.(e.target.value),
        placeholder: "Search...",
        disabled: disableSearch,
        startAdornment: /* @__PURE__ */ jsx8(SearchIcon, {}),
        loading: isSearching
      }
    ),
    /* @__PURE__ */ jsx8("div", { className: "flex-1 min-h-0", children: /* @__PURE__ */ jsx8(
      FileManagerTable,
      {
        files,
        selectedFiles,
        resultsCount: resultsCount || files.length,
        showCheckboxes,
        loading,
        isSearchResult: !!searchQuery,
        onSelectFile: handleSelectFile,
        onSelectAll: handleSelectAll,
        onFileClick,
        onFolderOpen: handleFolderOpen,
        onFileAction
      }
    ) })
  ] }) });
}

// src/components/ui/file-manager/file-manager-skeleton.tsx
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
function FileManagerSkeleton({
  rows = 8,
  showSearch = true,
  showActions = true
}) {
  const rowPlaceholders = Array.from({ length: rows });
  return /* @__PURE__ */ jsx9("div", { className: "flex flex-col h-full bg-ods-bg", children: /* @__PURE__ */ jsxs8("div", { className: "flex-1 flex flex-col py-6 space-y-6 min-h-0", children: [
    /* @__PURE__ */ jsxs8("div", { className: "flex flex-wrap items-start justify-between gap-4", children: [
      /* @__PURE__ */ jsxs8("div", { className: "flex-1 min-w-0 flex items-center gap-2", children: [
        /* @__PURE__ */ jsx9(Skeleton, { className: "h-5 w-12" }),
        /* @__PURE__ */ jsx9(Skeleton, { className: "h-4 w-4 rounded-full" }),
        /* @__PURE__ */ jsx9(Skeleton, { className: "h-5 w-20" }),
        /* @__PURE__ */ jsx9(Skeleton, { className: "h-4 w-4 rounded-full" }),
        /* @__PURE__ */ jsx9(Skeleton, { className: "h-5 w-24" })
      ] }),
      showActions && /* @__PURE__ */ jsxs8("div", { className: "flex-shrink-0 flex items-center gap-2", children: [
        /* @__PURE__ */ jsx9(Skeleton, { className: "h-9 w-24" }),
        /* @__PURE__ */ jsx9(Skeleton, { className: "h-9 w-20" }),
        /* @__PURE__ */ jsx9(Skeleton, { className: "h-9 w-20" }),
        /* @__PURE__ */ jsx9(Skeleton, { className: "h-9 w-28" })
      ] })
    ] }),
    showSearch && /* @__PURE__ */ jsx9(Skeleton, { className: "h-10 w-full rounded-lg" }),
    /* @__PURE__ */ jsx9("div", { className: "flex-1 min-h-0", children: /* @__PURE__ */ jsxs8("div", { className: "bg-ods-bg border border-ods-border rounded-lg flex flex-col", children: [
      /* @__PURE__ */ jsxs8("div", { className: "flex items-center h-12 px-4 bg-ods-bg-secondary border-b border-ods-border rounded-t-lg", children: [
        /* @__PURE__ */ jsx9("div", { className: "mr-4", children: /* @__PURE__ */ jsx9(Skeleton, { className: "h-5 w-5 rounded" }) }),
        /* @__PURE__ */ jsx9("div", { className: "flex items-center gap-3 flex-1 min-w-0 text-sm font-medium text-ods-text-secondary", children: "NAME" }),
        /* @__PURE__ */ jsx9("div", { className: "w-24 shrink-0 pr-4 text-sm font-medium text-ods-text-secondary", children: "SIZE" }),
        /* @__PURE__ */ jsx9("div", { className: "w-36 shrink-0 pl-4 text-sm font-medium text-ods-text-secondary", children: "EDITED" }),
        /* @__PURE__ */ jsx9("div", { className: "w-48 shrink-0 pl-4 flex justify-end" })
      ] }),
      /* @__PURE__ */ jsx9("div", { className: "divide-y divide-ods-border rounded-b-lg flex-1 overflow-auto min-h-0", children: rowPlaceholders.map((_, idx) => /* @__PURE__ */ jsxs8("div", { className: "bg-ods-card flex items-center h-16 px-4 border-ods-border", children: [
        /* @__PURE__ */ jsx9("div", { className: "mr-4", children: /* @__PURE__ */ jsx9(Skeleton, { className: "h-5 w-5 rounded" }) }),
        /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-3 flex-1 min-w-0", children: [
          /* @__PURE__ */ jsx9(Skeleton, { className: "h-6 w-6 rounded" }),
          /* @__PURE__ */ jsx9("div", { className: "flex flex-col min-w-0", children: /* @__PURE__ */ jsx9(Skeleton, { className: "h-4 w-32" }) })
        ] }),
        /* @__PURE__ */ jsx9("div", { className: "w-24 shrink-0 pr-4", children: /* @__PURE__ */ jsx9(Skeleton, { className: "h-4 w-16" }) }),
        /* @__PURE__ */ jsx9("div", { className: "w-36 shrink-0 pl-4", children: /* @__PURE__ */ jsx9(Skeleton, { className: "h-4 w-24" }) }),
        /* @__PURE__ */ jsxs8("div", { className: "w-48 shrink-0 pl-4 flex items-center justify-end gap-1", children: [
          /* @__PURE__ */ jsx9(Skeleton, { className: "h-8 w-8 rounded" }),
          /* @__PURE__ */ jsx9(Skeleton, { className: "h-8 w-8 rounded" })
        ] })
      ] }, idx)) })
    ] }) })
  ] }) });
}
export {
  FileIcon,
  FileManager,
  FileManagerActionBar,
  FileManagerBreadcrumb,
  FileManagerContextMenu,
  FileManagerEmpty,
  FileManagerSkeleton,
  FileManagerTable,
  FileManagerTableRow
};
//# sourceMappingURL=index.js.map