"use strict";const l=require("react"),m=/^--[\w-]+$/,f=/^var\(\s*(--[\w-]+)\s*(?:,\s*(.+))?\)$/,y=new Set(["currentcolor","inherit","initial","revert","revert-layer","unset"]),s=typeof document<"u"?document.createElement("span"):null;function d(u){const e=u.trim();if(!e||!s||y.has(e.toLowerCase()))return e;const t=document.body??document.documentElement;if(!t||(s.style.color=e,!s.style.color))return e;t.appendChild(s);const o=getComputedStyle(s).color.trim();return s.remove(),o||e}function C(u,e="currentColor"){var i;if(typeof document>"u")return e;const t=getComputedStyle(document.documentElement),o=new Set;let n=u.trim();for(;n;){const r=n.match(f),c=(r==null?void 0:r[1])??(m.test(n)?n:null),a=(i=r==null?void 0:r[2])==null?void 0:i.trim();if(!c)return d(n);if(o.has(c)){n=a??"";continue}o.add(c),n=t.getPropertyValue(c).trim()||a||""}return d(e)}function p(u){const[e,t]=l.useState(!1),o=l.useCallback(()=>t(!0),[]);return l.useEffect(()=>{t(!1)},[u]),{touched:e,onBlur:o}}exports.resolveColor=C;exports.useTouched=p;
//# sourceMappingURL=utils-DBzf7CFq.cjs.map
