import { t as C } from "./vendor/react.js";
import { t as l } from "./createLucideIcon.js";
import { t as f } from "./file-text.js";
import { t as w } from "./table.js";
import { t as s } from "./utils.js";
var I = [["path", {
  d: "M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",
  key: "kmsa83"
}], ["circle", {
  cx: "12",
  cy: "12",
  r: "10",
  key: "1mglay"
}]], z = l("circle-play", I), F = [
  ["path", {
    d: "m18 16 4-4-4-4",
    key: "1inbqp"
  }],
  ["path", {
    d: "m6 8-4 4 4 4",
    key: "15zrgr"
  }],
  ["path", {
    d: "m14.5 4-5 16",
    key: "e7oirm"
  }]
], E = l("code-xml", F), L = [
  ["rect", {
    width: "18",
    height: "18",
    x: "3",
    y: "3",
    rx: "2",
    key: "afitv7"
  }],
  ["path", {
    d: "M7 3v18",
    key: "bbkbws"
  }],
  ["path", {
    d: "M3 7.5h4",
    key: "zfgn84"
  }],
  ["path", {
    d: "M3 12h18",
    key: "1i2n21"
  }],
  ["path", {
    d: "M3 16.5h4",
    key: "1230mu"
  }],
  ["path", {
    d: "M17 3v18",
    key: "in4fa5"
  }],
  ["path", {
    d: "M17 7.5h4",
    key: "myr1c1"
  }],
  ["path", {
    d: "M17 16.5h4",
    key: "go4c1d"
  }]
], S = l("film", L), $ = [["path", {
  d: "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",
  key: "1kt360"
}], ["path", {
  d: "M2 10h20",
  key: "1ir3d8"
}]], A = l("folder-closed", $), U = [
  ["rect", {
    width: "18",
    height: "18",
    x: "3",
    y: "3",
    rx: "2",
    ry: "2",
    key: "1m3agn"
  }],
  ["circle", {
    cx: "9",
    cy: "9",
    r: "2",
    key: "af1f0g"
  }],
  ["path", {
    d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",
    key: "1xmnt7"
  }]
], V = l("image", U), q = [
  ["path", {
    d: "M9 18V5l12-2v13",
    key: "1jmyc2"
  }],
  ["circle", {
    cx: "6",
    cy: "18",
    r: "3",
    key: "fqmcym"
  }],
  ["circle", {
    cx: "18",
    cy: "16",
    r: "3",
    key: "1hluhg"
  }]
], H = l("music", q), a = C(), e = (o, r) => ({
  bg: o,
  accent: r
}), t = e("bg-primary", "bg-primary/10"), h = e("bg-success", "bg-success/10"), g = e("bg-orange-500", "bg-orange-500/10"), c = e("bg-blue-500", "bg-muted"), b = e("bg-indigo-600", "bg-indigo-600/10"), n = e("bg-gray-700", "bg-gray-700/10"), v = e("bg-pink-600", "bg-muted"), k = {
  img: t,
  jpg: t,
  jpeg: t,
  png: t,
  webp: t,
  tiff: t,
  gif: t,
  svg: t,
  eps: t,
  pdf: e("bg-destructive", "bg-destructive/10"),
  doc: e("bg-blue-300", "bg-blue-300/15"),
  docx: e("bg-blue-300", "bg-blue-300/15"),
  txt: e("bg-gray-500", "bg-gray-500/10"),
  csv: h,
  xls: h,
  xlsx: h,
  ppt: g,
  pptx: g,
  fig: t,
  ai: e("bg-orange-400", "bg-orange-400/10"),
  psd: e("bg-blue-500", "bg-blue-500/10"),
  indd: e("bg-fuchsia-600", "bg-fuchsia-600/10"),
  aep: e("bg-purple-600", "bg-purple-600/10"),
  mp3: v,
  wav: v,
  mp4: c,
  mpeg: c,
  avi: c,
  mkv: c,
  mov: c,
  html: b,
  css: b,
  rss: g,
  sql: b,
  js: b,
  json: n,
  java: g,
  xml: t,
  exe: n,
  dmg: n,
  zip: n,
  rar: n
}, X = Object.fromEntries(Object.entries(k).map(([o, { bg: r }]) => [o, r])), O = e("bg-muted-foreground", "bg-muted"), P = {
  empty: null,
  folder: A,
  image: V,
  video: S,
  play: z,
  audio: H,
  pdf: f,
  document: f,
  spreadsheet: w,
  code: E
}, R = {
  sm: "size-8",
  md: "size-10",
  lg: "size-12"
}, D = {
  sm: "text-[8px]",
  md: "text-[10px]",
  lg: "text-[12px]"
}, G = {
  sm: "text-[7px]",
  md: "text-[9px]",
  lg: "text-[11px]"
};
function T({ extension: o, fileType: r, variant: i = "default", size: x = "md", className: j }) {
  const d = o?.toLowerCase().replace(".", ""), m = !!d, _ = !m && !!r, u = m ? k[d] ?? O : t, p = m ? d.toUpperCase().slice(0, 4) : void 0, y = _ && r ? P[r] : null, N = d ? `${d} file type icon` : r ? `${r} file type icon` : "file type icon", M = i === "default" && m;
  return /* @__PURE__ */ (0, a.jsxs)("div", {
    className: s("relative", R[x], j),
    "data-slot": "file-type-icon",
    role: "img",
    "aria-label": N,
    children: [
      M ? /* @__PURE__ */ (0, a.jsxs)("svg", {
        viewBox: "0 0 40 40",
        fill: "none",
        className: "size-full",
        "aria-hidden": "true",
        children: [/* @__PURE__ */ (0, a.jsx)("path", {
          d: "M7 4C7 1.79086 8.79086 0 11 0H25L33 8V36C33 38.2091 31.2091 40 29 40H11C8.79086 40 7 38.2091 7 36V4Z",
          className: "fill-muted stroke-border",
          strokeWidth: "1"
        }), /* @__PURE__ */ (0, a.jsx)("path", {
          d: "M25 0L33 8H27C25.8954 8 25 7.10457 25 6V0Z",
          className: "fill-border"
        })]
      }) : /* @__PURE__ */ (0, a.jsx)("div", {
        className: s("absolute inset-x-[10%] inset-y-0 rounded", i === "default" ? "bg-background border border-border" : i === "accent" ? u.accent : u.bg),
        "aria-hidden": "true"
      }),
      p && i === "default" && /* @__PURE__ */ (0, a.jsx)("div", {
        className: s("absolute bottom-[15%] start-[2.5%] rounded-[2px] px-[3px] py-[2px] inline-flex items-center", u.bg),
        children: /* @__PURE__ */ (0, a.jsx)("span", {
          className: s("font-bold text-white uppercase leading-none", D[x]),
          children: p
        })
      }),
      p && i !== "default" && /* @__PURE__ */ (0, a.jsx)("div", {
        className: s("absolute top-[57.5%] bottom-[15%] left-[10%] right-[10%] flex items-center justify-center font-bold uppercase leading-none", G[x], i === "solid" ? "text-white" : "text-accent-foreground"),
        children: p
      }),
      y && /* @__PURE__ */ (0, a.jsx)("div", {
        className: s("absolute flex items-center justify-center", i === "default" ? "top-[37.5%] bottom-[17.5%] left-[27.5%] right-[27.5%]" : "top-[40%] bottom-[20%] left-[30%] right-[30%]"),
        children: /* @__PURE__ */ (0, a.jsx)(y, {
          className: s("size-full", i === "solid" ? "text-white" : "text-primary"),
          strokeWidth: 2,
          "aria-hidden": "true"
        })
      })
    ]
  });
}
T.displayName = "FileTypeIcon";
export {
  T as t
};

//# sourceMappingURL=FileTypeIcon.js.map