import{filterTemplate as t,backdropFilterTemplate as r,getRingTemplate as e,getTransformTemplate as i,getTransformGpuTemplate as a,flexDirectionTemplate as n}from"./templates.js";import{gradientTransform as o,globalSet as l}from"./parse-gradient.js";import{isNumber as s,isCssVar as u,isString as p}from"../../../../utils/dist/esm/assertion.js";var g=t=>r=>t+"("+r+")",d={filter:r=>"auto"!==r?r:t,backdropFilter:t=>"auto"!==t?t:r,ring:t=>e(d.px(t)),bgClip:t=>"text"===t?{color:"transparent",backgroundClip:"text"}:{backgroundClip:t},transform:t=>"auto"===t?i():"auto-gpu"===t?a():t,px(t){if(null==t)return t;var{unitless:r}=(t=>{var r=parseFloat(t.toString()),e=t.toString().replace(String(r),"");return{unitless:!e,value:r,unit:e}})(t);return r||s(t)?t+"px":t},fraction:t=>!s(t)||t>1?t:100*t+"%",float:(t,r)=>"rtl"===r.direction?{left:"right",right:"left"}[t]:t,degree(t){if(u(t)||null==t)return t;var r=p(t)&&!t.endsWith("deg");return s(t)||r?t+"deg":t},gradient:o,blur:g("blur"),opacity:g("opacity"),brightness:g("brightness"),contrast:g("contrast"),dropShadow:g("drop-shadow"),grayscale:g("grayscale"),hueRotate:g("hue-rotate"),invert:g("invert"),saturate:g("saturate"),sepia:g("sepia"),bgImage:t=>null==t||c(t)||l.has(t)?t:"url("+t+")",outline(t){var r="0"===String(t)||"none"===String(t);return null!==t&&r?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:t}},flexDirection(t){var r,{space:e,divide:i}=null!=(r=n[t])?r:{},a={flexDirection:t};return e&&(a[e]=1),i&&(a[i]=1),a}},c=t=>p(t)&&t.includes("(")&&t.includes(")");export{d as transformFunctions};
//# sourceMappingURL=transform-functions.js.map
