import { VxeUI } from "../../../@vxe-ui/core/es/index.esm.mjs";
import VxeLoadingComponent from "./src/loading.mjs";
import { dynamicApp, dynamicStore, checkDynamic } from "../dynamics/index.mjs";
const VxeLoading = Object.assign({}, VxeLoadingComponent, {
  install(app) {
    app.component(VxeLoadingComponent.name, VxeLoadingComponent);
  }
});
const LoadingController = {
  open(options) {
    const opts = Object.assign({}, options);
    dynamicStore.globalLoading = {
      modelValue: true,
      text: opts.text,
      icon: opts.icon
    };
    checkDynamic();
  },
  close() {
    dynamicStore.globalLoading = null;
  }
};
dynamicApp.use(VxeLoading);
VxeUI.component(VxeLoadingComponent);
VxeUI.loading = LoadingController;
const Loading = VxeLoading;
export {
  Loading,
  LoadingController,
  VxeLoading,
  VxeLoading as default
};
