"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const number = require("./dist-es-utils-mix-number.cjs");
const index = require("./dist-es-value-types-complex-index.cjs");
const correctBoxShadow = {
  correct: (latest, { treeScale, projectionDelta }) => {
    const original = latest;
    const shadow = index.complex.parse(latest);
    if (shadow.length > 5)
      return original;
    const template = index.complex.createTransformer(latest);
    const offset = typeof shadow[0] !== "number" ? 1 : 0;
    const xScale = projectionDelta.x.scale * treeScale.x;
    const yScale = projectionDelta.y.scale * treeScale.y;
    shadow[0 + offset] /= xScale;
    shadow[1 + offset] /= yScale;
    const averageScale = number.mixNumber(xScale, yScale, 0.5);
    if (typeof shadow[2 + offset] === "number")
      shadow[2 + offset] /= averageScale;
    if (typeof shadow[3 + offset] === "number")
      shadow[3 + offset] /= averageScale;
    return template(shadow);
  }
};
exports.correctBoxShadow = correctBoxShadow;
//# sourceMappingURL=dist-es-projection-styles-scale-box-shadow.cjs.map
