import { reactive as g, createElementBlock as n, openBlock as r, createElementVNode as o, Fragment as u, renderList as m, toDisplayString as d } from "vue";
import { hashText as x } from "./composables-BAZQlC3e.js";
const h = { class: "flex flex-col gap-2 p-2" }, k = { class: "p-2 flex flex-wrap gap-2 bg-light-100 dark-bg-dark-400 rounded cursor-pointer max-w-90 overflow-scroll" }, b = { class: "p-0 text-xs bg-light-400 dark-bg-dark-800 select-none opacity-80" }, _ = { class: "font-mono p-0 text-lg" }, F = {
  __name: "FileHash",
  setup(w) {
    const i = g({});
    function c(s) {
      var t;
      const e = (t = s == null ? void 0 : s.target) == null ? void 0 : t.files;
      for (const l of e) {
        console.log(l);
        const a = new FileReader();
        a.readAsDataURL(l), a.onloadend = async () => {
          const f = a.result, p = await x(f);
          i[p] = { name: l.name };
        };
      }
    }
    return (s, e) => (r(), n("div", h, [
      o("label", k, [
        e[1] || (e[1] = o("div", { class: "font-bold" }, "Check file hash", -1)),
        e[2] || (e[2] = o("div", { class: "flex-1" }, null, -1)),
        o("input", {
          type: "file",
          onChange: e[0] || (e[0] = (t) => c(t))
        }, null, 32)
      ]),
      (r(!0), n(u, null, m(i, (t, l) => (r(), n("div", {
        class: "p-2 flex flex-col break-all bg-light-100 dark-bg-dark-400 shadow",
        key: l
      }, [
        o("div", b, d(t.name), 1),
        o("div", _, d(l), 1)
      ]))), 128))
    ]));
  }
};
export {
  F as default
};
//# sourceMappingURL=FileHash-PeG6zifo.js.map
