import { Dt as mergeProps, Kn as ref, Ot as nextTick, et as createVNode, gn as watch } from "./vue.runtime.esm-bundler-BvoXUmaf.js";
import { H as omit, l as propsFactory, n as genericComponent } from "./defineComponent-DB6xIcDy.js";
import { o as VDialogTransition } from "./transitions-DCQ3sjjZ.js";
import { n as makeVOverlayProps, t as VOverlay } from "./VOverlay-BS8OrX3g.js";
import { t as useRender } from "./useRender-fVtVsZgv.js";
import { t as useProxiedModel } from "./proxiedModel-DSlSIQ0y.js";
import { t as VDefaultsProvider } from "./VDefaultsProvider-C09t4-My.js";
import { t as useScopeId } from "./scopeId-CyMkmyzM.js";
import { t as forwardRefs } from "./forwardRefs-CW3d8km7.js";
import "/Users/thackmaster/Development/routie2/frontend/node_modules/vuetify/lib/components/VDialog/VDialog.css";
//#region node_modules/vuetify/lib/components/VDialog/VDialog.js
var makeVDialogProps = propsFactory({
	fullscreen: Boolean,
	scrollable: Boolean,
	...omit(makeVOverlayProps({
		captureFocus: true,
		origin: "center center",
		scrollStrategy: "block",
		transition: { component: VDialogTransition },
		zIndex: 2400,
		retainFocus: true
	}), ["disableInitialFocus"])
}, "VDialog");
var VDialog = genericComponent()({
	name: "VDialog",
	props: makeVDialogProps(),
	emits: {
		"update:modelValue": (value) => true,
		afterEnter: () => true,
		afterLeave: () => true
	},
	setup(props, { emit, slots }) {
		const isActive = useProxiedModel(props, "modelValue");
		const { scopeId } = useScopeId();
		const overlay = ref();
		function onAfterEnter() {
			emit("afterEnter");
			if ((props.scrim || props.retainFocus) && overlay.value?.contentEl && !overlay.value.contentEl.contains(document.activeElement)) overlay.value.contentEl.focus({ preventScroll: true });
		}
		function onAfterLeave() {
			emit("afterLeave");
		}
		watch(isActive, async (val) => {
			if (!val) {
				await nextTick();
				overlay.value.activatorEl?.focus({ preventScroll: true });
			}
		});
		useRender(() => {
			const overlayProps = VOverlay.filterProps(props);
			const activatorProps = mergeProps({ "aria-haspopup": "dialog" }, props.activatorProps);
			const contentProps = mergeProps({ tabindex: -1 }, props.contentProps);
			return createVNode(VOverlay, mergeProps({
				"ref": overlay,
				"class": [
					"v-dialog",
					{
						"v-dialog--fullscreen": props.fullscreen,
						"v-dialog--scrollable": props.scrollable
					},
					props.class
				],
				"style": props.style
			}, overlayProps, {
				"modelValue": isActive.value,
				"onUpdate:modelValue": ($event) => isActive.value = $event,
				"aria-modal": "true",
				"activatorProps": activatorProps,
				"contentProps": contentProps,
				"height": !props.fullscreen ? props.height : void 0,
				"width": !props.fullscreen ? props.width : void 0,
				"maxHeight": !props.fullscreen ? props.maxHeight : void 0,
				"maxWidth": !props.fullscreen ? props.maxWidth : void 0,
				"role": "dialog",
				"onAfterEnter": onAfterEnter,
				"onAfterLeave": onAfterLeave
			}, scopeId), {
				activator: slots.activator,
				default: (...args) => createVNode(VDefaultsProvider, { "root": "VDialog" }, { default: () => [slots.default?.(...args)] })
			});
		});
		return forwardRefs({}, overlay);
	}
});
//#endregion
export { VDialog };

//# sourceMappingURL=vuetify_components_VDialog.js.map