"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const event = require("../../../constants/event.js");
const types = require("../../../utils/types.js");
const index = require("../../../hooks/use-namespace/index.js");
const constants = require("../../time-picker/src/constants.js");
const useCommonPicker = require("../../time-picker/src/composables/use-common-picker.js");
const datePickerPanel = require("./props/date-picker-panel.js");
const constants$1 = require("./constants.js");
const panelUtils = require("./panel-utils.js");
const vue = require("vue");
const dayjs_min = require("../../../../../../../_virtual/dayjs.min.js");
const customParseFormat = require("../../../../../../../_virtual/customParseFormat.js");
const localeData = require("../../../../../../../_virtual/localeData.js");
const advancedFormat = require("../../../../../../../_virtual/advancedFormat.js");
const weekOfYear = require("../../../../../../../_virtual/weekOfYear.js");
const weekYear = require("../../../../../../../_virtual/weekYear.js");
const dayOfYear = require("../../../../../../../_virtual/dayOfYear.js");
const isSameOrAfter = require("../../../../../../../_virtual/isSameOrAfter.js");
const isSameOrBefore = require("../../../../../../../_virtual/isSameOrBefore.js");
const omit = require("../../../../../lodash-es/omit.js");
function _isSlot(s) {
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
}
dayjs_min.default.extend(localeData.default);
dayjs_min.default.extend(advancedFormat.default);
dayjs_min.default.extend(customParseFormat.default);
dayjs_min.default.extend(weekOfYear.default);
dayjs_min.default.extend(weekYear.default);
dayjs_min.default.extend(dayOfYear.default);
dayjs_min.default.extend(isSameOrAfter.default);
dayjs_min.default.extend(isSameOrBefore.default);
var date_picker_panel_default = /* @__PURE__ */ vue.defineComponent({
  name: "ElDatePickerPanel",
  install: null,
  inheritAttrs: false,
  props: datePickerPanel.datePickerPanelProps,
  emits: [
    event.UPDATE_MODEL_EVENT,
    "calendar-change",
    "panel-change",
    "visible-change",
    "clear"
  ],
  setup(props, { slots, emit, attrs }) {
    const ns = index.useNamespace("picker-panel");
    if (types.isUndefined(vue.inject(constants.PICKER_BASE_INJECTION_KEY, void 0))) vue.provide(constants.PICKER_BASE_INJECTION_KEY, { props: vue.reactive({ ...vue.toRefs(props) }) });
    vue.provide(constants$1.ROOT_PICKER_INJECTION_KEY, {
      slots,
      pickerNs: ns
    });
    const { parsedValue, onCalendarChange, onPanelChange, onSetPickerOption, onPick } = vue.inject(constants.ROOT_COMMON_PICKER_INJECTION_KEY, () => useCommonPicker.useCommonPicker(props, emit), true);
    return () => {
      return vue.createVNode(panelUtils.getPanel(props.type), vue.mergeProps(omit.default(attrs, "onPick"), props, {
        "parsedValue": parsedValue.value,
        "onSet-picker-option": onSetPickerOption,
        "onCalendar-change": onCalendarChange,
        "onPanel-change": onPanelChange,
        "onClear": () => emit("clear"),
        "onPick": onPick
      }), _isSlot(slots) ? slots : { default: () => [slots] });
    };
  }
});
exports.default = date_picker_panel_default;
