"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const shared_esmBundler = require("../../../../../../@vue/shared/dist/shared.esm-bundler.js");
const vue = require("vue");
const dayjs_min = require("../../../../../../../../_virtual/dayjs.min.js");
const useShortcut = (lang) => {
  const { emit } = vue.getCurrentInstance();
  const attrs = vue.useAttrs();
  const slots = vue.useSlots();
  const handleShortcutClick = (shortcut) => {
    const shortcutValues = shared_esmBundler.isFunction(shortcut.value) ? shortcut.value() : shortcut.value;
    if (shortcutValues) {
      emit("pick", [dayjs_min.default(shortcutValues[0]).locale(lang.value), dayjs_min.default(shortcutValues[1]).locale(lang.value)]);
      return;
    }
    if (shortcut.onClick) shortcut.onClick({
      attrs,
      slots,
      emit
    });
  };
  return handleShortcutClick;
};
exports.useShortcut = useShortcut;
