import { reactive } from "vue";
import { ThemeKey, createTheme } from "./composables/theme/index.mjs";
import { useTheme } from "./composables/theme/index.mjs";
import { HighlighterKey, createHighlighter } from "./composables/highlighter/index.mjs";
import { DisplayKey, createDisplay } from "./composables/display/index.mjs";
import { useDisplay } from "./composables/display/index.mjs";
import { DefaultsKey, createDefaults } from "./composables/defaults/index.mjs";
import { MessageKey, NotificationKey } from "./composables/message/index.mjs";
import { message, useMessage } from "./composables/message/index.mjs";
import { DraggableSortableGroupKey, createDraggableSortableGroup } from "./composables/draggable-sortable-group/index.mjs";
import { ProvidersKey, createProviders } from "./composables/providers/index.mjs";
import { UI_VERSION } from "./utils/globals.mjs";
import { IconsKey, createIcons } from "./composables/icons/icons.mjs";
const version = UI_VERSION;
const createVeno = (options = {}) => {
  const install = (app) => {
    const {
      componentPrefix = "Ve",
      components = {},
      directives = {}
    } = options;
    for (const key in components) {
      app.component(`${componentPrefix}${key}`, components[key]);
    }
    for (const key in directives) {
      app.directive(key, directives[key]);
    }
    app.provide(DisplayKey, createDisplay(options.display));
    app.provide(DefaultsKey, createDefaults(options.defaults));
    app.provide(DraggableSortableGroupKey, createDraggableSortableGroup());
    app.provide(ThemeKey, createTheme(app, options.theme));
    app.provide(HighlighterKey, createHighlighter(options.highlighter));
    app.provide(IconsKey, createIcons(options.icons));
    app.provide(ProvidersKey, createProviders(app, options.providers));
    function inject(key) {
      var _a, _b, _c;
      const vm = this.$;
      const provides = (_c = (_a = vm.parent) == null ? void 0 : _a.provides) != null ? _c : (_b = vm.vnode.appContext) == null ? void 0 : _b.provides;
      if (provides && key in provides) {
        return provides[key];
      }
    }
    app.mixin({
      computed: {
        $veno() {
          return reactive({
            display: inject.call(this, DisplayKey),
            theme: inject.call(this, ThemeKey),
            icons: inject.call(this, IconsKey),
            message: inject.call(this, MessageKey),
            notification: inject.call(this, NotificationKey),
            version
          });
        }
      }
    });
  };
  return { install, version };
};
export {
  createVeno,
  message,
  useDisplay,
  useMessage,
  useTheme,
  version
};
//# sourceMappingURL=framework.mjs.map
