"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const types = require("../../../utils/types.js");
const index = require("../../../hooks/use-namespace/index.js");
const col = require("./col.js");
const constants = require("../../row/src/constants.js");
const Vue = require("vue");
const shared_esmBundler = require("../../../../../@vue/shared/dist/shared.esm-bundler.js");
var col_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ Vue.defineComponent({
  name: "ElCol",
  __name: "col",
  props: col.colProps,
  setup(__props) {
    const props = __props;
    const { gutter } = Vue.inject(constants.rowContextKey, { gutter: Vue.computed(() => 0) });
    const ns = index.useNamespace("col");
    const style = Vue.computed(() => {
      const styles = {};
      if (gutter.value) styles.paddingLeft = styles.paddingRight = `${gutter.value / 2}px`;
      return styles;
    });
    const colKls = Vue.computed(() => {
      const classes = [];
      [
        "span",
        "offset",
        "pull",
        "push"
      ].forEach((prop) => {
        const size = props[prop];
        if (types.isNumber(size)) {
          if (prop === "span") classes.push(ns.b(`${props[prop]}`));
          else if (size > 0) classes.push(ns.b(`${prop}-${props[prop]}`));
        }
      });
      [
        "xs",
        "sm",
        "md",
        "lg",
        "xl"
      ].forEach((size) => {
        if (types.isNumber(props[size])) classes.push(ns.b(`${size}-${props[size]}`));
        else if (shared_esmBundler.isObject(props[size])) Object.entries(props[size]).forEach(([prop, sizeProp]) => {
          classes.push(prop !== "span" ? ns.b(`${size}-${prop}-${sizeProp}`) : ns.b(`${size}-${sizeProp}`));
        });
      });
      if (gutter.value) classes.push(ns.is("guttered"));
      return [ns.b(), classes];
    });
    return (_ctx, _cache) => {
      return Vue.openBlock(), Vue.createBlock(Vue.resolveDynamicComponent(__props.tag), {
        class: Vue.normalizeClass(colKls.value),
        style: Vue.normalizeStyle(style.value)
      }, {
        default: Vue.withCtx(() => [Vue.renderSlot(_ctx.$slots, "default")]),
        _: 3
      }, 8, ["class", "style"]);
    };
  }
});
exports.default = col_vue_vue_type_script_setup_true_lang_default;
