import { defineComponent as g, mergeModels as b, useSlots as h, useModel as k, useCssModule as P, computed as T, useTemplateRef as B, watchEffect as L, createElementBlock as o, openBlock as s, normalizeClass as i, createElementVNode as t, unref as l, createCommentVNode as E, renderSlot as r, toDisplayString as M, withDirectives as v, createVNode as y, vModelText as S, normalizeProps as C, guardReactiveProps as z, vShow as D, normalizeStyle as G } from "vue";
import { PlBlockPageTitleTeleportTarget as N } from "./PlBlockPageTitleTeleportTarget.js";
/* empty css                   */
import V from "../../components/PlIcon24/PlIcon24.vue.js";
import { PL_PLACEHOLDER_TEXTS as $ } from "../PlPlaceholder/index.js";
import w from "../PlPlaceholder/PlPlaceholder.vue.js";
const I = { class: "pl-block-page__title" }, R = { class: "pl-block-page__title__default" }, A = { key: 0 }, O = { key: 1 }, H = { class: "pl-block-page__title__append" }, U = ["placeholder"], X = { key: 1 }, j = { class: "pl-block-page__body" }, q = {
  name: "PlBlockPage"
}, Z = /* @__PURE__ */ g({
  ...q,
  props: /* @__PURE__ */ b({
    title: {},
    subtitlePlaceholder: {},
    noBodyGutters: { type: Boolean },
    bodyLoading: {}
  }, {
    subtitle: {},
    subtitleModifiers: {}
  }),
  emits: ["update:subtitle"],
  setup(p) {
    const u = h(), e = p, n = k(p, "subtitle"), d = P(), c = T(() => typeof e.bodyLoading == "string" ? { variant: e.bodyLoading, ...$.LOADING } : e.bodyLoading), _ = B("teleportTarget");
    return L(() => {
      N.value = _.value;
    }), (a, m) => (s(), o("div", {
      class: i(["pl-layout-component pl-block-page", { noBodyGutters: e.noBodyGutters }])
    }, [
      l(u).title || e.title ? (s(), o("div", {
        key: 0,
        class: i(l(d).header)
      }, [
        t("div", I, [
          t("div", R, [
            l(u).title ? (s(), o("span", A, [
              r(a.$slots, "title")
            ])) : (s(), o("span", O, M(e.title), 1)),
            r(a.$slots, "after-title")
          ]),
          t("div", H, [
            t("div", {
              ref_key: "teleportTarget",
              ref: _,
              class: "pl-block-page__title__append__teleport"
            }, null, 512),
            r(a.$slots, "append")
          ])
        ]),
        n.value !== void 0 ? (s(), o("div", {
          key: 0,
          class: i(l(d).subtitle)
        }, [
          v(t("input", {
            "onUpdate:modelValue": m[0] || (m[0] = (f) => n.value = f),
            placeholder: e.subtitlePlaceholder
          }, null, 8, U), [
            [
              S,
              n.value,
              void 0,
              {
                lazy: !0,
                trim: !0
              }
            ]
          ]),
          y(l(V), {
            class: i(l(d).editIcon),
            name: "edit",
            color: "var(--ic-02)"
          }, null, 8, ["class"])
        ], 2)) : E("", !0)
      ], 2)) : (s(), o("div", X)),
      t("div", j, [
        v(y(l(w), C(z(c.value)), null, 16), [
          [D, c.value]
        ]),
        t("div", {
          style: G({ display: c.value ? "none" : "contents" })
        }, [
          r(a.$slots, "default")
        ], 4)
      ])
    ], 2));
  }
});
export {
  Z as default
};
//# sourceMappingURL=PlBlockPage.vue2.js.map
