"use strict";
const vue = require("vue");
const BCard_vue_vue_type_script_setup_true_lang = require("./BCard.vue_vue_type_script_setup_true_lang-D_MdzqZw.js");
const useDefaults = require("./useDefaults-YXpmugKp.js");
const BTableSimple_vue_vue_type_script_setup_true_lang = require("./BTableSimple.vue_vue_type_script_setup_true_lang-fbqLNWG6.js");
const useColorVariantClasses = require("./useColorVariantClasses-BjkZZDqD.js");
const index = require("./index-JJEBhaXq.js");
const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
  ...{
    inheritAttrs: false
  },
  __name: "BPlaceholder",
  props: {
    animation: { default: void 0 },
    cols: { default: 12 },
    size: { default: "md" },
    tag: { default: "span" },
    variant: { default: null },
    width: { default: void 0 },
    wrapperTag: { default: "span" }
  },
  setup(__props) {
    const _props = __props;
    const props = useDefaults.useDefaults(_props, "BPlaceholder");
    const widthString = vue.computed(
      () => props.width === void 0 ? void 0 : typeof props.width === "number" ? props.width.toString() : props.width.replace("%", "")
    );
    const colsString = vue.computed(
      () => props.cols === void 0 ? void 0 : typeof props.cols === "number" ? props.cols.toString() : props.cols
    );
    const colorClasses = useColorVariantClasses.useColorVariantClasses(
      vue.computed(() => ({
        bgVariant: props.variant
      }))
    );
    const computedClasses = vue.computed(() => [
      colorClasses.value,
      {
        [`col-${colsString.value}`]: colsString.value !== void 0 && widthString.value === void 0,
        [`placeholder-${props.size}`]: props.size !== "md"
      }
    ]);
    const wrapperClasses = vue.computed(() => ({
      [`placeholder-${props.animation}`]: props.animation !== void 0
    }));
    const computedStyle = vue.computed(() => ({
      width: widthString.value === void 0 ? void 0 : `${widthString.value}%`
    }));
    return (_ctx, _cache) => {
      return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(props).wrapperTag), {
        class: vue.normalizeClass(wrapperClasses.value)
      }, {
        default: vue.withCtx(() => [
          (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(__props.tag), vue.mergeProps(_ctx.$attrs, {
            class: ["placeholder", computedClasses.value],
            style: computedStyle.value
          }), null, 16, ["class", "style"]))
        ]),
        _: 1
      }, 8, ["class"]);
    };
  }
});
const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
  __name: "BPlaceholderButton",
  props: {
    animation: { default: void 0 },
    cols: { default: void 0 },
    tag: { default: "div" },
    variant: { default: "primary" },
    width: { default: void 0 }
  },
  setup(__props) {
    const _props = __props;
    const props = useDefaults.useDefaults(_props, "BPlaceholderButton");
    const computedClasses = vue.computed(() => ({
      [`btn-${props.variant}`]: props.variant !== null
    }));
    return (_ctx, _cache) => {
      return vue.openBlock(), vue.createBlock(_sfc_main$4, {
        class: vue.normalizeClass(["btn disabled", computedClasses.value]),
        animation: vue.unref(props).animation,
        width: vue.unref(props).width,
        cols: vue.unref(props).cols,
        tag: vue.unref(props).tag,
        style: { "cursor": "wait", "pointer-events": "auto" }
      }, null, 8, ["class", "animation", "width", "cols", "tag"]);
    };
  }
});
const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
  __name: "BPlaceholderCard",
  props: {
    animation: { default: void 0 },
    footerAnimation: { default: void 0 },
    footerSize: { default: "md" },
    footerVariant: { default: void 0 },
    footerWidth: { default: 100 },
    headerAnimation: { default: void 0 },
    headerSize: { default: "md" },
    headerVariant: { default: void 0 },
    headerWidth: { default: 100 },
    imgBlankColor: { default: "#868e96" },
    imgPlacement: { default: "top" },
    imgHeight: { default: 100 },
    imgSrc: { default: void 0 },
    noButton: { type: Boolean, default: false },
    noFooter: { type: Boolean, default: false },
    noHeader: { type: Boolean, default: false },
    noImg: { type: Boolean, default: false },
    size: { default: "md" },
    variant: { default: void 0 }
  },
  setup(__props) {
    const _props = __props;
    const props = useDefaults.useDefaults(_props, "BPlaceholderCard");
    const defaultAttrs = vue.computed(() => ({
      animation: props.animation,
      size: props.size,
      variant: props.variant
    }));
    const footerComponent = vue.computed(() => !props.noButton ? _sfc_main$3 : _sfc_main$4);
    return (_ctx, _cache) => {
      return vue.openBlock(), vue.createBlock(BCard_vue_vue_type_script_setup_true_lang._sfc_main, {
        "img-placement": vue.unref(props).imgPlacement
      }, vue.createSlots({
        default: vue.withCtx(() => [
          vue.renderSlot(_ctx.$slots, "default", {}, () => [
            vue.createVNode(_sfc_main$4, vue.mergeProps({ cols: "7" }, defaultAttrs.value), null, 16),
            vue.createVNode(_sfc_main$4, vue.mergeProps({ cols: "4" }, defaultAttrs.value), null, 16),
            vue.createVNode(_sfc_main$4, vue.mergeProps({ cols: "4" }, defaultAttrs.value), null, 16),
            vue.createVNode(_sfc_main$4, vue.mergeProps({ cols: "6" }, defaultAttrs.value), null, 16),
            vue.createVNode(_sfc_main$4, vue.mergeProps({ cols: "8" }, defaultAttrs.value), null, 16)
          ])
        ]),
        _: 2
      }, [
        !vue.unref(props).noImg ? {
          name: "img",
          fn: vue.withCtx(() => [
            vue.renderSlot(_ctx.$slots, "img", {}, () => [
              vue.createVNode(BCard_vue_vue_type_script_setup_true_lang._sfc_main$4, {
                blank: !vue.unref(props).imgSrc ? true : false,
                "blank-color": vue.unref(props).imgBlankColor,
                height: !vue.unref(props).imgSrc ? vue.unref(props).imgHeight : void 0,
                src: vue.unref(props).imgSrc,
                "img-placement": vue.unref(props).imgPlacement,
                style: { cursor: "wait" }
              }, null, 8, ["blank", "blank-color", "height", "src", "img-placement"])
            ])
          ]),
          key: "0"
        } : void 0,
        !vue.unref(props).noHeader ? {
          name: "header",
          fn: vue.withCtx(() => [
            vue.renderSlot(_ctx.$slots, "header", {}, () => [
              vue.createVNode(_sfc_main$4, {
                width: vue.unref(props).headerWidth,
                variant: vue.unref(props).headerVariant,
                animation: vue.unref(props).headerAnimation,
                size: vue.unref(props).headerSize
              }, null, 8, ["width", "variant", "animation", "size"])
            ])
          ]),
          key: "1"
        } : void 0,
        !vue.unref(props).noFooter ? {
          name: "footer",
          fn: vue.withCtx(() => [
            vue.renderSlot(_ctx.$slots, "footer", {}, () => [
              (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(footerComponent.value), {
                width: vue.unref(props).footerWidth,
                animation: vue.unref(props).footerAnimation,
                size: vue.unref(props).noButton ? vue.unref(props).footerSize : void 0,
                variant: vue.unref(props).footerVariant
              }, null, 8, ["width", "animation", "size", "variant"]))
            ])
          ]),
          key: "2"
        } : void 0
      ]), 1032, ["img-placement"]);
    };
  }
});
const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
  __name: "BPlaceholderTable",
  props: {
    animation: { default: void 0 },
    cellWidth: { default: 100 },
    columns: { default: 5 },
    footerAnimation: { default: void 0 },
    footerCellWidth: { default: 100 },
    footerColumns: { default: void 0 },
    footerSize: { default: "md" },
    footerVariant: { default: void 0 },
    headerAnimation: { default: void 0 },
    headerCellWidth: { default: 100 },
    headerColumns: { default: void 0 },
    headerSize: { default: "md" },
    headerVariant: { default: void 0 },
    noHeader: { type: Boolean, default: false },
    rows: { default: 3 },
    showFooter: { type: Boolean, default: false },
    size: { default: "md" },
    variant: { default: void 0 }
  },
  setup(__props) {
    const _props = __props;
    const props = useDefaults.useDefaults(_props, "BPlaceholderTable");
    const columnsToNumber = index.useToNumber(() => props.columns);
    const rowsToNumber = index.useToNumber(() => props.rows);
    const computedHeaderColumns = vue.computed(() => props.headerColumns ?? Number.NaN);
    const computedFooterColumns = vue.computed(() => props.footerColumns ?? Number.NaN);
    const headerColumnsNumber = index.useToNumber(computedHeaderColumns);
    const footerColumnsNumber = index.useToNumber(computedFooterColumns);
    const columnsNumber = vue.computed(() => columnsToNumber.value || 5);
    const rowsNumber = vue.computed(() => rowsToNumber.value || 3);
    const computedHeaderColumnsLength = vue.computed(
      () => props.headerColumns === void 0 ? columnsNumber.value : Number.isNaN(headerColumnsNumber.value) ? columnsNumber.value : headerColumnsNumber.value
    );
    const computedFooterColumnsLength = vue.computed(
      () => props.footerColumns === void 0 ? columnsNumber.value : Number.isNaN(footerColumnsNumber.value) ? columnsNumber.value : footerColumnsNumber.value
    );
    return (_ctx, _cache) => {
      return vue.openBlock(), vue.createBlock(BTableSimple_vue_vue_type_script_setup_true_lang._sfc_main, null, {
        default: vue.withCtx(() => [
          !vue.unref(props).noHeader ? vue.renderSlot(_ctx.$slots, "thead", { key: 0 }, () => [
            vue.createElementVNode("thead", null, [
              vue.createElementVNode("tr", null, [
                (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(computedHeaderColumnsLength.value, (_, i) => {
                  return vue.openBlock(), vue.createElementBlock("th", { key: i }, [
                    vue.createVNode(_sfc_main$4, {
                      size: vue.unref(props).headerSize,
                      variant: vue.unref(props).headerVariant,
                      animation: vue.unref(props).headerAnimation,
                      width: vue.unref(props).headerCellWidth
                    }, null, 8, ["size", "variant", "animation", "width"])
                  ]);
                }), 128))
              ])
            ])
          ]) : vue.createCommentVNode("", true),
          vue.renderSlot(_ctx.$slots, "default", {}, () => [
            vue.createElementVNode("tbody", null, [
              (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(rowsNumber.value, (_, j) => {
                return vue.openBlock(), vue.createElementBlock("tr", { key: j }, [
                  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(columnsNumber.value, (__, k) => {
                    return vue.openBlock(), vue.createElementBlock("td", { key: k }, [
                      vue.createVNode(_sfc_main$4, {
                        size: vue.unref(props).size,
                        variant: vue.unref(props).variant,
                        animation: vue.unref(props).animation,
                        width: vue.unref(props).cellWidth
                      }, null, 8, ["size", "variant", "animation", "width"])
                    ]);
                  }), 128))
                ]);
              }), 128))
            ])
          ]),
          vue.unref(props).showFooter ? vue.renderSlot(_ctx.$slots, "tfoot", { key: 1 }, () => [
            vue.createElementVNode("tfoot", null, [
              vue.createElementVNode("tr", null, [
                (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(computedFooterColumnsLength.value, (_, l) => {
                  return vue.openBlock(), vue.createElementBlock("th", { key: l }, [
                    vue.createVNode(_sfc_main$4, {
                      size: vue.unref(props).footerSize,
                      variant: vue.unref(props).footerVariant,
                      animation: vue.unref(props).footerAnimation,
                      width: vue.unref(props).footerCellWidth
                    }, null, 8, ["size", "variant", "animation", "width"])
                  ]);
                }), 128))
              ])
            ])
          ]) : vue.createCommentVNode("", true)
        ]),
        _: 3
      });
    };
  }
});
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
  __name: "BPlaceholderWrapper",
  props: {
    loading: { type: Boolean, default: false }
  },
  setup(__props) {
    const _props = __props;
    const props = useDefaults.useDefaults(_props, "BPlaceholderWrapper");
    return (_ctx, _cache) => {
      return vue.unref(props).loading ? vue.renderSlot(_ctx.$slots, "loading", { key: 0 }) : vue.renderSlot(_ctx.$slots, "default", { key: 1 });
    };
  }
});
exports._sfc_main = _sfc_main$4;
exports._sfc_main$1 = _sfc_main$3;
exports._sfc_main$2 = _sfc_main$2;
exports._sfc_main$3 = _sfc_main$1;
exports._sfc_main$4 = _sfc_main;
//# sourceMappingURL=BPlaceholderWrapper.vue_vue_type_script_setup_true_lang-fUMoIB0j.js.map
