import{isObject as r}from"../../../../utils/dist/esm/assertion.js";function n(n){return r(n)&&n.reference?n.reference:String(n)}var t=function(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),a=1;a<t;a++)e[a-1]=arguments[a];return e.map(n).join(" "+r+" ").replace(/calc/g,"")},e=function(){for(var r=arguments.length,n=new Array(r),e=0;e<r;e++)n[e]=arguments[e];return"calc("+t("+",...n)+")"},a=function(){for(var r=arguments.length,n=new Array(r),e=0;e<r;e++)n[e]=arguments[e];return"calc("+t("-",...n)+")"},i=function(){for(var r=arguments.length,n=new Array(r),e=0;e<r;e++)n[e]=arguments[e];return"calc("+t("*",...n)+")"},u=function(){for(var r=arguments.length,n=new Array(r),e=0;e<r;e++)n[e]=arguments[e];return"calc("+t("/",...n)+")"},c=r=>{var t=n(r);return null==t||Number.isNaN(parseFloat(t))?i(t,-1):String(t).startsWith("-")?String(t).slice(1):"-"+t},o=Object.assign((r=>({add:function(){for(var n=arguments.length,t=new Array(n),a=0;a<n;a++)t[a]=arguments[a];return o(e(r,...t))},subtract:function(){for(var n=arguments.length,t=new Array(n),e=0;e<n;e++)t[e]=arguments[e];return o(a(r,...t))},multiply:function(){for(var n=arguments.length,t=new Array(n),e=0;e<n;e++)t[e]=arguments[e];return o(i(r,...t))},divide:function(){for(var n=arguments.length,t=new Array(n),e=0;e<n;e++)t[e]=arguments[e];return o(u(r,...t))},negate:()=>o(c(r)),toString:()=>r.toString()})),{add:e,subtract:a,multiply:i,divide:u,negate:c});export{o as calc};
//# sourceMappingURL=calc.js.map
