import { useEventListener as e } from "../../composition/useEventListener.js";
import { useClickOutside as t } from "../../composition/useClickOutside.js";
import n from "../../utils/PlCloseModalBtn.js";
import './pl-slide-modal.css';/* empty css               */
import r from "../TransitionSlidePanel.js";
import { defaultProps as i } from "./props.js";
import { Teleport as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createVNode as l, defineComponent as u, mergeDefaults as d, mergeProps as f, openBlock as p, ref as m, renderSlot as h, unref as g, useAttrs as _, withCtx as v, withKeys as y } from "vue";
var b = /* @__PURE__ */ u({
	name: "PlPureSlideModal",
	inheritAttrs: !1,
	props: /* @__PURE__ */ d({
		modelValue: { type: Boolean },
		width: {},
		shadow: { type: Boolean },
		closeOnOutsideClick: { type: Boolean }
	}, i),
	emits: ["update:modelValue"],
	setup(i, { emit: u }) {
		let d = u, b = m(), x = _(), S = i;
		return t(b, () => {
			S.modelValue && S.closeOnOutsideClick && d("update:modelValue", !1);
		}), e(document, "keydown", (e) => {
			e.key === "Escape" && d("update:modelValue", !1);
		}), (e, t) => (p(), o(a, { to: "body" }, [l(r, null, {
			default: v(() => [S.modelValue ? (p(), c("div", f({
				key: 0,
				ref_key: "modal",
				ref: b,
				class: "pl-slide-modal",
				style: { width: S.width }
			}, g(x), { onKeyup: t[1] ||= y((e) => d("update:modelValue", !1), ["esc"]) }), [l(n, {
				class: "close-dialog-btn",
				onClick: t[0] ||= (e) => d("update:modelValue", !1)
			}), h(e.$slots, "default")], 16)) : s("", !0)]),
			_: 3
		}), S.modelValue && S.shadow ? (p(), c("div", {
			key: 0,
			class: "pl-slide-modal__shadow",
			onKeyup: t[2] ||= y((e) => d("update:modelValue", !1), ["esc"])
		}, null, 32)) : s("", !0)]));
	}
});
export { b as default };

//# sourceMappingURL=PlPureSlideModal.vue2.js.map