import { mix as c } from "./mix.es.js";
import { mixColor as f } from "./mix-color.es.js";
import { isNum as i } from "./inc.es.js";
import { pipe as p } from "./pipe.es.js";
import { warning as d } from "../../../../hey-listen/dist/hey-listen.es.es.js";
import { complex as a } from "../../../../style-value-types/dist/es/complex/index.es.js";
import { color as b } from "../../../../style-value-types/dist/es/color/index.es.js";
function l(n, e) {
  return i(n) ? (r) => c(n, e, r) : b.test(n) ? f(n, e) : h(n, e);
}
const x = (n, e) => {
  const r = [...n], o = r.length, t = n.map((u, s) => l(u, e[s]));
  return (u) => {
    for (let s = 0; s < o; s++)
      r[s] = t[s](u);
    return r;
  };
}, C = (n, e) => {
  const r = Object.assign(Object.assign({}, n), e), o = {};
  for (const t in r)
    n[t] !== void 0 && e[t] !== void 0 && (o[t] = l(n[t], e[t]));
  return (t) => {
    for (const u in o)
      r[u] = o[u](t);
    return r;
  };
};
function m(n) {
  const e = a.parse(n), r = e.length;
  let o = 0, t = 0, u = 0;
  for (let s = 0; s < r; s++)
    o || typeof e[s] == "number" ? o++ : e[s].hue !== void 0 ? u++ : t++;
  return { parsed: e, numNumbers: o, numRGB: t, numHSL: u };
}
const h = (n, e) => {
  const r = a.createTransformer(e), o = m(n), t = m(e);
  return o.numHSL === t.numHSL && o.numRGB === t.numRGB && o.numNumbers >= t.numNumbers ? p(x(o.parsed, t.parsed), r) : (d(!0, `Complex values '${n}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`), (s) => `${s > 0 ? e : n}`);
};
export {
  x as mixArray,
  h as mixComplex,
  C as mixObject
};
//# sourceMappingURL=mix-complex.es.js.map
