import { get as n, omit as a } from "lodash-es";
import { clsx as h } from "clsx";
import { twMerge as v } from "tailwind-merge";
import l from "react";
function D(e = 6, t = "abcdefghijklmnopqrstuvwxyzABCD") {
  let i = "";
  for (let r = e; r > 0; --r)
    i += t[Math.floor(Math.random() * t.length)];
  return i;
}
const N = (e) => e >= 1536 ? "2XL" : e >= 1280 ? "XL" : e >= 1024 ? "LG" : e >= 768 ? "MD" : e >= 640 ? "SM" : "XS", z = (...e) => v(h(e)), O = "#styles:", L = (e) => ({
  type: "singular",
  default: e.default || "",
  binding: n(e, "binding", !0),
  dataType: "string",
  schema: {
    type: "string",
    ...a(e, ["i18n", "required"])
  },
  uiSchema: {
    "ui:widget": "code"
  }
}), M = (e) => ({
  type: "singular",
  default: e.default || "",
  binding: n(e, "binding", !0),
  dataType: "string",
  required: e.required || !1,
  ai: e.ai || void 0,
  schema: {
    type: "string",
    ...a(e, ["ai", "required"])
  },
  uiSchema: {
    "ui:placeholder": e.placeholder || "Enter here"
  }
}), B = (e) => ({
  type: "singular",
  default: e.default || "",
  binding: n(e, "binding", !0),
  dataType: "string",
  required: e.required || !1,
  ai: e.ai || void 0,
  schema: {
    type: "string",
    ...a(e, ["i18n", "required", "rows"])
  },
  uiSchema: {
    "ui:widget": "textarea",
    "ui:placeholder": e.placeholder || "Enter here",
    "ui:options": {
      rows: e.rows || 4
    }
  }
}), G = (e) => ({
  type: "singular",
  i18n: e.i18n || !1,
  default: e.default || !1,
  dataType: "boolean",
  binding: n(e, "binding", !0),
  ai: e.ai || void 0,
  schema: {
    type: "boolean",
    ...a(e, ["i18n", "required"])
  },
  uiSchema: {
    "ui:title": e.title || "Select Item",
    "ui:description": ""
  }
}), W = (e) => ({
  type: "singular",
  default: e.default || "",
  binding: n(e, "binding", !0),
  dataType: "number",
  required: e.required || !1,
  ai: e.ai || void 0,
  schema: {
    type: "number",
    ...a(e, ["i18n", "required"])
  },
  uiSchema: {}
}), X = (e) => ({
  type: "singular",
  default: e.default || "",
  binding: n(e, "binding", !0),
  required: e.required || !1,
  dataType: "string",
  ai: e.ai || void 0,
  schema: {
    type: "string",
    ...a(e, ["i18n", "required", "options", "binding"]),
    oneOf: e.options.map((t) => ({ const: t.value, title: t.title }))
  },
  uiSchema: {
    "ui:widget": "select"
  }
}), U = (e) => ({
  type: "singular",
  i18n: e.i18n || !1,
  default: e.default || "",
  binding: n(e, "binding", !0),
  dataType: "string",
  ai: e.ai || void 0,
  schema: {
    type: "string",
    ...a(e, ["i18n", "required"])
  },
  uiSchema: {
    "ui:widget": "color"
  }
}), $ = (e) => ({
  type: "singular",
  default: e.default || "",
  binding: n(e, "binding", !0),
  dataType: "string",
  ai: e.ai || void 0,
  schema: {
    type: "string",
    ...a(e, ["i18n", "required"])
  },
  uiSchema: {
    "ui:widget": "richtext"
  }
}), A = (e) => ({
  type: "model",
  title: e.title,
  dataType: "object",
  default: e.default || {},
  binding: n(e, "binding", !0),
  properties: e.properties
}), K = (e) => ({
  type: "list",
  itemProperties: e.itemProperties,
  binding: n(e, "binding", !0),
  title: e.title,
  ai: e.ai || void 0,
  dataType: "array",
  default: e.default || [],
  itemTitle: e.getItemLabel ? e.getItemLabel({}) : () => ""
}), R = (e) => ({
  type: "styles",
  binding: !1,
  default: `${O},${e.default || ""}`,
  presets: e.presets || {}
}), V = (e) => ({
  default: e.default || "",
  binding: n(e, "binding", !0),
  type: "singular",
  dataType: "string",
  ai: e.ai || void 0,
  schema: {
    type: "string",
    title: "Icon",
    default: e.default || ""
  },
  uiSchema: {
    "ui:widget": "icon"
  }
}), F = (e) => ({
  default: e.default,
  type: "singular",
  binding: n(e, "binding", !0),
  dataType: "object",
  ai: e.ai || void 0,
  schema: {
    type: "object",
    ...e || {},
    properties: {
      type: { type: "string" },
      href: { type: "string" },
      target: { type: "string" }
    }
  },
  uiSchema: {
    "ui:field": "link"
  }
}), H = (e) => ({
  type: "singular",
  default: e.default || "",
  binding: n(e, "binding", !0),
  dataType: "string",
  ai: e.ai || void 0,
  schema: {
    type: "string",
    ...a(e, ["i18n", "required"])
  },
  uiSchema: {
    "ui:widget": "image"
  }
});
var m = {
  color: void 0,
  size: void 0,
  className: void 0,
  style: void 0,
  attr: void 0
}, p = l.createContext && /* @__PURE__ */ l.createContext(m), w = ["attr", "size", "title"];
function j(e, t) {
  if (e == null)
    return {};
  var i = P(e, t), r, u;
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (u = 0; u < o.length; u++)
      r = o[u], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (i[r] = e[r]);
  }
  return i;
}
function P(e, t) {
  if (e == null)
    return {};
  var i = {};
  for (var r in e)
    if (Object.prototype.hasOwnProperty.call(e, r)) {
      if (t.indexOf(r) >= 0)
        continue;
      i[r] = e[r];
    }
  return i;
}
function s() {
  return s = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var i = arguments[t];
      for (var r in i)
        Object.prototype.hasOwnProperty.call(i, r) && (e[r] = i[r]);
    }
    return e;
  }, s.apply(this, arguments);
}
function f(e, t) {
  var i = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(u) {
      return Object.getOwnPropertyDescriptor(e, u).enumerable;
    })), i.push.apply(i, r);
  }
  return i;
}
function c(e) {
  for (var t = 1; t < arguments.length; t++) {
    var i = arguments[t] != null ? arguments[t] : {};
    t % 2 ? f(Object(i), !0).forEach(function(r) {
      S(e, r, i[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(i)) : f(Object(i)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(i, r));
    });
  }
  return e;
}
function S(e, t, i) {
  return t = q(t), t in e ? Object.defineProperty(e, t, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = i, e;
}
function q(e) {
  var t = T(e, "string");
  return typeof t == "symbol" ? t : t + "";
}
function T(e, t) {
  if (typeof e != "object" || !e)
    return e;
  var i = e[Symbol.toPrimitive];
  if (i !== void 0) {
    var r = i.call(e, t || "default");
    if (typeof r != "object")
      return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
function y(e) {
  return e && e.map((t, i) => /* @__PURE__ */ l.createElement(t.tag, c({
    key: i
  }, t.attr), y(t.child)));
}
function J(e) {
  return (t) => /* @__PURE__ */ l.createElement(x, s({
    attr: c({}, e.attr)
  }, t), y(e.child));
}
function x(e) {
  var t = (i) => {
    var {
      attr: r,
      size: u,
      title: o
    } = e, b = j(e, w), g = u || i.size || "1em", d;
    return i.className && (d = i.className), e.className && (d = (d ? d + " " : "") + e.className), /* @__PURE__ */ l.createElement("svg", s({
      stroke: "currentColor",
      fill: "currentColor",
      strokeWidth: "0"
    }, i.attr, r, b, {
      className: d,
      style: c(c({
        color: e.color || i.color
      }, i.style), e.style),
      height: g,
      width: g,
      xmlns: "http://www.w3.org/2000/svg"
    }), o && /* @__PURE__ */ l.createElement("title", null, o), e.children);
  };
  return p !== void 0 ? /* @__PURE__ */ l.createElement(p.Consumer, null, (i) => t(i)) : t(m);
}
export {
  J as G,
  K as S,
  V as T,
  N as a,
  M as b,
  z as c,
  $ as d,
  G as e,
  X as f,
  D as g,
  A as h,
  R as o,
  F as q,
  B as r,
  U as s,
  L as u,
  H as v,
  W as y
};
