"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./is-css-variable.mjs.js"),r=require("../../../../../motion-utils/dist/es/errors.mjs.js"),t=require("../../../../../motion-utils/dist/es/is-numerical-string.mjs.js");const i=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function s(e){const r=i.exec(e);if(!r)return[,];const[,t,s,a]=r;return[`--${t??s}`,a]}exports.getVariableValue=function i(a,n){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;r.invariant(o<=4,`Max CSS variable fallback depth detected in property "${a}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[c,l]=s(a);if(!c)return;const u=window.getComputedStyle(n).getPropertyValue(c);if(u){const e=u.trim();return t.isNumericalString(e)?parseFloat(e):e}return e.isCSSVariableToken(l)?i(l,n,o+1):l},exports.parseCSSVariable=s;
//# sourceMappingURL=css-variables-conversion.mjs.js.map
