"use strict";
const vue = require("vue");
const OScrollbar_vue_vue_type_script_setup_true_lang = require("./OScrollbar.vue.js");
const types = require("./types.js");
const _hoisted_1 = { class: "o-scroller o-scrollbar-wrapper" };
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
  __name: "OScroller",
  props: types.scrollerProps,
  setup(__props, { expose: __expose }) {
    const props = __props;
    const targetRef = vue.ref(null);
    const scrollTo = (options) => {
      if (!targetRef.value) {
        return;
      }
      targetRef.value.scrollTo(options);
    };
    __expose({
      scrollTo,
      getContainerEl() {
        return targetRef.value;
      }
    });
    return (_ctx, _cache) => {
      return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
        vue.createElementVNode(
          "div",
          {
            ref_key: "targetRef",
            ref: targetRef,
            class: vue.normalizeClass(["o-scroller-container", [
              {
                "is-x-disabled": props.disabledX,
                "is-y-disabled": props.disabledY
              },
              props.wrapClass
            ]])
          },
          [
            vue.renderSlot(_ctx.$slots, "default")
          ],
          2
          /* CLASS */
        ),
        vue.createVNode(OScrollbar_vue_vue_type_script_setup_true_lang, {
          target: targetRef.value,
          "disabled-x": props.disabledX,
          "disabled-y": props.disabledY,
          duration: props.duration,
          "show-type": props.showType,
          size: props.size,
          "auto-update-on-scroll-size": props.autoUpdateOnScrollSize
        }, {
          thumb: vue.withCtx(() => [
            vue.renderSlot(_ctx.$slots, "thumb")
          ]),
          track: vue.withCtx(() => [
            vue.renderSlot(_ctx.$slots, "track")
          ]),
          _: 3
          /* FORWARDED */
        }, 8, ["target", "disabled-x", "disabled-y", "duration", "show-type", "size", "auto-update-on-scroll-size"])
      ]);
    };
  }
});
module.exports = _sfc_main;
