import { jsx as e, Fragment as v } from "react/jsx-runtime";
import { useState as C, useMemo as N, createElement as K } from "react";
import { c as j, s as E, a as F } from "../tools/tools.js";
import { P as t } from "./progress-bar.js";
import { P as y } from "./progress-stacked.js";
const a = function(P) {
  const {
    animated: f,
    as: n = "div",
    barProps: g,
    bg: u,
    children: i,
    className: l,
    dropOldClass: p,
    now: b,
    options: h,
    stacked: k,
    stackedProps: w,
    striped: x,
    style: d,
    variables: c,
    ...m
  } = P, B = (h ?? []).map((s, r) => ({
    ...s,
    id: s.id ?? r
  })), [O] = C(B), o = N(() => {
    const s = j(!p && "progress", l), r = E((M, S) => ({ tKey: F(S) }), c, d);
    return {
      className: s,
      style: r
    };
  }, [l, p, d, c]);
  return /* @__PURE__ */ e(v, { children: k ? /* @__PURE__ */ e(y, { ...w, children: O.map((s) => {
    let r = o.style;
    return s.now && (r = { ...r, width: `${s.now}%` }), /* @__PURE__ */ K(n, { ...m, ...o, ...s.props, key: s.id, style: r }, /* @__PURE__ */ e(t, { ...s.barProps, animated: s.animated, bg: s.bg, striped: s.striped, children: i }));
  }) }) : /* @__PURE__ */ e(n, { ...m, ...o, children: /* @__PURE__ */ e(t, { ...g, animated: f, bg: u, now: b, striped: x, children: i }) }) });
};
a.Bar = t;
a.Stacked = y;
a.displayName = "BRL.Progress";
export {
  a as P
};
//# sourceMappingURL=progress.js.map
