import e from "../number.js";
import { parseCss as t, parseSvg as n } from "./parse.js";
//#region ../../node_modules/d3-interpolate/src/transform/index.js
function r(t, n, r, i) {
	function a(e) {
		return e.length ? e.pop() + " " : "";
	}
	function o(t, i, a, o, s, c) {
		if (t !== a || i !== o) {
			var l = s.push("translate(", null, n, null, r);
			c.push({
				i: l - 4,
				x: e(t, a)
			}, {
				i: l - 2,
				x: e(i, o)
			});
		} else (a || o) && s.push("translate(" + a + n + o + r);
	}
	function s(t, n, r, o) {
		t === n ? n && r.push(a(r) + "rotate(" + n + i) : (t - n > 180 ? n += 360 : n - t > 180 && (t += 360), o.push({
			i: r.push(a(r) + "rotate(", null, i) - 2,
			x: e(t, n)
		}));
	}
	function c(t, n, r, o) {
		t === n ? n && r.push(a(r) + "skewX(" + n + i) : o.push({
			i: r.push(a(r) + "skewX(", null, i) - 2,
			x: e(t, n)
		});
	}
	function l(t, n, r, i, o, s) {
		if (t !== r || n !== i) {
			var c = o.push(a(o) + "scale(", null, ",", null, ")");
			s.push({
				i: c - 4,
				x: e(t, r)
			}, {
				i: c - 2,
				x: e(n, i)
			});
		} else (r !== 1 || i !== 1) && o.push(a(o) + "scale(" + r + "," + i + ")");
	}
	return function(e, n) {
		var r = [], i = [];
		return e = t(e), n = t(n), o(e.translateX, e.translateY, n.translateX, n.translateY, r, i), s(e.rotate, n.rotate, r, i), c(e.skewX, n.skewX, r, i), l(e.scaleX, e.scaleY, n.scaleX, n.scaleY, r, i), e = n = null, function(e) {
			for (var t = -1, n = i.length, a; ++t < n;) r[(a = i[t]).i] = a.x(e);
			return r.join("");
		};
	};
}
var i = r(t, "px, ", "px)", "deg)"), a = r(n, ", ", ")", ")");
//#endregion
export { i as interpolateTransformCss, a as interpolateTransformSvg };
