import { defineComponent as Y, toRefs as R, computed as I, createVNode as y } from "vue";
import "lodash-es";
import "dayjs";
import "ant-design-vue";
const J = {
  align: {
    type: String,
    default: "start"
  },
  src: {
    type: String,
    default: ""
  },
  shadow: {
    type: String,
    default: "hover"
  }
}, N = "g";
function _(e, t, n) {
  let r = e;
  return t && (r += `__${t}`), n && (r += `--${n}`), r;
}
function M(e, t = !1) {
  const n = t ? `.${N}-${e}` : `${N}-${e}`;
  return {
    b: () => _(n),
    e: (o) => o ? _(n, o) : "",
    m: (o) => o ? _(n, "", o) : "",
    em: (o, u) => o && u ? _(n, o, u) : ""
  };
}
const z = "G";
for (let e = 0; e <= 15; e++)
  e.toString(16);
/*!
 * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
 *
 * Copyright (c) 2014-2017, Jon Schlinkert.
 * Released under the MIT License.
 */
function V(e) {
  return Object.prototype.toString.call(e) === "[object Object]";
}
function G(e) {
  var t, n;
  return V(e) === !1 ? !1 : (t = e.constructor, t === void 0 ? !0 : (n = t.prototype, !(V(n) === !1 || n.hasOwnProperty("isPrototypeOf") === !1)));
}
function O() {
  return O = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, O.apply(this, arguments);
}
function A(e, t) {
  if (e == null)
    return {};
  var n, r, i = {}, a = Object.keys(e);
  for (r = 0; r < a.length; r++)
    t.indexOf(n = a[r]) >= 0 || (i[n] = e[n]);
  return i;
}
const w = { silent: !1, logLevel: "warn" }, H = ["validator"], C = Object.prototype, D = C.toString, K = C.hasOwnProperty, L = /^\s*function (\w+)/;
function E(e) {
  var t;
  const n = (t = e == null ? void 0 : e.type) !== null && t !== void 0 ? t : e;
  if (n) {
    const r = n.toString().match(L);
    return r ? r[1] : "";
  }
  return "";
}
const v = G, F = (e) => e;
let l = F;
process.env.NODE_ENV !== "production" && (l = typeof console < "u" ? function(t, n = w.logLevel) {
  w.silent === !1 && console[n](`[VueTypes warn]: ${t}`);
} : F);
const h = (e, t) => K.call(e, t), Q = Number.isInteger || function(e) {
  return typeof e == "number" && isFinite(e) && Math.floor(e) === e;
}, b = Array.isArray || function(e) {
  return D.call(e) === "[object Array]";
}, m = (e) => D.call(e) === "[object Function]", $ = (e) => v(e) && h(e, "_vueTypes_name"), k = (e) => v(e) && (h(e, "type") || ["_vueTypes_name", "validator", "default", "required"].some((t) => h(e, t)));
function x(e, t) {
  return Object.defineProperty(e.bind(t), "__original", { value: e });
}
function g(e, t, n = !1) {
  let r, i = !0, a = "";
  r = v(e) ? e : { type: e };
  const s = $(r) ? r._vueTypes_name + " - " : "";
  if (k(r) && r.type !== null) {
    if (r.type === void 0 || r.type === !0 || !r.required && t === void 0)
      return i;
    b(r.type) ? (i = r.type.some((o) => g(o, t, !0) === !0), a = r.type.map((o) => E(o)).join(" or ")) : (a = E(r), i = a === "Array" ? b(t) : a === "Object" ? v(t) : a === "String" || a === "Number" || a === "Boolean" || a === "Function" ? function(o) {
      if (o == null)
        return "";
      const u = o.constructor.toString().match(L);
      return u ? u[1] : "";
    }(t) === a : t instanceof r.type);
  }
  if (!i) {
    const o = `${s}value "${t}" should be of type "${a}"`;
    return n === !1 ? (l(o), !1) : o;
  }
  if (h(r, "validator") && m(r.validator)) {
    const o = l, u = [];
    if (l = (c) => {
      u.push(c);
    }, i = r.validator(t), l = o, !i) {
      const c = (u.length > 1 ? "* " : "") + u.join(`
* `);
      return u.length = 0, n === !1 ? (l(c), i) : c;
    }
  }
  return i;
}
function f(e, t) {
  const n = Object.defineProperties(t, { _vueTypes_name: { value: e, writable: !0 }, isRequired: { get() {
    return this.required = !0, this;
  } }, def: { value(i) {
    return i === void 0 ? (h(this, "default") && delete this.default, this) : m(i) || g(this, i, !0) === !0 ? (this.default = b(i) ? () => [...i] : v(i) ? () => Object.assign({}, i) : i, this) : (l(`${this._vueTypes_name} - invalid default value: "${i}"`), this);
  } } }), { validator: r } = n;
  return m(r) && (n.validator = x(r, n)), n;
}
function p(e, t) {
  const n = f(e, t);
  return Object.defineProperty(n, "validate", { value(r) {
    return m(this.validator) && l(`${this._vueTypes_name} - calling .validate() will overwrite the current custom validator function. Validator info:
${JSON.stringify(this)}`), this.validator = x(r, this), this;
  } });
}
function q(e, t, n) {
  const r = function(u) {
    const c = {};
    return Object.getOwnPropertyNames(u).forEach((d) => {
      c[d] = Object.getOwnPropertyDescriptor(u, d);
    }), Object.defineProperties({}, c);
  }(t);
  if (r._vueTypes_name = e, !v(n))
    return r;
  const { validator: i } = n, a = A(n, H);
  if (m(i)) {
    let { validator: u } = r;
    u && (u = (o = (s = u).__original) !== null && o !== void 0 ? o : s), r.validator = x(u ? function(c) {
      return u.call(this, c) && i.call(this, c);
    } : i, r);
  }
  var s, o;
  return Object.assign(r, a);
}
function T(e) {
  return e.replace(/^(?!\s*$)/gm, "  ");
}
const U = () => p("any", {}), W = () => p("function", { type: Function }), X = () => p("boolean", { type: Boolean }), Z = () => p("string", { type: String }), ee = () => p("number", { type: Number }), te = () => p("array", { type: Array }), ne = () => p("object", { type: Object }), re = () => f("integer", { type: Number, validator: (e) => Q(e) }), ie = () => f("symbol", { validator: (e) => typeof e == "symbol" });
function ae(e, t = "custom validation failed") {
  if (typeof e != "function")
    throw new TypeError("[VueTypes error]: You must provide a function as argument");
  return f(e.name || "<<anonymous function>>", { type: null, validator(n) {
    const r = e(n);
    return r || l(`${this._vueTypes_name} - ${t}`), r;
  } });
}
function oe(e) {
  if (!b(e))
    throw new TypeError("[VueTypes error]: You must provide an array as argument.");
  const t = `oneOf - value should be one of "${e.join('", "')}".`, n = e.reduce((r, i) => {
    if (i != null) {
      const a = i.constructor;
      r.indexOf(a) === -1 && r.push(a);
    }
    return r;
  }, []);
  return f("oneOf", { type: n.length > 0 ? n : void 0, validator(r) {
    const i = e.indexOf(r) !== -1;
    return i || l(t), i;
  } });
}
function ue(e) {
  if (!b(e))
    throw new TypeError("[VueTypes error]: You must provide an array as argument");
  let t = !1, n = [];
  for (let i = 0; i < e.length; i += 1) {
    const a = e[i];
    if (k(a)) {
      if ($(a) && a._vueTypes_name === "oneOf" && a.type) {
        n = n.concat(a.type);
        continue;
      }
      if (m(a.validator) && (t = !0), a.type === !0 || !a.type) {
        l('oneOfType - invalid usage of "true" or "null" as types.');
        continue;
      }
      n = n.concat(a.type);
    } else
      n.push(a);
  }
  n = n.filter((i, a) => n.indexOf(i) === a);
  const r = n.length > 0 ? n : null;
  return f("oneOfType", t ? { type: r, validator(i) {
    const a = [], s = e.some((o) => {
      const u = g($(o) && o._vueTypes_name === "oneOf" ? o.type || null : o, i, !0);
      return typeof u == "string" && a.push(u), u === !0;
    });
    return s || l(`oneOfType - provided value does not match any of the ${a.length} passed-in validators:
${T(a.join(`
`))}`), s;
  } } : { type: r });
}
function se(e) {
  return f("arrayOf", { type: Array, validator(t) {
    let n = "";
    const r = t.every((i) => (n = g(e, i, !0), n === !0));
    return r || l(`arrayOf - value validation error:
${T(n)}`), r;
  } });
}
function ce(e) {
  return f("instanceOf", { type: e });
}
function le(e) {
  return f("objectOf", { type: Object, validator(t) {
    let n = "";
    const r = Object.keys(t).every((i) => (n = g(e, t[i], !0), n === !0));
    return r || l(`objectOf - value validation error:
${T(n)}`), r;
  } });
}
function fe(e) {
  const t = Object.keys(e), n = t.filter((i) => {
    var a;
    return !((a = e[i]) === null || a === void 0 || !a.required);
  }), r = f("shape", { type: Object, validator(i) {
    if (!v(i))
      return !1;
    const a = Object.keys(i);
    if (n.length > 0 && n.some((s) => a.indexOf(s) === -1)) {
      const s = n.filter((o) => a.indexOf(o) === -1);
      return l(s.length === 1 ? `shape - required property "${s[0]}" is not defined.` : `shape - required properties "${s.join('", "')}" are not defined.`), !1;
    }
    return a.every((s) => {
      if (t.indexOf(s) === -1)
        return this._vueTypes_isLoose === !0 || (l(`shape - shape definition does not include a "${s}" property. Allowed keys: "${t.join('", "')}".`), !1);
      const o = g(e[s], i[s], !0);
      return typeof o == "string" && l(`shape - "${s}" property validation error:
 ${T(o)}`), o === !0;
    });
  } });
  return Object.defineProperty(r, "_vueTypes_isLoose", { writable: !0, value: !1 }), Object.defineProperty(r, "loose", { get() {
    return this._vueTypes_isLoose = !0, this;
  } }), r;
}
const de = ["name", "validate", "getter"], pe = /* @__PURE__ */ (() => {
  var e;
  return (e = class {
    static get any() {
      return U();
    }
    static get func() {
      return W().def(this.defaults.func);
    }
    static get bool() {
      return X().def(this.defaults.bool);
    }
    static get string() {
      return Z().def(this.defaults.string);
    }
    static get number() {
      return ee().def(this.defaults.number);
    }
    static get array() {
      return te().def(this.defaults.array);
    }
    static get object() {
      return ne().def(this.defaults.object);
    }
    static get integer() {
      return re().def(this.defaults.integer);
    }
    static get symbol() {
      return ie();
    }
    static get nullable() {
      return { type: null };
    }
    static extend(t) {
      if (b(t))
        return t.forEach((u) => this.extend(u)), this;
      const { name: n, validate: r = !1, getter: i = !1 } = t, a = A(t, de);
      if (h(this, n))
        throw new TypeError(`[VueTypes error]: Type "${n}" already defined`);
      const { type: s } = a;
      if ($(s))
        return delete a.type, Object.defineProperty(this, n, i ? { get: () => q(n, s, a) } : { value(...u) {
          const c = q(n, s, a);
          return c.validator && (c.validator = c.validator.bind(c, ...u)), c;
        } });
      let o;
      return o = i ? { get() {
        const u = Object.assign({}, a);
        return r ? p(n, u) : f(n, u);
      }, enumerable: !0 } : { value(...u) {
        const c = Object.assign({}, a);
        let d;
        return d = r ? p(n, c) : f(n, c), c.validator && (d.validator = c.validator.bind(d, ...u)), d;
      }, enumerable: !0 }, Object.defineProperty(this, n, o);
    }
  }).defaults = {}, e.sensibleDefaults = void 0, e.config = w, e.custom = ae, e.oneOf = oe, e.instanceOf = ce, e.oneOfType = ue, e.arrayOf = se, e.objectOf = le, e.shape = fe, e.utils = { validate: (t, n) => g(n, t, !0) === !0, toType: (t, n, r = !1) => r ? p(t, n) : f(t, n) }, e;
})();
function B(e = { func: () => {
}, bool: !0, string: "", number: 0, array: () => [], object: () => ({}), integer: 0 }) {
  var t;
  return (t = class extends pe {
    static get sensibleDefaults() {
      return O({}, this.defaults);
    }
    static set sensibleDefaults(n) {
      this.defaults = n !== !1 ? O({}, n !== !0 ? n : e) : {};
    }
  }).defaults = O({}, e), t;
}
class me extends B() {
}
const ye = B({
  func: void 0,
  bool: void 0,
  string: void 0,
  number: void 0,
  object: void 0,
  integer: void 0
});
ye.extend([
  {
    name: "style",
    getter: !0,
    type: [String, Object],
    default: void 0
  },
  {
    name: "VNodeChild",
    getter: !0,
    type: void 0
  }
]);
const j = /* @__PURE__ */ Y({
  name: `${z}Card`,
  props: J,
  setup(e, {
    slots: t
  }) {
    const {
      align: n,
      src: r
    } = R(e), i = M("card"), a = I(() => ({
      [i.e("actions")]: !0,
      [i.em("actions", `align-${n.value}`)]: n.value !== "start"
    }));
    return () => {
      var s, o, u, c, d, P, S;
      return y("div", {
        class: ["card-container", i.b(), i.em("shadow", e.shadow)]
      }, [(s = t.default) == null ? void 0 : s.call(t), y("div", {
        class: i.e("header")
      }, [(o = t.avatar) != null && o.call(t) ? y("div", {
        class: i.e("avatar")
      }, [(u = t.avatar) == null ? void 0 : u.call(t)]) : "", y("div", null, [y("div", {
        class: i.e("title")
      }, [(c = t.title) == null ? void 0 : c.call(t)]), y("div", {
        class: i.e("subtitle")
      }, [(d = t.subtitle) == null ? void 0 : d.call(t)])])]), (r == null ? void 0 : r.value) !== "" ? y("img", {
        src: r.value,
        alt: "",
        class: i.e("meta")
      }, null) : "", y("div", {
        class: i.e("content")
      }, [(P = t.content) == null ? void 0 : P.call(t)]), y("div", {
        class: a.value
      }, [t.actions ? (S = t.actions) == null ? void 0 : S.call(t) : ""])]);
    };
  }
});
j.install = function(e, t) {
  e.component(t || j.name, j);
};
const Oe = {
  title: "Card 卡片",
  category: "布局",
  status: "100%",
  install(e) {
    e.component(j.name, j);
  }
};
export {
  j as Card,
  Oe as default
};
