'use strict';var chunk2KB6V6KD_cjs=require('./chunk-2KB6V6KD.cjs'),chunkYISEJCI6_cjs=require('./chunk-YISEJCI6.cjs');var N=r=>({h:chunkYISEJCI6_cjs.c(r.h),s:chunkYISEJCI6_cjs.a(r.s,0,100),v:chunkYISEJCI6_cjs.a(r.v,0,100),alpha:chunkYISEJCI6_cjs.a(chunkYISEJCI6_cjs.b(r.alpha,3),0,1)}),g={h:0,s:0,v:0,alpha:0},T=({r,g:n,b:u,alpha:h})=>{let t=r/255,o=n/255,c=u/255,e=Math.max(t,o,c),a=Math.min(t,o,c),l=e-a,i=e===0?0:l/e,f=0;if(e!==a)switch(e){case t:f=((o-c)/l+(o<c?6:0))/6;break;case o:f=((c-t)/l+2)/6;break;case c:f=((t-o)/l+4)/6;break}let k=f*360;return g.h=k>=0&&k<360?k:(k%360+360)%360,g.s=chunkYISEJCI6_cjs.a(i*100,0,100),g.v=chunkYISEJCI6_cjs.a(e*100,0,100),g.alpha=chunkYISEJCI6_cjs.a(chunkYISEJCI6_cjs.b(h,3),0,1),g};var s=[0,0,0],M=({h:r,s:n,v:u,alpha:h})=>{let t=n/100,o=u/100,c=Math.floor(r/60%6),e=r/60-Math.floor(r/60),a=o*(1-t),l=o*(1-e*t),i=o*(1-(1-e)*t);switch(c){case 0:s[0]=o,s[1]=i,s[2]=a;break;case 1:s[0]=l,s[1]=o,s[2]=a;break;case 2:s[0]=a,s[1]=o,s[2]=i;break;case 3:s[0]=a,s[1]=l,s[2]=o;break;case 4:s[0]=i,s[1]=a,s[2]=o;break;default:s[0]=o,s[1]=a,s[2]=l;break}return chunk2KB6V6KD_cjs.a({r:s[0]*255,g:s[1]*255,b:s[2]*255,alpha:h})},y=new RegExp(`^hsva?\\(\\s*(?<h>${chunkYISEJCI6_cjs.k})(?<hu>deg|rad|grad|turn)?\\s*(?:,\\s*(?<s_c>${chunkYISEJCI6_cjs.j})%\\s*,\\s*(?<v_c>${chunkYISEJCI6_cjs.j})%(?:\\s*,\\s*(?<al_c>${chunkYISEJCI6_cjs.j})(?<alp_c>%?)?\\s*)?|\\s+(?<s_s>${chunkYISEJCI6_cjs.k})(?<sp_s>%?)\\s+(?<v_s>${chunkYISEJCI6_cjs.k})(?<vp_s>%?)(?:\\s*/\\s*(?<al_s>${chunkYISEJCI6_cjs.k})(?<alp_s>%?)?\\s*)?)\\)$`,"i"),j=r=>{if(typeof r!="string")return null;let n=y.exec(r.trim())?.groups;if(!n)return null;let u=n.s_c!==void 0;if(u&&/^none$/i.test(n.h))return null;let h=n.hu?.toLowerCase()??"deg",t=chunkYISEJCI6_cjs.l(n.h)*(chunkYISEJCI6_cjs.d[h]??1),o=chunkYISEJCI6_cjs.l(n.s_c??n.s_s),c=chunkYISEJCI6_cjs.l(n.v_c??n.v_s),e=n.al_c??n.al_s;if(u&&e!==void 0&&/^none$/i.test(e))return null;let a=!!(n.alp_c??n.alp_s),l=e===void 0?1:chunkYISEJCI6_cjs.l(e)/(a?100:1);return M(N({h:t,s:o,v:c,alpha:l}))},A=r=>{if(!chunkYISEJCI6_cjs.h(r)||!chunkYISEJCI6_cjs.i(r,["h","s","v"]))return null;let{h:n,s:u,v:h,alpha:t=1}=r;return !chunkYISEJCI6_cjs.f(n)||!chunkYISEJCI6_cjs.f(u)||!chunkYISEJCI6_cjs.f(h)||!chunkYISEJCI6_cjs.f(t)?null:M(N({h:chunkYISEJCI6_cjs.g(n),s:chunkYISEJCI6_cjs.g(u),v:chunkYISEJCI6_cjs.g(h),alpha:chunkYISEJCI6_cjs.g(t)}))};exports.a=T;exports.b=M;exports.c=j;exports.d=A;//# sourceMappingURL=chunk-SVWD7LPC.cjs.map
//# sourceMappingURL=chunk-SVWD7LPC.cjs.map