import { OverlayScrollbars as a, ClickScrollPlugin as c } from "overlayscrollbars";
const o = {
  name: "dt-scrollbar-directive",
  install(l) {
    a.plugin(c);
    const t = /* @__PURE__ */ new WeakMap();
    l.directive("dt-scrollbar", {
      inserted(r, e) {
        const s = a({
          target: r,
          elements: {
            viewport: r.children[0]
          }
        }, {
          scrollbars: {
            autoHide: `${e.arg || "leave"}`,
            clickScroll: !0,
            autoHideDelay: `${!e.arg || e.arg === "leave" ? 0 : 1300}`
          }
        });
        r.setAttribute("data-overlayscrollbars-initialize", !0), r.classList.add("d-scrollbar"), t.set(r, s);
      },
      unbind(r) {
        t.get(r).destroy();
      }
    });
  }
};
export {
  o as DtScrollbarDirective,
  o as default
};
//# sourceMappingURL=scrollbar.js.map
