'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
require('../../../utils/index.js');
var purify_es = require('../../../../node_modules/.pnpm/dompurify@3.3.0/node_modules/dompurify/dist/purify.es.js');
var empty = require('./empty.js');
var addUnit = require('../../../utils/add-unit.js');
var createNamespace = require('../../../utils/create-namespace.js');

"use strict";
const _hoisted_1 = ["src"];
const _hoisted_2 = ["innerHTML"];
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
  ...{ name: "LlEmpty" },
  __name: "empty",
  props: empty.emptyProps,
  setup(__props) {
    const props = __props;
    const empty$1 = vue.ref();
    const purifiedTitleHtml = vue.computed(() => {
      return purify_es.default.sanitize(props.title || "");
    });
    const style = vue.computed(() => {
      return {
        width: addUnit.addUnit(props.width),
        height: addUnit.addUnit(props.height)
      };
    });
    const imageWidth = vue.computed(() => addUnit.addUnit(props.imageWidth));
    const bem = createNamespace.createNamespace("empty");
    const bemInner = createNamespace.createNamespace("empty-inner");
    const bemTitle = createNamespace.createNamespace("empty-title");
    const disableSelection = (element) => {
      element.style.userSelect = "none";
      element.style.webkitUserSelect = "none";
      element.onselectstart = () => false;
      element.onmousedown = () => false;
    };
    vue.onMounted(async () => {
      await vue.nextTick();
      if (empty$1.value) {
        disableSelection(empty$1.value);
      }
    });
    return (_ctx, _cache) => {
      return vue.openBlock(), vue.createElementBlock(
        "div",
        {
          ref_key: "empty",
          ref: empty$1,
          class: vue.normalizeClass(vue.unref(bem).b()),
          style: vue.normalizeStyle(style.value)
        },
        [
          vue.renderSlot(_ctx.$slots, "image", {}, () => [
            vue.createElementVNode("img", {
              style: vue.normalizeStyle({ width: imageWidth.value }),
              src: _ctx.url || vue.unref(empty.defaultEmptyUrl),
              draggable: "false"
            }, null, 12, _hoisted_1)
          ]),
          vue.createElementVNode(
            "div",
            {
              class: vue.normalizeClass(vue.unref(bemInner).b())
            },
            [
              _ctx.showTitle ? vue.renderSlot(_ctx.$slots, "title", { key: 0 }, () => [
                vue.createElementVNode("div", {
                  class: vue.normalizeClass(vue.unref(bemTitle).b()),
                  innerHTML: purifiedTitleHtml.value
                }, null, 10, _hoisted_2)
              ]) : vue.createCommentVNode("v-if", true)
            ],
            2
            /* CLASS */
          ),
          vue.createElementVNode(
            "div",
            {
              class: vue.normalizeClass(vue.unref(bem).e("operate-content"))
            },
            [
              vue.renderSlot(_ctx.$slots, "operate")
            ],
            2
            /* CLASS */
          )
        ],
        6
        /* CLASS, STYLE */
      );
    };
  }
});

exports.default = _sfc_main;
//# sourceMappingURL=empty.vue2.js.map
