'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');

const RangeContextKey = Symbol("RangeContextProps");
function useProvideRange(props) {
  vue.provide(RangeContextKey, props);
}
function useInjectRange() {
  return vue.inject(RangeContextKey, {
    rangedValue: vue.ref(),
    hoverRangedValue: vue.ref(),
    inRange: vue.ref(),
    panelPosition: vue.ref()
  });
}
const RangeContextProvider = /* @__PURE__ */ vue.defineComponent({
  compatConfig: {
    MODE: 3
  },
  name: "PanelContextProvider",
  inheritAttrs: false,
  props: {
    value: {
      type: Object,
      default: () => ({})
    }
  },
  setup(props, {
    slots
  }) {
    const value = {
      rangedValue: vue.ref(props.value.rangedValue),
      hoverRangedValue: vue.ref(props.value.hoverRangedValue),
      inRange: vue.ref(props.value.inRange),
      panelPosition: vue.ref(props.value.panelPosition)
    };
    useProvideRange(value);
    vue.toRef;
    vue.watch(() => props.value, () => {
      Object.keys(props.value).forEach((key) => {
        if (value[key])
          value[key].value = props.value[key];
      });
    });
    return () => {
      var _a;
      return (_a = slots.default) == null ? void 0 : _a.call(slots);
    };
  }
});

exports.RangeContextProvider = RangeContextProvider;
exports.default = RangeContextKey;
exports.useInjectRange = useInjectRange;
exports.useProvideRange = useProvideRange;
//# sourceMappingURL=RangeContext.cjs.map
