import { defineComponent, resolveComponent, h } from 'vue';
import { u as useAuthStore, b as storeToRefs } from './auth-2d06b6ac.mjs';
import { b as navigateTo } from './nuxt-link-5ac46069.mjs';
import 'h3';
import './composables-31566dd1.mjs';
import '@ucast/mongo2js';
import 'change-case';
import '@ebec/http';
import 'hapic';
import '@hapic/oauth2';
import 'ufo';
import 'hookable';
import 'unctx';

const add = defineComponent({
  emits: ["failed", "created"],
  setup(props, { emit }) {
    const handleCreated = (e) => {
      navigateTo({ path: `/admin/clients/${e.id}` });
    };
    const handleFailed = (e) => {
      emit("failed", e);
    };
    const store = useAuthStore();
    const { realmManagementId } = storeToRefs(store);
    const form = resolveComponent("ClientForm");
    return () => h(form, {
      onCreated: handleCreated,
      onFailed: handleFailed,
      realmId: realmManagementId
    });
  }
});

export { add as default };
//# sourceMappingURL=add-9bb6def6.mjs.map
