import { defineComponent as f, mergeDefaults as c, ref as y, useAttrs as V, createBlock as k, openBlock as m, Teleport as w, createVNode as v, createElementBlock as l, createCommentVNode as s, withCtx as C, mergeProps as _, unref as B, withKeys as d, createElementVNode as O, renderSlot as $ } from "vue";
/* empty css                    */
import h from "../TransitionSlidePanel.vue.js";
/* empty css                   */
/* empty css                                        */
import "@milaboratories/helpers";
/* empty css                       */
import { useEventListener as E } from "../../composition/useEventListener.js";
import "../../composition/useTheme.js";
/* empty css                           */
import { useClickOutside as P } from "../../composition/useClickOutside.js";
/* empty css               */
import "../../global/resizeObserver.js";
import "../../layout/PlBlockPage/PlBlockPageTitleTeleportTarget.js";
/* empty css                                          */
import "@vueuse/core";
import "../PlSvg/registry.js";
import "../../layout/PlPlaceholder/PlPlaceholder.vue2.js";
/* empty css                                         */
/* empty css                                          */
/* empty css                               */
/* empty css                             */
/* empty css                                  */
/* empty css                       */
/* empty css                                     */
/* empty css                            */
/* empty css                                                */
import "canonicalize";
/* empty css                     */
/* empty css                                */
/* empty css                                */
/* empty css                              */
/* empty css                              */
/* empty css                            */
/* empty css                                      */
/* empty css                                  */
/* empty css                              */
/* empty css                             */
/* empty css                                  */
/* empty css                                        */
/* empty css                                    */
/* empty css                             */
/* empty css                                          */
/* empty css                                      */
/* empty css                                     */
/* empty css                                        */
import "@vueuse/integrations/useSortable";
/* empty css                            */
import "@platforma-sdk/model";
/* empty css                                    */
/* empty css                                      */
import { defaultProps as g } from "./props.js";
/* empty css                                */
/* empty css                             */
/* empty css                                */
/* empty css                                      */
/* empty css                                */
/* empty css                                                */
import "d3-selection";
import "d3-axis";
import "d3-array";
import "d3-scale";
import "../../colors/color.js";
import "../../colors/gradient.js";
const K = {
  name: "PlPureSlideModal",
  inheritAttrs: !1
}, qt = /* @__PURE__ */ f({
  ...K,
  props: /* @__PURE__ */ c({
    modelValue: { type: Boolean },
    width: {},
    shadow: { type: Boolean },
    closeOnOutsideClick: { type: Boolean }
  }, g),
  emits: ["update:modelValue"],
  setup(a, { emit: u }) {
    const e = u, i = y(), n = V(), t = a;
    return P(i, () => {
      t.modelValue && t.closeOnOutsideClick && e("update:modelValue", !1);
    }), E(document, "keydown", (r) => {
      r.key === "Escape" && e("update:modelValue", !1);
    }), (r, o) => (m(), k(w, { to: "body" }, [
      v(h, null, {
        default: C(() => [
          t.modelValue ? (m(), l("div", _({
            key: 0,
            ref_key: "modal",
            ref: i,
            class: "pl-slide-modal",
            style: { width: t.width }
          }, B(n), {
            onKeyup: o[1] || (o[1] = d((p) => e("update:modelValue", !1), ["esc"]))
          }), [
            O("div", {
              class: "close-dialog-btn",
              onClick: o[0] || (o[0] = (p) => e("update:modelValue", !1))
            }),
            $(r.$slots, "default")
          ], 16)) : s("", !0)
        ]),
        _: 3
      }),
      t.modelValue && t.shadow ? (m(), l("div", {
        key: 0,
        class: "pl-slide-modal__shadow",
        onKeyup: o[2] || (o[2] = d((p) => e("update:modelValue", !1), ["esc"]))
      }, null, 32)) : s("", !0)
    ]));
  }
});
export {
  qt as default
};
//# sourceMappingURL=PlPureSlideModal.vue.js.map
