'use strict';var chunkEXPXWBLP_cjs=require('./chunk-EXPXWBLP.cjs');var f=r=>({r:chunkEXPXWBLP_cjs.a(r.r,0,255),g:chunkEXPXWBLP_cjs.a(r.g,0,255),b:chunkEXPXWBLP_cjs.a(r.b,0,255),alpha:chunkEXPXWBLP_cjs.a(chunkEXPXWBLP_cjs.b(r.alpha,3),0,1)}),y=r=>{if(!chunkEXPXWBLP_cjs.h(r))return null;let n=r.colorSpace;if(n==="display-p3"||n==="rec2020"||!chunkEXPXWBLP_cjs.i(r,["r","g","b"]))return null;let{r:t,g:a,b:e,alpha:s=1}=r;return !chunkEXPXWBLP_cjs.f(t)||!chunkEXPXWBLP_cjs.f(a)||!chunkEXPXWBLP_cjs.f(e)||!chunkEXPXWBLP_cjs.f(s)?null:f({r:chunkEXPXWBLP_cjs.g(t),g:chunkEXPXWBLP_cjs.g(a),b:chunkEXPXWBLP_cjs.g(e),alpha:chunkEXPXWBLP_cjs.g(s)})},o="[+-]?\\d*\\.?\\d+",k=new RegExp(`^rgba?\\(\\s*(${o})(%?)\\s*(?:,\\s*(${o})(%?)\\s*,\\s*(${o})(%?)(?:\\s*,\\s*(${o})(%?))?\\s*|\\s+(${o})(%?)\\s+(${o})(%?)(?:\\s*/\\s*(${o})(%?))?\\s*)\\)$`,"i"),x=r=>{if(typeof r!="string")return null;let n=k.exec(r.trim());if(!n)return null;let t=!!n[2],a=t?Number(n[1])/100*255:Number(n[1]),e=n[3]??n[9],s=!!(n[4]??n[10]),w=s?Number(e)/100*255:Number(e),b=n[5]??n[11],p=!!(n[6]??n[12]),N=p?Number(b)/100*255:Number(b);if(t!==s||s!==p)return null;let g=n[7]??n[13],$=!!(n[8]??n[14]),h=g===void 0?1:Number(g)/($?100:1);return f({r:a,g:w,b:N,alpha:h})};exports.a=f;exports.b=y;exports.c=x;//# sourceMappingURL=chunk-GYCEEHZT.cjs.map
//# sourceMappingURL=chunk-GYCEEHZT.cjs.map