'use strict';Object.defineProperty(exports,'__esModule',{value:true});var chunkEPG4VVQB_cjs=require('../chunk-EPG4VVQB.cjs'),chunkBBEOVRYB_cjs=require('../chunk-BBEOVRYB.cjs');require('../chunk-IHOZOJHA.cjs');var chunkX5FCFNQN_cjs=require('../chunk-X5FCFNQN.cjs');require('../chunk-GYCEEHZT.cjs');var chunkEXPXWBLP_cjs=require('../chunk-EXPXWBLP.cjs');var B=.6274038959,A=.3292830384,F=.0433130657,w=.0690972894,I=.9195403951,$=.0113623156,j=.0163914389,v=.0880133079,N=.8955952532,z=1.6604910021084345,K=-0.5876411387885495,U=-0.07284986331988488,q=-0.12455047452159074,D=1.1328998971259603,H=-0.008349422604369477,J=-0.018150763354905303,M=-0.10057889800800739,Q=1.1187296613629127,O=(r,e,n,o)=>{r[0]=B*e+A*n+F*o,r[1]=w*e+I*n+$*o,r[2]=j*e+v*n+N*o;},p=(r,e,n)=>[B*r+A*e+F*n,w*r+I*e+$*n,j*r+v*e+N*n];var S=(r,e,n)=>[z*r+K*e+U*n,q*r+D*e+H*n,J*r+M*e+Q*n],E=({r,g:e,b:n,alpha:o})=>{let[c,m,b]=p(chunkX5FCFNQN_cjs.a(r/255),chunkX5FCFNQN_cjs.a(e/255),chunkX5FCFNQN_cjs.a(n/255));return {r:chunkEXPXWBLP_cjs.b(chunkX5FCFNQN_cjs.d(c),4),g:chunkEXPXWBLP_cjs.b(chunkX5FCFNQN_cjs.d(m),4),b:chunkEXPXWBLP_cjs.b(chunkX5FCFNQN_cjs.d(b),4),alpha:o,colorSpace:"rec2020"}};var P=({r,g:e,b:n,alpha:o})=>{let[c,m,b]=S(chunkX5FCFNQN_cjs.c(r),chunkX5FCFNQN_cjs.c(e),chunkX5FCFNQN_cjs.c(n));return {r:chunkX5FCFNQN_cjs.b(c)*255,g:chunkX5FCFNQN_cjs.b(m)*255,b:chunkX5FCFNQN_cjs.b(b)*255,alpha:o}},f=r=>{if(!chunkEXPXWBLP_cjs.h(r)||r.colorSpace!=="rec2020"||!chunkEXPXWBLP_cjs.i(r,["r","g","b"]))return null;let{r:e,g:n,b:o,alpha:c=1}=r;return !chunkEXPXWBLP_cjs.f(e)||!chunkEXPXWBLP_cjs.f(n)||!chunkEXPXWBLP_cjs.f(o)||!chunkEXPXWBLP_cjs.f(c)?null:P({r:chunkEXPXWBLP_cjs.g(e),g:chunkEXPXWBLP_cjs.g(n),b:chunkEXPXWBLP_cjs.g(o),alpha:chunkEXPXWBLP_cjs.a(chunkEXPXWBLP_cjs.g(c),0,1)})},V=/^color\(\s*rec2020\s+([+-]?\d*\.?\d+)\s+([+-]?\d*\.?\d+)\s+([+-]?\d*\.?\d+)\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,T=r=>{if(typeof r!="string")return null;let e=V.exec(r.trim());if(!e)return null;let n=e[4]===void 0?1:Number(e[4])/(e[5]?100:1);return P({r:Number(e[1]),g:Number(e[2]),b:Number(e[3]),alpha:chunkEXPXWBLP_cjs.a(n,0,1)})},d=(r,e,n)=>p(...chunkBBEOVRYB_cjs.f(r,e,n));var W=(r,e,n)=>chunkBBEOVRYB_cjs.a(...S(r,e,n)),X=(r,e,n)=>{let[o,c,m]=p(r,e,n);return [chunkX5FCFNQN_cjs.d(o),chunkX5FCFNQN_cjs.d(c),chunkX5FCFNQN_cjs.d(m)]},Y=(r,e,n,o)=>{O(r,e,n,o),r[0]=chunkX5FCFNQN_cjs.d(r[0]),r[1]=chunkX5FCFNQN_cjs.d(r[1]),r[2]=chunkX5FCFNQN_cjs.d(r[2]);},lr=(r,e,n)=>X(...chunkEPG4VVQB_cjs.e(r,e,n)),Rr=(r,e,n,o)=>{chunkEPG4VVQB_cjs.f(r,e,n,o),Y(r,r[0],r[1],r[2]);},sr=r=>chunkEPG4VVQB_cjs.c(r,d),Z=(r,e,n)=>{r.toGamutRec2020=o=>{let c=chunkEPG4VVQB_cjs.d(o,d,W);return c!==null?r._makeFromOklab(c):new r(o)},r.prototype.toRec2020=function(){return E(this._rawRgb())},r.prototype.toRec2020String=function(){let{r:o,g:c,b:m,alpha:b}=this.toRec2020();return b<1?`color(rec2020 ${o} ${c} ${m} / ${b})`:`color(rec2020 ${o} ${c} ${m})`},e.push(T,f),n.push([T,"rec2020"],[f,"rec2020"]);},ir=Z;exports.default=ir;exports.inGamutRec2020=sr;exports.linearToRec2020Channels=X;exports.linearToRec2020ChannelsInto=Y;exports.oklchToRec2020Channels=lr;exports.oklchToRec2020ChannelsInto=Rr;//# sourceMappingURL=rec2020.cjs.map
//# sourceMappingURL=rec2020.cjs.map