From 01345ad99658b0511f0b5b5585dba93dba84fe8e Mon Sep 17 00:00:00 2001 From: Jon Uhlmann Date: Thu, 24 Oct 2024 23:26:23 +0200 Subject: [PATCH] Fix: StyleX Style --- Resources/Public/Plugin.js | 2 +- Resources/Public/Plugin.js.map | 8 ++++---- package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Resources/Public/Plugin.js b/Resources/Public/Plugin.js index 886b06b..a02e648 100644 --- a/Resources/Public/Plugin.js +++ b/Resources/Public/Plugin.js @@ -1,2 +1,2 @@ -import{a as bo,b as Me,c as z,d as st}from"./chunk-5KL6F2HG.js";function O(e){return(...t)=>{if(window["@Neos:HostPluginAPI"]&&window["@Neos:HostPluginAPI"][`@${e}`])return window["@Neos:HostPluginAPI"][`@${e}`](...t);throw new Error("You are trying to read from a consumer api that hasn't been initialized yet!")}}var ue=bo(()=>{});var X=Me((Ma,Jt)=>{ue();Jt.exports=O("vendor")().React});var lt=Me((Sa,Kt)=>{ue();Kt.exports=O("NeosProjectPackages")().NeosUiDecorators});var Xt=Me((Na,Yt)=>{ue();Yt.exports=O("vendor")().reactRedux});var Rt=Me((iu,eo)=>{ue();eo.exports=O("NeosProjectPackages")().ReactUiComponents});var ro=Me((wu,to)=>{ue();to.exports=O("NeosProjectPackages")().NeosUiReduxStore});ue();var Gt=O("manifest");var C=z(X()),lo=z(lt()),uo=z(Xt());function _(e,t){let r=e.length;Array.isArray(e[0])||(e=[e]),Array.isArray(t[0])||(t=t.map(i=>[i]));let o=t[0].length,n=t[0].map((i,s)=>t.map(l=>l[s])),a=e.map(i=>n.map(s=>{let l=0;if(!Array.isArray(i)){for(let c of s)l+=i*c;return l}for(let c=0;ci[0]):a}function qe(e){return ce(e)==="string"}function ce(e){return(Object.prototype.toString.call(e).match(/^\[object\s+(.*?)\]$/)[1]||"").toLowerCase()}function ke(e,{precision:t,unit:r}){return Ae(e)?"none":vo(e,t)+(r??"")}function Ae(e){return Number.isNaN(e)||e instanceof Number&&e?.none}function vo(e,t){if(e===0)return 0;let r=~~e,o=0;r&&t&&(o=~~Math.log10(Math.abs(r))+1);let n=10**(t-o);return Math.floor(e*n+.5)/n}var wo={deg:1,grad:.9,rad:180/Math.PI,turn:360};function Zt(e){if(!e)return;e=e.trim();let t=/^([a-z]+)\((.+?)\)$/i,r=/^-?[\d.]+$/,o=/%|deg|g?rad|turn$/,n=/\/?\s*(none|[-\w.]+(?:%|deg|g?rad|turn)?)/g,a=e.match(t);if(a){let i=[];return a[2].replace(n,(s,l)=>{let c=l.match(o),u=l;if(c){let f=c[0],d=u.slice(0,-f.length);f==="%"?(u=new Number(d/100),u.type=""):(u=new Number(d*wo[f]),u.type="",u.unit=f)}else r.test(u)?(u=new Number(u),u.type=""):u==="none"&&(u=new Number(NaN),u.none=!0);s.startsWith("/")&&(u=u instanceof Number?u:new Number(u),u.alpha=!0),typeof u=="object"&&u instanceof Number&&(u.raw=l),i.push(u)}),{name:a[1].toLowerCase(),rawName:a[1],rawArgs:a[2],args:i}}}function Vt(e){return e[e.length-1]}function ut(e,t,r){return isNaN(e)?t:isNaN(t)?e:e+(t-e)*r}function Co(e,t,r){return(r-e)/(t-e)}function Be(e,t,r){return ut(t[0],t[1],Co(e[0],e[1],r))}function Ut(e){return e.map(t=>t.split("|").map(r=>{r=r.trim();let o=r.match(/^(<[a-z]+>)\[(-?[.\d]+),\s*(-?[.\d]+)\]?$/);if(o){let n=new String(o[1]);return n.range=[+o[2],+o[3]],n}return r}))}function Qt(e,t,r){return Math.max(Math.min(r,t),e)}function Te(e,t){return Math.sign(e)===Math.sign(t)?e:-e}function G(e,t){return Te(Math.abs(e)**t,e)}function ct(e,t){return t===0?0:e/t}function er(e,t,r=0,o=e.length){for(;r>1;e[n]","",""]);function tr(e,t,r,o){return Object.entries(e.coords).map(([a,i],s)=>{let l=t.coordGrammar[s],c=o[s],u=c?.type,f;if(c.none?f=l.find(p=>ko.has(p)):f=l.find(p=>p==u),!f){let p=i.name||a;throw new TypeError(`${u??c.raw} not allowed for ${p} in ${r}()`)}let d=f.range;u===""&&(d||(d=[0,1]));let g=i.range||i.refRange;return d&&g&&(o[s]=Be(d,g,o[s])),f})}function J(e,{meta:t}={}){let r={str:String(e)?.trim()};if(fe.run("parse-start",r),r.color)return r.color;if(r.parsed=Zt(r.str),r.parsed){let o=r.parsed.name;if(o==="color"){let n=r.parsed.args.shift(),a=n.startsWith("--")?n.substring(2):`--${n}`,i=[n,a],s=r.parsed.rawArgs.indexOf("/")>0?r.parsed.args.pop():1;for(let u of m.all){let f=u.getFormat("color");if(f&&(i.includes(f.id)||f.ids?.filter(d=>i.includes(d)).length)){let d=Object.keys(u.coords).map((p,x)=>r.parsed.args[x]||0),g;return f.coordGrammar&&(g=tr(u,f,"color",d)),t&&Object.assign(t,{formatId:"color",types:g}),f.id.startsWith("--")&&!n.startsWith("--")&&Z.warn(`${u.name} is a non-standard space and not currently supported in the CSS spec. Use prefixed color(${f.id}) instead of color(${n}).`),n.startsWith("--")&&!f.id.startsWith("--")&&Z.warn(`${u.name} is a standard space and supported in the CSS spec. Use color(${f.id}) instead of prefixed color(${n}).`),{spaceId:u.id,coords:d,alpha:s}}}let l="",c=n in m.registry?n:a;if(c in m.registry){let u=m.registry[c].formats?.color?.id;u&&(l=`Did you mean color(${u})?`)}throw new TypeError(`Cannot parse color(${n}). `+(l||"Missing a plugin?"))}else for(let n of m.all){let a=n.getFormat(o);if(a&&a.type==="function"){let i=1;(a.lastAlpha||Vt(r.parsed.args).alpha)&&(i=r.parsed.args.pop());let s=r.parsed.args,l;return a.coordGrammar&&(l=tr(n,a,o,s)),t&&Object.assign(t,{formatId:a.name,types:l}),{spaceId:n.id,coords:s,alpha:i}}}}else for(let o of m.all)for(let n in o.formats){let a=o.formats[n];if(a.type!=="custom"||a.test&&!a.test(r.str))continue;let i=a.parse(r.str);if(i)return i.alpha??(i.alpha=1),t&&(t.formatId=n),i}throw new TypeError(`Could not parse ${e} as a color. Missing a plugin?`)}function M(e){if(Array.isArray(e))return e.map(M);if(!e)throw new TypeError("Empty color reference");qe(e)&&(e=J(e));let t=e.space||e.spaceId;return t instanceof m||(e.space=m.get(t)),e.alpha===void 0&&(e.alpha=1),e}var So=75e-6,H=class H{constructor(t){this.id=t.id,this.name=t.name,this.base=t.base?H.get(t.base):null,this.aliases=t.aliases,this.base&&(this.fromBase=t.fromBase,this.toBase=t.toBase);let r=t.coords??this.base.coords;for(let n in r)"name"in r[n]||(r[n].name=n);this.coords=r;let o=t.white??this.base.white??"D65";this.white=De(o),this.formats=t.formats??{};for(let n in this.formats){let a=this.formats[n];a.type||(a.type="function"),a.name||(a.name=n)}this.formats.color?.id||(this.formats.color={...this.formats.color??{},id:t.cssId||this.id}),t.gamutSpace?this.gamutSpace=t.gamutSpace==="self"?this:H.get(t.gamutSpace):this.isPolar?this.gamutSpace=this.base:this.gamutSpace=this,this.gamutSpace.isUnbounded&&(this.inGamut=(n,a)=>!0),this.referred=t.referred,Object.defineProperty(this,"path",{value:_o(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),fe.run("colorspace-init-end",this)}inGamut(t,{epsilon:r=So}={}){if(!this.equals(this.gamutSpace))return t=this.to(this.gamutSpace,t),this.gamutSpace.inGamut(t,{epsilon:r});let o=Object.values(this.coords);return t.every((n,a)=>{let i=o[a];if(i.type!=="angle"&&i.range){if(Number.isNaN(n))return!0;let[s,l]=i.range;return(s===void 0||n>=s-r)&&(l===void 0||n<=l+r)}return!0})}get isUnbounded(){return Object.values(this.coords).every(t=>!("range"in t))}get cssId(){return this.formats?.color?.id||this.id}get isPolar(){for(let t in this.coords)if(this.coords[t].type==="angle")return!0;return!1}getFormat(t){if(typeof t=="object")return t=rr(t,this),t;let r;return t==="default"?r=Object.values(this.formats)[0]:r=this.formats[t],r?(r=rr(r,this),r):null}equals(t){return t?this===t||this.id===t||this.id===t.id:!1}to(t,r){if(arguments.length===1){let s=M(t);[t,r]=[s.space,s.coords]}if(t=H.get(t),this.equals(t))return r;r=r.map(s=>Number.isNaN(s)?0:s);let o=this.path,n=t.path,a,i;for(let s=0;si;s--)r=o[s].toBase(r);for(let s=i+1;s=0){let l=Object.entries(n.coords)[a];if(l)return{space:n,id:l[0],index:a,...l[1]}}n=H.get(n);let i=a.toLowerCase(),s=0;for(let l in n.coords){let c=n.coords[l];if(l.toLowerCase()===i||c.name?.toLowerCase()===i)return{space:n,id:l,index:s,...c};s++}throw new TypeError(`No "${a}" coordinate found in ${n.name}. Its coordinates are: ${Object.keys(n.coords).join(", ")}`)}};st(H,"registry",{}),st(H,"DEFAULT_FORMAT",{type:"functions",name:"color"});var m=H;function _o(e){let t=[e];for(let r=e;r=r.base;)t.push(r);return t}function rr(e,{coords:t}={}){if(e.coords&&!e.coordGrammar){e.type||(e.type="function"),e.name||(e.name="color"),e.coordGrammar=Ut(e.coords);let r=Object.entries(t).map(([o,n],a)=>{let i=e.coordGrammar[a][0],s=n.range||n.refRange,l=i.range,c="";return i==""?(l=[0,100],c="%"):i==""&&(c="deg"),{fromRange:s,toRange:l,suffix:c}});e.serializeCoords=(o,n)=>o.map((a,i)=>{let{fromRange:s,toRange:l,suffix:c}=r[i];return s&&l&&(a=Be(s,l,a)),a=ke(a,{precision:n,unit:c}),a})}return e}var I=new m({id:"xyz-d65",name:"XYZ D65",coords:{x:{name:"X"},y:{name:"Y"},z:{name:"Z"}},white:"D65",formats:{color:{ids:["xyz-d65","xyz"]}},aliases:["xyz"]});var me=class extends m{constructor(t){t.coords||(t.coords={r:{range:[0,1],name:"Red"},g:{range:[0,1],name:"Green"},b:{range:[0,1],name:"Blue"}}),t.base||(t.base=I),t.toXYZ_M&&t.fromXYZ_M&&(t.toBase??(t.toBase=r=>{let o=_(t.toXYZ_M,r);return this.white!==this.base.white&&(o=de(this.white,this.base.white,o)),o}),t.fromBase??(t.fromBase=r=>(r=de(this.base.white,this.white,r),_(t.fromXYZ_M,r)))),t.referred??(t.referred="display"),super(t)}};function Se(e,t){return e=M(e),!t||e.space.equals(t)?e.coords.slice():(t=m.get(t),t.from(e))}function ee(e,t){e=M(e);let{space:r,index:o}=m.resolveCoord(t,e.space);return Se(e,r)[o]}function Fe(e,t,r){return e=M(e),t=m.get(t),e.coords=t.to(e.space,r),e}Fe.returns="color";function _e(e,t,r){if(e=M(e),arguments.length===2&&ce(arguments[1])==="object"){let o=arguments[1];for(let n in o)_e(e,n,o[n])}else{typeof r=="function"&&(r=r(ee(e,t)));let{space:o,index:n}=m.resolveCoord(t,e.space),a=Se(e,o);a[n]=r,Fe(e,o,a)}return e}_e.returns="color";var or=new m({id:"xyz-d50",name:"XYZ D50",white:"D50",base:I,fromBase:e=>de(I.white,"D50",e),toBase:e=>de("D50",I.white,e)});var No=216/24389,nr=24/116,We=24389/27,mt=R.D50,T=new m({id:"lab",name:"Lab",coords:{l:{refRange:[0,100],name:"Lightness"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:mt,base:or,fromBase(e){let r=e.map((o,n)=>o/mt[n]).map(o=>o>No?Math.cbrt(o):(We*o+16)/116);return[116*r[1]-16,500*(r[0]-r[1]),200*(r[1]-r[2])]},toBase(e){let t=[];return t[1]=(e[0]+16)/116,t[0]=e[1]/500+t[1],t[2]=t[1]-e[2]/200,[t[0]>nr?Math.pow(t[0],3):(116*t[0]-16)/We,e[0]>8?Math.pow((e[0]+16)/116,3):e[0]/We,t[2]>nr?Math.pow(t[2],3):(116*t[2]-16)/We].map((o,n)=>o*mt[n])},formats:{lab:{coords:[" | "," | [-1,1]"," | [-1,1]"]}}});function j(e){return(e%360+360)%360}var xe=new m({id:"lch",name:"LCH",coords:{l:{refRange:[0,100],name:"Lightness"},c:{refRange:[0,150],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:T,fromBase(e){let[t,r,o]=e,n,a=.02;return Math.abs(r) | "," | "," | "]}}});var ar=25**7,Ge=Math.PI,ir=180/Ge,be=Ge/180;function sr(e){let t=e*e;return t*t*t*e}function Je(e,t,{kL:r=1,kC:o=1,kH:n=1}={}){[e,t]=M([e,t]);let[a,i,s]=T.from(e),l=xe.from(T,[a,i,s])[1],[c,u,f]=T.from(t),d=xe.from(T,[c,u,f])[1];l<0&&(l=0),d<0&&(d=0);let g=(l+d)/2,p=sr(g),x=.5*(1-Math.sqrt(p/(p+ar))),h=(1+x)*i,b=(1+x)*u,y=Math.sqrt(h**2+s**2),w=Math.sqrt(b**2+f**2),S=h===0&&s===0?0:Math.atan2(s,h),E=b===0&&f===0?0:Math.atan2(f,b);S<0&&(S+=2*Ge),E<0&&(E+=2*Ge),S*=ir,E*=ir;let k=c-a,W=w-y,A=E-S,le=S+E,we=Math.abs(A),B;y*w===0?B=0:we<=180?B=A:A>180?B=A-360:A<-180?B=A+360:Z.warn("the unthinkable has happened");let Re=2*Math.sqrt(w*y)*Math.sin(B*be/2),mo=(a+c)/2,it=(y+w)/2,Bt=sr(it),Y;y*w===0?Y=le:we<=180?Y=le/2:le<360?Y=(le+360)/2:Y=(le-360)/2;let Tt=(mo-50)**2,po=1+.015*Tt/Math.sqrt(20+Tt),Dt=1+.045*it,Ce=1;Ce-=.17*Math.cos((Y-30)*be),Ce+=.24*Math.cos(2*Y*be),Ce+=.32*Math.cos((3*Y+6)*be),Ce-=.2*Math.cos((4*Y-63)*be);let Ft=1+.015*it*Ce,ho=30*Math.exp(-1*((Y-275)/25)**2),go=2*Math.sqrt(Bt/(Bt+ar)),xo=-1*Math.sin(2*ho*be)*go,je=(k/(r*po))**2;return je+=(W/(o*Dt))**2,je+=(Re/(n*Ft))**2,je+=xo*(W/(o*Dt))*(Re/(n*Ft)),Math.sqrt(je)}var Lo=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],Eo=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],Po=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],zo=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],te=new m({id:"oklab",name:"Oklab",coords:{l:{refRange:[0,1],name:"Lightness"},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:"D65",base:I,fromBase(e){let r=_(Lo,e).map(o=>Math.cbrt(o));return _(Po,r)},toBase(e){let r=_(zo,e).map(o=>o**3);return _(Eo,r)},formats:{oklab:{coords:[" | "," | [-1,1]"," | [-1,1]"]}}});function Ne(e,t){[e,t]=M([e,t]);let[r,o,n]=te.from(e),[a,i,s]=te.from(t),l=r-a,c=o-i,u=n-s;return Math.sqrt(l**2+c**2+u**2)}var Ho=75e-6;function V(e,t,{epsilon:r=Ho}={}){e=M(e),t||(t=e.space),t=m.get(t);let o=e.coords;return t!==e.space&&(o=t.from(e)),t.inGamut(o,{epsilon:r})}function ye(e){return{space:e.space,coords:e.coords.slice(),alpha:e.alpha}}function pt(e,t,r="lab"){r=m.get(r);let o=r.from(e),n=r.from(t);return Math.sqrt(o.reduce((a,i,s)=>{let l=n[s];return isNaN(i)||isNaN(l)?a:a+(l-i)**2},0))}function ht(e,t){return pt(e,t,"lab")}var Io=Math.PI,lr=Io/180;function ur(e,t,{l:r=2,c:o=1}={}){[e,t]=M([e,t]);let[n,a,i]=T.from(e),[,s,l]=xe.from(T,[n,a,i]),[c,u,f]=T.from(t),d=xe.from(T,[c,u,f])[1];s<0&&(s=0),d<0&&(d=0);let g=n-c,p=s-d,x=a-u,h=i-f,b=x**2+h**2-p**2,y=.511;n>=16&&(y=.040975*n/(1+.01765*n));let w=.0638*s/(1+.0131*s)+.638,S;Number.isNaN(l)&&(l=0),l>=164&&l<=345?S=.56+Math.abs(.2*Math.cos((l+168)*lr)):S=.36+Math.abs(.4*Math.cos((l+35)*lr));let E=Math.pow(s,4),k=Math.sqrt(E/(E+1900)),W=w*(k*S+1-k),A=(g/(r*y))**2;return A+=(p/(o*w))**2,A+=b/W**2,Math.sqrt(A)}var cr=203,Ke=new m({id:"xyz-abs-d65",cssId:"--xyz-abs-d65",name:"Absolute XYZ D65",coords:{x:{refRange:[0,9504.7],name:"Xa"},y:{refRange:[0,1e4],name:"Ya"},z:{refRange:[0,10888.3],name:"Za"}},base:I,fromBase(e){return e.map(t=>Math.max(t*cr,0))},toBase(e){return e.map(t=>Math.max(t/cr,0))}});var Ye=1.15,Xe=.66,fr=2610/2**14,$o=2**14/2610,dr=3424/2**12,mr=2413/2**7,pr=2392/2**7,Oo=1.7*2523/2**5,hr=2**5/(1.7*2523),Ze=-.56,gt=16295499532821565e-27,Ro=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],jo=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],qo=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],Ao=[[1,.1386050432715393,.05804731615611886],[.9999999999999999,-.1386050432715393,-.05804731615611886],[.9999999999999998,-.09601924202631895,-.8118918960560388]],gr=new m({id:"jzazbz",name:"Jzazbz",coords:{jz:{refRange:[0,1],name:"Jz"},az:{refRange:[-.5,.5]},bz:{refRange:[-.5,.5]}},base:Ke,fromBase(e){let[t,r,o]=e,n=Ye*t-(Ye-1)*o,a=Xe*r-(Xe-1)*t,s=_(Ro,[n,a,o]).map(function(d){let g=dr+mr*(d/1e4)**fr,p=1+pr*(d/1e4)**fr;return(g/p)**Oo}),[l,c,u]=_(qo,s);return[(1+Ze)*l/(1+Ze*l)-gt,c,u]},toBase(e){let[t,r,o]=e,n=(t+gt)/(1+Ze-Ze*(t+gt)),i=_(Ao,[n,r,o]).map(function(d){let g=dr-d**hr,p=pr*d**hr-mr;return 1e4*(g/p)**$o}),[s,l,c]=_(jo,i),u=(s+(Ye-1)*c)/Ye,f=(l+(Xe-1)*u)/Xe;return[u,f,c]},formats:{color:{coords:[" | "," | [-1,1]"," | [-1,1]"]}}});var xt=new m({id:"jzczhz",name:"JzCzHz",coords:{jz:{refRange:[0,1],name:"Jz"},cz:{refRange:[0,1],name:"Chroma"},hz:{refRange:[0,360],type:"angle",name:"Hue"}},base:gr,fromBase(e){let[t,r,o]=e,n,a=2e-4;return Math.abs(r){let n=G(t*Math.abs(o)*.01,Nr);return 400*Te(n,o)/(n+27.13)})}function Qo(e,t){let r=100/t*27.13**kr;return e.map(o=>{let n=Math.abs(o);return Te(r*G(n/(400-n),kr),o)})}function en(e){let t=j(e);t<=pe.h[0]&&(t+=360);let r=er(pe.h,t)-1,[o,n]=pe.h.slice(r,r+2),[a,i]=pe.e.slice(r,r+2),s=pe.H[r],l=(t-o)/a;return s+100*l/(l+(n-t)/i)}function tn(e){let t=(e%400+400)%400,r=Math.floor(.01*t);t=t%100;let[o,n]=pe.h.slice(r,r+2),[a,i]=pe.e.slice(r,r+2);return j((t*(i*o-a*n)-100*o*i)/(t*(i-a)-100*i))}function vt(e,t,r,o,n){let a={};a.discounting=n,a.refWhite=e,a.surround=o;let i=e.map(x=>x*100);a.la=t,a.yb=r;let s=i[1],l=_(Lr,i);o=Vo[a.surround];let c=o[0];a.c=o[1],a.nc=o[2];let f=(1/(5*a.la+1))**4;a.fl=f*a.la+.1*(1-f)*(1-f)*Math.cbrt(5*a.la),a.flRoot=a.fl**.25,a.n=a.yb/s,a.z=1.48+Math.sqrt(a.n),a.nbb=.725*a.n**-.2,a.ncb=a.nbb;let d=n?1:Math.max(Math.min(c*(1-1/3.6*Math.exp((-a.la-42)/92)),1),0);a.dRgb=l.map(x=>ut(1,s/x,d)),a.dRgbInv=a.dRgb.map(x=>1/x);let g=l.map((x,h)=>x*a.dRgb[h]),p=Er(g,a.fl);return a.aW=a.nbb*(2*p[0]+p[1]+.05*p[2]),a}var _r=vt(Yo,64/Math.PI*.2,20,"average",!1);function Ve(e,t){if(!(e.J!==void 0^e.Q!==void 0))throw new Error("Conversion requires one and only one: 'J' or 'Q'");if(!(e.C!==void 0^e.M!==void 0^e.s!==void 0))throw new Error("Conversion requires one and only one: 'C', 'M' or 's'");if(!(e.h!==void 0^e.H!==void 0))throw new Error("Conversion requires one and only one: 'h' or 'H'");if(e.J===0||e.Q===0)return[0,0,0];let r=0;e.h!==void 0?r=j(e.h)*Sr:r=tn(e.H)*Sr;let o=Math.cos(r),n=Math.sin(r),a=0;e.J!==void 0?a=G(e.J,1/2)*.1:e.Q!==void 0&&(a=.25*t.c*e.Q/((t.aW+4)*t.flRoot));let i=0;e.C!==void 0?i=e.C/a:e.M!==void 0?i=e.M/t.flRoot/a:e.s!==void 0&&(i=4e-4*e.s**2*(t.aW+4)/t.c);let s=G(i*Math.pow(1.64-Math.pow(.29,t.n),-.73),10/9),l=.25*(Math.cos(r+2)+3.8),c=t.aW*G(a,2/t.c/t.z),u=5e4/13*t.nc*t.ncb*l,f=c/t.nbb,d=23*(f+.305)*ct(s,23*u+s*(11*o+108*n)),g=d*o,p=d*n,x=Qo(_(Zo,[f,g,p]).map(h=>h*1/1403),t.fl);return _(Xo,x.map((h,b)=>h*t.dRgbInv[b])).map(h=>h/100)}function wt(e,t){let r=e.map(w=>w*100),o=Er(_(Lr,r).map((w,S)=>w*t.dRgb[S]),t.fl),n=o[0]+(-12*o[1]+o[2])/11,a=(o[0]+o[1]-2*o[2])/9,i=(Math.atan2(a,n)%yt+yt)%yt,s=.25*(Math.cos(i+2)+3.8),l=5e4/13*t.nc*t.ncb*ct(s*Math.sqrt(n**2+a**2),o[0]+o[1]+1.05*o[2]+.305),c=G(l,.9)*Math.pow(1.64-Math.pow(.29,t.n),.73),u=t.nbb*(2*o[0]+o[1]+.05*o[2]),f=G(u/t.aW,.5*t.c*t.z),d=100*G(f,2),g=4/t.c*f*(t.aW+4)*t.flRoot,p=c*f,x=p*t.flRoot,h=j(i*Uo),b=en(h),y=50*G(t.c*c/(t.aW+4),1/2);return{J:d,C:p,h,s:y,Q:g,M:x,H:b}}var Ls=new m({id:"cam16-jmh",cssId:"--cam16-jmh",name:"CAM16-JMh",coords:{j:{refRange:[0,100],name:"J"},m:{refRange:[0,105],name:"Colorfulness"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:I,fromBase(e){let t=wt(e,_r);return[t.J,t.M,t.h]},toBase(e){return Ve({J:e[0],M:e[1],h:e[2]},_r)}});var rn=R.D65,on=216/24389,Pr=24389/27;function nn(e){return 116*(e>on?Math.cbrt(e):(Pr*e+16)/116)-16}function Ct(e){return e>8?Math.pow((e+16)/116,3):e/Pr}function an(e,t){let[r,o,n]=e,a=[],i=0;if(n===0)return[0,0,0];let s=Ct(n);n>0?i=.00379058511492914*n**2+.608983189401032*n+.9155088574762233:i=9514440756550361e-21*n**2+.08693057439788597*n-21.928975842194614;let l=2e-12,c=15,u=0,f=1/0,d=i;for(;u<=c;){a=Ve({J:i,C:o,h:r},t);let g=Math.abs(a[1]-s);if(g | "," | "," | "]}}});var As=180/Math.PI,ln=Math.PI/180,zr=[1,.007,.0228];function Hr(e){e[1]<0&&(e=Ee.fromBase(Ee.toBase(e)));let t=Math.log(Math.max(1+zr[2]*e[1]*Le.flRoot,1))/zr[2],r=e[0]*ln,o=t*Math.cos(r),n=t*Math.sin(r);return[e[2],o,n]}function Ir(e,t){[e,t]=M([e,t]);let[r,o,n]=Hr(Ee.from(e)),[a,i,s]=Hr(Ee.from(t));return Math.sqrt((r-a)**2+(o-i)**2+(n-s)**2)}var Mt={deltaE76:ht,deltaECMC:ur,deltaE2000:Je,deltaEJz:xr,deltaEITP:Mr,deltaEOK:Ne,deltaEHCT:Ir};function un(e){let t=e?Math.floor(Math.log10(Math.abs(e))):0;return Math.max(parseFloat(`1e${t-2}`),1e-6)}var $r={hct:{method:"hct.c",jnd:2,deltaEMethod:"hct",blackWhiteClamp:{}},"hct-tonal":{method:"hct.c",jnd:0,deltaEMethod:"hct",blackWhiteClamp:{channel:"hct.t",min:0,max:100}}};function re(e,{method:t=Z.gamut_mapping,space:r=void 0,deltaEMethod:o="",jnd:n=2,blackWhiteClamp:a={}}={}){if(e=M(e),qe(arguments[1])?r=arguments[1]:r||(r=e.space),r=m.get(r),V(e,r,{epsilon:0}))return e;let i;if(t==="css")i=cn(e,{space:r});else{if(t!=="clip"&&!V(e,r)){Object.prototype.hasOwnProperty.call($r,t)&&({method:t,jnd:n,deltaEMethod:o,blackWhiteClamp:a}=$r[t]);let s=Je;if(o!==""){for(let c in Mt)if("deltae"+o.toLowerCase()===c.toLowerCase()){s=Mt[c];break}}let l=re(N(e,r),{method:"clip",space:r});if(s(e,l)>n){if(Object.keys(a).length===3){let y=m.resolveCoord(a.channel),w=ee(N(e,y.space),y.id);if(Ae(w)&&(w=0),w>=a.max)return N({space:"xyz-d65",coords:R.D65},e.space);if(w<=a.min)return N({space:"xyz-d65",coords:[0,0,0]},e.space)}let c=m.resolveCoord(t),u=c.space,f=c.id,d=N(e,u);d.coords.forEach((y,w)=>{Ae(y)&&(d.coords[w]=0)});let p=(c.range||c.refRange)[0],x=un(n),h=p,b=ee(d,f);for(;b-h>x;){let y=ye(d);y=re(y,{space:r,method:"clip"}),s(d,y)-nl.range||[]);i.coords=i.coords.map((l,c)=>{let[u,f]=s[c];return u!==void 0&&(l=Math.max(u,l)),f!==void 0&&(l=Math.min(l,f)),l})}}return r!==e.space&&(i=N(i,e.space)),e.coords=i.coords,e}re.returns="color";var Or={WHITE:{space:te,coords:[1,0,0]},BLACK:{space:te,coords:[0,0,0]}};function cn(e,{space:t}={}){e=M(e),t||(t=e.space),t=m.get(t);let n=m.get("oklch");if(t.isUnbounded)return N(e,t);let a=N(e,n),i=a.coords[0];if(i>=1){let p=N(Or.WHITE,t);return p.alpha=e.alpha,N(p,t)}if(i<=0){let p=N(Or.BLACK,t);return p.alpha=e.alpha,N(p,t)}if(V(a,t,{epsilon:0}))return N(a,t);function s(p){let x=N(p,t),h=Object.values(t.coords);return x.coords=x.coords.map((b,y)=>{if("range"in h[y]){let[w,S]=h[y].range;return Qt(w,b,S)}return b}),x}let l=0,c=a.coords[1],u=!0,f=ye(a),d=s(f),g=Ne(d,f);if(g<.02)return d;for(;c-l>1e-4;){let p=(l+c)/2;if(f.coords[1]=p,u&&V(f,t,{epsilon:0}))l=p;else if(d=s(f),g=Ne(d,f),g<.02){if(.02-g<1e-4)break;u=!1,l=p}else c=p}return d}function N(e,t,{inGamut:r}={}){e=M(e),t=m.get(t);let o=t.from(e),n={space:t,coords:o,alpha:e.alpha};return r&&(n=re(n,r===!0?void 0:r)),n}N.returns="color";function oe(e,{precision:t=Z.precision,format:r="default",inGamut:o=!0,...n}={}){let a;e=M(e);let i=r;r=e.space.getFormat(r)??e.space.getFormat("default")??m.DEFAULT_FORMAT;let s=e.coords.slice();if(o||(o=r.toGamut),o&&!V(e)&&(s=re(ye(e),o===!0?void 0:o).coords),r.type==="custom")if(n.precision=t,r.serialize)a=r.serialize(s,e.alpha,n);else throw new TypeError(`format ${i} can only be used to parse colors, not for serialization`);else{let l=r.name||"color";r.serializeCoords?s=r.serializeCoords(s,t):t!==null&&(s=s.map(d=>ke(d,{precision:t})));let c=[...s];if(l==="color"){let d=r.id||r.ids?.[0]||e.space.id;c.unshift(d)}let u=e.alpha;t!==null&&(u=ke(u,{precision:t}));let f=e.alpha>=1||r.noAlpha?"":`${r.commas?",":" /"} ${u}`;a=`${l}(${c.join(r.commas?", ":" ")}${f})`}return a}var fn=[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],dn=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]],Rr=new me({id:"srgb-linear",name:"Linear sRGB",white:"D65",toXYZ_M:fn,fromXYZ_M:dn});var kt={aliceblue:[240/255,248/255,1],antiquewhite:[250/255,235/255,215/255],aqua:[0,1,1],aquamarine:[127/255,1,212/255],azure:[240/255,1,1],beige:[245/255,245/255,220/255],bisque:[1,228/255,196/255],black:[0,0,0],blanchedalmond:[1,235/255,205/255],blue:[0,0,1],blueviolet:[138/255,43/255,226/255],brown:[165/255,42/255,42/255],burlywood:[222/255,184/255,135/255],cadetblue:[95/255,158/255,160/255],chartreuse:[127/255,1,0],chocolate:[210/255,105/255,30/255],coral:[1,127/255,80/255],cornflowerblue:[100/255,149/255,237/255],cornsilk:[1,248/255,220/255],crimson:[220/255,20/255,60/255],cyan:[0,1,1],darkblue:[0,0,139/255],darkcyan:[0,139/255,139/255],darkgoldenrod:[184/255,134/255,11/255],darkgray:[169/255,169/255,169/255],darkgreen:[0,100/255,0],darkgrey:[169/255,169/255,169/255],darkkhaki:[189/255,183/255,107/255],darkmagenta:[139/255,0,139/255],darkolivegreen:[85/255,107/255,47/255],darkorange:[1,140/255,0],darkorchid:[153/255,50/255,204/255],darkred:[139/255,0,0],darksalmon:[233/255,150/255,122/255],darkseagreen:[143/255,188/255,143/255],darkslateblue:[72/255,61/255,139/255],darkslategray:[47/255,79/255,79/255],darkslategrey:[47/255,79/255,79/255],darkturquoise:[0,206/255,209/255],darkviolet:[148/255,0,211/255],deeppink:[1,20/255,147/255],deepskyblue:[0,191/255,1],dimgray:[105/255,105/255,105/255],dimgrey:[105/255,105/255,105/255],dodgerblue:[30/255,144/255,1],firebrick:[178/255,34/255,34/255],floralwhite:[1,250/255,240/255],forestgreen:[34/255,139/255,34/255],fuchsia:[1,0,1],gainsboro:[220/255,220/255,220/255],ghostwhite:[248/255,248/255,1],gold:[1,215/255,0],goldenrod:[218/255,165/255,32/255],gray:[128/255,128/255,128/255],green:[0,128/255,0],greenyellow:[173/255,1,47/255],grey:[128/255,128/255,128/255],honeydew:[240/255,1,240/255],hotpink:[1,105/255,180/255],indianred:[205/255,92/255,92/255],indigo:[75/255,0,130/255],ivory:[1,1,240/255],khaki:[240/255,230/255,140/255],lavender:[230/255,230/255,250/255],lavenderblush:[1,240/255,245/255],lawngreen:[124/255,252/255,0],lemonchiffon:[1,250/255,205/255],lightblue:[173/255,216/255,230/255],lightcoral:[240/255,128/255,128/255],lightcyan:[224/255,1,1],lightgoldenrodyellow:[250/255,250/255,210/255],lightgray:[211/255,211/255,211/255],lightgreen:[144/255,238/255,144/255],lightgrey:[211/255,211/255,211/255],lightpink:[1,182/255,193/255],lightsalmon:[1,160/255,122/255],lightseagreen:[32/255,178/255,170/255],lightskyblue:[135/255,206/255,250/255],lightslategray:[119/255,136/255,153/255],lightslategrey:[119/255,136/255,153/255],lightsteelblue:[176/255,196/255,222/255],lightyellow:[1,1,224/255],lime:[0,1,0],limegreen:[50/255,205/255,50/255],linen:[250/255,240/255,230/255],magenta:[1,0,1],maroon:[128/255,0,0],mediumaquamarine:[102/255,205/255,170/255],mediumblue:[0,0,205/255],mediumorchid:[186/255,85/255,211/255],mediumpurple:[147/255,112/255,219/255],mediumseagreen:[60/255,179/255,113/255],mediumslateblue:[123/255,104/255,238/255],mediumspringgreen:[0,250/255,154/255],mediumturquoise:[72/255,209/255,204/255],mediumvioletred:[199/255,21/255,133/255],midnightblue:[25/255,25/255,112/255],mintcream:[245/255,1,250/255],mistyrose:[1,228/255,225/255],moccasin:[1,228/255,181/255],navajowhite:[1,222/255,173/255],navy:[0,0,128/255],oldlace:[253/255,245/255,230/255],olive:[128/255,128/255,0],olivedrab:[107/255,142/255,35/255],orange:[1,165/255,0],orangered:[1,69/255,0],orchid:[218/255,112/255,214/255],palegoldenrod:[238/255,232/255,170/255],palegreen:[152/255,251/255,152/255],paleturquoise:[175/255,238/255,238/255],palevioletred:[219/255,112/255,147/255],papayawhip:[1,239/255,213/255],peachpuff:[1,218/255,185/255],peru:[205/255,133/255,63/255],pink:[1,192/255,203/255],plum:[221/255,160/255,221/255],powderblue:[176/255,224/255,230/255],purple:[128/255,0,128/255],rebeccapurple:[102/255,51/255,153/255],red:[1,0,0],rosybrown:[188/255,143/255,143/255],royalblue:[65/255,105/255,225/255],saddlebrown:[139/255,69/255,19/255],salmon:[250/255,128/255,114/255],sandybrown:[244/255,164/255,96/255],seagreen:[46/255,139/255,87/255],seashell:[1,245/255,238/255],sienna:[160/255,82/255,45/255],silver:[192/255,192/255,192/255],skyblue:[135/255,206/255,235/255],slateblue:[106/255,90/255,205/255],slategray:[112/255,128/255,144/255],slategrey:[112/255,128/255,144/255],snow:[1,250/255,250/255],springgreen:[0,1,127/255],steelblue:[70/255,130/255,180/255],tan:[210/255,180/255,140/255],teal:[0,128/255,128/255],thistle:[216/255,191/255,216/255],tomato:[1,99/255,71/255],turquoise:[64/255,224/255,208/255],violet:[238/255,130/255,238/255],wheat:[245/255,222/255,179/255],white:[1,1,1],whitesmoke:[245/255,245/255,245/255],yellow:[1,1,0],yellowgreen:[154/255,205/255,50/255]};var jr=Array(3).fill(" | [0, 255]"),qr=Array(3).fill("[0, 255]"),ne=new me({id:"srgb",name:"sRGB",base:Rr,fromBase:e=>e.map(t=>{let r=t<0?-1:1,o=t*r;return o>.0031308?r*(1.055*o**(1/2.4)-.055):12.92*t}),toBase:e=>e.map(t=>{let r=t<0?-1:1,o=t*r;return o<=.04045?t/12.92:r*((o+.055)/1.055)**2.4}),formats:{rgb:{coords:jr},rgb_number:{name:"rgb",commas:!0,coords:qr,noAlpha:!0},color:{},rgba:{coords:jr,commas:!0,lastAlpha:!0},rgba_number:{name:"rgba",commas:!0,coords:qr},hex:{type:"custom",toGamut:!0,test:e=>/^#([a-f0-9]{3,4}){1,2}$/i.test(e),parse(e){e.length<=5&&(e=e.replace(/[a-f0-9]/gi,"$&$&"));let t=[];return e.replace(/[a-f0-9]{2}/gi,r=>{t.push(parseInt(r,16)/255)}),{spaceId:"srgb",coords:t.slice(0,3),alpha:t.slice(3)[0]}},serialize:(e,t,{collapse:r=!0}={})=>{t<1&&e.push(t),e=e.map(a=>Math.round(a*255));let o=r&&e.every(a=>a%17===0);return"#"+e.map(a=>o?(a/17).toString(16):a.toString(16).padStart(2,"0")).join("")}},keyword:{type:"custom",test:e=>/^[a-z]+$/i.test(e),parse(e){e=e.toLowerCase();let t={spaceId:"srgb",coords:null,alpha:1};if(e==="transparent"?(t.coords=kt.black,t.alpha=0):t.coords=kt[e],t.coords)return t}}}});var Pe=new m({id:"hsl",name:"HSL",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:ne,fromBase:e=>{let t=Math.max(...e),r=Math.min(...e),[o,n,a]=e,[i,s,l]=[NaN,0,(r+t)/2],c=t-r;if(c!==0){switch(s=l===0||l===1?0:(t-l)/Math.min(l,1-l),t){case o:i=(n-a)/c+(n=360&&(i-=360),[i,s*100,l*100]},toBase:e=>{let[t,r,o]=e;t=t%360,t<0&&(t+=360),r/=100,o/=100;function n(a){let i=(a+t/30)%12,s=r*Math.min(o,1-o);return o-s*Math.max(-1,Math.min(i-3,9-i,1))}return[n(0),n(8),n(4)]},formats:{hsl:{coords:[" | ","",""]},hsla:{coords:[" | ","",""],commas:!0,lastAlpha:!0}}});var Ue=new m({id:"oklch",name:"Oklch",coords:{l:{refRange:[0,1],name:"Lightness"},c:{refRange:[0,.4],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},white:"D65",base:te,fromBase(e){let[t,r,o]=e,n,a=2e-4;return Math.abs(r) | "," | [0,1]"," | "]}}});m.register(ne);m.register(Ue);m.register(Pe);function _t(e,t,r){if((t==="hex"||t==="oklch")&&typeof e=="object"&&e!==null&&(e=e.toString(),e==="[object Object]"))return{};if(!e||Array.isArray(e)&&e.length===0||typeof e=="object"&&Object.keys(e).length===0)return{};if(t==="all"){let o=e?.hex;if(!o)return{};let n=J(o),a=Et(n);return{...e,lightness:a}}return t==="coords"?e?.l===void 0||e?.c===void 0||e?.h===void 0?{}:Ar(`oklch(${e.l} ${e.c} ${e.h})`,r):t==="hex"?Qe(e,r):t==="oklch"?Ar(e,r):{}}function Ar(e,t){let r=J(e),o=Et(r),n=N(r,ne);return{hex:oe(n,{format:"hex"}),oklch:oe(r,{precision:t}),coords:Br(r,t),lightness:o}}function Nt(e,t){let r=J(e),o=N(r,Pe);return o.coords[2]=t,oe(N(o,ne),{format:"hex"})}function Lt(e,t){let r=J(e);r.coords[0]=t/100;let o=N(r,ne);return oe(o,{format:"hex"})}function Qe(e,t){let r=J(e),o=Et(r),n=N(r,Ue);return{hex:e,oklch:oe(n,{precision:t}),coords:Br(n,t),lightness:o}}function Et(e){let{coords:t}=N(e,Pe);return Math.round(t[2])}function Br(e,t=5){let{coords:r}=e,o=t>3?t-3:0;return{l:St(r[0],t),c:St(r[1],t),h:St(r[2],o)}}function St(e,t=void 0){if(e=e||0,!t)return e;let r=Math.pow(10,t);return Math.round(e*r)/r}var et=z(X());var Pt={};Object.defineProperty(Pt,"__esModule",{value:!0});var zt=Pt.styleq=void 0,mn=new WeakMap,pn="$$css";function Tr(e){var t,r,o;return e!=null&&(t=e.disableCache===!0,r=e.disableMix===!0,o=e.transform),function(){for(var a=[],i="",s=null,l=t?null:mn,c=new Array(arguments.length),u=0;u0;){var f=c.pop();if(!(f==null||f===!1)){if(Array.isArray(f)){for(var d=0;dnew Error(`'stylex.${e}' should never be called at runtime. It should be compiled away by '@stylexjs/babel-plugin'`),q=e=>he(`types.${e}`);function L(){let e=this;for(var t=arguments.length,r=new Array(t),o=0;o0&&(i.style=a),i}function hn(){let{className:e,style:t}=L(...arguments),r={};return e!=null&&e!==""&&(r.class=e),t!=null&&Object.keys(t).length>0&&(r.style=Object.keys(t).map(o=>`${o}:${t[o]};`).join("")),r}function gn(e){if($.create!=null){let t=$.create;return t(e)}throw he("create")}function xn(e){if($.defineVars)return $.defineVars(e);throw he("defineVars")}var bn=(e,t)=>{if($.createTheme)return $.createTheme(e,t);throw he("createTheme")},yn=e=>{if($.include)return $.include(e);throw he("include")},vn=gn,wn=xn,Cn=bn,Mn=yn,kn={angle:e=>{throw q("angle")},color:e=>{throw q("color")},url:e=>{throw q("url")},image:e=>{throw q("image")},integer:e=>{throw q("integer")},lengthPercentage:e=>{throw q("lengthPercentage")},length:e=>{throw q("length")},percentage:e=>{throw q("percentage")},number:e=>{throw q("number")},resolution:e=>{throw q("resolution")},time:e=>{throw q("time")},transformFunction:e=>{throw q("transformFunction")},transformList:e=>{throw q("transformList")}},Sn=e=>{if($.keyframes)return $.keyframes(e);throw he("keyframes")},_n=function(){if($.firstThatWorks)return $.firstThatWorks(...arguments);throw he("firstThatWorks")};function U(){for(var e=arguments.length,t=new Array(e),r=0;r{i(e)},[e]);function c(g){t(g?.currentTarget?.valueAsNumber)}let u=g=>g.toString().length,d=`calc(${Math.max(u(s),u(l))+"ch"} + 2rem)`;return K.default.createElement("div",{...L(Wr.wrapper,o&&Wr.disabled)},K.default.createElement("div",{className:"x78zum5 x1qughib x188dswm"},K.default.createElement("label",{htmlFor:n,className:"x87ps6o x1ypdohk xiq9r4"},r),K.default.createElement("input",{className:"x1lo5vof xdneb0g xjohyra x1hr2gdg x1awj2ng x1sirlc8 x1wty727 x11g6tue x1a2a7pz x1i1gfen x9pjoqp xtilpmw x1yrzqix xo6swyp xpf6v1x x1agkqgv",style:{minWidth:d},min:s,max:l,type:"number",value:Math.round(a),onChange:c,id:n,inputMode:"numeric"})),K.default.createElement("input",{className:"xh8yej3 x1wyezfn xjyslct xjohyra x1wty727 x1a2a7pz x1qjns4s xibs45w x8cq3ga x1kthjsd xu2yhzc x1p6diu8 x1iqn34f xcvrw5r x1c6sthy x1butzbu x1tx7z28 xbepbgz xnwzpgn xd8b9pn x1tk0e90 x1xk2y70 x13fi9fm x4wtp0 x66xn83 x1w3w5 x1qquo6a xovb9ml x1wwh93d x1l5f1bp x55q4sf x16hwx1y x3jfnhq xsahp4b x1272q6d xuyzg6f xoo02y2",type:"range",min:s,max:l,step:"1",value:Math.round(a),onChange:c}))}var F=z(X());var v=z(X(),1);function ve(){return(ve=Object.assign||function(e){for(var t=1;t=0||(n[r]=e[r]);return n}function $e(e){var t=(0,v.useRef)(e),r=(0,v.useRef)(function(o){t.current&&t.current(o)});return t.current=e,r.current}var Oe=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=1),e>r?r:e0:h.buttons>0)&&n.current?a(Gr(n.current,h,s.current)):x(!1)},p=function(){return x(!1)};function x(h){var b=l.current,y=Ht(n.current),w=h?y.addEventListener:y.removeEventListener;w(b?"touchmove":"mousemove",g),w(b?"touchend":"mouseup",p)}return[function(h){var b=h.nativeEvent,y=n.current;if(y&&(Jr(b),!function(S,E){return E&&!Ie(S)}(b,l.current)&&y)){if(Ie(b)){l.current=!0;var w=b.changedTouches||[];w.length&&(s.current=w[0].identifier)}y.focus(),a(Gr(y,b,s.current)),x(!0)}},function(h){var b=h.which||h.keyCode;b<37||b>40||(h.preventDefault(),i({left:b===39?.05:b===37?-.05:0,top:b===40?.05:b===38?-.05:0}))},x]},[i,a]),u=c[0],f=c[1],d=c[2];return(0,v.useEffect)(function(){return d},[d]),v.default.createElement("div",ve({},o,{onTouchStart:u,onMouseDown:u,className:"react-colorful__interactive",ref:n,onKeyDown:f,tabIndex:0,role:"slider"}))}),Ot=function(e){return e.filter(Boolean).join(" ")},Zr=function(e){var t=e.color,r=e.left,o=e.top,n=o===void 0?.5:o,a=Ot(["react-colorful__pointer",e.className]);return v.default.createElement("div",{className:a,style:{top:100*n+"%",left:100*r+"%"}},v.default.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},P=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=Math.pow(10,t)),Math.round(r*e)/r},ou={grad:.9,turn:360,rad:360/(2*Math.PI)},Ln=function(e){return In(It(e))},It=function(e){return e[0]==="#"&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?P(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?P(parseInt(e.substring(6,8),16)/255,2):1}};var En=function(e){return Hn(zn(e))},Pn=function(e){var t=e.s,r=e.v,o=e.a,n=(200-t)*r/100;return{h:P(e.h),s:P(n>0&&n<200?t*r/100/(n<=100?n:200-n)*100:0),l:P(n/2),a:P(o,2)}},$t=function(e){var t=Pn(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"};var zn=function(e){var t=e.h,r=e.s,o=e.v,n=e.a;t=t/360*6,r/=100,o/=100;var a=Math.floor(t),i=o*(1-r),s=o*(1-(t-a)*r),l=o*(1-(1-t+a)*r),c=a%6;return{r:P(255*[o,s,i,i,l,o][c]),g:P(255*[l,o,o,s,i,i][c]),b:P(255*[i,i,l,o,o,s][c]),a:P(n,2)}};var rt=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Hn=function(e){var t=e.r,r=e.g,o=e.b,n=e.a,a=n<1?rt(P(255*n)):"";return"#"+rt(t)+rt(r)+rt(o)+a},In=function(e){var t=e.r,r=e.g,o=e.b,n=e.a,a=Math.max(t,r,o),i=a-Math.min(t,r,o),s=i?a===t?(r-o)/i:a===r?2+(o-t)/i:4+(t-r)/i:0;return{h:P(60*(s<0?s+6:s)),s:P(a?i/a*100:0),v:P(a/255*100),a:n}};var $n=v.default.memo(function(e){var t=e.hue,r=e.onChange,o=Ot(["react-colorful__hue",e.className]);return v.default.createElement("div",{className:o},v.default.createElement(Xr,{onMove:function(n){r({h:360*n.left})},onKey:function(n){r({h:Oe(t+360*n.left,0,360)})},"aria-label":"Hue","aria-valuenow":P(t),"aria-valuemax":"360","aria-valuemin":"0"},v.default.createElement(Zr,{className:"react-colorful__hue-pointer",left:t/360,color:$t({h:t,s:100,v:100,a:1})})))}),On=v.default.memo(function(e){var t=e.hsva,r=e.onChange,o={backgroundColor:$t({h:t.h,s:100,v:100,a:1})};return v.default.createElement("div",{className:"react-colorful__saturation",style:o},v.default.createElement(Xr,{onMove:function(n){r({s:100*n.left,v:100-100*n.top})},onKey:function(n){r({s:Oe(t.s+100*n.left,0,100),v:Oe(t.v-100*n.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+P(t.s)+"%, Brightness "+P(t.v)+"%"},v.default.createElement(Zr,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:$t(t)})))}),Vr=function(e,t){if(e===t)return!0;for(var r in e)if(e[r]!==t[r])return!1;return!0};var Rn=function(e,t){return e.toLowerCase()===t.toLowerCase()||Vr(It(e),It(t))};function jn(e,t,r){var o=$e(r),n=(0,v.useState)(function(){return e.toHsva(t)}),a=n[0],i=n[1],s=(0,v.useRef)({color:t,hsva:a});(0,v.useEffect)(function(){if(!e.equal(t,s.current.color)){var c=e.toHsva(t);s.current={hsva:c,color:t},i(c)}},[t,e]),(0,v.useEffect)(function(){var c;Vr(a,s.current.hsva)||e.equal(c=e.fromHsva(a),s.current.color)||(s.current={hsva:a,color:c},o(c))},[a,e,o]);var l=(0,v.useCallback)(function(c){i(function(u){return Object.assign({},u,c)})},[]);return[a,l]}var qn,An=typeof window<"u"?v.useLayoutEffect:v.useEffect,Bn=function(){return qn||(typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0)};var Kr=new Map,Tn=function(e){An(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!Kr.has(t)){var r=t.createElement("style");r.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,Kr.set(t,r);var o=Bn();o&&r.setAttribute("nonce",o),t.head.appendChild(r)}},[])},Dn=function(e){var t=e.className,r=e.colorModel,o=e.color,n=o===void 0?r.defaultColor:o,a=e.onChange,i=ot(e,["className","colorModel","color","onChange"]),s=(0,v.useRef)(null);Tn(s);var l=jn(r,n,a),c=l[0],u=l[1],f=Ot(["react-colorful",t]);return v.default.createElement("div",ve({},i,{ref:s,className:f}),v.default.createElement(On,{hsva:c,onChange:u}),v.default.createElement($n,{hue:c.h,onChange:u,className:"react-colorful__last-control"}))},Fn={defaultColor:"000",toHsva:Ln,fromHsva:function(e){return En({h:e.h,s:e.s,v:e.v,a:1})},equal:Rn},Ur=function(e){return v.default.createElement(Dn,ve({},e,{colorModel:Fn}))};var Wn=/^#?([0-9A-F]{3,8})$/i,Gn=function(e){var t=e.color,r=t===void 0?"":t,o=e.onChange,n=e.onBlur,a=e.escape,i=e.validate,s=e.format,l=e.process,c=ot(e,["color","onChange","onBlur","escape","validate","format","process"]),u=(0,v.useState)(function(){return a(r)}),f=u[0],d=u[1],g=$e(o),p=$e(n),x=(0,v.useCallback)(function(b){var y=a(b.target.value);d(y),i(y)&&g(l?l(y):y)},[a,l,i,g]),h=(0,v.useCallback)(function(b){i(b.target.value)||d(a(r)),p(b)},[r,a,i,p]);return(0,v.useEffect)(function(){d(a(r))},[r,a]),v.default.createElement("input",ve({},c,{value:s?s(f):f,spellCheck:"false",onChange:x,onBlur:h}))},Yr=function(e){return"#"+e},Qr=function(e){var t=e.prefixed,r=e.alpha,o=ot(e,["prefixed","alpha"]),n=(0,v.useCallback)(function(i){return i.replace(/([^0-9A-F]+)/gi,"").substring(0,r?8:6)},[r]),a=(0,v.useCallback)(function(i){return function(s,l){var c=Wn.exec(s),u=c?c[1].length:0;return u===3||u===6||!!l&&u===4||!!l&&u===8}(i,r)},[r]);return v.default.createElement(Gn,ve({},o,{escape:n,format:t?Yr:void 0,process:Yr,validate:a}))};var at=z(Rt());var nt={highlight:{borderRadius:"xjohyra",borderStartStartRadius:null,borderStartEndRadius:null,borderEndStartRadius:null,borderEndEndRadius:null,borderTopLeftRadius:null,borderTopRightRadius:null,borderBottomLeftRadius:null,borderBottomRightRadius:null,boxShadow:"x11mstge",$$css:!0},colorPreview:e=>[{borderRadius:"xjohyra",borderStartStartRadius:null,borderStartEndRadius:null,borderEndStartRadius:null,borderEndEndRadius:null,borderTopLeftRadius:null,borderTopRightRadius:null,borderBottomLeftRadius:null,borderBottomRightRadius:null,height:"x1hhc0k",minWidth:"x15g7okx",flexBasis:null,flex:"x98rzlu",flexGrow:null,flexShrink:null,backgroundColor:"xq1mx2j",backgroundSize:"xx8ilsi",backgroundImage:"x1g0zcm7",$$css:!0},{"--backgroundColor":(e||ae.contrastNeutral)!=null?e||ae.contrastNeutral:"initial","--backgroundSize":(e?null:"16px 16px")??"initial","--backgroundImage":(e?null:ae.checkerboard)!=null?e?null:ae.checkerboard:"initial"}],colorPicker:{width:"xh8yej3",height:"xt7dq6l",aspectRatio:"x1plog1",marginTop:"xlt0ddm",":where(*) > :first-child_borderTopLeftRadius":"xf5yl2k",":where(*) > :first-child_borderTopRightRadius":"x9av0op",":where(*) > :last-child_borderBottomLeftRadius":"xdosjj7",":where(*) > :last-child_borderBottomRightRadius":"xkmff00",":where(*) .react-colorful__pointer_height":"xbq8i1p",":where(*) .react-colorful__pointer_width":"x19mnrqj",":where(*) .react-colorful__pointer_backgroundColor":"x13bp1ud",":where(*) .react-colorful__pointer_borderColor":"x1th5coa",":where(*) .react-colorful__pointer_transition":"x1lptuiq",":where(*) .react-colorful__pointer:hover_backgroundColor":"x4hip2o",":where(*) .react-colorful__pointer:hover_borderColor":"xfbmp4j",":where(*) .react-colorful__pointer:hover_cursor":"x2lqnu4",":where(*) .react-colorful__pointer:active_transform":"xmxw2tw",":where(*) .react-colorful__pointer:active_cursor":"x46gmau",$$css:!0},colorPickerCollapsed:{marginTop:"x16i8m89",$$css:!0}};function jt({allowEmpty:e,precision:t,presets:r,showHexInput:o,showLightness:n,showLuminance:a,showPicker:i,showPresets:s,i18nRegistry:l,highlight:c,state:u,setState:f,id:d,onFocus:g=()=>{},collapsed:p}){function x(w){f(Qe(w,t))}function h(w){x(Nt(u?.hex,w))}function b(w){x(Lt(u?.oklch,w))}let y=s&&r&&Object.entries(r).map(([w,S])=>({value:S,label:w})).filter(w=>!!w.value);return F.default.createElement(F.default.Fragment,null,!!i&&F.default.createElement(Ur,{...L(nt.colorPicker,p&&nt.colorPickerCollapsed),color:u?.hex,onChange:x}),!!n&&F.default.createElement(He,{disabled:!u?.hex,value:u?.lightness||0,onChange:h,label:l.translate("Carbon.ColorPicker.OKLCH:Main:lightness"),id:`${d}-lightness`}),!!a&&F.default.createElement(He,{disabled:!u?.coords?.l,value:u?.coords?.l*100||0,onChange:b,label:l.translate("Carbon.ColorPicker.OKLCH:Main:luminance"),id:`${d}-luminance`}),(p?!!o:!0)&&F.default.createElement("div",{className:"x78zum5 x188dswm"},!!p||F.default.createElement("div",{...L(nt.colorPreview(u?.oklch),c&&nt.highlight)}),!!o&&F.default.createElement(Qr,{className:"x1iyjqo2 x1hhc0k xh8yej3 xjohyra x1wty727 x1qjns4s xtqyqw7 x1awj2ng x1a2a7pz x1agkqgv xtw1abo x1sirlc8",title:l.translate("Carbon.ColorPicker.OKLCH:Main:setHexColor"),color:u?.hex,onChange:x,prefixed:!1,id:d,onFocus:()=>g()}),!p&&!!e&&F.default.createElement(at.IconButton,{style:"light",icon:"times",title:l.translate("Carbon.ColorPicker.OKLCH:Main:resetColor"),onClick:()=>{f(null)}})),!!y&&F.default.createElement(at.SelectBox,{options:y,value:u?.hex,placeholder:l.translate("Carbon.ColorPicker.OKLCH:Main:preset"),allowEmpty:!1,onValueChange:x,ListPreviewElement:tt}))}var qt=jt;var ge=z(Rt()),co=z(ro());var oo=z(X());function At({hex:e}){return e?oo.default.createElement("span",{className:"x1sirlc8"},e):""}var ie=z(X());var Q=z(X());function no({style:e,className:t,size:r=30}){return Q.default.createElement("svg",{width:r,height:r,stroke:"currentColor",viewBox:"0 0 24 24",style:e,className:t},Q.default.createElement("g",null,Q.default.createElement("circle",{cx:"12",cy:"12",r:"9.5",fill:"none","stroke-width":"2","stroke-linecap":"round"},[{attribute:"dasharray",values:"0 150;42 150;42 150;42 150"},{attribute:"dashoffset",values:"0;-16;-59;-59"}].map(({attribute:o,values:n})=>Q.default.createElement("animate",{key:o,attributeName:`stroke-${o}`,values:n,dur:"1.5s",calcMode:"spline",keyTimes:"0;0.475;0.95;1",keySplines:"0.42,0,0.58,1;0.42,0,0.58,1;0.42,0,0.58,1",repeatCount:"indefinite"}))),Q.default.createElement("animateTransform",{attributeName:"transform",type:"rotate",dur:"2s",values:"0 12 12;360 12 12",repeatCount:"indefinite"})))}function ao({style:e,className:t,size:r=30}){return Q.default.createElement("svg",{width:r*2,height:r,viewBox:"0 0 24 12",class:t,style:e},[1,2,3].map(o=>{let n=o*6,a=Math.round(100/3*(o-1))/100;return Q.default.createElement("circle",{cx:n,cy:"6",r:"0",fill:"currentColor"},Q.default.createElement("animate",{attributeName:"r",begin:a,calcMode:"spline",dur:"1.5s",keySplines:"0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8",repeatCount:"indefinite",values:"0;2;0;0"}))}))}var io=z(lt());function Jn({id:e,title:t="Neos.Neos:Main:loading",isLoading:r=!1,delayTime:o=500,timeoutTime:n=5e3,i18nRegistry:a,heightMultiplier:i=1}){let[s,l]=(0,ie.useState)(0),c=t?a.translate(t):null;return(0,ie.useEffect)(()=>{if(!r){l(0);return}let u=setTimeout(()=>{l(1)},o),f=setTimeout(()=>{l(2)},o+n);return()=>{clearTimeout(u),clearTimeout(f)}},[r]),r?ie.default.createElement("div",{id:e,title:c,...L(style.container(i))},ie.default.createElement(no,{...L(style.item(s==1))}),ie.default.createElement(ao,{...L(style.item(s==2))})):null}var Kn=(0,io.neos)(e=>({i18nRegistry:e.get("i18n")})),so=Kn(Jn);var Yn=e=>({contextNodePath:e.focusedNodePath,dataSourceIdentifier:e.options.dataSourceIdentifier,dataSourceUri:e.options.dataSourceUri,dataSourceAdditionalData:e.options.dataSourceAdditionalData,dataSourceDisableCaching:!!e.options.dataSourceDisableCaching}),Xn=(0,C.lazy)(()=>import("./ColorName.js")),Zn={mode:"all",customPropertyName:"color",hidden:!1,disabled:!1,allowEmpty:!0,showPresets:!0,showPicker:!0,showHexInput:!0,showLightness:!1,showLuminance:!1,hasOwnLabel:!1,contrastThreshold:.6,precision:5,presets:{}},se={disabled:{cursor:"x1h6gzvc",opacity:"x190dgpg",":where(*) *_pointerEvents":"x1g8rrie",$$css:!0},highlight:{borderRadius:"xjohyra",boxShadow:"x11mstge",$$css:!0},wrapper:{display:"x78zum5",flexDirection:"xdt5ytf",gap:"x188dswm",$$css:!0},popoverButton:{display:"x78zum5",alignItems:"x6s0dn4",justifyContent:"x1szn6h9",borderWidth:"xc342km",padding:"x1717udv",minHeight:"x1rhtz0q",borderRadius:"xjohyra",cursor:"x1ypdohk",background:"x11g6tue",backgroundColor:"x1qjns4s",$$css:!0},popoverButtonPreview:(e,t,r)=>[{flex:"x98rzlu",flexGrow:null,flexShrink:null,flexBasis:null,display:"x78zum5",alignItems:"x6s0dn4",justifyContent:"x1nhvcw1",textAlign:"xdpxx8g",minHeight:"x1rhtz0q",borderTopLeftRadius:"x6bjwg6",borderStartStartRadius:null,borderStartEndRadius:null,borderBottomLeftRadius:"x1trtmuu",borderEndStartRadius:null,borderEndEndRadius:null,color:"x19dipnz",backgroundColor:"xq1mx2j",backgroundSize:"xx8ilsi",backgroundImage:"x1g0zcm7",paddingInline:"xtqyqw7",paddingStart:null,paddingLeft:null,paddingEnd:null,paddingRight:null,overflow:"xb3r6kr",overflowX:null,overflowY:null,textOverflow:"xlyipyv",$$css:!0},{"--color":(t>r?"black":"white")!=null?t>r?"black":"white":"initial","--backgroundColor":(e||null)??"initial","--backgroundSize":(e?null:"16px 16px")??"initial","--backgroundImage":(e?null:ae.checkerboard)!=null?e?null:ae.checkerboard:"initial"}],popoverButtonIcon:e=>[{transform:"x1v0jg1i",transition:"xl913vs",transitionBehavior:null,transitionDelay:null,transitionDuration:null,transitionProperty:null,transitionTimingFunction:null,minWidth:"x15g7okx",$$css:!0},{"--transform":(e?"rotate(180deg)":"rotate(0deg)")??"initial"}],popoverPanel:e=>[{display:"xrvj5dj",gridTemplateRows:"xi7raoi",opacity:"x1u4uod0",transition:"x5z8be9",transitionBehavior:null,transitionDelay:null,transitionDuration:null,transitionProperty:null,transitionTimingFunction:null,$$css:!0},{"--gridTemplateRows":(e?"1fr":"0fr")??"initial","--opacity":(e?1:0)??"initial","--transition":`grid-template-rows ${D.default} ${D.timing}, opacity ${D.fast} ${D.timing} ${e?D.fast:"0s"}`!=null?`grid-template-rows ${D.default} ${D.timing}, opacity ${D.fast} ${D.timing} ${e?D.fast:"0s"}`:"initial"}],noGap:{gap:"xxhr3t",rowGap:null,columnGap:null,$$css:!0}};function Vn(e){let t={...Zn,...e.config,...e.options},{value:r,commit:o,highlight:n,i18nRegistry:a,id:i,dataSourcesDataLoader:s,renderHelpIcon:l}=e,c=a.translate(e.label),{mode:u,precision:f,dataSourceIdentifier:d,dataSourceUri:g,dataSourceAdditionalData:p}=t;if(u!=="coords"&&u!=="hex"&&u!=="all"&&u!=="oklch")return C.default.createElement("div",{className:"xjohyra x1hgx17m x89w75u"},a.translate("Carbon.ColorPicker.OKLCH:Main:invalidMode","",[u]));let x=!!(d||g),[h,b]=(0,C.useState)(x?[]:t),[y,w]=(0,C.useState)(x),[S,E]=(0,C.useState)(!1),[k,W]=(0,C.useState)(_t(r,u,f)),[A,le]=(0,C.useState)(null);(0,C.useEffect)(()=>{let B=JSON.stringify({dataSourceIdentifier:d,dataSourceUri:g,dataSourceAdditionalData:p});!x||A===B||(le(B),s.resolveValue(Yn(e),r).then(Re=>{w(!1),b({...t,...Re})}))},[d,g,p]),(0,C.useEffect)(()=>{if(!k?.hex){if(r==""||(u==="all"||u==="coords")&&(JSON.stringify(r)=="{}"||JSON.stringify(r)=="[]"))return;o("");return}if(u==="all"){if(r.oklch!=k.oklch){let B={coords:`--${h.customPropertyName}-l:${k.coords.l};--${h.customPropertyName}-c:${k.coords.c};--${h.customPropertyName}-h:${k.coords.h};`,oklch:`--${h.customPropertyName}:${k.oklch};`,hex:`--${h.customPropertyName}:${k.hex};`};o({hex:k.hex,oklch:k.oklch,coords:k.coords,customProperty:B})}return}if(u==="coords"){JSON.stringify(r)!=JSON.stringify(k.coords)&&o(k.coords);return}r!=k[u]&&o(k[u])},[k]);let we=h.collapsed&&h.showPicker;return y?C.default.createElement(C.default.Fragment,null,C.default.createElement(ge.Label,{htmlFor:i},c," ",l()),C.default.createElement(so,{isLoading:y,id:i,title:"Carbon.ColorPicker.OKLCH:Main:loading"})):h.hidden?null:C.default.createElement(C.default.Fragment,null,C.default.createElement(ge.Label,{htmlFor:i},c," ",l()),C.default.createElement("div",{...L(se.wrapper,h.disabled&&se.disabled,we&&se.noGap)},we?C.default.createElement(C.default.Fragment,null,C.default.createElement("button",{...L(se.popoverButton,n&&se.highlight),type:"button",title:a.translate(`Carbon.ColorPicker.OKLCH:Main:${S?"close":"open"}Panel`),onClick:()=>E(!S),"aria-expanded":S,"aria-controls":`${i}-panel`},C.default.createElement("output",{...L(se.popoverButtonPreview(k?.oklch,k?.coords?.l||0,h.contrastThreshold))},C.default.createElement(C.Suspense,{fallback:C.default.createElement(At,{hex:k?.hex})},C.default.createElement(Xn,{hex:k?.hex}))),!!h.allowEmpty&&!!k?.oklch&&C.default.createElement(ge.IconButton,{style:"light",icon:"times",title:a.translate("Carbon.ColorPicker.OKLCH:Main:resetColor"),onClick:B=>{B.stopPropagation(),W(null)}}),C.default.createElement(ge.Icon,{icon:"chevron-down",...L(se.popoverButtonIcon(S))})),C.default.createElement("div",{...L(se.popoverPanel(S)),"aria-hidden":!S,id:`${i}-panel`},C.default.createElement("div",{className:"x78zum5 xdt5ytf x188dswm xb3r6kr xlutiju x1hr3lfm"},C.default.createElement(qt,{...h,state:k,setState:W,i18nRegistry:a,id:i,onFocus:()=>E(!0),collapsed:!0})))):C.default.createElement(qt,{...h,state:k,setState:W,highlight:n,i18nRegistry:a,id:i,collapsed:!1})))}var Un=(0,lo.neos)(e=>({i18nRegistry:e.get("i18n"),config:e.get("frontendConfiguration").get("Carbon.ColorPicker.OKLCH"),dataSourcesDataLoader:e.get("dataLoaders").get("DataSources")})),Qn=(0,uo.connect)(e=>({focusedNodePath:co.selectors.CR.Nodes.focusedNodePathSelector(e)})),fo=Un(Qn(Vn));Gt("Carbon.ColorPicker:OKLCH",{},e=>{e.get("inspector").get("editors").set("Carbon.ColorPicker/OKLCH",{component:fo,hasOwnLabel:!0})}); +import{a as yo,b as Me,c as H,d as st}from"./chunk-5KL6F2HG.js";function O(e){return(...t)=>{if(window["@Neos:HostPluginAPI"]&&window["@Neos:HostPluginAPI"][`@${e}`])return window["@Neos:HostPluginAPI"][`@${e}`](...t);throw new Error("You are trying to read from a consumer api that hasn't been initialized yet!")}}var ue=yo(()=>{});var X=Me((ka,Kt)=>{ue();Kt.exports=O("vendor")().React});var lt=Me((_a,Yt)=>{ue();Yt.exports=O("NeosProjectPackages")().NeosUiDecorators});var Zt=Me((La,Xt)=>{ue();Xt.exports=O("vendor")().reactRedux});var jt=Me((su,to)=>{ue();to.exports=O("NeosProjectPackages")().ReactUiComponents});var oo=Me((Cu,ro)=>{ue();ro.exports=O("NeosProjectPackages")().NeosUiReduxStore});ue();var Jt=O("manifest");var C=H(X()),uo=H(lt()),co=H(Zt());function _(e,t){let r=e.length;Array.isArray(e[0])||(e=[e]),Array.isArray(t[0])||(t=t.map(i=>[i]));let o=t[0].length,n=t[0].map((i,s)=>t.map(l=>l[s])),a=e.map(i=>n.map(s=>{let l=0;if(!Array.isArray(i)){for(let c of s)l+=i*c;return l}for(let c=0;ci[0]):a}function qe(e){return ce(e)==="string"}function ce(e){return(Object.prototype.toString.call(e).match(/^\[object\s+(.*?)\]$/)[1]||"").toLowerCase()}function ke(e,{precision:t,unit:r}){return Ae(e)?"none":wo(e,t)+(r??"")}function Ae(e){return Number.isNaN(e)||e instanceof Number&&e?.none}function wo(e,t){if(e===0)return 0;let r=~~e,o=0;r&&t&&(o=~~Math.log10(Math.abs(r))+1);let n=10**(t-o);return Math.floor(e*n+.5)/n}var Co={deg:1,grad:.9,rad:180/Math.PI,turn:360};function Vt(e){if(!e)return;e=e.trim();let t=/^([a-z]+)\((.+?)\)$/i,r=/^-?[\d.]+$/,o=/%|deg|g?rad|turn$/,n=/\/?\s*(none|[-\w.]+(?:%|deg|g?rad|turn)?)/g,a=e.match(t);if(a){let i=[];return a[2].replace(n,(s,l)=>{let c=l.match(o),u=l;if(c){let f=c[0],d=u.slice(0,-f.length);f==="%"?(u=new Number(d/100),u.type=""):(u=new Number(d*Co[f]),u.type="",u.unit=f)}else r.test(u)?(u=new Number(u),u.type=""):u==="none"&&(u=new Number(NaN),u.none=!0);s.startsWith("/")&&(u=u instanceof Number?u:new Number(u),u.alpha=!0),typeof u=="object"&&u instanceof Number&&(u.raw=l),i.push(u)}),{name:a[1].toLowerCase(),rawName:a[1],rawArgs:a[2],args:i}}}function Ut(e){return e[e.length-1]}function ut(e,t,r){return isNaN(e)?t:isNaN(t)?e:e+(t-e)*r}function Mo(e,t,r){return(r-e)/(t-e)}function Te(e,t,r){return ut(t[0],t[1],Mo(e[0],e[1],r))}function Qt(e){return e.map(t=>t.split("|").map(r=>{r=r.trim();let o=r.match(/^(<[a-z]+>)\[(-?[.\d]+),\s*(-?[.\d]+)\]?$/);if(o){let n=new String(o[1]);return n.range=[+o[2],+o[3]],n}return r}))}function er(e,t,r){return Math.max(Math.min(r,t),e)}function Be(e,t){return Math.sign(e)===Math.sign(t)?e:-e}function G(e,t){return Be(Math.abs(e)**t,e)}function ct(e,t){return t===0?0:e/t}function tr(e,t,r=0,o=e.length){for(;r>1;e[n]","",""]);function rr(e,t,r,o){return Object.entries(e.coords).map(([a,i],s)=>{let l=t.coordGrammar[s],c=o[s],u=c?.type,f;if(c.none?f=l.find(p=>So.has(p)):f=l.find(p=>p==u),!f){let p=i.name||a;throw new TypeError(`${u??c.raw} not allowed for ${p} in ${r}()`)}let d=f.range;u===""&&(d||(d=[0,1]));let g=i.range||i.refRange;return d&&g&&(o[s]=Te(d,g,o[s])),f})}function J(e,{meta:t}={}){let r={str:String(e)?.trim()};if(fe.run("parse-start",r),r.color)return r.color;if(r.parsed=Vt(r.str),r.parsed){let o=r.parsed.name;if(o==="color"){let n=r.parsed.args.shift(),a=n.startsWith("--")?n.substring(2):`--${n}`,i=[n,a],s=r.parsed.rawArgs.indexOf("/")>0?r.parsed.args.pop():1;for(let u of m.all){let f=u.getFormat("color");if(f&&(i.includes(f.id)||f.ids?.filter(d=>i.includes(d)).length)){let d=Object.keys(u.coords).map((p,x)=>r.parsed.args[x]||0),g;return f.coordGrammar&&(g=rr(u,f,"color",d)),t&&Object.assign(t,{formatId:"color",types:g}),f.id.startsWith("--")&&!n.startsWith("--")&&Z.warn(`${u.name} is a non-standard space and not currently supported in the CSS spec. Use prefixed color(${f.id}) instead of color(${n}).`),n.startsWith("--")&&!f.id.startsWith("--")&&Z.warn(`${u.name} is a standard space and supported in the CSS spec. Use color(${f.id}) instead of prefixed color(${n}).`),{spaceId:u.id,coords:d,alpha:s}}}let l="",c=n in m.registry?n:a;if(c in m.registry){let u=m.registry[c].formats?.color?.id;u&&(l=`Did you mean color(${u})?`)}throw new TypeError(`Cannot parse color(${n}). `+(l||"Missing a plugin?"))}else for(let n of m.all){let a=n.getFormat(o);if(a&&a.type==="function"){let i=1;(a.lastAlpha||Ut(r.parsed.args).alpha)&&(i=r.parsed.args.pop());let s=r.parsed.args,l;return a.coordGrammar&&(l=rr(n,a,o,s)),t&&Object.assign(t,{formatId:a.name,types:l}),{spaceId:n.id,coords:s,alpha:i}}}}else for(let o of m.all)for(let n in o.formats){let a=o.formats[n];if(a.type!=="custom"||a.test&&!a.test(r.str))continue;let i=a.parse(r.str);if(i)return i.alpha??(i.alpha=1),t&&(t.formatId=n),i}throw new TypeError(`Could not parse ${e} as a color. Missing a plugin?`)}function M(e){if(Array.isArray(e))return e.map(M);if(!e)throw new TypeError("Empty color reference");qe(e)&&(e=J(e));let t=e.space||e.spaceId;return t instanceof m||(e.space=m.get(t)),e.alpha===void 0&&(e.alpha=1),e}var _o=75e-6,z=class z{constructor(t){this.id=t.id,this.name=t.name,this.base=t.base?z.get(t.base):null,this.aliases=t.aliases,this.base&&(this.fromBase=t.fromBase,this.toBase=t.toBase);let r=t.coords??this.base.coords;for(let n in r)"name"in r[n]||(r[n].name=n);this.coords=r;let o=t.white??this.base.white??"D65";this.white=De(o),this.formats=t.formats??{};for(let n in this.formats){let a=this.formats[n];a.type||(a.type="function"),a.name||(a.name=n)}this.formats.color?.id||(this.formats.color={...this.formats.color??{},id:t.cssId||this.id}),t.gamutSpace?this.gamutSpace=t.gamutSpace==="self"?this:z.get(t.gamutSpace):this.isPolar?this.gamutSpace=this.base:this.gamutSpace=this,this.gamutSpace.isUnbounded&&(this.inGamut=(n,a)=>!0),this.referred=t.referred,Object.defineProperty(this,"path",{value:No(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),fe.run("colorspace-init-end",this)}inGamut(t,{epsilon:r=_o}={}){if(!this.equals(this.gamutSpace))return t=this.to(this.gamutSpace,t),this.gamutSpace.inGamut(t,{epsilon:r});let o=Object.values(this.coords);return t.every((n,a)=>{let i=o[a];if(i.type!=="angle"&&i.range){if(Number.isNaN(n))return!0;let[s,l]=i.range;return(s===void 0||n>=s-r)&&(l===void 0||n<=l+r)}return!0})}get isUnbounded(){return Object.values(this.coords).every(t=>!("range"in t))}get cssId(){return this.formats?.color?.id||this.id}get isPolar(){for(let t in this.coords)if(this.coords[t].type==="angle")return!0;return!1}getFormat(t){if(typeof t=="object")return t=or(t,this),t;let r;return t==="default"?r=Object.values(this.formats)[0]:r=this.formats[t],r?(r=or(r,this),r):null}equals(t){return t?this===t||this.id===t||this.id===t.id:!1}to(t,r){if(arguments.length===1){let s=M(t);[t,r]=[s.space,s.coords]}if(t=z.get(t),this.equals(t))return r;r=r.map(s=>Number.isNaN(s)?0:s);let o=this.path,n=t.path,a,i;for(let s=0;si;s--)r=o[s].toBase(r);for(let s=i+1;s=0){let l=Object.entries(n.coords)[a];if(l)return{space:n,id:l[0],index:a,...l[1]}}n=z.get(n);let i=a.toLowerCase(),s=0;for(let l in n.coords){let c=n.coords[l];if(l.toLowerCase()===i||c.name?.toLowerCase()===i)return{space:n,id:l,index:s,...c};s++}throw new TypeError(`No "${a}" coordinate found in ${n.name}. Its coordinates are: ${Object.keys(n.coords).join(", ")}`)}};st(z,"registry",{}),st(z,"DEFAULT_FORMAT",{type:"functions",name:"color"});var m=z;function No(e){let t=[e];for(let r=e;r=r.base;)t.push(r);return t}function or(e,{coords:t}={}){if(e.coords&&!e.coordGrammar){e.type||(e.type="function"),e.name||(e.name="color"),e.coordGrammar=Qt(e.coords);let r=Object.entries(t).map(([o,n],a)=>{let i=e.coordGrammar[a][0],s=n.range||n.refRange,l=i.range,c="";return i==""?(l=[0,100],c="%"):i==""&&(c="deg"),{fromRange:s,toRange:l,suffix:c}});e.serializeCoords=(o,n)=>o.map((a,i)=>{let{fromRange:s,toRange:l,suffix:c}=r[i];return s&&l&&(a=Te(s,l,a)),a=ke(a,{precision:n,unit:c}),a})}return e}var $=new m({id:"xyz-d65",name:"XYZ D65",coords:{x:{name:"X"},y:{name:"Y"},z:{name:"Z"}},white:"D65",formats:{color:{ids:["xyz-d65","xyz"]}},aliases:["xyz"]});var me=class extends m{constructor(t){t.coords||(t.coords={r:{range:[0,1],name:"Red"},g:{range:[0,1],name:"Green"},b:{range:[0,1],name:"Blue"}}),t.base||(t.base=$),t.toXYZ_M&&t.fromXYZ_M&&(t.toBase??(t.toBase=r=>{let o=_(t.toXYZ_M,r);return this.white!==this.base.white&&(o=de(this.white,this.base.white,o)),o}),t.fromBase??(t.fromBase=r=>(r=de(this.base.white,this.white,r),_(t.fromXYZ_M,r)))),t.referred??(t.referred="display"),super(t)}};function Se(e,t){return e=M(e),!t||e.space.equals(t)?e.coords.slice():(t=m.get(t),t.from(e))}function ee(e,t){e=M(e);let{space:r,index:o}=m.resolveCoord(t,e.space);return Se(e,r)[o]}function Fe(e,t,r){return e=M(e),t=m.get(t),e.coords=t.to(e.space,r),e}Fe.returns="color";function _e(e,t,r){if(e=M(e),arguments.length===2&&ce(arguments[1])==="object"){let o=arguments[1];for(let n in o)_e(e,n,o[n])}else{typeof r=="function"&&(r=r(ee(e,t)));let{space:o,index:n}=m.resolveCoord(t,e.space),a=Se(e,o);a[n]=r,Fe(e,o,a)}return e}_e.returns="color";var nr=new m({id:"xyz-d50",name:"XYZ D50",white:"D50",base:$,fromBase:e=>de($.white,"D50",e),toBase:e=>de("D50",$.white,e)});var Lo=216/24389,ar=24/116,We=24389/27,mt=j.D50,B=new m({id:"lab",name:"Lab",coords:{l:{refRange:[0,100],name:"Lightness"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:mt,base:nr,fromBase(e){let r=e.map((o,n)=>o/mt[n]).map(o=>o>Lo?Math.cbrt(o):(We*o+16)/116);return[116*r[1]-16,500*(r[0]-r[1]),200*(r[1]-r[2])]},toBase(e){let t=[];return t[1]=(e[0]+16)/116,t[0]=e[1]/500+t[1],t[2]=t[1]-e[2]/200,[t[0]>ar?Math.pow(t[0],3):(116*t[0]-16)/We,e[0]>8?Math.pow((e[0]+16)/116,3):e[0]/We,t[2]>ar?Math.pow(t[2],3):(116*t[2]-16)/We].map((o,n)=>o*mt[n])},formats:{lab:{coords:[" | "," | [-1,1]"," | [-1,1]"]}}});function R(e){return(e%360+360)%360}var xe=new m({id:"lch",name:"LCH",coords:{l:{refRange:[0,100],name:"Lightness"},c:{refRange:[0,150],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:B,fromBase(e){let[t,r,o]=e,n,a=.02;return Math.abs(r) | "," | "," | "]}}});var ir=25**7,Ge=Math.PI,sr=180/Ge,be=Ge/180;function lr(e){let t=e*e;return t*t*t*e}function Je(e,t,{kL:r=1,kC:o=1,kH:n=1}={}){[e,t]=M([e,t]);let[a,i,s]=B.from(e),l=xe.from(B,[a,i,s])[1],[c,u,f]=B.from(t),d=xe.from(B,[c,u,f])[1];l<0&&(l=0),d<0&&(d=0);let g=(l+d)/2,p=lr(g),x=.5*(1-Math.sqrt(p/(p+ir))),h=(1+x)*i,b=(1+x)*u,y=Math.sqrt(h**2+s**2),w=Math.sqrt(b**2+f**2),S=h===0&&s===0?0:Math.atan2(s,h),E=b===0&&f===0?0:Math.atan2(f,b);S<0&&(S+=2*Ge),E<0&&(E+=2*Ge),S*=sr,E*=sr;let k=c-a,W=w-y,A=E-S,le=S+E,we=Math.abs(A),T;y*w===0?T=0:we<=180?T=A:A>180?T=A-360:A<-180?T=A+360:Z.warn("the unthinkable has happened");let je=2*Math.sqrt(w*y)*Math.sin(T*be/2),po=(a+c)/2,it=(y+w)/2,Bt=lr(it),Y;y*w===0?Y=le:we<=180?Y=le/2:le<360?Y=(le+360)/2:Y=(le-360)/2;let Dt=(po-50)**2,ho=1+.015*Dt/Math.sqrt(20+Dt),Ft=1+.045*it,Ce=1;Ce-=.17*Math.cos((Y-30)*be),Ce+=.24*Math.cos(2*Y*be),Ce+=.32*Math.cos((3*Y+6)*be),Ce-=.2*Math.cos((4*Y-63)*be);let Wt=1+.015*it*Ce,go=30*Math.exp(-1*((Y-275)/25)**2),xo=2*Math.sqrt(Bt/(Bt+ir)),bo=-1*Math.sin(2*go*be)*xo,Re=(k/(r*ho))**2;return Re+=(W/(o*Ft))**2,Re+=(je/(n*Wt))**2,Re+=bo*(W/(o*Ft))*(je/(n*Wt)),Math.sqrt(Re)}var Eo=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],Po=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],Ho=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],zo=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],te=new m({id:"oklab",name:"Oklab",coords:{l:{refRange:[0,1],name:"Lightness"},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:"D65",base:$,fromBase(e){let r=_(Eo,e).map(o=>Math.cbrt(o));return _(Ho,r)},toBase(e){let r=_(zo,e).map(o=>o**3);return _(Po,r)},formats:{oklab:{coords:[" | "," | [-1,1]"," | [-1,1]"]}}});function Ne(e,t){[e,t]=M([e,t]);let[r,o,n]=te.from(e),[a,i,s]=te.from(t),l=r-a,c=o-i,u=n-s;return Math.sqrt(l**2+c**2+u**2)}var $o=75e-6;function V(e,t,{epsilon:r=$o}={}){e=M(e),t||(t=e.space),t=m.get(t);let o=e.coords;return t!==e.space&&(o=t.from(e)),t.inGamut(o,{epsilon:r})}function ye(e){return{space:e.space,coords:e.coords.slice(),alpha:e.alpha}}function pt(e,t,r="lab"){r=m.get(r);let o=r.from(e),n=r.from(t);return Math.sqrt(o.reduce((a,i,s)=>{let l=n[s];return isNaN(i)||isNaN(l)?a:a+(l-i)**2},0))}function ht(e,t){return pt(e,t,"lab")}var Io=Math.PI,ur=Io/180;function cr(e,t,{l:r=2,c:o=1}={}){[e,t]=M([e,t]);let[n,a,i]=B.from(e),[,s,l]=xe.from(B,[n,a,i]),[c,u,f]=B.from(t),d=xe.from(B,[c,u,f])[1];s<0&&(s=0),d<0&&(d=0);let g=n-c,p=s-d,x=a-u,h=i-f,b=x**2+h**2-p**2,y=.511;n>=16&&(y=.040975*n/(1+.01765*n));let w=.0638*s/(1+.0131*s)+.638,S;Number.isNaN(l)&&(l=0),l>=164&&l<=345?S=.56+Math.abs(.2*Math.cos((l+168)*ur)):S=.36+Math.abs(.4*Math.cos((l+35)*ur));let E=Math.pow(s,4),k=Math.sqrt(E/(E+1900)),W=w*(k*S+1-k),A=(g/(r*y))**2;return A+=(p/(o*w))**2,A+=b/W**2,Math.sqrt(A)}var fr=203,Ke=new m({id:"xyz-abs-d65",cssId:"--xyz-abs-d65",name:"Absolute XYZ D65",coords:{x:{refRange:[0,9504.7],name:"Xa"},y:{refRange:[0,1e4],name:"Ya"},z:{refRange:[0,10888.3],name:"Za"}},base:$,fromBase(e){return e.map(t=>Math.max(t*fr,0))},toBase(e){return e.map(t=>Math.max(t/fr,0))}});var Ye=1.15,Xe=.66,dr=2610/2**14,Oo=2**14/2610,mr=3424/2**12,pr=2413/2**7,hr=2392/2**7,jo=1.7*2523/2**5,gr=2**5/(1.7*2523),Ze=-.56,gt=16295499532821565e-27,Ro=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],qo=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],Ao=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],To=[[1,.1386050432715393,.05804731615611886],[.9999999999999999,-.1386050432715393,-.05804731615611886],[.9999999999999998,-.09601924202631895,-.8118918960560388]],xr=new m({id:"jzazbz",name:"Jzazbz",coords:{jz:{refRange:[0,1],name:"Jz"},az:{refRange:[-.5,.5]},bz:{refRange:[-.5,.5]}},base:Ke,fromBase(e){let[t,r,o]=e,n=Ye*t-(Ye-1)*o,a=Xe*r-(Xe-1)*t,s=_(Ro,[n,a,o]).map(function(d){let g=mr+pr*(d/1e4)**dr,p=1+hr*(d/1e4)**dr;return(g/p)**jo}),[l,c,u]=_(Ao,s);return[(1+Ze)*l/(1+Ze*l)-gt,c,u]},toBase(e){let[t,r,o]=e,n=(t+gt)/(1+Ze-Ze*(t+gt)),i=_(To,[n,r,o]).map(function(d){let g=mr-d**gr,p=hr*d**gr-pr;return 1e4*(g/p)**Oo}),[s,l,c]=_(qo,i),u=(s+(Ye-1)*c)/Ye,f=(l+(Xe-1)*u)/Xe;return[u,f,c]},formats:{color:{coords:[" | "," | [-1,1]"," | [-1,1]"]}}});var xt=new m({id:"jzczhz",name:"JzCzHz",coords:{jz:{refRange:[0,1],name:"Jz"},cz:{refRange:[0,1],name:"Chroma"},hz:{refRange:[0,360],type:"angle",name:"Hue"}},base:xr,fromBase(e){let[t,r,o]=e,n,a=2e-4;return Math.abs(r){let n=G(t*Math.abs(o)*.01,Lr);return 400*Be(n,o)/(n+27.13)})}function en(e,t){let r=100/t*27.13**Sr;return e.map(o=>{let n=Math.abs(o);return Be(r*G(n/(400-n),Sr),o)})}function tn(e){let t=R(e);t<=pe.h[0]&&(t+=360);let r=tr(pe.h,t)-1,[o,n]=pe.h.slice(r,r+2),[a,i]=pe.e.slice(r,r+2),s=pe.H[r],l=(t-o)/a;return s+100*l/(l+(n-t)/i)}function rn(e){let t=(e%400+400)%400,r=Math.floor(.01*t);t=t%100;let[o,n]=pe.h.slice(r,r+2),[a,i]=pe.e.slice(r,r+2);return R((t*(i*o-a*n)-100*o*i)/(t*(i-a)-100*i))}function vt(e,t,r,o,n){let a={};a.discounting=n,a.refWhite=e,a.surround=o;let i=e.map(x=>x*100);a.la=t,a.yb=r;let s=i[1],l=_(Er,i);o=Uo[a.surround];let c=o[0];a.c=o[1],a.nc=o[2];let f=(1/(5*a.la+1))**4;a.fl=f*a.la+.1*(1-f)*(1-f)*Math.cbrt(5*a.la),a.flRoot=a.fl**.25,a.n=a.yb/s,a.z=1.48+Math.sqrt(a.n),a.nbb=.725*a.n**-.2,a.ncb=a.nbb;let d=n?1:Math.max(Math.min(c*(1-1/3.6*Math.exp((-a.la-42)/92)),1),0);a.dRgb=l.map(x=>ut(1,s/x,d)),a.dRgbInv=a.dRgb.map(x=>1/x);let g=l.map((x,h)=>x*a.dRgb[h]),p=Pr(g,a.fl);return a.aW=a.nbb*(2*p[0]+p[1]+.05*p[2]),a}var Nr=vt(Xo,64/Math.PI*.2,20,"average",!1);function Ve(e,t){if(!(e.J!==void 0^e.Q!==void 0))throw new Error("Conversion requires one and only one: 'J' or 'Q'");if(!(e.C!==void 0^e.M!==void 0^e.s!==void 0))throw new Error("Conversion requires one and only one: 'C', 'M' or 's'");if(!(e.h!==void 0^e.H!==void 0))throw new Error("Conversion requires one and only one: 'h' or 'H'");if(e.J===0||e.Q===0)return[0,0,0];let r=0;e.h!==void 0?r=R(e.h)*_r:r=rn(e.H)*_r;let o=Math.cos(r),n=Math.sin(r),a=0;e.J!==void 0?a=G(e.J,1/2)*.1:e.Q!==void 0&&(a=.25*t.c*e.Q/((t.aW+4)*t.flRoot));let i=0;e.C!==void 0?i=e.C/a:e.M!==void 0?i=e.M/t.flRoot/a:e.s!==void 0&&(i=4e-4*e.s**2*(t.aW+4)/t.c);let s=G(i*Math.pow(1.64-Math.pow(.29,t.n),-.73),10/9),l=.25*(Math.cos(r+2)+3.8),c=t.aW*G(a,2/t.c/t.z),u=5e4/13*t.nc*t.ncb*l,f=c/t.nbb,d=23*(f+.305)*ct(s,23*u+s*(11*o+108*n)),g=d*o,p=d*n,x=en(_(Vo,[f,g,p]).map(h=>h*1/1403),t.fl);return _(Zo,x.map((h,b)=>h*t.dRgbInv[b])).map(h=>h/100)}function wt(e,t){let r=e.map(w=>w*100),o=Pr(_(Er,r).map((w,S)=>w*t.dRgb[S]),t.fl),n=o[0]+(-12*o[1]+o[2])/11,a=(o[0]+o[1]-2*o[2])/9,i=(Math.atan2(a,n)%yt+yt)%yt,s=.25*(Math.cos(i+2)+3.8),l=5e4/13*t.nc*t.ncb*ct(s*Math.sqrt(n**2+a**2),o[0]+o[1]+1.05*o[2]+.305),c=G(l,.9)*Math.pow(1.64-Math.pow(.29,t.n),.73),u=t.nbb*(2*o[0]+o[1]+.05*o[2]),f=G(u/t.aW,.5*t.c*t.z),d=100*G(f,2),g=4/t.c*f*(t.aW+4)*t.flRoot,p=c*f,x=p*t.flRoot,h=R(i*Qo),b=tn(h),y=50*G(t.c*c/(t.aW+4),1/2);return{J:d,C:p,h,s:y,Q:g,M:x,H:b}}var Es=new m({id:"cam16-jmh",cssId:"--cam16-jmh",name:"CAM16-JMh",coords:{j:{refRange:[0,100],name:"J"},m:{refRange:[0,105],name:"Colorfulness"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:$,fromBase(e){let t=wt(e,Nr);return[t.J,t.M,t.h]},toBase(e){return Ve({J:e[0],M:e[1],h:e[2]},Nr)}});var on=j.D65,nn=216/24389,Hr=24389/27;function an(e){return 116*(e>nn?Math.cbrt(e):(Hr*e+16)/116)-16}function Ct(e){return e>8?Math.pow((e+16)/116,3):e/Hr}function sn(e,t){let[r,o,n]=e,a=[],i=0;if(n===0)return[0,0,0];let s=Ct(n);n>0?i=.00379058511492914*n**2+.608983189401032*n+.9155088574762233:i=9514440756550361e-21*n**2+.08693057439788597*n-21.928975842194614;let l=2e-12,c=15,u=0,f=1/0,d=i;for(;u<=c;){a=Ve({J:i,C:o,h:r},t);let g=Math.abs(a[1]-s);if(g | "," | "," | "]}}});var Ts=180/Math.PI,un=Math.PI/180,zr=[1,.007,.0228];function $r(e){e[1]<0&&(e=Ee.fromBase(Ee.toBase(e)));let t=Math.log(Math.max(1+zr[2]*e[1]*Le.flRoot,1))/zr[2],r=e[0]*un,o=t*Math.cos(r),n=t*Math.sin(r);return[e[2],o,n]}function Ir(e,t){[e,t]=M([e,t]);let[r,o,n]=$r(Ee.from(e)),[a,i,s]=$r(Ee.from(t));return Math.sqrt((r-a)**2+(o-i)**2+(n-s)**2)}var Mt={deltaE76:ht,deltaECMC:cr,deltaE2000:Je,deltaEJz:br,deltaEITP:kr,deltaEOK:Ne,deltaEHCT:Ir};function cn(e){let t=e?Math.floor(Math.log10(Math.abs(e))):0;return Math.max(parseFloat(`1e${t-2}`),1e-6)}var Or={hct:{method:"hct.c",jnd:2,deltaEMethod:"hct",blackWhiteClamp:{}},"hct-tonal":{method:"hct.c",jnd:0,deltaEMethod:"hct",blackWhiteClamp:{channel:"hct.t",min:0,max:100}}};function re(e,{method:t=Z.gamut_mapping,space:r=void 0,deltaEMethod:o="",jnd:n=2,blackWhiteClamp:a={}}={}){if(e=M(e),qe(arguments[1])?r=arguments[1]:r||(r=e.space),r=m.get(r),V(e,r,{epsilon:0}))return e;let i;if(t==="css")i=fn(e,{space:r});else{if(t!=="clip"&&!V(e,r)){Object.prototype.hasOwnProperty.call(Or,t)&&({method:t,jnd:n,deltaEMethod:o,blackWhiteClamp:a}=Or[t]);let s=Je;if(o!==""){for(let c in Mt)if("deltae"+o.toLowerCase()===c.toLowerCase()){s=Mt[c];break}}let l=re(N(e,r),{method:"clip",space:r});if(s(e,l)>n){if(Object.keys(a).length===3){let y=m.resolveCoord(a.channel),w=ee(N(e,y.space),y.id);if(Ae(w)&&(w=0),w>=a.max)return N({space:"xyz-d65",coords:j.D65},e.space);if(w<=a.min)return N({space:"xyz-d65",coords:[0,0,0]},e.space)}let c=m.resolveCoord(t),u=c.space,f=c.id,d=N(e,u);d.coords.forEach((y,w)=>{Ae(y)&&(d.coords[w]=0)});let p=(c.range||c.refRange)[0],x=cn(n),h=p,b=ee(d,f);for(;b-h>x;){let y=ye(d);y=re(y,{space:r,method:"clip"}),s(d,y)-nl.range||[]);i.coords=i.coords.map((l,c)=>{let[u,f]=s[c];return u!==void 0&&(l=Math.max(u,l)),f!==void 0&&(l=Math.min(l,f)),l})}}return r!==e.space&&(i=N(i,e.space)),e.coords=i.coords,e}re.returns="color";var jr={WHITE:{space:te,coords:[1,0,0]},BLACK:{space:te,coords:[0,0,0]}};function fn(e,{space:t}={}){e=M(e),t||(t=e.space),t=m.get(t);let n=m.get("oklch");if(t.isUnbounded)return N(e,t);let a=N(e,n),i=a.coords[0];if(i>=1){let p=N(jr.WHITE,t);return p.alpha=e.alpha,N(p,t)}if(i<=0){let p=N(jr.BLACK,t);return p.alpha=e.alpha,N(p,t)}if(V(a,t,{epsilon:0}))return N(a,t);function s(p){let x=N(p,t),h=Object.values(t.coords);return x.coords=x.coords.map((b,y)=>{if("range"in h[y]){let[w,S]=h[y].range;return er(w,b,S)}return b}),x}let l=0,c=a.coords[1],u=!0,f=ye(a),d=s(f),g=Ne(d,f);if(g<.02)return d;for(;c-l>1e-4;){let p=(l+c)/2;if(f.coords[1]=p,u&&V(f,t,{epsilon:0}))l=p;else if(d=s(f),g=Ne(d,f),g<.02){if(.02-g<1e-4)break;u=!1,l=p}else c=p}return d}function N(e,t,{inGamut:r}={}){e=M(e),t=m.get(t);let o=t.from(e),n={space:t,coords:o,alpha:e.alpha};return r&&(n=re(n,r===!0?void 0:r)),n}N.returns="color";function oe(e,{precision:t=Z.precision,format:r="default",inGamut:o=!0,...n}={}){let a;e=M(e);let i=r;r=e.space.getFormat(r)??e.space.getFormat("default")??m.DEFAULT_FORMAT;let s=e.coords.slice();if(o||(o=r.toGamut),o&&!V(e)&&(s=re(ye(e),o===!0?void 0:o).coords),r.type==="custom")if(n.precision=t,r.serialize)a=r.serialize(s,e.alpha,n);else throw new TypeError(`format ${i} can only be used to parse colors, not for serialization`);else{let l=r.name||"color";r.serializeCoords?s=r.serializeCoords(s,t):t!==null&&(s=s.map(d=>ke(d,{precision:t})));let c=[...s];if(l==="color"){let d=r.id||r.ids?.[0]||e.space.id;c.unshift(d)}let u=e.alpha;t!==null&&(u=ke(u,{precision:t}));let f=e.alpha>=1||r.noAlpha?"":`${r.commas?",":" /"} ${u}`;a=`${l}(${c.join(r.commas?", ":" ")}${f})`}return a}var dn=[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],mn=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]],Rr=new me({id:"srgb-linear",name:"Linear sRGB",white:"D65",toXYZ_M:dn,fromXYZ_M:mn});var kt={aliceblue:[240/255,248/255,1],antiquewhite:[250/255,235/255,215/255],aqua:[0,1,1],aquamarine:[127/255,1,212/255],azure:[240/255,1,1],beige:[245/255,245/255,220/255],bisque:[1,228/255,196/255],black:[0,0,0],blanchedalmond:[1,235/255,205/255],blue:[0,0,1],blueviolet:[138/255,43/255,226/255],brown:[165/255,42/255,42/255],burlywood:[222/255,184/255,135/255],cadetblue:[95/255,158/255,160/255],chartreuse:[127/255,1,0],chocolate:[210/255,105/255,30/255],coral:[1,127/255,80/255],cornflowerblue:[100/255,149/255,237/255],cornsilk:[1,248/255,220/255],crimson:[220/255,20/255,60/255],cyan:[0,1,1],darkblue:[0,0,139/255],darkcyan:[0,139/255,139/255],darkgoldenrod:[184/255,134/255,11/255],darkgray:[169/255,169/255,169/255],darkgreen:[0,100/255,0],darkgrey:[169/255,169/255,169/255],darkkhaki:[189/255,183/255,107/255],darkmagenta:[139/255,0,139/255],darkolivegreen:[85/255,107/255,47/255],darkorange:[1,140/255,0],darkorchid:[153/255,50/255,204/255],darkred:[139/255,0,0],darksalmon:[233/255,150/255,122/255],darkseagreen:[143/255,188/255,143/255],darkslateblue:[72/255,61/255,139/255],darkslategray:[47/255,79/255,79/255],darkslategrey:[47/255,79/255,79/255],darkturquoise:[0,206/255,209/255],darkviolet:[148/255,0,211/255],deeppink:[1,20/255,147/255],deepskyblue:[0,191/255,1],dimgray:[105/255,105/255,105/255],dimgrey:[105/255,105/255,105/255],dodgerblue:[30/255,144/255,1],firebrick:[178/255,34/255,34/255],floralwhite:[1,250/255,240/255],forestgreen:[34/255,139/255,34/255],fuchsia:[1,0,1],gainsboro:[220/255,220/255,220/255],ghostwhite:[248/255,248/255,1],gold:[1,215/255,0],goldenrod:[218/255,165/255,32/255],gray:[128/255,128/255,128/255],green:[0,128/255,0],greenyellow:[173/255,1,47/255],grey:[128/255,128/255,128/255],honeydew:[240/255,1,240/255],hotpink:[1,105/255,180/255],indianred:[205/255,92/255,92/255],indigo:[75/255,0,130/255],ivory:[1,1,240/255],khaki:[240/255,230/255,140/255],lavender:[230/255,230/255,250/255],lavenderblush:[1,240/255,245/255],lawngreen:[124/255,252/255,0],lemonchiffon:[1,250/255,205/255],lightblue:[173/255,216/255,230/255],lightcoral:[240/255,128/255,128/255],lightcyan:[224/255,1,1],lightgoldenrodyellow:[250/255,250/255,210/255],lightgray:[211/255,211/255,211/255],lightgreen:[144/255,238/255,144/255],lightgrey:[211/255,211/255,211/255],lightpink:[1,182/255,193/255],lightsalmon:[1,160/255,122/255],lightseagreen:[32/255,178/255,170/255],lightskyblue:[135/255,206/255,250/255],lightslategray:[119/255,136/255,153/255],lightslategrey:[119/255,136/255,153/255],lightsteelblue:[176/255,196/255,222/255],lightyellow:[1,1,224/255],lime:[0,1,0],limegreen:[50/255,205/255,50/255],linen:[250/255,240/255,230/255],magenta:[1,0,1],maroon:[128/255,0,0],mediumaquamarine:[102/255,205/255,170/255],mediumblue:[0,0,205/255],mediumorchid:[186/255,85/255,211/255],mediumpurple:[147/255,112/255,219/255],mediumseagreen:[60/255,179/255,113/255],mediumslateblue:[123/255,104/255,238/255],mediumspringgreen:[0,250/255,154/255],mediumturquoise:[72/255,209/255,204/255],mediumvioletred:[199/255,21/255,133/255],midnightblue:[25/255,25/255,112/255],mintcream:[245/255,1,250/255],mistyrose:[1,228/255,225/255],moccasin:[1,228/255,181/255],navajowhite:[1,222/255,173/255],navy:[0,0,128/255],oldlace:[253/255,245/255,230/255],olive:[128/255,128/255,0],olivedrab:[107/255,142/255,35/255],orange:[1,165/255,0],orangered:[1,69/255,0],orchid:[218/255,112/255,214/255],palegoldenrod:[238/255,232/255,170/255],palegreen:[152/255,251/255,152/255],paleturquoise:[175/255,238/255,238/255],palevioletred:[219/255,112/255,147/255],papayawhip:[1,239/255,213/255],peachpuff:[1,218/255,185/255],peru:[205/255,133/255,63/255],pink:[1,192/255,203/255],plum:[221/255,160/255,221/255],powderblue:[176/255,224/255,230/255],purple:[128/255,0,128/255],rebeccapurple:[102/255,51/255,153/255],red:[1,0,0],rosybrown:[188/255,143/255,143/255],royalblue:[65/255,105/255,225/255],saddlebrown:[139/255,69/255,19/255],salmon:[250/255,128/255,114/255],sandybrown:[244/255,164/255,96/255],seagreen:[46/255,139/255,87/255],seashell:[1,245/255,238/255],sienna:[160/255,82/255,45/255],silver:[192/255,192/255,192/255],skyblue:[135/255,206/255,235/255],slateblue:[106/255,90/255,205/255],slategray:[112/255,128/255,144/255],slategrey:[112/255,128/255,144/255],snow:[1,250/255,250/255],springgreen:[0,1,127/255],steelblue:[70/255,130/255,180/255],tan:[210/255,180/255,140/255],teal:[0,128/255,128/255],thistle:[216/255,191/255,216/255],tomato:[1,99/255,71/255],turquoise:[64/255,224/255,208/255],violet:[238/255,130/255,238/255],wheat:[245/255,222/255,179/255],white:[1,1,1],whitesmoke:[245/255,245/255,245/255],yellow:[1,1,0],yellowgreen:[154/255,205/255,50/255]};var qr=Array(3).fill(" | [0, 255]"),Ar=Array(3).fill("[0, 255]"),ne=new me({id:"srgb",name:"sRGB",base:Rr,fromBase:e=>e.map(t=>{let r=t<0?-1:1,o=t*r;return o>.0031308?r*(1.055*o**(1/2.4)-.055):12.92*t}),toBase:e=>e.map(t=>{let r=t<0?-1:1,o=t*r;return o<=.04045?t/12.92:r*((o+.055)/1.055)**2.4}),formats:{rgb:{coords:qr},rgb_number:{name:"rgb",commas:!0,coords:Ar,noAlpha:!0},color:{},rgba:{coords:qr,commas:!0,lastAlpha:!0},rgba_number:{name:"rgba",commas:!0,coords:Ar},hex:{type:"custom",toGamut:!0,test:e=>/^#([a-f0-9]{3,4}){1,2}$/i.test(e),parse(e){e.length<=5&&(e=e.replace(/[a-f0-9]/gi,"$&$&"));let t=[];return e.replace(/[a-f0-9]{2}/gi,r=>{t.push(parseInt(r,16)/255)}),{spaceId:"srgb",coords:t.slice(0,3),alpha:t.slice(3)[0]}},serialize:(e,t,{collapse:r=!0}={})=>{t<1&&e.push(t),e=e.map(a=>Math.round(a*255));let o=r&&e.every(a=>a%17===0);return"#"+e.map(a=>o?(a/17).toString(16):a.toString(16).padStart(2,"0")).join("")}},keyword:{type:"custom",test:e=>/^[a-z]+$/i.test(e),parse(e){e=e.toLowerCase();let t={spaceId:"srgb",coords:null,alpha:1};if(e==="transparent"?(t.coords=kt.black,t.alpha=0):t.coords=kt[e],t.coords)return t}}}});var Pe=new m({id:"hsl",name:"HSL",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:ne,fromBase:e=>{let t=Math.max(...e),r=Math.min(...e),[o,n,a]=e,[i,s,l]=[NaN,0,(r+t)/2],c=t-r;if(c!==0){switch(s=l===0||l===1?0:(t-l)/Math.min(l,1-l),t){case o:i=(n-a)/c+(n=360&&(i-=360),[i,s*100,l*100]},toBase:e=>{let[t,r,o]=e;t=t%360,t<0&&(t+=360),r/=100,o/=100;function n(a){let i=(a+t/30)%12,s=r*Math.min(o,1-o);return o-s*Math.max(-1,Math.min(i-3,9-i,1))}return[n(0),n(8),n(4)]},formats:{hsl:{coords:[" | ","",""]},hsla:{coords:[" | ","",""],commas:!0,lastAlpha:!0}}});var Ue=new m({id:"oklch",name:"Oklch",coords:{l:{refRange:[0,1],name:"Lightness"},c:{refRange:[0,.4],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},white:"D65",base:te,fromBase(e){let[t,r,o]=e,n,a=2e-4;return Math.abs(r) | "," | [0,1]"," | "]}}});m.register(ne);m.register(Ue);m.register(Pe);function _t(e,t,r){if((t==="hex"||t==="oklch")&&typeof e=="object"&&e!==null&&(e=e.toString(),e==="[object Object]"))return{};if(!e||Array.isArray(e)&&e.length===0||typeof e=="object"&&Object.keys(e).length===0)return{};if(t==="all"){let o=e?.hex;if(!o)return{};let n=J(o),a=Et(n);return{...e,lightness:a}}return t==="coords"?e?.l===void 0||e?.c===void 0||e?.h===void 0?{}:Tr(`oklch(${e.l} ${e.c} ${e.h})`,r):t==="hex"?Qe(e,r):t==="oklch"?Tr(e,r):{}}function Tr(e,t){let r=J(e),o=Et(r),n=N(r,ne);return{hex:oe(n,{format:"hex"}),oklch:oe(r,{precision:t}),coords:Br(r,t),lightness:o}}function Nt(e,t){let r=J(e),o=N(r,Pe);return o.coords[2]=t,oe(N(o,ne),{format:"hex"})}function Lt(e,t){let r=J(e);r.coords[0]=t/100;let o=N(r,ne);return oe(o,{format:"hex"})}function Qe(e,t){let r=J(e),o=Et(r),n=N(r,Ue);return{hex:e,oklch:oe(n,{precision:t}),coords:Br(n,t),lightness:o}}function Et(e){let{coords:t}=N(e,Pe);return Math.round(t[2])}function Br(e,t=5){let{coords:r}=e,o=t>3?t-3:0;return{l:St(r[0],t),c:St(r[1],t),h:St(r[2],o)}}function St(e,t=void 0){if(e=e||0,!t)return e;let r=Math.pow(10,t);return Math.round(e*r)/r}var et=H(X());var Pt={};Object.defineProperty(Pt,"__esModule",{value:!0});var Ht=Pt.styleq=void 0,pn=new WeakMap,hn="$$css";function Dr(e){var t,r,o;return e!=null&&(t=e.disableCache===!0,r=e.disableMix===!0,o=e.transform),function(){for(var a=[],i="",s=null,l=t?null:pn,c=new Array(arguments.length),u=0;u0;){var f=c.pop();if(!(f==null||f===!1)){if(Array.isArray(f)){for(var d=0;dnew Error(`'stylex.${e}' should never be called at runtime. It should be compiled away by '@stylexjs/babel-plugin'`),q=e=>he(`types.${e}`);function L(){let e=this;for(var t=arguments.length,r=new Array(t),o=0;o0&&(i.style=a),i}function gn(){let{className:e,style:t}=L(...arguments),r={};return e!=null&&e!==""&&(r.class=e),t!=null&&Object.keys(t).length>0&&(r.style=Object.keys(t).map(o=>`${o}:${t[o]};`).join("")),r}function xn(e){if(I.create!=null){let t=I.create;return t(e)}throw he("create")}function bn(e){if(I.defineVars)return I.defineVars(e);throw he("defineVars")}var yn=(e,t)=>{if(I.createTheme)return I.createTheme(e,t);throw he("createTheme")},vn=e=>{if(I.include)return I.include(e);throw he("include")},wn=xn,Cn=bn,Mn=yn,kn=vn,Sn={angle:e=>{throw q("angle")},color:e=>{throw q("color")},url:e=>{throw q("url")},image:e=>{throw q("image")},integer:e=>{throw q("integer")},lengthPercentage:e=>{throw q("lengthPercentage")},length:e=>{throw q("length")},percentage:e=>{throw q("percentage")},number:e=>{throw q("number")},resolution:e=>{throw q("resolution")},time:e=>{throw q("time")},transformFunction:e=>{throw q("transformFunction")},transformList:e=>{throw q("transformList")}},_n=e=>{if(I.keyframes)return I.keyframes(e);throw he("keyframes")},Nn=function(){if(I.firstThatWorks)return I.firstThatWorks(...arguments);throw he("firstThatWorks")};function U(){for(var e=arguments.length,t=new Array(e),r=0;r{i(e)},[e]);function c(g){t(g?.currentTarget?.valueAsNumber)}let u=g=>g.toString().length,d=`calc(${Math.max(u(s),u(l))+"ch"} + 2rem)`;return K.default.createElement("div",{...L(Gr.wrapper,o&&Gr.disabled)},K.default.createElement("div",{className:"x78zum5 x1qughib x188dswm"},K.default.createElement("label",{htmlFor:n,className:"x87ps6o x1ypdohk xiq9r4"},r),K.default.createElement("input",{className:"x1lo5vof xdneb0g xjohyra x1hr2gdg x1awj2ng x1sirlc8 x1wty727 x11g6tue x1a2a7pz x1i1gfen x9pjoqp xtilpmw x1yrzqix xo6swyp xpf6v1x x1agkqgv",style:{minWidth:d},min:s,max:l,type:"number",value:Math.round(a),onChange:c,id:n,inputMode:"numeric"})),K.default.createElement("input",{className:"xh8yej3 x1wyezfn xjyslct xjohyra x1wty727 x1a2a7pz x1qjns4s xibs45w x8cq3ga x1kthjsd xu2yhzc x1p6diu8 x1iqn34f xcvrw5r x1c6sthy x1butzbu x1tx7z28 xbepbgz xnwzpgn xd8b9pn x1tk0e90 x1xk2y70 x13fi9fm x4wtp0 x66xn83 x1w3w5 x1qquo6a xovb9ml x1wwh93d x1l5f1bp x55q4sf x16hwx1y x3jfnhq xsahp4b x1272q6d xuyzg6f xoo02y2",type:"range",min:s,max:l,step:"1",value:Math.round(a),onChange:c}))}var F=H(X());var v=H(X(),1);function ve(){return(ve=Object.assign||function(e){for(var t=1;t=0||(n[r]=e[r]);return n}function Ie(e){var t=(0,v.useRef)(e),r=(0,v.useRef)(function(o){t.current&&t.current(o)});return t.current=e,r.current}var Oe=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=1),e>r?r:e0:h.buttons>0)&&n.current?a(Jr(n.current,h,s.current)):x(!1)},p=function(){return x(!1)};function x(h){var b=l.current,y=zt(n.current),w=h?y.addEventListener:y.removeEventListener;w(b?"touchmove":"mousemove",g),w(b?"touchend":"mouseup",p)}return[function(h){var b=h.nativeEvent,y=n.current;if(y&&(Kr(b),!function(S,E){return E&&!$e(S)}(b,l.current)&&y)){if($e(b)){l.current=!0;var w=b.changedTouches||[];w.length&&(s.current=w[0].identifier)}y.focus(),a(Jr(y,b,s.current)),x(!0)}},function(h){var b=h.which||h.keyCode;b<37||b>40||(h.preventDefault(),i({left:b===39?.05:b===37?-.05:0,top:b===40?.05:b===38?-.05:0}))},x]},[i,a]),u=c[0],f=c[1],d=c[2];return(0,v.useEffect)(function(){return d},[d]),v.default.createElement("div",ve({},o,{onTouchStart:u,onMouseDown:u,className:"react-colorful__interactive",ref:n,onKeyDown:f,tabIndex:0,role:"slider"}))}),Ot=function(e){return e.filter(Boolean).join(" ")},Vr=function(e){var t=e.color,r=e.left,o=e.top,n=o===void 0?.5:o,a=Ot(["react-colorful__pointer",e.className]);return v.default.createElement("div",{className:a,style:{top:100*n+"%",left:100*r+"%"}},v.default.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},P=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=Math.pow(10,t)),Math.round(r*e)/r},nu={grad:.9,turn:360,rad:360/(2*Math.PI)},En=function(e){return In($t(e))},$t=function(e){return e[0]==="#"&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?P(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?P(parseInt(e.substring(6,8),16)/255,2):1}};var Pn=function(e){return $n(zn(e))},Hn=function(e){var t=e.s,r=e.v,o=e.a,n=(200-t)*r/100;return{h:P(e.h),s:P(n>0&&n<200?t*r/100/(n<=100?n:200-n)*100:0),l:P(n/2),a:P(o,2)}},It=function(e){var t=Hn(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"};var zn=function(e){var t=e.h,r=e.s,o=e.v,n=e.a;t=t/360*6,r/=100,o/=100;var a=Math.floor(t),i=o*(1-r),s=o*(1-(t-a)*r),l=o*(1-(1-t+a)*r),c=a%6;return{r:P(255*[o,s,i,i,l,o][c]),g:P(255*[l,o,o,s,i,i][c]),b:P(255*[i,i,l,o,o,s][c]),a:P(n,2)}};var rt=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},$n=function(e){var t=e.r,r=e.g,o=e.b,n=e.a,a=n<1?rt(P(255*n)):"";return"#"+rt(t)+rt(r)+rt(o)+a},In=function(e){var t=e.r,r=e.g,o=e.b,n=e.a,a=Math.max(t,r,o),i=a-Math.min(t,r,o),s=i?a===t?(r-o)/i:a===r?2+(o-t)/i:4+(t-r)/i:0;return{h:P(60*(s<0?s+6:s)),s:P(a?i/a*100:0),v:P(a/255*100),a:n}};var On=v.default.memo(function(e){var t=e.hue,r=e.onChange,o=Ot(["react-colorful__hue",e.className]);return v.default.createElement("div",{className:o},v.default.createElement(Zr,{onMove:function(n){r({h:360*n.left})},onKey:function(n){r({h:Oe(t+360*n.left,0,360)})},"aria-label":"Hue","aria-valuenow":P(t),"aria-valuemax":"360","aria-valuemin":"0"},v.default.createElement(Vr,{className:"react-colorful__hue-pointer",left:t/360,color:It({h:t,s:100,v:100,a:1})})))}),jn=v.default.memo(function(e){var t=e.hsva,r=e.onChange,o={backgroundColor:It({h:t.h,s:100,v:100,a:1})};return v.default.createElement("div",{className:"react-colorful__saturation",style:o},v.default.createElement(Zr,{onMove:function(n){r({s:100*n.left,v:100-100*n.top})},onKey:function(n){r({s:Oe(t.s+100*n.left,0,100),v:Oe(t.v-100*n.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+P(t.s)+"%, Brightness "+P(t.v)+"%"},v.default.createElement(Vr,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:It(t)})))}),Ur=function(e,t){if(e===t)return!0;for(var r in e)if(e[r]!==t[r])return!1;return!0};var Rn=function(e,t){return e.toLowerCase()===t.toLowerCase()||Ur($t(e),$t(t))};function qn(e,t,r){var o=Ie(r),n=(0,v.useState)(function(){return e.toHsva(t)}),a=n[0],i=n[1],s=(0,v.useRef)({color:t,hsva:a});(0,v.useEffect)(function(){if(!e.equal(t,s.current.color)){var c=e.toHsva(t);s.current={hsva:c,color:t},i(c)}},[t,e]),(0,v.useEffect)(function(){var c;Ur(a,s.current.hsva)||e.equal(c=e.fromHsva(a),s.current.color)||(s.current={hsva:a,color:c},o(c))},[a,e,o]);var l=(0,v.useCallback)(function(c){i(function(u){return Object.assign({},u,c)})},[]);return[a,l]}var An,Tn=typeof window<"u"?v.useLayoutEffect:v.useEffect,Bn=function(){return An||(typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0)};var Yr=new Map,Dn=function(e){Tn(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!Yr.has(t)){var r=t.createElement("style");r.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,Yr.set(t,r);var o=Bn();o&&r.setAttribute("nonce",o),t.head.appendChild(r)}},[])},Fn=function(e){var t=e.className,r=e.colorModel,o=e.color,n=o===void 0?r.defaultColor:o,a=e.onChange,i=ot(e,["className","colorModel","color","onChange"]),s=(0,v.useRef)(null);Dn(s);var l=qn(r,n,a),c=l[0],u=l[1],f=Ot(["react-colorful",t]);return v.default.createElement("div",ve({},i,{ref:s,className:f}),v.default.createElement(jn,{hsva:c,onChange:u}),v.default.createElement(On,{hue:c.h,onChange:u,className:"react-colorful__last-control"}))},Wn={defaultColor:"000",toHsva:En,fromHsva:function(e){return Pn({h:e.h,s:e.s,v:e.v,a:1})},equal:Rn},Qr=function(e){return v.default.createElement(Fn,ve({},e,{colorModel:Wn}))};var Gn=/^#?([0-9A-F]{3,8})$/i,Jn=function(e){var t=e.color,r=t===void 0?"":t,o=e.onChange,n=e.onBlur,a=e.escape,i=e.validate,s=e.format,l=e.process,c=ot(e,["color","onChange","onBlur","escape","validate","format","process"]),u=(0,v.useState)(function(){return a(r)}),f=u[0],d=u[1],g=Ie(o),p=Ie(n),x=(0,v.useCallback)(function(b){var y=a(b.target.value);d(y),i(y)&&g(l?l(y):y)},[a,l,i,g]),h=(0,v.useCallback)(function(b){i(b.target.value)||d(a(r)),p(b)},[r,a,i,p]);return(0,v.useEffect)(function(){d(a(r))},[r,a]),v.default.createElement("input",ve({},c,{value:s?s(f):f,spellCheck:"false",onChange:x,onBlur:h}))},Xr=function(e){return"#"+e},eo=function(e){var t=e.prefixed,r=e.alpha,o=ot(e,["prefixed","alpha"]),n=(0,v.useCallback)(function(i){return i.replace(/([^0-9A-F]+)/gi,"").substring(0,r?8:6)},[r]),a=(0,v.useCallback)(function(i){return function(s,l){var c=Gn.exec(s),u=c?c[1].length:0;return u===3||u===6||!!l&&u===4||!!l&&u===8}(i,r)},[r]);return v.default.createElement(Jn,ve({},o,{escape:n,format:t?Xr:void 0,process:Xr,validate:a}))};var at=H(jt());var nt={highlight:{borderRadius:"xjohyra",borderStartStartRadius:null,borderStartEndRadius:null,borderEndStartRadius:null,borderEndEndRadius:null,borderTopLeftRadius:null,borderTopRightRadius:null,borderBottomLeftRadius:null,borderBottomRightRadius:null,boxShadow:"x11mstge",$$css:!0},colorPreview:e=>[{borderRadius:"xjohyra",borderStartStartRadius:null,borderStartEndRadius:null,borderEndStartRadius:null,borderEndEndRadius:null,borderTopLeftRadius:null,borderTopRightRadius:null,borderBottomLeftRadius:null,borderBottomRightRadius:null,height:"x1hhc0k",minWidth:"x15g7okx",flexBasis:null,flex:"x98rzlu",flexGrow:null,flexShrink:null,backgroundColor:"xq1mx2j",backgroundSize:"xx8ilsi",backgroundImage:"x1g0zcm7",$$css:!0},{"--backgroundColor":(e||ae.contrastNeutral)!=null?e||ae.contrastNeutral:"initial","--backgroundSize":(e?null:"16px 16px")??"initial","--backgroundImage":(e?null:ae.checkerboard)!=null?e?null:ae.checkerboard:"initial"}],colorPicker:{width:"xh8yej3",height:"xt7dq6l",aspectRatio:"x1plog1",marginTop:"xlt0ddm",":where(*) > :first-child_borderTopLeftRadius":"xf5yl2k",":where(*) > :first-child_borderTopRightRadius":"x9av0op",":where(*) > :last-child_borderBottomLeftRadius":"xdosjj7",":where(*) > :last-child_borderBottomRightRadius":"xkmff00",":where(*) .react-colorful__pointer_height":"xbq8i1p",":where(*) .react-colorful__pointer_width":"x19mnrqj",":where(*) .react-colorful__pointer_backgroundColor":"x13bp1ud",":where(*) .react-colorful__pointer_borderColor":"x1th5coa",":where(*) .react-colorful__pointer_transition":"x1lptuiq",":where(*) .react-colorful__pointer:hover_backgroundColor":"x4hip2o",":where(*) .react-colorful__pointer:hover_borderColor":"xfbmp4j",":where(*) .react-colorful__pointer:hover_cursor":"x2lqnu4",":where(*) .react-colorful__pointer:active_transform":"xmxw2tw",":where(*) .react-colorful__pointer:active_cursor":"x46gmau",$$css:!0},colorPickerCollapsed:{marginTop:"x16i8m89",$$css:!0}};function Rt({allowEmpty:e,precision:t,presets:r,showHexInput:o,showLightness:n,showLuminance:a,showPicker:i,showPresets:s,i18nRegistry:l,highlight:c,state:u,setState:f,id:d,onFocus:g=()=>{},collapsed:p}){function x(w){f(Qe(w,t))}function h(w){x(Nt(u?.hex,w))}function b(w){x(Lt(u?.oklch,w))}let y=s&&r&&Object.entries(r).map(([w,S])=>({value:S,label:w})).filter(w=>!!w.value);return F.default.createElement(F.default.Fragment,null,!!i&&F.default.createElement(Qr,{...L(nt.colorPicker,p&&nt.colorPickerCollapsed),color:u?.hex,onChange:x}),!!n&&F.default.createElement(ze,{disabled:!u?.hex,value:u?.lightness||0,onChange:h,label:l.translate("Carbon.ColorPicker.OKLCH:Main:lightness"),id:`${d}-lightness`}),!!a&&F.default.createElement(ze,{disabled:!u?.coords?.l,value:u?.coords?.l*100||0,onChange:b,label:l.translate("Carbon.ColorPicker.OKLCH:Main:luminance"),id:`${d}-luminance`}),(p?!!o:!0)&&F.default.createElement("div",{className:"x78zum5 x188dswm"},!!p||F.default.createElement("div",{...L(nt.colorPreview(u?.oklch),c&&nt.highlight)}),!!o&&F.default.createElement(eo,{className:"x1iyjqo2 x1hhc0k xh8yej3 xjohyra x1wty727 x1qjns4s xtqyqw7 x1awj2ng x1a2a7pz x1agkqgv xtw1abo x1sirlc8",title:l.translate("Carbon.ColorPicker.OKLCH:Main:setHexColor"),color:u?.hex,onChange:x,prefixed:!1,id:d,onFocus:()=>g()}),!p&&!!e&&F.default.createElement(at.IconButton,{style:"light",icon:"times",title:l.translate("Carbon.ColorPicker.OKLCH:Main:resetColor"),onClick:()=>{f(null)}})),!!y&&F.default.createElement(at.SelectBox,{options:y,value:u?.hex,placeholder:l.translate("Carbon.ColorPicker.OKLCH:Main:preset"),allowEmpty:!1,onValueChange:x,ListPreviewElement:tt}))}var qt=Rt;var ge=H(jt()),fo=H(oo());var no=H(X());function At({hex:e}){return e?no.default.createElement("span",{className:"x1sirlc8"},e):""}var ie=H(X());var Q=H(X());function ao({style:e,className:t,size:r=30}){return Q.default.createElement("svg",{width:r,height:r,stroke:"currentColor",viewBox:"0 0 24 24",style:e,className:t},Q.default.createElement("g",null,Q.default.createElement("circle",{cx:"12",cy:"12",r:"9.5",fill:"none","stroke-width":"2","stroke-linecap":"round"},[{attribute:"dasharray",values:"0 150;42 150;42 150;42 150"},{attribute:"dashoffset",values:"0;-16;-59;-59"}].map(({attribute:o,values:n})=>Q.default.createElement("animate",{key:o,attributeName:`stroke-${o}`,values:n,dur:"1.5s",calcMode:"spline",keyTimes:"0;0.475;0.95;1",keySplines:"0.42,0,0.58,1;0.42,0,0.58,1;0.42,0,0.58,1",repeatCount:"indefinite"}))),Q.default.createElement("animateTransform",{attributeName:"transform",type:"rotate",dur:"2s",values:"0 12 12;360 12 12",repeatCount:"indefinite"})))}function io({style:e,className:t,size:r=30}){return Q.default.createElement("svg",{width:r*2,height:r,viewBox:"0 0 24 12",class:t,style:e},[1,2,3].map(o=>{let n=o*6,a=Math.round(100/3*(o-1))/100;return Q.default.createElement("circle",{cx:n,cy:"6",r:"0",fill:"currentColor"},Q.default.createElement("animate",{attributeName:"r",begin:a,calcMode:"spline",dur:"1.5s",keySplines:"0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8;0.2 0.2 0.4 0.8",repeatCount:"indefinite",values:"0;2;0;0"}))}))}var so=H(lt());var Tt={container:e=>[{display:"xrvj5dj",gridTemplate:"xd3rg8h",gridTemplateAreas:null,gridTemplateColumns:null,gridTemplateRows:null,alignItems:"x6s0dn4",justifyItems:"x1o2pa38",width:"xh8yej3",minHeight:"x1gu4hsp",$$css:!0},{"--minHeight":(t=>typeof t=="number"?t+"px":t??"initial")(`calc(var(--spacing-GoldenUnit) * ${e})`)}],item:e=>[{gridArea:"x1fdo2jl",gridRow:null,gridRowStart:null,gridRowEnd:null,gridColumn:null,gridColumnStart:null,gridColumnEnd:null,transition:"xc8avi6",transitionBehavior:null,transitionDelay:null,transitionDuration:null,transitionProperty:null,transitionTimingFunction:null,opacity:"x1u4uod0",transform:"x1v0jg1i",$$css:!0},{"--opacity":(e?1:0)??"initial","--transform":`scale(${e?1:0})`!=null?`scale(${e?1:0})`:"initial"}]};function Kn({id:e,title:t="Neos.Neos:Main:loading",isLoading:r=!1,delayTime:o=500,timeoutTime:n=5e3,i18nRegistry:a,heightMultiplier:i=1}){let[s,l]=(0,ie.useState)(0),c=t?a.translate(t):null;return(0,ie.useEffect)(()=>{if(!r){l(0);return}let u=setTimeout(()=>{l(1)},o),f=setTimeout(()=>{l(2)},o+n);return()=>{clearTimeout(u),clearTimeout(f)}},[r]),r?ie.default.createElement("div",{id:e,title:c,...L(Tt.container(i))},ie.default.createElement(ao,{...L(Tt.item(s==1))}),ie.default.createElement(io,{...L(Tt.item(s==2))})):null}var Yn=(0,so.neos)(e=>({i18nRegistry:e.get("i18n")})),lo=Yn(Kn);var Xn=e=>({contextNodePath:e.focusedNodePath,dataSourceIdentifier:e.options.dataSourceIdentifier,dataSourceUri:e.options.dataSourceUri,dataSourceAdditionalData:e.options.dataSourceAdditionalData,dataSourceDisableCaching:!!e.options.dataSourceDisableCaching}),Zn=(0,C.lazy)(()=>import("./ColorName.js")),Vn={mode:"all",customPropertyName:"color",hidden:!1,disabled:!1,allowEmpty:!0,showPresets:!0,showPicker:!0,showHexInput:!0,showLightness:!1,showLuminance:!1,hasOwnLabel:!1,contrastThreshold:.6,precision:5,presets:{}},se={disabled:{cursor:"x1h6gzvc",opacity:"x190dgpg",":where(*) *_pointerEvents":"x1g8rrie",$$css:!0},highlight:{borderRadius:"xjohyra",boxShadow:"x11mstge",$$css:!0},wrapper:{display:"x78zum5",flexDirection:"xdt5ytf",gap:"x188dswm",$$css:!0},popoverButton:{display:"x78zum5",alignItems:"x6s0dn4",justifyContent:"x1szn6h9",borderWidth:"xc342km",padding:"x1717udv",minHeight:"x1rhtz0q",borderRadius:"xjohyra",cursor:"x1ypdohk",background:"x11g6tue",backgroundColor:"x1qjns4s",$$css:!0},popoverButtonPreview:(e,t,r)=>[{flex:"x98rzlu",flexGrow:null,flexShrink:null,flexBasis:null,display:"x78zum5",alignItems:"x6s0dn4",justifyContent:"x1nhvcw1",textAlign:"xdpxx8g",minHeight:"x1rhtz0q",borderTopLeftRadius:"x6bjwg6",borderStartStartRadius:null,borderStartEndRadius:null,borderBottomLeftRadius:"x1trtmuu",borderEndStartRadius:null,borderEndEndRadius:null,color:"x19dipnz",backgroundColor:"xq1mx2j",backgroundSize:"xx8ilsi",backgroundImage:"x1g0zcm7",paddingInline:"xtqyqw7",paddingStart:null,paddingLeft:null,paddingEnd:null,paddingRight:null,overflow:"xb3r6kr",overflowX:null,overflowY:null,textOverflow:"xlyipyv",$$css:!0},{"--color":(t>r?"black":"white")!=null?t>r?"black":"white":"initial","--backgroundColor":(e||null)??"initial","--backgroundSize":(e?null:"16px 16px")??"initial","--backgroundImage":(e?null:ae.checkerboard)!=null?e?null:ae.checkerboard:"initial"}],popoverButtonIcon:e=>[{transform:"x1v0jg1i",transition:"xl913vs",transitionBehavior:null,transitionDelay:null,transitionDuration:null,transitionProperty:null,transitionTimingFunction:null,minWidth:"x15g7okx",$$css:!0},{"--transform":(e?"rotate(180deg)":"rotate(0deg)")??"initial"}],popoverPanel:e=>[{display:"xrvj5dj",gridTemplateRows:"xi7raoi",opacity:"x1u4uod0",transition:"x5z8be9",transitionBehavior:null,transitionDelay:null,transitionDuration:null,transitionProperty:null,transitionTimingFunction:null,$$css:!0},{"--gridTemplateRows":(e?"1fr":"0fr")??"initial","--opacity":(e?1:0)??"initial","--transition":`grid-template-rows ${D.default} ${D.timing}, opacity ${D.fast} ${D.timing} ${e?D.fast:"0s"}`!=null?`grid-template-rows ${D.default} ${D.timing}, opacity ${D.fast} ${D.timing} ${e?D.fast:"0s"}`:"initial"}],noGap:{gap:"xxhr3t",rowGap:null,columnGap:null,$$css:!0}};function Un(e){let t={...Vn,...e.config,...e.options},{value:r,commit:o,highlight:n,i18nRegistry:a,id:i,dataSourcesDataLoader:s,renderHelpIcon:l}=e,c=a.translate(e.label),{mode:u,precision:f,dataSourceIdentifier:d,dataSourceUri:g,dataSourceAdditionalData:p}=t;if(u!=="coords"&&u!=="hex"&&u!=="all"&&u!=="oklch")return C.default.createElement("div",{className:"xjohyra x1hgx17m x89w75u"},a.translate("Carbon.ColorPicker.OKLCH:Main:invalidMode","",[u]));let x=!!(d||g),[h,b]=(0,C.useState)(x?[]:t),[y,w]=(0,C.useState)(x),[S,E]=(0,C.useState)(!1),[k,W]=(0,C.useState)(_t(r,u,f)),[A,le]=(0,C.useState)(null);(0,C.useEffect)(()=>{let T=JSON.stringify({dataSourceIdentifier:d,dataSourceUri:g,dataSourceAdditionalData:p});!x||A===T||(le(T),s.resolveValue(Xn(e),r).then(je=>{w(!1),b({...t,...je})}))},[d,g,p]),(0,C.useEffect)(()=>{if(!k?.hex){if(r==""||(u==="all"||u==="coords")&&(JSON.stringify(r)=="{}"||JSON.stringify(r)=="[]"))return;o("");return}if(u==="all"){if(r.oklch!=k.oklch){let T={coords:`--${h.customPropertyName}-l:${k.coords.l};--${h.customPropertyName}-c:${k.coords.c};--${h.customPropertyName}-h:${k.coords.h};`,oklch:`--${h.customPropertyName}:${k.oklch};`,hex:`--${h.customPropertyName}:${k.hex};`};o({hex:k.hex,oklch:k.oklch,coords:k.coords,customProperty:T})}return}if(u==="coords"){JSON.stringify(r)!=JSON.stringify(k.coords)&&o(k.coords);return}r!=k[u]&&o(k[u])},[k]);let we=h.collapsed&&h.showPicker;return y?C.default.createElement(C.default.Fragment,null,C.default.createElement(ge.Label,{htmlFor:i},c," ",l()),C.default.createElement(lo,{isLoading:y,id:i,title:"Carbon.ColorPicker.OKLCH:Main:loading"})):h.hidden?null:C.default.createElement(C.default.Fragment,null,C.default.createElement(ge.Label,{htmlFor:i},c," ",l()),C.default.createElement("div",{...L(se.wrapper,h.disabled&&se.disabled,we&&se.noGap)},we?C.default.createElement(C.default.Fragment,null,C.default.createElement("button",{...L(se.popoverButton,n&&se.highlight),type:"button",title:a.translate(`Carbon.ColorPicker.OKLCH:Main:${S?"close":"open"}Panel`),onClick:()=>E(!S),"aria-expanded":S,"aria-controls":`${i}-panel`},C.default.createElement("output",{...L(se.popoverButtonPreview(k?.oklch,k?.coords?.l||0,h.contrastThreshold))},C.default.createElement(C.Suspense,{fallback:C.default.createElement(At,{hex:k?.hex})},C.default.createElement(Zn,{hex:k?.hex}))),!!h.allowEmpty&&!!k?.oklch&&C.default.createElement(ge.IconButton,{style:"light",icon:"times",title:a.translate("Carbon.ColorPicker.OKLCH:Main:resetColor"),onClick:T=>{T.stopPropagation(),W(null)}}),C.default.createElement(ge.Icon,{icon:"chevron-down",...L(se.popoverButtonIcon(S))})),C.default.createElement("div",{...L(se.popoverPanel(S)),"aria-hidden":!S,id:`${i}-panel`},C.default.createElement("div",{className:"x78zum5 xdt5ytf x188dswm xb3r6kr xlutiju x1hr3lfm"},C.default.createElement(qt,{...h,state:k,setState:W,i18nRegistry:a,id:i,onFocus:()=>E(!0),collapsed:!0})))):C.default.createElement(qt,{...h,state:k,setState:W,highlight:n,i18nRegistry:a,id:i,collapsed:!1})))}var Qn=(0,uo.neos)(e=>({i18nRegistry:e.get("i18n"),config:e.get("frontendConfiguration").get("Carbon.ColorPicker.OKLCH"),dataSourcesDataLoader:e.get("dataLoaders").get("DataSources")})),ea=(0,co.connect)(e=>({focusedNodePath:fo.selectors.CR.Nodes.focusedNodePathSelector(e)})),mo=Qn(ea(Un));Jt("Carbon.ColorPicker:OKLCH",{},e=>{e.get("inspector").get("editors").set("Carbon.ColorPicker/OKLCH",{component:mo,hasOwnLabel:!0})}); //# sourceMappingURL=Plugin.js.map diff --git a/Resources/Public/Plugin.js.map b/Resources/Public/Plugin.js.map index 62d326f..ec71243 100644 --- a/Resources/Public/Plugin.js.map +++ b/Resources/Public/Plugin.js.map @@ -1,7 +1,7 @@ { "version": 3, - "sources": ["../../node_modules/.pnpm/@neos-project+neos-ui-extensibility@8.3.11/node_modules/@neos-project/neos-ui-extensibility/src/readFromConsumerApi.ts", "../../node_modules/.pnpm/@neos-project+neos-ui-extensibility@8.3.11/node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/react/index.js", "../../node_modules/.pnpm/@neos-project+neos-ui-extensibility@8.3.11/node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-decorators/index.js", "../../node_modules/.pnpm/@neos-project+neos-ui-extensibility@8.3.11/node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/react-redux/index.js", "../../node_modules/.pnpm/@neos-project+neos-ui-extensibility@8.3.11/node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/react-ui-components/index.js", "../../node_modules/.pnpm/@neos-project+neos-ui-extensibility@8.3.11/node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-redux-store/index.js", "../../node_modules/.pnpm/@neos-project+neos-ui-extensibility@8.3.11/node_modules/@neos-project/neos-ui-extensibility/src/index.ts", "../Private/Editor/ColorPicker/index.tsx", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/multiply-matrices.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/util.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/hooks.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/adapt.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/defaults.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/parse.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/getColor.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/space.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/spaces/xyz-d65.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/rgbspace.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/getAll.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/get.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/setAll.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/set.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/spaces/xyz-d50.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/spaces/lab.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/angles.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/spaces/lch.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/deltaE/deltaE2000.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/spaces/oklab.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/deltaE/deltaEOK.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/inGamut.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/clone.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/distance.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/deltaE/deltaE76.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/deltaE/deltaECMC.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/spaces/xyz-abs-d65.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/spaces/jzazbz.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/spaces/jzczhz.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/deltaE/deltaEJz.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/spaces/ictcp.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/deltaE/deltaEITP.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/spaces/cam16.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/spaces/hct.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/deltaE/deltaEHCT.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/deltaE/index.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/toGamut.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/to.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/serialize.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/spaces/srgb-linear.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/keywords.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/spaces/srgb.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/spaces/hsl.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/spaces/oklch.js", "../Private/Editor/ColorPicker/Components/ColorConverter.ts", "../Private/Editor/ColorPicker/Components/OptionPreview.tsx", "../../node_modules/.pnpm/@stylexjs+stylex@0.8.0/node_modules/@stylexjs/stylex/lib/es/stylex.mjs", "../Private/Editor/ColorPicker/Tokens.stylex.ts", "../Private/Editor/ColorPicker/Components/RangeSlider.tsx", "../Private/Editor/ColorPicker/Components/Panel.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/hooks/useEventCallback.ts", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/utils/clamp.ts", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/common/Interactive.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/utils/format.ts", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/common/Pointer.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/utils/round.ts", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/utils/convert.ts", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/common/Hue.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/common/Saturation.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/utils/compare.ts", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/hooks/useColorManipulation.ts", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/utils/nonce.ts", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/hooks/useIsomorphicLayoutEffect.ts", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/hooks/useStyleSheet.ts", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/common/ColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/HexColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/common/Alpha.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/common/AlphaColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/HexAlphaColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/HslaColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/HslaStringColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/HslColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/HslStringColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/HsvaColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/HsvaStringColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/HsvColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/HsvStringColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/RgbaColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/RgbaStringColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/RgbColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/RgbStringColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/utils/validate.ts", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/common/ColorInput.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/HexColorInput.tsx", "../Private/Editor/ColorPicker/Components/index.ts", "../Private/Editor/ColorPicker/Components/HexOutput.tsx", "../../node_modules/.pnpm/carbon-neos-loadinganimation@1.1.0_@neos-project+neos-ui-extensibility@8.3.11/node_modules/carbon-neos-loadinganimation/src/LoadingWithStyleX.jsx", "../../node_modules/.pnpm/carbon-neos-loadinganimation@1.1.0_@neos-project+neos-ui-extensibility@8.3.11/node_modules/carbon-neos-loadinganimation/src/Elements.jsx", "../Private/Editor/manifest.ts"], - "sourcesContent": [null, null, null, null, null, null, null, "// @ts-ignore\nimport React, { useState, useEffect, MouseEvent, lazy, Suspense } from \"react\";\nimport { neos } from \"@neos-project/neos-ui-decorators\";\nimport { connect } from \"react-redux\";\nimport Panel, { setStateFromValue } from \"./Components\";\nimport { Icon, IconButton, Label } from \"@neos-project/react-ui-components\";\nimport { selectors } from \"@neos-project/neos-ui-redux-store\";\nimport * as stylex from \"@stylexjs/stylex\";\nimport \"./Tokens.stylex\";\nimport { colors, sizes, transitions } from \"./Tokens.stylex\";\nimport HexOutput from \"./Components/HexOutput\";\nimport LoadingAnimation from \"carbon-neos-loadinganimation/LoadingWithStyleX\";\nconst getDataLoaderOptionsForProps = (props: any) => ({\n contextNodePath: props.focusedNodePath,\n dataSourceIdentifier: props.options.dataSourceIdentifier,\n dataSourceUri: props.options.dataSourceUri,\n dataSourceAdditionalData: props.options.dataSourceAdditionalData,\n dataSourceDisableCaching: Boolean(props.options.dataSourceDisableCaching)\n});\nconst ColorName = lazy(() => import(\"./ColorName.js\"));\nconst defaultOptions = {\n mode: \"all\",\n customPropertyName: \"color\",\n // This option makes it possible hide the whole editor based on data source\n hidden: false,\n disabled: false,\n allowEmpty: true,\n showPresets: true,\n showPicker: true,\n showHexInput: true,\n showLightness: false,\n showLuminance: false,\n hasOwnLabel: false,\n contrastThreshold: 0.6,\n precision: 5,\n presets: {}\n};\nconst styles = {\n disabled: {\n cursor: \"x1h6gzvc\",\n opacity: \"x190dgpg\",\n \":where(*) *_pointerEvents\": \"x1g8rrie\",\n $$css: true\n },\n highlight: {\n borderRadius: \"xjohyra\",\n boxShadow: \"x11mstge\",\n $$css: true\n },\n wrapper: {\n display: \"x78zum5\",\n flexDirection: \"xdt5ytf\",\n gap: \"x188dswm\",\n $$css: true\n },\n popoverButton: {\n display: \"x78zum5\",\n alignItems: \"x6s0dn4\",\n justifyContent: \"x1szn6h9\",\n borderWidth: \"xc342km\",\n padding: \"x1717udv\",\n minHeight: \"x1rhtz0q\",\n borderRadius: \"xjohyra\",\n cursor: \"x1ypdohk\",\n background: \"x11g6tue\",\n backgroundColor: \"x1qjns4s\",\n $$css: true\n },\n popoverButtonPreview: (color, luminance, contrastThreshold) => [{\n flex: \"x98rzlu\",\n flexGrow: null,\n flexShrink: null,\n flexBasis: null,\n display: \"x78zum5\",\n alignItems: \"x6s0dn4\",\n justifyContent: \"x1nhvcw1\",\n textAlign: \"xdpxx8g\",\n minHeight: \"x1rhtz0q\",\n borderTopLeftRadius: \"x6bjwg6\",\n borderStartStartRadius: null,\n borderStartEndRadius: null,\n borderBottomLeftRadius: \"x1trtmuu\",\n borderEndStartRadius: null,\n borderEndEndRadius: null,\n color: \"x19dipnz\",\n backgroundColor: \"xq1mx2j\",\n backgroundSize: \"xx8ilsi\",\n backgroundImage: \"x1g0zcm7\",\n paddingInline: \"xtqyqw7\",\n paddingStart: null,\n paddingLeft: null,\n paddingEnd: null,\n paddingRight: null,\n overflow: \"xb3r6kr\",\n overflowX: null,\n overflowY: null,\n textOverflow: \"xlyipyv\",\n $$css: true\n }, {\n \"--color\": (luminance > contrastThreshold ? \"black\" : \"white\") != null ? luminance > contrastThreshold ? \"black\" : \"white\" : \"initial\",\n \"--backgroundColor\": (color || null) != null ? color || null : \"initial\",\n \"--backgroundSize\": (color ? null : \"16px 16px\") != null ? color ? null : \"16px 16px\" : \"initial\",\n \"--backgroundImage\": (color ? null : colors.checkerboard) != null ? color ? null : colors.checkerboard : \"initial\"\n }],\n popoverButtonIcon: open => [{\n transform: \"x1v0jg1i\",\n transition: \"xl913vs\",\n transitionBehavior: null,\n transitionDelay: null,\n transitionDuration: null,\n transitionProperty: null,\n transitionTimingFunction: null,\n minWidth: \"x15g7okx\",\n $$css: true\n }, {\n \"--transform\": (open ? \"rotate(180deg)\" : \"rotate(0deg)\") != null ? open ? \"rotate(180deg)\" : \"rotate(0deg)\" : \"initial\"\n }],\n popoverPanel: open => [{\n display: \"xrvj5dj\",\n gridTemplateRows: \"xi7raoi\",\n opacity: \"x1u4uod0\",\n transition: \"x5z8be9\",\n transitionBehavior: null,\n transitionDelay: null,\n transitionDuration: null,\n transitionProperty: null,\n transitionTimingFunction: null,\n $$css: true\n }, {\n \"--gridTemplateRows\": (open ? \"1fr\" : \"0fr\") != null ? open ? \"1fr\" : \"0fr\" : \"initial\",\n \"--opacity\": (open ? 1 : 0) != null ? open ? 1 : 0 : \"initial\",\n \"--transition\": `grid-template-rows ${transitions.default} ${transitions.timing}, opacity ${transitions.fast} ${transitions.timing} ${open ? transitions.fast : \"0s\"}` != null ? `grid-template-rows ${transitions.default} ${transitions.timing}, opacity ${transitions.fast} ${transitions.timing} ${open ? transitions.fast : \"0s\"}` : \"initial\"\n }],\n noGap: {\n gap: \"xxhr3t\",\n rowGap: null,\n columnGap: null,\n $$css: true\n }\n};\n\n// @ts-ignore\nfunction Editor(props) {\n const mergedOptions = {\n ...defaultOptions,\n ...props.config,\n ...props.options\n };\n const {\n value,\n commit,\n highlight,\n i18nRegistry,\n id,\n dataSourcesDataLoader,\n renderHelpIcon\n } = props;\n const label = i18nRegistry.translate(props.label);\n const {\n mode,\n precision,\n dataSourceIdentifier,\n dataSourceUri,\n dataSourceAdditionalData\n } = mergedOptions;\n if (mode !== \"coords\" && mode !== \"hex\" && mode !== \"all\" && mode !== \"oklch\") {\n return
\n {i18nRegistry.translate(\"Carbon.ColorPicker.OKLCH:Main:invalidMode\", \"\", [mode])}\n
;\n }\n const hasDataSource = !!(dataSourceIdentifier || dataSourceUri);\n const [options, setOptions] = useState(hasDataSource ? [] : mergedOptions);\n const [isLoading, setIsLoading] = useState(hasDataSource);\n const [open, setOpen] = useState(false);\n const [state, setState] = useState(setStateFromValue(value, mode, precision));\n\n // We use this hack to prevent the editor from re-rendering all the time, even if the options are the same.\n const [dataSourceOptionsAsJSON, setDataSourceOptionsAsJSON] = useState(null);\n useEffect(() => {\n const dataAsJSON = JSON.stringify({\n dataSourceIdentifier,\n dataSourceUri,\n dataSourceAdditionalData\n });\n if (!hasDataSource || dataSourceOptionsAsJSON === dataAsJSON) {\n return;\n }\n setDataSourceOptionsAsJSON(dataAsJSON);\n\n // Load options from data source\n dataSourcesDataLoader.resolveValue(getDataLoaderOptionsForProps(props), value).then((values: any) => {\n setIsLoading(false);\n setOptions({\n ...mergedOptions,\n ...values\n });\n });\n }, [dataSourceIdentifier, dataSourceUri, dataSourceAdditionalData]);\n useEffect(() => {\n if (!state?.hex) {\n if (value == \"\") {\n return;\n }\n\n // Make no commit if the color is empty\n if ((mode === \"all\" || mode === \"coords\") && (JSON.stringify(value) == \"{}\" || JSON.stringify(value) == \"[]\")) {\n return;\n }\n commit(\"\");\n return;\n }\n if (mode === \"all\") {\n if (value.oklch != state.oklch) {\n // create custom properties\n const customProperty = {\n coords: `--${options.customPropertyName}-l:${state.coords.l};--${options.customPropertyName}-c:${state.coords.c};--${options.customPropertyName}-h:${state.coords.h};`,\n oklch: `--${options.customPropertyName}:${state.oklch};`,\n hex: `--${options.customPropertyName}:${state.hex};`\n };\n commit({\n hex: state.hex,\n oklch: state.oklch,\n coords: state.coords,\n customProperty\n });\n }\n return;\n }\n if (mode === \"coords\") {\n if (JSON.stringify(value) != JSON.stringify(state.coords)) {\n commit(state.coords);\n }\n return;\n }\n if (value != state[mode]) {\n commit(state[mode]);\n }\n }, [state]);\n const enableCollapsed = options.collapsed && options.showPicker;\n if (isLoading) {\n return <>\n \n \n ;\n }\n if (options.hidden) {\n return null;\n }\n return <>\n \n
\n {enableCollapsed ? <>\n \n
\n
\n setOpen(true)} collapsed={true} />\n
\n
\n : }\n
\n ;\n}\nconst neosifier = neos(globalRegistry => ({\n i18nRegistry: globalRegistry.get(\"i18n\"),\n config: globalRegistry.get(\"frontendConfiguration\").get(\"Carbon.ColorPicker.OKLCH\"),\n // @ts-ignore\n dataSourcesDataLoader: globalRegistry.get(\"dataLoaders\").get(\"DataSources\")\n}));\nconst connector = connect((state: any) => ({\n // @ts-ignore\n focusedNodePath: selectors.CR.Nodes.focusedNodePathSelector(state)\n}));\nexport default neosifier(connector(Editor));", "// A is m x n. B is n x p. product is m x p.\nexport default function multiplyMatrices (A, B) {\n\tlet m = A.length;\n\n\tif (!Array.isArray(A[0])) {\n\t\t// A is vector, convert to [[a, b, c, ...]]\n\t\tA = [A];\n\t}\n\n\tif (!Array.isArray(B[0])) {\n\t\t// B is vector, convert to [[a], [b], [c], ...]]\n\t\tB = B.map(x => [x]);\n\t}\n\n\tlet p = B[0].length;\n\tlet B_cols = B[0].map((_, i) => B.map(x => x[i])); // transpose B\n\tlet product = A.map(row => B_cols.map(col => {\n\t\tlet ret = 0;\n\n\t\tif (!Array.isArray(row)) {\n\t\t\tfor (let c of col) {\n\t\t\t\tret += row * c;\n\t\t\t}\n\n\t\t\treturn ret;\n\t\t}\n\n\t\tfor (let i = 0; i < row.length; i++) {\n\t\t\tret += row[i] * (col[i] || 0);\n\t\t}\n\n\t\treturn ret;\n\t}));\n\n\tif (m === 1) {\n\t\tproduct = product[0]; // Avoid [[a, b, c, ...]]\n\t}\n\n\tif (p === 1) {\n\t\treturn product.map(x => x[0]); // Avoid [[a], [b], [c], ...]]\n\t}\n\n\treturn product;\n}\n", "/**\n * Various utility functions\n */\n\nexport {default as multiplyMatrices} from \"./multiply-matrices.js\";\n\n/**\n * Check if a value is a string (including a String object)\n * @param {*} str - Value to check\n * @returns {boolean}\n */\nexport function isString (str) {\n\treturn type(str) === \"string\";\n}\n\n/**\n * Determine the internal JavaScript [[Class]] of an object.\n * @param {*} o - Value to check\n * @returns {string}\n */\nexport function type (o) {\n\tlet str = Object.prototype.toString.call(o);\n\n\treturn (str.match(/^\\[object\\s+(.*?)\\]$/)[1] || \"\").toLowerCase();\n}\n\nexport function serializeNumber (n, {precision, unit }) {\n\tif (isNone(n)) {\n\t\treturn \"none\";\n\t}\n\n\treturn toPrecision(n, precision) + (unit ?? \"\");\n}\n\n/**\n * Check if a value corresponds to a none argument\n * @param {*} n - Value to check\n * @returns {boolean}\n */\nexport function isNone (n) {\n\treturn Number.isNaN(n) || (n instanceof Number && n?.none);\n}\n\n/**\n * Replace none values with 0\n */\nexport function skipNone (n) {\n\treturn isNone(n) ? 0 : n;\n}\n\n/**\n * Round a number to a certain number of significant digits\n * @param {number} n - The number to round\n * @param {number} precision - Number of significant digits\n */\nexport function toPrecision (n, precision) {\n\tif (n === 0) {\n\t\treturn 0;\n\t}\n\tlet integer = ~~n;\n\tlet digits = 0;\n\tif (integer && precision) {\n\t\tdigits = ~~Math.log10(Math.abs(integer)) + 1;\n\t}\n\tconst multiplier = 10.0 ** (precision - digits);\n\treturn Math.floor(n * multiplier + 0.5) / multiplier;\n}\n\nconst angleFactor = {\n\tdeg: 1,\n\tgrad: 0.9,\n\trad: 180 / Math.PI,\n\tturn: 360,\n};\n\n/**\n* Parse a CSS function, regardless of its name and arguments\n* @param String str String to parse\n* @return {{name, args, rawArgs}}\n*/\nexport function parseFunction (str) {\n\tif (!str) {\n\t\treturn;\n\t}\n\n\tstr = str.trim();\n\n\tconst isFunctionRegex = /^([a-z]+)\\((.+?)\\)$/i;\n\tconst isNumberRegex = /^-?[\\d.]+$/;\n\tconst unitValueRegex = /%|deg|g?rad|turn$/;\n\tconst singleArgument = /\\/?\\s*(none|[-\\w.]+(?:%|deg|g?rad|turn)?)/g;\n\tlet parts = str.match(isFunctionRegex);\n\n\tif (parts) {\n\t\t// It is a function, parse args\n\t\tlet args = [];\n\t\tparts[2].replace(singleArgument, ($0, rawArg) => {\n\t\t\tlet match = rawArg.match(unitValueRegex);\n\t\t\tlet arg = rawArg;\n\n\t\t\tif (match) {\n\t\t\t\tlet unit = match[0];\n\t\t\t\t// Drop unit from value\n\t\t\t\tlet unitlessArg = arg.slice(0, -unit.length);\n\n\t\t\t\tif (unit === \"%\") {\n\t\t\t\t\t// Convert percentages to 0-1 numbers\n\t\t\t\t\targ = new Number(unitlessArg / 100);\n\t\t\t\t\targ.type = \"\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// Multiply angle by appropriate factor for its unit\n\t\t\t\t\targ = new Number(unitlessArg * angleFactor[unit]);\n\t\t\t\t\targ.type = \"\";\n\t\t\t\t\targ.unit = unit;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (isNumberRegex.test(arg)) {\n\t\t\t\t// Convert numerical args to numbers\n\t\t\t\targ = new Number(arg);\n\t\t\t\targ.type = \"\";\n\t\t\t}\n\t\t\telse if (arg === \"none\") {\n\t\t\t\targ = new Number(NaN);\n\t\t\t\targ.none = true;\n\t\t\t}\n\n\t\t\tif ($0.startsWith(\"/\")) {\n\t\t\t\t// It's alpha\n\t\t\t\targ = arg instanceof Number ? arg : new Number(arg);\n\t\t\t\targ.alpha = true;\n\t\t\t}\n\n\t\t\tif (typeof arg === \"object\" && arg instanceof Number) {\n\t\t\t\targ.raw = rawArg;\n\t\t\t}\n\n\t\t\targs.push(arg);\n\t\t});\n\n\t\treturn {\n\t\t\tname: parts[1].toLowerCase(),\n\t\t\trawName: parts[1],\n\t\t\trawArgs: parts[2],\n\t\t\t// An argument could be (as of css-color-4):\n\t\t\t// a number, percentage, degrees (hue), ident (in color())\n\t\t\targs,\n\t\t};\n\t}\n}\n\nexport function last (arr) {\n\treturn arr[arr.length - 1];\n}\n\nexport function interpolate (start, end, p) {\n\tif (isNaN(start)) {\n\t\treturn end;\n\t}\n\n\tif (isNaN(end)) {\n\t\treturn start;\n\t}\n\n\treturn start + (end - start) * p;\n}\n\nexport function interpolateInv (start, end, value) {\n\treturn (value - start) / (end - start);\n}\n\nexport function mapRange (from, to, value) {\n\treturn interpolate(to[0], to[1], interpolateInv(from[0], from[1], value));\n}\n\nexport function parseCoordGrammar (coordGrammars) {\n\treturn coordGrammars.map(coordGrammar => {\n\t\treturn coordGrammar.split(\"|\").map(type => {\n\t\t\ttype = type.trim();\n\t\t\tlet range = type.match(/^(<[a-z]+>)\\[(-?[.\\d]+),\\s*(-?[.\\d]+)\\]?$/);\n\n\t\t\tif (range) {\n\t\t\t\tlet ret = new String(range[1]);\n\t\t\t\tret.range = [+range[2], +range[3]];\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\treturn type;\n\t\t});\n\t});\n}\n\n/**\n * Clamp value between the minimum and maximum\n * @param {number} min minimum value to return\n * @param {number} val the value to return if it is between min and max\n * @param {number} max maximum value to return\n * @returns number\n */\nexport function clamp (min, val, max) {\n\treturn Math.max(Math.min(max, val), min);\n}\n\n/**\n * Copy sign of one value to another.\n * @param {number} - to number to copy sign to\n * @param {number} - from number to copy sign from\n * @returns number\n */\nexport function copySign (to, from) {\n\treturn Math.sign(to) === Math.sign(from) ? to : -to;\n}\n\n/**\n * Perform pow on a signed number and copy sign to result\n * @param {number} - base the base number\n * @param {number} - exp the exponent\n * @returns number\n */\nexport function spow (base, exp) {\n\treturn copySign(Math.abs(base) ** exp, base);\n}\n\n/**\n * Perform a divide, but return zero if the numerator is zero\n * @param {number} n - the numerator\n * @param {number} d - the denominator\n * @returns number\n */\nexport function zdiv (n, d) {\n\treturn (d === 0) ? 0 : n / d;\n}\n\n/**\n * Perform a bisect on a sorted list and locate the insertion point for\n * a value in arr to maintain sorted order.\n * @param {number[]} arr - array of sorted numbers\n * @param {number} value - value to find insertion point for\n * @param {number} lo - used to specify a the low end of a subset of the list\n * @param {number} hi - used to specify a the high end of a subset of the list\n * @returns number\n */\nexport function bisectLeft (arr, value, lo = 0, hi = arr.length) {\n\twhile (lo < hi) {\n\t\tconst mid = (lo + hi) >> 1;\n\t\tif (arr[mid] < value) {\n\t\t\tlo = mid + 1;\n\t\t}\n\t\telse {\n\t\t\thi = mid;\n\t\t}\n\t}\n\treturn lo;\n}\n", "/**\n * A class for adding deep extensibility to any piece of JS code\n */\nexport class Hooks {\n\tadd (name, callback, first) {\n\t\tif (typeof arguments[0] != \"string\") {\n\t\t\t// Multiple hooks\n\t\t\tfor (var name in arguments[0]) {\n\t\t\t\tthis.add(name, arguments[0][name], arguments[1]);\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t(Array.isArray(name) ? name : [name]).forEach(function (name) {\n\t\t\tthis[name] = this[name] || [];\n\n\t\t\tif (callback) {\n\t\t\t\tthis[name][first ? \"unshift\" : \"push\"](callback);\n\t\t\t}\n\t\t}, this);\n\t}\n\n\trun (name, env) {\n\t\tthis[name] = this[name] || [];\n\t\tthis[name].forEach(function (callback) {\n\t\t\tcallback.call(env && env.context ? env.context : env, env);\n\t\t});\n\t}\n}\n\n/**\n * The instance of {@link Hooks} used throughout Color.js\n */\nconst hooks = new Hooks();\n\nexport default hooks;\n", "import hooks from \"./hooks.js\";\nimport {multiplyMatrices} from \"./util.js\";\n\nexport const WHITES = {\n\t// for compatibility, the four-digit chromaticity-derived ones everyone else uses\n\tD50: [0.3457 / 0.3585, 1.00000, (1.0 - 0.3457 - 0.3585) / 0.3585],\n\tD65: [0.3127 / 0.3290, 1.00000, (1.0 - 0.3127 - 0.3290) / 0.3290],\n};\n\nexport function getWhite (name) {\n\tif (Array.isArray(name)) {\n\t\treturn name;\n\t}\n\n\treturn WHITES[name];\n}\n\n// Adapt XYZ from white point W1 to W2\nexport default function adapt (W1, W2, XYZ, options = {}) {\n\tW1 = getWhite(W1);\n\tW2 = getWhite(W2);\n\n\tif (!W1 || !W2) {\n\t\tthrow new TypeError(`Missing white point to convert ${!W1 ? \"from\" : \"\"}${!W1 && !W2 ? \"/\" : \"\"}${!W2 ? \"to\" : \"\"}`);\n\t}\n\n\tif (W1 === W2) {\n\t\t// Same whitepoints, no conversion needed\n\t\treturn XYZ;\n\t}\n\n\tlet env = {W1, W2, XYZ, options};\n\n\thooks.run(\"chromatic-adaptation-start\", env);\n\n\tif (!env.M) {\n\t\tif (env.W1 === WHITES.D65 && env.W2 === WHITES.D50) {\n\t\t\tenv.M = [\n\t\t\t\t[ 1.0479297925449969, 0.022946870601609652, -0.05019226628920524 ],\n\t\t\t\t[ 0.02962780877005599, 0.9904344267538799, -0.017073799063418826 ],\n\t\t\t\t[ -0.009243040646204504, 0.015055191490298152, 0.7518742814281371 ],\n\t\t\t];\n\t\t}\n\t\telse if (env.W1 === WHITES.D50 && env.W2 === WHITES.D65) {\n\n\t\t\tenv.M = [\n\t\t\t\t[ 0.955473421488075, -0.02309845494876471, 0.06325924320057072 ],\n\t\t\t\t[ -0.0283697093338637, 1.0099953980813041, 0.021041441191917323 ],\n\t\t\t\t[ 0.012314014864481998, -0.020507649298898964, 1.330365926242124 ],\n\t\t\t];\n\t\t}\n\t}\n\n\thooks.run(\"chromatic-adaptation-end\", env);\n\n\tif (env.M) {\n\t\treturn multiplyMatrices(env.M, env.XYZ);\n\t}\n\telse {\n\t\tthrow new TypeError(\"Only Bradford CAT with white points D50 and D65 supported for now.\");\n\t}\n}\n", "// Global defaults one may want to configure\nexport default {\n\tgamut_mapping: \"css\",\n\tprecision: 5,\n\tdeltaE: \"76\", // Default deltaE method\n\tverbose: globalThis?.process?.env?.NODE_ENV?.toLowerCase() !== \"test\",\n\twarn: function warn (msg) {\n\t\tif (this.verbose) {\n\t\t\tglobalThis?.console?.warn?.(msg);\n\t\t}\n\t},\n};\n", "import * as util from \"./util.js\";\nimport hooks from \"./hooks.js\";\nimport ColorSpace from \"./space.js\";\nimport defaults from \"./defaults.js\";\n\nconst noneTypes = new Set([\"\", \"\", \"\"]);\n\n/**\n * Validates the coordinates of a color against a format's coord grammar and\n * maps the coordinates to the range or refRange of the coordinates.\n * @param {ColorSpace} space - Colorspace the coords are in\n * @param {object} format - the format object to validate against\n * @param {string} name - the name of the color function. e.g. \"oklab\" or \"color\"\n * @returns {object[]} - an array of type metadata for each coordinate\n */\nfunction coerceCoords (space, format, name, coords) {\n\tlet types = Object.entries(space.coords).map(([id, coordMeta], i) => {\n\t\tlet coordGrammar = format.coordGrammar[i];\n\t\tlet arg = coords[i];\n\t\tlet providedType = arg?.type;\n\n\t\t// Find grammar alternative that matches the provided type\n\t\t// Non-strict equals is intentional because we are comparing w/ string objects\n\t\tlet type;\n\t\tif (arg.none) {\n\t\t\ttype = coordGrammar.find(c => noneTypes.has(c));\n\t\t}\n\t\telse {\n\t\t\ttype = coordGrammar.find(c => c == providedType);\n\t\t}\n\n\t\t// Check that each coord conforms to its grammar\n\t\tif (!type) {\n\t\t\t// Type does not exist in the grammar, throw\n\t\t\tlet coordName = coordMeta.name || id;\n\t\t\tthrow new TypeError(`${providedType ?? arg.raw} not allowed for ${coordName} in ${name}()`);\n\t\t}\n\n\t\tlet fromRange = type.range;\n\n\t\tif (providedType === \"\") {\n\t\t\tfromRange ||= [0, 1];\n\t\t}\n\n\t\tlet toRange = coordMeta.range || coordMeta.refRange;\n\n\t\tif (fromRange && toRange) {\n\t\t\tcoords[i] = util.mapRange(fromRange, toRange, coords[i]);\n\t\t}\n\n\t\treturn type;\n\t});\n\n\treturn types;\n}\n\n\n/**\n * Convert a CSS Color string to a color object\n * @param {string} str\n * @param {object} [options]\n * @param {object} [options.meta] - Object for additional information about the parsing\n * @returns {Color}\n */\nexport default function parse (str, {meta} = {}) {\n\tlet env = {\"str\": String(str)?.trim()};\n\thooks.run(\"parse-start\", env);\n\n\tif (env.color) {\n\t\treturn env.color;\n\t}\n\n\tenv.parsed = util.parseFunction(env.str);\n\n\tif (env.parsed) {\n\t\t// Is a functional syntax\n\t\tlet name = env.parsed.name;\n\n\t\tif (name === \"color\") {\n\t\t\t// color() function\n\t\t\tlet id = env.parsed.args.shift();\n\t\t\t// Check against both and versions\n\t\t\tlet alternateId = id.startsWith(\"--\") ? id.substring(2) : `--${id}`;\n\t\t\tlet ids = [id, alternateId];\n\t\t\tlet alpha = env.parsed.rawArgs.indexOf(\"/\") > 0 ? env.parsed.args.pop() : 1;\n\n\t\t\tfor (let space of ColorSpace.all) {\n\t\t\t\tlet colorSpec = space.getFormat(\"color\");\n\n\t\t\t\tif (colorSpec) {\n\t\t\t\t\tif (ids.includes(colorSpec.id) || colorSpec.ids?.filter((specId) => ids.includes(specId)).length) {\n\t\t\t\t\t\t// From https://drafts.csswg.org/css-color-4/#color-function\n\t\t\t\t\t\t// If more s or s are provided than parameters that the colorspace takes, the excess s at the end are ignored.\n\t\t\t\t\t\t// If less s or s are provided than parameters that the colorspace takes, the missing parameters default to 0. (This is particularly convenient for multichannel printers where the additional inks are spot colors or varnishes that most colors on the page won\u2019t use.)\n\t\t\t\t\t\tconst coords = Object.keys(space.coords).map((_, i) => env.parsed.args[i] || 0);\n\n\t\t\t\t\t\tlet types;\n\n\t\t\t\t\t\tif (colorSpec.coordGrammar) {\n\t\t\t\t\t\t\ttypes = coerceCoords(space, colorSpec, \"color\", coords);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (meta) {\n\t\t\t\t\t\t\tObject.assign(meta, {formatId: \"color\", types});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (colorSpec.id.startsWith(\"--\") && !id.startsWith(\"--\")) {\n\t\t\t\t\t\t\tdefaults.warn(`${space.name} is a non-standard space and not currently supported in the CSS spec. ` +\n\t\t\t\t\t\t\t `Use prefixed color(${colorSpec.id}) instead of color(${id}).`);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (id.startsWith(\"--\") && !colorSpec.id.startsWith(\"--\")) {\n\t\t\t\t\t\t\tdefaults.warn(`${space.name} is a standard space and supported in the CSS spec. ` +\n\t\t\t\t\t\t\t `Use color(${colorSpec.id}) instead of prefixed color(${id}).`);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn {spaceId: space.id, coords, alpha};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Not found\n\t\t\tlet didYouMean = \"\";\n\t\t\tlet registryId = id in ColorSpace.registry ? id : alternateId;\n\t\t\tif (registryId in ColorSpace.registry) {\n\t\t\t\t// Used color space id instead of color() id, these are often different\n\t\t\t\tlet cssId = ColorSpace.registry[registryId].formats?.color?.id;\n\n\t\t\t\tif (cssId) {\n\t\t\t\t\tdidYouMean = `Did you mean color(${cssId})?`;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthrow new TypeError(`Cannot parse color(${id}). ` + (didYouMean || \"Missing a plugin?\"));\n\t\t}\n\t\telse {\n\t\t\tfor (let space of ColorSpace.all) {\n\t\t\t\t// color space specific function\n\t\t\t\tlet format = space.getFormat(name);\n\t\t\t\tif (format && format.type === \"function\") {\n\t\t\t\t\tlet alpha = 1;\n\n\t\t\t\t\tif (format.lastAlpha || util.last(env.parsed.args).alpha) {\n\t\t\t\t\t\talpha = env.parsed.args.pop();\n\t\t\t\t\t}\n\n\t\t\t\t\tlet coords = env.parsed.args;\n\n\t\t\t\t\tlet types;\n\n\t\t\t\t\tif (format.coordGrammar) {\n\t\t\t\t\t\ttypes = coerceCoords(space, format, name, coords);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (meta) {\n\t\t\t\t\t\tObject.assign(meta, {formatId: format.name, types});\n\t\t\t\t\t}\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tspaceId: space.id,\n\t\t\t\t\t\tcoords, alpha,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\t// Custom, colorspace-specific format\n\t\tfor (let space of ColorSpace.all) {\n\t\t\tfor (let formatId in space.formats) {\n\t\t\t\tlet format = space.formats[formatId];\n\n\t\t\t\tif (format.type !== \"custom\") {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (format.test && !format.test(env.str)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tlet color = format.parse(env.str);\n\n\t\t\t\tif (color) {\n\t\t\t\t\tcolor.alpha ??= 1;\n\n\t\t\t\t\tif (meta) {\n\t\t\t\t\t\tmeta.formatId = formatId;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn color;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\n\t// If we're here, we couldn't parse\n\tthrow new TypeError(`Could not parse ${str} as a color. Missing a plugin?`);\n}\n", "import ColorSpace from \"./space.js\";\nimport {isString} from \"./util.js\";\nimport parse from \"./parse.js\";\n\n/**\n * Resolves a color reference (object or string) to a plain color object\n * @param {Color | {space, coords, alpha} | string | Array } color\n * @returns {{space, coords, alpha} | Array<{space, coords, alpha}}>\n */\nexport default function getColor (color) {\n\tif (Array.isArray(color)) {\n\t\treturn color.map(getColor);\n\t}\n\n\tif (!color) {\n\t\tthrow new TypeError(\"Empty color reference\");\n\t}\n\n\tif (isString(color)) {\n\t\tcolor = parse(color);\n\t}\n\n\t// Object fixup\n\tlet space = color.space || color.spaceId;\n\n\tif (!(space instanceof ColorSpace)) {\n\t\t// Convert string id to color space object\n\t\tcolor.space = ColorSpace.get(space);\n\t}\n\n\tif (color.alpha === undefined) {\n\t\tcolor.alpha = 1;\n\t}\n\n\treturn color;\n}\n", "import {type, parseCoordGrammar, serializeNumber, mapRange} from \"./util.js\";\nimport {getWhite} from \"./adapt.js\";\nimport hooks from \"./hooks.js\";\nimport getColor from \"./getColor.js\";\n\nconst \u03B5 = .000075;\n\n/**\n * Class to represent a color space\n */\nexport default class ColorSpace {\n\tconstructor (options) {\n\t\tthis.id = options.id;\n\t\tthis.name = options.name;\n\t\tthis.base = options.base ? ColorSpace.get(options.base) : null;\n\t\tthis.aliases = options.aliases;\n\n\t\tif (this.base) {\n\t\t\tthis.fromBase = options.fromBase;\n\t\t\tthis.toBase = options.toBase;\n\t\t}\n\n\t\t// Coordinate metadata\n\n\t\tlet coords = options.coords ?? this.base.coords;\n\n\t\tfor (let name in coords) {\n\t\t\tif (!(\"name\" in coords[name])) {\n\t\t\t\tcoords[name].name = name;\n\t\t\t}\n\t\t}\n\t\tthis.coords = coords;\n\n\t\t// White point\n\n\t\tlet white = options.white ?? this.base.white ?? \"D65\";\n\t\tthis.white = getWhite(white);\n\n\t\t// Sort out formats\n\n\t\tthis.formats = options.formats ?? {};\n\n\t\tfor (let name in this.formats) {\n\t\t\tlet format = this.formats[name];\n\t\t\tformat.type ||= \"function\";\n\t\t\tformat.name ||= name;\n\t\t}\n\n\t\tif (!this.formats.color?.id) {\n\t\t\tthis.formats.color = {\n\t\t\t\t...this.formats.color ?? {},\n\t\t\t\tid: options.cssId || this.id,\n\t\t\t};\n\t\t}\n\n\t\t// Gamut space\n\n\t\tif (options.gamutSpace) {\n\t\t\t// Gamut space explicitly specified\n\t\t\tthis.gamutSpace = options.gamutSpace === \"self\" ? this : ColorSpace.get(options.gamutSpace);\n\t\t}\n\t\telse {\n\t\t\t// No gamut space specified, calculate a sensible default\n\t\t\tif (this.isPolar) {\n\t\t\t\t// Do not check gamut through polar coordinates\n\t\t\t\tthis.gamutSpace = this.base;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.gamutSpace = this;\n\t\t\t}\n\t\t}\n\n\t\t// Optimize inGamut for unbounded spaces\n\t\tif (this.gamutSpace.isUnbounded) {\n\t\t\tthis.inGamut = (coords, options) => {\n\t\t\t\treturn true;\n\t\t\t};\n\t\t}\n\n\t\t// Other stuff\n\t\tthis.referred = options.referred;\n\n\t\t// Compute ancestors and store them, since they will never change\n\t\tObject.defineProperty(this, \"path\", {\n\t\t\tvalue: getPath(this).reverse(),\n\t\t\twritable: false,\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t});\n\n\t\thooks.run(\"colorspace-init-end\", this);\n\t}\n\n\tinGamut (coords, {epsilon = \u03B5} = {}) {\n\t\tif (!this.equals(this.gamutSpace)) {\n\t\t\tcoords = this.to(this.gamutSpace, coords);\n\t\t\treturn this.gamutSpace.inGamut(coords, {epsilon});\n\t\t}\n\n\t\tlet coordMeta = Object.values(this.coords);\n\n\t\treturn coords.every((c, i) => {\n\t\t\tlet meta = coordMeta[i];\n\n\t\t\tif (meta.type !== \"angle\" && meta.range) {\n\t\t\t\tif (Number.isNaN(c)) {\n\t\t\t\t\t// NaN is always in gamut\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tlet [min, max] = meta.range;\n\t\t\t\treturn (min === undefined || c >= min - epsilon)\n\t\t\t\t && (max === undefined || c <= max + epsilon);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t});\n\t}\n\n\tget isUnbounded () {\n\t\treturn Object.values(this.coords).every(coord => !(\"range\" in coord));\n\t}\n\n\tget cssId () {\n\t\treturn this.formats?.color?.id || this.id;\n\t}\n\n\tget isPolar () {\n\t\tfor (let id in this.coords) {\n\t\t\tif (this.coords[id].type === \"angle\") {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tgetFormat (format) {\n\t\tif (typeof format === \"object\") {\n\t\t\tformat = processFormat(format, this);\n\t\t\treturn format;\n\t\t}\n\n\t\tlet ret;\n\t\tif (format === \"default\") {\n\t\t\t// Get first format\n\t\t\tret = Object.values(this.formats)[0];\n\t\t}\n\t\telse {\n\t\t\tret = this.formats[format];\n\t\t}\n\n\t\tif (ret) {\n\t\t\tret = processFormat(ret, this);\n\t\t\treturn ret;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Check if this color space is the same as another color space reference.\n\t * Allows proxying color space objects and comparing color spaces with ids.\n\t * @param {string | ColorSpace} space ColorSpace object or id to compare to\n\t * @returns {boolean}\n\t */\n\tequals (space) {\n\t\tif (!space) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn this === space || this.id === space || this.id === space.id;\n\t}\n\n\tto (space, coords) {\n\t\tif (arguments.length === 1) {\n\t\t\tconst color = getColor(space);\n\t\t\t[space, coords] = [color.space, color.coords];\n\t\t}\n\n\t\tspace = ColorSpace.get(space);\n\n\t\tif (this.equals(space)) {\n\t\t\t// Same space, no change needed\n\t\t\treturn coords;\n\t\t}\n\n\t\t// Convert NaN to 0, which seems to be valid in every coordinate of every color space\n\t\tcoords = coords.map(c => Number.isNaN(c) ? 0 : c);\n\n\t\t// Find connection space = lowest common ancestor in the base tree\n\t\tlet myPath = this.path;\n\t\tlet otherPath = space.path;\n\n\t\tlet connectionSpace, connectionSpaceIndex;\n\n\t\tfor (let i = 0; i < myPath.length; i++) {\n\t\t\tif (myPath[i].equals(otherPath[i])) {\n\t\t\t\tconnectionSpace = myPath[i];\n\t\t\t\tconnectionSpaceIndex = i;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (!connectionSpace) {\n\t\t\t// This should never happen\n\t\t\tthrow new Error(`Cannot convert between color spaces ${this} and ${space}: no connection space was found`);\n\t\t}\n\n\t\t// Go up from current space to connection space\n\t\tfor (let i = myPath.length - 1; i > connectionSpaceIndex; i--) {\n\t\t\tcoords = myPath[i].toBase(coords);\n\t\t}\n\n\t\t// Go down from connection space to target space\n\t\tfor (let i = connectionSpaceIndex + 1; i < otherPath.length; i++) {\n\t\t\tcoords = otherPath[i].fromBase(coords);\n\t\t}\n\n\t\treturn coords;\n\t}\n\n\tfrom (space, coords) {\n\t\tif (arguments.length === 1) {\n\t\t\tconst color = getColor(space);\n\t\t\t[space, coords] = [color.space, color.coords];\n\t\t}\n\n\t\tspace = ColorSpace.get(space);\n\n\t\treturn space.to(this, coords);\n\t}\n\n\ttoString () {\n\t\treturn `${this.name} (${this.id})`;\n\t}\n\n\tgetMinCoords () {\n\t\tlet ret = [];\n\n\t\tfor (let id in this.coords) {\n\t\t\tlet meta = this.coords[id];\n\t\t\tlet range = meta.range || meta.refRange;\n\t\t\tret.push(range?.min ?? 0);\n\t\t}\n\n\t\treturn ret;\n\t}\n\n\tstatic registry = {};\n\n\t// Returns array of unique color spaces\n\tstatic get all () {\n\t\treturn [...new Set(Object.values(ColorSpace.registry))];\n\t}\n\n\tstatic register (id, space) {\n\t\tif (arguments.length === 1) {\n\t\t\tspace = arguments[0];\n\t\t\tid = space.id;\n\t\t}\n\n\t\tspace = this.get(space);\n\n\t\tif (this.registry[id] && this.registry[id] !== space) {\n\t\t\tthrow new Error(`Duplicate color space registration: '${id}'`);\n\t\t}\n\t\tthis.registry[id] = space;\n\n\t\t// Register aliases when called without an explicit ID.\n\t\tif (arguments.length === 1 && space.aliases) {\n\t\t\tfor (let alias of space.aliases) {\n\t\t\t\tthis.register(alias, space);\n\t\t\t}\n\t\t}\n\n\t\treturn space;\n\t}\n\n\t/**\n\t * Lookup ColorSpace object by name\n\t * @param {ColorSpace | string} name\n\t */\n\tstatic get (space, ...alternatives) {\n\t\tif (!space || space instanceof ColorSpace) {\n\t\t\treturn space;\n\t\t}\n\n\t\tlet argType = type(space);\n\n\t\tif (argType === \"string\") {\n\t\t\t// It's a color space id\n\t\t\tlet ret = ColorSpace.registry[space.toLowerCase()];\n\n\t\t\tif (!ret) {\n\t\t\t\tthrow new TypeError(`No color space found with id = \"${space}\"`);\n\t\t\t}\n\n\t\t\treturn ret;\n\t\t}\n\n\t\tif (alternatives.length) {\n\t\t\treturn ColorSpace.get(...alternatives);\n\t\t}\n\n\t\tthrow new TypeError(`${space} is not a valid color space`);\n\t}\n\n\t/**\n\t * Get metadata about a coordinate of a color space\n\t *\n\t * @static\n\t * @param {Array | string} ref\n\t * @param {ColorSpace | string} [workingSpace]\n\t * @return {Object}\n\t */\n\tstatic resolveCoord (ref, workingSpace) {\n\t\tlet coordType = type(ref);\n\t\tlet space, coord;\n\n\t\tif (coordType === \"string\") {\n\t\t\tif (ref.includes(\".\")) {\n\t\t\t\t// Absolute coordinate\n\t\t\t\t[space, coord] = ref.split(\".\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Relative coordinate\n\t\t\t\t[space, coord] = [, ref];\n\t\t\t}\n\t\t}\n\t\telse if (Array.isArray(ref)) {\n\t\t\t[space, coord] = ref;\n\t\t}\n\t\telse {\n\t\t\t// Object\n\t\t\tspace = ref.space;\n\t\t\tcoord = ref.coordId;\n\t\t}\n\n\t\tspace = ColorSpace.get(space);\n\n\t\tif (!space) {\n\t\t\tspace = workingSpace;\n\t\t}\n\n\t\tif (!space) {\n\t\t\tthrow new TypeError(`Cannot resolve coordinate reference ${ref}: No color space specified and relative references are not allowed here`);\n\t\t}\n\n\t\tcoordType = type(coord);\n\n\t\tif (coordType === \"number\" || coordType === \"string\" && coord >= 0) {\n\t\t\t// Resolve numerical coord\n\t\t\tlet meta = Object.entries(space.coords)[coord];\n\n\t\t\tif (meta) {\n\t\t\t\treturn {space, id: meta[0], index: coord, ...meta[1]};\n\t\t\t}\n\t\t}\n\n\t\tspace = ColorSpace.get(space);\n\n\t\tlet normalizedCoord = coord.toLowerCase();\n\n\t\tlet i = 0;\n\t\tfor (let id in space.coords) {\n\t\t\tlet meta = space.coords[id];\n\n\t\t\tif (id.toLowerCase() === normalizedCoord || meta.name?.toLowerCase() === normalizedCoord) {\n\t\t\t\treturn {space, id, index: i, ...meta};\n\t\t\t}\n\n\t\t\ti++;\n\t\t}\n\n\t\tthrow new TypeError(`No \"${coord}\" coordinate found in ${space.name}. Its coordinates are: ${Object.keys(space.coords).join(\", \")}`);\n\t}\n\n\tstatic DEFAULT_FORMAT = {\n\t\ttype: \"functions\",\n\t\tname: \"color\",\n\t};\n}\n\nfunction getPath (space) {\n\tlet ret = [space];\n\n\tfor (let s = space; s = s.base;) {\n\t\tret.push(s);\n\t}\n\n\treturn ret;\n}\n\nfunction processFormat (format, {coords} = {}) {\n\tif (format.coords && !format.coordGrammar) {\n\t\tformat.type ||= \"function\";\n\t\tformat.name ||= \"color\";\n\n\t\t// Format has not been processed\n\t\tformat.coordGrammar = parseCoordGrammar(format.coords);\n\n\t\tlet coordFormats = Object.entries(coords).map(([id, coordMeta], i) => {\n\t\t\t// Preferred format for each coord is the first one\n\t\t\tlet outputType = format.coordGrammar[i][0];\n\n\t\t\tlet fromRange = coordMeta.range || coordMeta.refRange;\n\t\t\tlet toRange = outputType.range, suffix = \"\";\n\n\t\t\t// Non-strict equals intentional since outputType could be a string object\n\t\t\tif (outputType == \"\") {\n\t\t\t\ttoRange = [0, 100];\n\t\t\t\tsuffix = \"%\";\n\t\t\t}\n\t\t\telse if (outputType == \"\") {\n\t\t\t\tsuffix = \"deg\";\n\t\t\t}\n\n\t\t\treturn {fromRange, toRange, suffix};\n\t\t});\n\n\t\tformat.serializeCoords = (coords, precision) => {\n\t\t\treturn coords.map((c, i) => {\n\t\t\t\tlet {fromRange, toRange, suffix} = coordFormats[i];\n\n\t\t\t\tif (fromRange && toRange) {\n\t\t\t\t\tc = mapRange(fromRange, toRange, c);\n\t\t\t\t}\n\n\t\t\t\tc = serializeNumber(c, {precision, unit: suffix});\n\n\t\t\t\treturn c;\n\t\t\t});\n\t\t};\n\t}\n\n\treturn format;\n}\n", "import ColorSpace from \"../space.js\";\n\nexport default new ColorSpace({\n\tid: \"xyz-d65\",\n\tname: \"XYZ D65\",\n\tcoords: {\n\t\tx: {name: \"X\"},\n\t\ty: {name: \"Y\"},\n\t\tz: {name: \"Z\"},\n\t},\n\twhite: \"D65\",\n\tformats: {\n\t\tcolor: {\n\t\t\tids: [\"xyz-d65\", \"xyz\"],\n\t\t},\n\t},\n\taliases: [\"xyz\"],\n});\n", "import ColorSpace from \"./space.js\";\nimport {multiplyMatrices} from \"./util.js\";\nimport adapt from \"./adapt.js\";\nimport XYZ_D65 from \"./spaces/xyz-d65.js\";\n\n/**\n * Convenience class for RGB color spaces\n * @extends {ColorSpace}\n */\nexport default class RGBColorSpace extends ColorSpace {\n\t/**\n\t * Creates a new RGB ColorSpace.\n\t * If coords are not specified, they will use the default RGB coords.\n\t * Instead of `fromBase()` and `toBase()` functions,\n\t * you can specify to/from XYZ matrices and have `toBase()` and `fromBase()` automatically generated.\n\t * @param {*} options - Same options as {@link ColorSpace} plus:\n\t * @param {number[][]} options.toXYZ_M - Matrix to convert to XYZ\n\t * @param {number[][]} options.fromXYZ_M - Matrix to convert from XYZ\n\t */\n\tconstructor (options) {\n\t\tif (!options.coords) {\n\t\t\toptions.coords = {\n\t\t\t\tr: {\n\t\t\t\t\trange: [0, 1],\n\t\t\t\t\tname: \"Red\",\n\t\t\t\t},\n\t\t\t\tg: {\n\t\t\t\t\trange: [0, 1],\n\t\t\t\t\tname: \"Green\",\n\t\t\t\t},\n\t\t\t\tb: {\n\t\t\t\t\trange: [0, 1],\n\t\t\t\t\tname: \"Blue\",\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\tif (!options.base) {\n\t\t\toptions.base = XYZ_D65;\n\t\t}\n\n\t\tif (options.toXYZ_M && options.fromXYZ_M) {\n\t\t\toptions.toBase ??= rgb => {\n\t\t\t\tlet xyz = multiplyMatrices(options.toXYZ_M, rgb);\n\n\t\t\t\tif (this.white !== this.base.white) {\n\t\t\t\t\t// Perform chromatic adaptation\n\t\t\t\t\txyz = adapt(this.white, this.base.white, xyz);\n\t\t\t\t}\n\n\t\t\t\treturn xyz;\n\t\t\t};\n\n\t\t\toptions.fromBase ??= xyz => {\n\t\t\t\txyz = adapt(this.base.white, this.white, xyz);\n\t\t\t\treturn multiplyMatrices(options.fromXYZ_M, xyz);\n\t\t\t};\n\t\t}\n\n\t\toptions.referred ??= \"display\";\n\n\t\tsuper(options);\n\t}\n}\n", "import ColorSpace from \"./space.js\";\nimport getColor from \"./getColor.js\";\n\n/**\n * Get the coordinates of a color in any color space\n * @param {Color} color\n * @param {string | ColorSpace} [space = color.space] The color space to convert to. Defaults to the color's current space\n * @returns {number[]} The color coordinates in the given color space\n */\nexport default function getAll (color, space) {\n\tcolor = getColor(color);\n\n\tif (!space || color.space.equals(space)) {\n\t\t// No conversion needed\n\t\treturn color.coords.slice();\n\t}\n\n\tspace = ColorSpace.get(space);\n\treturn space.from(color);\n}\n", "import ColorSpace from \"./space.js\";\nimport getAll from \"./getAll.js\";\nimport getColor from \"./getColor.js\";\n\nexport default function get (color, prop) {\n\tcolor = getColor(color);\n\n\tlet {space, index} = ColorSpace.resolveCoord(prop, color.space);\n\tlet coords = getAll(color, space);\n\treturn coords[index];\n}\n", "import ColorSpace from \"./space.js\";\nimport getColor from \"./getColor.js\";\n\nexport default function setAll (color, space, coords) {\n\tcolor = getColor(color);\n\n\tspace = ColorSpace.get(space);\n\tcolor.coords = space.to(color.space, coords);\n\treturn color;\n}\n\nsetAll.returns = \"color\";\n", "import ColorSpace from \"./space.js\";\nimport getColor from \"./getColor.js\";\nimport get from \"./get.js\";\nimport getAll from \"./getAll.js\";\nimport setAll from \"./setAll.js\";\nimport {type} from \"./util.js\";\n\n// Set properties and return current instance\nexport default function set (color, prop, value) {\n\tcolor = getColor(color);\n\n\tif (arguments.length === 2 && type(arguments[1]) === \"object\") {\n\t\t// Argument is an object literal\n\t\tlet object = arguments[1];\n\t\tfor (let p in object) {\n\t\t\tset(color, p, object[p]);\n\t\t}\n\t}\n\telse {\n\t\tif (typeof value === \"function\") {\n\t\t\tvalue = value(get(color, prop));\n\t\t}\n\n\t\tlet {space, index} = ColorSpace.resolveCoord(prop, color.space);\n\t\tlet coords = getAll(color, space);\n\t\tcoords[index] = value;\n\t\tsetAll(color, space, coords);\n\t}\n\n\treturn color;\n}\n\nset.returns = \"color\";\n", "import ColorSpace from \"../space.js\";\nimport adapt from \"../adapt.js\";\nimport XYZ_D65 from \"./xyz-d65.js\";\n\nexport default new ColorSpace({\n\tid: \"xyz-d50\",\n\tname: \"XYZ D50\",\n\twhite: \"D50\",\n\tbase: XYZ_D65,\n\tfromBase: coords => adapt(XYZ_D65.white, \"D50\", coords),\n\ttoBase: coords => adapt(\"D50\", XYZ_D65.white, coords),\n});\n", "import ColorSpace from \"../space.js\";\nimport {WHITES} from \"../adapt.js\";\nimport xyz_d50 from \"./xyz-d50.js\";\n\n// \u03BA * \u03B5 = 2^3 = 8\nconst \u03B5 = 216 / 24389; // 6^3/29^3 == (24/116)^3\nconst \u03B53 = 24 / 116;\nconst \u03BA = 24389 / 27; // 29^3/3^3\n\nlet white = WHITES.D50;\n\nexport default new ColorSpace({\n\tid: \"lab\",\n\tname: \"Lab\",\n\tcoords: {\n\t\tl: {\n\t\t\trefRange: [0, 100],\n\t\t\tname: \"Lightness\",\n\t\t},\n\t\ta: {\n\t\t\trefRange: [-125, 125],\n\t\t},\n\t\tb: {\n\t\t\trefRange: [-125, 125],\n\t\t},\n\t},\n\n\t// Assuming XYZ is relative to D50, convert to CIE Lab\n\t// from CIE standard, which now defines these as a rational fraction\n\twhite,\n\n\tbase: xyz_d50,\n\t// Convert D50-adapted XYX to Lab\n\t// CIE 15.3:2004 section 8.2.1.1\n\tfromBase (XYZ) {\n\t\t// compute xyz, which is XYZ scaled relative to reference white\n\t\tlet xyz = XYZ.map((value, i) => value / white[i]);\n\n\t\t// now compute f\n\t\tlet f = xyz.map(value => value > \u03B5 ? Math.cbrt(value) : (\u03BA * value + 16) / 116);\n\n\t\treturn [\n\t\t\t(116 * f[1]) - 16, // L\n\t\t\t500 * (f[0] - f[1]), // a\n\t\t\t200 * (f[1] - f[2]), // b\n\t\t];\n\t},\n\t// Convert Lab to D50-adapted XYZ\n\t// Same result as CIE 15.3:2004 Appendix D although the derivation is different\n\t// http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html\n\ttoBase (Lab) {\n\t\t// compute f, starting with the luminance-related term\n\t\tlet f = [];\n\t\tf[1] = (Lab[0] + 16) / 116;\n\t\tf[0] = Lab[1] / 500 + f[1];\n\t\tf[2] = f[1] - Lab[2] / 200;\n\n\t\t// compute xyz\n\t\tlet xyz = [\n\t\t\tf[0] > \u03B53 ? Math.pow(f[0], 3) : (116 * f[0] - 16) / \u03BA,\n\t\t\tLab[0] > 8 ? Math.pow((Lab[0] + 16) / 116, 3) : Lab[0] / \u03BA,\n\t\t\tf[2] > \u03B53 ? Math.pow(f[2], 3) : (116 * f[2] - 16) / \u03BA,\n\t\t];\n\n\t\t// Compute XYZ by scaling xyz by reference white\n\t\treturn xyz.map((value, i) => value * white[i]);\n\t},\n\n\tformats: {\n\t\t\"lab\": {\n\t\t\tcoords: [\" | \", \" | [-1,1]\", \" | [-1,1]\"],\n\t\t},\n\t},\n});\n", "export function constrain (angle) {\n\treturn ((angle % 360) + 360) % 360;\n}\n\nexport function adjust (arc, angles) {\n\tif (arc === \"raw\") {\n\t\treturn angles;\n\t}\n\n\tlet [a1, a2] = angles.map(constrain);\n\n\tlet angleDiff = a2 - a1;\n\n\tif (arc === \"increasing\") {\n\t\tif (angleDiff < 0) {\n\t\t\ta2 += 360;\n\t\t}\n\t}\n\telse if (arc === \"decreasing\") {\n\t\tif (angleDiff > 0) {\n\t\t\ta1 += 360;\n\t\t}\n\t}\n\telse if (arc === \"longer\") {\n\t\tif (-180 < angleDiff && angleDiff < 180) {\n\t\t\tif (angleDiff > 0) {\n\t\t\t\ta1 += 360;\n\t\t\t}\n\t\t\telse {\n\t\t\t\ta2 += 360;\n\t\t\t}\n\t\t}\n\t}\n\telse if (arc === \"shorter\") {\n\t\tif (angleDiff > 180) {\n\t\t\ta1 += 360;\n\t\t}\n\t\telse if (angleDiff < -180) {\n\t\t\ta2 += 360;\n\t\t}\n\t}\n\n\treturn [a1, a2];\n}\n", "import ColorSpace from \"../space.js\";\nimport Lab from \"./lab.js\";\nimport {constrain as constrainAngle} from \"../angles.js\";\n\nexport default new ColorSpace({\n\tid: \"lch\",\n\tname: \"LCH\",\n\tcoords: {\n\t\tl: {\n\t\t\trefRange: [0, 100],\n\t\t\tname: \"Lightness\",\n\t\t},\n\t\tc: {\n\t\t\trefRange: [0, 150],\n\t\t\tname: \"Chroma\",\n\t\t},\n\t\th: {\n\t\t\trefRange: [0, 360],\n\t\t\ttype: \"angle\",\n\t\t\tname: \"Hue\",\n\t\t},\n\t},\n\n\tbase: Lab,\n\tfromBase (Lab) {\n\t\t// Convert to polar form\n\t\tlet [L, a, b] = Lab;\n\t\tlet hue;\n\t\tconst \u03B5 = 0.02;\n\n\t\tif (Math.abs(a) < \u03B5 && Math.abs(b) < \u03B5) {\n\t\t\thue = NaN;\n\t\t}\n\t\telse {\n\t\t\thue = Math.atan2(b, a) * 180 / Math.PI;\n\t\t}\n\n\t\treturn [\n\t\t\tL, // L is still L\n\t\t\tMath.sqrt(a ** 2 + b ** 2), // Chroma\n\t\t\tconstrainAngle(hue), // Hue, in degrees [0 to 360)\n\t\t];\n\t},\n\ttoBase (LCH) {\n\t\t// Convert from polar form\n\t\tlet [Lightness, Chroma, Hue] = LCH;\n\t\t// Clamp any negative Chroma\n\t\tif (Chroma < 0) {\n\t\t\tChroma = 0;\n\t\t}\n\t\t// Deal with NaN Hue\n\t\tif (isNaN(Hue)) {\n\t\t\tHue = 0;\n\t\t}\n\t\treturn [\n\t\t\tLightness, // L is still L\n\t\t\tChroma * Math.cos(Hue * Math.PI / 180), // a\n\t\t\tChroma * Math.sin(Hue * Math.PI / 180), // b\n\t\t];\n\t},\n\n\tformats: {\n\t\t\"lch\": {\n\t\t\tcoords: [\" | \", \" | \", \" | \"],\n\t\t},\n\t},\n});\n", "import defaults from \"../defaults.js\";\nimport lab from \"../spaces/lab.js\";\nimport lch from \"../spaces/lch.js\";\nimport getColor from \"../getColor.js\";\n\n// deltaE2000 is a statistically significant improvement\n// and is recommended by the CIE and Idealliance\n// especially for color differences less than 10 deltaE76\n// but is wicked complicated\n// and many implementations have small errors!\n// DeltaE2000 is also discontinuous; in case this\n// matters to you, use deltaECMC instead.\n\nconst Gfactor = 25 ** 7;\nconst \u03C0 = Math.PI;\nconst r2d = 180 / \u03C0;\nconst d2r = \u03C0 / 180;\n\nfunction pow7 (x) {\n\t// Faster than x ** 7 or Math.pow(x, 7)\n\n\tconst x2 = x * x;\n\tconst x7 = x2 * x2 * x2 * x;\n\n\treturn x7;\n}\n\nexport default function (color, sample, {kL = 1, kC = 1, kH = 1} = {}) {\n\t[color, sample] = getColor([color, sample]);\n\n\t// Given this color as the reference\n\t// and the function parameter as the sample,\n\t// calculate deltaE 2000.\n\n\t// This implementation assumes the parametric\n\t// weighting factors kL, kC and kH\n\t// for the influence of viewing conditions\n\t// are all 1, as sadly seems typical.\n\t// kL should be increased for lightness texture or noise\n\t// and kC increased for chroma noise\n\n\tlet [L1, a1, b1] = lab.from(color);\n\tlet C1 = lch.from(lab, [L1, a1, b1])[1];\n\tlet [L2, a2, b2] = lab.from(sample);\n\tlet C2 = lch.from(lab, [L2, a2, b2])[1];\n\n\t// Check for negative Chroma,\n\t// which might happen through\n\t// direct user input of LCH values\n\n\tif (C1 < 0) {\n\t\tC1 = 0;\n\t}\n\tif (C2 < 0) {\n\t\tC2 = 0;\n\t}\n\n\tlet Cbar = (C1 + C2) / 2; // mean Chroma\n\n\t// calculate a-axis asymmetry factor from mean Chroma\n\t// this turns JND ellipses for near-neutral colors back into circles\n\tlet C7 = pow7(Cbar);\n\n\tlet G = 0.5 * (1 - Math.sqrt(C7 / (C7 + Gfactor)));\n\n\t// scale a axes by asymmetry factor\n\t// this by the way is why there is no Lab2000 colorspace\n\tlet adash1 = (1 + G) * a1;\n\tlet adash2 = (1 + G) * a2;\n\n\t// calculate new Chroma from scaled a and original b axes\n\tlet Cdash1 = Math.sqrt(adash1 ** 2 + b1 ** 2);\n\tlet Cdash2 = Math.sqrt(adash2 ** 2 + b2 ** 2);\n\n\t// calculate new hues, with zero hue for true neutrals\n\t// and in degrees, not radians\n\n\tlet h1 = (adash1 === 0 && b1 === 0) ? 0 : Math.atan2(b1, adash1);\n\tlet h2 = (adash2 === 0 && b2 === 0) ? 0 : Math.atan2(b2, adash2);\n\n\tif (h1 < 0) {\n\t\th1 += 2 * \u03C0;\n\t}\n\tif (h2 < 0) {\n\t\th2 += 2 * \u03C0;\n\t}\n\n\th1 *= r2d;\n\th2 *= r2d;\n\n\t// Lightness and Chroma differences; sign matters\n\tlet \u0394L = L2 - L1;\n\tlet \u0394C = Cdash2 - Cdash1;\n\n\t// Hue difference, getting the sign correct\n\tlet hdiff = h2 - h1;\n\tlet hsum = h1 + h2;\n\tlet habs = Math.abs(hdiff);\n\tlet \u0394h;\n\n\tif (Cdash1 * Cdash2 === 0) {\n\t\t\u0394h = 0;\n\t}\n\telse if (habs <= 180) {\n\t\t\u0394h = hdiff;\n\t}\n\telse if (hdiff > 180) {\n\t\t\u0394h = hdiff - 360;\n\t}\n\telse if (hdiff < -180) {\n\t\t\u0394h = hdiff + 360;\n\t}\n\telse {\n\t\tdefaults.warn(\"the unthinkable has happened\");\n\t}\n\n\t// weighted Hue difference, more for larger Chroma\n\tlet \u0394H = 2 * Math.sqrt(Cdash2 * Cdash1) * Math.sin(\u0394h * d2r / 2);\n\n\t// calculate mean Lightness and Chroma\n\tlet Ldash = (L1 + L2) / 2;\n\tlet Cdash = (Cdash1 + Cdash2) / 2;\n\tlet Cdash7 = pow7(Cdash);\n\n\t// Compensate for non-linearity in the blue region of Lab.\n\t// Four possibilities for hue weighting factor,\n\t// depending on the angles, to get the correct sign\n\tlet hdash;\n\tif (Cdash1 * Cdash2 === 0) {\n\t\thdash = hsum; // which should be zero\n\t}\n\telse if (habs <= 180) {\n\t\thdash = hsum / 2;\n\t}\n\telse if (hsum < 360) {\n\t\thdash = (hsum + 360) / 2;\n\t}\n\telse {\n\t\thdash = (hsum - 360) / 2;\n\t}\n\n\t// positional corrections to the lack of uniformity of CIELAB\n\t// These are all trying to make JND ellipsoids more like spheres\n\n\t// SL Lightness crispening factor\n\t// a background with L=50 is assumed\n\tlet lsq = (Ldash - 50) ** 2;\n\tlet SL = 1 + ((0.015 * lsq) / Math.sqrt(20 + lsq));\n\n\t// SC Chroma factor, similar to those in CMC and deltaE 94 formulae\n\tlet SC = 1 + 0.045 * Cdash;\n\n\t// Cross term T for blue non-linearity\n\tlet T = 1;\n\tT -= (0.17 * Math.cos(( hdash - 30) * d2r));\n\tT += (0.24 * Math.cos( 2 * hdash * d2r));\n\tT += (0.32 * Math.cos(((3 * hdash) + 6) * d2r));\n\tT -= (0.20 * Math.cos(((4 * hdash) - 63) * d2r));\n\n\t// SH Hue factor depends on Chroma,\n\t// as well as adjusted hue angle like deltaE94.\n\tlet SH = 1 + 0.015 * Cdash * T;\n\n\t// RT Hue rotation term compensates for rotation of JND ellipses\n\t// and Munsell constant hue lines\n\t// in the medium-high Chroma blue region\n\t// (Hue 225 to 315)\n\tlet \u0394\u03B8 = 30 * Math.exp(-1 * (((hdash - 275) / 25) ** 2));\n\tlet RC = 2 * Math.sqrt(Cdash7 / (Cdash7 + Gfactor));\n\tlet RT = -1 * Math.sin(2 * \u0394\u03B8 * d2r) * RC;\n\n\t// Finally calculate the deltaE, term by term as root sume of squares\n\tlet dE = (\u0394L / (kL * SL)) ** 2;\n\tdE += (\u0394C / (kC * SC)) ** 2;\n\tdE += (\u0394H / (kH * SH)) ** 2;\n\tdE += RT * (\u0394C / (kC * SC)) * (\u0394H / (kH * SH));\n\treturn Math.sqrt(dE);\n\t// Yay!!!\n}\n", "import ColorSpace from \"../space.js\";\nimport {multiplyMatrices} from \"../util.js\";\nimport XYZ_D65 from \"./xyz-d65.js\";\n\n// Recalculated for consistent reference white\n// see https://github.com/w3c/csswg-drafts/issues/6642#issuecomment-943521484\nconst XYZtoLMS_M = [\n\t[ 0.8190224379967030, 0.3619062600528904, -0.1288737815209879 ],\n\t[ 0.0329836539323885, 0.9292868615863434, 0.0361446663506424 ],\n\t[ 0.0481771893596242, 0.2642395317527308, 0.6335478284694309 ],\n];\n// inverse of XYZtoLMS_M\nconst LMStoXYZ_M = [\n\t[ 1.2268798758459243, -0.5578149944602171, 0.2813910456659647 ],\n\t[ -0.0405757452148008, 1.1122868032803170, -0.0717110580655164 ],\n\t[ -0.0763729366746601, -0.4214933324022432, 1.5869240198367816 ],\n];\nconst LMStoLab_M = [\n\t[ 0.2104542683093140, 0.7936177747023054, -0.0040720430116193 ],\n\t[ 1.9779985324311684, -2.4285922420485799, 0.4505937096174110 ],\n\t[ 0.0259040424655478, 0.7827717124575296, -0.8086757549230774 ],\n];\n// LMStoIab_M inverted\nconst LabtoLMS_M = [\n\t[ 1.0000000000000000, 0.3963377773761749, 0.2158037573099136 ],\n\t[ 1.0000000000000000, -0.1055613458156586, -0.0638541728258133 ],\n\t[ 1.0000000000000000, -0.0894841775298119, -1.2914855480194092 ],\n];\n\nexport default new ColorSpace({\n\tid: \"oklab\",\n\tname: \"Oklab\",\n\tcoords: {\n\t\tl: {\n\t\t\trefRange: [0, 1],\n\t\t\tname: \"Lightness\",\n\t\t},\n\t\ta: {\n\t\t\trefRange: [-0.4, 0.4],\n\t\t},\n\t\tb: {\n\t\t\trefRange: [-0.4, 0.4],\n\t\t},\n\t},\n\n\t// Note that XYZ is relative to D65\n\twhite: \"D65\",\n\tbase: XYZ_D65,\n\tfromBase (XYZ) {\n\t\t// move to LMS cone domain\n\t\tlet LMS = multiplyMatrices(XYZtoLMS_M, XYZ);\n\n\t\t// non-linearity\n\t\tlet LMSg = LMS.map(val => Math.cbrt(val));\n\n\t\treturn multiplyMatrices(LMStoLab_M, LMSg);\n\n\t},\n\ttoBase (OKLab) {\n\t\t// move to LMS cone domain\n\t\tlet LMSg = multiplyMatrices(LabtoLMS_M, OKLab);\n\n\t\t// restore linearity\n\t\tlet LMS = LMSg.map(val => val ** 3);\n\n\t\treturn multiplyMatrices(LMStoXYZ_M, LMS);\n\t},\n\n\tformats: {\n\t\t\"oklab\": {\n\t\t\tcoords: [\" | \", \" | [-1,1]\", \" | [-1,1]\"],\n\t\t},\n\t},\n});\n", "// More accurate color-difference formulae\n// than the simple 1976 Euclidean distance in CIE Lab\n\nimport oklab from \"../spaces/oklab.js\";\nimport getColor from \"../getColor.js\";\n\nexport default function (color, sample) {\n\t[color, sample] = getColor([color, sample]);\n\n\t// Given this color as the reference\n\t// and a sample,\n\t// calculate deltaEOK, term by term as root sum of squares\n\tlet [L1, a1, b1] = oklab.from(color);\n\tlet [L2, a2, b2] = oklab.from(sample);\n\tlet \u0394L = L1 - L2;\n\tlet \u0394a = a1 - a2;\n\tlet \u0394b = b1 - b2;\n\treturn Math.sqrt(\u0394L ** 2 + \u0394a ** 2 + \u0394b ** 2);\n}\n", "import ColorSpace from \"./space.js\";\nimport getColor from \"./getColor.js\";\n\nconst \u03B5 = .000075;\n\n/**\n * Check if a color is in gamut of either its own or another color space\n * @return {Boolean} Is the color in gamut?\n */\nexport default function inGamut (color, space, {epsilon = \u03B5} = {}) {\n\tcolor = getColor(color);\n\n\tif (!space) {\n\t\tspace = color.space;\n\t}\n\n\tspace = ColorSpace.get(space);\n\tlet coords = color.coords;\n\n\tif (space !== color.space) {\n\t\tcoords = space.from(color);\n\t}\n\n\treturn space.inGamut(coords, {epsilon});\n}\n", "export default function clone (color) {\n\treturn {\n\t\tspace: color.space,\n\t\tcoords: color.coords.slice(),\n\t\talpha: color.alpha,\n\t};\n}\n", "import ColorSpace from \"./space.js\";\n\n/**\n * Euclidean distance of colors in an arbitrary color space\n */\nexport default function distance (color1, color2, space = \"lab\") {\n\tspace = ColorSpace.get(space);\n\n\t// Assume getColor() is called on color in space.from()\n\tlet coords1 = space.from(color1);\n\tlet coords2 = space.from(color2);\n\n\treturn Math.sqrt(coords1.reduce((acc, c1, i) => {\n\t\tlet c2 = coords2[i];\n\t\tif (isNaN(c1) || isNaN(c2)) {\n\t\t\treturn acc;\n\t\t}\n\n\t\treturn acc + (c2 - c1) ** 2;\n\t}, 0));\n}\n", "import distance from \"../distance.js\";\nimport getColor from \"../getColor.js\";\n\nexport default function deltaE76 (color, sample) {\n\t// Assume getColor() is called in the distance function\n\treturn distance(color, sample, \"lab\");\n}\n", "import lab from \"../spaces/lab.js\";\nimport lch from \"../spaces/lch.js\";\nimport getColor from \"../getColor.js\";\n\n// More accurate color-difference formulae\n// than the simple 1976 Euclidean distance in Lab\n\n// CMC by the Color Measurement Committee of the\n// Bradford Society of Dyeists and Colorsts, 1994.\n// Uses LCH rather than Lab,\n// with different weights for L, C and H differences\n// A nice increase in accuracy for modest increase in complexity\nconst \u03C0 = Math.PI;\nconst d2r = \u03C0 / 180;\n\nexport default function (color, sample, {l = 2, c = 1} = {}) {\n\t[color, sample] = getColor([color, sample]);\n\n\t// Given this color as the reference\n\t// and a sample,\n\t// calculate deltaE CMC.\n\n\t// This implementation assumes the parametric\n\t// weighting factors l:c are 2:1\n\t// which is typical for non-textile uses.\n\n\tlet [L1, a1, b1] = lab.from(color);\n\tlet [, C1, H1] = lch.from(lab, [L1, a1, b1]);\n\tlet [L2, a2, b2] = lab.from(sample);\n\tlet C2 = lch.from(lab, [L2, a2, b2])[1];\n\n\t// let [L1, a1, b1] = color.getAll(lab);\n\t// let C1 = color.get(\"lch.c\");\n\t// let H1 = color.get(\"lch.h\");\n\t// let [L2, a2, b2] = sample.getAll(lab);\n\t// let C2 = sample.get(\"lch.c\");\n\n\t// Check for negative Chroma,\n\t// which might happen through\n\t// direct user input of LCH values\n\n\tif (C1 < 0) {\n\t\tC1 = 0;\n\t}\n\tif (C2 < 0) {\n\t\tC2 = 0;\n\t}\n\n\t// we don't need H2 as \u0394H is calculated from \u0394a, \u0394b and \u0394C\n\n\t// Lightness and Chroma differences\n\t// These are (color - sample), unlike deltaE2000\n\tlet \u0394L = L1 - L2;\n\tlet \u0394C = C1 - C2;\n\n\tlet \u0394a = a1 - a2;\n\tlet \u0394b = b1 - b2;\n\n\t// weighted Hue difference, less for larger Chroma difference\n\n\tlet H2 = (\u0394a ** 2) + (\u0394b ** 2) - (\u0394C ** 2);\n\t// due to roundoff error it is possible that, for zero a and b,\n\t// \u0394C > \u0394a + \u0394b is 0, resulting in attempting\n\t// to take the square root of a negative number\n\n\t// trying instead the equation from Industrial Color Physics\n\t// By Georg A. Klein\n\n\t// let \u0394H = ((a1 * b2) - (a2 * b1)) / Math.sqrt(0.5 * ((C2 * C1) + (a2 * a1) + (b2 * b1)));\n\t// console.log({\u0394H});\n\t// This gives the same result to 12 decimal places\n\t// except it sometimes NaNs when trying to root a negative number\n\n\t// let \u0394H = Math.sqrt(H2); we never actually use the root, it gets squared again!!\n\n\t// positional corrections to the lack of uniformity of CIELAB\n\t// These are all trying to make JND ellipsoids more like spheres\n\n\t// SL Lightness crispening factor, depends entirely on L1 not L2\n\tlet SL = 0.511;\t// linear portion of the Y to L transfer function\n\tif (L1 >= 16) {\t// cubic portion\n\t\tSL = (0.040975 * L1) / (1 + 0.01765 * L1);\n\t}\n\n\t// SC Chroma factor\n\tlet SC = ((0.0638 * C1) / (1 + 0.0131 * C1)) + 0.638;\n\n\t// Cross term T for blue non-linearity\n\tlet T;\n\tif (Number.isNaN(H1)) {\n\t\tH1 = 0;\n\t}\n\n\tif (H1 >= 164 && H1 <= 345) {\n\t\tT = 0.56 + Math.abs(0.2 * Math.cos((H1 + 168) * d2r));\n\t}\n\telse {\n\t\tT = 0.36 + Math.abs(0.4 * Math.cos((H1 + 35) * d2r));\n\t}\n\t// console.log({T});\n\n\t// SH Hue factor also depends on C1,\n\tlet C4 = Math.pow(C1, 4);\n\tlet F = Math.sqrt(C4 / (C4 + 1900));\n\tlet SH = SC * ((F * T) + 1 - F);\n\n\t// Finally calculate the deltaE, term by term as root sume of squares\n\tlet dE = (\u0394L / (l * SL)) ** 2;\n\tdE += (\u0394C / (c * SC)) ** 2;\n\tdE += (H2 / (SH ** 2));\n\t// dE += (\u0394H / SH) ** 2;\n\treturn Math.sqrt(dE);\n\t// Yay!!!\n}\n", "import ColorSpace from \"../space.js\";\nimport XYZ_D65 from \"./xyz-d65.js\";\n\nconst Yw = 203;\t// absolute luminance of media white\n\nexport default new ColorSpace({\n// Absolute CIE XYZ, with a D65 whitepoint,\n// as used in most HDR colorspaces as a starting point.\n// SDR spaces are converted per BT.2048\n// so that diffuse, media white is 203 cd/m\u00B2\n\tid: \"xyz-abs-d65\",\n\tcssId: \"--xyz-abs-d65\",\n\tname: \"Absolute XYZ D65\",\n\tcoords: {\n\t\tx: {\n\t\t\trefRange: [0, 9504.7],\n\t\t\tname: \"Xa\",\n\t\t},\n\t\ty: {\n\t\t\trefRange: [0, 10000],\n\t\t\tname: \"Ya\",\n\t\t},\n\t\tz: {\n\t\t\trefRange: [0, 10888.3],\n\t\t\tname: \"Za\",\n\t\t},\n\t},\n\n\tbase: XYZ_D65,\n\tfromBase (XYZ) {\n\t\t// Make XYZ absolute, not relative to media white\n\t\t// Maximum luminance in PQ is 10,000 cd/m\u00B2\n\t\t// Relative XYZ has Y=1 for media white\n\t\treturn XYZ.map (v => Math.max(v * Yw, 0));\n\t},\n\ttoBase (AbsXYZ) {\n\t\t// Convert to media-white relative XYZ\n\t\treturn AbsXYZ.map(v => Math.max(v / Yw, 0));\n\t},\n});\n", "import ColorSpace from \"../space.js\";\nimport {multiplyMatrices} from \"../util.js\";\nimport XYZ_Abs_D65 from \"./xyz-abs-d65.js\";\n\nconst b = 1.15;\nconst g = 0.66;\nconst n = 2610 / (2 ** 14);\nconst ninv = (2 ** 14) / 2610;\nconst c1 = 3424 / (2 ** 12);\nconst c2 = 2413 / (2 ** 7);\nconst c3 = 2392 / (2 ** 7);\nconst p = 1.7 * 2523 / (2 ** 5);\nconst pinv = (2 ** 5) / (1.7 * 2523);\nconst d = -0.56;\nconst d0 = 1.6295499532821566E-11;\n\nconst XYZtoCone_M = [\n\t[ 0.41478972, 0.579999, 0.0146480 ],\n\t[ -0.2015100, 1.120649, 0.0531008 ],\n\t[ -0.0166008, 0.264800, 0.6684799 ],\n];\n// XYZtoCone_M inverted\nconst ConetoXYZ_M = [\n\t[ 1.9242264357876067, -1.0047923125953657, 0.037651404030618 ],\n\t[ 0.35031676209499907, 0.7264811939316552, -0.06538442294808501 ],\n\t[ -0.09098281098284752, -0.3127282905230739, 1.5227665613052603 ],\n];\nconst ConetoIab_M = [\n\t[ 0.5, 0.5, 0 ],\n\t[ 3.524000, -4.066708, 0.542708 ],\n\t[ 0.199076, 1.096799, -1.295875 ],\n];\n// ConetoIab_M inverted\nconst IabtoCone_M = [\n\t[ 1, 0.1386050432715393, 0.05804731615611886 ],\n\t[ 0.9999999999999999, -0.1386050432715393, -0.05804731615611886 ],\n\t[ 0.9999999999999998, -0.09601924202631895, -0.8118918960560388 ],\n];\n\nexport default new ColorSpace({\n\tid: \"jzazbz\",\n\tname: \"Jzazbz\",\n\tcoords: {\n\t\tjz: {\n\t\t\trefRange: [0, 1],\n\t\t\tname: \"Jz\",\n\t\t},\n\t\taz: {\n\t\t\trefRange: [-0.5, 0.5],\n\t\t},\n\t\tbz: {\n\t\t\trefRange: [-0.5, 0.5],\n\t\t},\n\t},\n\n\tbase: XYZ_Abs_D65,\n\tfromBase (XYZ) {\n\t\t// First make XYZ absolute, not relative to media white\n\t\t// Maximum luminance in PQ is 10,000 cd/m\u00B2\n\t\t// Relative XYZ has Y=1 for media white\n\t\t// BT.2048 says media white Y=203 at PQ 58\n\n\t\tlet [ Xa, Ya, Za ] = XYZ;\n\n\t\t// modify X and Y\n\t\tlet Xm = (b * Xa) - ((b - 1) * Za);\n\t\tlet Ym = (g * Ya) - ((g - 1) * Xa);\n\n\t\t// move to LMS cone domain\n\t\tlet LMS = multiplyMatrices(XYZtoCone_M, [ Xm, Ym, Za ]);\n\n\t\t// PQ-encode LMS\n\t\tlet PQLMS = LMS.map (function (val) {\n\t\t\tlet num = c1 + (c2 * ((val / 10000) ** n));\n\t\t\tlet denom = 1 + (c3 * ((val / 10000) ** n));\n\n\t\t\treturn (num / denom) ** p;\n\t\t});\n\n\t\t// almost there, calculate Iz az bz\n\t\tlet [ Iz, az, bz] = multiplyMatrices(ConetoIab_M, PQLMS);\n\t\t// console.log({Iz, az, bz});\n\n\t\tlet Jz = ((1 + d) * Iz) / (1 + (d * Iz)) - d0;\n\t\treturn [Jz, az, bz];\n\t},\n\ttoBase (Jzazbz) {\n\t\tlet [Jz, az, bz] = Jzazbz;\n\t\tlet Iz = (Jz + d0) / (1 + d - d * (Jz + d0));\n\n\t\t// bring into LMS cone domain\n\t\tlet PQLMS = multiplyMatrices(IabtoCone_M, [ Iz, az, bz ]);\n\n\t\t// convert from PQ-coded to linear-light\n\t\tlet LMS = PQLMS.map(function (val) {\n\t\t\tlet num = (c1 - (val ** pinv));\n\t\t\tlet denom = (c3 * (val ** pinv)) - c2;\n\t\t\tlet x = 10000 * ((num / denom) ** ninv);\n\n\t\t\treturn (x); \t// luminance relative to diffuse white, [0, 70 or so].\n\t\t});\n\n\t\t// modified abs XYZ\n\t\tlet [ Xm, Ym, Za ] = multiplyMatrices(ConetoXYZ_M, LMS);\n\n\t\t// restore standard D50 relative XYZ, relative to media white\n\t\tlet Xa = (Xm + ((b - 1) * Za)) / b;\n\t\tlet Ya = (Ym + ((g - 1) * Xa)) / g;\n\t\treturn [ Xa, Ya, Za ];\n\t},\n\n\tformats: {\n\t\t// https://drafts.csswg.org/css-color-hdr/#Jzazbz\n\t\t\"color\": {\n\t\t\tcoords: [\" | \", \" | [-1,1]\", \" | [-1,1]\"],\n\t\t},\n\t},\n});\n", "import ColorSpace from \"../space.js\";\nimport Jzazbz from \"./jzazbz.js\";\nimport {constrain as constrainAngle} from \"../angles.js\";\n\nexport default new ColorSpace({\n\tid: \"jzczhz\",\n\tname: \"JzCzHz\",\n\tcoords: {\n\t\tjz: {\n\t\t\trefRange: [0, 1],\n\t\t\tname: \"Jz\",\n\t\t},\n\t\tcz: {\n\t\t\trefRange: [0, 1],\n\t\t\tname: \"Chroma\",\n\t\t},\n\t\thz: {\n\t\t\trefRange: [0, 360],\n\t\t\ttype: \"angle\",\n\t\t\tname: \"Hue\",\n\t\t},\n\t},\n\n\tbase: Jzazbz,\n\tfromBase (jzazbz) {\n\t\t// Convert to polar form\n\t\tlet [Jz, az, bz] = jzazbz;\n\t\tlet hue;\n\t\tconst \u03B5 = 0.0002; // chromatic components much smaller than a,b\n\n\t\tif (Math.abs(az) < \u03B5 && Math.abs(bz) < \u03B5) {\n\t\t\thue = NaN;\n\t\t}\n\t\telse {\n\t\t\thue = Math.atan2(bz, az) * 180 / Math.PI;\n\t\t}\n\n\t\treturn [\n\t\t\tJz, // Jz is still Jz\n\t\t\tMath.sqrt(az ** 2 + bz ** 2), // Chroma\n\t\t\tconstrainAngle(hue), // Hue, in degrees [0 to 360)\n\t\t];\n\t},\n\ttoBase (jzczhz) {\n\t\t// Convert from polar form\n\t\t// debugger;\n\t\treturn [\n\t\t\tjzczhz[0], // Jz is still Jz\n\t\t\tjzczhz[1] * Math.cos(jzczhz[2] * Math.PI / 180), // az\n\t\t\tjzczhz[1] * Math.sin(jzczhz[2] * Math.PI / 180), // bz\n\t\t];\n\t},\n});\n", "import jzczhz from \"../spaces/jzczhz.js\";\nimport getColor from \"../getColor.js\";\n\n// More accurate color-difference formulae\n// than the simple 1976 Euclidean distance in Lab\n\n// Uses JzCzHz, which has improved perceptual uniformity\n// and thus a simple Euclidean root-sum of \u0394L\u00B2 \u0394C\u00B2 \u0394H\u00B2\n// gives good results.\n\nexport default function (color, sample) {\n\t[color, sample] = getColor([color, sample]);\n\n\t// Given this color as the reference\n\t// and a sample,\n\t// calculate deltaE in JzCzHz.\n\tlet [Jz1, Cz1, Hz1] = jzczhz.from(color);\n\tlet [Jz2, Cz2, Hz2] = jzczhz.from(sample);\n\n\t// Lightness and Chroma differences\n\t// sign does not matter as they are squared.\n\tlet \u0394J = Jz1 - Jz2;\n\tlet \u0394C = Cz1 - Cz2;\n\n\t// length of chord for \u0394H\n\tif ((Number.isNaN(Hz1)) && (Number.isNaN(Hz2))) {\n\t\t// both undefined hues\n\t\tHz1 = 0;\n\t\tHz2 = 0;\n\t}\n\telse if (Number.isNaN(Hz1)) {\n\t\t// one undefined, set to the defined hue\n\t\tHz1 = Hz2;\n\t}\n\telse if (Number.isNaN(Hz2)) {\n\t\tHz2 = Hz1;\n\t}\n\n\tlet \u0394h = Hz1 - Hz2;\n\tlet \u0394H = 2 * Math.sqrt(Cz1 * Cz2) * Math.sin((\u0394h / 2) * (Math.PI / 180));\n\n\treturn Math.sqrt(\u0394J ** 2 + \u0394C ** 2 + \u0394H ** 2);\n}\n", "import ColorSpace from \"../space.js\";\nimport {multiplyMatrices} from \"../util.js\";\nimport XYZ_Abs_D65 from \"./xyz-abs-d65.js\";\n\nconst c1 = 3424 / 4096;\nconst c2 = 2413 / 128;\nconst c3 = 2392 / 128;\nconst m1 = 2610 / 16384;\nconst m2 = 2523 / 32;\nconst im1 = 16384 / 2610;\nconst im2 = 32 / 2523;\n\n// The matrix below includes the 4% crosstalk components\n// and is from the Dolby \"What is ICtCp\" paper\"\nconst XYZtoLMS_M = [\n\t[ 0.3592832590121217, 0.6976051147779502, -0.0358915932320290 ],\n\t[ -0.1920808463704993, 1.1004767970374321, 0.0753748658519118 ],\n\t[ 0.0070797844607479, 0.0748396662186362, 0.8433265453898765 ],\n];\n// linear-light Rec.2020 to LMS, again with crosstalk\n// rational terms from Jan Fr\u00F6hlich,\n// Encoding High Dynamic Range andWide Color Gamut Imagery, p.97\n// and ITU-R BT.2124-0 p.2\n/*\nconst Rec2020toLMS_M = [\n\t[ 1688 / 4096, 2146 / 4096, 262 / 4096 ],\n\t[ 683 / 4096, 2951 / 4096, 462 / 4096 ],\n\t[ 99 / 4096, 309 / 4096, 3688 / 4096 ]\n];\n*/\n// this includes the Ebner LMS coefficients,\n// the rotation, and the scaling to [-0.5,0.5] range\n// rational terms from Fr\u00F6hlich p.97\n// and ITU-R BT.2124-0 pp.2-3\nconst LMStoIPT_M = [\n\t[ 2048 / 4096, 2048 / 4096, 0 ],\n\t[ 6610 / 4096, -13613 / 4096, 7003 / 4096 ],\n\t[ 17933 / 4096, -17390 / 4096, -543 / 4096 ],\n];\n\n// inverted matrices, calculated from the above\nconst IPTtoLMS_M = [\n\t[ 0.9999999999999998, 0.0086090370379328, 0.1110296250030260 ],\n\t[ 0.9999999999999998, -0.0086090370379328, -0.1110296250030259 ],\n\t[ 0.9999999999999998, 0.5600313357106791, -0.3206271749873188 ],\n];\n/*\nconst LMStoRec2020_M = [\n\t[ 3.4375568932814012112, -2.5072112125095058195, 0.069654319228104608382],\n\t[-0.79142868665644156125, 1.9838372198740089874, -0.19240853321756742626 ],\n\t[-0.025646662911506476363, -0.099240248643945566751, 1.1248869115554520431 ]\n];\n*/\nconst LMStoXYZ_M = [\n\t[ 2.0701522183894223, -1.3263473389671563, 0.2066510476294053 ],\n\t[ 0.3647385209748072, 0.6805660249472273, -0.0453045459220347 ],\n\t[ -0.0497472075358123, -0.0492609666966131, 1.1880659249923042 ],\n];\n\n// Only the PQ form of ICtCp is implemented here. There is also an HLG form.\n// from Dolby, \"WHAT IS ICTCP?\"\n// https://professional.dolby.com/siteassets/pdfs/ictcp_dolbywhitepaper_v071.pdf\n// and\n// Dolby, \"Perceptual Color Volume\n// Measuring the Distinguishable Colors of HDR and WCG Displays\"\n// https://professional.dolby.com/siteassets/pdfs/dolby-vision-measuring-perceptual-color-volume-v7.1.pdf\nexport default new ColorSpace({\n\tid: \"ictcp\",\n\tname: \"ICTCP\",\n\t// From BT.2100-2 page 7:\n\t// During production, signal values are expected to exceed the\n\t// range E\u2032 = [0.0 : 1.0]. This provides processing headroom and avoids\n\t// signal degradation during cascaded processing. Such values of E\u2032,\n\t// below 0.0 or exceeding 1.0, should not be clipped during production\n\t// and exchange.\n\t// Values below 0.0 should not be clipped in reference displays (even\n\t// though they represent \u201Cnegative\u201D light) to allow the black level of\n\t// the signal (LB) to be properly set using test signals known as \u201CPLUGE\u201D\n\tcoords: {\n\t\ti: {\n\t\t\trefRange: [0, 1],\t// Constant luminance,\n\t\t\tname: \"I\",\n\t\t},\n\t\tct: {\n\t\t\trefRange: [-0.5, 0.5],\t// Full BT.2020 gamut in range [-0.5, 0.5]\n\t\t\tname: \"CT\",\n\t\t},\n\t\tcp: {\n\t\t\trefRange: [-0.5, 0.5],\n\t\t\tname: \"CP\",\n\t\t},\n\t},\n\n\tbase: XYZ_Abs_D65,\n\tfromBase (XYZ) {\n\t\t// move to LMS cone domain\n\t\tlet LMS = multiplyMatrices(XYZtoLMS_M, XYZ);\n\n\t\treturn LMStoICtCp(LMS);\n\t},\n\ttoBase (ICtCp) {\n\t\tlet LMS = ICtCptoLMS(ICtCp);\n\n\t\treturn multiplyMatrices(LMStoXYZ_M, LMS);\n\t},\n});\n\nfunction LMStoICtCp (LMS) {\n\t// apply the PQ EOTF\n\t// we can't ever be dividing by zero because of the \"1 +\" in the denominator\n\tlet PQLMS = LMS.map (function (val) {\n\t\tlet num = c1 + (c2 * ((val / 10000) ** m1));\n\t\tlet denom = 1 + (c3 * ((val / 10000) ** m1));\n\n\t\treturn (num / denom) ** m2;\n\t});\n\n\t// LMS to IPT, with rotation for Y'C'bC'r compatibility\n\treturn multiplyMatrices(LMStoIPT_M, PQLMS);\n}\n\nfunction ICtCptoLMS (ICtCp) {\n\tlet PQLMS = multiplyMatrices(IPTtoLMS_M, ICtCp);\n\n\t// From BT.2124-0 Annex 2 Conversion 3\n\tlet LMS = PQLMS.map (function (val) {\n\t\tlet num = Math.max((val ** im2) - c1, 0);\n\t\tlet denom = (c2 - (c3 * (val ** im2)));\n\t\treturn 10000 * ((num / denom) ** im1);\n\t});\n\n\treturn LMS;\n}\n", "import ictcp from \"../spaces/ictcp.js\";\nimport getColor from \"../getColor.js\";\n\n// Delta E in ICtCp space,\n// which the ITU calls Delta E ITP, which is shorter\n// formulae from ITU Rec. ITU-R BT.2124-0\n\nexport default function (color, sample) {\n\t[color, sample] = getColor([color, sample]);\n\n\t// Given this color as the reference\n\t// and a sample,\n\t// calculate deltaE in ICtCp\n\t// which is simply the Euclidean distance\n\n\tlet [ I1, T1, P1 ] = ictcp.from(color);\n\tlet [ I2, T2, P2 ] = ictcp.from(sample);\n\n\t// the 0.25 factor is to undo the encoding scaling in Ct\n\t// the 720 is so that 1 deltaE = 1 JND\n\t// per ITU-R BT.2124-0 p.3\n\n\treturn 720 * Math.sqrt((I1 - I2) ** 2 + (0.25 * (T1 - T2) ** 2) + (P1 - P2) ** 2);\n}\n", "import ColorSpace from \"../space.js\";\nimport {multiplyMatrices, interpolate, copySign, spow, zdiv, bisectLeft} from \"../util.js\";\nimport {constrain} from \"../angles.js\";\nimport xyz_d65 from \"./xyz-d65.js\";\nimport {WHITES} from \"../adapt.js\";\n\nconst white = WHITES.D65;\nconst adaptedCoef = 0.42;\nconst adaptedCoefInv = 1 / adaptedCoef;\nconst tau = 2 * Math.PI;\n\nconst cat16 = [\n\t[ 0.401288, 0.650173, -0.051461 ],\n\t[ -0.250268, 1.204414, 0.045854 ],\n\t[ -0.002079, 0.048952, 0.953127 ],\n];\n\nconst cat16Inv = [\n\t[1.8620678550872327, -1.0112546305316843, 0.14918677544445175],\n\t[0.38752654323613717, 0.6214474419314753, -0.008973985167612518],\n\t[-0.015841498849333856, -0.03412293802851557, 1.0499644368778496],\n];\n\nconst m1 = [\n\t[460.0, 451.0, 288.0],\n\t[460.0, -891.0, -261.0],\n\t[460.0, -220.0, -6300.0],\n];\n\nconst surroundMap = {\n\tdark: [0.8, 0.525, 0.8],\n\tdim: [0.9, 0.59, 0.9],\n\taverage: [1, 0.69, 1],\n};\n\nconst hueQuadMap = {\n\t// Red, Yellow, Green, Blue, Red\n\th: [20.14, 90.00, 164.25, 237.53, 380.14],\n\te: [0.8, 0.7, 1.0, 1.2, 0.8],\n\tH: [0.0, 100.0, 200.0, 300.0, 400.0],\n};\n\nconst rad2deg = 180 / Math.PI;\nconst deg2rad = Math.PI / 180;\n\nexport function adapt (coords, fl) {\n\tconst temp = coords.map(c => {\n\t\tconst x = spow(fl * Math.abs(c) * 0.01, adaptedCoef);\n\t\treturn 400 * copySign(x, c) / (x + 27.13);\n\t});\n\treturn temp;\n}\n\nexport function unadapt (adapted, fl) {\n\tconst constant = 100 / fl * (27.13 ** adaptedCoefInv);\n\treturn adapted.map(c => {\n\t\tconst cabs = Math.abs(c);\n\t\treturn copySign(constant * spow(cabs / (400 - cabs), adaptedCoefInv), c);\n\t});\n}\n\nexport function hueQuadrature (h) {\n\tlet hp = constrain(h);\n\tif (hp <= hueQuadMap.h[0]) {\n\t\thp += 360;\n\t}\n\n\tconst i = bisectLeft(hueQuadMap.h, hp) - 1;\n\tconst [hi, hii] = hueQuadMap.h.slice(i, i + 2);\n\tconst [ei, eii] = hueQuadMap.e.slice(i, i + 2);\n\tconst Hi = hueQuadMap.H[i];\n\n\tconst t = (hp - hi) / ei;\n\treturn Hi + (100 * t) / (t + (hii - hp) / eii);\n}\n\nexport function invHueQuadrature (H) {\n\tlet Hp = ((H % 400 + 400) % 400);\n\tconst i = Math.floor(0.01 * Hp);\n\tHp = Hp % 100;\n\tconst [hi, hii] = hueQuadMap.h.slice(i, i + 2);\n\tconst [ei, eii] = hueQuadMap.e.slice(i, i + 2);\n\n\treturn constrain(\n\t\t(Hp * (eii * hi - ei * hii) - 100 * hi * eii) /\n\t\t(Hp * (eii - ei) - 100 * eii),\n\t);\n}\n\nexport function environment (\n\trefWhite,\n\tadaptingLuminance,\n\tbackgroundLuminance,\n\tsurround,\n\tdiscounting,\n) {\n\n\tconst env = {};\n\n\tenv.discounting = discounting;\n\tenv.refWhite = refWhite;\n\tenv.surround = surround;\n\tconst xyzW = refWhite.map(c => {\n\t\treturn c * 100;\n\t});\n\n\t// The average luminance of the environment in `cd/m^2cd/m` (a.k.a. nits)\n\tenv.la = adaptingLuminance;\n\t// The relative luminance of the nearby background\n\tenv.yb = backgroundLuminance;\n\t// Absolute luminance of the reference white.\n\tconst yw = xyzW[1];\n\n\t// Cone response for reference white\n\tconst rgbW = multiplyMatrices(cat16, xyzW);\n\n\t// Surround: dark, dim, and average\n\tsurround = surroundMap[env.surround];\n\tconst f = surround[0];\n\tenv.c = surround[1];\n\tenv.nc = surround[2];\n\n\tconst k = 1 / (5 * env.la + 1);\n\tconst k4 = k ** 4;\n\n\t// Factor of luminance level adaptation\n\tenv.fl = (k4 * env.la + 0.1 * (1 - k4) * (1 - k4) * Math.cbrt(5 * env.la));\n\tenv.flRoot = env.fl ** 0.25;\n\n\tenv.n = env.yb / yw;\n\tenv.z = 1.48 + Math.sqrt(env.n);\n\tenv.nbb = 0.725 * (env.n ** -0.2);\n\tenv.ncb = env.nbb;\n\n\t// Degree of adaptation calculating if not discounting\n\t// illuminant (assumed eye is fully adapted)\n\tconst d = (discounting) ?\n\t\t1 :\n\t\tMath.max(\n\t\t\tMath.min(f * (1 - 1 / 3.6 * Math.exp((-env.la - 42) / 92)), 1),\n\t\t\t0,\n\t\t);\n\tenv.dRgb = rgbW.map(c => {\n\t\treturn interpolate(1, yw / c, d);\n\t});\n\tenv.dRgbInv = env.dRgb.map(c => {\n\t\treturn 1 / c;\n\t});\n\n\t// Achromatic response\n\tconst rgbCW = rgbW.map((c, i) => {\n\t\treturn c * env.dRgb[i];\n\t});\n\tconst rgbAW = adapt(rgbCW, env.fl);\n\tenv.aW = env.nbb * (2 * rgbAW[0] + rgbAW[1] + 0.05 * rgbAW[2]);\n\n\t// console.log(env);\n\n\treturn env;\n}\n\n// Pre-calculate everything we can with the viewing conditions\nconst viewingConditions = environment(\n\twhite,\n\t64 / Math.PI * 0.2, 20,\n\t\"average\",\n\tfalse,\n);\n\nexport function fromCam16 (cam16, env) {\n\n\t// These check ensure one, and only one attribute for a\n\t// given category is provided.\n\tif (!((cam16.J !== undefined) ^ (cam16.Q !== undefined))) {\n\t\tthrow new Error(\"Conversion requires one and only one: 'J' or 'Q'\");\n\t}\n\n\tif (!((cam16.C !== undefined) ^ (cam16.M !== undefined) ^ (cam16.s !== undefined))) {\n\t\tthrow new Error(\"Conversion requires one and only one: 'C', 'M' or 's'\");\n\t}\n\n\t// Hue is absolutely required\n\tif (!((cam16.h !== undefined) ^ (cam16.H !== undefined))) {\n\t\tthrow new Error(\"Conversion requires one and only one: 'h' or 'H'\");\n\t}\n\n\t// Black\n\tif (cam16.J === 0.0 || cam16.Q === 0.0) {\n\t\treturn [0.0, 0.0, 0.0];\n\t}\n\n\t// Break hue into Cartesian components\n\tlet hRad = 0.0;\n\tif (cam16.h !== undefined) {\n\t\thRad = constrain(cam16.h) * deg2rad;\n\t}\n\telse {\n\t\thRad = invHueQuadrature(cam16.H) * deg2rad;\n\t}\n\n\tconst cosh = Math.cos(hRad);\n\tconst sinh = Math.sin(hRad);\n\n\t// Calculate `Jroot` from one of the lightness derived coordinates.\n\tlet Jroot = 0.0;\n\tif (cam16.J !== undefined) {\n\t\tJroot = spow(cam16.J, 1 / 2) * 0.1;\n\t}\n\telse if (cam16.Q !== undefined) {\n\t\tJroot = 0.25 * env.c * cam16.Q / ((env.aW + 4) * env.flRoot);\n\t}\n\n\t// Calculate the `t` value from one of the chroma derived coordinates\n\tlet alpha = 0.0;\n\tif (cam16.C !== undefined) {\n\t\talpha = cam16.C / Jroot;\n\t}\n\telse if (cam16.M !== undefined) {\n\t\talpha = (cam16.M / env.flRoot) / Jroot;\n\t}\n\telse if (cam16.s !== undefined) {\n\t\talpha = 0.0004 * (cam16.s ** 2) * (env.aW + 4) / env.c;\n\t}\n\tconst t = spow(\n\t\talpha * Math.pow(1.64 - Math.pow(0.29, env.n), -0.73),\n\t\t10 / 9,\n\t);\n\n\t// Eccentricity\n\tconst et = 0.25 * (Math.cos(hRad + 2) + 3.8);\n\n\t// Achromatic response\n\tconst A = env.aW * spow(Jroot, 2 / env.c / env.z);\n\n\t// Calculate red-green and yellow-blue components\n\tconst p1 = 5e4 / 13 * env.nc * env.ncb * et;\n\tconst p2 = A / env.nbb;\n\tconst r = (\n\t\t23 * (p2 + 0.305) *\n\t\tzdiv(t, 23 * p1 + t * (11 * cosh + 108 * sinh))\n\t);\n\tconst a = r * cosh;\n\tconst b = r * sinh;\n\n\t// Calculate back from cone response to XYZ\n\tconst rgb_c = unadapt(\n\t\tmultiplyMatrices(m1, [p2, a, b]).map(c => {\n\t\t\treturn c * 1 / 1403;\n\t\t}),\n\t\tenv.fl,\n\t);\n\treturn multiplyMatrices(\n\t\tcat16Inv,\n\t\trgb_c.map((c, i) => {\n\t\t\treturn c * env.dRgbInv[i];\n\t\t}),\n\t).map(c => {\n\t\treturn c / 100;\n\t});\n}\n\n\nexport function toCam16 (xyzd65, env) {\n\t// Cone response\n\tconst xyz100 = xyzd65.map(c => {\n\t\treturn c * 100;\n\t});\n\tconst rgbA = adapt(\n\t\tmultiplyMatrices(cat16, xyz100).map((c, i) => {\n\t\t\treturn c * env.dRgb[i];\n\t\t}),\n\t\tenv.fl,\n\t);\n\n\t// Calculate hue from red-green and yellow-blue components\n\tconst a = rgbA[0] + (-12 * rgbA[1] + rgbA[2]) / 11;\n\tconst b = (rgbA[0] + rgbA[1] - 2 * rgbA[2]) / 9;\n\tconst hRad = ((Math.atan2(b, a) % tau) + tau) % tau;\n\n\t// Eccentricity\n\tconst et = 0.25 * (Math.cos(hRad + 2) + 3.8);\n\n\tconst t = (\n\t\t5e4 / 13 * env.nc * env.ncb *\n\t\tzdiv(\n\t\t\tet * Math.sqrt(a ** 2 + b ** 2),\n\t\t\trgbA[0] + rgbA[1] + 1.05 * rgbA[2] + 0.305,\n\t\t)\n\t);\n\tconst alpha = spow(t, 0.9) * Math.pow(1.64 - Math.pow(0.29, env.n), 0.73);\n\n\t// Achromatic response\n\tconst A = env.nbb * (2 * rgbA[0] + rgbA[1] + 0.05 * rgbA[2]);\n\n\tconst Jroot = spow(A / env.aW, 0.5 * env.c * env.z);\n\n\t// Lightness\n\tconst J = 100 * spow(Jroot, 2);\n\n\t// Brightness\n\tconst Q = (4 / env.c * Jroot * (env.aW + 4) * env.flRoot);\n\n\t// Chroma\n\tconst C = alpha * Jroot;\n\n\t// Colorfulness\n\tconst M = C * env.flRoot;\n\n\t// Hue\n\tconst h = constrain(hRad * rad2deg);\n\n\t// Hue quadrature\n\tconst H = hueQuadrature(h);\n\n\t// Saturation\n\tconst s = 50 * spow(env.c * alpha / (env.aW + 4), 1 / 2);\n\n\t// console.log({J: J, C: C, h: h, s: s, Q: Q, M: M, H: H});\n\n\treturn {J: J, C: C, h: h, s: s, Q: Q, M: M, H: H};\n}\n\n\n// Provided as a way to directly evaluate the CAM16 model\n// https://observablehq.com/@jrus/cam16: reference implementation\n// https://arxiv.org/pdf/1802.06067.pdf: Nico Schl\u00F6mer\n// https://onlinelibrary.wiley.com/doi/pdf/10.1002/col.22324: hue quadrature\n// https://www.researchgate.net/publication/318152296_Comprehensive_color_solutions_CAM16_CAT16_and_CAM16-UCS\n// Results compared against: https://github.com/colour-science/colour\nexport default new ColorSpace({\n\tid: \"cam16-jmh\",\n\tcssId: \"--cam16-jmh\",\n\tname: \"CAM16-JMh\",\n\tcoords: {\n\t\tj: {\n\t\t\trefRange: [0, 100],\n\t\t\tname: \"J\",\n\t\t},\n\t\tm: {\n\t\t\trefRange: [0, 105.0],\n\t\t\tname: \"Colorfulness\",\n\t\t},\n\t\th: {\n\t\t\trefRange: [0, 360],\n\t\t\ttype: \"angle\",\n\t\t\tname: \"Hue\",\n\t\t},\n\t},\n\n\tbase: xyz_d65,\n\n\tfromBase (xyz) {\n\t\tconst cam16 = toCam16(xyz, viewingConditions);\n\t\treturn [cam16.J, cam16.M, cam16.h];\n\t},\n\ttoBase (cam16) {\n\t\treturn fromCam16(\n\t\t\t{J: cam16[0], M: cam16[1], h: cam16[2]},\n\t\t\tviewingConditions,\n\t\t);\n\t},\n});\n", "import ColorSpace from \"../space.js\";\nimport {constrain} from \"../angles.js\";\nimport xyz_d65 from \"./xyz-d65.js\";\nimport {fromCam16, toCam16, environment} from \"./cam16.js\";\nimport {WHITES} from \"../adapt.js\";\n\nconst white = WHITES.D65;\nconst \u03B5 = 216 / 24389; // 6^3/29^3 == (24/116)^3\nconst \u03BA = 24389 / 27; // 29^3/3^3\n\nfunction toLstar (y) {\n\t// Convert XYZ Y to L*\n\n\tconst fy = (y > \u03B5) ? Math.cbrt(y) : (\u03BA * y + 16) / 116;\n\treturn (116.0 * fy) - 16.0;\n}\n\nfunction fromLstar (lstar) {\n\t// Convert L* back to XYZ Y\n\n\treturn (lstar > 8) ? Math.pow((lstar + 16) / 116, 3) : lstar / \u03BA;\n}\n\nfunction fromHct (coords, env) {\n\t// Use Newton's method to try and converge as quick as possible or\n\t// converge as close as we can. While the requested precision is achieved\n\t// most of the time, it may not always be achievable. Especially past the\n\t// visible spectrum, the algorithm will likely struggle to get the same\n\t// precision. If, for whatever reason, we cannot achieve the accuracy we\n\t// seek in the allotted iterations, just return the closest we were able to\n\t// get.\n\n\tlet [h, c, t] = coords;\n\tlet xyz = [];\n\tlet j = 0;\n\n\t// Shortcut out for black\n\tif (t === 0) {\n\t\treturn [0.0, 0.0, 0.0];\n\t}\n\n\t// Calculate the Y we need to target\n\tlet y = fromLstar(t);\n\n\t// A better initial guess yields better results. Polynomials come from\n\t// curve fitting the T vs J response.\n\tif (t > 0) {\n\t\tj = 0.00379058511492914 * t ** 2 + 0.608983189401032 * t + 0.9155088574762233;\n\t}\n\telse {\n\t\tj = 9.514440756550361e-06 * t ** 2 + 0.08693057439788597 * t - 21.928975842194614;\n\t}\n\n\t// Threshold of how close is close enough, and max number of attempts.\n\t// More precision and more attempts means more time spent iterating. Higher\n\t// required precision gives more accuracy but also increases the chance of\n\t// not hitting the goal. 2e-12 allows us to convert round trip with\n\t// reasonable accuracy of six decimal places or more.\n\tconst threshold = 2e-12;\n\tconst max_attempts = 15;\n\n\tlet attempt = 0;\n\tlet last = Infinity;\n\tlet best = j;\n\n\t// Try to find a J such that the returned y matches the returned y of the L*\n\twhile (attempt <= max_attempts) {\n\t\txyz = fromCam16({J: j, C: c, h: h}, env);\n\n\t\t// If we are within range, return XYZ\n\t\t// If we are closer than last time, save the values\n\t\tconst delta = Math.abs(xyz[1] - y);\n\t\tif (delta < last) {\n\t\t\tif (delta <= threshold) {\n\t\t\t\treturn xyz;\n\t\t\t}\n\t\t\tbest = j;\n\t\t\tlast = delta;\n\t\t}\n\n\t\t// f(j_root) = (j ** (1 / 2)) * 0.1\n\t\t// f(j) = ((f(j_root) * 100) ** 2) / j - 1 = 0\n\t\t// f(j_root) = Y = y / 100\n\t\t// f(j) = (y ** 2) / j - 1\n\t\t// f'(j) = (2 * y) / j\n\t\tj = j - (xyz[1] - y) * j / (2 * xyz[1]);\n\n\t\tattempt += 1;\n\t}\n\n\t// We could not acquire the precision we desired,\n\t// return our closest attempt.\n\treturn fromCam16({J: j, C: c, h: h}, env);\n}\n\nfunction toHct (xyz, env) {\n\t// Calculate HCT by taking the L* of CIE LCh D65 and CAM16 chroma and hue.\n\n\tconst t = toLstar(xyz[1]);\n\tif (t === 0.0) {\n\t\treturn [0.0, 0.0, 0.0];\n\t}\n\tconst cam16 = toCam16(xyz, viewingConditions);\n\treturn [constrain(cam16.h), cam16.C, t];\n}\n\n// Pre-calculate everything we can with the viewing conditions\nexport const viewingConditions = environment(\n\twhite, 200 / Math.PI * fromLstar(50.0),\n\tfromLstar(50.0) * 100,\n\t\"average\",\n\tfalse,\n);\n\n// https://material.io/blog/science-of-color-design\n// This is not a port of the material-color-utilities,\n// but instead implements the full color space as described,\n// combining CAM16 JCh and Lab D65. This does not clamp conversion\n// to HCT to specific chroma bands and provides support for wider\n// gamuts than Google currently supports and does so at a greater\n// precision (> 8 bits back to sRGB).\n// This implementation comes from https://github.com/facelessuser/coloraide\n// which is licensed under MIT.\nexport default new ColorSpace({\n\tid: \"hct\",\n\tname: \"HCT\",\n\tcoords: {\n\t\th: {\n\t\t\trefRange: [0, 360],\n\t\t\ttype: \"angle\",\n\t\t\tname: \"Hue\",\n\t\t},\n\t\tc: {\n\t\t\trefRange: [0, 145],\n\t\t\tname: \"Colorfulness\",\n\t\t},\n\t\tt: {\n\t\t\trefRange: [0, 100],\n\t\t\tname: \"Tone\",\n\t\t},\n\t},\n\n\tbase: xyz_d65,\n\n\tfromBase (xyz) {\n\t\treturn toHct(xyz, viewingConditions);\n\t},\n\ttoBase (hct) {\n\t\treturn fromHct(hct, viewingConditions);\n\t},\n\tformats: {\n\t\tcolor: {\n\t\t\tid: \"--hct\",\n\t\t\tcoords: [\" | \", \" | \", \" | \"],\n\t\t},\n\t},\n});\n", "import hct from \"../spaces/hct.js\";\nimport {viewingConditions} from \"../spaces/hct.js\";\nimport getColor from \"../getColor.js\";\n\nconst rad2deg = 180 / Math.PI;\nconst deg2rad = Math.PI / 180;\nconst ucsCoeff = [1.00, 0.007, 0.0228];\n\n/**\n* Convert HCT chroma and hue (CAM16 JMh colorfulness and hue) using UCS logic for a and b.\n* @param {number[]} coords - HCT coordinates.\n* @return {number[]}\n*/\nfunction convertUcsAb (coords) {\n\t// We want the distance between the actual color.\n\t// If chroma is negative, it will throw off our calculations.\n\t// Normally, converting back to the base and forward will correct it.\n\t// If we have a negative chroma after this, then we have a color that\n\t// cannot resolve to positive chroma.\n\tif (coords[1] < 0) {\n\t\tcoords = hct.fromBase(hct.toBase(coords));\n\t}\n\n\t// Only in extreme cases (usually outside the visible spectrum)\n\t// can the input value for log become negative.\n\t// Avoid domain error by forcing a zero result via \"max\" if necessary.\n\tconst M = Math.log(Math.max(1 + ucsCoeff[2] * coords[1] * viewingConditions.flRoot, 1.0)) / ucsCoeff[2];\n\tconst hrad = coords[0] * deg2rad;\n\tconst a = M * Math.cos(hrad);\n\tconst b = M * Math.sin(hrad);\n\n\treturn [coords[2], a, b];\n}\n\n\n/**\n* Color distance using HCT.\n* @param {Color} color - Color to compare.\n* @param {Color} sample - Color to compare.\n* @return {number[]}\n*/\nexport default function (color, sample) {\n\t[color, sample] = getColor([color, sample]);\n\n\tlet [ t1, a1, b1 ] = convertUcsAb(hct.from(color));\n\tlet [ t2, a2, b2 ] = convertUcsAb(hct.from(sample));\n\n\t// Use simple euclidean distance with a and b using UCS conversion\n\t// and LCh lightness (HCT tone).\n\treturn Math.sqrt((t1 - t2) ** 2 + (a1 - a2) ** 2 + (b1 - b2) ** 2);\n}\n", "import deltaE76 from \"./deltaE76.js\";\nimport deltaECMC from \"./deltaECMC.js\";\nimport deltaE2000 from \"./deltaE2000.js\";\nimport deltaEJz from \"./deltaEJz.js\";\nimport deltaEITP from \"./deltaEITP.js\";\nimport deltaEOK from \"./deltaEOK.js\";\nimport deltaEHCT from \"./deltaEHCT.js\";\n\nexport {\n\tdeltaE76,\n\tdeltaECMC,\n\tdeltaE2000,\n\tdeltaEJz,\n\tdeltaEITP,\n\tdeltaEOK,\n\tdeltaEHCT,\n};\n\nexport default {\n\tdeltaE76,\n\tdeltaECMC,\n\tdeltaE2000,\n\tdeltaEJz,\n\tdeltaEITP,\n\tdeltaEOK,\n\tdeltaEHCT,\n};\n", "import * as util from \"./util.js\";\nimport ColorSpace from \"./space.js\";\nimport defaults from \"./defaults.js\";\nimport deltaE2000 from \"./deltaE/deltaE2000.js\";\nimport deltaEOK from \"./deltaE/deltaEOK.js\";\nimport inGamut from \"./inGamut.js\";\nimport to from \"./to.js\";\nimport get from \"./get.js\";\nimport oklab from \"./spaces/oklab.js\";\nimport set from \"./set.js\";\nimport clone from \"./clone.js\";\nimport getColor from \"./getColor.js\";\nimport deltaEMethods from \"./deltaE/index.js\";\nimport {WHITES} from \"./adapt.js\";\n\n/**\n * Calculate the epsilon to 2 degrees smaller than the specified JND.\n * @param {Number} jnd - The target \"just noticeable difference\".\n * @returns {Number}\n */\nfunction calcEpsilon (jnd) {\n\t// Calculate the epsilon to 2 degrees smaller than the specified JND.\n\n\tconst order = (!jnd) ? 0 : Math.floor(Math.log10(Math.abs(jnd)));\n\t// Limit to an arbitrary value to ensure value is never too small and causes infinite loops.\n\treturn Math.max(parseFloat(`1e${order - 2}`), 1e-6);\n}\n\nconst GMAPPRESET = {\n\t\"hct\": {\n\t\tmethod: \"hct.c\",\n\t\tjnd: 2,\n\t\tdeltaEMethod: \"hct\",\n\t\tblackWhiteClamp: {},\n\t},\n\t\"hct-tonal\": {\n\t\tmethod: \"hct.c\",\n\t\tjnd: 0,\n\t\tdeltaEMethod: \"hct\",\n\t\tblackWhiteClamp: { channel: \"hct.t\", min: 0, max: 100 },\n\t},\n};\n\n/**\n * Force coordinates to be in gamut of a certain color space.\n * Mutates the color it is passed.\n * @param {Object|string} options object or spaceId string\n * @param {string} options.method - How to force into gamut.\n * If \"clip\", coordinates are just clipped to their reference range.\n * If \"css\", coordinates are reduced according to the CSS 4 Gamut Mapping Algorithm.\n * If in the form [colorSpaceId].[coordName], that coordinate is reduced\n * until the color is in gamut. Please note that this may produce nonsensical\n * results for certain coordinates (e.g. hue) or infinite loops if reducing the coordinate never brings the color in gamut.\n * @param {ColorSpace|string} options.space - The space whose gamut we want to map to\n * @param {string} options.deltaEMethod - The delta E method to use while performing gamut mapping.\n * If no method is specified, delta E 2000 is used.\n * @param {Number} options.jnd - The \"just noticeable difference\" to target.\n * @param {Object} options.blackWhiteClamp - Used to configure SDR black and clamping.\n * \"channel\" indicates the \"space.channel\" to use for determining when to clamp.\n * \"min\" indicates the lower limit for black clamping and \"max\" indicates the upper\n * limit for white clamping.\n */\n\nexport default function toGamut (\n\tcolor,\n\t{\n\t\tmethod = defaults.gamut_mapping,\n\t\tspace = undefined,\n\t\tdeltaEMethod = \"\",\n\t\tjnd = 2,\n\t\tblackWhiteClamp = {},\n\t} = {},\n) {\n\tcolor = getColor(color);\n\n\tif (util.isString(arguments[1])) {\n\t\tspace = arguments[1];\n\t}\n\telse if (!space) {\n\t\tspace = color.space;\n\t}\n\n\tspace = ColorSpace.get(space);\n\n\t// 3 spaces:\n\t// color.space: current color space\n\t// space: space whose gamut we are mapping to\n\t// mapSpace: space with the coord we're reducing\n\n\tif (inGamut(color, space, { epsilon: 0 })) {\n\t\treturn color;\n\t}\n\n\tlet spaceColor;\n\tif (method === \"css\") {\n\t\tspaceColor = toGamutCSS(color, { space });\n\t}\n\telse {\n\t\tif (method !== \"clip\" && !inGamut(color, space)) {\n\n\t\t\tif (Object.prototype.hasOwnProperty.call(GMAPPRESET, method)) {\n\t\t\t\t({method, jnd, deltaEMethod, blackWhiteClamp} = GMAPPRESET[method]);\n\t\t\t}\n\n\t\t\t// Get the correct delta E method\n\t\t\tlet de = deltaE2000;\n\t\t\tif (deltaEMethod !== \"\") {\n\t\t\t\tfor (let m in deltaEMethods) {\n\t\t\t\t\tif (\"deltae\" + deltaEMethod.toLowerCase() === m.toLowerCase()) {\n\t\t\t\t\t\tde = deltaEMethods[m];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet clipped = toGamut(to(color, space), { method: \"clip\", space });\n\t\t\tif (de(color, clipped) > jnd) {\n\n\t\t\t\t// Clamp to SDR white and black if required\n\t\t\t\tif (Object.keys(blackWhiteClamp).length === 3) {\n\t\t\t\t\tlet channelMeta = ColorSpace.resolveCoord(blackWhiteClamp.channel);\n\t\t\t\t\tlet channel = get(to(color, channelMeta.space), channelMeta.id);\n\t\t\t\t\tif (util.isNone(channel)) {\n\t\t\t\t\t\tchannel = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif (channel >= blackWhiteClamp.max) {\n\t\t\t\t\t\treturn to({ space: \"xyz-d65\", coords: WHITES[\"D65\"] }, color.space);\n\t\t\t\t\t}\n\t\t\t\t\telse if (channel <= blackWhiteClamp.min) {\n\t\t\t\t\t\treturn to({ space: \"xyz-d65\", coords: [0, 0, 0] }, color.space);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Reduce a coordinate of a certain color space until the color is in gamut\n\t\t\t\tlet coordMeta = ColorSpace.resolveCoord(method);\n\t\t\t\tlet mapSpace = coordMeta.space;\n\t\t\t\tlet coordId = coordMeta.id;\n\n\t\t\t\tlet mappedColor = to(color, mapSpace);\n\t\t\t\t// If we were already in the mapped color space, we need to resolve undefined channels\n\t\t\t\tmappedColor.coords.forEach((c, i) => {\n\t\t\t\t\tif (util.isNone(c)) {\n\t\t\t\t\t\tmappedColor.coords[i] = 0;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tlet bounds = coordMeta.range || coordMeta.refRange;\n\t\t\t\tlet min = bounds[0];\n\t\t\t\tlet \u03B5 = calcEpsilon(jnd);\n\t\t\t\tlet low = min;\n\t\t\t\tlet high = get(mappedColor, coordId);\n\n\t\t\t\twhile (high - low > \u03B5) {\n\t\t\t\t\tlet clipped = clone(mappedColor);\n\t\t\t\t\tclipped = toGamut(clipped, { space, method: \"clip\" });\n\t\t\t\t\tlet deltaE = de(mappedColor, clipped);\n\n\t\t\t\t\tif (deltaE - jnd < \u03B5) {\n\t\t\t\t\t\tlow = get(mappedColor, coordId);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\thigh = get(mappedColor, coordId);\n\t\t\t\t\t}\n\n\t\t\t\t\tset(mappedColor, coordId, (low + high) / 2);\n\t\t\t\t}\n\n\t\t\t\tspaceColor = to(mappedColor, space);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tspaceColor = clipped;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tspaceColor = to(color, space);\n\t\t}\n\n\t\tif (method === \"clip\" // Dumb coord clipping\n\t\t\t// finish off smarter gamut mapping with clip to get rid of \u03B5, see #17\n\t\t\t|| !inGamut(spaceColor, space, { epsilon: 0 })\n\t\t) {\n\t\t\tlet bounds = Object.values(space.coords).map(c => c.range || []);\n\n\t\t\tspaceColor.coords = spaceColor.coords.map((c, i) => {\n\t\t\t\tlet [min, max] = bounds[i];\n\n\t\t\t\tif (min !== undefined) {\n\t\t\t\t\tc = Math.max(min, c);\n\t\t\t\t}\n\n\t\t\t\tif (max !== undefined) {\n\t\t\t\t\tc = Math.min(c, max);\n\t\t\t\t}\n\n\t\t\t\treturn c;\n\t\t\t});\n\t\t}\n\t}\n\n\tif (space !== color.space) {\n\t\tspaceColor = to(spaceColor, color.space);\n\t}\n\n\tcolor.coords = spaceColor.coords;\n\treturn color;\n}\n\ntoGamut.returns = \"color\";\n\n// The reference colors to be used if lightness is out of the range 0-1 in the\n// `Oklch` space. These are created in the `Oklab` space, as it is used by the\n// DeltaEOK calculation, so it is guaranteed to be imported.\nconst COLORS = {\n\tWHITE: { space: oklab, coords: [1, 0, 0] },\n\tBLACK: { space: oklab, coords: [0, 0, 0] },\n};\n\n/**\n * Given a color `origin`, returns a new color that is in gamut using\n * the CSS Gamut Mapping Algorithm. If `space` is specified, it will be in gamut\n * in `space`, and returned in `space`. Otherwise, it will be in gamut and\n * returned in the color space of `origin`.\n * @param {Object} origin\n * @param {Object} options\n * @param {ColorSpace|string} options.space\n * @returns {Color}\n */\nexport function toGamutCSS (origin, {space} = {}) {\n\tconst JND = 0.02;\n\tconst \u03B5 = 0.0001;\n\n\torigin = getColor(origin);\n\n\tif (!space) {\n\t\tspace = origin.space;\n\t}\n\n\tspace = ColorSpace.get(space);\n\tconst oklchSpace = ColorSpace.get(\"oklch\");\n\n\tif (space.isUnbounded) {\n\t\treturn to(origin, space);\n\t}\n\n\tconst origin_OKLCH = to(origin, oklchSpace);\n\tlet L = origin_OKLCH.coords[0];\n\n\t// return media white or black, if lightness is out of range\n\tif (L >= 1) {\n\t\tconst white = to(COLORS.WHITE, space);\n\t\twhite.alpha = origin.alpha;\n\t\treturn to(white, space);\n\t}\n\tif (L <= 0) {\n\t\tconst black = to(COLORS.BLACK, space);\n\t\tblack.alpha = origin.alpha;\n\t\treturn to(black, space);\n\t}\n\n\tif (inGamut(origin_OKLCH, space, {epsilon: 0})) {\n\t\treturn to(origin_OKLCH, space);\n\t}\n\n\tfunction clip (_color) {\n\t\tconst destColor = to(_color, space);\n\t\tconst spaceCoords = Object.values(space.coords);\n\t\tdestColor.coords = destColor.coords.map((coord, index) => {\n\t\t\tif (\"range\" in spaceCoords[index]) {\n\t\t\t\tconst [min, max] = spaceCoords[index].range;\n\t\t\t\treturn util.clamp(min, coord, max);\n\t\t\t}\n\t\t\treturn coord;\n\t\t});\n\t\treturn destColor;\n\t}\n\tlet min = 0;\n\tlet max = origin_OKLCH.coords[1];\n\tlet min_inGamut = true;\n\tlet current = clone(origin_OKLCH);\n\tlet clipped = clip(current);\n\n\tlet E = deltaEOK(clipped, current);\n\tif (E < JND) {\n\t\treturn clipped;\n\t}\n\n\twhile ((max - min) > \u03B5) {\n\t\tconst chroma = (min + max) / 2;\n\t\tcurrent.coords[1] = chroma;\n\t\tif (min_inGamut && inGamut(current, space, {epsilon: 0})) {\n\t\t\tmin = chroma;\n\t\t}\n\t\telse {\n\t\t\tclipped = clip(current);\n\t\t\tE = deltaEOK(clipped, current);\n\t\t\tif (E < JND) {\n\t\t\t\tif ((JND - E < \u03B5)) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmin_inGamut = false;\n\t\t\t\t\tmin = chroma;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmax = chroma;\n\t\t\t}\n\t\t}\n\t}\n\treturn clipped;\n}\n", "import getColor from \"./getColor.js\";\nimport ColorSpace from \"./space.js\";\nimport toGamut from \"./toGamut.js\";\n\n/**\n * Convert to color space and return a new color\n * @param {Object|string} space - Color space object or id\n * @param {Object} options\n * @param {boolean} options.inGamut - Whether to force resulting color in gamut\n * @returns {Color}\n */\nexport default function to (color, space, {inGamut} = {}) {\n\tcolor = getColor(color);\n\tspace = ColorSpace.get(space);\n\n\tlet coords = space.from(color);\n\tlet ret = {space, coords, alpha: color.alpha};\n\n\tif (inGamut) {\n\t\tret = toGamut(ret, inGamut === true ? undefined : inGamut);\n\t}\n\n\treturn ret;\n}\n\nto.returns = \"color\";\n", "import * as util from \"./util.js\";\nimport ColorSpace from \"./space.js\";\nimport defaults from \"./defaults.js\";\nimport getColor from \"./getColor.js\";\nimport checkInGamut from \"./inGamut.js\";\nimport toGamut from \"./toGamut.js\";\nimport clone from \"./clone.js\";\n\n/**\n * Generic toString() method, outputs a color(spaceId ...coords) function, a functional syntax, or custom formats defined by the color space\n * @param {Object} options\n * @param {number} options.precision - Significant digits\n * @param {boolean} options.inGamut - Adjust coordinates to fit in gamut first? [default: false]\n */\nexport default function serialize (color, {\n\tprecision = defaults.precision,\n\tformat = \"default\",\n\tinGamut = true,\n\t...customOptions\n} = {}) {\n\tlet ret;\n\n\tcolor = getColor(color);\n\n\tlet formatId = format;\n\tformat = color.space.getFormat(format)\n\t ?? color.space.getFormat(\"default\")\n\t ?? ColorSpace.DEFAULT_FORMAT;\n\n\t// The assignment to coords and inGamut needs to stay in the order they are now\n\t// The order of the assignment was changed as a workaround for a bug in Next.js\n\t// See this issue for details: https://github.com/color-js/color.js/issues/260\n\n\tlet coords = color.coords.slice(); // clone so we can manipulate it\n\n\tinGamut ||= format.toGamut;\n\n\tif (inGamut && !checkInGamut(color)) {\n\t\t// FIXME what happens if the color contains NaNs?\n\t\tcoords = toGamut(clone(color), inGamut === true ? undefined : inGamut).coords;\n\t}\n\n\tif (format.type === \"custom\") {\n\t\tcustomOptions.precision = precision;\n\n\t\tif (format.serialize) {\n\t\t\tret = format.serialize(coords, color.alpha, customOptions);\n\t\t}\n\t\telse {\n\t\t\tthrow new TypeError(`format ${formatId} can only be used to parse colors, not for serialization`);\n\t\t}\n\t}\n\telse {\n\t\t// Functional syntax\n\t\tlet name = format.name || \"color\";\n\n\t\tif (format.serializeCoords) {\n\t\t\tcoords = format.serializeCoords(coords, precision);\n\t\t}\n\t\telse {\n\t\t\tif (precision !== null) {\n\t\t\t\tcoords = coords.map(c => {\n\t\t\t\t\treturn util.serializeNumber(c, {precision});\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tlet args = [...coords];\n\n\t\tif (name === \"color\") {\n\t\t\t// If output is a color() function, add colorspace id as first argument\n\t\t\tlet cssId = format.id || format.ids?.[0] || color.space.id;\n\t\t\targs.unshift(cssId);\n\t\t}\n\n\t\tlet alpha = color.alpha;\n\t\tif (precision !== null) {\n\t\t\talpha = util.serializeNumber(alpha, {precision});\n\t\t}\n\n\t\tlet strAlpha = color.alpha >= 1 || format.noAlpha ? \"\" : `${format.commas ? \",\" : \" /\"} ${alpha}`;\n\t\tret = `${name}(${args.join(format.commas ? \", \" : \" \")}${strAlpha})`;\n\t}\n\n\treturn ret;\n}\n", "import RGBColorSpace from \"../rgbspace.js\";\n\n// This is the linear-light version of sRGB\n// as used for example in SVG filters\n// or in Canvas\n\n// This matrix was calculated directly from the RGB and white chromaticities\n// when rounded to 8 decimal places, it agrees completely with the official matrix\n// see https://github.com/w3c/csswg-drafts/issues/5922\nconst toXYZ_M = [\n\t[ 0.41239079926595934, 0.357584339383878, 0.1804807884018343 ],\n\t[ 0.21263900587151027, 0.715168678767756, 0.07219231536073371 ],\n\t[ 0.01933081871559182, 0.11919477979462598, 0.9505321522496607 ],\n];\n\n// This matrix is the inverse of the above;\n// again it agrees with the official definition when rounded to 8 decimal places\nexport const fromXYZ_M = [\n\t[ 3.2409699419045226, -1.537383177570094, -0.4986107602930034 ],\n\t[ -0.9692436362808796, 1.8759675015077202, 0.04155505740717559 ],\n\t[ 0.05563007969699366, -0.20397695888897652, 1.0569715142428786 ],\n];\n\nexport default new RGBColorSpace({\n\tid: \"srgb-linear\",\n\tname: \"Linear sRGB\",\n\twhite: \"D65\",\n\ttoXYZ_M,\n\tfromXYZ_M,\n});\n", "/* List of CSS color keywords\n * Note that this does not include currentColor, transparent,\n * or system colors\n */\n\n// To produce: Visit https://www.w3.org/TR/css-color-4/#named-colors\n// and run in the console:\n// copy($$(\"tr\", $(\".named-color-table tbody\")).map(tr => `\"${tr.cells[2].textContent.trim()}\": [${tr.cells[4].textContent.trim().split(/\\s+/).map(c => c === \"0\"? \"0\" : c === \"255\"? \"1\" : c + \" / 255\").join(\", \")}]`).join(\",\\n\"))\nexport default {\n\t\"aliceblue\": [240 / 255, 248 / 255, 1],\n\t\"antiquewhite\": [250 / 255, 235 / 255, 215 / 255],\n\t\"aqua\": [0, 1, 1],\n\t\"aquamarine\": [127 / 255, 1, 212 / 255],\n\t\"azure\": [240 / 255, 1, 1],\n\t\"beige\": [245 / 255, 245 / 255, 220 / 255],\n\t\"bisque\": [1, 228 / 255, 196 / 255],\n\t\"black\": [0, 0, 0],\n\t\"blanchedalmond\": [1, 235 / 255, 205 / 255],\n\t\"blue\": [0, 0, 1],\n\t\"blueviolet\": [138 / 255, 43 / 255, 226 / 255],\n\t\"brown\": [165 / 255, 42 / 255, 42 / 255],\n\t\"burlywood\": [222 / 255, 184 / 255, 135 / 255],\n\t\"cadetblue\": [95 / 255, 158 / 255, 160 / 255],\n\t\"chartreuse\": [127 / 255, 1, 0],\n\t\"chocolate\": [210 / 255, 105 / 255, 30 / 255],\n\t\"coral\": [1, 127 / 255, 80 / 255],\n\t\"cornflowerblue\": [100 / 255, 149 / 255, 237 / 255],\n\t\"cornsilk\": [1, 248 / 255, 220 / 255],\n\t\"crimson\": [220 / 255, 20 / 255, 60 / 255],\n\t\"cyan\": [0, 1, 1],\n\t\"darkblue\": [0, 0, 139 / 255],\n\t\"darkcyan\": [0, 139 / 255, 139 / 255],\n\t\"darkgoldenrod\": [184 / 255, 134 / 255, 11 / 255],\n\t\"darkgray\": [169 / 255, 169 / 255, 169 / 255],\n\t\"darkgreen\": [0, 100 / 255, 0],\n\t\"darkgrey\": [169 / 255, 169 / 255, 169 / 255],\n\t\"darkkhaki\": [189 / 255, 183 / 255, 107 / 255],\n\t\"darkmagenta\": [139 / 255, 0, 139 / 255],\n\t\"darkolivegreen\": [85 / 255, 107 / 255, 47 / 255],\n\t\"darkorange\": [1, 140 / 255, 0],\n\t\"darkorchid\": [153 / 255, 50 / 255, 204 / 255],\n\t\"darkred\": [139 / 255, 0, 0],\n\t\"darksalmon\": [233 / 255, 150 / 255, 122 / 255],\n\t\"darkseagreen\": [143 / 255, 188 / 255, 143 / 255],\n\t\"darkslateblue\": [72 / 255, 61 / 255, 139 / 255],\n\t\"darkslategray\": [47 / 255, 79 / 255, 79 / 255],\n\t\"darkslategrey\": [47 / 255, 79 / 255, 79 / 255],\n\t\"darkturquoise\": [0, 206 / 255, 209 / 255],\n\t\"darkviolet\": [148 / 255, 0, 211 / 255],\n\t\"deeppink\": [1, 20 / 255, 147 / 255],\n\t\"deepskyblue\": [0, 191 / 255, 1],\n\t\"dimgray\": [105 / 255, 105 / 255, 105 / 255],\n\t\"dimgrey\": [105 / 255, 105 / 255, 105 / 255],\n\t\"dodgerblue\": [30 / 255, 144 / 255, 1],\n\t\"firebrick\": [178 / 255, 34 / 255, 34 / 255],\n\t\"floralwhite\": [1, 250 / 255, 240 / 255],\n\t\"forestgreen\": [34 / 255, 139 / 255, 34 / 255],\n\t\"fuchsia\": [1, 0, 1],\n\t\"gainsboro\": [220 / 255, 220 / 255, 220 / 255],\n\t\"ghostwhite\": [248 / 255, 248 / 255, 1],\n\t\"gold\": [1, 215 / 255, 0],\n\t\"goldenrod\": [218 / 255, 165 / 255, 32 / 255],\n\t\"gray\": [128 / 255, 128 / 255, 128 / 255],\n\t\"green\": [0, 128 / 255, 0],\n\t\"greenyellow\": [173 / 255, 1, 47 / 255],\n\t\"grey\": [128 / 255, 128 / 255, 128 / 255],\n\t\"honeydew\": [240 / 255, 1, 240 / 255],\n\t\"hotpink\": [1, 105 / 255, 180 / 255],\n\t\"indianred\": [205 / 255, 92 / 255, 92 / 255],\n\t\"indigo\": [75 / 255, 0, 130 / 255],\n\t\"ivory\": [1, 1, 240 / 255],\n\t\"khaki\": [240 / 255, 230 / 255, 140 / 255],\n\t\"lavender\": [230 / 255, 230 / 255, 250 / 255],\n\t\"lavenderblush\": [1, 240 / 255, 245 / 255],\n\t\"lawngreen\": [124 / 255, 252 / 255, 0],\n\t\"lemonchiffon\": [1, 250 / 255, 205 / 255],\n\t\"lightblue\": [173 / 255, 216 / 255, 230 / 255],\n\t\"lightcoral\": [240 / 255, 128 / 255, 128 / 255],\n\t\"lightcyan\": [224 / 255, 1, 1],\n\t\"lightgoldenrodyellow\": [250 / 255, 250 / 255, 210 / 255],\n\t\"lightgray\": [211 / 255, 211 / 255, 211 / 255],\n\t\"lightgreen\": [144 / 255, 238 / 255, 144 / 255],\n\t\"lightgrey\": [211 / 255, 211 / 255, 211 / 255],\n\t\"lightpink\": [1, 182 / 255, 193 / 255],\n\t\"lightsalmon\": [1, 160 / 255, 122 / 255],\n\t\"lightseagreen\": [32 / 255, 178 / 255, 170 / 255],\n\t\"lightskyblue\": [135 / 255, 206 / 255, 250 / 255],\n\t\"lightslategray\": [119 / 255, 136 / 255, 153 / 255],\n\t\"lightslategrey\": [119 / 255, 136 / 255, 153 / 255],\n\t\"lightsteelblue\": [176 / 255, 196 / 255, 222 / 255],\n\t\"lightyellow\": [1, 1, 224 / 255],\n\t\"lime\": [0, 1, 0],\n\t\"limegreen\": [50 / 255, 205 / 255, 50 / 255],\n\t\"linen\": [250 / 255, 240 / 255, 230 / 255],\n\t\"magenta\": [1, 0, 1],\n\t\"maroon\": [128 / 255, 0, 0],\n\t\"mediumaquamarine\": [102 / 255, 205 / 255, 170 / 255],\n\t\"mediumblue\": [0, 0, 205 / 255],\n\t\"mediumorchid\": [186 / 255, 85 / 255, 211 / 255],\n\t\"mediumpurple\": [147 / 255, 112 / 255, 219 / 255],\n\t\"mediumseagreen\": [60 / 255, 179 / 255, 113 / 255],\n\t\"mediumslateblue\": [123 / 255, 104 / 255, 238 / 255],\n\t\"mediumspringgreen\": [0, 250 / 255, 154 / 255],\n\t\"mediumturquoise\": [72 / 255, 209 / 255, 204 / 255],\n\t\"mediumvioletred\": [199 / 255, 21 / 255, 133 / 255],\n\t\"midnightblue\": [25 / 255, 25 / 255, 112 / 255],\n\t\"mintcream\": [245 / 255, 1, 250 / 255],\n\t\"mistyrose\": [1, 228 / 255, 225 / 255],\n\t\"moccasin\": [1, 228 / 255, 181 / 255],\n\t\"navajowhite\": [1, 222 / 255, 173 / 255],\n\t\"navy\": [0, 0, 128 / 255],\n\t\"oldlace\": [253 / 255, 245 / 255, 230 / 255],\n\t\"olive\": [128 / 255, 128 / 255, 0],\n\t\"olivedrab\": [107 / 255, 142 / 255, 35 / 255],\n\t\"orange\": [1, 165 / 255, 0],\n\t\"orangered\": [1, 69 / 255, 0],\n\t\"orchid\": [218 / 255, 112 / 255, 214 / 255],\n\t\"palegoldenrod\": [238 / 255, 232 / 255, 170 / 255],\n\t\"palegreen\": [152 / 255, 251 / 255, 152 / 255],\n\t\"paleturquoise\": [175 / 255, 238 / 255, 238 / 255],\n\t\"palevioletred\": [219 / 255, 112 / 255, 147 / 255],\n\t\"papayawhip\": [1, 239 / 255, 213 / 255],\n\t\"peachpuff\": [1, 218 / 255, 185 / 255],\n\t\"peru\": [205 / 255, 133 / 255, 63 / 255],\n\t\"pink\": [1, 192 / 255, 203 / 255],\n\t\"plum\": [221 / 255, 160 / 255, 221 / 255],\n\t\"powderblue\": [176 / 255, 224 / 255, 230 / 255],\n\t\"purple\": [128 / 255, 0, 128 / 255],\n\t\"rebeccapurple\": [102 / 255, 51 / 255, 153 / 255],\n\t\"red\": [1, 0, 0],\n\t\"rosybrown\": [188 / 255, 143 / 255, 143 / 255],\n\t\"royalblue\": [65 / 255, 105 / 255, 225 / 255],\n\t\"saddlebrown\": [139 / 255, 69 / 255, 19 / 255],\n\t\"salmon\": [250 / 255, 128 / 255, 114 / 255],\n\t\"sandybrown\": [244 / 255, 164 / 255, 96 / 255],\n\t\"seagreen\": [46 / 255, 139 / 255, 87 / 255],\n\t\"seashell\": [1, 245 / 255, 238 / 255],\n\t\"sienna\": [160 / 255, 82 / 255, 45 / 255],\n\t\"silver\": [192 / 255, 192 / 255, 192 / 255],\n\t\"skyblue\": [135 / 255, 206 / 255, 235 / 255],\n\t\"slateblue\": [106 / 255, 90 / 255, 205 / 255],\n\t\"slategray\": [112 / 255, 128 / 255, 144 / 255],\n\t\"slategrey\": [112 / 255, 128 / 255, 144 / 255],\n\t\"snow\": [1, 250 / 255, 250 / 255],\n\t\"springgreen\": [0, 1, 127 / 255],\n\t\"steelblue\": [70 / 255, 130 / 255, 180 / 255],\n\t\"tan\": [210 / 255, 180 / 255, 140 / 255],\n\t\"teal\": [0, 128 / 255, 128 / 255],\n\t\"thistle\": [216 / 255, 191 / 255, 216 / 255],\n\t\"tomato\": [1, 99 / 255, 71 / 255],\n\t\"turquoise\": [64 / 255, 224 / 255, 208 / 255],\n\t\"violet\": [238 / 255, 130 / 255, 238 / 255],\n\t\"wheat\": [245 / 255, 222 / 255, 179 / 255],\n\t\"white\": [1, 1, 1],\n\t\"whitesmoke\": [245 / 255, 245 / 255, 245 / 255],\n\t\"yellow\": [1, 1, 0],\n\t\"yellowgreen\": [154 / 255, 205 / 255, 50 / 255],\n};\n", "import RGBColorSpace from \"../rgbspace.js\";\nimport sRGBLinear from \"./srgb-linear.js\";\nimport KEYWORDS from \"../keywords.js\";\n\nlet coordGrammar = Array(3).fill(\" | [0, 255]\");\nlet coordGrammarNumber = Array(3).fill(\"[0, 255]\");\n\nexport default new RGBColorSpace({\n\tid: \"srgb\",\n\tname: \"sRGB\",\n\tbase: sRGBLinear,\n\tfromBase: rgb => {\n\t\t// convert an array of linear-light sRGB values in the range 0.0-1.0\n\t\t// to gamma corrected form\n\t\t// https://en.wikipedia.org/wiki/SRGB\n\t\treturn rgb.map(val => {\n\t\t\tlet sign = val < 0 ? -1 : 1;\n\t\t\tlet abs = val * sign;\n\n\t\t\tif (abs > 0.0031308) {\n\t\t\t\treturn sign * (1.055 * (abs ** (1 / 2.4)) - 0.055);\n\t\t\t}\n\n\t\t\treturn 12.92 * val;\n\t\t});\n\t},\n\ttoBase: rgb => {\n\t\t// convert an array of sRGB values in the range 0.0 - 1.0\n\t\t// to linear light (un-companded) form.\n\t\t// https://en.wikipedia.org/wiki/SRGB\n\t\treturn rgb.map(val => {\n\t\t\tlet sign = val < 0 ? -1 : 1;\n\t\t\tlet abs = val * sign;\n\n\t\t\tif (abs <= 0.04045) {\n\t\t\t\treturn val / 12.92;\n\t\t\t}\n\n\t\t\treturn sign * (((abs + 0.055) / 1.055) ** 2.4);\n\t\t});\n\t},\n\tformats: {\n\t\t\"rgb\": {\n\t\t\tcoords: coordGrammar,\n\t\t},\n\t\t\"rgb_number\": {\n\t\t\tname: \"rgb\",\n\t\t\tcommas: true,\n\t\t\tcoords: coordGrammarNumber,\n\t\t\tnoAlpha: true,\n\t\t},\n\t\t\"color\": { /* use defaults */ },\n\t\t\"rgba\": {\n\t\t\tcoords: coordGrammar,\n\t\t\tcommas: true,\n\t\t\tlastAlpha: true,\n\t\t},\n\t\t\"rgba_number\": {\n\t\t\tname: \"rgba\",\n\t\t\tcommas: true,\n\t\t\tcoords: coordGrammarNumber,\n\t\t},\n\t\t\"hex\": {\n\t\t\ttype: \"custom\",\n\t\t\ttoGamut: true,\n\t\t\ttest: str => /^#([a-f0-9]{3,4}){1,2}$/i.test(str),\n\t\t\tparse (str) {\n\t\t\t\tif (str.length <= 5) {\n\t\t\t\t\t// #rgb or #rgba, duplicate digits\n\t\t\t\t\tstr = str.replace(/[a-f0-9]/gi, \"$&$&\");\n\t\t\t\t}\n\n\t\t\t\tlet rgba = [];\n\t\t\t\tstr.replace(/[a-f0-9]{2}/gi, component => {\n\t\t\t\t\trgba.push(parseInt(component, 16) / 255);\n\t\t\t\t});\n\n\t\t\t\treturn {\n\t\t\t\t\tspaceId: \"srgb\",\n\t\t\t\t\tcoords: rgba.slice(0, 3),\n\t\t\t\t\talpha: rgba.slice(3)[0],\n\t\t\t\t};\n\t\t\t},\n\t\t\tserialize: (coords, alpha, {\n\t\t\t\tcollapse = true, // collapse to 3-4 digit hex when possible?\n\t\t\t} = {}) => {\n\t\t\t\tif (alpha < 1) {\n\t\t\t\t\tcoords.push(alpha);\n\t\t\t\t}\n\n\t\t\t\tcoords = coords.map(c => Math.round(c * 255));\n\n\t\t\t\tlet collapsible = collapse && coords.every(c => c % 17 === 0);\n\n\t\t\t\tlet hex = coords.map(c => {\n\t\t\t\t\tif (collapsible) {\n\t\t\t\t\t\treturn (c / 17).toString(16);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn c.toString(16).padStart(2, \"0\");\n\t\t\t\t}).join(\"\");\n\n\t\t\t\treturn \"#\" + hex;\n\t\t\t},\n\t\t},\n\t\t\"keyword\": {\n\t\t\ttype: \"custom\",\n\t\t\ttest: str => /^[a-z]+$/i.test(str),\n\t\t\tparse (str) {\n\t\t\t\tstr = str.toLowerCase();\n\t\t\t\tlet ret = {spaceId: \"srgb\", coords: null, alpha: 1};\n\n\t\t\t\tif (str === \"transparent\") {\n\t\t\t\t\tret.coords = KEYWORDS.black;\n\t\t\t\t\tret.alpha = 0;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tret.coords = KEYWORDS[str];\n\t\t\t\t}\n\n\t\t\t\tif (ret.coords) {\n\t\t\t\t\treturn ret;\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n});\n", "import ColorSpace from \"../space.js\";\nimport sRGB from \"./srgb.js\";\n\nexport default new ColorSpace({\n\tid: \"hsl\",\n\tname: \"HSL\",\n\tcoords: {\n\t\th: {\n\t\t\trefRange: [0, 360],\n\t\t\ttype: \"angle\",\n\t\t\tname: \"Hue\",\n\t\t},\n\t\ts: {\n\t\t\trange: [0, 100],\n\t\t\tname: \"Saturation\",\n\t\t},\n\t\tl: {\n\t\t\trange: [0, 100],\n\t\t\tname: \"Lightness\",\n\t\t},\n\t},\n\n\tbase: sRGB,\n\n\t// Adapted from https://drafts.csswg.org/css-color-4/better-rgbToHsl.js\n\tfromBase: rgb => {\n\t\tlet max = Math.max(...rgb);\n\t\tlet min = Math.min(...rgb);\n\t\tlet [r, g, b] = rgb;\n\t\tlet [h, s, l] = [NaN, 0, (min + max) / 2];\n\t\tlet d = max - min;\n\n\t\tif (d !== 0) {\n\t\t\ts = (l === 0 || l === 1) ? 0 : (max - l) / Math.min(l, 1 - l);\n\n\t\t\tswitch (max) {\n\t\t\t\tcase r: h = (g - b) / d + (g < b ? 6 : 0); break;\n\t\t\t\tcase g: h = (b - r) / d + 2; break;\n\t\t\t\tcase b: h = (r - g) / d + 4;\n\t\t\t}\n\n\t\t\th = h * 60;\n\t\t}\n\n\t\t// Very out of gamut colors can produce negative saturation\n\t\t// If so, just rotate the hue by 180 and use a positive saturation\n\t\t// see https://github.com/w3c/csswg-drafts/issues/9222\n\t\tif (s < 0) {\n\t\t\th += 180;\n\t\t\ts = Math.abs(s);\n\t\t}\n\n\t\tif (h >= 360) {\n\t\t\th -= 360;\n\t\t}\n\n\t\treturn [h, s * 100, l * 100];\n\t},\n\n\t// Adapted from https://en.wikipedia.org/wiki/HSL_and_HSV#HSL_to_RGB_alternative\n\ttoBase: hsl => {\n\t\tlet [h, s, l] = hsl;\n\t\th = h % 360;\n\n\t\tif (h < 0) {\n\t\t\th += 360;\n\t\t}\n\n\t\ts /= 100;\n\t\tl /= 100;\n\n\t\tfunction f (n) {\n\t\t\tlet k = (n + h / 30) % 12;\n\t\t\tlet a = s * Math.min(l, 1 - l);\n\t\t\treturn l - a * Math.max(-1, Math.min(k - 3, 9 - k, 1));\n\t\t}\n\n\t\treturn [f(0), f(8), f(4)];\n\t},\n\n\tformats: {\n\t\t\"hsl\": {\n\t\t\tcoords: [\" | \", \"\", \"\"],\n\t\t},\n\t\t\"hsla\": {\n\t\t\tcoords: [\" | \", \"\", \"\"],\n\t\t\tcommas: true,\n\t\t\tlastAlpha: true,\n\t\t},\n\t},\n});\n", "import ColorSpace from \"../space.js\";\nimport OKLab from \"./oklab.js\";\nimport {constrain as constrainAngle} from \"../angles.js\";\n\nexport default new ColorSpace({\n\tid: \"oklch\",\n\tname: \"Oklch\",\n\tcoords: {\n\t\tl: {\n\t\t\trefRange: [0, 1],\n\t\t\tname: \"Lightness\",\n\t\t},\n\t\tc: {\n\t\t\trefRange: [0, 0.4],\n\t\t\tname: \"Chroma\",\n\t\t},\n\t\th: {\n\t\t\trefRange: [0, 360],\n\t\t\ttype: \"angle\",\n\t\t\tname: \"Hue\",\n\t\t},\n\t},\n\twhite: \"D65\",\n\n\tbase: OKLab,\n\tfromBase (oklab) {\n\t\t// Convert to polar form\n\t\tlet [L, a, b] = oklab;\n\t\tlet h;\n\t\tconst \u03B5 = 0.0002; // chromatic components much smaller than a,b\n\n\t\tif (Math.abs(a) < \u03B5 && Math.abs(b) < \u03B5) {\n\t\t\th = NaN;\n\t\t}\n\t\telse {\n\t\t\th = Math.atan2(b, a) * 180 / Math.PI;\n\t\t}\n\n\t\treturn [\n\t\t\tL, // OKLab L is still L\n\t\t\tMath.sqrt(a ** 2 + b ** 2), // Chroma\n\t\t\tconstrainAngle(h), // Hue, in degrees [0 to 360)\n\t\t];\n\t},\n\t// Convert from polar form\n\ttoBase (oklch) {\n\t\tlet [L, C, h] = oklch;\n\t\tlet a, b;\n\n\t\t// check for NaN hue\n\t\tif (isNaN(h)) {\n\t\t\ta = 0;\n\t\t\tb = 0;\n\t\t}\n\t\telse {\n\t\t\ta = C * Math.cos(h * Math.PI / 180);\n\t\t\tb = C * Math.sin(h * Math.PI / 180);\n\t\t}\n\n\t\treturn [ L, a, b ];\n\t},\n\n\tformats: {\n\t\t\"oklch\": {\n\t\t\tcoords: [\" | \", \" | [0,1]\", \" | \"],\n\t\t},\n\t},\n});\n", "import {\n to as convert,\n parse as parseColor,\n ColorSpace,\n serialize,\n sRGB,\n OKLCH,\n HSL,\n ColorConstructor,\n PlainColorObject,\n} from \"colorjs.io/fn\";\n\nColorSpace.register(sRGB);\nColorSpace.register(OKLCH);\nColorSpace.register(HSL);\n\ntype CoordsValueType = {\n l: number;\n c: number;\n h: number;\n};\n\ntype ColorValueType = {\n hex: string;\n oklch: string;\n coords: CoordsValueType;\n lightness: number;\n};\n\nexport function setStateFromValue(\n value: null | undefined | string | ColorValueType | CoordsValueType,\n mode: \"all\" | \"hex\" | \"oklch\" | \"coords\",\n precision: number,\n) {\n // Handle wrong initial values\n if ((mode === \"hex\" || mode === \"oklch\") && typeof value === \"object\" && value !== null) {\n value = value.toString();\n\n if (value === \"[object Object]\") {\n return {};\n }\n }\n\n if (\n !value ||\n (Array.isArray(value) && value.length === 0) ||\n (typeof value === \"object\" && Object.keys(value).length === 0)\n ) {\n return {};\n }\n\n if (mode === \"all\") {\n // @ts-ignore\n const hex = value?.hex;\n // @ts-ignore\n if (!hex) {\n return {};\n }\n\n const color = parseColor(hex);\n const lightness = getLightness(color);\n // @ts-ignore\n return { ...value, lightness };\n }\n\n if (mode === \"coords\") {\n // @ts-ignore\n if (value?.l === undefined || value?.c === undefined || value?.h === undefined) {\n return {};\n }\n // @ts-ignore\n return convertOKLCHFromValue(`oklch(${value.l} ${value.c} ${value.h})`, precision);\n }\n\n if (mode === \"hex\") {\n return onHexChange(value as string, precision);\n }\n\n if (mode === \"oklch\") {\n return convertOKLCHFromValue(value as string, precision);\n }\n\n return {};\n}\n\nfunction convertOKLCHFromValue(value: string, precision: number) {\n const color = parseColor(value);\n const lightness = getLightness(color);\n const rgb = convert(color, sRGB);\n return {\n hex: serialize(rgb, { format: \"hex\" }),\n oklch: serialize(color, { precision }),\n coords: convertToOkLchCoords(color, precision),\n lightness,\n };\n}\n\nexport function setLightness(hex: string, lightness: number) {\n const color = parseColor(hex);\n const hsl = convert(color, HSL);\n hsl.coords[2] = lightness;\n return serialize(convert(hsl, sRGB), { format: \"hex\" });\n}\n\nexport function setLuminance(oklch: string, luminance: number) {\n const color = parseColor(oklch);\n color.coords[0] = luminance / 100;\n const rgb = convert(color, sRGB);\n return serialize(rgb, { format: \"hex\" });\n}\n\nexport function onHexChange(hex: string, precision: number): ColorValueType {\n const color = parseColor(hex);\n const lightness = getLightness(color);\n const oklch = convert(color, OKLCH);\n\n return {\n hex,\n oklch: serialize(oklch, { precision }),\n coords: convertToOkLchCoords(oklch, precision),\n lightness,\n };\n}\n\nfunction getLightness(color: ColorConstructor) {\n const { coords } = convert(color, HSL);\n return Math.round(coords[2]);\n}\n\nfunction convertToOkLchCoords(oklch: PlainColorObject | ColorConstructor, precision = 5) {\n const { coords } = oklch;\n const anglePrecision = precision > 3 ? precision - 3 : 0;\n return {\n l: round(coords[0], precision),\n c: round(coords[1], precision),\n h: round(coords[2], anglePrecision),\n };\n}\n\nfunction round(value: number, precision: number | undefined = undefined) {\n value = value || 0;\n if (!precision) {\n return value;\n }\n const factor = Math.pow(10, precision);\n return Math.round(value * factor) / factor;\n}\n", "// @ts-ignore\nimport React from \"react\";\nimport * as stylex from \"@stylexjs/stylex\";\nimport \"../Tokens.stylex\";\nimport { colors, sizes, fonts } from \"../Tokens.stylex\";\nconst styles = {\n button: {\n cursor: \"x1ypdohk\",\n textOverflow: \"xlyipyv\",\n whiteSpace: \"xuxw1ft\",\n fontSize: \"xiq9r4\",\n lineHeight: \"x1bexyg0\",\n padding: \"x1dskcqz\",\n overflow: \"xb3r6kr\",\n display: \"x78zum5\",\n gap: \"x188dswm\",\n alignItems: \"x6s0dn4\",\n border: \"x1wty727\",\n background: \"x11g6tue\",\n borderRadius: \"x2u8bby\",\n color: \"x1awj2ng\",\n width: \"xh8yej3\",\n $$css: true\n },\n buttonHighlighted: {\n backgroundColor: \"x18z1ewl\",\n $$css: true\n }\n};\nexport default function OptionPreview({\n option,\n onClick,\n isHighlighted,\n onMouseEnter\n}: {\n option: {\n label: string;\n value: string;\n };\n onClick: () => void;\n isHighlighted: boolean;\n onMouseEnter: () => void;\n}) {\n const label = capitalizeFirstLetter(option.label);\n return ;\n}\nfunction capitalizeFirstLetter(string: string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "var styleq$1 = {};\n\n/**\n * Copyright (c) Nicolas Gallagher\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nObject.defineProperty(styleq$1, \"__esModule\", {\n value: true\n});\nvar styleq_2 = styleq$1.styleq = void 0;\nvar cache = new WeakMap();\nvar compiledKey = '$$css';\n\nfunction createStyleq(options) {\n var disableCache;\n var disableMix;\n var transform;\n\n if (options != null) {\n disableCache = options.disableCache === true;\n disableMix = options.disableMix === true;\n transform = options.transform;\n }\n\n return function styleq() {\n // Keep track of property commits to the className\n var definedProperties = []; // The className and inline style to build up\n\n var className = '';\n var inlineStyle = null; // The current position in the cache graph\n\n var nextCache = disableCache ? null : cache; // This way of creating an array from arguments is fastest\n\n var styles = new Array(arguments.length);\n\n for (var i = 0; i < arguments.length; i++) {\n styles[i] = arguments[i];\n } // Iterate over styles from last to first\n\n\n while (styles.length > 0) {\n var possibleStyle = styles.pop(); // Skip empty items\n\n if (possibleStyle == null || possibleStyle === false) {\n continue;\n } // Push nested styles back onto the stack to be processed\n\n\n if (Array.isArray(possibleStyle)) {\n for (var _i = 0; _i < possibleStyle.length; _i++) {\n styles.push(possibleStyle[_i]);\n }\n\n continue;\n } // Process an individual style object\n\n\n var style = transform != null ? transform(possibleStyle) : possibleStyle;\n\n if (style.$$css) {\n // Build up the class names defined by this object\n var classNameChunk = ''; // Check the cache to see if we've already done this work\n\n if (nextCache != null && nextCache.has(style)) {\n // Cache: read\n var cacheEntry = nextCache.get(style);\n\n if (cacheEntry != null) {\n classNameChunk = cacheEntry[0]; // $FlowIgnore\n\n definedProperties.push.apply(definedProperties, cacheEntry[1]);\n nextCache = cacheEntry[2];\n }\n } // Update the chunks with data from this object\n else {\n // The properties defined by this object\n var definedPropertiesChunk = [];\n\n for (var prop in style) {\n var value = style[prop];\n if (prop === compiledKey) continue; // Each property value is used as an HTML class name\n // { 'debug.string': 'debug.string', opacity: 's-jskmnoqp' }\n\n if (typeof value === 'string' || value === null) {\n // Only add to chunks if this property hasn't already been seen\n if (!definedProperties.includes(prop)) {\n definedProperties.push(prop);\n\n if (nextCache != null) {\n definedPropertiesChunk.push(prop);\n }\n\n if (typeof value === 'string') {\n classNameChunk += classNameChunk ? ' ' + value : value;\n }\n }\n } // If we encounter a value that isn't a string or `null`\n else {\n console.error(\"styleq: \".concat(prop, \" typeof \").concat(String(value), \" is not \\\"string\\\" or \\\"null\\\".\"));\n }\n } // Cache: write\n\n\n if (nextCache != null) {\n // Create the next WeakMap for this sequence of styles\n var weakMap = new WeakMap();\n nextCache.set(style, [classNameChunk, definedPropertiesChunk, weakMap]);\n nextCache = weakMap;\n }\n } // Order of classes in chunks matches property-iteration order of style\n // object. Order of chunks matches passed order of styles from first to\n // last (which we iterate over in reverse).\n\n\n if (classNameChunk) {\n className = className ? classNameChunk + ' ' + className : classNameChunk;\n }\n } // ----- DYNAMIC: Process inline style object -----\n else {\n if (disableMix) {\n if (inlineStyle == null) {\n inlineStyle = {};\n }\n\n inlineStyle = Object.assign({}, style, inlineStyle);\n } else {\n var subStyle = null;\n\n for (var _prop in style) {\n var _value = style[_prop];\n\n if (_value !== undefined) {\n if (!definedProperties.includes(_prop)) {\n if (_value != null) {\n if (inlineStyle == null) {\n inlineStyle = {};\n }\n\n if (subStyle == null) {\n subStyle = {};\n }\n\n subStyle[_prop] = _value;\n }\n\n definedProperties.push(_prop); // Cache is unnecessary overhead if results can't be reused.\n\n nextCache = null;\n }\n }\n }\n\n if (subStyle != null) {\n inlineStyle = Object.assign(subStyle, inlineStyle);\n }\n }\n }\n }\n\n var styleProps = [className, inlineStyle];\n return styleProps;\n };\n}\n\nvar styleq = createStyleq();\nstyleq_2 = styleq$1.styleq = styleq;\nstyleq.factory = createStyleq;\n\nconst errorForFn = name => new Error(`'stylex.${name}' should never be called at runtime. It should be compiled away by '@stylexjs/babel-plugin'`);\nconst errorForType = key => errorForFn(`types.${key}`);\nfunction props() {\n const options = this;\n for (var _len = arguments.length, styles = new Array(_len), _key = 0; _key < _len; _key++) {\n styles[_key] = arguments[_key];\n }\n if (__implementations.props) {\n return __implementations.props.call(options, styles);\n }\n const [className, style] = styleq_2(styles);\n const result = {};\n if (className != null && className !== '') {\n result.className = className;\n }\n if (style != null && Object.keys(style).length > 0) {\n result.style = style;\n }\n return result;\n}\nfunction attrs() {\n const {\n className,\n style\n } = props(...arguments);\n const result = {};\n if (className != null && className !== '') {\n result.class = className;\n }\n if (style != null && Object.keys(style).length > 0) {\n result.style = Object.keys(style).map(key => `${key}:${style[key]};`).join('');\n }\n return result;\n}\nfunction stylexCreate(styles) {\n if (__implementations.create != null) {\n const create = __implementations.create;\n return create(styles);\n }\n throw errorForFn('create');\n}\nfunction stylexDefineVars(styles) {\n if (__implementations.defineVars) {\n return __implementations.defineVars(styles);\n }\n throw errorForFn('defineVars');\n}\nconst stylexCreateTheme = (baseTokens, overrides) => {\n if (__implementations.createTheme) {\n return __implementations.createTheme(baseTokens, overrides);\n }\n throw errorForFn('createTheme');\n};\nconst stylexInclude = styles => {\n if (__implementations.include) {\n return __implementations.include(styles);\n }\n throw errorForFn('include');\n};\nconst create = stylexCreate;\nconst defineVars = stylexDefineVars;\nconst createTheme = stylexCreateTheme;\nconst include = stylexInclude;\nconst types = {\n angle: _v => {\n throw errorForType('angle');\n },\n color: _v => {\n throw errorForType('color');\n },\n url: _v => {\n throw errorForType('url');\n },\n image: _v => {\n throw errorForType('image');\n },\n integer: _v => {\n throw errorForType('integer');\n },\n lengthPercentage: _v => {\n throw errorForType('lengthPercentage');\n },\n length: _v => {\n throw errorForType('length');\n },\n percentage: _v => {\n throw errorForType('percentage');\n },\n number: _v => {\n throw errorForType('number');\n },\n resolution: _v => {\n throw errorForType('resolution');\n },\n time: _v => {\n throw errorForType('time');\n },\n transformFunction: _v => {\n throw errorForType('transformFunction');\n },\n transformList: _v => {\n throw errorForType('transformList');\n }\n};\nconst keyframes = keyframes => {\n if (__implementations.keyframes) {\n return __implementations.keyframes(keyframes);\n }\n throw errorForFn('keyframes');\n};\nconst firstThatWorks = function () {\n if (__implementations.firstThatWorks) {\n return __implementations.firstThatWorks(...arguments);\n }\n throw errorForFn('firstThatWorks');\n};\nfunction _stylex() {\n for (var _len2 = arguments.length, styles = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n styles[_key2] = arguments[_key2];\n }\n const [className] = styleq_2(styles);\n return className;\n}\n_stylex.props = props;\n_stylex.attrs = attrs;\n_stylex.create = create;\n_stylex.defineVars = defineVars;\n_stylex.createTheme = createTheme;\n_stylex.include = include;\n_stylex.keyframes = keyframes;\n_stylex.firstThatWorks = firstThatWorks;\n_stylex.types = types;\nconst __implementations = {};\nfunction __monkey_patch__(key, implementation) {\n if (key === 'types') {\n Object.assign(types, implementation);\n } else {\n __implementations[key] = implementation;\n }\n}\nconst legacyMerge = _stylex;\n\nexport { __monkey_patch__, attrs, create, createTheme, _stylex as default, defineVars, firstThatWorks, include, keyframes, legacyMerge, props, types };\n", "import * as stylex from \"@stylexjs/stylex\";\nexport const colors = {\n primaryBlue: \"var(--x9oor1w)\",\n primaryBlueHover: \"var(--x15izvnz)\",\n contrastNeutral: \"var(--x14zwxex)\",\n warn: \"var(--xo9o7wn)\",\n error: \"var(--xm2tcaw)\",\n checkerboard: \"var(--xohrf6u)\",\n __themeName__: \"x6kjhhb\"\n};\nexport const sizes = {\n input: \"var(--xuyr3qr)\",\n spacingFull: \"var(--x1xhd60u)\",\n spacingHalf: \"var(--xdcwdaz)\",\n spacingQuarter: \"var(--x12ft4ps)\",\n borderRadius: \"var(--x1th158f)\",\n goldenUnit: \"var(--x1fv9uxr)\",\n __themeName__: \"x12xlb9\"\n};\nexport const fonts = {\n mono: \"var(--xhezqga)\",\n size: \"var(--x11o33fd)\",\n __themeName__: \"x12k5fg9\"\n};\nexport const transitions = {\n fast: \"var(--xx5xnzz)\",\n default: \"var(--xk43sx8)\",\n slow: \"var(--xevhp2r)\",\n timing: \"var(--x111wrgi)\",\n __themeName__: \"x11g3sqh\"\n};", "// @ts-ignore\nimport React, { useEffect, useState } from \"react\";\nimport * as stylex from \"@stylexjs/stylex\";\nimport \"../Tokens.stylex\";\nimport { colors, sizes, fonts, transitions } from \"../Tokens.stylex\";\nconst styles = {\n wrapper: {\n display: \"x78zum5\",\n flexDirection: \"xdt5ytf\",\n maxWidth: \"x193iq5w\",\n gap: \"x188dswm\",\n $$css: true\n },\n disabled: {\n cursor: \"x1h6gzvc\",\n opacity: \"x190dgpg\",\n \":where(*) *_pointerEvents\": \"x8ie97q\",\n $$css: true\n }\n};\nexport default function RangeSlider({\n value,\n onChange,\n label,\n disabled,\n id\n}: {\n value: number;\n onChange: Function;\n label: string;\n input?: Boolean;\n disabled?: Boolean;\n id: string;\n}) {\n const [number, setNumber] = useState(value || 0);\n const min = 0;\n const max = 100;\n useEffect(() => {\n setNumber(value);\n }, [value]);\n function handleChange(event: React.FormEvent) {\n onChange(event?.currentTarget?.valueAsNumber);\n }\n const numLength = (value: number) => value.toString().length;\n const minWidth = Math.max(numLength(min), numLength(max)) + \"ch\";\n const minWidthInput = `calc(${minWidth} + 2rem)`; // 2rem for the input padding\n\n return
\n
\n \n \n
\n \n
;\n}", "// @ts-ignore\nimport React from \"react\";\nimport { HexColorPicker, HexColorInput } from \"react-colorful\";\nimport { onHexChange, setLuminance, setLightness, OptionPreview, RangeSlider } from \"./index\";\nimport { IconButton, SelectBox } from \"@neos-project/react-ui-components\";\nimport * as stylex from \"@stylexjs/stylex\";\nimport \"../Tokens.stylex\";\nimport { colors, sizes, fonts, transitions } from \"../Tokens.stylex\";\nconst styles = {\n highlight: {\n borderRadius: \"xjohyra\",\n borderStartStartRadius: null,\n borderStartEndRadius: null,\n borderEndStartRadius: null,\n borderEndEndRadius: null,\n borderTopLeftRadius: null,\n borderTopRightRadius: null,\n borderBottomLeftRadius: null,\n borderBottomRightRadius: null,\n boxShadow: \"x11mstge\",\n $$css: true\n },\n colorPreview: color => [{\n borderRadius: \"xjohyra\",\n borderStartStartRadius: null,\n borderStartEndRadius: null,\n borderEndStartRadius: null,\n borderEndEndRadius: null,\n borderTopLeftRadius: null,\n borderTopRightRadius: null,\n borderBottomLeftRadius: null,\n borderBottomRightRadius: null,\n height: \"x1hhc0k\",\n minWidth: \"x15g7okx\",\n flexBasis: null,\n flex: \"x98rzlu\",\n flexGrow: null,\n flexShrink: null,\n backgroundColor: \"xq1mx2j\",\n backgroundSize: \"xx8ilsi\",\n backgroundImage: \"x1g0zcm7\",\n $$css: true\n }, {\n \"--backgroundColor\": (color || colors.contrastNeutral) != null ? color || colors.contrastNeutral : \"initial\",\n \"--backgroundSize\": (color ? null : \"16px 16px\") != null ? color ? null : \"16px 16px\" : \"initial\",\n \"--backgroundImage\": (color ? null : colors.checkerboard) != null ? color ? null : colors.checkerboard : \"initial\"\n }],\n colorPicker: {\n width: \"xh8yej3\",\n height: \"xt7dq6l\",\n aspectRatio: \"x1plog1\",\n marginTop: \"xlt0ddm\",\n \":where(*) > :first-child_borderTopLeftRadius\": \"xf5yl2k\",\n \":where(*) > :first-child_borderTopRightRadius\": \"x9av0op\",\n \":where(*) > :last-child_borderBottomLeftRadius\": \"xdosjj7\",\n \":where(*) > :last-child_borderBottomRightRadius\": \"xkmff00\",\n \":where(*) .react-colorful__pointer_height\": \"xbq8i1p\",\n \":where(*) .react-colorful__pointer_width\": \"x19mnrqj\",\n \":where(*) .react-colorful__pointer_backgroundColor\": \"x13bp1ud\",\n \":where(*) .react-colorful__pointer_borderColor\": \"x1th5coa\",\n \":where(*) .react-colorful__pointer_transition\": \"x1lptuiq\",\n \":where(*) .react-colorful__pointer:hover_backgroundColor\": \"x4hip2o\",\n \":where(*) .react-colorful__pointer:hover_borderColor\": \"xfbmp4j\",\n \":where(*) .react-colorful__pointer:hover_cursor\": \"x2lqnu4\",\n \":where(*) .react-colorful__pointer:active_transform\": \"xmxw2tw\",\n \":where(*) .react-colorful__pointer:active_cursor\": \"x46gmau\",\n $$css: true\n },\n colorPickerCollapsed: {\n marginTop: \"x16i8m89\",\n $$css: true\n }\n};\n\n// @ts-ignore\nexport default function Panel({\n allowEmpty,\n precision,\n presets,\n showHexInput,\n showLightness,\n showLuminance,\n showPicker,\n showPresets,\n i18nRegistry,\n highlight,\n state,\n setState,\n id,\n onFocus = () => {},\n collapsed\n}: {\n allowEmpty: boolean;\n precision: number;\n presets: object;\n showHexInput: boolean;\n showLightness: boolean;\n showLuminance: boolean;\n showPicker: boolean;\n showPresets: boolean;\n i18nRegistry: any;\n highlight?: boolean;\n state: any;\n setState: Function;\n id: string;\n onFocus?: Function;\n collapsed: boolean;\n}) {\n function handleHexChange(hex: string) {\n setState(onHexChange(hex, precision));\n }\n function handleLightnessChange(lightness: number) {\n handleHexChange(setLightness(state?.hex, lightness));\n }\n function handleLuminanceChange(luminance: number) {\n handleHexChange(setLuminance(state?.oklch, luminance));\n }\n const presetOptions = showPresets && presets && Object.entries(presets).map(([key, color]) => ({\n value: color,\n label: key\n })).filter(preset => !!preset.value);\n return <>\n {Boolean(showPicker) && }\n\n {Boolean(showLightness) && }\n\n {Boolean(showLuminance) && }\n\n {(collapsed ? Boolean(showHexInput) : true) &&
\n {Boolean(collapsed) ||
}\n\n {Boolean(showHexInput) && onFocus()} />}\n\n {!collapsed && Boolean(allowEmpty) && {\n setState(null);\n }} />}\n
}\n\n {Boolean(presetOptions) && }\n ;\n}", "import { useRef } from \"react\";\n\n// Saves incoming handler to the ref in order to avoid \"useCallback hell\"\nexport function useEventCallback(handler?: (value: T) => void): (value: T) => void {\n const callbackRef = useRef(handler);\n const fn = useRef((value: T) => {\n callbackRef.current && callbackRef.current(value);\n });\n callbackRef.current = handler;\n\n return fn.current;\n}\n", "// Clamps a value between an upper and lower bound.\n// We use ternary operators because it makes the minified code\n// 2 times shorter then `Math.min(Math.max(a,b),c)`\nexport const clamp = (number: number, min = 0, max = 1): number => {\n return number > max ? max : number < min ? min : number;\n};\n", "import React, { useRef, useMemo, useEffect } from \"react\";\n\nimport { useEventCallback } from \"../../hooks/useEventCallback\";\nimport { clamp } from \"../../utils/clamp\";\n\nexport interface Interaction {\n left: number;\n top: number;\n}\n\n// Check if an event was triggered by touch\nconst isTouch = (event: MouseEvent | TouchEvent): event is TouchEvent => \"touches\" in event;\n\n// Finds a proper touch point by its identifier\nconst getTouchPoint = (touches: TouchList, touchId: null | number): Touch => {\n for (let i = 0; i < touches.length; i++) {\n if (touches[i].identifier === touchId) return touches[i];\n }\n return touches[0];\n};\n\n// Finds the proper window object to fix iframe embedding issues\nconst getParentWindow = (node?: HTMLDivElement | null): Window => {\n return (node && node.ownerDocument.defaultView) || self;\n};\n\n// Returns a relative position of the pointer inside the node's bounding box\nconst getRelativePosition = (\n node: HTMLDivElement,\n event: MouseEvent | TouchEvent,\n touchId: null | number\n): Interaction => {\n const rect = node.getBoundingClientRect();\n\n // Get user's pointer position from `touches` array if it's a `TouchEvent`\n const pointer = isTouch(event) ? getTouchPoint(event.touches, touchId) : (event as MouseEvent);\n\n return {\n left: clamp((pointer.pageX - (rect.left + getParentWindow(node).pageXOffset)) / rect.width),\n top: clamp((pointer.pageY - (rect.top + getParentWindow(node).pageYOffset)) / rect.height),\n };\n};\n\n// Browsers introduced an intervention, making touch events passive by default.\n// This workaround removes `preventDefault` call from the touch handlers.\n// https://github.com/facebook/react/issues/19651\nconst preventDefaultMove = (event: MouseEvent | TouchEvent): void => {\n !isTouch(event) && event.preventDefault();\n};\n\n// Prevent mobile browsers from handling mouse events (conflicting with touch ones).\n// If we detected a touch interaction before, we prefer reacting to touch events only.\nconst isInvalid = (event: MouseEvent | TouchEvent, hasTouch: boolean): boolean => {\n return hasTouch && !isTouch(event);\n};\n\ninterface Props {\n onMove: (interaction: Interaction) => void;\n onKey: (offset: Interaction) => void;\n children: React.ReactNode;\n}\n\nconst InteractiveBase = ({ onMove, onKey, ...rest }: Props) => {\n const container = useRef(null);\n const onMoveCallback = useEventCallback(onMove);\n const onKeyCallback = useEventCallback(onKey);\n const touchId = useRef(null);\n const hasTouch = useRef(false);\n\n const [handleMoveStart, handleKeyDown, toggleDocumentEvents] = useMemo(() => {\n const handleMoveStart = ({ nativeEvent }: React.MouseEvent | React.TouchEvent) => {\n const el = container.current;\n if (!el) return;\n\n // Prevent text selection\n preventDefaultMove(nativeEvent);\n\n if (isInvalid(nativeEvent, hasTouch.current) || !el) return;\n\n if (isTouch(nativeEvent)) {\n hasTouch.current = true;\n const changedTouches = nativeEvent.changedTouches || [];\n if (changedTouches.length) touchId.current = changedTouches[0].identifier;\n }\n\n el.focus();\n onMoveCallback(getRelativePosition(el, nativeEvent, touchId.current));\n toggleDocumentEvents(true);\n };\n\n const handleMove = (event: MouseEvent | TouchEvent) => {\n // Prevent text selection\n preventDefaultMove(event);\n\n // If user moves the pointer outside of the window or iframe bounds and release it there,\n // `mouseup`/`touchend` won't be fired. In order to stop the picker from following the cursor\n // after the user has moved the mouse/finger back to the document, we check `event.buttons`\n // and `event.touches`. It allows us to detect that the user is just moving his pointer\n // without pressing it down\n const isDown = isTouch(event) ? event.touches.length > 0 : event.buttons > 0;\n\n if (isDown && container.current) {\n onMoveCallback(getRelativePosition(container.current, event, touchId.current));\n } else {\n toggleDocumentEvents(false);\n }\n };\n\n const handleMoveEnd = () => toggleDocumentEvents(false);\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n const keyCode = event.which || event.keyCode;\n\n // Ignore all keys except arrow ones\n if (keyCode < 37 || keyCode > 40) return;\n // Do not scroll page by arrow keys when document is focused on the element\n event.preventDefault();\n // Send relative offset to the parent component.\n // We use codes (37←, 38↑, 39→, 40↓) instead of keys ('ArrowRight', 'ArrowDown', etc)\n // to reduce the size of the library\n onKeyCallback({\n left: keyCode === 39 ? 0.05 : keyCode === 37 ? -0.05 : 0,\n top: keyCode === 40 ? 0.05 : keyCode === 38 ? -0.05 : 0,\n });\n };\n\n function toggleDocumentEvents(state?: boolean) {\n const touch = hasTouch.current;\n const el = container.current;\n const parentWindow = getParentWindow(el);\n\n // Add or remove additional pointer event listeners\n const toggleEvent = state ? parentWindow.addEventListener : parentWindow.removeEventListener;\n toggleEvent(touch ? \"touchmove\" : \"mousemove\", handleMove);\n toggleEvent(touch ? \"touchend\" : \"mouseup\", handleMoveEnd);\n }\n\n return [handleMoveStart, handleKeyDown, toggleDocumentEvents];\n }, [onKeyCallback, onMoveCallback]);\n\n // Remove window event listeners before unmounting\n useEffect(() => toggleDocumentEvents, [toggleDocumentEvents]);\n\n return (\n \n );\n};\n\nexport const Interactive = React.memo(InteractiveBase);\n", "export const formatClassName = (names: unknown[]): string => names.filter(Boolean).join(\" \");\n", "import React from \"react\";\nimport { formatClassName } from \"../../utils/format\";\n\ninterface Props {\n className?: string;\n top?: number;\n left: number;\n color: string;\n}\n\nexport const Pointer = ({ className, color, left, top = 0.5 }: Props): JSX.Element => {\n const nodeClassName = formatClassName([\"react-colorful__pointer\", className]);\n\n const style = {\n top: `${top * 100}%`,\n left: `${left * 100}%`,\n };\n\n return (\n
\n
\n
\n );\n};\n", "export const round = (number: number, digits = 0, base = Math.pow(10, digits)): number => {\n return Math.round(base * number) / base;\n};\n", "import { round } from \"./round\";\nimport { RgbaColor, RgbColor, HslaColor, HslColor, HsvaColor, HsvColor } from \"../types\";\n\n/**\n * Valid CSS units.\n * https://developer.mozilla.org/en-US/docs/Web/CSS/angle\n */\nconst angleUnits: Record = {\n grad: 360 / 400,\n turn: 360,\n rad: 360 / (Math.PI * 2),\n};\n\nexport const hexToHsva = (hex: string): HsvaColor => rgbaToHsva(hexToRgba(hex));\n\nexport const hexToRgba = (hex: string): RgbaColor => {\n if (hex[0] === \"#\") hex = hex.substring(1);\n\n if (hex.length < 6) {\n return {\n r: parseInt(hex[0] + hex[0], 16),\n g: parseInt(hex[1] + hex[1], 16),\n b: parseInt(hex[2] + hex[2], 16),\n a: hex.length === 4 ? round(parseInt(hex[3] + hex[3], 16) / 255, 2) : 1,\n };\n }\n\n return {\n r: parseInt(hex.substring(0, 2), 16),\n g: parseInt(hex.substring(2, 4), 16),\n b: parseInt(hex.substring(4, 6), 16),\n a: hex.length === 8 ? round(parseInt(hex.substring(6, 8), 16) / 255, 2) : 1,\n };\n};\n\nexport const parseHue = (value: string, unit = \"deg\"): number => {\n return Number(value) * (angleUnits[unit] || 1);\n};\n\nexport const hslaStringToHsva = (hslString: string): HsvaColor => {\n const matcher = /hsla?\\(?\\s*(-?\\d*\\.?\\d+)(deg|rad|grad|turn)?[,\\s]+(-?\\d*\\.?\\d+)%?[,\\s]+(-?\\d*\\.?\\d+)%?,?\\s*[/\\s]*(-?\\d*\\.?\\d+)?(%)?\\s*\\)?/i;\n const match = matcher.exec(hslString);\n\n if (!match) return { h: 0, s: 0, v: 0, a: 1 };\n\n return hslaToHsva({\n h: parseHue(match[1], match[2]),\n s: Number(match[3]),\n l: Number(match[4]),\n a: match[5] === undefined ? 1 : Number(match[5]) / (match[6] ? 100 : 1),\n });\n};\n\nexport const hslStringToHsva = hslaStringToHsva;\n\nexport const hslaToHsva = ({ h, s, l, a }: HslaColor): HsvaColor => {\n s *= (l < 50 ? l : 100 - l) / 100;\n\n return {\n h: h,\n s: s > 0 ? ((2 * s) / (l + s)) * 100 : 0,\n v: l + s,\n a,\n };\n};\n\nexport const hsvaToHex = (hsva: HsvaColor): string => rgbaToHex(hsvaToRgba(hsva));\n\nexport const hsvaToHsla = ({ h, s, v, a }: HsvaColor): HslaColor => {\n const hh = ((200 - s) * v) / 100;\n\n return {\n h: round(h),\n s: round(hh > 0 && hh < 200 ? ((s * v) / 100 / (hh <= 100 ? hh : 200 - hh)) * 100 : 0),\n l: round(hh / 2),\n a: round(a, 2),\n };\n};\n\nexport const hsvaToHslString = (hsva: HsvaColor): string => {\n const { h, s, l } = hsvaToHsla(hsva);\n return `hsl(${h}, ${s}%, ${l}%)`;\n};\n\nexport const hsvaToHsvString = (hsva: HsvaColor): string => {\n const { h, s, v } = roundHsva(hsva);\n return `hsv(${h}, ${s}%, ${v}%)`;\n};\n\nexport const hsvaToHsvaString = (hsva: HsvaColor): string => {\n const { h, s, v, a } = roundHsva(hsva);\n return `hsva(${h}, ${s}%, ${v}%, ${a})`;\n};\n\nexport const hsvaToHslaString = (hsva: HsvaColor): string => {\n const { h, s, l, a } = hsvaToHsla(hsva);\n return `hsla(${h}, ${s}%, ${l}%, ${a})`;\n};\n\nexport const hsvaToRgba = ({ h, s, v, a }: HsvaColor): RgbaColor => {\n h = (h / 360) * 6;\n s = s / 100;\n v = v / 100;\n\n const hh = Math.floor(h),\n b = v * (1 - s),\n c = v * (1 - (h - hh) * s),\n d = v * (1 - (1 - h + hh) * s),\n module = hh % 6;\n\n return {\n r: round([v, c, b, b, d, v][module] * 255),\n g: round([d, v, v, c, b, b][module] * 255),\n b: round([b, b, d, v, v, c][module] * 255),\n a: round(a, 2),\n };\n};\n\nexport const hsvaToRgbString = (hsva: HsvaColor): string => {\n const { r, g, b } = hsvaToRgba(hsva);\n return `rgb(${r}, ${g}, ${b})`;\n};\n\nexport const hsvaToRgbaString = (hsva: HsvaColor): string => {\n const { r, g, b, a } = hsvaToRgba(hsva);\n return `rgba(${r}, ${g}, ${b}, ${a})`;\n};\n\nexport const hsvaStringToHsva = (hsvString: string): HsvaColor => {\n const matcher = /hsva?\\(?\\s*(-?\\d*\\.?\\d+)(deg|rad|grad|turn)?[,\\s]+(-?\\d*\\.?\\d+)%?[,\\s]+(-?\\d*\\.?\\d+)%?,?\\s*[/\\s]*(-?\\d*\\.?\\d+)?(%)?\\s*\\)?/i;\n const match = matcher.exec(hsvString);\n\n if (!match) return { h: 0, s: 0, v: 0, a: 1 };\n\n return roundHsva({\n h: parseHue(match[1], match[2]),\n s: Number(match[3]),\n v: Number(match[4]),\n a: match[5] === undefined ? 1 : Number(match[5]) / (match[6] ? 100 : 1),\n });\n};\n\nexport const hsvStringToHsva = hsvaStringToHsva;\n\nexport const rgbaStringToHsva = (rgbaString: string): HsvaColor => {\n const matcher = /rgba?\\(?\\s*(-?\\d*\\.?\\d+)(%)?[,\\s]+(-?\\d*\\.?\\d+)(%)?[,\\s]+(-?\\d*\\.?\\d+)(%)?,?\\s*[/\\s]*(-?\\d*\\.?\\d+)?(%)?\\s*\\)?/i;\n const match = matcher.exec(rgbaString);\n\n if (!match) return { h: 0, s: 0, v: 0, a: 1 };\n\n return rgbaToHsva({\n r: Number(match[1]) / (match[2] ? 100 / 255 : 1),\n g: Number(match[3]) / (match[4] ? 100 / 255 : 1),\n b: Number(match[5]) / (match[6] ? 100 / 255 : 1),\n a: match[7] === undefined ? 1 : Number(match[7]) / (match[8] ? 100 : 1),\n });\n};\n\nexport const rgbStringToHsva = rgbaStringToHsva;\n\nconst format = (number: number) => {\n const hex = number.toString(16);\n return hex.length < 2 ? \"0\" + hex : hex;\n};\n\nexport const rgbaToHex = ({ r, g, b, a }: RgbaColor): string => {\n const alphaHex = a < 1 ? format(round(a * 255)) : \"\";\n return \"#\" + format(r) + format(g) + format(b) + alphaHex;\n};\n\nexport const rgbaToHsva = ({ r, g, b, a }: RgbaColor): HsvaColor => {\n const max = Math.max(r, g, b);\n const delta = max - Math.min(r, g, b);\n\n // prettier-ignore\n const hh = delta\n ? max === r\n ? (g - b) / delta\n : max === g\n ? 2 + (b - r) / delta\n : 4 + (r - g) / delta\n : 0;\n\n return {\n h: round(60 * (hh < 0 ? hh + 6 : hh)),\n s: round(max ? (delta / max) * 100 : 0),\n v: round((max / 255) * 100),\n a,\n };\n};\n\nexport const roundHsva = (hsva: HsvaColor): HsvaColor => ({\n h: round(hsva.h),\n s: round(hsva.s),\n v: round(hsva.v),\n a: round(hsva.a, 2),\n});\n\nexport const rgbaToRgb = ({ r, g, b }: RgbaColor): RgbColor => ({ r, g, b });\n\nexport const hslaToHsl = ({ h, s, l }: HslaColor): HslColor => ({ h, s, l });\n\nexport const hsvaToHsv = (hsva: HsvaColor): HsvColor => {\n const { h, s, v } = roundHsva(hsva);\n return { h, s, v };\n};\n", "import React from \"react\";\n\nimport { Interactive, Interaction } from \"./Interactive\";\nimport { Pointer } from \"./Pointer\";\n\nimport { hsvaToHslString } from \"../../utils/convert\";\nimport { formatClassName } from \"../../utils/format\";\nimport { clamp } from \"../../utils/clamp\";\nimport { round } from \"../../utils/round\";\n\ninterface Props {\n className?: string;\n hue: number;\n onChange: (newHue: { h: number }) => void;\n}\n\nconst HueBase = ({ className, hue, onChange }: Props) => {\n const handleMove = (interaction: Interaction) => {\n onChange({ h: 360 * interaction.left });\n };\n\n const handleKey = (offset: Interaction) => {\n // Hue measured in degrees of the color circle ranging from 0 to 360\n onChange({\n h: clamp(hue + offset.left * 360, 0, 360),\n });\n };\n\n const nodeClassName = formatClassName([\"react-colorful__hue\", className]);\n\n return (\n
\n \n \n \n
\n );\n};\n\nexport const Hue = React.memo(HueBase);\n", "import React from \"react\";\nimport { Interactive, Interaction } from \"./Interactive\";\nimport { Pointer } from \"./Pointer\";\nimport { HsvaColor } from \"../../types\";\nimport { hsvaToHslString } from \"../../utils/convert\";\nimport { clamp } from \"../../utils/clamp\";\nimport { round } from \"../../utils/round\";\n\ninterface Props {\n hsva: HsvaColor;\n onChange: (newColor: { s: number; v: number }) => void;\n}\n\nconst SaturationBase = ({ hsva, onChange }: Props) => {\n const handleMove = (interaction: Interaction) => {\n onChange({\n s: interaction.left * 100,\n v: 100 - interaction.top * 100,\n });\n };\n\n const handleKey = (offset: Interaction) => {\n // Saturation and brightness always fit into [0, 100] range\n onChange({\n s: clamp(hsva.s + offset.left * 100, 0, 100),\n v: clamp(hsva.v - offset.top * 100, 0, 100),\n });\n };\n\n const containerStyle = {\n backgroundColor: hsvaToHslString({ h: hsva.h, s: 100, v: 100, a: 1 }),\n };\n\n return (\n
\n \n \n \n
\n );\n};\n\nexport const Saturation = React.memo(SaturationBase);\n", "import { hexToRgba } from \"./convert\";\nimport { ObjectColor } from \"../types\";\n\nexport const equalColorObjects = (first: ObjectColor, second: ObjectColor): boolean => {\n if (first === second) return true;\n\n for (const prop in first) {\n // The following allows for a type-safe calling of this function (first & second have to be HSL, HSV, or RGB)\n // with type-unsafe iterating over object keys. TS does not allow this without an index (`[key: string]: number`)\n // on an object to define how iteration is normally done. To ensure extra keys are not allowed on our types,\n // we must cast our object to unknown (as RGB demands `r` be a key, while `Record` does not care if\n // there is or not), and then as a type TS can iterate over.\n if (\n ((first as unknown) as Record)[prop] !==\n ((second as unknown) as Record)[prop]\n )\n return false;\n }\n\n return true;\n};\n\nexport const equalColorString = (first: string, second: string): boolean => {\n return first.replace(/\\s/g, \"\") === second.replace(/\\s/g, \"\");\n};\n\nexport const equalHex = (first: string, second: string): boolean => {\n if (first.toLowerCase() === second.toLowerCase()) return true;\n\n // To compare colors like `#FFF` and `ffffff` we convert them into RGB objects\n return equalColorObjects(hexToRgba(first), hexToRgba(second));\n};\n", "import { useState, useEffect, useCallback, useRef } from \"react\";\nimport { ColorModel, AnyColor, HsvaColor } from \"../types\";\nimport { equalColorObjects } from \"../utils/compare\";\nimport { useEventCallback } from \"./useEventCallback\";\n\nexport function useColorManipulation(\n colorModel: ColorModel,\n color: T,\n onChange?: (color: T) => void\n): [HsvaColor, (color: Partial) => void] {\n // Save onChange callback in the ref for avoiding \"useCallback hell\"\n const onChangeCallback = useEventCallback(onChange);\n\n // No matter which color model is used (HEX, RGB(A) or HSL(A)),\n // all internal calculations are based on HSVA model\n const [hsva, updateHsva] = useState(() => colorModel.toHsva(color));\n\n // By using this ref we're able to prevent extra updates\n // and the effects recursion during the color conversion\n const cache = useRef({ color, hsva });\n\n // Update local HSVA-value if `color` property value is changed,\n // but only if that's not the same color that we just sent to the parent\n useEffect(() => {\n if (!colorModel.equal(color, cache.current.color)) {\n const newHsva = colorModel.toHsva(color);\n cache.current = { hsva: newHsva, color };\n updateHsva(newHsva);\n }\n }, [color, colorModel]);\n\n // Trigger `onChange` callback only if an updated color is different from cached one;\n // save the new color to the ref to prevent unnecessary updates\n useEffect(() => {\n let newColor;\n if (\n !equalColorObjects(hsva, cache.current.hsva) &&\n !colorModel.equal((newColor = colorModel.fromHsva(hsva)), cache.current.color)\n ) {\n cache.current = { hsva, color: newColor };\n onChangeCallback(newColor);\n }\n }, [hsva, colorModel, onChangeCallback]);\n\n // Merge the current HSVA color object with updated params.\n // For example, when a child component sends `h` or `s` only\n const handleChange = useCallback((params: Partial) => {\n updateHsva((current) => Object.assign({}, current, params));\n }, []);\n\n return [hsva, handleChange];\n}\n", "declare const __webpack_nonce__: string | undefined;\nlet nonce: string | undefined;\n\n/**\n * Returns a nonce hash included by Webpack or the one defined manually by developer.\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce\n * https://webpack.js.org/guides/csp/\n */\nexport const getNonce = (): string | undefined => {\n if (nonce) return nonce;\n if (typeof __webpack_nonce__ !== \"undefined\") return __webpack_nonce__;\n return undefined;\n};\n\n/**\n * Signs the style tag with a base64-encoded string (nonce) to conforms to Content Security Policies.\n * This function has to be invoked before any picker is rendered if you aren't using Webpack for CSP.\n */\nexport const setNonce = (hash: string): void => {\n nonce = hash;\n};\n", "import { useLayoutEffect, useEffect } from \"react\";\n\n// React currently throws a warning when using useLayoutEffect on the server.\n// To get around it, we can conditionally useEffect on the server (no-op) and\n// useLayoutEffect in the browser.\nexport const useIsomorphicLayoutEffect =\n typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n", "import { RefObject } from \"react\";\n\nimport { useIsomorphicLayoutEffect } from \"./useIsomorphicLayoutEffect\";\nimport { getNonce } from \"../utils/nonce\";\n\n// Bundler is configured to load this as a processed minified CSS-string\nimport styles from \"../css/styles.css\";\n\nconst styleElementMap: Map = new Map();\n\n/**\n * Injects CSS code into the document's \n */\nexport const useStyleSheet = (nodeRef: RefObject): void => {\n useIsomorphicLayoutEffect(() => {\n const parentDocument = nodeRef.current ? nodeRef.current.ownerDocument : document;\n\n if (typeof parentDocument !== \"undefined\" && !styleElementMap.has(parentDocument)) {\n const styleElement = parentDocument.createElement(\"style\");\n styleElement.innerHTML = styles;\n styleElementMap.set(parentDocument, styleElement);\n\n // Conform to CSP rules by setting `nonce` attribute to the inline styles\n const nonce = getNonce();\n if (nonce) styleElement.setAttribute(\"nonce\", nonce);\n\n parentDocument.head.appendChild(styleElement);\n }\n }, []);\n};\n", "import React, { useRef } from \"react\";\n\nimport { Hue } from \"./Hue\";\nimport { Saturation } from \"./Saturation\";\n\nimport { ColorModel, ColorPickerBaseProps, AnyColor } from \"../../types\";\nimport { useColorManipulation } from \"../../hooks/useColorManipulation\";\nimport { useStyleSheet } from \"../../hooks/useStyleSheet\";\nimport { formatClassName } from \"../../utils/format\";\n\ninterface Props extends Partial> {\n colorModel: ColorModel;\n}\n\nexport const ColorPicker = ({\n className,\n colorModel,\n color = colorModel.defaultColor,\n onChange,\n ...rest\n}: Props): JSX.Element => {\n const nodeRef = useRef(null);\n useStyleSheet(nodeRef);\n\n const [hsva, updateHsva] = useColorManipulation(colorModel, color, onChange);\n\n const nodeClassName = formatClassName([\"react-colorful\", className]);\n\n return (\n
\n \n \n
\n );\n};\n", "import React from \"react\";\n\nimport { ColorPicker } from \"./common/ColorPicker\";\nimport { ColorModel, ColorPickerBaseProps } from \"../types\";\nimport { equalHex } from \"../utils/compare\";\nimport { hexToHsva, hsvaToHex } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: \"000\",\n toHsva: hexToHsva,\n fromHsva: ({ h, s, v }) => hsvaToHex({ h, s, v, a: 1 }),\n equal: equalHex,\n};\n\nexport const HexColorPicker = (props: Partial>): JSX.Element => (\n \n);\n", "import React from \"react\";\n\nimport { Interactive, Interaction } from \"./Interactive\";\nimport { Pointer } from \"./Pointer\";\n\nimport { hsvaToHslaString } from \"../../utils/convert\";\nimport { formatClassName } from \"../../utils/format\";\nimport { clamp } from \"../../utils/clamp\";\nimport { round } from \"../../utils/round\";\nimport { HsvaColor } from \"../../types\";\n\ninterface Props {\n className?: string;\n hsva: HsvaColor;\n onChange: (newAlpha: { a: number }) => void;\n}\n\nexport const Alpha = ({ className, hsva, onChange }: Props): JSX.Element => {\n const handleMove = (interaction: Interaction) => {\n onChange({ a: interaction.left });\n };\n\n const handleKey = (offset: Interaction) => {\n // Alpha always fit into [0, 1] range\n onChange({ a: clamp(hsva.a + offset.left) });\n };\n\n // We use `Object.assign` instead of the spread operator\n // to prevent adding the polyfill (about 150 bytes gzipped)\n const colorFrom = hsvaToHslaString(Object.assign({}, hsva, { a: 0 }));\n const colorTo = hsvaToHslaString(Object.assign({}, hsva, { a: 1 }));\n\n const gradientStyle = {\n backgroundImage: `linear-gradient(90deg, ${colorFrom}, ${colorTo})`,\n };\n\n const nodeClassName = formatClassName([\"react-colorful__alpha\", className]);\n const ariaValue = round(hsva.a * 100);\n\n return (\n
\n
\n \n \n \n
\n );\n};\n", "import React, { useRef } from \"react\";\n\nimport { Hue } from \"./Hue\";\nimport { Saturation } from \"./Saturation\";\nimport { Alpha } from \"./Alpha\";\n\nimport { ColorModel, ColorPickerBaseProps, AnyColor } from \"../../types\";\nimport { useColorManipulation } from \"../../hooks/useColorManipulation\";\nimport { useStyleSheet } from \"../../hooks/useStyleSheet\";\nimport { formatClassName } from \"../../utils/format\";\n\ninterface Props extends Partial> {\n colorModel: ColorModel;\n}\n\nexport const AlphaColorPicker = ({\n className,\n colorModel,\n color = colorModel.defaultColor,\n onChange,\n ...rest\n}: Props): JSX.Element => {\n const nodeRef = useRef(null);\n useStyleSheet(nodeRef);\n\n const [hsva, updateHsva] = useColorManipulation(colorModel, color, onChange);\n\n const nodeClassName = formatClassName([\"react-colorful\", className]);\n\n return (\n
\n \n \n \n
\n );\n};\n", "import React from \"react\";\n\nimport { AlphaColorPicker } from \"./common/AlphaColorPicker\";\nimport { ColorModel, ColorPickerBaseProps } from \"../types\";\nimport { equalHex } from \"../utils/compare\";\nimport { hexToHsva, hsvaToHex } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: \"0001\",\n toHsva: hexToHsva,\n fromHsva: hsvaToHex,\n equal: equalHex,\n};\n\nexport const HexAlphaColorPicker = (props: Partial>): JSX.Element => (\n \n);\n", "import React from \"react\";\n\nimport { AlphaColorPicker } from \"./common/AlphaColorPicker\";\nimport { ColorModel, ColorPickerBaseProps, HslaColor } from \"../types\";\nimport { equalColorObjects } from \"../utils/compare\";\nimport { hslaToHsva, hsvaToHsla } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: { h: 0, s: 0, l: 0, a: 1 },\n toHsva: hslaToHsva,\n fromHsva: hsvaToHsla,\n equal: equalColorObjects,\n};\n\nexport const HslaColorPicker = (props: Partial>): JSX.Element => (\n \n);\n", "import React from \"react\";\n\nimport { AlphaColorPicker } from \"./common/AlphaColorPicker\";\nimport { ColorModel, ColorPickerBaseProps } from \"../types\";\nimport { equalColorString } from \"../utils/compare\";\nimport { hslaStringToHsva, hsvaToHslaString } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: \"hsla(0, 0%, 0%, 1)\",\n toHsva: hslaStringToHsva,\n fromHsva: hsvaToHslaString,\n equal: equalColorString,\n};\n\nexport const HslaStringColorPicker = (\n props: Partial>\n): JSX.Element => ;\n", "import React from \"react\";\n\nimport { ColorPicker } from \"./common/ColorPicker\";\nimport { ColorModel, ColorPickerBaseProps, HslColor } from \"../types\";\nimport { equalColorObjects } from \"../utils/compare\";\nimport { hslaToHsva, hsvaToHsla, hslaToHsl } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: { h: 0, s: 0, l: 0 },\n toHsva: ({ h, s, l }) => hslaToHsva({ h, s, l, a: 1 }),\n fromHsva: (hsva) => hslaToHsl(hsvaToHsla(hsva)),\n equal: equalColorObjects,\n};\n\nexport const HslColorPicker = (props: Partial>): JSX.Element => (\n \n);\n", "import React from \"react\";\n\nimport { ColorPicker } from \"./common/ColorPicker\";\nimport { ColorModel, ColorPickerBaseProps } from \"../types\";\nimport { equalColorString } from \"../utils/compare\";\nimport { hslStringToHsva, hsvaToHslString } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: \"hsl(0, 0%, 0%)\",\n toHsva: hslStringToHsva,\n fromHsva: hsvaToHslString,\n equal: equalColorString,\n};\n\nexport const HslStringColorPicker = (props: Partial>): JSX.Element => (\n \n);\n", "import React from \"react\";\n\nimport { AlphaColorPicker } from \"./common/AlphaColorPicker\";\nimport { ColorModel, ColorPickerBaseProps, HsvaColor } from \"../types\";\nimport { equalColorObjects } from \"../utils/compare\";\nimport { roundHsva } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: { h: 0, s: 0, v: 0, a: 1 },\n toHsva: (hsva) => hsva,\n fromHsva: roundHsva,\n equal: equalColorObjects,\n};\n\nexport const HsvaColorPicker = (props: Partial>): JSX.Element => (\n \n);\n", "import React from \"react\";\n\nimport { AlphaColorPicker } from \"./common/AlphaColorPicker\";\nimport { ColorModel, ColorPickerBaseProps } from \"../types\";\nimport { equalColorString } from \"../utils/compare\";\nimport { hsvaStringToHsva, hsvaToHsvaString } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: \"hsva(0, 0%, 0%, 1)\",\n toHsva: hsvaStringToHsva,\n fromHsva: hsvaToHsvaString,\n equal: equalColorString,\n};\n\nexport const HsvaStringColorPicker = (\n props: Partial>\n): JSX.Element => ;\n", "import React from \"react\";\n\nimport { ColorPicker } from \"./common/ColorPicker\";\nimport { ColorModel, ColorPickerBaseProps, HsvColor } from \"../types\";\nimport { equalColorObjects } from \"../utils/compare\";\nimport { hsvaToHsv } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: { h: 0, s: 0, v: 0 },\n toHsva: ({ h, s, v }) => ({ h, s, v, a: 1 }),\n fromHsva: hsvaToHsv,\n equal: equalColorObjects,\n};\n\nexport const HsvColorPicker = (props: Partial>): JSX.Element => (\n \n);\n", "import React from \"react\";\n\nimport { ColorPicker } from \"./common/ColorPicker\";\nimport { ColorModel, ColorPickerBaseProps } from \"../types\";\nimport { equalColorString } from \"../utils/compare\";\nimport { hsvStringToHsva, hsvaToHsvString } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: \"hsv(0, 0%, 0%)\",\n toHsva: hsvStringToHsva,\n fromHsva: hsvaToHsvString,\n equal: equalColorString,\n};\n\nexport const HsvStringColorPicker = (props: Partial>): JSX.Element => (\n \n);\n", "import React from \"react\";\n\nimport { AlphaColorPicker } from \"./common/AlphaColorPicker\";\nimport { ColorModel, ColorPickerBaseProps, RgbaColor } from \"../types\";\nimport { equalColorObjects } from \"../utils/compare\";\nimport { rgbaToHsva, hsvaToRgba } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: { r: 0, g: 0, b: 0, a: 1 },\n toHsva: rgbaToHsva,\n fromHsva: hsvaToRgba,\n equal: equalColorObjects,\n};\n\nexport const RgbaColorPicker = (props: Partial>): JSX.Element => (\n \n);\n", "import React from \"react\";\n\nimport { AlphaColorPicker } from \"./common/AlphaColorPicker\";\nimport { ColorModel, ColorPickerBaseProps } from \"../types\";\nimport { equalColorString } from \"../utils/compare\";\nimport { rgbaStringToHsva, hsvaToRgbaString } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: \"rgba(0, 0, 0, 1)\",\n toHsva: rgbaStringToHsva,\n fromHsva: hsvaToRgbaString,\n equal: equalColorString,\n};\n\nexport const RgbaStringColorPicker = (\n props: Partial>\n): JSX.Element => ;\n", "import React from \"react\";\n\nimport { ColorPicker } from \"./common/ColorPicker\";\nimport { ColorModel, ColorPickerBaseProps, RgbColor } from \"../types\";\nimport { equalColorObjects } from \"../utils/compare\";\nimport { rgbaToHsva, hsvaToRgba, rgbaToRgb } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: { r: 0, g: 0, b: 0 },\n toHsva: ({ r, g, b }) => rgbaToHsva({ r, g, b, a: 1 }),\n fromHsva: (hsva) => rgbaToRgb(hsvaToRgba(hsva)),\n equal: equalColorObjects,\n};\n\nexport const RgbColorPicker = (props: Partial>): JSX.Element => (\n \n);\n", "import React from \"react\";\n\nimport { ColorPicker } from \"./common/ColorPicker\";\nimport { ColorModel, ColorPickerBaseProps } from \"../types\";\nimport { equalColorString } from \"../utils/compare\";\nimport { rgbStringToHsva, hsvaToRgbString } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: \"rgb(0, 0, 0)\",\n toHsva: rgbStringToHsva,\n fromHsva: hsvaToRgbString,\n equal: equalColorString,\n};\n\nexport const RgbStringColorPicker = (props: Partial>): JSX.Element => (\n \n);\n", "const matcher = /^#?([0-9A-F]{3,8})$/i;\n\nexport const validHex = (value: string, alpha?: boolean): boolean => {\n const match = matcher.exec(value);\n const length = match ? match[1].length : 0;\n\n return (\n length === 3 || // '#rgb' format\n length === 6 || // '#rrggbb' format\n (!!alpha && length === 4) || // '#rgba' format\n (!!alpha && length === 8) // '#rrggbbaa' format\n );\n};\n", "import React, { useState, useEffect, useCallback } from \"react\";\n\nimport { useEventCallback } from \"../../hooks/useEventCallback\";\nimport { ColorInputBaseProps } from \"../../types\";\n\ninterface Props extends ColorInputBaseProps {\n /** Blocks typing invalid characters and limits string length */\n escape: (value: string) => string;\n /** Checks that value is valid color string */\n validate: (value: string) => boolean;\n /** Processes value before displaying it in the input */\n format?: (value: string) => string;\n /** Processes value before sending it in `onChange` */\n process?: (value: string) => string;\n}\n\nexport const ColorInput = (props: Props): JSX.Element => {\n const { color = \"\", onChange, onBlur, escape, validate, format, process, ...rest } = props;\n const [value, setValue] = useState(() => escape(color));\n const onChangeCallback = useEventCallback(onChange);\n const onBlurCallback = useEventCallback>(onBlur);\n\n // Trigger `onChange` handler only if the input value is a valid color\n const handleChange = useCallback(\n (e: React.ChangeEvent) => {\n const inputValue = escape(e.target.value);\n setValue(inputValue);\n if (validate(inputValue)) onChangeCallback(process ? process(inputValue) : inputValue);\n },\n [escape, process, validate, onChangeCallback]\n );\n\n // Take the color from props if the last typed color (in local state) is not valid\n const handleBlur = useCallback(\n (e: React.FocusEvent) => {\n if (!validate(e.target.value)) setValue(escape(color));\n onBlurCallback(e);\n },\n [color, escape, validate, onBlurCallback]\n );\n\n // Update the local state when `color` property value is changed\n useEffect(() => {\n setValue(escape(color));\n }, [color, escape]);\n\n return (\n \n );\n};\n", "import React, { useCallback } from \"react\";\nimport { ColorInputBaseProps } from \"../types\";\n\nimport { validHex } from \"../utils/validate\";\nimport { ColorInput } from \"./common/ColorInput\";\n\ninterface HexColorInputProps extends ColorInputBaseProps {\n /** Enables `#` prefix displaying */\n prefixed?: boolean;\n /** Allows `#rgba` and `#rrggbbaa` color formats */\n alpha?: boolean;\n}\n\n/** Adds \"#\" symbol to the beginning of the string */\nconst prefix = (value: string) => \"#\" + value;\n\nexport const HexColorInput = (props: HexColorInputProps): JSX.Element => {\n const { prefixed, alpha, ...rest } = props;\n\n /** Escapes all non-hexadecimal characters including \"#\" */\n const escape = useCallback(\n (value: string) => value.replace(/([^0-9A-F]+)/gi, \"\").substring(0, alpha ? 8 : 6),\n [alpha]\n );\n\n /** Validates hexadecimal strings */\n const validate = useCallback((value: string) => validHex(value, alpha), [alpha]);\n\n return (\n \n );\n};\n", "import { onHexChange, setLightness, setLuminance, setStateFromValue } from \"./ColorConverter\";\nimport OptionPreview from \"./OptionPreview\";\nimport RangeSlider from \"./RangeSlider\";\nimport Panel from \"./Panel\";\n\nexport default Panel;\nexport { onHexChange, setLuminance, setStateFromValue, OptionPreview, setLightness, RangeSlider };\n", "// @ts-ignore\nimport React from \"react\";\nimport * as stylex from \"@stylexjs/stylex\";\nimport \"../Tokens.stylex\";\nimport { fonts } from \"../Tokens.stylex\";\nexport default function HexOutput({\n hex\n}: {\n hex: string | null | undefined;\n}) {\n if (!hex) {\n return \"\";\n }\n return {hex};\n}", "import React, { useState, useEffect } from \"react\";\nimport { Circle, Dots } from \"./Elements\";\nimport { neos } from \"@neos-project/neos-ui-decorators\";\nimport * as stylex from \"@stylexjs/stylex\";\nfunction Loading({\n id,\n title = \"Neos.Neos:Main:loading\",\n isLoading = false,\n delayTime = 500,\n timeoutTime = 5000,\n i18nRegistry,\n heightMultiplier = 1\n}) {\n const [showLoading, setShowLoading] = useState(0);\n const translatedTitle = title ? i18nRegistry.translate(title) : null;\n useEffect(() => {\n if (!isLoading) {\n setShowLoading(0);\n return;\n }\n const delay = setTimeout(() => {\n setShowLoading(1);\n }, delayTime);\n const timeout = setTimeout(() => {\n setShowLoading(2);\n }, delayTime + timeoutTime);\n return () => {\n clearTimeout(delay);\n clearTimeout(timeout);\n };\n }, [isLoading]);\n if (!isLoading) {\n return null;\n }\n return
\n \n \n
;\n}\nconst neosifier = neos(globalRegistry => ({\n i18nRegistry: globalRegistry.get(\"i18n\")\n}));\nexport default neosifier(Loading);", "import React from \"react\";\n\nexport function Circle({ style, className, size = 30 }) {\n return (\n \n \n \n {[\n {\n attribute: \"dasharray\",\n values: \"0 150;42 150;42 150;42 150\",\n },\n {\n attribute: \"dashoffset\",\n values: \"0;-16;-59;-59\",\n },\n ].map(({ attribute, values }) => (\n \n ))}\n \n \n \n \n );\n}\n\nexport function Dots({ style, className, size = 30 }) {\n return (\n \n {[1, 2, 3].map((number) => {\n const cx = number * 6;\n const beginn = Math.round((100 / 3) * (number - 1)) / 100;\n return (\n \n \n \n );\n })}\n \n );\n}\n", "import manifest from \"@neos-project/neos-ui-extensibility\";\n\nimport ColorPicker from \"./ColorPicker\";\n\nmanifest(\"Carbon.ColorPicker:OKLCH\", {}, (globalRegistry) => {\n const editorsRegistry = globalRegistry.get(\"inspector\").get(\"editors\");\n\n editorsRegistry.set(\"Carbon.ColorPicker/OKLCH\", {\n component: ColorPicker,\n hasOwnLabel: true,\n });\n});\n"], - "mappings": "gEAAc,SAAPA,EAAqCC,EAAW,CACnD,MAAO,IAAIC,IAAe,CACtB,GAAK,OAAe,qBAAqB,GAAM,OAAe,qBAAqB,EAAE,IAAID,CAAG,EAAE,EAC1F,OAAQ,OAAe,qBAAqB,EAAE,IAAIA,CAAG,EAAE,EAAE,GAAGC,CAAI,EAGpE,MAAM,IAAI,MAAM,8EAA+E,CACnG,CACJ,CARA,IAAAC,GAAAC,GAAA,QCAA,IAAAC,EAAAC,GAAA,CAAAC,GAAAC,KAAA,CAAAC,KAEAD,GAAO,QAAUE,EAAoB,QAAQ,EAAC,EAAG,QCFjD,IAAAC,GAAAC,GAAA,CAAAC,GAAAC,KAAA,CAAAC,KAEAD,GAAO,QAAUE,EAAoB,qBAAqB,EAAC,EAAG,mBCF9D,IAAAC,GAAAC,GAAA,CAAAC,GAAAC,KAAA,CAAAC,KAEAD,GAAO,QAAUE,EAAoB,QAAQ,EAAC,EAAG,aCFjD,IAAAC,GAAAC,GAAA,CAAAC,GAAAC,KAAA,CAAAC,KAEAD,GAAO,QAAUE,EAAoB,qBAAqB,EAAC,EAAG,oBCF9D,IAAAC,GAAAC,GAAA,CAAAC,GAAAC,KAAA,CAAAC,KAEAD,GAA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IAAI,MAAM,EACvC,OAAQA,EAAe,IAAI,uBAAuB,EAAE,IAAI,0BAA0B,EAElF,sBAAuBA,EAAe,IAAI,aAAa,EAAE,IAAI,aAAa,CAC5E,EAAE,EACIC,MAAY,YAASf,IAAgB,CAEzC,gBAAiB,aAAU,GAAG,MAAM,wBAAwBA,CAAK,CACnE,EAAE,EACKgB,GAAQH,GAAUE,GAAUrC,EAAM,CAAC,EyF/R1CuC,GAAS,2BAA4B,CAAC,EAAIC,GAAmB,CACjCA,EAAe,IAAI,WAAW,EAAE,IAAI,SAAS,EAErD,IAAI,2BAA4B,CAC5C,UAAWC,GACX,YAAa,EACjB,CAAC,CACL,CAAC", - "names": ["readFromConsumerApi", "key", "args", "init_readFromConsumerApi", "__esmMin", "require_react", "__commonJSMin", "exports", "module", "init_readFromConsumerApi", "readFromConsumerApi", "require_neos_ui_decorators", "__commonJSMin", "exports", "module", "init_readFromConsumerApi", "readFromConsumerApi", "require_react_redux", "__commonJSMin", "exports", "module", "init_readFromConsumerApi", "readFromConsumerApi", "require_react_ui_components", "__commonJSMin", "exports", "module", "init_readFromConsumerApi", "readFromConsumerApi", "require_neos_ui_redux_store", "__commonJSMin", "exports", "module", "init_readFromConsumerApi", "readFromConsumerApi", "init_readFromConsumerApi", "dist_default", "readFromConsumerApi", "import_react", "import_neos_ui_decorators", "import_react_redux", "multiplyMatrices", "A", "B", "m", "x", "p", "B_cols", "_", "i", "product", "row", "col", "ret", "isString", "str", "type", "o", "serializeNumber", "n", "precision", "unit", "isNone", "toPrecision", "toPrecision", "n", "precision", "integer", "digits", "multiplier", "angleFactor", "parseFunction", "str", "isFunctionRegex", "isNumberRegex", "unitValueRegex", "singleArgument", "parts", "args", "$0", "rawArg", "match", "arg", "unit", "unitlessArg", "last", "arr", "interpolate", "start", "end", "p", "interpolateInv", "value", "mapRange", "from", "to", "parseCoordGrammar", "coordGrammars", "coordGrammar", "type", "range", "ret", "clamp", "min", "val", "max", "copySign", "spow", "base", "exp", "zdiv", "d", "bisectLeft", "lo", "hi", "mid", "Hooks", "name", "callback", "first", "env", "hooks", "hooks_default", "WHITES", "getWhite", "name", "adapt", "W1", "W2", "XYZ", "options", "env", "hooks_default", "multiplyMatrices", "defaults_default", "msg", "noneTypes", "coerceCoords", "space", "format", "name", "coords", "id", "coordMeta", "i", "coordGrammar", "arg", "providedType", "type", "c", "coordName", "fromRange", "toRange", "mapRange", "parse", "str", "meta", "env", "hooks_default", "parseFunction", "alternateId", "ids", "alpha", "ColorSpace", "colorSpec", "specId", "_", "types", "defaults_default", "didYouMean", "registryId", "cssId", "last", "formatId", "color", "getColor", "color", "isString", "parse", "space", "ColorSpace", "\u03B5", "_ColorSpace", "options", "coords", "name", "white", "getWhite", "format", "getPath", "hooks_default", "epsilon", "coordMeta", "c", "i", "meta", "min", "max", "coord", "id", "processFormat", "ret", "space", "color", "getColor", "myPath", "otherPath", "connectionSpace", "connectionSpaceIndex", "range", "alias", "alternatives", "type", "ref", "workingSpace", "coordType", "normalizedCoord", "__publicField", "ColorSpace", "s", "parseCoordGrammar", "coordFormats", "outputType", "fromRange", "toRange", "suffix", "precision", "mapRange", "serializeNumber", "xyz_d65_default", "ColorSpace", "RGBColorSpace", "ColorSpace", "options", "xyz_d65_default", "rgb", "xyz", "multiplyMatrices", "adapt", "getAll", "color", "space", "getColor", "ColorSpace", "get", "color", "prop", "getColor", "space", "index", "ColorSpace", "getAll", "setAll", "color", "space", "coords", "getColor", "ColorSpace", "set", "color", "prop", "value", "getColor", "type", "object", "p", "get", "space", "index", "ColorSpace", "coords", "getAll", "setAll", "xyz_d50_default", "ColorSpace", "xyz_d65_default", "coords", "adapt", "\u03B5", "\u03B53", "\u03BA", "white", "WHITES", "lab_default", "ColorSpace", "xyz_d50_default", "XYZ", "f", "value", "i", "Lab", "constrain", "angle", "lch_default", "ColorSpace", "lab_default", "Lab", "L", "a", "b", "hue", "\u03B5", "constrain", "LCH", "Lightness", "Chroma", "Hue", "Gfactor", "\u03C0", "r2d", "d2r", "pow7", "x", "x2", "deltaE2000_default", "color", "sample", "kL", "kC", "kH", "getColor", "L1", "a1", "b1", "lab_default", "C1", "lch_default", "L2", "a2", "b2", "C2", "Cbar", "C7", "G", "adash1", "adash2", "Cdash1", "Cdash2", "h1", "h2", "\u0394L", "\u0394C", "hdiff", "hsum", "habs", "\u0394h", "defaults_default", "\u0394H", "Ldash", "Cdash", "Cdash7", "hdash", "lsq", "SL", "SC", "T", "SH", "\u0394\u03B8", "RC", "RT", "dE", "XYZtoLMS_M", "LMStoXYZ_M", "LMStoLab_M", "LabtoLMS_M", "oklab_default", "ColorSpace", "xyz_d65_default", "XYZ", "LMSg", "multiplyMatrices", "val", "OKLab", "LMS", "deltaEOK_default", "color", "sample", "getColor", "L1", "a1", "b1", "oklab_default", "L2", "a2", "b2", "\u0394L", "\u0394a", "\u0394b", "\u03B5", "inGamut", "color", "space", "epsilon", "getColor", "ColorSpace", "coords", "clone", "color", "distance", "color1", "color2", "space", "ColorSpace", "coords1", "coords2", "acc", "c1", "i", "c2", "deltaE76", "color", "sample", "distance", "\u03C0", "d2r", "deltaECMC_default", "color", "sample", "l", "c", "getColor", "L1", "a1", "b1", "lab_default", "C1", "H1", "lch_default", "L2", "a2", "b2", "C2", "\u0394L", "\u0394C", "\u0394a", "\u0394b", "H2", "SL", "SC", "T", "C4", "F", "SH", "dE", "Yw", "xyz_abs_d65_default", "ColorSpace", "xyz_d65_default", "XYZ", "v", "AbsXYZ", "b", "g", "n", "ninv", "c1", "c2", "c3", "p", "pinv", "d", "d0", "XYZtoCone_M", "ConetoXYZ_M", "ConetoIab_M", "IabtoCone_M", "jzazbz_default", "ColorSpace", "xyz_abs_d65_default", "XYZ", "Xa", "Ya", "Za", "Xm", "Ym", "PQLMS", "multiplyMatrices", "val", "num", "denom", "Iz", "az", "bz", "Jzazbz", "Jz", "LMS", "jzczhz_default", "ColorSpace", "jzazbz_default", "jzazbz", "Jz", "az", "bz", "hue", "\u03B5", "constrain", "jzczhz", "deltaEJz_default", "color", "sample", "getColor", "Jz1", "Cz1", "Hz1", "jzczhz_default", "Jz2", "Cz2", "Hz2", "\u0394J", "\u0394C", "\u0394h", "\u0394H", "c1", "c2", "c3", "m1", "m2", "im1", "im2", "XYZtoLMS_M", "LMStoIPT_M", "IPTtoLMS_M", "LMStoXYZ_M", "ictcp_default", "ColorSpace", "xyz_abs_d65_default", "XYZ", "LMS", "multiplyMatrices", "LMStoICtCp", "ICtCp", "ICtCptoLMS", "PQLMS", "val", "num", "denom", "deltaEITP_default", "color", "sample", "getColor", "I1", "T1", "P1", "ictcp_default", "I2", "T2", "P2", "white", "WHITES", "adaptedCoef", "adaptedCoefInv", "tau", "cat16", "cat16Inv", "m1", "surroundMap", "hueQuadMap", "rad2deg", "deg2rad", "adapt", "coords", "fl", "c", "x", "spow", "copySign", "unadapt", "adapted", "constant", "cabs", "hueQuadrature", "h", "hp", "constrain", "i", "bisectLeft", "hi", "hii", "ei", "eii", "Hi", "t", "invHueQuadrature", "H", "Hp", "environment", "refWhite", "adaptingLuminance", "backgroundLuminance", "surround", "discounting", "env", "xyzW", "yw", "rgbW", "multiplyMatrices", "f", "k4", "interpolate", "rgbCW", "rgbAW", "viewingConditions", "fromCam16", "cam16", "hRad", "cosh", "sinh", "Jroot", "alpha", "et", "A", "p1", "p2", "r", "zdiv", "a", "b", "rgb_c", "toCam16", "xyzd65", "xyz100", "rgbA", "J", "Q", "C", "M", "s", "cam16_default", "ColorSpace", "xyz_d65_default", "xyz", "white", "WHITES", "\u03B5", "\u03BA", "toLstar", "y", "fromLstar", "lstar", "fromHct", "coords", "env", "h", "c", "t", "xyz", "j", "threshold", "max_attempts", "attempt", "last", "best", "fromCam16", "delta", "toHct", "cam16", "toCam16", "viewingConditions", "constrain", "environment", "hct_default", "ColorSpace", "xyz_d65_default", "hct", "rad2deg", "deg2rad", "ucsCoeff", "convertUcsAb", "coords", "hct_default", "M", "viewingConditions", "hrad", "a", "b", "deltaEHCT_default", "color", "sample", "getColor", "t1", "a1", "b1", "t2", "a2", "b2", "deltaE_default", "deltaE76", "deltaECMC_default", "deltaE2000_default", "deltaEJz_default", "deltaEITP_default", "deltaEOK_default", "deltaEHCT_default", "calcEpsilon", "jnd", "order", "GMAPPRESET", "toGamut", "color", "method", "defaults_default", "space", "deltaEMethod", "blackWhiteClamp", "getColor", "isString", "ColorSpace", "inGamut", "spaceColor", "toGamutCSS", "de", "deltaE2000_default", "m", "deltaE_default", "clipped", "to", "channelMeta", "channel", "get", "isNone", "WHITES", "coordMeta", "mapSpace", "coordId", "mappedColor", "c", "i", "min", "\u03B5", "low", "high", "clone", "set", "bounds", "max", "COLORS", "oklab_default", "origin", "oklchSpace", "origin_OKLCH", "L", "white", "black", "clip", "_color", "destColor", "spaceCoords", "coord", "index", "clamp", "min_inGamut", "current", "E", "deltaEOK_default", "chroma", "to", "color", "space", "inGamut", "getColor", "ColorSpace", "coords", "ret", "toGamut", "serialize", "color", "precision", "defaults_default", "format", "inGamut", "customOptions", "ret", "getColor", "formatId", "ColorSpace", "coords", "toGamut", "clone", "name", "c", "serializeNumber", "args", "cssId", "alpha", "strAlpha", "toXYZ_M", "fromXYZ_M", "srgb_linear_default", "RGBColorSpace", "keywords_default", "coordGrammar", "coordGrammarNumber", "srgb_default", "RGBColorSpace", "srgb_linear_default", "rgb", "val", "sign", "abs", "str", "rgba", "component", "coords", "alpha", "collapse", "c", "collapsible", "ret", "keywords_default", "hsl_default", "ColorSpace", "srgb_default", "rgb", "max", "min", "r", "g", "b", "h", "d", "hsl", "s", "l", "f", "n", "k", "a", "oklch_default", "ColorSpace", "oklab_default", "oklab", "L", "a", "b", "h", "\u03B5", "constrain", "oklch", "C", "ColorSpace", "srgb_default", "oklch_default", "hsl_default", "setStateFromValue", "value", "mode", "precision", "hex", "color", "parse", "lightness", "getLightness", "convertOKLCHFromValue", "onHexChange", "rgb", "to", "serialize", "convertToOkLchCoords", "setLightness", "hsl", "setLuminance", "oklch", "luminance", "coords", "anglePrecision", "round", "factor", "import_react", "styleq$1", "styleq_2", "cache", "compiledKey", "createStyleq", "options", "disableCache", "disableMix", "transform", "definedProperties", "className", "inlineStyle", "nextCache", "styles", "i", "possibleStyle", "_i", "style", "classNameChunk", "cacheEntry", "definedPropertiesChunk", "prop", "value", "weakMap", "subStyle", "_prop", "_value", "styleProps", "styleq", "errorForFn", "name", "errorForType", "key", "props", "_len", "_key", "__implementations", "result", "attrs", "stylexCreate", "create", "stylexDefineVars", "stylexCreateTheme", "baseTokens", "overrides", "stylexInclude", "defineVars", "createTheme", "include", "types", "_v", "keyframes", "firstThatWorks", "_stylex", "_len2", "_key2", "colors", "transitions", "styles", "OptionPreview", "option", "onClick", "isHighlighted", "onMouseEnter", "label", "capitalizeFirstLetter", "React", "props", "string", "import_react", "styles", "RangeSlider", "value", "onChange", "label", "disabled", "id", "number", "setNumber", "min", "max", "handleChange", "event", "numLength", "minWidthInput", "React", "props", "import_react", "useEventCallback", "handler", "callbackRef", "useRef", "fn", "value", "current", "clamp", "number", "min", "max", "isTouch", "event", "getParentWindow", "node", "ownerDocument", "defaultView", "self", "getRelativePosition", "touchId", "rect", "getBoundingClientRect", "pointer", "touches", "i", "length", "identifier", "left", "pageX", "pageXOffset", "width", "top", "pageY", "pageYOffset", "height", "preventDefaultMove", "preventDefault", "Interactive", "React", "memo", "o", "onMove", "onKey", "rest", "container", "onMoveCallback", "onKeyCallback", "hasTouch", "x", "useMemo", "handleMove", "buttons", "toggleDocumentEvents", "handleMoveEnd", "state", "touch", "parentWindow", "toggleEvent", "addEventListener", "removeEventListener", "e", "nativeEvent", "el", "changedTouches", "focus", "keyCode", "which", "handleMoveStart", "handleKeyDown", "useEffect", "onTouchStart", "onMouseDown", "className", "ref", "onKeyDown", "tabIndex", "role", "formatClassName", "names", "filter", "Boolean", "join", "Pointer", "r", "color", "nodeClassName", "style", "backgroundColor", "round", "digits", "base", "Math", "pow", "angleUnits", "grad", "turn", "rad", "PI", "hexToHsva", "hex", "rgbaToHsva", "hexToRgba", "substring", "parseInt", "g", "b", "a", "current", "hsvaToHex", "hsva", "rgbaToHex", "hsvaToRgba", "hsvaToHsla", "s", "v", "a", "hh", "h", "round", "l", "hsvaToHslString", "r", "current", "hsvaToRgba", "h", "s", "v", "a", "hh", "Math", "floor", "b", "c", "d", "module", "r", "round", "g", "current", "format", "number", "hex", "toString", "length", "rgbaToHex", "r", "g", "b", "a", "alphaHex", "round", "rgbaToHsva", "max", "Math", "delta", "min", "hh", "h", "s", "v", "current", "Hue", "React", "memo", "r", "hue", "onChange", "nodeClassName", "formatClassName", "className", "Interactive", "onMove", "interaction", "h", "left", "onKey", "offset", "clamp", "aria-label", "aria-valuenow", "round", "aria-valuemax", "aria-valuemin", "Pointer", "color", "hsvaToHslString", "s", "v", "a", "Saturation", "hsva", "containerStyle", "backgroundColor", "style", "top", "aria-valuetext", "equalColorObjects", "first", "second", "prop", "current", "equalHex", "first", "second", "toLowerCase", "equalColorObjects", "hexToRgba", "useColorManipulation", "colorModel", "color", "onChange", "onChangeCallback", "useEventCallback", "useState", "toHsva", "hsva", "updateHsva", "cache", "useRef", "useEffect", "equal", "newHsva", "newColor", "fromHsva", "handleChange", "useCallback", "params", "Object", "assign", "nonce", "useIsomorphicLayoutEffect", "window", "useLayoutEffect", "getNonce", "__webpack_nonce__", "handleChange", "styleElementMap", "Map", "useStyleSheet", "nodeRef", "useIsomorphicLayoutEffect", "parentDocument", "current", "ownerDocument", "document", "has", "styleElement", "createElement", "innerHTML", "set", "nonce", "getNonce", "setAttribute", "head", "appendChild", "ColorPicker", "t", "className", "colorModel", "color", "defaultColor", "onChange", "rest", "useRef", "useColorManipulation", "hsva", "updateHsva", "nodeClassName", "formatClassName", "React", "ref", "Saturation", "Hue", "hue", "h", "toHsva", "hexToHsva", "fromHsva", "hsvaToHex", "s", "v", "a", "equal", "equalHex", "HexColorPicker", "props", "handleChange", "matcher", "ColorInput", "props", "color", "onChange", "onBlur", "escape", "validate", "format", "process", "rest", "useState", "value", "setValue", "onChangeCallback", "useEventCallback", "onBlurCallback", "useCallback", "e", "inputValue", "target", "handleBlur", "useEffect", "React", "spellCheck", "prefix", "HexColorInput", "prefixed", "alpha", "replace", "substring", "match", "exec", "length", "import_react_ui_components", "styles", "color", "colors", "Panel", "allowEmpty", "precision", "presets", "showHexInput", "showLightness", "showLuminance", "showPicker", "showPresets", "i18nRegistry", "highlight", "state", "setState", "id", "onFocus", "collapsed", "handleHexChange", "hex", "onHexChange", "handleLightnessChange", "lightness", "setLightness", "handleLuminanceChange", "luminance", "setLuminance", "presetOptions", "key", "preset", "React", "Z", "props", "RangeSlider", "Oe", "OptionPreview", "Components_default", "Panel", "import_react_ui_components", "import_neos_ui_redux_store", "import_react", "HexOutput", "hex", "React", "import_react", "import_react", "Circle", "style", "className", "size", "React", "attribute", "values", "Dots", "number", "cx", "beginn", "import_neos_ui_decorators", "Loading", "id", "title", "isLoading", "delayTime", "timeoutTime", "i18nRegistry", "heightMultiplier", "showLoading", "setShowLoading", "translatedTitle", "delay", "timeout", "React", "props", "Circle", "Dots", "neosifier", "globalRegistry", "LoadingWithStyleX_default", "getDataLoaderOptionsForProps", "props", "ColorName", "defaultOptions", "styles", "color", "luminance", "contrastThreshold", "colors", "open", "transitions", "Editor", "mergedOptions", "value", "commit", "highlight", "i18nRegistry", "id", "dataSourcesDataLoader", "renderHelpIcon", "label", "mode", "precision", "dataSourceIdentifier", "dataSourceUri", "dataSourceAdditionalData", "React", "hasDataSource", "options", "setOptions", "isLoading", "setIsLoading", "setOpen", "state", "setState", "setStateFromValue", "dataSourceOptionsAsJSON", "setDataSourceOptionsAsJSON", "dataAsJSON", "values", "customProperty", "enableCollapsed", "LoadingWithStyleX_default", "HexOutput", "event", "Components_default", "neosifier", "globalRegistry", "connector", "ColorPicker_default", "dist_default", "globalRegistry", "ColorPicker_default"] + "sources": ["../../node_modules/.pnpm/@neos-project+neos-ui-extensibility@8.3.11/node_modules/@neos-project/neos-ui-extensibility/src/readFromConsumerApi.ts", "../../node_modules/.pnpm/@neos-project+neos-ui-extensibility@8.3.11/node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/react/index.js", "../../node_modules/.pnpm/@neos-project+neos-ui-extensibility@8.3.11/node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-decorators/index.js", "../../node_modules/.pnpm/@neos-project+neos-ui-extensibility@8.3.11/node_modules/@neos-project/neos-ui-extensibility/src/shims/vendor/react-redux/index.js", "../../node_modules/.pnpm/@neos-project+neos-ui-extensibility@8.3.11/node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/react-ui-components/index.js", "../../node_modules/.pnpm/@neos-project+neos-ui-extensibility@8.3.11/node_modules/@neos-project/neos-ui-extensibility/src/shims/neosProjectPackages/neos-ui-redux-store/index.js", "../../node_modules/.pnpm/@neos-project+neos-ui-extensibility@8.3.11/node_modules/@neos-project/neos-ui-extensibility/src/index.ts", "../Private/Editor/ColorPicker/index.tsx", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/multiply-matrices.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/util.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/hooks.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/adapt.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/defaults.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/parse.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/getColor.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/space.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/spaces/xyz-d65.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/rgbspace.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/getAll.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/get.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/setAll.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/set.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/spaces/xyz-d50.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/spaces/lab.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/angles.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/spaces/lch.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/deltaE/deltaE2000.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/spaces/oklab.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/deltaE/deltaEOK.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/inGamut.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/clone.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/distance.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/deltaE/deltaE76.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/deltaE/deltaECMC.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/spaces/xyz-abs-d65.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/spaces/jzazbz.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/spaces/jzczhz.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/deltaE/deltaEJz.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/spaces/ictcp.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/deltaE/deltaEITP.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/spaces/cam16.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/spaces/hct.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/deltaE/deltaEHCT.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/deltaE/index.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/toGamut.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/to.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/serialize.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/spaces/srgb-linear.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/keywords.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/spaces/srgb.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/spaces/hsl.js", "../../node_modules/.pnpm/colorjs.io@0.5.2/node_modules/colorjs.io/src/spaces/oklch.js", "../Private/Editor/ColorPicker/Components/ColorConverter.ts", "../Private/Editor/ColorPicker/Components/OptionPreview.tsx", "../../node_modules/.pnpm/@stylexjs+stylex@0.8.0/node_modules/@stylexjs/stylex/lib/es/stylex.mjs", "../Private/Editor/ColorPicker/Tokens.stylex.ts", "../Private/Editor/ColorPicker/Components/RangeSlider.tsx", "../Private/Editor/ColorPicker/Components/Panel.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/hooks/useEventCallback.ts", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/utils/clamp.ts", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/common/Interactive.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/utils/format.ts", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/common/Pointer.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/utils/round.ts", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/utils/convert.ts", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/common/Hue.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/common/Saturation.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/utils/compare.ts", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/hooks/useColorManipulation.ts", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/utils/nonce.ts", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/hooks/useIsomorphicLayoutEffect.ts", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/hooks/useStyleSheet.ts", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/common/ColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/HexColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/common/Alpha.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/common/AlphaColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/HexAlphaColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/HslaColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/HslaStringColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/HslColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/HslStringColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/HsvaColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/HsvaStringColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/HsvColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/HsvStringColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/RgbaColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/RgbaStringColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/RgbColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/RgbStringColorPicker.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/utils/validate.ts", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/common/ColorInput.tsx", "../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-colorful/src/components/HexColorInput.tsx", "../Private/Editor/ColorPicker/Components/index.ts", "../Private/Editor/ColorPicker/Components/HexOutput.tsx", "../../node_modules/.pnpm/carbon-neos-loadinganimation@1.1.1_@neos-project+neos-ui-extensibility@8.3.11/node_modules/carbon-neos-loadinganimation/src/LoadingWithStyleX.jsx", "../../node_modules/.pnpm/carbon-neos-loadinganimation@1.1.1_@neos-project+neos-ui-extensibility@8.3.11/node_modules/carbon-neos-loadinganimation/src/Elements.jsx", "../Private/Editor/manifest.ts"], + "sourcesContent": [null, null, null, null, null, null, null, "// @ts-ignore\nimport React, { useState, useEffect, MouseEvent, lazy, Suspense } from \"react\";\nimport { neos } from \"@neos-project/neos-ui-decorators\";\nimport { connect } from \"react-redux\";\nimport Panel, { setStateFromValue } from \"./Components\";\nimport { Icon, IconButton, Label } from \"@neos-project/react-ui-components\";\nimport { selectors } from \"@neos-project/neos-ui-redux-store\";\nimport * as stylex from \"@stylexjs/stylex\";\nimport \"./Tokens.stylex\";\nimport { colors, sizes, transitions } from \"./Tokens.stylex\";\nimport HexOutput from \"./Components/HexOutput\";\nimport LoadingAnimation from \"carbon-neos-loadinganimation/LoadingWithStyleX\";\nconst getDataLoaderOptionsForProps = (props: any) => ({\n contextNodePath: props.focusedNodePath,\n dataSourceIdentifier: props.options.dataSourceIdentifier,\n dataSourceUri: props.options.dataSourceUri,\n dataSourceAdditionalData: props.options.dataSourceAdditionalData,\n dataSourceDisableCaching: Boolean(props.options.dataSourceDisableCaching)\n});\nconst ColorName = lazy(() => import(\"./ColorName.js\"));\nconst defaultOptions = {\n mode: \"all\",\n customPropertyName: \"color\",\n // This option makes it possible hide the whole editor based on data source\n hidden: false,\n disabled: false,\n allowEmpty: true,\n showPresets: true,\n showPicker: true,\n showHexInput: true,\n showLightness: false,\n showLuminance: false,\n hasOwnLabel: false,\n contrastThreshold: 0.6,\n precision: 5,\n presets: {}\n};\nconst styles = {\n disabled: {\n cursor: \"x1h6gzvc\",\n opacity: \"x190dgpg\",\n \":where(*) *_pointerEvents\": \"x1g8rrie\",\n $$css: true\n },\n highlight: {\n borderRadius: \"xjohyra\",\n boxShadow: \"x11mstge\",\n $$css: true\n },\n wrapper: {\n display: \"x78zum5\",\n flexDirection: \"xdt5ytf\",\n gap: \"x188dswm\",\n $$css: true\n },\n popoverButton: {\n display: \"x78zum5\",\n alignItems: \"x6s0dn4\",\n justifyContent: \"x1szn6h9\",\n borderWidth: \"xc342km\",\n padding: \"x1717udv\",\n minHeight: \"x1rhtz0q\",\n borderRadius: \"xjohyra\",\n cursor: \"x1ypdohk\",\n background: \"x11g6tue\",\n backgroundColor: \"x1qjns4s\",\n $$css: true\n },\n popoverButtonPreview: (color, luminance, contrastThreshold) => [{\n flex: \"x98rzlu\",\n flexGrow: null,\n flexShrink: null,\n flexBasis: null,\n display: \"x78zum5\",\n alignItems: \"x6s0dn4\",\n justifyContent: \"x1nhvcw1\",\n textAlign: \"xdpxx8g\",\n minHeight: \"x1rhtz0q\",\n borderTopLeftRadius: \"x6bjwg6\",\n borderStartStartRadius: null,\n borderStartEndRadius: null,\n borderBottomLeftRadius: \"x1trtmuu\",\n borderEndStartRadius: null,\n borderEndEndRadius: null,\n color: \"x19dipnz\",\n backgroundColor: \"xq1mx2j\",\n backgroundSize: \"xx8ilsi\",\n backgroundImage: \"x1g0zcm7\",\n paddingInline: \"xtqyqw7\",\n paddingStart: null,\n paddingLeft: null,\n paddingEnd: null,\n paddingRight: null,\n overflow: \"xb3r6kr\",\n overflowX: null,\n overflowY: null,\n textOverflow: \"xlyipyv\",\n $$css: true\n }, {\n \"--color\": (luminance > contrastThreshold ? \"black\" : \"white\") != null ? luminance > contrastThreshold ? \"black\" : \"white\" : \"initial\",\n \"--backgroundColor\": (color || null) != null ? color || null : \"initial\",\n \"--backgroundSize\": (color ? null : \"16px 16px\") != null ? color ? null : \"16px 16px\" : \"initial\",\n \"--backgroundImage\": (color ? null : colors.checkerboard) != null ? color ? null : colors.checkerboard : \"initial\"\n }],\n popoverButtonIcon: open => [{\n transform: \"x1v0jg1i\",\n transition: \"xl913vs\",\n transitionBehavior: null,\n transitionDelay: null,\n transitionDuration: null,\n transitionProperty: null,\n transitionTimingFunction: null,\n minWidth: \"x15g7okx\",\n $$css: true\n }, {\n \"--transform\": (open ? \"rotate(180deg)\" : \"rotate(0deg)\") != null ? open ? \"rotate(180deg)\" : \"rotate(0deg)\" : \"initial\"\n }],\n popoverPanel: open => [{\n display: \"xrvj5dj\",\n gridTemplateRows: \"xi7raoi\",\n opacity: \"x1u4uod0\",\n transition: \"x5z8be9\",\n transitionBehavior: null,\n transitionDelay: null,\n transitionDuration: null,\n transitionProperty: null,\n transitionTimingFunction: null,\n $$css: true\n }, {\n \"--gridTemplateRows\": (open ? \"1fr\" : \"0fr\") != null ? open ? \"1fr\" : \"0fr\" : \"initial\",\n \"--opacity\": (open ? 1 : 0) != null ? open ? 1 : 0 : \"initial\",\n \"--transition\": `grid-template-rows ${transitions.default} ${transitions.timing}, opacity ${transitions.fast} ${transitions.timing} ${open ? transitions.fast : \"0s\"}` != null ? `grid-template-rows ${transitions.default} ${transitions.timing}, opacity ${transitions.fast} ${transitions.timing} ${open ? transitions.fast : \"0s\"}` : \"initial\"\n }],\n noGap: {\n gap: \"xxhr3t\",\n rowGap: null,\n columnGap: null,\n $$css: true\n }\n};\n\n// @ts-ignore\nfunction Editor(props) {\n const mergedOptions = {\n ...defaultOptions,\n ...props.config,\n ...props.options\n };\n const {\n value,\n commit,\n highlight,\n i18nRegistry,\n id,\n dataSourcesDataLoader,\n renderHelpIcon\n } = props;\n const label = i18nRegistry.translate(props.label);\n const {\n mode,\n precision,\n dataSourceIdentifier,\n dataSourceUri,\n dataSourceAdditionalData\n } = mergedOptions;\n if (mode !== \"coords\" && mode !== \"hex\" && mode !== \"all\" && mode !== \"oklch\") {\n return
\n {i18nRegistry.translate(\"Carbon.ColorPicker.OKLCH:Main:invalidMode\", \"\", [mode])}\n
;\n }\n const hasDataSource = !!(dataSourceIdentifier || dataSourceUri);\n const [options, setOptions] = useState(hasDataSource ? [] : mergedOptions);\n const [isLoading, setIsLoading] = useState(hasDataSource);\n const [open, setOpen] = useState(false);\n const [state, setState] = useState(setStateFromValue(value, mode, precision));\n\n // We use this hack to prevent the editor from re-rendering all the time, even if the options are the same.\n const [dataSourceOptionsAsJSON, setDataSourceOptionsAsJSON] = useState(null);\n useEffect(() => {\n const dataAsJSON = JSON.stringify({\n dataSourceIdentifier,\n dataSourceUri,\n dataSourceAdditionalData\n });\n if (!hasDataSource || dataSourceOptionsAsJSON === dataAsJSON) {\n return;\n }\n setDataSourceOptionsAsJSON(dataAsJSON);\n\n // Load options from data source\n dataSourcesDataLoader.resolveValue(getDataLoaderOptionsForProps(props), value).then((values: any) => {\n setIsLoading(false);\n setOptions({\n ...mergedOptions,\n ...values\n });\n });\n }, [dataSourceIdentifier, dataSourceUri, dataSourceAdditionalData]);\n useEffect(() => {\n if (!state?.hex) {\n if (value == \"\") {\n return;\n }\n\n // Make no commit if the color is empty\n if ((mode === \"all\" || mode === \"coords\") && (JSON.stringify(value) == \"{}\" || JSON.stringify(value) == \"[]\")) {\n return;\n }\n commit(\"\");\n return;\n }\n if (mode === \"all\") {\n if (value.oklch != state.oklch) {\n // create custom properties\n const customProperty = {\n coords: `--${options.customPropertyName}-l:${state.coords.l};--${options.customPropertyName}-c:${state.coords.c};--${options.customPropertyName}-h:${state.coords.h};`,\n oklch: `--${options.customPropertyName}:${state.oklch};`,\n hex: `--${options.customPropertyName}:${state.hex};`\n };\n commit({\n hex: state.hex,\n oklch: state.oklch,\n coords: state.coords,\n customProperty\n });\n }\n return;\n }\n if (mode === \"coords\") {\n if (JSON.stringify(value) != JSON.stringify(state.coords)) {\n commit(state.coords);\n }\n return;\n }\n if (value != state[mode]) {\n commit(state[mode]);\n }\n }, [state]);\n const enableCollapsed = options.collapsed && options.showPicker;\n if (isLoading) {\n return <>\n \n \n ;\n }\n if (options.hidden) {\n return null;\n }\n return <>\n \n
\n {enableCollapsed ? <>\n \n
\n
\n setOpen(true)} collapsed={true} />\n
\n
\n : }\n
\n ;\n}\nconst neosifier = neos(globalRegistry => ({\n i18nRegistry: globalRegistry.get(\"i18n\"),\n config: globalRegistry.get(\"frontendConfiguration\").get(\"Carbon.ColorPicker.OKLCH\"),\n // @ts-ignore\n dataSourcesDataLoader: globalRegistry.get(\"dataLoaders\").get(\"DataSources\")\n}));\nconst connector = connect((state: any) => ({\n // @ts-ignore\n focusedNodePath: selectors.CR.Nodes.focusedNodePathSelector(state)\n}));\nexport default neosifier(connector(Editor));", "// A is m x n. B is n x p. product is m x p.\nexport default function multiplyMatrices (A, B) {\n\tlet m = A.length;\n\n\tif (!Array.isArray(A[0])) {\n\t\t// A is vector, convert to [[a, b, c, ...]]\n\t\tA = [A];\n\t}\n\n\tif (!Array.isArray(B[0])) {\n\t\t// B is vector, convert to [[a], [b], [c], ...]]\n\t\tB = B.map(x => [x]);\n\t}\n\n\tlet p = B[0].length;\n\tlet B_cols = B[0].map((_, i) => B.map(x => x[i])); // transpose B\n\tlet product = A.map(row => B_cols.map(col => {\n\t\tlet ret = 0;\n\n\t\tif (!Array.isArray(row)) {\n\t\t\tfor (let c of col) {\n\t\t\t\tret += row * c;\n\t\t\t}\n\n\t\t\treturn ret;\n\t\t}\n\n\t\tfor (let i = 0; i < row.length; i++) {\n\t\t\tret += row[i] * (col[i] || 0);\n\t\t}\n\n\t\treturn ret;\n\t}));\n\n\tif (m === 1) {\n\t\tproduct = product[0]; // Avoid [[a, b, c, ...]]\n\t}\n\n\tif (p === 1) {\n\t\treturn product.map(x => x[0]); // Avoid [[a], [b], [c], ...]]\n\t}\n\n\treturn product;\n}\n", "/**\n * Various utility functions\n */\n\nexport {default as multiplyMatrices} from \"./multiply-matrices.js\";\n\n/**\n * Check if a value is a string (including a String object)\n * @param {*} str - Value to check\n * @returns {boolean}\n */\nexport function isString (str) {\n\treturn type(str) === \"string\";\n}\n\n/**\n * Determine the internal JavaScript [[Class]] of an object.\n * @param {*} o - Value to check\n * @returns {string}\n */\nexport function type (o) {\n\tlet str = Object.prototype.toString.call(o);\n\n\treturn (str.match(/^\\[object\\s+(.*?)\\]$/)[1] || \"\").toLowerCase();\n}\n\nexport function serializeNumber (n, {precision, unit }) {\n\tif (isNone(n)) {\n\t\treturn \"none\";\n\t}\n\n\treturn toPrecision(n, precision) + (unit ?? \"\");\n}\n\n/**\n * Check if a value corresponds to a none argument\n * @param {*} n - Value to check\n * @returns {boolean}\n */\nexport function isNone (n) {\n\treturn Number.isNaN(n) || (n instanceof Number && n?.none);\n}\n\n/**\n * Replace none values with 0\n */\nexport function skipNone (n) {\n\treturn isNone(n) ? 0 : n;\n}\n\n/**\n * Round a number to a certain number of significant digits\n * @param {number} n - The number to round\n * @param {number} precision - Number of significant digits\n */\nexport function toPrecision (n, precision) {\n\tif (n === 0) {\n\t\treturn 0;\n\t}\n\tlet integer = ~~n;\n\tlet digits = 0;\n\tif (integer && precision) {\n\t\tdigits = ~~Math.log10(Math.abs(integer)) + 1;\n\t}\n\tconst multiplier = 10.0 ** (precision - digits);\n\treturn Math.floor(n * multiplier + 0.5) / multiplier;\n}\n\nconst angleFactor = {\n\tdeg: 1,\n\tgrad: 0.9,\n\trad: 180 / Math.PI,\n\tturn: 360,\n};\n\n/**\n* Parse a CSS function, regardless of its name and arguments\n* @param String str String to parse\n* @return {{name, args, rawArgs}}\n*/\nexport function parseFunction (str) {\n\tif (!str) {\n\t\treturn;\n\t}\n\n\tstr = str.trim();\n\n\tconst isFunctionRegex = /^([a-z]+)\\((.+?)\\)$/i;\n\tconst isNumberRegex = /^-?[\\d.]+$/;\n\tconst unitValueRegex = /%|deg|g?rad|turn$/;\n\tconst singleArgument = /\\/?\\s*(none|[-\\w.]+(?:%|deg|g?rad|turn)?)/g;\n\tlet parts = str.match(isFunctionRegex);\n\n\tif (parts) {\n\t\t// It is a function, parse args\n\t\tlet args = [];\n\t\tparts[2].replace(singleArgument, ($0, rawArg) => {\n\t\t\tlet match = rawArg.match(unitValueRegex);\n\t\t\tlet arg = rawArg;\n\n\t\t\tif (match) {\n\t\t\t\tlet unit = match[0];\n\t\t\t\t// Drop unit from value\n\t\t\t\tlet unitlessArg = arg.slice(0, -unit.length);\n\n\t\t\t\tif (unit === \"%\") {\n\t\t\t\t\t// Convert percentages to 0-1 numbers\n\t\t\t\t\targ = new Number(unitlessArg / 100);\n\t\t\t\t\targ.type = \"\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// Multiply angle by appropriate factor for its unit\n\t\t\t\t\targ = new Number(unitlessArg * angleFactor[unit]);\n\t\t\t\t\targ.type = \"\";\n\t\t\t\t\targ.unit = unit;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (isNumberRegex.test(arg)) {\n\t\t\t\t// Convert numerical args to numbers\n\t\t\t\targ = new Number(arg);\n\t\t\t\targ.type = \"\";\n\t\t\t}\n\t\t\telse if (arg === \"none\") {\n\t\t\t\targ = new Number(NaN);\n\t\t\t\targ.none = true;\n\t\t\t}\n\n\t\t\tif ($0.startsWith(\"/\")) {\n\t\t\t\t// It's alpha\n\t\t\t\targ = arg instanceof Number ? arg : new Number(arg);\n\t\t\t\targ.alpha = true;\n\t\t\t}\n\n\t\t\tif (typeof arg === \"object\" && arg instanceof Number) {\n\t\t\t\targ.raw = rawArg;\n\t\t\t}\n\n\t\t\targs.push(arg);\n\t\t});\n\n\t\treturn {\n\t\t\tname: parts[1].toLowerCase(),\n\t\t\trawName: parts[1],\n\t\t\trawArgs: parts[2],\n\t\t\t// An argument could be (as of css-color-4):\n\t\t\t// a number, percentage, degrees (hue), ident (in color())\n\t\t\targs,\n\t\t};\n\t}\n}\n\nexport function last (arr) {\n\treturn arr[arr.length - 1];\n}\n\nexport function interpolate (start, end, p) {\n\tif (isNaN(start)) {\n\t\treturn end;\n\t}\n\n\tif (isNaN(end)) {\n\t\treturn start;\n\t}\n\n\treturn start + (end - start) * p;\n}\n\nexport function interpolateInv (start, end, value) {\n\treturn (value - start) / (end - start);\n}\n\nexport function mapRange (from, to, value) {\n\treturn interpolate(to[0], to[1], interpolateInv(from[0], from[1], value));\n}\n\nexport function parseCoordGrammar (coordGrammars) {\n\treturn coordGrammars.map(coordGrammar => {\n\t\treturn coordGrammar.split(\"|\").map(type => {\n\t\t\ttype = type.trim();\n\t\t\tlet range = type.match(/^(<[a-z]+>)\\[(-?[.\\d]+),\\s*(-?[.\\d]+)\\]?$/);\n\n\t\t\tif (range) {\n\t\t\t\tlet ret = new String(range[1]);\n\t\t\t\tret.range = [+range[2], +range[3]];\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\treturn type;\n\t\t});\n\t});\n}\n\n/**\n * Clamp value between the minimum and maximum\n * @param {number} min minimum value to return\n * @param {number} val the value to return if it is between min and max\n * @param {number} max maximum value to return\n * @returns number\n */\nexport function clamp (min, val, max) {\n\treturn Math.max(Math.min(max, val), min);\n}\n\n/**\n * Copy sign of one value to another.\n * @param {number} - to number to copy sign to\n * @param {number} - from number to copy sign from\n * @returns number\n */\nexport function copySign (to, from) {\n\treturn Math.sign(to) === Math.sign(from) ? to : -to;\n}\n\n/**\n * Perform pow on a signed number and copy sign to result\n * @param {number} - base the base number\n * @param {number} - exp the exponent\n * @returns number\n */\nexport function spow (base, exp) {\n\treturn copySign(Math.abs(base) ** exp, base);\n}\n\n/**\n * Perform a divide, but return zero if the numerator is zero\n * @param {number} n - the numerator\n * @param {number} d - the denominator\n * @returns number\n */\nexport function zdiv (n, d) {\n\treturn (d === 0) ? 0 : n / d;\n}\n\n/**\n * Perform a bisect on a sorted list and locate the insertion point for\n * a value in arr to maintain sorted order.\n * @param {number[]} arr - array of sorted numbers\n * @param {number} value - value to find insertion point for\n * @param {number} lo - used to specify a the low end of a subset of the list\n * @param {number} hi - used to specify a the high end of a subset of the list\n * @returns number\n */\nexport function bisectLeft (arr, value, lo = 0, hi = arr.length) {\n\twhile (lo < hi) {\n\t\tconst mid = (lo + hi) >> 1;\n\t\tif (arr[mid] < value) {\n\t\t\tlo = mid + 1;\n\t\t}\n\t\telse {\n\t\t\thi = mid;\n\t\t}\n\t}\n\treturn lo;\n}\n", "/**\n * A class for adding deep extensibility to any piece of JS code\n */\nexport class Hooks {\n\tadd (name, callback, first) {\n\t\tif (typeof arguments[0] != \"string\") {\n\t\t\t// Multiple hooks\n\t\t\tfor (var name in arguments[0]) {\n\t\t\t\tthis.add(name, arguments[0][name], arguments[1]);\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t(Array.isArray(name) ? name : [name]).forEach(function (name) {\n\t\t\tthis[name] = this[name] || [];\n\n\t\t\tif (callback) {\n\t\t\t\tthis[name][first ? \"unshift\" : \"push\"](callback);\n\t\t\t}\n\t\t}, this);\n\t}\n\n\trun (name, env) {\n\t\tthis[name] = this[name] || [];\n\t\tthis[name].forEach(function (callback) {\n\t\t\tcallback.call(env && env.context ? env.context : env, env);\n\t\t});\n\t}\n}\n\n/**\n * The instance of {@link Hooks} used throughout Color.js\n */\nconst hooks = new Hooks();\n\nexport default hooks;\n", "import hooks from \"./hooks.js\";\nimport {multiplyMatrices} from \"./util.js\";\n\nexport const WHITES = {\n\t// for compatibility, the four-digit chromaticity-derived ones everyone else uses\n\tD50: [0.3457 / 0.3585, 1.00000, (1.0 - 0.3457 - 0.3585) / 0.3585],\n\tD65: [0.3127 / 0.3290, 1.00000, (1.0 - 0.3127 - 0.3290) / 0.3290],\n};\n\nexport function getWhite (name) {\n\tif (Array.isArray(name)) {\n\t\treturn name;\n\t}\n\n\treturn WHITES[name];\n}\n\n// Adapt XYZ from white point W1 to W2\nexport default function adapt (W1, W2, XYZ, options = {}) {\n\tW1 = getWhite(W1);\n\tW2 = getWhite(W2);\n\n\tif (!W1 || !W2) {\n\t\tthrow new TypeError(`Missing white point to convert ${!W1 ? \"from\" : \"\"}${!W1 && !W2 ? \"/\" : \"\"}${!W2 ? \"to\" : \"\"}`);\n\t}\n\n\tif (W1 === W2) {\n\t\t// Same whitepoints, no conversion needed\n\t\treturn XYZ;\n\t}\n\n\tlet env = {W1, W2, XYZ, options};\n\n\thooks.run(\"chromatic-adaptation-start\", env);\n\n\tif (!env.M) {\n\t\tif (env.W1 === WHITES.D65 && env.W2 === WHITES.D50) {\n\t\t\tenv.M = [\n\t\t\t\t[ 1.0479297925449969, 0.022946870601609652, -0.05019226628920524 ],\n\t\t\t\t[ 0.02962780877005599, 0.9904344267538799, -0.017073799063418826 ],\n\t\t\t\t[ -0.009243040646204504, 0.015055191490298152, 0.7518742814281371 ],\n\t\t\t];\n\t\t}\n\t\telse if (env.W1 === WHITES.D50 && env.W2 === WHITES.D65) {\n\n\t\t\tenv.M = [\n\t\t\t\t[ 0.955473421488075, -0.02309845494876471, 0.06325924320057072 ],\n\t\t\t\t[ -0.0283697093338637, 1.0099953980813041, 0.021041441191917323 ],\n\t\t\t\t[ 0.012314014864481998, -0.020507649298898964, 1.330365926242124 ],\n\t\t\t];\n\t\t}\n\t}\n\n\thooks.run(\"chromatic-adaptation-end\", env);\n\n\tif (env.M) {\n\t\treturn multiplyMatrices(env.M, env.XYZ);\n\t}\n\telse {\n\t\tthrow new TypeError(\"Only Bradford CAT with white points D50 and D65 supported for now.\");\n\t}\n}\n", "// Global defaults one may want to configure\nexport default {\n\tgamut_mapping: \"css\",\n\tprecision: 5,\n\tdeltaE: \"76\", // Default deltaE method\n\tverbose: globalThis?.process?.env?.NODE_ENV?.toLowerCase() !== \"test\",\n\twarn: function warn (msg) {\n\t\tif (this.verbose) {\n\t\t\tglobalThis?.console?.warn?.(msg);\n\t\t}\n\t},\n};\n", "import * as util from \"./util.js\";\nimport hooks from \"./hooks.js\";\nimport ColorSpace from \"./space.js\";\nimport defaults from \"./defaults.js\";\n\nconst noneTypes = new Set([\"\", \"\", \"\"]);\n\n/**\n * Validates the coordinates of a color against a format's coord grammar and\n * maps the coordinates to the range or refRange of the coordinates.\n * @param {ColorSpace} space - Colorspace the coords are in\n * @param {object} format - the format object to validate against\n * @param {string} name - the name of the color function. e.g. \"oklab\" or \"color\"\n * @returns {object[]} - an array of type metadata for each coordinate\n */\nfunction coerceCoords (space, format, name, coords) {\n\tlet types = Object.entries(space.coords).map(([id, coordMeta], i) => {\n\t\tlet coordGrammar = format.coordGrammar[i];\n\t\tlet arg = coords[i];\n\t\tlet providedType = arg?.type;\n\n\t\t// Find grammar alternative that matches the provided type\n\t\t// Non-strict equals is intentional because we are comparing w/ string objects\n\t\tlet type;\n\t\tif (arg.none) {\n\t\t\ttype = coordGrammar.find(c => noneTypes.has(c));\n\t\t}\n\t\telse {\n\t\t\ttype = coordGrammar.find(c => c == providedType);\n\t\t}\n\n\t\t// Check that each coord conforms to its grammar\n\t\tif (!type) {\n\t\t\t// Type does not exist in the grammar, throw\n\t\t\tlet coordName = coordMeta.name || id;\n\t\t\tthrow new TypeError(`${providedType ?? arg.raw} not allowed for ${coordName} in ${name}()`);\n\t\t}\n\n\t\tlet fromRange = type.range;\n\n\t\tif (providedType === \"\") {\n\t\t\tfromRange ||= [0, 1];\n\t\t}\n\n\t\tlet toRange = coordMeta.range || coordMeta.refRange;\n\n\t\tif (fromRange && toRange) {\n\t\t\tcoords[i] = util.mapRange(fromRange, toRange, coords[i]);\n\t\t}\n\n\t\treturn type;\n\t});\n\n\treturn types;\n}\n\n\n/**\n * Convert a CSS Color string to a color object\n * @param {string} str\n * @param {object} [options]\n * @param {object} [options.meta] - Object for additional information about the parsing\n * @returns {Color}\n */\nexport default function parse (str, {meta} = {}) {\n\tlet env = {\"str\": String(str)?.trim()};\n\thooks.run(\"parse-start\", env);\n\n\tif (env.color) {\n\t\treturn env.color;\n\t}\n\n\tenv.parsed = util.parseFunction(env.str);\n\n\tif (env.parsed) {\n\t\t// Is a functional syntax\n\t\tlet name = env.parsed.name;\n\n\t\tif (name === \"color\") {\n\t\t\t// color() function\n\t\t\tlet id = env.parsed.args.shift();\n\t\t\t// Check against both and versions\n\t\t\tlet alternateId = id.startsWith(\"--\") ? id.substring(2) : `--${id}`;\n\t\t\tlet ids = [id, alternateId];\n\t\t\tlet alpha = env.parsed.rawArgs.indexOf(\"/\") > 0 ? env.parsed.args.pop() : 1;\n\n\t\t\tfor (let space of ColorSpace.all) {\n\t\t\t\tlet colorSpec = space.getFormat(\"color\");\n\n\t\t\t\tif (colorSpec) {\n\t\t\t\t\tif (ids.includes(colorSpec.id) || colorSpec.ids?.filter((specId) => ids.includes(specId)).length) {\n\t\t\t\t\t\t// From https://drafts.csswg.org/css-color-4/#color-function\n\t\t\t\t\t\t// If more s or s are provided than parameters that the colorspace takes, the excess s at the end are ignored.\n\t\t\t\t\t\t// If less s or s are provided than parameters that the colorspace takes, the missing parameters default to 0. (This is particularly convenient for multichannel printers where the additional inks are spot colors or varnishes that most colors on the page won\u2019t use.)\n\t\t\t\t\t\tconst coords = Object.keys(space.coords).map((_, i) => env.parsed.args[i] || 0);\n\n\t\t\t\t\t\tlet types;\n\n\t\t\t\t\t\tif (colorSpec.coordGrammar) {\n\t\t\t\t\t\t\ttypes = coerceCoords(space, colorSpec, \"color\", coords);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (meta) {\n\t\t\t\t\t\t\tObject.assign(meta, {formatId: \"color\", types});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (colorSpec.id.startsWith(\"--\") && !id.startsWith(\"--\")) {\n\t\t\t\t\t\t\tdefaults.warn(`${space.name} is a non-standard space and not currently supported in the CSS spec. ` +\n\t\t\t\t\t\t\t `Use prefixed color(${colorSpec.id}) instead of color(${id}).`);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (id.startsWith(\"--\") && !colorSpec.id.startsWith(\"--\")) {\n\t\t\t\t\t\t\tdefaults.warn(`${space.name} is a standard space and supported in the CSS spec. ` +\n\t\t\t\t\t\t\t `Use color(${colorSpec.id}) instead of prefixed color(${id}).`);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn {spaceId: space.id, coords, alpha};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Not found\n\t\t\tlet didYouMean = \"\";\n\t\t\tlet registryId = id in ColorSpace.registry ? id : alternateId;\n\t\t\tif (registryId in ColorSpace.registry) {\n\t\t\t\t// Used color space id instead of color() id, these are often different\n\t\t\t\tlet cssId = ColorSpace.registry[registryId].formats?.color?.id;\n\n\t\t\t\tif (cssId) {\n\t\t\t\t\tdidYouMean = `Did you mean color(${cssId})?`;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthrow new TypeError(`Cannot parse color(${id}). ` + (didYouMean || \"Missing a plugin?\"));\n\t\t}\n\t\telse {\n\t\t\tfor (let space of ColorSpace.all) {\n\t\t\t\t// color space specific function\n\t\t\t\tlet format = space.getFormat(name);\n\t\t\t\tif (format && format.type === \"function\") {\n\t\t\t\t\tlet alpha = 1;\n\n\t\t\t\t\tif (format.lastAlpha || util.last(env.parsed.args).alpha) {\n\t\t\t\t\t\talpha = env.parsed.args.pop();\n\t\t\t\t\t}\n\n\t\t\t\t\tlet coords = env.parsed.args;\n\n\t\t\t\t\tlet types;\n\n\t\t\t\t\tif (format.coordGrammar) {\n\t\t\t\t\t\ttypes = coerceCoords(space, format, name, coords);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (meta) {\n\t\t\t\t\t\tObject.assign(meta, {formatId: format.name, types});\n\t\t\t\t\t}\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tspaceId: space.id,\n\t\t\t\t\t\tcoords, alpha,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\t// Custom, colorspace-specific format\n\t\tfor (let space of ColorSpace.all) {\n\t\t\tfor (let formatId in space.formats) {\n\t\t\t\tlet format = space.formats[formatId];\n\n\t\t\t\tif (format.type !== \"custom\") {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (format.test && !format.test(env.str)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tlet color = format.parse(env.str);\n\n\t\t\t\tif (color) {\n\t\t\t\t\tcolor.alpha ??= 1;\n\n\t\t\t\t\tif (meta) {\n\t\t\t\t\t\tmeta.formatId = formatId;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn color;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\n\t// If we're here, we couldn't parse\n\tthrow new TypeError(`Could not parse ${str} as a color. Missing a plugin?`);\n}\n", "import ColorSpace from \"./space.js\";\nimport {isString} from \"./util.js\";\nimport parse from \"./parse.js\";\n\n/**\n * Resolves a color reference (object or string) to a plain color object\n * @param {Color | {space, coords, alpha} | string | Array } color\n * @returns {{space, coords, alpha} | Array<{space, coords, alpha}}>\n */\nexport default function getColor (color) {\n\tif (Array.isArray(color)) {\n\t\treturn color.map(getColor);\n\t}\n\n\tif (!color) {\n\t\tthrow new TypeError(\"Empty color reference\");\n\t}\n\n\tif (isString(color)) {\n\t\tcolor = parse(color);\n\t}\n\n\t// Object fixup\n\tlet space = color.space || color.spaceId;\n\n\tif (!(space instanceof ColorSpace)) {\n\t\t// Convert string id to color space object\n\t\tcolor.space = ColorSpace.get(space);\n\t}\n\n\tif (color.alpha === undefined) {\n\t\tcolor.alpha = 1;\n\t}\n\n\treturn color;\n}\n", "import {type, parseCoordGrammar, serializeNumber, mapRange} from \"./util.js\";\nimport {getWhite} from \"./adapt.js\";\nimport hooks from \"./hooks.js\";\nimport getColor from \"./getColor.js\";\n\nconst \u03B5 = .000075;\n\n/**\n * Class to represent a color space\n */\nexport default class ColorSpace {\n\tconstructor (options) {\n\t\tthis.id = options.id;\n\t\tthis.name = options.name;\n\t\tthis.base = options.base ? ColorSpace.get(options.base) : null;\n\t\tthis.aliases = options.aliases;\n\n\t\tif (this.base) {\n\t\t\tthis.fromBase = options.fromBase;\n\t\t\tthis.toBase = options.toBase;\n\t\t}\n\n\t\t// Coordinate metadata\n\n\t\tlet coords = options.coords ?? this.base.coords;\n\n\t\tfor (let name in coords) {\n\t\t\tif (!(\"name\" in coords[name])) {\n\t\t\t\tcoords[name].name = name;\n\t\t\t}\n\t\t}\n\t\tthis.coords = coords;\n\n\t\t// White point\n\n\t\tlet white = options.white ?? this.base.white ?? \"D65\";\n\t\tthis.white = getWhite(white);\n\n\t\t// Sort out formats\n\n\t\tthis.formats = options.formats ?? {};\n\n\t\tfor (let name in this.formats) {\n\t\t\tlet format = this.formats[name];\n\t\t\tformat.type ||= \"function\";\n\t\t\tformat.name ||= name;\n\t\t}\n\n\t\tif (!this.formats.color?.id) {\n\t\t\tthis.formats.color = {\n\t\t\t\t...this.formats.color ?? {},\n\t\t\t\tid: options.cssId || this.id,\n\t\t\t};\n\t\t}\n\n\t\t// Gamut space\n\n\t\tif (options.gamutSpace) {\n\t\t\t// Gamut space explicitly specified\n\t\t\tthis.gamutSpace = options.gamutSpace === \"self\" ? this : ColorSpace.get(options.gamutSpace);\n\t\t}\n\t\telse {\n\t\t\t// No gamut space specified, calculate a sensible default\n\t\t\tif (this.isPolar) {\n\t\t\t\t// Do not check gamut through polar coordinates\n\t\t\t\tthis.gamutSpace = this.base;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.gamutSpace = this;\n\t\t\t}\n\t\t}\n\n\t\t// Optimize inGamut for unbounded spaces\n\t\tif (this.gamutSpace.isUnbounded) {\n\t\t\tthis.inGamut = (coords, options) => {\n\t\t\t\treturn true;\n\t\t\t};\n\t\t}\n\n\t\t// Other stuff\n\t\tthis.referred = options.referred;\n\n\t\t// Compute ancestors and store them, since they will never change\n\t\tObject.defineProperty(this, \"path\", {\n\t\t\tvalue: getPath(this).reverse(),\n\t\t\twritable: false,\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t});\n\n\t\thooks.run(\"colorspace-init-end\", this);\n\t}\n\n\tinGamut (coords, {epsilon = \u03B5} = {}) {\n\t\tif (!this.equals(this.gamutSpace)) {\n\t\t\tcoords = this.to(this.gamutSpace, coords);\n\t\t\treturn this.gamutSpace.inGamut(coords, {epsilon});\n\t\t}\n\n\t\tlet coordMeta = Object.values(this.coords);\n\n\t\treturn coords.every((c, i) => {\n\t\t\tlet meta = coordMeta[i];\n\n\t\t\tif (meta.type !== \"angle\" && meta.range) {\n\t\t\t\tif (Number.isNaN(c)) {\n\t\t\t\t\t// NaN is always in gamut\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tlet [min, max] = meta.range;\n\t\t\t\treturn (min === undefined || c >= min - epsilon)\n\t\t\t\t && (max === undefined || c <= max + epsilon);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t});\n\t}\n\n\tget isUnbounded () {\n\t\treturn Object.values(this.coords).every(coord => !(\"range\" in coord));\n\t}\n\n\tget cssId () {\n\t\treturn this.formats?.color?.id || this.id;\n\t}\n\n\tget isPolar () {\n\t\tfor (let id in this.coords) {\n\t\t\tif (this.coords[id].type === \"angle\") {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tgetFormat (format) {\n\t\tif (typeof format === \"object\") {\n\t\t\tformat = processFormat(format, this);\n\t\t\treturn format;\n\t\t}\n\n\t\tlet ret;\n\t\tif (format === \"default\") {\n\t\t\t// Get first format\n\t\t\tret = Object.values(this.formats)[0];\n\t\t}\n\t\telse {\n\t\t\tret = this.formats[format];\n\t\t}\n\n\t\tif (ret) {\n\t\t\tret = processFormat(ret, this);\n\t\t\treturn ret;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Check if this color space is the same as another color space reference.\n\t * Allows proxying color space objects and comparing color spaces with ids.\n\t * @param {string | ColorSpace} space ColorSpace object or id to compare to\n\t * @returns {boolean}\n\t */\n\tequals (space) {\n\t\tif (!space) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn this === space || this.id === space || this.id === space.id;\n\t}\n\n\tto (space, coords) {\n\t\tif (arguments.length === 1) {\n\t\t\tconst color = getColor(space);\n\t\t\t[space, coords] = [color.space, color.coords];\n\t\t}\n\n\t\tspace = ColorSpace.get(space);\n\n\t\tif (this.equals(space)) {\n\t\t\t// Same space, no change needed\n\t\t\treturn coords;\n\t\t}\n\n\t\t// Convert NaN to 0, which seems to be valid in every coordinate of every color space\n\t\tcoords = coords.map(c => Number.isNaN(c) ? 0 : c);\n\n\t\t// Find connection space = lowest common ancestor in the base tree\n\t\tlet myPath = this.path;\n\t\tlet otherPath = space.path;\n\n\t\tlet connectionSpace, connectionSpaceIndex;\n\n\t\tfor (let i = 0; i < myPath.length; i++) {\n\t\t\tif (myPath[i].equals(otherPath[i])) {\n\t\t\t\tconnectionSpace = myPath[i];\n\t\t\t\tconnectionSpaceIndex = i;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (!connectionSpace) {\n\t\t\t// This should never happen\n\t\t\tthrow new Error(`Cannot convert between color spaces ${this} and ${space}: no connection space was found`);\n\t\t}\n\n\t\t// Go up from current space to connection space\n\t\tfor (let i = myPath.length - 1; i > connectionSpaceIndex; i--) {\n\t\t\tcoords = myPath[i].toBase(coords);\n\t\t}\n\n\t\t// Go down from connection space to target space\n\t\tfor (let i = connectionSpaceIndex + 1; i < otherPath.length; i++) {\n\t\t\tcoords = otherPath[i].fromBase(coords);\n\t\t}\n\n\t\treturn coords;\n\t}\n\n\tfrom (space, coords) {\n\t\tif (arguments.length === 1) {\n\t\t\tconst color = getColor(space);\n\t\t\t[space, coords] = [color.space, color.coords];\n\t\t}\n\n\t\tspace = ColorSpace.get(space);\n\n\t\treturn space.to(this, coords);\n\t}\n\n\ttoString () {\n\t\treturn `${this.name} (${this.id})`;\n\t}\n\n\tgetMinCoords () {\n\t\tlet ret = [];\n\n\t\tfor (let id in this.coords) {\n\t\t\tlet meta = this.coords[id];\n\t\t\tlet range = meta.range || meta.refRange;\n\t\t\tret.push(range?.min ?? 0);\n\t\t}\n\n\t\treturn ret;\n\t}\n\n\tstatic registry = {};\n\n\t// Returns array of unique color spaces\n\tstatic get all () {\n\t\treturn [...new Set(Object.values(ColorSpace.registry))];\n\t}\n\n\tstatic register (id, space) {\n\t\tif (arguments.length === 1) {\n\t\t\tspace = arguments[0];\n\t\t\tid = space.id;\n\t\t}\n\n\t\tspace = this.get(space);\n\n\t\tif (this.registry[id] && this.registry[id] !== space) {\n\t\t\tthrow new Error(`Duplicate color space registration: '${id}'`);\n\t\t}\n\t\tthis.registry[id] = space;\n\n\t\t// Register aliases when called without an explicit ID.\n\t\tif (arguments.length === 1 && space.aliases) {\n\t\t\tfor (let alias of space.aliases) {\n\t\t\t\tthis.register(alias, space);\n\t\t\t}\n\t\t}\n\n\t\treturn space;\n\t}\n\n\t/**\n\t * Lookup ColorSpace object by name\n\t * @param {ColorSpace | string} name\n\t */\n\tstatic get (space, ...alternatives) {\n\t\tif (!space || space instanceof ColorSpace) {\n\t\t\treturn space;\n\t\t}\n\n\t\tlet argType = type(space);\n\n\t\tif (argType === \"string\") {\n\t\t\t// It's a color space id\n\t\t\tlet ret = ColorSpace.registry[space.toLowerCase()];\n\n\t\t\tif (!ret) {\n\t\t\t\tthrow new TypeError(`No color space found with id = \"${space}\"`);\n\t\t\t}\n\n\t\t\treturn ret;\n\t\t}\n\n\t\tif (alternatives.length) {\n\t\t\treturn ColorSpace.get(...alternatives);\n\t\t}\n\n\t\tthrow new TypeError(`${space} is not a valid color space`);\n\t}\n\n\t/**\n\t * Get metadata about a coordinate of a color space\n\t *\n\t * @static\n\t * @param {Array | string} ref\n\t * @param {ColorSpace | string} [workingSpace]\n\t * @return {Object}\n\t */\n\tstatic resolveCoord (ref, workingSpace) {\n\t\tlet coordType = type(ref);\n\t\tlet space, coord;\n\n\t\tif (coordType === \"string\") {\n\t\t\tif (ref.includes(\".\")) {\n\t\t\t\t// Absolute coordinate\n\t\t\t\t[space, coord] = ref.split(\".\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Relative coordinate\n\t\t\t\t[space, coord] = [, ref];\n\t\t\t}\n\t\t}\n\t\telse if (Array.isArray(ref)) {\n\t\t\t[space, coord] = ref;\n\t\t}\n\t\telse {\n\t\t\t// Object\n\t\t\tspace = ref.space;\n\t\t\tcoord = ref.coordId;\n\t\t}\n\n\t\tspace = ColorSpace.get(space);\n\n\t\tif (!space) {\n\t\t\tspace = workingSpace;\n\t\t}\n\n\t\tif (!space) {\n\t\t\tthrow new TypeError(`Cannot resolve coordinate reference ${ref}: No color space specified and relative references are not allowed here`);\n\t\t}\n\n\t\tcoordType = type(coord);\n\n\t\tif (coordType === \"number\" || coordType === \"string\" && coord >= 0) {\n\t\t\t// Resolve numerical coord\n\t\t\tlet meta = Object.entries(space.coords)[coord];\n\n\t\t\tif (meta) {\n\t\t\t\treturn {space, id: meta[0], index: coord, ...meta[1]};\n\t\t\t}\n\t\t}\n\n\t\tspace = ColorSpace.get(space);\n\n\t\tlet normalizedCoord = coord.toLowerCase();\n\n\t\tlet i = 0;\n\t\tfor (let id in space.coords) {\n\t\t\tlet meta = space.coords[id];\n\n\t\t\tif (id.toLowerCase() === normalizedCoord || meta.name?.toLowerCase() === normalizedCoord) {\n\t\t\t\treturn {space, id, index: i, ...meta};\n\t\t\t}\n\n\t\t\ti++;\n\t\t}\n\n\t\tthrow new TypeError(`No \"${coord}\" coordinate found in ${space.name}. Its coordinates are: ${Object.keys(space.coords).join(\", \")}`);\n\t}\n\n\tstatic DEFAULT_FORMAT = {\n\t\ttype: \"functions\",\n\t\tname: \"color\",\n\t};\n}\n\nfunction getPath (space) {\n\tlet ret = [space];\n\n\tfor (let s = space; s = s.base;) {\n\t\tret.push(s);\n\t}\n\n\treturn ret;\n}\n\nfunction processFormat (format, {coords} = {}) {\n\tif (format.coords && !format.coordGrammar) {\n\t\tformat.type ||= \"function\";\n\t\tformat.name ||= \"color\";\n\n\t\t// Format has not been processed\n\t\tformat.coordGrammar = parseCoordGrammar(format.coords);\n\n\t\tlet coordFormats = Object.entries(coords).map(([id, coordMeta], i) => {\n\t\t\t// Preferred format for each coord is the first one\n\t\t\tlet outputType = format.coordGrammar[i][0];\n\n\t\t\tlet fromRange = coordMeta.range || coordMeta.refRange;\n\t\t\tlet toRange = outputType.range, suffix = \"\";\n\n\t\t\t// Non-strict equals intentional since outputType could be a string object\n\t\t\tif (outputType == \"\") {\n\t\t\t\ttoRange = [0, 100];\n\t\t\t\tsuffix = \"%\";\n\t\t\t}\n\t\t\telse if (outputType == \"\") {\n\t\t\t\tsuffix = \"deg\";\n\t\t\t}\n\n\t\t\treturn {fromRange, toRange, suffix};\n\t\t});\n\n\t\tformat.serializeCoords = (coords, precision) => {\n\t\t\treturn coords.map((c, i) => {\n\t\t\t\tlet {fromRange, toRange, suffix} = coordFormats[i];\n\n\t\t\t\tif (fromRange && toRange) {\n\t\t\t\t\tc = mapRange(fromRange, toRange, c);\n\t\t\t\t}\n\n\t\t\t\tc = serializeNumber(c, {precision, unit: suffix});\n\n\t\t\t\treturn c;\n\t\t\t});\n\t\t};\n\t}\n\n\treturn format;\n}\n", "import ColorSpace from \"../space.js\";\n\nexport default new ColorSpace({\n\tid: \"xyz-d65\",\n\tname: \"XYZ D65\",\n\tcoords: {\n\t\tx: {name: \"X\"},\n\t\ty: {name: \"Y\"},\n\t\tz: {name: \"Z\"},\n\t},\n\twhite: \"D65\",\n\tformats: {\n\t\tcolor: {\n\t\t\tids: [\"xyz-d65\", \"xyz\"],\n\t\t},\n\t},\n\taliases: [\"xyz\"],\n});\n", "import ColorSpace from \"./space.js\";\nimport {multiplyMatrices} from \"./util.js\";\nimport adapt from \"./adapt.js\";\nimport XYZ_D65 from \"./spaces/xyz-d65.js\";\n\n/**\n * Convenience class for RGB color spaces\n * @extends {ColorSpace}\n */\nexport default class RGBColorSpace extends ColorSpace {\n\t/**\n\t * Creates a new RGB ColorSpace.\n\t * If coords are not specified, they will use the default RGB coords.\n\t * Instead of `fromBase()` and `toBase()` functions,\n\t * you can specify to/from XYZ matrices and have `toBase()` and `fromBase()` automatically generated.\n\t * @param {*} options - Same options as {@link ColorSpace} plus:\n\t * @param {number[][]} options.toXYZ_M - Matrix to convert to XYZ\n\t * @param {number[][]} options.fromXYZ_M - Matrix to convert from XYZ\n\t */\n\tconstructor (options) {\n\t\tif (!options.coords) {\n\t\t\toptions.coords = {\n\t\t\t\tr: {\n\t\t\t\t\trange: [0, 1],\n\t\t\t\t\tname: \"Red\",\n\t\t\t\t},\n\t\t\t\tg: {\n\t\t\t\t\trange: [0, 1],\n\t\t\t\t\tname: \"Green\",\n\t\t\t\t},\n\t\t\t\tb: {\n\t\t\t\t\trange: [0, 1],\n\t\t\t\t\tname: \"Blue\",\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\tif (!options.base) {\n\t\t\toptions.base = XYZ_D65;\n\t\t}\n\n\t\tif (options.toXYZ_M && options.fromXYZ_M) {\n\t\t\toptions.toBase ??= rgb => {\n\t\t\t\tlet xyz = multiplyMatrices(options.toXYZ_M, rgb);\n\n\t\t\t\tif (this.white !== this.base.white) {\n\t\t\t\t\t// Perform chromatic adaptation\n\t\t\t\t\txyz = adapt(this.white, this.base.white, xyz);\n\t\t\t\t}\n\n\t\t\t\treturn xyz;\n\t\t\t};\n\n\t\t\toptions.fromBase ??= xyz => {\n\t\t\t\txyz = adapt(this.base.white, this.white, xyz);\n\t\t\t\treturn multiplyMatrices(options.fromXYZ_M, xyz);\n\t\t\t};\n\t\t}\n\n\t\toptions.referred ??= \"display\";\n\n\t\tsuper(options);\n\t}\n}\n", "import ColorSpace from \"./space.js\";\nimport getColor from \"./getColor.js\";\n\n/**\n * Get the coordinates of a color in any color space\n * @param {Color} color\n * @param {string | ColorSpace} [space = color.space] The color space to convert to. Defaults to the color's current space\n * @returns {number[]} The color coordinates in the given color space\n */\nexport default function getAll (color, space) {\n\tcolor = getColor(color);\n\n\tif (!space || color.space.equals(space)) {\n\t\t// No conversion needed\n\t\treturn color.coords.slice();\n\t}\n\n\tspace = ColorSpace.get(space);\n\treturn space.from(color);\n}\n", "import ColorSpace from \"./space.js\";\nimport getAll from \"./getAll.js\";\nimport getColor from \"./getColor.js\";\n\nexport default function get (color, prop) {\n\tcolor = getColor(color);\n\n\tlet {space, index} = ColorSpace.resolveCoord(prop, color.space);\n\tlet coords = getAll(color, space);\n\treturn coords[index];\n}\n", "import ColorSpace from \"./space.js\";\nimport getColor from \"./getColor.js\";\n\nexport default function setAll (color, space, coords) {\n\tcolor = getColor(color);\n\n\tspace = ColorSpace.get(space);\n\tcolor.coords = space.to(color.space, coords);\n\treturn color;\n}\n\nsetAll.returns = \"color\";\n", "import ColorSpace from \"./space.js\";\nimport getColor from \"./getColor.js\";\nimport get from \"./get.js\";\nimport getAll from \"./getAll.js\";\nimport setAll from \"./setAll.js\";\nimport {type} from \"./util.js\";\n\n// Set properties and return current instance\nexport default function set (color, prop, value) {\n\tcolor = getColor(color);\n\n\tif (arguments.length === 2 && type(arguments[1]) === \"object\") {\n\t\t// Argument is an object literal\n\t\tlet object = arguments[1];\n\t\tfor (let p in object) {\n\t\t\tset(color, p, object[p]);\n\t\t}\n\t}\n\telse {\n\t\tif (typeof value === \"function\") {\n\t\t\tvalue = value(get(color, prop));\n\t\t}\n\n\t\tlet {space, index} = ColorSpace.resolveCoord(prop, color.space);\n\t\tlet coords = getAll(color, space);\n\t\tcoords[index] = value;\n\t\tsetAll(color, space, coords);\n\t}\n\n\treturn color;\n}\n\nset.returns = \"color\";\n", "import ColorSpace from \"../space.js\";\nimport adapt from \"../adapt.js\";\nimport XYZ_D65 from \"./xyz-d65.js\";\n\nexport default new ColorSpace({\n\tid: \"xyz-d50\",\n\tname: \"XYZ D50\",\n\twhite: \"D50\",\n\tbase: XYZ_D65,\n\tfromBase: coords => adapt(XYZ_D65.white, \"D50\", coords),\n\ttoBase: coords => adapt(\"D50\", XYZ_D65.white, coords),\n});\n", "import ColorSpace from \"../space.js\";\nimport {WHITES} from \"../adapt.js\";\nimport xyz_d50 from \"./xyz-d50.js\";\n\n// \u03BA * \u03B5 = 2^3 = 8\nconst \u03B5 = 216 / 24389; // 6^3/29^3 == (24/116)^3\nconst \u03B53 = 24 / 116;\nconst \u03BA = 24389 / 27; // 29^3/3^3\n\nlet white = WHITES.D50;\n\nexport default new ColorSpace({\n\tid: \"lab\",\n\tname: \"Lab\",\n\tcoords: {\n\t\tl: {\n\t\t\trefRange: [0, 100],\n\t\t\tname: \"Lightness\",\n\t\t},\n\t\ta: {\n\t\t\trefRange: [-125, 125],\n\t\t},\n\t\tb: {\n\t\t\trefRange: [-125, 125],\n\t\t},\n\t},\n\n\t// Assuming XYZ is relative to D50, convert to CIE Lab\n\t// from CIE standard, which now defines these as a rational fraction\n\twhite,\n\n\tbase: xyz_d50,\n\t// Convert D50-adapted XYX to Lab\n\t// CIE 15.3:2004 section 8.2.1.1\n\tfromBase (XYZ) {\n\t\t// compute xyz, which is XYZ scaled relative to reference white\n\t\tlet xyz = XYZ.map((value, i) => value / white[i]);\n\n\t\t// now compute f\n\t\tlet f = xyz.map(value => value > \u03B5 ? Math.cbrt(value) : (\u03BA * value + 16) / 116);\n\n\t\treturn [\n\t\t\t(116 * f[1]) - 16, // L\n\t\t\t500 * (f[0] - f[1]), // a\n\t\t\t200 * (f[1] - f[2]), // b\n\t\t];\n\t},\n\t// Convert Lab to D50-adapted XYZ\n\t// Same result as CIE 15.3:2004 Appendix D although the derivation is different\n\t// http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html\n\ttoBase (Lab) {\n\t\t// compute f, starting with the luminance-related term\n\t\tlet f = [];\n\t\tf[1] = (Lab[0] + 16) / 116;\n\t\tf[0] = Lab[1] / 500 + f[1];\n\t\tf[2] = f[1] - Lab[2] / 200;\n\n\t\t// compute xyz\n\t\tlet xyz = [\n\t\t\tf[0] > \u03B53 ? Math.pow(f[0], 3) : (116 * f[0] - 16) / \u03BA,\n\t\t\tLab[0] > 8 ? Math.pow((Lab[0] + 16) / 116, 3) : Lab[0] / \u03BA,\n\t\t\tf[2] > \u03B53 ? Math.pow(f[2], 3) : (116 * f[2] - 16) / \u03BA,\n\t\t];\n\n\t\t// Compute XYZ by scaling xyz by reference white\n\t\treturn xyz.map((value, i) => value * white[i]);\n\t},\n\n\tformats: {\n\t\t\"lab\": {\n\t\t\tcoords: [\" | \", \" | [-1,1]\", \" | [-1,1]\"],\n\t\t},\n\t},\n});\n", "export function constrain (angle) {\n\treturn ((angle % 360) + 360) % 360;\n}\n\nexport function adjust (arc, angles) {\n\tif (arc === \"raw\") {\n\t\treturn angles;\n\t}\n\n\tlet [a1, a2] = angles.map(constrain);\n\n\tlet angleDiff = a2 - a1;\n\n\tif (arc === \"increasing\") {\n\t\tif (angleDiff < 0) {\n\t\t\ta2 += 360;\n\t\t}\n\t}\n\telse if (arc === \"decreasing\") {\n\t\tif (angleDiff > 0) {\n\t\t\ta1 += 360;\n\t\t}\n\t}\n\telse if (arc === \"longer\") {\n\t\tif (-180 < angleDiff && angleDiff < 180) {\n\t\t\tif (angleDiff > 0) {\n\t\t\t\ta1 += 360;\n\t\t\t}\n\t\t\telse {\n\t\t\t\ta2 += 360;\n\t\t\t}\n\t\t}\n\t}\n\telse if (arc === \"shorter\") {\n\t\tif (angleDiff > 180) {\n\t\t\ta1 += 360;\n\t\t}\n\t\telse if (angleDiff < -180) {\n\t\t\ta2 += 360;\n\t\t}\n\t}\n\n\treturn [a1, a2];\n}\n", "import ColorSpace from \"../space.js\";\nimport Lab from \"./lab.js\";\nimport {constrain as constrainAngle} from \"../angles.js\";\n\nexport default new ColorSpace({\n\tid: \"lch\",\n\tname: \"LCH\",\n\tcoords: {\n\t\tl: {\n\t\t\trefRange: [0, 100],\n\t\t\tname: \"Lightness\",\n\t\t},\n\t\tc: {\n\t\t\trefRange: [0, 150],\n\t\t\tname: \"Chroma\",\n\t\t},\n\t\th: {\n\t\t\trefRange: [0, 360],\n\t\t\ttype: \"angle\",\n\t\t\tname: \"Hue\",\n\t\t},\n\t},\n\n\tbase: Lab,\n\tfromBase (Lab) {\n\t\t// Convert to polar form\n\t\tlet [L, a, b] = Lab;\n\t\tlet hue;\n\t\tconst \u03B5 = 0.02;\n\n\t\tif (Math.abs(a) < \u03B5 && Math.abs(b) < \u03B5) {\n\t\t\thue = NaN;\n\t\t}\n\t\telse {\n\t\t\thue = Math.atan2(b, a) * 180 / Math.PI;\n\t\t}\n\n\t\treturn [\n\t\t\tL, // L is still L\n\t\t\tMath.sqrt(a ** 2 + b ** 2), // Chroma\n\t\t\tconstrainAngle(hue), // Hue, in degrees [0 to 360)\n\t\t];\n\t},\n\ttoBase (LCH) {\n\t\t// Convert from polar form\n\t\tlet [Lightness, Chroma, Hue] = LCH;\n\t\t// Clamp any negative Chroma\n\t\tif (Chroma < 0) {\n\t\t\tChroma = 0;\n\t\t}\n\t\t// Deal with NaN Hue\n\t\tif (isNaN(Hue)) {\n\t\t\tHue = 0;\n\t\t}\n\t\treturn [\n\t\t\tLightness, // L is still L\n\t\t\tChroma * Math.cos(Hue * Math.PI / 180), // a\n\t\t\tChroma * Math.sin(Hue * Math.PI / 180), // b\n\t\t];\n\t},\n\n\tformats: {\n\t\t\"lch\": {\n\t\t\tcoords: [\" | \", \" | \", \" | \"],\n\t\t},\n\t},\n});\n", "import defaults from \"../defaults.js\";\nimport lab from \"../spaces/lab.js\";\nimport lch from \"../spaces/lch.js\";\nimport getColor from \"../getColor.js\";\n\n// deltaE2000 is a statistically significant improvement\n// and is recommended by the CIE and Idealliance\n// especially for color differences less than 10 deltaE76\n// but is wicked complicated\n// and many implementations have small errors!\n// DeltaE2000 is also discontinuous; in case this\n// matters to you, use deltaECMC instead.\n\nconst Gfactor = 25 ** 7;\nconst \u03C0 = Math.PI;\nconst r2d = 180 / \u03C0;\nconst d2r = \u03C0 / 180;\n\nfunction pow7 (x) {\n\t// Faster than x ** 7 or Math.pow(x, 7)\n\n\tconst x2 = x * x;\n\tconst x7 = x2 * x2 * x2 * x;\n\n\treturn x7;\n}\n\nexport default function (color, sample, {kL = 1, kC = 1, kH = 1} = {}) {\n\t[color, sample] = getColor([color, sample]);\n\n\t// Given this color as the reference\n\t// and the function parameter as the sample,\n\t// calculate deltaE 2000.\n\n\t// This implementation assumes the parametric\n\t// weighting factors kL, kC and kH\n\t// for the influence of viewing conditions\n\t// are all 1, as sadly seems typical.\n\t// kL should be increased for lightness texture or noise\n\t// and kC increased for chroma noise\n\n\tlet [L1, a1, b1] = lab.from(color);\n\tlet C1 = lch.from(lab, [L1, a1, b1])[1];\n\tlet [L2, a2, b2] = lab.from(sample);\n\tlet C2 = lch.from(lab, [L2, a2, b2])[1];\n\n\t// Check for negative Chroma,\n\t// which might happen through\n\t// direct user input of LCH values\n\n\tif (C1 < 0) {\n\t\tC1 = 0;\n\t}\n\tif (C2 < 0) {\n\t\tC2 = 0;\n\t}\n\n\tlet Cbar = (C1 + C2) / 2; // mean Chroma\n\n\t// calculate a-axis asymmetry factor from mean Chroma\n\t// this turns JND ellipses for near-neutral colors back into circles\n\tlet C7 = pow7(Cbar);\n\n\tlet G = 0.5 * (1 - Math.sqrt(C7 / (C7 + Gfactor)));\n\n\t// scale a axes by asymmetry factor\n\t// this by the way is why there is no Lab2000 colorspace\n\tlet adash1 = (1 + G) * a1;\n\tlet adash2 = (1 + G) * a2;\n\n\t// calculate new Chroma from scaled a and original b axes\n\tlet Cdash1 = Math.sqrt(adash1 ** 2 + b1 ** 2);\n\tlet Cdash2 = Math.sqrt(adash2 ** 2 + b2 ** 2);\n\n\t// calculate new hues, with zero hue for true neutrals\n\t// and in degrees, not radians\n\n\tlet h1 = (adash1 === 0 && b1 === 0) ? 0 : Math.atan2(b1, adash1);\n\tlet h2 = (adash2 === 0 && b2 === 0) ? 0 : Math.atan2(b2, adash2);\n\n\tif (h1 < 0) {\n\t\th1 += 2 * \u03C0;\n\t}\n\tif (h2 < 0) {\n\t\th2 += 2 * \u03C0;\n\t}\n\n\th1 *= r2d;\n\th2 *= r2d;\n\n\t// Lightness and Chroma differences; sign matters\n\tlet \u0394L = L2 - L1;\n\tlet \u0394C = Cdash2 - Cdash1;\n\n\t// Hue difference, getting the sign correct\n\tlet hdiff = h2 - h1;\n\tlet hsum = h1 + h2;\n\tlet habs = Math.abs(hdiff);\n\tlet \u0394h;\n\n\tif (Cdash1 * Cdash2 === 0) {\n\t\t\u0394h = 0;\n\t}\n\telse if (habs <= 180) {\n\t\t\u0394h = hdiff;\n\t}\n\telse if (hdiff > 180) {\n\t\t\u0394h = hdiff - 360;\n\t}\n\telse if (hdiff < -180) {\n\t\t\u0394h = hdiff + 360;\n\t}\n\telse {\n\t\tdefaults.warn(\"the unthinkable has happened\");\n\t}\n\n\t// weighted Hue difference, more for larger Chroma\n\tlet \u0394H = 2 * Math.sqrt(Cdash2 * Cdash1) * Math.sin(\u0394h * d2r / 2);\n\n\t// calculate mean Lightness and Chroma\n\tlet Ldash = (L1 + L2) / 2;\n\tlet Cdash = (Cdash1 + Cdash2) / 2;\n\tlet Cdash7 = pow7(Cdash);\n\n\t// Compensate for non-linearity in the blue region of Lab.\n\t// Four possibilities for hue weighting factor,\n\t// depending on the angles, to get the correct sign\n\tlet hdash;\n\tif (Cdash1 * Cdash2 === 0) {\n\t\thdash = hsum; // which should be zero\n\t}\n\telse if (habs <= 180) {\n\t\thdash = hsum / 2;\n\t}\n\telse if (hsum < 360) {\n\t\thdash = (hsum + 360) / 2;\n\t}\n\telse {\n\t\thdash = (hsum - 360) / 2;\n\t}\n\n\t// positional corrections to the lack of uniformity of CIELAB\n\t// These are all trying to make JND ellipsoids more like spheres\n\n\t// SL Lightness crispening factor\n\t// a background with L=50 is assumed\n\tlet lsq = (Ldash - 50) ** 2;\n\tlet SL = 1 + ((0.015 * lsq) / Math.sqrt(20 + lsq));\n\n\t// SC Chroma factor, similar to those in CMC and deltaE 94 formulae\n\tlet SC = 1 + 0.045 * Cdash;\n\n\t// Cross term T for blue non-linearity\n\tlet T = 1;\n\tT -= (0.17 * Math.cos(( hdash - 30) * d2r));\n\tT += (0.24 * Math.cos( 2 * hdash * d2r));\n\tT += (0.32 * Math.cos(((3 * hdash) + 6) * d2r));\n\tT -= (0.20 * Math.cos(((4 * hdash) - 63) * d2r));\n\n\t// SH Hue factor depends on Chroma,\n\t// as well as adjusted hue angle like deltaE94.\n\tlet SH = 1 + 0.015 * Cdash * T;\n\n\t// RT Hue rotation term compensates for rotation of JND ellipses\n\t// and Munsell constant hue lines\n\t// in the medium-high Chroma blue region\n\t// (Hue 225 to 315)\n\tlet \u0394\u03B8 = 30 * Math.exp(-1 * (((hdash - 275) / 25) ** 2));\n\tlet RC = 2 * Math.sqrt(Cdash7 / (Cdash7 + Gfactor));\n\tlet RT = -1 * Math.sin(2 * \u0394\u03B8 * d2r) * RC;\n\n\t// Finally calculate the deltaE, term by term as root sume of squares\n\tlet dE = (\u0394L / (kL * SL)) ** 2;\n\tdE += (\u0394C / (kC * SC)) ** 2;\n\tdE += (\u0394H / (kH * SH)) ** 2;\n\tdE += RT * (\u0394C / (kC * SC)) * (\u0394H / (kH * SH));\n\treturn Math.sqrt(dE);\n\t// Yay!!!\n}\n", "import ColorSpace from \"../space.js\";\nimport {multiplyMatrices} from \"../util.js\";\nimport XYZ_D65 from \"./xyz-d65.js\";\n\n// Recalculated for consistent reference white\n// see https://github.com/w3c/csswg-drafts/issues/6642#issuecomment-943521484\nconst XYZtoLMS_M = [\n\t[ 0.8190224379967030, 0.3619062600528904, -0.1288737815209879 ],\n\t[ 0.0329836539323885, 0.9292868615863434, 0.0361446663506424 ],\n\t[ 0.0481771893596242, 0.2642395317527308, 0.6335478284694309 ],\n];\n// inverse of XYZtoLMS_M\nconst LMStoXYZ_M = [\n\t[ 1.2268798758459243, -0.5578149944602171, 0.2813910456659647 ],\n\t[ -0.0405757452148008, 1.1122868032803170, -0.0717110580655164 ],\n\t[ -0.0763729366746601, -0.4214933324022432, 1.5869240198367816 ],\n];\nconst LMStoLab_M = [\n\t[ 0.2104542683093140, 0.7936177747023054, -0.0040720430116193 ],\n\t[ 1.9779985324311684, -2.4285922420485799, 0.4505937096174110 ],\n\t[ 0.0259040424655478, 0.7827717124575296, -0.8086757549230774 ],\n];\n// LMStoIab_M inverted\nconst LabtoLMS_M = [\n\t[ 1.0000000000000000, 0.3963377773761749, 0.2158037573099136 ],\n\t[ 1.0000000000000000, -0.1055613458156586, -0.0638541728258133 ],\n\t[ 1.0000000000000000, -0.0894841775298119, -1.2914855480194092 ],\n];\n\nexport default new ColorSpace({\n\tid: \"oklab\",\n\tname: \"Oklab\",\n\tcoords: {\n\t\tl: {\n\t\t\trefRange: [0, 1],\n\t\t\tname: \"Lightness\",\n\t\t},\n\t\ta: {\n\t\t\trefRange: [-0.4, 0.4],\n\t\t},\n\t\tb: {\n\t\t\trefRange: [-0.4, 0.4],\n\t\t},\n\t},\n\n\t// Note that XYZ is relative to D65\n\twhite: \"D65\",\n\tbase: XYZ_D65,\n\tfromBase (XYZ) {\n\t\t// move to LMS cone domain\n\t\tlet LMS = multiplyMatrices(XYZtoLMS_M, XYZ);\n\n\t\t// non-linearity\n\t\tlet LMSg = LMS.map(val => Math.cbrt(val));\n\n\t\treturn multiplyMatrices(LMStoLab_M, LMSg);\n\n\t},\n\ttoBase (OKLab) {\n\t\t// move to LMS cone domain\n\t\tlet LMSg = multiplyMatrices(LabtoLMS_M, OKLab);\n\n\t\t// restore linearity\n\t\tlet LMS = LMSg.map(val => val ** 3);\n\n\t\treturn multiplyMatrices(LMStoXYZ_M, LMS);\n\t},\n\n\tformats: {\n\t\t\"oklab\": {\n\t\t\tcoords: [\" | \", \" | [-1,1]\", \" | [-1,1]\"],\n\t\t},\n\t},\n});\n", "// More accurate color-difference formulae\n// than the simple 1976 Euclidean distance in CIE Lab\n\nimport oklab from \"../spaces/oklab.js\";\nimport getColor from \"../getColor.js\";\n\nexport default function (color, sample) {\n\t[color, sample] = getColor([color, sample]);\n\n\t// Given this color as the reference\n\t// and a sample,\n\t// calculate deltaEOK, term by term as root sum of squares\n\tlet [L1, a1, b1] = oklab.from(color);\n\tlet [L2, a2, b2] = oklab.from(sample);\n\tlet \u0394L = L1 - L2;\n\tlet \u0394a = a1 - a2;\n\tlet \u0394b = b1 - b2;\n\treturn Math.sqrt(\u0394L ** 2 + \u0394a ** 2 + \u0394b ** 2);\n}\n", "import ColorSpace from \"./space.js\";\nimport getColor from \"./getColor.js\";\n\nconst \u03B5 = .000075;\n\n/**\n * Check if a color is in gamut of either its own or another color space\n * @return {Boolean} Is the color in gamut?\n */\nexport default function inGamut (color, space, {epsilon = \u03B5} = {}) {\n\tcolor = getColor(color);\n\n\tif (!space) {\n\t\tspace = color.space;\n\t}\n\n\tspace = ColorSpace.get(space);\n\tlet coords = color.coords;\n\n\tif (space !== color.space) {\n\t\tcoords = space.from(color);\n\t}\n\n\treturn space.inGamut(coords, {epsilon});\n}\n", "export default function clone (color) {\n\treturn {\n\t\tspace: color.space,\n\t\tcoords: color.coords.slice(),\n\t\talpha: color.alpha,\n\t};\n}\n", "import ColorSpace from \"./space.js\";\n\n/**\n * Euclidean distance of colors in an arbitrary color space\n */\nexport default function distance (color1, color2, space = \"lab\") {\n\tspace = ColorSpace.get(space);\n\n\t// Assume getColor() is called on color in space.from()\n\tlet coords1 = space.from(color1);\n\tlet coords2 = space.from(color2);\n\n\treturn Math.sqrt(coords1.reduce((acc, c1, i) => {\n\t\tlet c2 = coords2[i];\n\t\tif (isNaN(c1) || isNaN(c2)) {\n\t\t\treturn acc;\n\t\t}\n\n\t\treturn acc + (c2 - c1) ** 2;\n\t}, 0));\n}\n", "import distance from \"../distance.js\";\nimport getColor from \"../getColor.js\";\n\nexport default function deltaE76 (color, sample) {\n\t// Assume getColor() is called in the distance function\n\treturn distance(color, sample, \"lab\");\n}\n", "import lab from \"../spaces/lab.js\";\nimport lch from \"../spaces/lch.js\";\nimport getColor from \"../getColor.js\";\n\n// More accurate color-difference formulae\n// than the simple 1976 Euclidean distance in Lab\n\n// CMC by the Color Measurement Committee of the\n// Bradford Society of Dyeists and Colorsts, 1994.\n// Uses LCH rather than Lab,\n// with different weights for L, C and H differences\n// A nice increase in accuracy for modest increase in complexity\nconst \u03C0 = Math.PI;\nconst d2r = \u03C0 / 180;\n\nexport default function (color, sample, {l = 2, c = 1} = {}) {\n\t[color, sample] = getColor([color, sample]);\n\n\t// Given this color as the reference\n\t// and a sample,\n\t// calculate deltaE CMC.\n\n\t// This implementation assumes the parametric\n\t// weighting factors l:c are 2:1\n\t// which is typical for non-textile uses.\n\n\tlet [L1, a1, b1] = lab.from(color);\n\tlet [, C1, H1] = lch.from(lab, [L1, a1, b1]);\n\tlet [L2, a2, b2] = lab.from(sample);\n\tlet C2 = lch.from(lab, [L2, a2, b2])[1];\n\n\t// let [L1, a1, b1] = color.getAll(lab);\n\t// let C1 = color.get(\"lch.c\");\n\t// let H1 = color.get(\"lch.h\");\n\t// let [L2, a2, b2] = sample.getAll(lab);\n\t// let C2 = sample.get(\"lch.c\");\n\n\t// Check for negative Chroma,\n\t// which might happen through\n\t// direct user input of LCH values\n\n\tif (C1 < 0) {\n\t\tC1 = 0;\n\t}\n\tif (C2 < 0) {\n\t\tC2 = 0;\n\t}\n\n\t// we don't need H2 as \u0394H is calculated from \u0394a, \u0394b and \u0394C\n\n\t// Lightness and Chroma differences\n\t// These are (color - sample), unlike deltaE2000\n\tlet \u0394L = L1 - L2;\n\tlet \u0394C = C1 - C2;\n\n\tlet \u0394a = a1 - a2;\n\tlet \u0394b = b1 - b2;\n\n\t// weighted Hue difference, less for larger Chroma difference\n\n\tlet H2 = (\u0394a ** 2) + (\u0394b ** 2) - (\u0394C ** 2);\n\t// due to roundoff error it is possible that, for zero a and b,\n\t// \u0394C > \u0394a + \u0394b is 0, resulting in attempting\n\t// to take the square root of a negative number\n\n\t// trying instead the equation from Industrial Color Physics\n\t// By Georg A. Klein\n\n\t// let \u0394H = ((a1 * b2) - (a2 * b1)) / Math.sqrt(0.5 * ((C2 * C1) + (a2 * a1) + (b2 * b1)));\n\t// console.log({\u0394H});\n\t// This gives the same result to 12 decimal places\n\t// except it sometimes NaNs when trying to root a negative number\n\n\t// let \u0394H = Math.sqrt(H2); we never actually use the root, it gets squared again!!\n\n\t// positional corrections to the lack of uniformity of CIELAB\n\t// These are all trying to make JND ellipsoids more like spheres\n\n\t// SL Lightness crispening factor, depends entirely on L1 not L2\n\tlet SL = 0.511;\t// linear portion of the Y to L transfer function\n\tif (L1 >= 16) {\t// cubic portion\n\t\tSL = (0.040975 * L1) / (1 + 0.01765 * L1);\n\t}\n\n\t// SC Chroma factor\n\tlet SC = ((0.0638 * C1) / (1 + 0.0131 * C1)) + 0.638;\n\n\t// Cross term T for blue non-linearity\n\tlet T;\n\tif (Number.isNaN(H1)) {\n\t\tH1 = 0;\n\t}\n\n\tif (H1 >= 164 && H1 <= 345) {\n\t\tT = 0.56 + Math.abs(0.2 * Math.cos((H1 + 168) * d2r));\n\t}\n\telse {\n\t\tT = 0.36 + Math.abs(0.4 * Math.cos((H1 + 35) * d2r));\n\t}\n\t// console.log({T});\n\n\t// SH Hue factor also depends on C1,\n\tlet C4 = Math.pow(C1, 4);\n\tlet F = Math.sqrt(C4 / (C4 + 1900));\n\tlet SH = SC * ((F * T) + 1 - F);\n\n\t// Finally calculate the deltaE, term by term as root sume of squares\n\tlet dE = (\u0394L / (l * SL)) ** 2;\n\tdE += (\u0394C / (c * SC)) ** 2;\n\tdE += (H2 / (SH ** 2));\n\t// dE += (\u0394H / SH) ** 2;\n\treturn Math.sqrt(dE);\n\t// Yay!!!\n}\n", "import ColorSpace from \"../space.js\";\nimport XYZ_D65 from \"./xyz-d65.js\";\n\nconst Yw = 203;\t// absolute luminance of media white\n\nexport default new ColorSpace({\n// Absolute CIE XYZ, with a D65 whitepoint,\n// as used in most HDR colorspaces as a starting point.\n// SDR spaces are converted per BT.2048\n// so that diffuse, media white is 203 cd/m\u00B2\n\tid: \"xyz-abs-d65\",\n\tcssId: \"--xyz-abs-d65\",\n\tname: \"Absolute XYZ D65\",\n\tcoords: {\n\t\tx: {\n\t\t\trefRange: [0, 9504.7],\n\t\t\tname: \"Xa\",\n\t\t},\n\t\ty: {\n\t\t\trefRange: [0, 10000],\n\t\t\tname: \"Ya\",\n\t\t},\n\t\tz: {\n\t\t\trefRange: [0, 10888.3],\n\t\t\tname: \"Za\",\n\t\t},\n\t},\n\n\tbase: XYZ_D65,\n\tfromBase (XYZ) {\n\t\t// Make XYZ absolute, not relative to media white\n\t\t// Maximum luminance in PQ is 10,000 cd/m\u00B2\n\t\t// Relative XYZ has Y=1 for media white\n\t\treturn XYZ.map (v => Math.max(v * Yw, 0));\n\t},\n\ttoBase (AbsXYZ) {\n\t\t// Convert to media-white relative XYZ\n\t\treturn AbsXYZ.map(v => Math.max(v / Yw, 0));\n\t},\n});\n", "import ColorSpace from \"../space.js\";\nimport {multiplyMatrices} from \"../util.js\";\nimport XYZ_Abs_D65 from \"./xyz-abs-d65.js\";\n\nconst b = 1.15;\nconst g = 0.66;\nconst n = 2610 / (2 ** 14);\nconst ninv = (2 ** 14) / 2610;\nconst c1 = 3424 / (2 ** 12);\nconst c2 = 2413 / (2 ** 7);\nconst c3 = 2392 / (2 ** 7);\nconst p = 1.7 * 2523 / (2 ** 5);\nconst pinv = (2 ** 5) / (1.7 * 2523);\nconst d = -0.56;\nconst d0 = 1.6295499532821566E-11;\n\nconst XYZtoCone_M = [\n\t[ 0.41478972, 0.579999, 0.0146480 ],\n\t[ -0.2015100, 1.120649, 0.0531008 ],\n\t[ -0.0166008, 0.264800, 0.6684799 ],\n];\n// XYZtoCone_M inverted\nconst ConetoXYZ_M = [\n\t[ 1.9242264357876067, -1.0047923125953657, 0.037651404030618 ],\n\t[ 0.35031676209499907, 0.7264811939316552, -0.06538442294808501 ],\n\t[ -0.09098281098284752, -0.3127282905230739, 1.5227665613052603 ],\n];\nconst ConetoIab_M = [\n\t[ 0.5, 0.5, 0 ],\n\t[ 3.524000, -4.066708, 0.542708 ],\n\t[ 0.199076, 1.096799, -1.295875 ],\n];\n// ConetoIab_M inverted\nconst IabtoCone_M = [\n\t[ 1, 0.1386050432715393, 0.05804731615611886 ],\n\t[ 0.9999999999999999, -0.1386050432715393, -0.05804731615611886 ],\n\t[ 0.9999999999999998, -0.09601924202631895, -0.8118918960560388 ],\n];\n\nexport default new ColorSpace({\n\tid: \"jzazbz\",\n\tname: \"Jzazbz\",\n\tcoords: {\n\t\tjz: {\n\t\t\trefRange: [0, 1],\n\t\t\tname: \"Jz\",\n\t\t},\n\t\taz: {\n\t\t\trefRange: [-0.5, 0.5],\n\t\t},\n\t\tbz: {\n\t\t\trefRange: [-0.5, 0.5],\n\t\t},\n\t},\n\n\tbase: XYZ_Abs_D65,\n\tfromBase (XYZ) {\n\t\t// First make XYZ absolute, not relative to media white\n\t\t// Maximum luminance in PQ is 10,000 cd/m\u00B2\n\t\t// Relative XYZ has Y=1 for media white\n\t\t// BT.2048 says media white Y=203 at PQ 58\n\n\t\tlet [ Xa, Ya, Za ] = XYZ;\n\n\t\t// modify X and Y\n\t\tlet Xm = (b * Xa) - ((b - 1) * Za);\n\t\tlet Ym = (g * Ya) - ((g - 1) * Xa);\n\n\t\t// move to LMS cone domain\n\t\tlet LMS = multiplyMatrices(XYZtoCone_M, [ Xm, Ym, Za ]);\n\n\t\t// PQ-encode LMS\n\t\tlet PQLMS = LMS.map (function (val) {\n\t\t\tlet num = c1 + (c2 * ((val / 10000) ** n));\n\t\t\tlet denom = 1 + (c3 * ((val / 10000) ** n));\n\n\t\t\treturn (num / denom) ** p;\n\t\t});\n\n\t\t// almost there, calculate Iz az bz\n\t\tlet [ Iz, az, bz] = multiplyMatrices(ConetoIab_M, PQLMS);\n\t\t// console.log({Iz, az, bz});\n\n\t\tlet Jz = ((1 + d) * Iz) / (1 + (d * Iz)) - d0;\n\t\treturn [Jz, az, bz];\n\t},\n\ttoBase (Jzazbz) {\n\t\tlet [Jz, az, bz] = Jzazbz;\n\t\tlet Iz = (Jz + d0) / (1 + d - d * (Jz + d0));\n\n\t\t// bring into LMS cone domain\n\t\tlet PQLMS = multiplyMatrices(IabtoCone_M, [ Iz, az, bz ]);\n\n\t\t// convert from PQ-coded to linear-light\n\t\tlet LMS = PQLMS.map(function (val) {\n\t\t\tlet num = (c1 - (val ** pinv));\n\t\t\tlet denom = (c3 * (val ** pinv)) - c2;\n\t\t\tlet x = 10000 * ((num / denom) ** ninv);\n\n\t\t\treturn (x); \t// luminance relative to diffuse white, [0, 70 or so].\n\t\t});\n\n\t\t// modified abs XYZ\n\t\tlet [ Xm, Ym, Za ] = multiplyMatrices(ConetoXYZ_M, LMS);\n\n\t\t// restore standard D50 relative XYZ, relative to media white\n\t\tlet Xa = (Xm + ((b - 1) * Za)) / b;\n\t\tlet Ya = (Ym + ((g - 1) * Xa)) / g;\n\t\treturn [ Xa, Ya, Za ];\n\t},\n\n\tformats: {\n\t\t// https://drafts.csswg.org/css-color-hdr/#Jzazbz\n\t\t\"color\": {\n\t\t\tcoords: [\" | \", \" | [-1,1]\", \" | [-1,1]\"],\n\t\t},\n\t},\n});\n", "import ColorSpace from \"../space.js\";\nimport Jzazbz from \"./jzazbz.js\";\nimport {constrain as constrainAngle} from \"../angles.js\";\n\nexport default new ColorSpace({\n\tid: \"jzczhz\",\n\tname: \"JzCzHz\",\n\tcoords: {\n\t\tjz: {\n\t\t\trefRange: [0, 1],\n\t\t\tname: \"Jz\",\n\t\t},\n\t\tcz: {\n\t\t\trefRange: [0, 1],\n\t\t\tname: \"Chroma\",\n\t\t},\n\t\thz: {\n\t\t\trefRange: [0, 360],\n\t\t\ttype: \"angle\",\n\t\t\tname: \"Hue\",\n\t\t},\n\t},\n\n\tbase: Jzazbz,\n\tfromBase (jzazbz) {\n\t\t// Convert to polar form\n\t\tlet [Jz, az, bz] = jzazbz;\n\t\tlet hue;\n\t\tconst \u03B5 = 0.0002; // chromatic components much smaller than a,b\n\n\t\tif (Math.abs(az) < \u03B5 && Math.abs(bz) < \u03B5) {\n\t\t\thue = NaN;\n\t\t}\n\t\telse {\n\t\t\thue = Math.atan2(bz, az) * 180 / Math.PI;\n\t\t}\n\n\t\treturn [\n\t\t\tJz, // Jz is still Jz\n\t\t\tMath.sqrt(az ** 2 + bz ** 2), // Chroma\n\t\t\tconstrainAngle(hue), // Hue, in degrees [0 to 360)\n\t\t];\n\t},\n\ttoBase (jzczhz) {\n\t\t// Convert from polar form\n\t\t// debugger;\n\t\treturn [\n\t\t\tjzczhz[0], // Jz is still Jz\n\t\t\tjzczhz[1] * Math.cos(jzczhz[2] * Math.PI / 180), // az\n\t\t\tjzczhz[1] * Math.sin(jzczhz[2] * Math.PI / 180), // bz\n\t\t];\n\t},\n});\n", "import jzczhz from \"../spaces/jzczhz.js\";\nimport getColor from \"../getColor.js\";\n\n// More accurate color-difference formulae\n// than the simple 1976 Euclidean distance in Lab\n\n// Uses JzCzHz, which has improved perceptual uniformity\n// and thus a simple Euclidean root-sum of \u0394L\u00B2 \u0394C\u00B2 \u0394H\u00B2\n// gives good results.\n\nexport default function (color, sample) {\n\t[color, sample] = getColor([color, sample]);\n\n\t// Given this color as the reference\n\t// and a sample,\n\t// calculate deltaE in JzCzHz.\n\tlet [Jz1, Cz1, Hz1] = jzczhz.from(color);\n\tlet [Jz2, Cz2, Hz2] = jzczhz.from(sample);\n\n\t// Lightness and Chroma differences\n\t// sign does not matter as they are squared.\n\tlet \u0394J = Jz1 - Jz2;\n\tlet \u0394C = Cz1 - Cz2;\n\n\t// length of chord for \u0394H\n\tif ((Number.isNaN(Hz1)) && (Number.isNaN(Hz2))) {\n\t\t// both undefined hues\n\t\tHz1 = 0;\n\t\tHz2 = 0;\n\t}\n\telse if (Number.isNaN(Hz1)) {\n\t\t// one undefined, set to the defined hue\n\t\tHz1 = Hz2;\n\t}\n\telse if (Number.isNaN(Hz2)) {\n\t\tHz2 = Hz1;\n\t}\n\n\tlet \u0394h = Hz1 - Hz2;\n\tlet \u0394H = 2 * Math.sqrt(Cz1 * Cz2) * Math.sin((\u0394h / 2) * (Math.PI / 180));\n\n\treturn Math.sqrt(\u0394J ** 2 + \u0394C ** 2 + \u0394H ** 2);\n}\n", "import ColorSpace from \"../space.js\";\nimport {multiplyMatrices} from \"../util.js\";\nimport XYZ_Abs_D65 from \"./xyz-abs-d65.js\";\n\nconst c1 = 3424 / 4096;\nconst c2 = 2413 / 128;\nconst c3 = 2392 / 128;\nconst m1 = 2610 / 16384;\nconst m2 = 2523 / 32;\nconst im1 = 16384 / 2610;\nconst im2 = 32 / 2523;\n\n// The matrix below includes the 4% crosstalk components\n// and is from the Dolby \"What is ICtCp\" paper\"\nconst XYZtoLMS_M = [\n\t[ 0.3592832590121217, 0.6976051147779502, -0.0358915932320290 ],\n\t[ -0.1920808463704993, 1.1004767970374321, 0.0753748658519118 ],\n\t[ 0.0070797844607479, 0.0748396662186362, 0.8433265453898765 ],\n];\n// linear-light Rec.2020 to LMS, again with crosstalk\n// rational terms from Jan Fr\u00F6hlich,\n// Encoding High Dynamic Range andWide Color Gamut Imagery, p.97\n// and ITU-R BT.2124-0 p.2\n/*\nconst Rec2020toLMS_M = [\n\t[ 1688 / 4096, 2146 / 4096, 262 / 4096 ],\n\t[ 683 / 4096, 2951 / 4096, 462 / 4096 ],\n\t[ 99 / 4096, 309 / 4096, 3688 / 4096 ]\n];\n*/\n// this includes the Ebner LMS coefficients,\n// the rotation, and the scaling to [-0.5,0.5] range\n// rational terms from Fr\u00F6hlich p.97\n// and ITU-R BT.2124-0 pp.2-3\nconst LMStoIPT_M = [\n\t[ 2048 / 4096, 2048 / 4096, 0 ],\n\t[ 6610 / 4096, -13613 / 4096, 7003 / 4096 ],\n\t[ 17933 / 4096, -17390 / 4096, -543 / 4096 ],\n];\n\n// inverted matrices, calculated from the above\nconst IPTtoLMS_M = [\n\t[ 0.9999999999999998, 0.0086090370379328, 0.1110296250030260 ],\n\t[ 0.9999999999999998, -0.0086090370379328, -0.1110296250030259 ],\n\t[ 0.9999999999999998, 0.5600313357106791, -0.3206271749873188 ],\n];\n/*\nconst LMStoRec2020_M = [\n\t[ 3.4375568932814012112, -2.5072112125095058195, 0.069654319228104608382],\n\t[-0.79142868665644156125, 1.9838372198740089874, -0.19240853321756742626 ],\n\t[-0.025646662911506476363, -0.099240248643945566751, 1.1248869115554520431 ]\n];\n*/\nconst LMStoXYZ_M = [\n\t[ 2.0701522183894223, -1.3263473389671563, 0.2066510476294053 ],\n\t[ 0.3647385209748072, 0.6805660249472273, -0.0453045459220347 ],\n\t[ -0.0497472075358123, -0.0492609666966131, 1.1880659249923042 ],\n];\n\n// Only the PQ form of ICtCp is implemented here. There is also an HLG form.\n// from Dolby, \"WHAT IS ICTCP?\"\n// https://professional.dolby.com/siteassets/pdfs/ictcp_dolbywhitepaper_v071.pdf\n// and\n// Dolby, \"Perceptual Color Volume\n// Measuring the Distinguishable Colors of HDR and WCG Displays\"\n// https://professional.dolby.com/siteassets/pdfs/dolby-vision-measuring-perceptual-color-volume-v7.1.pdf\nexport default new ColorSpace({\n\tid: \"ictcp\",\n\tname: \"ICTCP\",\n\t// From BT.2100-2 page 7:\n\t// During production, signal values are expected to exceed the\n\t// range E\u2032 = [0.0 : 1.0]. This provides processing headroom and avoids\n\t// signal degradation during cascaded processing. Such values of E\u2032,\n\t// below 0.0 or exceeding 1.0, should not be clipped during production\n\t// and exchange.\n\t// Values below 0.0 should not be clipped in reference displays (even\n\t// though they represent \u201Cnegative\u201D light) to allow the black level of\n\t// the signal (LB) to be properly set using test signals known as \u201CPLUGE\u201D\n\tcoords: {\n\t\ti: {\n\t\t\trefRange: [0, 1],\t// Constant luminance,\n\t\t\tname: \"I\",\n\t\t},\n\t\tct: {\n\t\t\trefRange: [-0.5, 0.5],\t// Full BT.2020 gamut in range [-0.5, 0.5]\n\t\t\tname: \"CT\",\n\t\t},\n\t\tcp: {\n\t\t\trefRange: [-0.5, 0.5],\n\t\t\tname: \"CP\",\n\t\t},\n\t},\n\n\tbase: XYZ_Abs_D65,\n\tfromBase (XYZ) {\n\t\t// move to LMS cone domain\n\t\tlet LMS = multiplyMatrices(XYZtoLMS_M, XYZ);\n\n\t\treturn LMStoICtCp(LMS);\n\t},\n\ttoBase (ICtCp) {\n\t\tlet LMS = ICtCptoLMS(ICtCp);\n\n\t\treturn multiplyMatrices(LMStoXYZ_M, LMS);\n\t},\n});\n\nfunction LMStoICtCp (LMS) {\n\t// apply the PQ EOTF\n\t// we can't ever be dividing by zero because of the \"1 +\" in the denominator\n\tlet PQLMS = LMS.map (function (val) {\n\t\tlet num = c1 + (c2 * ((val / 10000) ** m1));\n\t\tlet denom = 1 + (c3 * ((val / 10000) ** m1));\n\n\t\treturn (num / denom) ** m2;\n\t});\n\n\t// LMS to IPT, with rotation for Y'C'bC'r compatibility\n\treturn multiplyMatrices(LMStoIPT_M, PQLMS);\n}\n\nfunction ICtCptoLMS (ICtCp) {\n\tlet PQLMS = multiplyMatrices(IPTtoLMS_M, ICtCp);\n\n\t// From BT.2124-0 Annex 2 Conversion 3\n\tlet LMS = PQLMS.map (function (val) {\n\t\tlet num = Math.max((val ** im2) - c1, 0);\n\t\tlet denom = (c2 - (c3 * (val ** im2)));\n\t\treturn 10000 * ((num / denom) ** im1);\n\t});\n\n\treturn LMS;\n}\n", "import ictcp from \"../spaces/ictcp.js\";\nimport getColor from \"../getColor.js\";\n\n// Delta E in ICtCp space,\n// which the ITU calls Delta E ITP, which is shorter\n// formulae from ITU Rec. ITU-R BT.2124-0\n\nexport default function (color, sample) {\n\t[color, sample] = getColor([color, sample]);\n\n\t// Given this color as the reference\n\t// and a sample,\n\t// calculate deltaE in ICtCp\n\t// which is simply the Euclidean distance\n\n\tlet [ I1, T1, P1 ] = ictcp.from(color);\n\tlet [ I2, T2, P2 ] = ictcp.from(sample);\n\n\t// the 0.25 factor is to undo the encoding scaling in Ct\n\t// the 720 is so that 1 deltaE = 1 JND\n\t// per ITU-R BT.2124-0 p.3\n\n\treturn 720 * Math.sqrt((I1 - I2) ** 2 + (0.25 * (T1 - T2) ** 2) + (P1 - P2) ** 2);\n}\n", "import ColorSpace from \"../space.js\";\nimport {multiplyMatrices, interpolate, copySign, spow, zdiv, bisectLeft} from \"../util.js\";\nimport {constrain} from \"../angles.js\";\nimport xyz_d65 from \"./xyz-d65.js\";\nimport {WHITES} from \"../adapt.js\";\n\nconst white = WHITES.D65;\nconst adaptedCoef = 0.42;\nconst adaptedCoefInv = 1 / adaptedCoef;\nconst tau = 2 * Math.PI;\n\nconst cat16 = [\n\t[ 0.401288, 0.650173, -0.051461 ],\n\t[ -0.250268, 1.204414, 0.045854 ],\n\t[ -0.002079, 0.048952, 0.953127 ],\n];\n\nconst cat16Inv = [\n\t[1.8620678550872327, -1.0112546305316843, 0.14918677544445175],\n\t[0.38752654323613717, 0.6214474419314753, -0.008973985167612518],\n\t[-0.015841498849333856, -0.03412293802851557, 1.0499644368778496],\n];\n\nconst m1 = [\n\t[460.0, 451.0, 288.0],\n\t[460.0, -891.0, -261.0],\n\t[460.0, -220.0, -6300.0],\n];\n\nconst surroundMap = {\n\tdark: [0.8, 0.525, 0.8],\n\tdim: [0.9, 0.59, 0.9],\n\taverage: [1, 0.69, 1],\n};\n\nconst hueQuadMap = {\n\t// Red, Yellow, Green, Blue, Red\n\th: [20.14, 90.00, 164.25, 237.53, 380.14],\n\te: [0.8, 0.7, 1.0, 1.2, 0.8],\n\tH: [0.0, 100.0, 200.0, 300.0, 400.0],\n};\n\nconst rad2deg = 180 / Math.PI;\nconst deg2rad = Math.PI / 180;\n\nexport function adapt (coords, fl) {\n\tconst temp = coords.map(c => {\n\t\tconst x = spow(fl * Math.abs(c) * 0.01, adaptedCoef);\n\t\treturn 400 * copySign(x, c) / (x + 27.13);\n\t});\n\treturn temp;\n}\n\nexport function unadapt (adapted, fl) {\n\tconst constant = 100 / fl * (27.13 ** adaptedCoefInv);\n\treturn adapted.map(c => {\n\t\tconst cabs = Math.abs(c);\n\t\treturn copySign(constant * spow(cabs / (400 - cabs), adaptedCoefInv), c);\n\t});\n}\n\nexport function hueQuadrature (h) {\n\tlet hp = constrain(h);\n\tif (hp <= hueQuadMap.h[0]) {\n\t\thp += 360;\n\t}\n\n\tconst i = bisectLeft(hueQuadMap.h, hp) - 1;\n\tconst [hi, hii] = hueQuadMap.h.slice(i, i + 2);\n\tconst [ei, eii] = hueQuadMap.e.slice(i, i + 2);\n\tconst Hi = hueQuadMap.H[i];\n\n\tconst t = (hp - hi) / ei;\n\treturn Hi + (100 * t) / (t + (hii - hp) / eii);\n}\n\nexport function invHueQuadrature (H) {\n\tlet Hp = ((H % 400 + 400) % 400);\n\tconst i = Math.floor(0.01 * Hp);\n\tHp = Hp % 100;\n\tconst [hi, hii] = hueQuadMap.h.slice(i, i + 2);\n\tconst [ei, eii] = hueQuadMap.e.slice(i, i + 2);\n\n\treturn constrain(\n\t\t(Hp * (eii * hi - ei * hii) - 100 * hi * eii) /\n\t\t(Hp * (eii - ei) - 100 * eii),\n\t);\n}\n\nexport function environment (\n\trefWhite,\n\tadaptingLuminance,\n\tbackgroundLuminance,\n\tsurround,\n\tdiscounting,\n) {\n\n\tconst env = {};\n\n\tenv.discounting = discounting;\n\tenv.refWhite = refWhite;\n\tenv.surround = surround;\n\tconst xyzW = refWhite.map(c => {\n\t\treturn c * 100;\n\t});\n\n\t// The average luminance of the environment in `cd/m^2cd/m` (a.k.a. nits)\n\tenv.la = adaptingLuminance;\n\t// The relative luminance of the nearby background\n\tenv.yb = backgroundLuminance;\n\t// Absolute luminance of the reference white.\n\tconst yw = xyzW[1];\n\n\t// Cone response for reference white\n\tconst rgbW = multiplyMatrices(cat16, xyzW);\n\n\t// Surround: dark, dim, and average\n\tsurround = surroundMap[env.surround];\n\tconst f = surround[0];\n\tenv.c = surround[1];\n\tenv.nc = surround[2];\n\n\tconst k = 1 / (5 * env.la + 1);\n\tconst k4 = k ** 4;\n\n\t// Factor of luminance level adaptation\n\tenv.fl = (k4 * env.la + 0.1 * (1 - k4) * (1 - k4) * Math.cbrt(5 * env.la));\n\tenv.flRoot = env.fl ** 0.25;\n\n\tenv.n = env.yb / yw;\n\tenv.z = 1.48 + Math.sqrt(env.n);\n\tenv.nbb = 0.725 * (env.n ** -0.2);\n\tenv.ncb = env.nbb;\n\n\t// Degree of adaptation calculating if not discounting\n\t// illuminant (assumed eye is fully adapted)\n\tconst d = (discounting) ?\n\t\t1 :\n\t\tMath.max(\n\t\t\tMath.min(f * (1 - 1 / 3.6 * Math.exp((-env.la - 42) / 92)), 1),\n\t\t\t0,\n\t\t);\n\tenv.dRgb = rgbW.map(c => {\n\t\treturn interpolate(1, yw / c, d);\n\t});\n\tenv.dRgbInv = env.dRgb.map(c => {\n\t\treturn 1 / c;\n\t});\n\n\t// Achromatic response\n\tconst rgbCW = rgbW.map((c, i) => {\n\t\treturn c * env.dRgb[i];\n\t});\n\tconst rgbAW = adapt(rgbCW, env.fl);\n\tenv.aW = env.nbb * (2 * rgbAW[0] + rgbAW[1] + 0.05 * rgbAW[2]);\n\n\t// console.log(env);\n\n\treturn env;\n}\n\n// Pre-calculate everything we can with the viewing conditions\nconst viewingConditions = environment(\n\twhite,\n\t64 / Math.PI * 0.2, 20,\n\t\"average\",\n\tfalse,\n);\n\nexport function fromCam16 (cam16, env) {\n\n\t// These check ensure one, and only one attribute for a\n\t// given category is provided.\n\tif (!((cam16.J !== undefined) ^ (cam16.Q !== undefined))) {\n\t\tthrow new Error(\"Conversion requires one and only one: 'J' or 'Q'\");\n\t}\n\n\tif (!((cam16.C !== undefined) ^ (cam16.M !== undefined) ^ (cam16.s !== undefined))) {\n\t\tthrow new Error(\"Conversion requires one and only one: 'C', 'M' or 's'\");\n\t}\n\n\t// Hue is absolutely required\n\tif (!((cam16.h !== undefined) ^ (cam16.H !== undefined))) {\n\t\tthrow new Error(\"Conversion requires one and only one: 'h' or 'H'\");\n\t}\n\n\t// Black\n\tif (cam16.J === 0.0 || cam16.Q === 0.0) {\n\t\treturn [0.0, 0.0, 0.0];\n\t}\n\n\t// Break hue into Cartesian components\n\tlet hRad = 0.0;\n\tif (cam16.h !== undefined) {\n\t\thRad = constrain(cam16.h) * deg2rad;\n\t}\n\telse {\n\t\thRad = invHueQuadrature(cam16.H) * deg2rad;\n\t}\n\n\tconst cosh = Math.cos(hRad);\n\tconst sinh = Math.sin(hRad);\n\n\t// Calculate `Jroot` from one of the lightness derived coordinates.\n\tlet Jroot = 0.0;\n\tif (cam16.J !== undefined) {\n\t\tJroot = spow(cam16.J, 1 / 2) * 0.1;\n\t}\n\telse if (cam16.Q !== undefined) {\n\t\tJroot = 0.25 * env.c * cam16.Q / ((env.aW + 4) * env.flRoot);\n\t}\n\n\t// Calculate the `t` value from one of the chroma derived coordinates\n\tlet alpha = 0.0;\n\tif (cam16.C !== undefined) {\n\t\talpha = cam16.C / Jroot;\n\t}\n\telse if (cam16.M !== undefined) {\n\t\talpha = (cam16.M / env.flRoot) / Jroot;\n\t}\n\telse if (cam16.s !== undefined) {\n\t\talpha = 0.0004 * (cam16.s ** 2) * (env.aW + 4) / env.c;\n\t}\n\tconst t = spow(\n\t\talpha * Math.pow(1.64 - Math.pow(0.29, env.n), -0.73),\n\t\t10 / 9,\n\t);\n\n\t// Eccentricity\n\tconst et = 0.25 * (Math.cos(hRad + 2) + 3.8);\n\n\t// Achromatic response\n\tconst A = env.aW * spow(Jroot, 2 / env.c / env.z);\n\n\t// Calculate red-green and yellow-blue components\n\tconst p1 = 5e4 / 13 * env.nc * env.ncb * et;\n\tconst p2 = A / env.nbb;\n\tconst r = (\n\t\t23 * (p2 + 0.305) *\n\t\tzdiv(t, 23 * p1 + t * (11 * cosh + 108 * sinh))\n\t);\n\tconst a = r * cosh;\n\tconst b = r * sinh;\n\n\t// Calculate back from cone response to XYZ\n\tconst rgb_c = unadapt(\n\t\tmultiplyMatrices(m1, [p2, a, b]).map(c => {\n\t\t\treturn c * 1 / 1403;\n\t\t}),\n\t\tenv.fl,\n\t);\n\treturn multiplyMatrices(\n\t\tcat16Inv,\n\t\trgb_c.map((c, i) => {\n\t\t\treturn c * env.dRgbInv[i];\n\t\t}),\n\t).map(c => {\n\t\treturn c / 100;\n\t});\n}\n\n\nexport function toCam16 (xyzd65, env) {\n\t// Cone response\n\tconst xyz100 = xyzd65.map(c => {\n\t\treturn c * 100;\n\t});\n\tconst rgbA = adapt(\n\t\tmultiplyMatrices(cat16, xyz100).map((c, i) => {\n\t\t\treturn c * env.dRgb[i];\n\t\t}),\n\t\tenv.fl,\n\t);\n\n\t// Calculate hue from red-green and yellow-blue components\n\tconst a = rgbA[0] + (-12 * rgbA[1] + rgbA[2]) / 11;\n\tconst b = (rgbA[0] + rgbA[1] - 2 * rgbA[2]) / 9;\n\tconst hRad = ((Math.atan2(b, a) % tau) + tau) % tau;\n\n\t// Eccentricity\n\tconst et = 0.25 * (Math.cos(hRad + 2) + 3.8);\n\n\tconst t = (\n\t\t5e4 / 13 * env.nc * env.ncb *\n\t\tzdiv(\n\t\t\tet * Math.sqrt(a ** 2 + b ** 2),\n\t\t\trgbA[0] + rgbA[1] + 1.05 * rgbA[2] + 0.305,\n\t\t)\n\t);\n\tconst alpha = spow(t, 0.9) * Math.pow(1.64 - Math.pow(0.29, env.n), 0.73);\n\n\t// Achromatic response\n\tconst A = env.nbb * (2 * rgbA[0] + rgbA[1] + 0.05 * rgbA[2]);\n\n\tconst Jroot = spow(A / env.aW, 0.5 * env.c * env.z);\n\n\t// Lightness\n\tconst J = 100 * spow(Jroot, 2);\n\n\t// Brightness\n\tconst Q = (4 / env.c * Jroot * (env.aW + 4) * env.flRoot);\n\n\t// Chroma\n\tconst C = alpha * Jroot;\n\n\t// Colorfulness\n\tconst M = C * env.flRoot;\n\n\t// Hue\n\tconst h = constrain(hRad * rad2deg);\n\n\t// Hue quadrature\n\tconst H = hueQuadrature(h);\n\n\t// Saturation\n\tconst s = 50 * spow(env.c * alpha / (env.aW + 4), 1 / 2);\n\n\t// console.log({J: J, C: C, h: h, s: s, Q: Q, M: M, H: H});\n\n\treturn {J: J, C: C, h: h, s: s, Q: Q, M: M, H: H};\n}\n\n\n// Provided as a way to directly evaluate the CAM16 model\n// https://observablehq.com/@jrus/cam16: reference implementation\n// https://arxiv.org/pdf/1802.06067.pdf: Nico Schl\u00F6mer\n// https://onlinelibrary.wiley.com/doi/pdf/10.1002/col.22324: hue quadrature\n// https://www.researchgate.net/publication/318152296_Comprehensive_color_solutions_CAM16_CAT16_and_CAM16-UCS\n// Results compared against: https://github.com/colour-science/colour\nexport default new ColorSpace({\n\tid: \"cam16-jmh\",\n\tcssId: \"--cam16-jmh\",\n\tname: \"CAM16-JMh\",\n\tcoords: {\n\t\tj: {\n\t\t\trefRange: [0, 100],\n\t\t\tname: \"J\",\n\t\t},\n\t\tm: {\n\t\t\trefRange: [0, 105.0],\n\t\t\tname: \"Colorfulness\",\n\t\t},\n\t\th: {\n\t\t\trefRange: [0, 360],\n\t\t\ttype: \"angle\",\n\t\t\tname: \"Hue\",\n\t\t},\n\t},\n\n\tbase: xyz_d65,\n\n\tfromBase (xyz) {\n\t\tconst cam16 = toCam16(xyz, viewingConditions);\n\t\treturn [cam16.J, cam16.M, cam16.h];\n\t},\n\ttoBase (cam16) {\n\t\treturn fromCam16(\n\t\t\t{J: cam16[0], M: cam16[1], h: cam16[2]},\n\t\t\tviewingConditions,\n\t\t);\n\t},\n});\n", "import ColorSpace from \"../space.js\";\nimport {constrain} from \"../angles.js\";\nimport xyz_d65 from \"./xyz-d65.js\";\nimport {fromCam16, toCam16, environment} from \"./cam16.js\";\nimport {WHITES} from \"../adapt.js\";\n\nconst white = WHITES.D65;\nconst \u03B5 = 216 / 24389; // 6^3/29^3 == (24/116)^3\nconst \u03BA = 24389 / 27; // 29^3/3^3\n\nfunction toLstar (y) {\n\t// Convert XYZ Y to L*\n\n\tconst fy = (y > \u03B5) ? Math.cbrt(y) : (\u03BA * y + 16) / 116;\n\treturn (116.0 * fy) - 16.0;\n}\n\nfunction fromLstar (lstar) {\n\t// Convert L* back to XYZ Y\n\n\treturn (lstar > 8) ? Math.pow((lstar + 16) / 116, 3) : lstar / \u03BA;\n}\n\nfunction fromHct (coords, env) {\n\t// Use Newton's method to try and converge as quick as possible or\n\t// converge as close as we can. While the requested precision is achieved\n\t// most of the time, it may not always be achievable. Especially past the\n\t// visible spectrum, the algorithm will likely struggle to get the same\n\t// precision. If, for whatever reason, we cannot achieve the accuracy we\n\t// seek in the allotted iterations, just return the closest we were able to\n\t// get.\n\n\tlet [h, c, t] = coords;\n\tlet xyz = [];\n\tlet j = 0;\n\n\t// Shortcut out for black\n\tif (t === 0) {\n\t\treturn [0.0, 0.0, 0.0];\n\t}\n\n\t// Calculate the Y we need to target\n\tlet y = fromLstar(t);\n\n\t// A better initial guess yields better results. Polynomials come from\n\t// curve fitting the T vs J response.\n\tif (t > 0) {\n\t\tj = 0.00379058511492914 * t ** 2 + 0.608983189401032 * t + 0.9155088574762233;\n\t}\n\telse {\n\t\tj = 9.514440756550361e-06 * t ** 2 + 0.08693057439788597 * t - 21.928975842194614;\n\t}\n\n\t// Threshold of how close is close enough, and max number of attempts.\n\t// More precision and more attempts means more time spent iterating. Higher\n\t// required precision gives more accuracy but also increases the chance of\n\t// not hitting the goal. 2e-12 allows us to convert round trip with\n\t// reasonable accuracy of six decimal places or more.\n\tconst threshold = 2e-12;\n\tconst max_attempts = 15;\n\n\tlet attempt = 0;\n\tlet last = Infinity;\n\tlet best = j;\n\n\t// Try to find a J such that the returned y matches the returned y of the L*\n\twhile (attempt <= max_attempts) {\n\t\txyz = fromCam16({J: j, C: c, h: h}, env);\n\n\t\t// If we are within range, return XYZ\n\t\t// If we are closer than last time, save the values\n\t\tconst delta = Math.abs(xyz[1] - y);\n\t\tif (delta < last) {\n\t\t\tif (delta <= threshold) {\n\t\t\t\treturn xyz;\n\t\t\t}\n\t\t\tbest = j;\n\t\t\tlast = delta;\n\t\t}\n\n\t\t// f(j_root) = (j ** (1 / 2)) * 0.1\n\t\t// f(j) = ((f(j_root) * 100) ** 2) / j - 1 = 0\n\t\t// f(j_root) = Y = y / 100\n\t\t// f(j) = (y ** 2) / j - 1\n\t\t// f'(j) = (2 * y) / j\n\t\tj = j - (xyz[1] - y) * j / (2 * xyz[1]);\n\n\t\tattempt += 1;\n\t}\n\n\t// We could not acquire the precision we desired,\n\t// return our closest attempt.\n\treturn fromCam16({J: j, C: c, h: h}, env);\n}\n\nfunction toHct (xyz, env) {\n\t// Calculate HCT by taking the L* of CIE LCh D65 and CAM16 chroma and hue.\n\n\tconst t = toLstar(xyz[1]);\n\tif (t === 0.0) {\n\t\treturn [0.0, 0.0, 0.0];\n\t}\n\tconst cam16 = toCam16(xyz, viewingConditions);\n\treturn [constrain(cam16.h), cam16.C, t];\n}\n\n// Pre-calculate everything we can with the viewing conditions\nexport const viewingConditions = environment(\n\twhite, 200 / Math.PI * fromLstar(50.0),\n\tfromLstar(50.0) * 100,\n\t\"average\",\n\tfalse,\n);\n\n// https://material.io/blog/science-of-color-design\n// This is not a port of the material-color-utilities,\n// but instead implements the full color space as described,\n// combining CAM16 JCh and Lab D65. This does not clamp conversion\n// to HCT to specific chroma bands and provides support for wider\n// gamuts than Google currently supports and does so at a greater\n// precision (> 8 bits back to sRGB).\n// This implementation comes from https://github.com/facelessuser/coloraide\n// which is licensed under MIT.\nexport default new ColorSpace({\n\tid: \"hct\",\n\tname: \"HCT\",\n\tcoords: {\n\t\th: {\n\t\t\trefRange: [0, 360],\n\t\t\ttype: \"angle\",\n\t\t\tname: \"Hue\",\n\t\t},\n\t\tc: {\n\t\t\trefRange: [0, 145],\n\t\t\tname: \"Colorfulness\",\n\t\t},\n\t\tt: {\n\t\t\trefRange: [0, 100],\n\t\t\tname: \"Tone\",\n\t\t},\n\t},\n\n\tbase: xyz_d65,\n\n\tfromBase (xyz) {\n\t\treturn toHct(xyz, viewingConditions);\n\t},\n\ttoBase (hct) {\n\t\treturn fromHct(hct, viewingConditions);\n\t},\n\tformats: {\n\t\tcolor: {\n\t\t\tid: \"--hct\",\n\t\t\tcoords: [\" | \", \" | \", \" | \"],\n\t\t},\n\t},\n});\n", "import hct from \"../spaces/hct.js\";\nimport {viewingConditions} from \"../spaces/hct.js\";\nimport getColor from \"../getColor.js\";\n\nconst rad2deg = 180 / Math.PI;\nconst deg2rad = Math.PI / 180;\nconst ucsCoeff = [1.00, 0.007, 0.0228];\n\n/**\n* Convert HCT chroma and hue (CAM16 JMh colorfulness and hue) using UCS logic for a and b.\n* @param {number[]} coords - HCT coordinates.\n* @return {number[]}\n*/\nfunction convertUcsAb (coords) {\n\t// We want the distance between the actual color.\n\t// If chroma is negative, it will throw off our calculations.\n\t// Normally, converting back to the base and forward will correct it.\n\t// If we have a negative chroma after this, then we have a color that\n\t// cannot resolve to positive chroma.\n\tif (coords[1] < 0) {\n\t\tcoords = hct.fromBase(hct.toBase(coords));\n\t}\n\n\t// Only in extreme cases (usually outside the visible spectrum)\n\t// can the input value for log become negative.\n\t// Avoid domain error by forcing a zero result via \"max\" if necessary.\n\tconst M = Math.log(Math.max(1 + ucsCoeff[2] * coords[1] * viewingConditions.flRoot, 1.0)) / ucsCoeff[2];\n\tconst hrad = coords[0] * deg2rad;\n\tconst a = M * Math.cos(hrad);\n\tconst b = M * Math.sin(hrad);\n\n\treturn [coords[2], a, b];\n}\n\n\n/**\n* Color distance using HCT.\n* @param {Color} color - Color to compare.\n* @param {Color} sample - Color to compare.\n* @return {number[]}\n*/\nexport default function (color, sample) {\n\t[color, sample] = getColor([color, sample]);\n\n\tlet [ t1, a1, b1 ] = convertUcsAb(hct.from(color));\n\tlet [ t2, a2, b2 ] = convertUcsAb(hct.from(sample));\n\n\t// Use simple euclidean distance with a and b using UCS conversion\n\t// and LCh lightness (HCT tone).\n\treturn Math.sqrt((t1 - t2) ** 2 + (a1 - a2) ** 2 + (b1 - b2) ** 2);\n}\n", "import deltaE76 from \"./deltaE76.js\";\nimport deltaECMC from \"./deltaECMC.js\";\nimport deltaE2000 from \"./deltaE2000.js\";\nimport deltaEJz from \"./deltaEJz.js\";\nimport deltaEITP from \"./deltaEITP.js\";\nimport deltaEOK from \"./deltaEOK.js\";\nimport deltaEHCT from \"./deltaEHCT.js\";\n\nexport {\n\tdeltaE76,\n\tdeltaECMC,\n\tdeltaE2000,\n\tdeltaEJz,\n\tdeltaEITP,\n\tdeltaEOK,\n\tdeltaEHCT,\n};\n\nexport default {\n\tdeltaE76,\n\tdeltaECMC,\n\tdeltaE2000,\n\tdeltaEJz,\n\tdeltaEITP,\n\tdeltaEOK,\n\tdeltaEHCT,\n};\n", "import * as util from \"./util.js\";\nimport ColorSpace from \"./space.js\";\nimport defaults from \"./defaults.js\";\nimport deltaE2000 from \"./deltaE/deltaE2000.js\";\nimport deltaEOK from \"./deltaE/deltaEOK.js\";\nimport inGamut from \"./inGamut.js\";\nimport to from \"./to.js\";\nimport get from \"./get.js\";\nimport oklab from \"./spaces/oklab.js\";\nimport set from \"./set.js\";\nimport clone from \"./clone.js\";\nimport getColor from \"./getColor.js\";\nimport deltaEMethods from \"./deltaE/index.js\";\nimport {WHITES} from \"./adapt.js\";\n\n/**\n * Calculate the epsilon to 2 degrees smaller than the specified JND.\n * @param {Number} jnd - The target \"just noticeable difference\".\n * @returns {Number}\n */\nfunction calcEpsilon (jnd) {\n\t// Calculate the epsilon to 2 degrees smaller than the specified JND.\n\n\tconst order = (!jnd) ? 0 : Math.floor(Math.log10(Math.abs(jnd)));\n\t// Limit to an arbitrary value to ensure value is never too small and causes infinite loops.\n\treturn Math.max(parseFloat(`1e${order - 2}`), 1e-6);\n}\n\nconst GMAPPRESET = {\n\t\"hct\": {\n\t\tmethod: \"hct.c\",\n\t\tjnd: 2,\n\t\tdeltaEMethod: \"hct\",\n\t\tblackWhiteClamp: {},\n\t},\n\t\"hct-tonal\": {\n\t\tmethod: \"hct.c\",\n\t\tjnd: 0,\n\t\tdeltaEMethod: \"hct\",\n\t\tblackWhiteClamp: { channel: \"hct.t\", min: 0, max: 100 },\n\t},\n};\n\n/**\n * Force coordinates to be in gamut of a certain color space.\n * Mutates the color it is passed.\n * @param {Object|string} options object or spaceId string\n * @param {string} options.method - How to force into gamut.\n * If \"clip\", coordinates are just clipped to their reference range.\n * If \"css\", coordinates are reduced according to the CSS 4 Gamut Mapping Algorithm.\n * If in the form [colorSpaceId].[coordName], that coordinate is reduced\n * until the color is in gamut. Please note that this may produce nonsensical\n * results for certain coordinates (e.g. hue) or infinite loops if reducing the coordinate never brings the color in gamut.\n * @param {ColorSpace|string} options.space - The space whose gamut we want to map to\n * @param {string} options.deltaEMethod - The delta E method to use while performing gamut mapping.\n * If no method is specified, delta E 2000 is used.\n * @param {Number} options.jnd - The \"just noticeable difference\" to target.\n * @param {Object} options.blackWhiteClamp - Used to configure SDR black and clamping.\n * \"channel\" indicates the \"space.channel\" to use for determining when to clamp.\n * \"min\" indicates the lower limit for black clamping and \"max\" indicates the upper\n * limit for white clamping.\n */\n\nexport default function toGamut (\n\tcolor,\n\t{\n\t\tmethod = defaults.gamut_mapping,\n\t\tspace = undefined,\n\t\tdeltaEMethod = \"\",\n\t\tjnd = 2,\n\t\tblackWhiteClamp = {},\n\t} = {},\n) {\n\tcolor = getColor(color);\n\n\tif (util.isString(arguments[1])) {\n\t\tspace = arguments[1];\n\t}\n\telse if (!space) {\n\t\tspace = color.space;\n\t}\n\n\tspace = ColorSpace.get(space);\n\n\t// 3 spaces:\n\t// color.space: current color space\n\t// space: space whose gamut we are mapping to\n\t// mapSpace: space with the coord we're reducing\n\n\tif (inGamut(color, space, { epsilon: 0 })) {\n\t\treturn color;\n\t}\n\n\tlet spaceColor;\n\tif (method === \"css\") {\n\t\tspaceColor = toGamutCSS(color, { space });\n\t}\n\telse {\n\t\tif (method !== \"clip\" && !inGamut(color, space)) {\n\n\t\t\tif (Object.prototype.hasOwnProperty.call(GMAPPRESET, method)) {\n\t\t\t\t({method, jnd, deltaEMethod, blackWhiteClamp} = GMAPPRESET[method]);\n\t\t\t}\n\n\t\t\t// Get the correct delta E method\n\t\t\tlet de = deltaE2000;\n\t\t\tif (deltaEMethod !== \"\") {\n\t\t\t\tfor (let m in deltaEMethods) {\n\t\t\t\t\tif (\"deltae\" + deltaEMethod.toLowerCase() === m.toLowerCase()) {\n\t\t\t\t\t\tde = deltaEMethods[m];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet clipped = toGamut(to(color, space), { method: \"clip\", space });\n\t\t\tif (de(color, clipped) > jnd) {\n\n\t\t\t\t// Clamp to SDR white and black if required\n\t\t\t\tif (Object.keys(blackWhiteClamp).length === 3) {\n\t\t\t\t\tlet channelMeta = ColorSpace.resolveCoord(blackWhiteClamp.channel);\n\t\t\t\t\tlet channel = get(to(color, channelMeta.space), channelMeta.id);\n\t\t\t\t\tif (util.isNone(channel)) {\n\t\t\t\t\t\tchannel = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif (channel >= blackWhiteClamp.max) {\n\t\t\t\t\t\treturn to({ space: \"xyz-d65\", coords: WHITES[\"D65\"] }, color.space);\n\t\t\t\t\t}\n\t\t\t\t\telse if (channel <= blackWhiteClamp.min) {\n\t\t\t\t\t\treturn to({ space: \"xyz-d65\", coords: [0, 0, 0] }, color.space);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Reduce a coordinate of a certain color space until the color is in gamut\n\t\t\t\tlet coordMeta = ColorSpace.resolveCoord(method);\n\t\t\t\tlet mapSpace = coordMeta.space;\n\t\t\t\tlet coordId = coordMeta.id;\n\n\t\t\t\tlet mappedColor = to(color, mapSpace);\n\t\t\t\t// If we were already in the mapped color space, we need to resolve undefined channels\n\t\t\t\tmappedColor.coords.forEach((c, i) => {\n\t\t\t\t\tif (util.isNone(c)) {\n\t\t\t\t\t\tmappedColor.coords[i] = 0;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tlet bounds = coordMeta.range || coordMeta.refRange;\n\t\t\t\tlet min = bounds[0];\n\t\t\t\tlet \u03B5 = calcEpsilon(jnd);\n\t\t\t\tlet low = min;\n\t\t\t\tlet high = get(mappedColor, coordId);\n\n\t\t\t\twhile (high - low > \u03B5) {\n\t\t\t\t\tlet clipped = clone(mappedColor);\n\t\t\t\t\tclipped = toGamut(clipped, { space, method: \"clip\" });\n\t\t\t\t\tlet deltaE = de(mappedColor, clipped);\n\n\t\t\t\t\tif (deltaE - jnd < \u03B5) {\n\t\t\t\t\t\tlow = get(mappedColor, coordId);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\thigh = get(mappedColor, coordId);\n\t\t\t\t\t}\n\n\t\t\t\t\tset(mappedColor, coordId, (low + high) / 2);\n\t\t\t\t}\n\n\t\t\t\tspaceColor = to(mappedColor, space);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tspaceColor = clipped;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tspaceColor = to(color, space);\n\t\t}\n\n\t\tif (method === \"clip\" // Dumb coord clipping\n\t\t\t// finish off smarter gamut mapping with clip to get rid of \u03B5, see #17\n\t\t\t|| !inGamut(spaceColor, space, { epsilon: 0 })\n\t\t) {\n\t\t\tlet bounds = Object.values(space.coords).map(c => c.range || []);\n\n\t\t\tspaceColor.coords = spaceColor.coords.map((c, i) => {\n\t\t\t\tlet [min, max] = bounds[i];\n\n\t\t\t\tif (min !== undefined) {\n\t\t\t\t\tc = Math.max(min, c);\n\t\t\t\t}\n\n\t\t\t\tif (max !== undefined) {\n\t\t\t\t\tc = Math.min(c, max);\n\t\t\t\t}\n\n\t\t\t\treturn c;\n\t\t\t});\n\t\t}\n\t}\n\n\tif (space !== color.space) {\n\t\tspaceColor = to(spaceColor, color.space);\n\t}\n\n\tcolor.coords = spaceColor.coords;\n\treturn color;\n}\n\ntoGamut.returns = \"color\";\n\n// The reference colors to be used if lightness is out of the range 0-1 in the\n// `Oklch` space. These are created in the `Oklab` space, as it is used by the\n// DeltaEOK calculation, so it is guaranteed to be imported.\nconst COLORS = {\n\tWHITE: { space: oklab, coords: [1, 0, 0] },\n\tBLACK: { space: oklab, coords: [0, 0, 0] },\n};\n\n/**\n * Given a color `origin`, returns a new color that is in gamut using\n * the CSS Gamut Mapping Algorithm. If `space` is specified, it will be in gamut\n * in `space`, and returned in `space`. Otherwise, it will be in gamut and\n * returned in the color space of `origin`.\n * @param {Object} origin\n * @param {Object} options\n * @param {ColorSpace|string} options.space\n * @returns {Color}\n */\nexport function toGamutCSS (origin, {space} = {}) {\n\tconst JND = 0.02;\n\tconst \u03B5 = 0.0001;\n\n\torigin = getColor(origin);\n\n\tif (!space) {\n\t\tspace = origin.space;\n\t}\n\n\tspace = ColorSpace.get(space);\n\tconst oklchSpace = ColorSpace.get(\"oklch\");\n\n\tif (space.isUnbounded) {\n\t\treturn to(origin, space);\n\t}\n\n\tconst origin_OKLCH = to(origin, oklchSpace);\n\tlet L = origin_OKLCH.coords[0];\n\n\t// return media white or black, if lightness is out of range\n\tif (L >= 1) {\n\t\tconst white = to(COLORS.WHITE, space);\n\t\twhite.alpha = origin.alpha;\n\t\treturn to(white, space);\n\t}\n\tif (L <= 0) {\n\t\tconst black = to(COLORS.BLACK, space);\n\t\tblack.alpha = origin.alpha;\n\t\treturn to(black, space);\n\t}\n\n\tif (inGamut(origin_OKLCH, space, {epsilon: 0})) {\n\t\treturn to(origin_OKLCH, space);\n\t}\n\n\tfunction clip (_color) {\n\t\tconst destColor = to(_color, space);\n\t\tconst spaceCoords = Object.values(space.coords);\n\t\tdestColor.coords = destColor.coords.map((coord, index) => {\n\t\t\tif (\"range\" in spaceCoords[index]) {\n\t\t\t\tconst [min, max] = spaceCoords[index].range;\n\t\t\t\treturn util.clamp(min, coord, max);\n\t\t\t}\n\t\t\treturn coord;\n\t\t});\n\t\treturn destColor;\n\t}\n\tlet min = 0;\n\tlet max = origin_OKLCH.coords[1];\n\tlet min_inGamut = true;\n\tlet current = clone(origin_OKLCH);\n\tlet clipped = clip(current);\n\n\tlet E = deltaEOK(clipped, current);\n\tif (E < JND) {\n\t\treturn clipped;\n\t}\n\n\twhile ((max - min) > \u03B5) {\n\t\tconst chroma = (min + max) / 2;\n\t\tcurrent.coords[1] = chroma;\n\t\tif (min_inGamut && inGamut(current, space, {epsilon: 0})) {\n\t\t\tmin = chroma;\n\t\t}\n\t\telse {\n\t\t\tclipped = clip(current);\n\t\t\tE = deltaEOK(clipped, current);\n\t\t\tif (E < JND) {\n\t\t\t\tif ((JND - E < \u03B5)) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmin_inGamut = false;\n\t\t\t\t\tmin = chroma;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmax = chroma;\n\t\t\t}\n\t\t}\n\t}\n\treturn clipped;\n}\n", "import getColor from \"./getColor.js\";\nimport ColorSpace from \"./space.js\";\nimport toGamut from \"./toGamut.js\";\n\n/**\n * Convert to color space and return a new color\n * @param {Object|string} space - Color space object or id\n * @param {Object} options\n * @param {boolean} options.inGamut - Whether to force resulting color in gamut\n * @returns {Color}\n */\nexport default function to (color, space, {inGamut} = {}) {\n\tcolor = getColor(color);\n\tspace = ColorSpace.get(space);\n\n\tlet coords = space.from(color);\n\tlet ret = {space, coords, alpha: color.alpha};\n\n\tif (inGamut) {\n\t\tret = toGamut(ret, inGamut === true ? undefined : inGamut);\n\t}\n\n\treturn ret;\n}\n\nto.returns = \"color\";\n", "import * as util from \"./util.js\";\nimport ColorSpace from \"./space.js\";\nimport defaults from \"./defaults.js\";\nimport getColor from \"./getColor.js\";\nimport checkInGamut from \"./inGamut.js\";\nimport toGamut from \"./toGamut.js\";\nimport clone from \"./clone.js\";\n\n/**\n * Generic toString() method, outputs a color(spaceId ...coords) function, a functional syntax, or custom formats defined by the color space\n * @param {Object} options\n * @param {number} options.precision - Significant digits\n * @param {boolean} options.inGamut - Adjust coordinates to fit in gamut first? [default: false]\n */\nexport default function serialize (color, {\n\tprecision = defaults.precision,\n\tformat = \"default\",\n\tinGamut = true,\n\t...customOptions\n} = {}) {\n\tlet ret;\n\n\tcolor = getColor(color);\n\n\tlet formatId = format;\n\tformat = color.space.getFormat(format)\n\t ?? color.space.getFormat(\"default\")\n\t ?? ColorSpace.DEFAULT_FORMAT;\n\n\t// The assignment to coords and inGamut needs to stay in the order they are now\n\t// The order of the assignment was changed as a workaround for a bug in Next.js\n\t// See this issue for details: https://github.com/color-js/color.js/issues/260\n\n\tlet coords = color.coords.slice(); // clone so we can manipulate it\n\n\tinGamut ||= format.toGamut;\n\n\tif (inGamut && !checkInGamut(color)) {\n\t\t// FIXME what happens if the color contains NaNs?\n\t\tcoords = toGamut(clone(color), inGamut === true ? undefined : inGamut).coords;\n\t}\n\n\tif (format.type === \"custom\") {\n\t\tcustomOptions.precision = precision;\n\n\t\tif (format.serialize) {\n\t\t\tret = format.serialize(coords, color.alpha, customOptions);\n\t\t}\n\t\telse {\n\t\t\tthrow new TypeError(`format ${formatId} can only be used to parse colors, not for serialization`);\n\t\t}\n\t}\n\telse {\n\t\t// Functional syntax\n\t\tlet name = format.name || \"color\";\n\n\t\tif (format.serializeCoords) {\n\t\t\tcoords = format.serializeCoords(coords, precision);\n\t\t}\n\t\telse {\n\t\t\tif (precision !== null) {\n\t\t\t\tcoords = coords.map(c => {\n\t\t\t\t\treturn util.serializeNumber(c, {precision});\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tlet args = [...coords];\n\n\t\tif (name === \"color\") {\n\t\t\t// If output is a color() function, add colorspace id as first argument\n\t\t\tlet cssId = format.id || format.ids?.[0] || color.space.id;\n\t\t\targs.unshift(cssId);\n\t\t}\n\n\t\tlet alpha = color.alpha;\n\t\tif (precision !== null) {\n\t\t\talpha = util.serializeNumber(alpha, {precision});\n\t\t}\n\n\t\tlet strAlpha = color.alpha >= 1 || format.noAlpha ? \"\" : `${format.commas ? \",\" : \" /\"} ${alpha}`;\n\t\tret = `${name}(${args.join(format.commas ? \", \" : \" \")}${strAlpha})`;\n\t}\n\n\treturn ret;\n}\n", "import RGBColorSpace from \"../rgbspace.js\";\n\n// This is the linear-light version of sRGB\n// as used for example in SVG filters\n// or in Canvas\n\n// This matrix was calculated directly from the RGB and white chromaticities\n// when rounded to 8 decimal places, it agrees completely with the official matrix\n// see https://github.com/w3c/csswg-drafts/issues/5922\nconst toXYZ_M = [\n\t[ 0.41239079926595934, 0.357584339383878, 0.1804807884018343 ],\n\t[ 0.21263900587151027, 0.715168678767756, 0.07219231536073371 ],\n\t[ 0.01933081871559182, 0.11919477979462598, 0.9505321522496607 ],\n];\n\n// This matrix is the inverse of the above;\n// again it agrees with the official definition when rounded to 8 decimal places\nexport const fromXYZ_M = [\n\t[ 3.2409699419045226, -1.537383177570094, -0.4986107602930034 ],\n\t[ -0.9692436362808796, 1.8759675015077202, 0.04155505740717559 ],\n\t[ 0.05563007969699366, -0.20397695888897652, 1.0569715142428786 ],\n];\n\nexport default new RGBColorSpace({\n\tid: \"srgb-linear\",\n\tname: \"Linear sRGB\",\n\twhite: \"D65\",\n\ttoXYZ_M,\n\tfromXYZ_M,\n});\n", "/* List of CSS color keywords\n * Note that this does not include currentColor, transparent,\n * or system colors\n */\n\n// To produce: Visit https://www.w3.org/TR/css-color-4/#named-colors\n// and run in the console:\n// copy($$(\"tr\", $(\".named-color-table tbody\")).map(tr => `\"${tr.cells[2].textContent.trim()}\": [${tr.cells[4].textContent.trim().split(/\\s+/).map(c => c === \"0\"? \"0\" : c === \"255\"? \"1\" : c + \" / 255\").join(\", \")}]`).join(\",\\n\"))\nexport default {\n\t\"aliceblue\": [240 / 255, 248 / 255, 1],\n\t\"antiquewhite\": [250 / 255, 235 / 255, 215 / 255],\n\t\"aqua\": [0, 1, 1],\n\t\"aquamarine\": [127 / 255, 1, 212 / 255],\n\t\"azure\": [240 / 255, 1, 1],\n\t\"beige\": [245 / 255, 245 / 255, 220 / 255],\n\t\"bisque\": [1, 228 / 255, 196 / 255],\n\t\"black\": [0, 0, 0],\n\t\"blanchedalmond\": [1, 235 / 255, 205 / 255],\n\t\"blue\": [0, 0, 1],\n\t\"blueviolet\": [138 / 255, 43 / 255, 226 / 255],\n\t\"brown\": [165 / 255, 42 / 255, 42 / 255],\n\t\"burlywood\": [222 / 255, 184 / 255, 135 / 255],\n\t\"cadetblue\": [95 / 255, 158 / 255, 160 / 255],\n\t\"chartreuse\": [127 / 255, 1, 0],\n\t\"chocolate\": [210 / 255, 105 / 255, 30 / 255],\n\t\"coral\": [1, 127 / 255, 80 / 255],\n\t\"cornflowerblue\": [100 / 255, 149 / 255, 237 / 255],\n\t\"cornsilk\": [1, 248 / 255, 220 / 255],\n\t\"crimson\": [220 / 255, 20 / 255, 60 / 255],\n\t\"cyan\": [0, 1, 1],\n\t\"darkblue\": [0, 0, 139 / 255],\n\t\"darkcyan\": [0, 139 / 255, 139 / 255],\n\t\"darkgoldenrod\": [184 / 255, 134 / 255, 11 / 255],\n\t\"darkgray\": [169 / 255, 169 / 255, 169 / 255],\n\t\"darkgreen\": [0, 100 / 255, 0],\n\t\"darkgrey\": [169 / 255, 169 / 255, 169 / 255],\n\t\"darkkhaki\": [189 / 255, 183 / 255, 107 / 255],\n\t\"darkmagenta\": [139 / 255, 0, 139 / 255],\n\t\"darkolivegreen\": [85 / 255, 107 / 255, 47 / 255],\n\t\"darkorange\": [1, 140 / 255, 0],\n\t\"darkorchid\": [153 / 255, 50 / 255, 204 / 255],\n\t\"darkred\": [139 / 255, 0, 0],\n\t\"darksalmon\": [233 / 255, 150 / 255, 122 / 255],\n\t\"darkseagreen\": [143 / 255, 188 / 255, 143 / 255],\n\t\"darkslateblue\": [72 / 255, 61 / 255, 139 / 255],\n\t\"darkslategray\": [47 / 255, 79 / 255, 79 / 255],\n\t\"darkslategrey\": [47 / 255, 79 / 255, 79 / 255],\n\t\"darkturquoise\": [0, 206 / 255, 209 / 255],\n\t\"darkviolet\": [148 / 255, 0, 211 / 255],\n\t\"deeppink\": [1, 20 / 255, 147 / 255],\n\t\"deepskyblue\": [0, 191 / 255, 1],\n\t\"dimgray\": [105 / 255, 105 / 255, 105 / 255],\n\t\"dimgrey\": [105 / 255, 105 / 255, 105 / 255],\n\t\"dodgerblue\": [30 / 255, 144 / 255, 1],\n\t\"firebrick\": [178 / 255, 34 / 255, 34 / 255],\n\t\"floralwhite\": [1, 250 / 255, 240 / 255],\n\t\"forestgreen\": [34 / 255, 139 / 255, 34 / 255],\n\t\"fuchsia\": [1, 0, 1],\n\t\"gainsboro\": [220 / 255, 220 / 255, 220 / 255],\n\t\"ghostwhite\": [248 / 255, 248 / 255, 1],\n\t\"gold\": [1, 215 / 255, 0],\n\t\"goldenrod\": [218 / 255, 165 / 255, 32 / 255],\n\t\"gray\": [128 / 255, 128 / 255, 128 / 255],\n\t\"green\": [0, 128 / 255, 0],\n\t\"greenyellow\": [173 / 255, 1, 47 / 255],\n\t\"grey\": [128 / 255, 128 / 255, 128 / 255],\n\t\"honeydew\": [240 / 255, 1, 240 / 255],\n\t\"hotpink\": [1, 105 / 255, 180 / 255],\n\t\"indianred\": [205 / 255, 92 / 255, 92 / 255],\n\t\"indigo\": [75 / 255, 0, 130 / 255],\n\t\"ivory\": [1, 1, 240 / 255],\n\t\"khaki\": [240 / 255, 230 / 255, 140 / 255],\n\t\"lavender\": [230 / 255, 230 / 255, 250 / 255],\n\t\"lavenderblush\": [1, 240 / 255, 245 / 255],\n\t\"lawngreen\": [124 / 255, 252 / 255, 0],\n\t\"lemonchiffon\": [1, 250 / 255, 205 / 255],\n\t\"lightblue\": [173 / 255, 216 / 255, 230 / 255],\n\t\"lightcoral\": [240 / 255, 128 / 255, 128 / 255],\n\t\"lightcyan\": [224 / 255, 1, 1],\n\t\"lightgoldenrodyellow\": [250 / 255, 250 / 255, 210 / 255],\n\t\"lightgray\": [211 / 255, 211 / 255, 211 / 255],\n\t\"lightgreen\": [144 / 255, 238 / 255, 144 / 255],\n\t\"lightgrey\": [211 / 255, 211 / 255, 211 / 255],\n\t\"lightpink\": [1, 182 / 255, 193 / 255],\n\t\"lightsalmon\": [1, 160 / 255, 122 / 255],\n\t\"lightseagreen\": [32 / 255, 178 / 255, 170 / 255],\n\t\"lightskyblue\": [135 / 255, 206 / 255, 250 / 255],\n\t\"lightslategray\": [119 / 255, 136 / 255, 153 / 255],\n\t\"lightslategrey\": [119 / 255, 136 / 255, 153 / 255],\n\t\"lightsteelblue\": [176 / 255, 196 / 255, 222 / 255],\n\t\"lightyellow\": [1, 1, 224 / 255],\n\t\"lime\": [0, 1, 0],\n\t\"limegreen\": [50 / 255, 205 / 255, 50 / 255],\n\t\"linen\": [250 / 255, 240 / 255, 230 / 255],\n\t\"magenta\": [1, 0, 1],\n\t\"maroon\": [128 / 255, 0, 0],\n\t\"mediumaquamarine\": [102 / 255, 205 / 255, 170 / 255],\n\t\"mediumblue\": [0, 0, 205 / 255],\n\t\"mediumorchid\": [186 / 255, 85 / 255, 211 / 255],\n\t\"mediumpurple\": [147 / 255, 112 / 255, 219 / 255],\n\t\"mediumseagreen\": [60 / 255, 179 / 255, 113 / 255],\n\t\"mediumslateblue\": [123 / 255, 104 / 255, 238 / 255],\n\t\"mediumspringgreen\": [0, 250 / 255, 154 / 255],\n\t\"mediumturquoise\": [72 / 255, 209 / 255, 204 / 255],\n\t\"mediumvioletred\": [199 / 255, 21 / 255, 133 / 255],\n\t\"midnightblue\": [25 / 255, 25 / 255, 112 / 255],\n\t\"mintcream\": [245 / 255, 1, 250 / 255],\n\t\"mistyrose\": [1, 228 / 255, 225 / 255],\n\t\"moccasin\": [1, 228 / 255, 181 / 255],\n\t\"navajowhite\": [1, 222 / 255, 173 / 255],\n\t\"navy\": [0, 0, 128 / 255],\n\t\"oldlace\": [253 / 255, 245 / 255, 230 / 255],\n\t\"olive\": [128 / 255, 128 / 255, 0],\n\t\"olivedrab\": [107 / 255, 142 / 255, 35 / 255],\n\t\"orange\": [1, 165 / 255, 0],\n\t\"orangered\": [1, 69 / 255, 0],\n\t\"orchid\": [218 / 255, 112 / 255, 214 / 255],\n\t\"palegoldenrod\": [238 / 255, 232 / 255, 170 / 255],\n\t\"palegreen\": [152 / 255, 251 / 255, 152 / 255],\n\t\"paleturquoise\": [175 / 255, 238 / 255, 238 / 255],\n\t\"palevioletred\": [219 / 255, 112 / 255, 147 / 255],\n\t\"papayawhip\": [1, 239 / 255, 213 / 255],\n\t\"peachpuff\": [1, 218 / 255, 185 / 255],\n\t\"peru\": [205 / 255, 133 / 255, 63 / 255],\n\t\"pink\": [1, 192 / 255, 203 / 255],\n\t\"plum\": [221 / 255, 160 / 255, 221 / 255],\n\t\"powderblue\": [176 / 255, 224 / 255, 230 / 255],\n\t\"purple\": [128 / 255, 0, 128 / 255],\n\t\"rebeccapurple\": [102 / 255, 51 / 255, 153 / 255],\n\t\"red\": [1, 0, 0],\n\t\"rosybrown\": [188 / 255, 143 / 255, 143 / 255],\n\t\"royalblue\": [65 / 255, 105 / 255, 225 / 255],\n\t\"saddlebrown\": [139 / 255, 69 / 255, 19 / 255],\n\t\"salmon\": [250 / 255, 128 / 255, 114 / 255],\n\t\"sandybrown\": [244 / 255, 164 / 255, 96 / 255],\n\t\"seagreen\": [46 / 255, 139 / 255, 87 / 255],\n\t\"seashell\": [1, 245 / 255, 238 / 255],\n\t\"sienna\": [160 / 255, 82 / 255, 45 / 255],\n\t\"silver\": [192 / 255, 192 / 255, 192 / 255],\n\t\"skyblue\": [135 / 255, 206 / 255, 235 / 255],\n\t\"slateblue\": [106 / 255, 90 / 255, 205 / 255],\n\t\"slategray\": [112 / 255, 128 / 255, 144 / 255],\n\t\"slategrey\": [112 / 255, 128 / 255, 144 / 255],\n\t\"snow\": [1, 250 / 255, 250 / 255],\n\t\"springgreen\": [0, 1, 127 / 255],\n\t\"steelblue\": [70 / 255, 130 / 255, 180 / 255],\n\t\"tan\": [210 / 255, 180 / 255, 140 / 255],\n\t\"teal\": [0, 128 / 255, 128 / 255],\n\t\"thistle\": [216 / 255, 191 / 255, 216 / 255],\n\t\"tomato\": [1, 99 / 255, 71 / 255],\n\t\"turquoise\": [64 / 255, 224 / 255, 208 / 255],\n\t\"violet\": [238 / 255, 130 / 255, 238 / 255],\n\t\"wheat\": [245 / 255, 222 / 255, 179 / 255],\n\t\"white\": [1, 1, 1],\n\t\"whitesmoke\": [245 / 255, 245 / 255, 245 / 255],\n\t\"yellow\": [1, 1, 0],\n\t\"yellowgreen\": [154 / 255, 205 / 255, 50 / 255],\n};\n", "import RGBColorSpace from \"../rgbspace.js\";\nimport sRGBLinear from \"./srgb-linear.js\";\nimport KEYWORDS from \"../keywords.js\";\n\nlet coordGrammar = Array(3).fill(\" | [0, 255]\");\nlet coordGrammarNumber = Array(3).fill(\"[0, 255]\");\n\nexport default new RGBColorSpace({\n\tid: \"srgb\",\n\tname: \"sRGB\",\n\tbase: sRGBLinear,\n\tfromBase: rgb => {\n\t\t// convert an array of linear-light sRGB values in the range 0.0-1.0\n\t\t// to gamma corrected form\n\t\t// https://en.wikipedia.org/wiki/SRGB\n\t\treturn rgb.map(val => {\n\t\t\tlet sign = val < 0 ? -1 : 1;\n\t\t\tlet abs = val * sign;\n\n\t\t\tif (abs > 0.0031308) {\n\t\t\t\treturn sign * (1.055 * (abs ** (1 / 2.4)) - 0.055);\n\t\t\t}\n\n\t\t\treturn 12.92 * val;\n\t\t});\n\t},\n\ttoBase: rgb => {\n\t\t// convert an array of sRGB values in the range 0.0 - 1.0\n\t\t// to linear light (un-companded) form.\n\t\t// https://en.wikipedia.org/wiki/SRGB\n\t\treturn rgb.map(val => {\n\t\t\tlet sign = val < 0 ? -1 : 1;\n\t\t\tlet abs = val * sign;\n\n\t\t\tif (abs <= 0.04045) {\n\t\t\t\treturn val / 12.92;\n\t\t\t}\n\n\t\t\treturn sign * (((abs + 0.055) / 1.055) ** 2.4);\n\t\t});\n\t},\n\tformats: {\n\t\t\"rgb\": {\n\t\t\tcoords: coordGrammar,\n\t\t},\n\t\t\"rgb_number\": {\n\t\t\tname: \"rgb\",\n\t\t\tcommas: true,\n\t\t\tcoords: coordGrammarNumber,\n\t\t\tnoAlpha: true,\n\t\t},\n\t\t\"color\": { /* use defaults */ },\n\t\t\"rgba\": {\n\t\t\tcoords: coordGrammar,\n\t\t\tcommas: true,\n\t\t\tlastAlpha: true,\n\t\t},\n\t\t\"rgba_number\": {\n\t\t\tname: \"rgba\",\n\t\t\tcommas: true,\n\t\t\tcoords: coordGrammarNumber,\n\t\t},\n\t\t\"hex\": {\n\t\t\ttype: \"custom\",\n\t\t\ttoGamut: true,\n\t\t\ttest: str => /^#([a-f0-9]{3,4}){1,2}$/i.test(str),\n\t\t\tparse (str) {\n\t\t\t\tif (str.length <= 5) {\n\t\t\t\t\t// #rgb or #rgba, duplicate digits\n\t\t\t\t\tstr = str.replace(/[a-f0-9]/gi, \"$&$&\");\n\t\t\t\t}\n\n\t\t\t\tlet rgba = [];\n\t\t\t\tstr.replace(/[a-f0-9]{2}/gi, component => {\n\t\t\t\t\trgba.push(parseInt(component, 16) / 255);\n\t\t\t\t});\n\n\t\t\t\treturn {\n\t\t\t\t\tspaceId: \"srgb\",\n\t\t\t\t\tcoords: rgba.slice(0, 3),\n\t\t\t\t\talpha: rgba.slice(3)[0],\n\t\t\t\t};\n\t\t\t},\n\t\t\tserialize: (coords, alpha, {\n\t\t\t\tcollapse = true, // collapse to 3-4 digit hex when possible?\n\t\t\t} = {}) => {\n\t\t\t\tif (alpha < 1) {\n\t\t\t\t\tcoords.push(alpha);\n\t\t\t\t}\n\n\t\t\t\tcoords = coords.map(c => Math.round(c * 255));\n\n\t\t\t\tlet collapsible = collapse && coords.every(c => c % 17 === 0);\n\n\t\t\t\tlet hex = coords.map(c => {\n\t\t\t\t\tif (collapsible) {\n\t\t\t\t\t\treturn (c / 17).toString(16);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn c.toString(16).padStart(2, \"0\");\n\t\t\t\t}).join(\"\");\n\n\t\t\t\treturn \"#\" + hex;\n\t\t\t},\n\t\t},\n\t\t\"keyword\": {\n\t\t\ttype: \"custom\",\n\t\t\ttest: str => /^[a-z]+$/i.test(str),\n\t\t\tparse (str) {\n\t\t\t\tstr = str.toLowerCase();\n\t\t\t\tlet ret = {spaceId: \"srgb\", coords: null, alpha: 1};\n\n\t\t\t\tif (str === \"transparent\") {\n\t\t\t\t\tret.coords = KEYWORDS.black;\n\t\t\t\t\tret.alpha = 0;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tret.coords = KEYWORDS[str];\n\t\t\t\t}\n\n\t\t\t\tif (ret.coords) {\n\t\t\t\t\treturn ret;\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n});\n", "import ColorSpace from \"../space.js\";\nimport sRGB from \"./srgb.js\";\n\nexport default new ColorSpace({\n\tid: \"hsl\",\n\tname: \"HSL\",\n\tcoords: {\n\t\th: {\n\t\t\trefRange: [0, 360],\n\t\t\ttype: \"angle\",\n\t\t\tname: \"Hue\",\n\t\t},\n\t\ts: {\n\t\t\trange: [0, 100],\n\t\t\tname: \"Saturation\",\n\t\t},\n\t\tl: {\n\t\t\trange: [0, 100],\n\t\t\tname: \"Lightness\",\n\t\t},\n\t},\n\n\tbase: sRGB,\n\n\t// Adapted from https://drafts.csswg.org/css-color-4/better-rgbToHsl.js\n\tfromBase: rgb => {\n\t\tlet max = Math.max(...rgb);\n\t\tlet min = Math.min(...rgb);\n\t\tlet [r, g, b] = rgb;\n\t\tlet [h, s, l] = [NaN, 0, (min + max) / 2];\n\t\tlet d = max - min;\n\n\t\tif (d !== 0) {\n\t\t\ts = (l === 0 || l === 1) ? 0 : (max - l) / Math.min(l, 1 - l);\n\n\t\t\tswitch (max) {\n\t\t\t\tcase r: h = (g - b) / d + (g < b ? 6 : 0); break;\n\t\t\t\tcase g: h = (b - r) / d + 2; break;\n\t\t\t\tcase b: h = (r - g) / d + 4;\n\t\t\t}\n\n\t\t\th = h * 60;\n\t\t}\n\n\t\t// Very out of gamut colors can produce negative saturation\n\t\t// If so, just rotate the hue by 180 and use a positive saturation\n\t\t// see https://github.com/w3c/csswg-drafts/issues/9222\n\t\tif (s < 0) {\n\t\t\th += 180;\n\t\t\ts = Math.abs(s);\n\t\t}\n\n\t\tif (h >= 360) {\n\t\t\th -= 360;\n\t\t}\n\n\t\treturn [h, s * 100, l * 100];\n\t},\n\n\t// Adapted from https://en.wikipedia.org/wiki/HSL_and_HSV#HSL_to_RGB_alternative\n\ttoBase: hsl => {\n\t\tlet [h, s, l] = hsl;\n\t\th = h % 360;\n\n\t\tif (h < 0) {\n\t\t\th += 360;\n\t\t}\n\n\t\ts /= 100;\n\t\tl /= 100;\n\n\t\tfunction f (n) {\n\t\t\tlet k = (n + h / 30) % 12;\n\t\t\tlet a = s * Math.min(l, 1 - l);\n\t\t\treturn l - a * Math.max(-1, Math.min(k - 3, 9 - k, 1));\n\t\t}\n\n\t\treturn [f(0), f(8), f(4)];\n\t},\n\n\tformats: {\n\t\t\"hsl\": {\n\t\t\tcoords: [\" | \", \"\", \"\"],\n\t\t},\n\t\t\"hsla\": {\n\t\t\tcoords: [\" | \", \"\", \"\"],\n\t\t\tcommas: true,\n\t\t\tlastAlpha: true,\n\t\t},\n\t},\n});\n", "import ColorSpace from \"../space.js\";\nimport OKLab from \"./oklab.js\";\nimport {constrain as constrainAngle} from \"../angles.js\";\n\nexport default new ColorSpace({\n\tid: \"oklch\",\n\tname: \"Oklch\",\n\tcoords: {\n\t\tl: {\n\t\t\trefRange: [0, 1],\n\t\t\tname: \"Lightness\",\n\t\t},\n\t\tc: {\n\t\t\trefRange: [0, 0.4],\n\t\t\tname: \"Chroma\",\n\t\t},\n\t\th: {\n\t\t\trefRange: [0, 360],\n\t\t\ttype: \"angle\",\n\t\t\tname: \"Hue\",\n\t\t},\n\t},\n\twhite: \"D65\",\n\n\tbase: OKLab,\n\tfromBase (oklab) {\n\t\t// Convert to polar form\n\t\tlet [L, a, b] = oklab;\n\t\tlet h;\n\t\tconst \u03B5 = 0.0002; // chromatic components much smaller than a,b\n\n\t\tif (Math.abs(a) < \u03B5 && Math.abs(b) < \u03B5) {\n\t\t\th = NaN;\n\t\t}\n\t\telse {\n\t\t\th = Math.atan2(b, a) * 180 / Math.PI;\n\t\t}\n\n\t\treturn [\n\t\t\tL, // OKLab L is still L\n\t\t\tMath.sqrt(a ** 2 + b ** 2), // Chroma\n\t\t\tconstrainAngle(h), // Hue, in degrees [0 to 360)\n\t\t];\n\t},\n\t// Convert from polar form\n\ttoBase (oklch) {\n\t\tlet [L, C, h] = oklch;\n\t\tlet a, b;\n\n\t\t// check for NaN hue\n\t\tif (isNaN(h)) {\n\t\t\ta = 0;\n\t\t\tb = 0;\n\t\t}\n\t\telse {\n\t\t\ta = C * Math.cos(h * Math.PI / 180);\n\t\t\tb = C * Math.sin(h * Math.PI / 180);\n\t\t}\n\n\t\treturn [ L, a, b ];\n\t},\n\n\tformats: {\n\t\t\"oklch\": {\n\t\t\tcoords: [\" | \", \" | [0,1]\", \" | \"],\n\t\t},\n\t},\n});\n", "import {\n to as convert,\n parse as parseColor,\n ColorSpace,\n serialize,\n sRGB,\n OKLCH,\n HSL,\n ColorConstructor,\n PlainColorObject,\n} from \"colorjs.io/fn\";\n\nColorSpace.register(sRGB);\nColorSpace.register(OKLCH);\nColorSpace.register(HSL);\n\ntype CoordsValueType = {\n l: number;\n c: number;\n h: number;\n};\n\ntype ColorValueType = {\n hex: string;\n oklch: string;\n coords: CoordsValueType;\n lightness: number;\n};\n\nexport function setStateFromValue(\n value: null | undefined | string | ColorValueType | CoordsValueType,\n mode: \"all\" | \"hex\" | \"oklch\" | \"coords\",\n precision: number,\n) {\n // Handle wrong initial values\n if ((mode === \"hex\" || mode === \"oklch\") && typeof value === \"object\" && value !== null) {\n value = value.toString();\n\n if (value === \"[object Object]\") {\n return {};\n }\n }\n\n if (\n !value ||\n (Array.isArray(value) && value.length === 0) ||\n (typeof value === \"object\" && Object.keys(value).length === 0)\n ) {\n return {};\n }\n\n if (mode === \"all\") {\n // @ts-ignore\n const hex = value?.hex;\n // @ts-ignore\n if (!hex) {\n return {};\n }\n\n const color = parseColor(hex);\n const lightness = getLightness(color);\n // @ts-ignore\n return { ...value, lightness };\n }\n\n if (mode === \"coords\") {\n // @ts-ignore\n if (value?.l === undefined || value?.c === undefined || value?.h === undefined) {\n return {};\n }\n // @ts-ignore\n return convertOKLCHFromValue(`oklch(${value.l} ${value.c} ${value.h})`, precision);\n }\n\n if (mode === \"hex\") {\n return onHexChange(value as string, precision);\n }\n\n if (mode === \"oklch\") {\n return convertOKLCHFromValue(value as string, precision);\n }\n\n return {};\n}\n\nfunction convertOKLCHFromValue(value: string, precision: number) {\n const color = parseColor(value);\n const lightness = getLightness(color);\n const rgb = convert(color, sRGB);\n return {\n hex: serialize(rgb, { format: \"hex\" }),\n oklch: serialize(color, { precision }),\n coords: convertToOkLchCoords(color, precision),\n lightness,\n };\n}\n\nexport function setLightness(hex: string, lightness: number) {\n const color = parseColor(hex);\n const hsl = convert(color, HSL);\n hsl.coords[2] = lightness;\n return serialize(convert(hsl, sRGB), { format: \"hex\" });\n}\n\nexport function setLuminance(oklch: string, luminance: number) {\n const color = parseColor(oklch);\n color.coords[0] = luminance / 100;\n const rgb = convert(color, sRGB);\n return serialize(rgb, { format: \"hex\" });\n}\n\nexport function onHexChange(hex: string, precision: number): ColorValueType {\n const color = parseColor(hex);\n const lightness = getLightness(color);\n const oklch = convert(color, OKLCH);\n\n return {\n hex,\n oklch: serialize(oklch, { precision }),\n coords: convertToOkLchCoords(oklch, precision),\n lightness,\n };\n}\n\nfunction getLightness(color: ColorConstructor) {\n const { coords } = convert(color, HSL);\n return Math.round(coords[2]);\n}\n\nfunction convertToOkLchCoords(oklch: PlainColorObject | ColorConstructor, precision = 5) {\n const { coords } = oklch;\n const anglePrecision = precision > 3 ? precision - 3 : 0;\n return {\n l: round(coords[0], precision),\n c: round(coords[1], precision),\n h: round(coords[2], anglePrecision),\n };\n}\n\nfunction round(value: number, precision: number | undefined = undefined) {\n value = value || 0;\n if (!precision) {\n return value;\n }\n const factor = Math.pow(10, precision);\n return Math.round(value * factor) / factor;\n}\n", "// @ts-ignore\nimport React from \"react\";\nimport * as stylex from \"@stylexjs/stylex\";\nimport \"../Tokens.stylex\";\nimport { colors, sizes, fonts } from \"../Tokens.stylex\";\nconst styles = {\n button: {\n cursor: \"x1ypdohk\",\n textOverflow: \"xlyipyv\",\n whiteSpace: \"xuxw1ft\",\n fontSize: \"xiq9r4\",\n lineHeight: \"x1bexyg0\",\n padding: \"x1dskcqz\",\n overflow: \"xb3r6kr\",\n display: \"x78zum5\",\n gap: \"x188dswm\",\n alignItems: \"x6s0dn4\",\n border: \"x1wty727\",\n background: \"x11g6tue\",\n borderRadius: \"x2u8bby\",\n color: \"x1awj2ng\",\n width: \"xh8yej3\",\n $$css: true\n },\n buttonHighlighted: {\n backgroundColor: \"x18z1ewl\",\n $$css: true\n }\n};\nexport default function OptionPreview({\n option,\n onClick,\n isHighlighted,\n onMouseEnter\n}: {\n option: {\n label: string;\n value: string;\n };\n onClick: () => void;\n isHighlighted: boolean;\n onMouseEnter: () => void;\n}) {\n const label = capitalizeFirstLetter(option.label);\n return ;\n}\nfunction capitalizeFirstLetter(string: string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "var styleq$1 = {};\n\n/**\n * Copyright (c) Nicolas Gallagher\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nObject.defineProperty(styleq$1, \"__esModule\", {\n value: true\n});\nvar styleq_2 = styleq$1.styleq = void 0;\nvar cache = new WeakMap();\nvar compiledKey = '$$css';\n\nfunction createStyleq(options) {\n var disableCache;\n var disableMix;\n var transform;\n\n if (options != null) {\n disableCache = options.disableCache === true;\n disableMix = options.disableMix === true;\n transform = options.transform;\n }\n\n return function styleq() {\n // Keep track of property commits to the className\n var definedProperties = []; // The className and inline style to build up\n\n var className = '';\n var inlineStyle = null; // The current position in the cache graph\n\n var nextCache = disableCache ? null : cache; // This way of creating an array from arguments is fastest\n\n var styles = new Array(arguments.length);\n\n for (var i = 0; i < arguments.length; i++) {\n styles[i] = arguments[i];\n } // Iterate over styles from last to first\n\n\n while (styles.length > 0) {\n var possibleStyle = styles.pop(); // Skip empty items\n\n if (possibleStyle == null || possibleStyle === false) {\n continue;\n } // Push nested styles back onto the stack to be processed\n\n\n if (Array.isArray(possibleStyle)) {\n for (var _i = 0; _i < possibleStyle.length; _i++) {\n styles.push(possibleStyle[_i]);\n }\n\n continue;\n } // Process an individual style object\n\n\n var style = transform != null ? transform(possibleStyle) : possibleStyle;\n\n if (style.$$css) {\n // Build up the class names defined by this object\n var classNameChunk = ''; // Check the cache to see if we've already done this work\n\n if (nextCache != null && nextCache.has(style)) {\n // Cache: read\n var cacheEntry = nextCache.get(style);\n\n if (cacheEntry != null) {\n classNameChunk = cacheEntry[0]; // $FlowIgnore\n\n definedProperties.push.apply(definedProperties, cacheEntry[1]);\n nextCache = cacheEntry[2];\n }\n } // Update the chunks with data from this object\n else {\n // The properties defined by this object\n var definedPropertiesChunk = [];\n\n for (var prop in style) {\n var value = style[prop];\n if (prop === compiledKey) continue; // Each property value is used as an HTML class name\n // { 'debug.string': 'debug.string', opacity: 's-jskmnoqp' }\n\n if (typeof value === 'string' || value === null) {\n // Only add to chunks if this property hasn't already been seen\n if (!definedProperties.includes(prop)) {\n definedProperties.push(prop);\n\n if (nextCache != null) {\n definedPropertiesChunk.push(prop);\n }\n\n if (typeof value === 'string') {\n classNameChunk += classNameChunk ? ' ' + value : value;\n }\n }\n } // If we encounter a value that isn't a string or `null`\n else {\n console.error(\"styleq: \".concat(prop, \" typeof \").concat(String(value), \" is not \\\"string\\\" or \\\"null\\\".\"));\n }\n } // Cache: write\n\n\n if (nextCache != null) {\n // Create the next WeakMap for this sequence of styles\n var weakMap = new WeakMap();\n nextCache.set(style, [classNameChunk, definedPropertiesChunk, weakMap]);\n nextCache = weakMap;\n }\n } // Order of classes in chunks matches property-iteration order of style\n // object. Order of chunks matches passed order of styles from first to\n // last (which we iterate over in reverse).\n\n\n if (classNameChunk) {\n className = className ? classNameChunk + ' ' + className : classNameChunk;\n }\n } // ----- DYNAMIC: Process inline style object -----\n else {\n if (disableMix) {\n if (inlineStyle == null) {\n inlineStyle = {};\n }\n\n inlineStyle = Object.assign({}, style, inlineStyle);\n } else {\n var subStyle = null;\n\n for (var _prop in style) {\n var _value = style[_prop];\n\n if (_value !== undefined) {\n if (!definedProperties.includes(_prop)) {\n if (_value != null) {\n if (inlineStyle == null) {\n inlineStyle = {};\n }\n\n if (subStyle == null) {\n subStyle = {};\n }\n\n subStyle[_prop] = _value;\n }\n\n definedProperties.push(_prop); // Cache is unnecessary overhead if results can't be reused.\n\n nextCache = null;\n }\n }\n }\n\n if (subStyle != null) {\n inlineStyle = Object.assign(subStyle, inlineStyle);\n }\n }\n }\n }\n\n var styleProps = [className, inlineStyle];\n return styleProps;\n };\n}\n\nvar styleq = createStyleq();\nstyleq_2 = styleq$1.styleq = styleq;\nstyleq.factory = createStyleq;\n\nconst errorForFn = name => new Error(`'stylex.${name}' should never be called at runtime. It should be compiled away by '@stylexjs/babel-plugin'`);\nconst errorForType = key => errorForFn(`types.${key}`);\nfunction props() {\n const options = this;\n for (var _len = arguments.length, styles = new Array(_len), _key = 0; _key < _len; _key++) {\n styles[_key] = arguments[_key];\n }\n if (__implementations.props) {\n return __implementations.props.call(options, styles);\n }\n const [className, style] = styleq_2(styles);\n const result = {};\n if (className != null && className !== '') {\n result.className = className;\n }\n if (style != null && Object.keys(style).length > 0) {\n result.style = style;\n }\n return result;\n}\nfunction attrs() {\n const {\n className,\n style\n } = props(...arguments);\n const result = {};\n if (className != null && className !== '') {\n result.class = className;\n }\n if (style != null && Object.keys(style).length > 0) {\n result.style = Object.keys(style).map(key => `${key}:${style[key]};`).join('');\n }\n return result;\n}\nfunction stylexCreate(styles) {\n if (__implementations.create != null) {\n const create = __implementations.create;\n return create(styles);\n }\n throw errorForFn('create');\n}\nfunction stylexDefineVars(styles) {\n if (__implementations.defineVars) {\n return __implementations.defineVars(styles);\n }\n throw errorForFn('defineVars');\n}\nconst stylexCreateTheme = (baseTokens, overrides) => {\n if (__implementations.createTheme) {\n return __implementations.createTheme(baseTokens, overrides);\n }\n throw errorForFn('createTheme');\n};\nconst stylexInclude = styles => {\n if (__implementations.include) {\n return __implementations.include(styles);\n }\n throw errorForFn('include');\n};\nconst create = stylexCreate;\nconst defineVars = stylexDefineVars;\nconst createTheme = stylexCreateTheme;\nconst include = stylexInclude;\nconst types = {\n angle: _v => {\n throw errorForType('angle');\n },\n color: _v => {\n throw errorForType('color');\n },\n url: _v => {\n throw errorForType('url');\n },\n image: _v => {\n throw errorForType('image');\n },\n integer: _v => {\n throw errorForType('integer');\n },\n lengthPercentage: _v => {\n throw errorForType('lengthPercentage');\n },\n length: _v => {\n throw errorForType('length');\n },\n percentage: _v => {\n throw errorForType('percentage');\n },\n number: _v => {\n throw errorForType('number');\n },\n resolution: _v => {\n throw errorForType('resolution');\n },\n time: _v => {\n throw errorForType('time');\n },\n transformFunction: _v => {\n throw errorForType('transformFunction');\n },\n transformList: _v => {\n throw errorForType('transformList');\n }\n};\nconst keyframes = keyframes => {\n if (__implementations.keyframes) {\n return __implementations.keyframes(keyframes);\n }\n throw errorForFn('keyframes');\n};\nconst firstThatWorks = function () {\n if (__implementations.firstThatWorks) {\n return __implementations.firstThatWorks(...arguments);\n }\n throw errorForFn('firstThatWorks');\n};\nfunction _stylex() {\n for (var _len2 = arguments.length, styles = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n styles[_key2] = arguments[_key2];\n }\n const [className] = styleq_2(styles);\n return className;\n}\n_stylex.props = props;\n_stylex.attrs = attrs;\n_stylex.create = create;\n_stylex.defineVars = defineVars;\n_stylex.createTheme = createTheme;\n_stylex.include = include;\n_stylex.keyframes = keyframes;\n_stylex.firstThatWorks = firstThatWorks;\n_stylex.types = types;\nconst __implementations = {};\nfunction __monkey_patch__(key, implementation) {\n if (key === 'types') {\n Object.assign(types, implementation);\n } else {\n __implementations[key] = implementation;\n }\n}\nconst legacyMerge = _stylex;\n\nexport { __monkey_patch__, attrs, create, createTheme, _stylex as default, defineVars, firstThatWorks, include, keyframes, legacyMerge, props, types };\n", "import * as stylex from \"@stylexjs/stylex\";\nexport const colors = {\n primaryBlue: \"var(--x9oor1w)\",\n primaryBlueHover: \"var(--x15izvnz)\",\n contrastNeutral: \"var(--x14zwxex)\",\n warn: \"var(--xo9o7wn)\",\n error: \"var(--xm2tcaw)\",\n checkerboard: \"var(--xohrf6u)\",\n __themeName__: \"x6kjhhb\"\n};\nexport const sizes = {\n input: \"var(--xuyr3qr)\",\n spacingFull: \"var(--x1xhd60u)\",\n spacingHalf: \"var(--xdcwdaz)\",\n spacingQuarter: \"var(--x12ft4ps)\",\n borderRadius: \"var(--x1th158f)\",\n goldenUnit: \"var(--x1fv9uxr)\",\n __themeName__: \"x12xlb9\"\n};\nexport const fonts = {\n mono: \"var(--xhezqga)\",\n size: \"var(--x11o33fd)\",\n __themeName__: \"x12k5fg9\"\n};\nexport const transitions = {\n fast: \"var(--xx5xnzz)\",\n default: \"var(--xk43sx8)\",\n slow: \"var(--xevhp2r)\",\n timing: \"var(--x111wrgi)\",\n __themeName__: \"x11g3sqh\"\n};", "// @ts-ignore\nimport React, { useEffect, useState } from \"react\";\nimport * as stylex from \"@stylexjs/stylex\";\nimport \"../Tokens.stylex\";\nimport { colors, sizes, fonts, transitions } from \"../Tokens.stylex\";\nconst styles = {\n wrapper: {\n display: \"x78zum5\",\n flexDirection: \"xdt5ytf\",\n maxWidth: \"x193iq5w\",\n gap: \"x188dswm\",\n $$css: true\n },\n disabled: {\n cursor: \"x1h6gzvc\",\n opacity: \"x190dgpg\",\n \":where(*) *_pointerEvents\": \"x8ie97q\",\n $$css: true\n }\n};\nexport default function RangeSlider({\n value,\n onChange,\n label,\n disabled,\n id\n}: {\n value: number;\n onChange: Function;\n label: string;\n input?: Boolean;\n disabled?: Boolean;\n id: string;\n}) {\n const [number, setNumber] = useState(value || 0);\n const min = 0;\n const max = 100;\n useEffect(() => {\n setNumber(value);\n }, [value]);\n function handleChange(event: React.FormEvent) {\n onChange(event?.currentTarget?.valueAsNumber);\n }\n const numLength = (value: number) => value.toString().length;\n const minWidth = Math.max(numLength(min), numLength(max)) + \"ch\";\n const minWidthInput = `calc(${minWidth} + 2rem)`; // 2rem for the input padding\n\n return
\n
\n \n \n
\n \n
;\n}", "// @ts-ignore\nimport React from \"react\";\nimport { HexColorPicker, HexColorInput } from \"react-colorful\";\nimport { onHexChange, setLuminance, setLightness, OptionPreview, RangeSlider } from \"./index\";\nimport { IconButton, SelectBox } from \"@neos-project/react-ui-components\";\nimport * as stylex from \"@stylexjs/stylex\";\nimport \"../Tokens.stylex\";\nimport { colors, sizes, fonts, transitions } from \"../Tokens.stylex\";\nconst styles = {\n highlight: {\n borderRadius: \"xjohyra\",\n borderStartStartRadius: null,\n borderStartEndRadius: null,\n borderEndStartRadius: null,\n borderEndEndRadius: null,\n borderTopLeftRadius: null,\n borderTopRightRadius: null,\n borderBottomLeftRadius: null,\n borderBottomRightRadius: null,\n boxShadow: \"x11mstge\",\n $$css: true\n },\n colorPreview: color => [{\n borderRadius: \"xjohyra\",\n borderStartStartRadius: null,\n borderStartEndRadius: null,\n borderEndStartRadius: null,\n borderEndEndRadius: null,\n borderTopLeftRadius: null,\n borderTopRightRadius: null,\n borderBottomLeftRadius: null,\n borderBottomRightRadius: null,\n height: \"x1hhc0k\",\n minWidth: \"x15g7okx\",\n flexBasis: null,\n flex: \"x98rzlu\",\n flexGrow: null,\n flexShrink: null,\n backgroundColor: \"xq1mx2j\",\n backgroundSize: \"xx8ilsi\",\n backgroundImage: \"x1g0zcm7\",\n $$css: true\n }, {\n \"--backgroundColor\": (color || colors.contrastNeutral) != null ? color || colors.contrastNeutral : \"initial\",\n \"--backgroundSize\": (color ? null : \"16px 16px\") != null ? color ? null : \"16px 16px\" : \"initial\",\n \"--backgroundImage\": (color ? null : colors.checkerboard) != null ? color ? null : colors.checkerboard : \"initial\"\n }],\n colorPicker: {\n width: \"xh8yej3\",\n height: \"xt7dq6l\",\n aspectRatio: \"x1plog1\",\n marginTop: \"xlt0ddm\",\n \":where(*) > :first-child_borderTopLeftRadius\": \"xf5yl2k\",\n \":where(*) > :first-child_borderTopRightRadius\": \"x9av0op\",\n \":where(*) > :last-child_borderBottomLeftRadius\": \"xdosjj7\",\n \":where(*) > :last-child_borderBottomRightRadius\": \"xkmff00\",\n \":where(*) .react-colorful__pointer_height\": \"xbq8i1p\",\n \":where(*) .react-colorful__pointer_width\": \"x19mnrqj\",\n \":where(*) .react-colorful__pointer_backgroundColor\": \"x13bp1ud\",\n \":where(*) .react-colorful__pointer_borderColor\": \"x1th5coa\",\n \":where(*) .react-colorful__pointer_transition\": \"x1lptuiq\",\n \":where(*) .react-colorful__pointer:hover_backgroundColor\": \"x4hip2o\",\n \":where(*) .react-colorful__pointer:hover_borderColor\": \"xfbmp4j\",\n \":where(*) .react-colorful__pointer:hover_cursor\": \"x2lqnu4\",\n \":where(*) .react-colorful__pointer:active_transform\": \"xmxw2tw\",\n \":where(*) .react-colorful__pointer:active_cursor\": \"x46gmau\",\n $$css: true\n },\n colorPickerCollapsed: {\n marginTop: \"x16i8m89\",\n $$css: true\n }\n};\n\n// @ts-ignore\nexport default function Panel({\n allowEmpty,\n precision,\n presets,\n showHexInput,\n showLightness,\n showLuminance,\n showPicker,\n showPresets,\n i18nRegistry,\n highlight,\n state,\n setState,\n id,\n onFocus = () => {},\n collapsed\n}: {\n allowEmpty: boolean;\n precision: number;\n presets: object;\n showHexInput: boolean;\n showLightness: boolean;\n showLuminance: boolean;\n showPicker: boolean;\n showPresets: boolean;\n i18nRegistry: any;\n highlight?: boolean;\n state: any;\n setState: Function;\n id: string;\n onFocus?: Function;\n collapsed: boolean;\n}) {\n function handleHexChange(hex: string) {\n setState(onHexChange(hex, precision));\n }\n function handleLightnessChange(lightness: number) {\n handleHexChange(setLightness(state?.hex, lightness));\n }\n function handleLuminanceChange(luminance: number) {\n handleHexChange(setLuminance(state?.oklch, luminance));\n }\n const presetOptions = showPresets && presets && Object.entries(presets).map(([key, color]) => ({\n value: color,\n label: key\n })).filter(preset => !!preset.value);\n return <>\n {Boolean(showPicker) && }\n\n {Boolean(showLightness) && }\n\n {Boolean(showLuminance) && }\n\n {(collapsed ? Boolean(showHexInput) : true) &&
\n {Boolean(collapsed) ||
}\n\n {Boolean(showHexInput) && onFocus()} />}\n\n {!collapsed && Boolean(allowEmpty) && {\n setState(null);\n }} />}\n
}\n\n {Boolean(presetOptions) && }\n ;\n}", "import { useRef } from \"react\";\n\n// Saves incoming handler to the ref in order to avoid \"useCallback hell\"\nexport function useEventCallback(handler?: (value: T) => void): (value: T) => void {\n const callbackRef = useRef(handler);\n const fn = useRef((value: T) => {\n callbackRef.current && callbackRef.current(value);\n });\n callbackRef.current = handler;\n\n return fn.current;\n}\n", "// Clamps a value between an upper and lower bound.\n// We use ternary operators because it makes the minified code\n// 2 times shorter then `Math.min(Math.max(a,b),c)`\nexport const clamp = (number: number, min = 0, max = 1): number => {\n return number > max ? max : number < min ? min : number;\n};\n", "import React, { useRef, useMemo, useEffect } from \"react\";\n\nimport { useEventCallback } from \"../../hooks/useEventCallback\";\nimport { clamp } from \"../../utils/clamp\";\n\nexport interface Interaction {\n left: number;\n top: number;\n}\n\n// Check if an event was triggered by touch\nconst isTouch = (event: MouseEvent | TouchEvent): event is TouchEvent => \"touches\" in event;\n\n// Finds a proper touch point by its identifier\nconst getTouchPoint = (touches: TouchList, touchId: null | number): Touch => {\n for (let i = 0; i < touches.length; i++) {\n if (touches[i].identifier === touchId) return touches[i];\n }\n return touches[0];\n};\n\n// Finds the proper window object to fix iframe embedding issues\nconst getParentWindow = (node?: HTMLDivElement | null): Window => {\n return (node && node.ownerDocument.defaultView) || self;\n};\n\n// Returns a relative position of the pointer inside the node's bounding box\nconst getRelativePosition = (\n node: HTMLDivElement,\n event: MouseEvent | TouchEvent,\n touchId: null | number\n): Interaction => {\n const rect = node.getBoundingClientRect();\n\n // Get user's pointer position from `touches` array if it's a `TouchEvent`\n const pointer = isTouch(event) ? getTouchPoint(event.touches, touchId) : (event as MouseEvent);\n\n return {\n left: clamp((pointer.pageX - (rect.left + getParentWindow(node).pageXOffset)) / rect.width),\n top: clamp((pointer.pageY - (rect.top + getParentWindow(node).pageYOffset)) / rect.height),\n };\n};\n\n// Browsers introduced an intervention, making touch events passive by default.\n// This workaround removes `preventDefault` call from the touch handlers.\n// https://github.com/facebook/react/issues/19651\nconst preventDefaultMove = (event: MouseEvent | TouchEvent): void => {\n !isTouch(event) && event.preventDefault();\n};\n\n// Prevent mobile browsers from handling mouse events (conflicting with touch ones).\n// If we detected a touch interaction before, we prefer reacting to touch events only.\nconst isInvalid = (event: MouseEvent | TouchEvent, hasTouch: boolean): boolean => {\n return hasTouch && !isTouch(event);\n};\n\ninterface Props {\n onMove: (interaction: Interaction) => void;\n onKey: (offset: Interaction) => void;\n children: React.ReactNode;\n}\n\nconst InteractiveBase = ({ onMove, onKey, ...rest }: Props) => {\n const container = useRef(null);\n const onMoveCallback = useEventCallback(onMove);\n const onKeyCallback = useEventCallback(onKey);\n const touchId = useRef(null);\n const hasTouch = useRef(false);\n\n const [handleMoveStart, handleKeyDown, toggleDocumentEvents] = useMemo(() => {\n const handleMoveStart = ({ nativeEvent }: React.MouseEvent | React.TouchEvent) => {\n const el = container.current;\n if (!el) return;\n\n // Prevent text selection\n preventDefaultMove(nativeEvent);\n\n if (isInvalid(nativeEvent, hasTouch.current) || !el) return;\n\n if (isTouch(nativeEvent)) {\n hasTouch.current = true;\n const changedTouches = nativeEvent.changedTouches || [];\n if (changedTouches.length) touchId.current = changedTouches[0].identifier;\n }\n\n el.focus();\n onMoveCallback(getRelativePosition(el, nativeEvent, touchId.current));\n toggleDocumentEvents(true);\n };\n\n const handleMove = (event: MouseEvent | TouchEvent) => {\n // Prevent text selection\n preventDefaultMove(event);\n\n // If user moves the pointer outside of the window or iframe bounds and release it there,\n // `mouseup`/`touchend` won't be fired. In order to stop the picker from following the cursor\n // after the user has moved the mouse/finger back to the document, we check `event.buttons`\n // and `event.touches`. It allows us to detect that the user is just moving his pointer\n // without pressing it down\n const isDown = isTouch(event) ? event.touches.length > 0 : event.buttons > 0;\n\n if (isDown && container.current) {\n onMoveCallback(getRelativePosition(container.current, event, touchId.current));\n } else {\n toggleDocumentEvents(false);\n }\n };\n\n const handleMoveEnd = () => toggleDocumentEvents(false);\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n const keyCode = event.which || event.keyCode;\n\n // Ignore all keys except arrow ones\n if (keyCode < 37 || keyCode > 40) return;\n // Do not scroll page by arrow keys when document is focused on the element\n event.preventDefault();\n // Send relative offset to the parent component.\n // We use codes (37←, 38↑, 39→, 40↓) instead of keys ('ArrowRight', 'ArrowDown', etc)\n // to reduce the size of the library\n onKeyCallback({\n left: keyCode === 39 ? 0.05 : keyCode === 37 ? -0.05 : 0,\n top: keyCode === 40 ? 0.05 : keyCode === 38 ? -0.05 : 0,\n });\n };\n\n function toggleDocumentEvents(state?: boolean) {\n const touch = hasTouch.current;\n const el = container.current;\n const parentWindow = getParentWindow(el);\n\n // Add or remove additional pointer event listeners\n const toggleEvent = state ? parentWindow.addEventListener : parentWindow.removeEventListener;\n toggleEvent(touch ? \"touchmove\" : \"mousemove\", handleMove);\n toggleEvent(touch ? \"touchend\" : \"mouseup\", handleMoveEnd);\n }\n\n return [handleMoveStart, handleKeyDown, toggleDocumentEvents];\n }, [onKeyCallback, onMoveCallback]);\n\n // Remove window event listeners before unmounting\n useEffect(() => toggleDocumentEvents, [toggleDocumentEvents]);\n\n return (\n \n );\n};\n\nexport const Interactive = React.memo(InteractiveBase);\n", "export const formatClassName = (names: unknown[]): string => names.filter(Boolean).join(\" \");\n", "import React from \"react\";\nimport { formatClassName } from \"../../utils/format\";\n\ninterface Props {\n className?: string;\n top?: number;\n left: number;\n color: string;\n}\n\nexport const Pointer = ({ className, color, left, top = 0.5 }: Props): JSX.Element => {\n const nodeClassName = formatClassName([\"react-colorful__pointer\", className]);\n\n const style = {\n top: `${top * 100}%`,\n left: `${left * 100}%`,\n };\n\n return (\n
\n
\n
\n );\n};\n", "export const round = (number: number, digits = 0, base = Math.pow(10, digits)): number => {\n return Math.round(base * number) / base;\n};\n", "import { round } from \"./round\";\nimport { RgbaColor, RgbColor, HslaColor, HslColor, HsvaColor, HsvColor } from \"../types\";\n\n/**\n * Valid CSS units.\n * https://developer.mozilla.org/en-US/docs/Web/CSS/angle\n */\nconst angleUnits: Record = {\n grad: 360 / 400,\n turn: 360,\n rad: 360 / (Math.PI * 2),\n};\n\nexport const hexToHsva = (hex: string): HsvaColor => rgbaToHsva(hexToRgba(hex));\n\nexport const hexToRgba = (hex: string): RgbaColor => {\n if (hex[0] === \"#\") hex = hex.substring(1);\n\n if (hex.length < 6) {\n return {\n r: parseInt(hex[0] + hex[0], 16),\n g: parseInt(hex[1] + hex[1], 16),\n b: parseInt(hex[2] + hex[2], 16),\n a: hex.length === 4 ? round(parseInt(hex[3] + hex[3], 16) / 255, 2) : 1,\n };\n }\n\n return {\n r: parseInt(hex.substring(0, 2), 16),\n g: parseInt(hex.substring(2, 4), 16),\n b: parseInt(hex.substring(4, 6), 16),\n a: hex.length === 8 ? round(parseInt(hex.substring(6, 8), 16) / 255, 2) : 1,\n };\n};\n\nexport const parseHue = (value: string, unit = \"deg\"): number => {\n return Number(value) * (angleUnits[unit] || 1);\n};\n\nexport const hslaStringToHsva = (hslString: string): HsvaColor => {\n const matcher = /hsla?\\(?\\s*(-?\\d*\\.?\\d+)(deg|rad|grad|turn)?[,\\s]+(-?\\d*\\.?\\d+)%?[,\\s]+(-?\\d*\\.?\\d+)%?,?\\s*[/\\s]*(-?\\d*\\.?\\d+)?(%)?\\s*\\)?/i;\n const match = matcher.exec(hslString);\n\n if (!match) return { h: 0, s: 0, v: 0, a: 1 };\n\n return hslaToHsva({\n h: parseHue(match[1], match[2]),\n s: Number(match[3]),\n l: Number(match[4]),\n a: match[5] === undefined ? 1 : Number(match[5]) / (match[6] ? 100 : 1),\n });\n};\n\nexport const hslStringToHsva = hslaStringToHsva;\n\nexport const hslaToHsva = ({ h, s, l, a }: HslaColor): HsvaColor => {\n s *= (l < 50 ? l : 100 - l) / 100;\n\n return {\n h: h,\n s: s > 0 ? ((2 * s) / (l + s)) * 100 : 0,\n v: l + s,\n a,\n };\n};\n\nexport const hsvaToHex = (hsva: HsvaColor): string => rgbaToHex(hsvaToRgba(hsva));\n\nexport const hsvaToHsla = ({ h, s, v, a }: HsvaColor): HslaColor => {\n const hh = ((200 - s) * v) / 100;\n\n return {\n h: round(h),\n s: round(hh > 0 && hh < 200 ? ((s * v) / 100 / (hh <= 100 ? hh : 200 - hh)) * 100 : 0),\n l: round(hh / 2),\n a: round(a, 2),\n };\n};\n\nexport const hsvaToHslString = (hsva: HsvaColor): string => {\n const { h, s, l } = hsvaToHsla(hsva);\n return `hsl(${h}, ${s}%, ${l}%)`;\n};\n\nexport const hsvaToHsvString = (hsva: HsvaColor): string => {\n const { h, s, v } = roundHsva(hsva);\n return `hsv(${h}, ${s}%, ${v}%)`;\n};\n\nexport const hsvaToHsvaString = (hsva: HsvaColor): string => {\n const { h, s, v, a } = roundHsva(hsva);\n return `hsva(${h}, ${s}%, ${v}%, ${a})`;\n};\n\nexport const hsvaToHslaString = (hsva: HsvaColor): string => {\n const { h, s, l, a } = hsvaToHsla(hsva);\n return `hsla(${h}, ${s}%, ${l}%, ${a})`;\n};\n\nexport const hsvaToRgba = ({ h, s, v, a }: HsvaColor): RgbaColor => {\n h = (h / 360) * 6;\n s = s / 100;\n v = v / 100;\n\n const hh = Math.floor(h),\n b = v * (1 - s),\n c = v * (1 - (h - hh) * s),\n d = v * (1 - (1 - h + hh) * s),\n module = hh % 6;\n\n return {\n r: round([v, c, b, b, d, v][module] * 255),\n g: round([d, v, v, c, b, b][module] * 255),\n b: round([b, b, d, v, v, c][module] * 255),\n a: round(a, 2),\n };\n};\n\nexport const hsvaToRgbString = (hsva: HsvaColor): string => {\n const { r, g, b } = hsvaToRgba(hsva);\n return `rgb(${r}, ${g}, ${b})`;\n};\n\nexport const hsvaToRgbaString = (hsva: HsvaColor): string => {\n const { r, g, b, a } = hsvaToRgba(hsva);\n return `rgba(${r}, ${g}, ${b}, ${a})`;\n};\n\nexport const hsvaStringToHsva = (hsvString: string): HsvaColor => {\n const matcher = /hsva?\\(?\\s*(-?\\d*\\.?\\d+)(deg|rad|grad|turn)?[,\\s]+(-?\\d*\\.?\\d+)%?[,\\s]+(-?\\d*\\.?\\d+)%?,?\\s*[/\\s]*(-?\\d*\\.?\\d+)?(%)?\\s*\\)?/i;\n const match = matcher.exec(hsvString);\n\n if (!match) return { h: 0, s: 0, v: 0, a: 1 };\n\n return roundHsva({\n h: parseHue(match[1], match[2]),\n s: Number(match[3]),\n v: Number(match[4]),\n a: match[5] === undefined ? 1 : Number(match[5]) / (match[6] ? 100 : 1),\n });\n};\n\nexport const hsvStringToHsva = hsvaStringToHsva;\n\nexport const rgbaStringToHsva = (rgbaString: string): HsvaColor => {\n const matcher = /rgba?\\(?\\s*(-?\\d*\\.?\\d+)(%)?[,\\s]+(-?\\d*\\.?\\d+)(%)?[,\\s]+(-?\\d*\\.?\\d+)(%)?,?\\s*[/\\s]*(-?\\d*\\.?\\d+)?(%)?\\s*\\)?/i;\n const match = matcher.exec(rgbaString);\n\n if (!match) return { h: 0, s: 0, v: 0, a: 1 };\n\n return rgbaToHsva({\n r: Number(match[1]) / (match[2] ? 100 / 255 : 1),\n g: Number(match[3]) / (match[4] ? 100 / 255 : 1),\n b: Number(match[5]) / (match[6] ? 100 / 255 : 1),\n a: match[7] === undefined ? 1 : Number(match[7]) / (match[8] ? 100 : 1),\n });\n};\n\nexport const rgbStringToHsva = rgbaStringToHsva;\n\nconst format = (number: number) => {\n const hex = number.toString(16);\n return hex.length < 2 ? \"0\" + hex : hex;\n};\n\nexport const rgbaToHex = ({ r, g, b, a }: RgbaColor): string => {\n const alphaHex = a < 1 ? format(round(a * 255)) : \"\";\n return \"#\" + format(r) + format(g) + format(b) + alphaHex;\n};\n\nexport const rgbaToHsva = ({ r, g, b, a }: RgbaColor): HsvaColor => {\n const max = Math.max(r, g, b);\n const delta = max - Math.min(r, g, b);\n\n // prettier-ignore\n const hh = delta\n ? max === r\n ? (g - b) / delta\n : max === g\n ? 2 + (b - r) / delta\n : 4 + (r - g) / delta\n : 0;\n\n return {\n h: round(60 * (hh < 0 ? hh + 6 : hh)),\n s: round(max ? (delta / max) * 100 : 0),\n v: round((max / 255) * 100),\n a,\n };\n};\n\nexport const roundHsva = (hsva: HsvaColor): HsvaColor => ({\n h: round(hsva.h),\n s: round(hsva.s),\n v: round(hsva.v),\n a: round(hsva.a, 2),\n});\n\nexport const rgbaToRgb = ({ r, g, b }: RgbaColor): RgbColor => ({ r, g, b });\n\nexport const hslaToHsl = ({ h, s, l }: HslaColor): HslColor => ({ h, s, l });\n\nexport const hsvaToHsv = (hsva: HsvaColor): HsvColor => {\n const { h, s, v } = roundHsva(hsva);\n return { h, s, v };\n};\n", "import React from \"react\";\n\nimport { Interactive, Interaction } from \"./Interactive\";\nimport { Pointer } from \"./Pointer\";\n\nimport { hsvaToHslString } from \"../../utils/convert\";\nimport { formatClassName } from \"../../utils/format\";\nimport { clamp } from \"../../utils/clamp\";\nimport { round } from \"../../utils/round\";\n\ninterface Props {\n className?: string;\n hue: number;\n onChange: (newHue: { h: number }) => void;\n}\n\nconst HueBase = ({ className, hue, onChange }: Props) => {\n const handleMove = (interaction: Interaction) => {\n onChange({ h: 360 * interaction.left });\n };\n\n const handleKey = (offset: Interaction) => {\n // Hue measured in degrees of the color circle ranging from 0 to 360\n onChange({\n h: clamp(hue + offset.left * 360, 0, 360),\n });\n };\n\n const nodeClassName = formatClassName([\"react-colorful__hue\", className]);\n\n return (\n
\n \n \n \n
\n );\n};\n\nexport const Hue = React.memo(HueBase);\n", "import React from \"react\";\nimport { Interactive, Interaction } from \"./Interactive\";\nimport { Pointer } from \"./Pointer\";\nimport { HsvaColor } from \"../../types\";\nimport { hsvaToHslString } from \"../../utils/convert\";\nimport { clamp } from \"../../utils/clamp\";\nimport { round } from \"../../utils/round\";\n\ninterface Props {\n hsva: HsvaColor;\n onChange: (newColor: { s: number; v: number }) => void;\n}\n\nconst SaturationBase = ({ hsva, onChange }: Props) => {\n const handleMove = (interaction: Interaction) => {\n onChange({\n s: interaction.left * 100,\n v: 100 - interaction.top * 100,\n });\n };\n\n const handleKey = (offset: Interaction) => {\n // Saturation and brightness always fit into [0, 100] range\n onChange({\n s: clamp(hsva.s + offset.left * 100, 0, 100),\n v: clamp(hsva.v - offset.top * 100, 0, 100),\n });\n };\n\n const containerStyle = {\n backgroundColor: hsvaToHslString({ h: hsva.h, s: 100, v: 100, a: 1 }),\n };\n\n return (\n
\n \n \n \n
\n );\n};\n\nexport const Saturation = React.memo(SaturationBase);\n", "import { hexToRgba } from \"./convert\";\nimport { ObjectColor } from \"../types\";\n\nexport const equalColorObjects = (first: ObjectColor, second: ObjectColor): boolean => {\n if (first === second) return true;\n\n for (const prop in first) {\n // The following allows for a type-safe calling of this function (first & second have to be HSL, HSV, or RGB)\n // with type-unsafe iterating over object keys. TS does not allow this without an index (`[key: string]: number`)\n // on an object to define how iteration is normally done. To ensure extra keys are not allowed on our types,\n // we must cast our object to unknown (as RGB demands `r` be a key, while `Record` does not care if\n // there is or not), and then as a type TS can iterate over.\n if (\n ((first as unknown) as Record)[prop] !==\n ((second as unknown) as Record)[prop]\n )\n return false;\n }\n\n return true;\n};\n\nexport const equalColorString = (first: string, second: string): boolean => {\n return first.replace(/\\s/g, \"\") === second.replace(/\\s/g, \"\");\n};\n\nexport const equalHex = (first: string, second: string): boolean => {\n if (first.toLowerCase() === second.toLowerCase()) return true;\n\n // To compare colors like `#FFF` and `ffffff` we convert them into RGB objects\n return equalColorObjects(hexToRgba(first), hexToRgba(second));\n};\n", "import { useState, useEffect, useCallback, useRef } from \"react\";\nimport { ColorModel, AnyColor, HsvaColor } from \"../types\";\nimport { equalColorObjects } from \"../utils/compare\";\nimport { useEventCallback } from \"./useEventCallback\";\n\nexport function useColorManipulation(\n colorModel: ColorModel,\n color: T,\n onChange?: (color: T) => void\n): [HsvaColor, (color: Partial) => void] {\n // Save onChange callback in the ref for avoiding \"useCallback hell\"\n const onChangeCallback = useEventCallback(onChange);\n\n // No matter which color model is used (HEX, RGB(A) or HSL(A)),\n // all internal calculations are based on HSVA model\n const [hsva, updateHsva] = useState(() => colorModel.toHsva(color));\n\n // By using this ref we're able to prevent extra updates\n // and the effects recursion during the color conversion\n const cache = useRef({ color, hsva });\n\n // Update local HSVA-value if `color` property value is changed,\n // but only if that's not the same color that we just sent to the parent\n useEffect(() => {\n if (!colorModel.equal(color, cache.current.color)) {\n const newHsva = colorModel.toHsva(color);\n cache.current = { hsva: newHsva, color };\n updateHsva(newHsva);\n }\n }, [color, colorModel]);\n\n // Trigger `onChange` callback only if an updated color is different from cached one;\n // save the new color to the ref to prevent unnecessary updates\n useEffect(() => {\n let newColor;\n if (\n !equalColorObjects(hsva, cache.current.hsva) &&\n !colorModel.equal((newColor = colorModel.fromHsva(hsva)), cache.current.color)\n ) {\n cache.current = { hsva, color: newColor };\n onChangeCallback(newColor);\n }\n }, [hsva, colorModel, onChangeCallback]);\n\n // Merge the current HSVA color object with updated params.\n // For example, when a child component sends `h` or `s` only\n const handleChange = useCallback((params: Partial) => {\n updateHsva((current) => Object.assign({}, current, params));\n }, []);\n\n return [hsva, handleChange];\n}\n", "declare const __webpack_nonce__: string | undefined;\nlet nonce: string | undefined;\n\n/**\n * Returns a nonce hash included by Webpack or the one defined manually by developer.\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce\n * https://webpack.js.org/guides/csp/\n */\nexport const getNonce = (): string | undefined => {\n if (nonce) return nonce;\n if (typeof __webpack_nonce__ !== \"undefined\") return __webpack_nonce__;\n return undefined;\n};\n\n/**\n * Signs the style tag with a base64-encoded string (nonce) to conforms to Content Security Policies.\n * This function has to be invoked before any picker is rendered if you aren't using Webpack for CSP.\n */\nexport const setNonce = (hash: string): void => {\n nonce = hash;\n};\n", "import { useLayoutEffect, useEffect } from \"react\";\n\n// React currently throws a warning when using useLayoutEffect on the server.\n// To get around it, we can conditionally useEffect on the server (no-op) and\n// useLayoutEffect in the browser.\nexport const useIsomorphicLayoutEffect =\n typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n", "import { RefObject } from \"react\";\n\nimport { useIsomorphicLayoutEffect } from \"./useIsomorphicLayoutEffect\";\nimport { getNonce } from \"../utils/nonce\";\n\n// Bundler is configured to load this as a processed minified CSS-string\nimport styles from \"../css/styles.css\";\n\nconst styleElementMap: Map = new Map();\n\n/**\n * Injects CSS code into the document's \n */\nexport const useStyleSheet = (nodeRef: RefObject): void => {\n useIsomorphicLayoutEffect(() => {\n const parentDocument = nodeRef.current ? nodeRef.current.ownerDocument : document;\n\n if (typeof parentDocument !== \"undefined\" && !styleElementMap.has(parentDocument)) {\n const styleElement = parentDocument.createElement(\"style\");\n styleElement.innerHTML = styles;\n styleElementMap.set(parentDocument, styleElement);\n\n // Conform to CSP rules by setting `nonce` attribute to the inline styles\n const nonce = getNonce();\n if (nonce) styleElement.setAttribute(\"nonce\", nonce);\n\n parentDocument.head.appendChild(styleElement);\n }\n }, []);\n};\n", "import React, { useRef } from \"react\";\n\nimport { Hue } from \"./Hue\";\nimport { Saturation } from \"./Saturation\";\n\nimport { ColorModel, ColorPickerBaseProps, AnyColor } from \"../../types\";\nimport { useColorManipulation } from \"../../hooks/useColorManipulation\";\nimport { useStyleSheet } from \"../../hooks/useStyleSheet\";\nimport { formatClassName } from \"../../utils/format\";\n\ninterface Props extends Partial> {\n colorModel: ColorModel;\n}\n\nexport const ColorPicker = ({\n className,\n colorModel,\n color = colorModel.defaultColor,\n onChange,\n ...rest\n}: Props): JSX.Element => {\n const nodeRef = useRef(null);\n useStyleSheet(nodeRef);\n\n const [hsva, updateHsva] = useColorManipulation(colorModel, color, onChange);\n\n const nodeClassName = formatClassName([\"react-colorful\", className]);\n\n return (\n
\n \n \n
\n );\n};\n", "import React from \"react\";\n\nimport { ColorPicker } from \"./common/ColorPicker\";\nimport { ColorModel, ColorPickerBaseProps } from \"../types\";\nimport { equalHex } from \"../utils/compare\";\nimport { hexToHsva, hsvaToHex } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: \"000\",\n toHsva: hexToHsva,\n fromHsva: ({ h, s, v }) => hsvaToHex({ h, s, v, a: 1 }),\n equal: equalHex,\n};\n\nexport const HexColorPicker = (props: Partial>): JSX.Element => (\n \n);\n", "import React from \"react\";\n\nimport { Interactive, Interaction } from \"./Interactive\";\nimport { Pointer } from \"./Pointer\";\n\nimport { hsvaToHslaString } from \"../../utils/convert\";\nimport { formatClassName } from \"../../utils/format\";\nimport { clamp } from \"../../utils/clamp\";\nimport { round } from \"../../utils/round\";\nimport { HsvaColor } from \"../../types\";\n\ninterface Props {\n className?: string;\n hsva: HsvaColor;\n onChange: (newAlpha: { a: number }) => void;\n}\n\nexport const Alpha = ({ className, hsva, onChange }: Props): JSX.Element => {\n const handleMove = (interaction: Interaction) => {\n onChange({ a: interaction.left });\n };\n\n const handleKey = (offset: Interaction) => {\n // Alpha always fit into [0, 1] range\n onChange({ a: clamp(hsva.a + offset.left) });\n };\n\n // We use `Object.assign` instead of the spread operator\n // to prevent adding the polyfill (about 150 bytes gzipped)\n const colorFrom = hsvaToHslaString(Object.assign({}, hsva, { a: 0 }));\n const colorTo = hsvaToHslaString(Object.assign({}, hsva, { a: 1 }));\n\n const gradientStyle = {\n backgroundImage: `linear-gradient(90deg, ${colorFrom}, ${colorTo})`,\n };\n\n const nodeClassName = formatClassName([\"react-colorful__alpha\", className]);\n const ariaValue = round(hsva.a * 100);\n\n return (\n
\n
\n \n \n \n
\n );\n};\n", "import React, { useRef } from \"react\";\n\nimport { Hue } from \"./Hue\";\nimport { Saturation } from \"./Saturation\";\nimport { Alpha } from \"./Alpha\";\n\nimport { ColorModel, ColorPickerBaseProps, AnyColor } from \"../../types\";\nimport { useColorManipulation } from \"../../hooks/useColorManipulation\";\nimport { useStyleSheet } from \"../../hooks/useStyleSheet\";\nimport { formatClassName } from \"../../utils/format\";\n\ninterface Props extends Partial> {\n colorModel: ColorModel;\n}\n\nexport const AlphaColorPicker = ({\n className,\n colorModel,\n color = colorModel.defaultColor,\n onChange,\n ...rest\n}: Props): JSX.Element => {\n const nodeRef = useRef(null);\n useStyleSheet(nodeRef);\n\n const [hsva, updateHsva] = useColorManipulation(colorModel, color, onChange);\n\n const nodeClassName = formatClassName([\"react-colorful\", className]);\n\n return (\n
\n \n \n \n
\n );\n};\n", "import React from \"react\";\n\nimport { AlphaColorPicker } from \"./common/AlphaColorPicker\";\nimport { ColorModel, ColorPickerBaseProps } from \"../types\";\nimport { equalHex } from \"../utils/compare\";\nimport { hexToHsva, hsvaToHex } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: \"0001\",\n toHsva: hexToHsva,\n fromHsva: hsvaToHex,\n equal: equalHex,\n};\n\nexport const HexAlphaColorPicker = (props: Partial>): JSX.Element => (\n \n);\n", "import React from \"react\";\n\nimport { AlphaColorPicker } from \"./common/AlphaColorPicker\";\nimport { ColorModel, ColorPickerBaseProps, HslaColor } from \"../types\";\nimport { equalColorObjects } from \"../utils/compare\";\nimport { hslaToHsva, hsvaToHsla } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: { h: 0, s: 0, l: 0, a: 1 },\n toHsva: hslaToHsva,\n fromHsva: hsvaToHsla,\n equal: equalColorObjects,\n};\n\nexport const HslaColorPicker = (props: Partial>): JSX.Element => (\n \n);\n", "import React from \"react\";\n\nimport { AlphaColorPicker } from \"./common/AlphaColorPicker\";\nimport { ColorModel, ColorPickerBaseProps } from \"../types\";\nimport { equalColorString } from \"../utils/compare\";\nimport { hslaStringToHsva, hsvaToHslaString } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: \"hsla(0, 0%, 0%, 1)\",\n toHsva: hslaStringToHsva,\n fromHsva: hsvaToHslaString,\n equal: equalColorString,\n};\n\nexport const HslaStringColorPicker = (\n props: Partial>\n): JSX.Element => ;\n", "import React from \"react\";\n\nimport { ColorPicker } from \"./common/ColorPicker\";\nimport { ColorModel, ColorPickerBaseProps, HslColor } from \"../types\";\nimport { equalColorObjects } from \"../utils/compare\";\nimport { hslaToHsva, hsvaToHsla, hslaToHsl } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: { h: 0, s: 0, l: 0 },\n toHsva: ({ h, s, l }) => hslaToHsva({ h, s, l, a: 1 }),\n fromHsva: (hsva) => hslaToHsl(hsvaToHsla(hsva)),\n equal: equalColorObjects,\n};\n\nexport const HslColorPicker = (props: Partial>): JSX.Element => (\n \n);\n", "import React from \"react\";\n\nimport { ColorPicker } from \"./common/ColorPicker\";\nimport { ColorModel, ColorPickerBaseProps } from \"../types\";\nimport { equalColorString } from \"../utils/compare\";\nimport { hslStringToHsva, hsvaToHslString } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: \"hsl(0, 0%, 0%)\",\n toHsva: hslStringToHsva,\n fromHsva: hsvaToHslString,\n equal: equalColorString,\n};\n\nexport const HslStringColorPicker = (props: Partial>): JSX.Element => (\n \n);\n", "import React from \"react\";\n\nimport { AlphaColorPicker } from \"./common/AlphaColorPicker\";\nimport { ColorModel, ColorPickerBaseProps, HsvaColor } from \"../types\";\nimport { equalColorObjects } from \"../utils/compare\";\nimport { roundHsva } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: { h: 0, s: 0, v: 0, a: 1 },\n toHsva: (hsva) => hsva,\n fromHsva: roundHsva,\n equal: equalColorObjects,\n};\n\nexport const HsvaColorPicker = (props: Partial>): JSX.Element => (\n \n);\n", "import React from \"react\";\n\nimport { AlphaColorPicker } from \"./common/AlphaColorPicker\";\nimport { ColorModel, ColorPickerBaseProps } from \"../types\";\nimport { equalColorString } from \"../utils/compare\";\nimport { hsvaStringToHsva, hsvaToHsvaString } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: \"hsva(0, 0%, 0%, 1)\",\n toHsva: hsvaStringToHsva,\n fromHsva: hsvaToHsvaString,\n equal: equalColorString,\n};\n\nexport const HsvaStringColorPicker = (\n props: Partial>\n): JSX.Element => ;\n", "import React from \"react\";\n\nimport { ColorPicker } from \"./common/ColorPicker\";\nimport { ColorModel, ColorPickerBaseProps, HsvColor } from \"../types\";\nimport { equalColorObjects } from \"../utils/compare\";\nimport { hsvaToHsv } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: { h: 0, s: 0, v: 0 },\n toHsva: ({ h, s, v }) => ({ h, s, v, a: 1 }),\n fromHsva: hsvaToHsv,\n equal: equalColorObjects,\n};\n\nexport const HsvColorPicker = (props: Partial>): JSX.Element => (\n \n);\n", "import React from \"react\";\n\nimport { ColorPicker } from \"./common/ColorPicker\";\nimport { ColorModel, ColorPickerBaseProps } from \"../types\";\nimport { equalColorString } from \"../utils/compare\";\nimport { hsvStringToHsva, hsvaToHsvString } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: \"hsv(0, 0%, 0%)\",\n toHsva: hsvStringToHsva,\n fromHsva: hsvaToHsvString,\n equal: equalColorString,\n};\n\nexport const HsvStringColorPicker = (props: Partial>): JSX.Element => (\n \n);\n", "import React from \"react\";\n\nimport { AlphaColorPicker } from \"./common/AlphaColorPicker\";\nimport { ColorModel, ColorPickerBaseProps, RgbaColor } from \"../types\";\nimport { equalColorObjects } from \"../utils/compare\";\nimport { rgbaToHsva, hsvaToRgba } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: { r: 0, g: 0, b: 0, a: 1 },\n toHsva: rgbaToHsva,\n fromHsva: hsvaToRgba,\n equal: equalColorObjects,\n};\n\nexport const RgbaColorPicker = (props: Partial>): JSX.Element => (\n \n);\n", "import React from \"react\";\n\nimport { AlphaColorPicker } from \"./common/AlphaColorPicker\";\nimport { ColorModel, ColorPickerBaseProps } from \"../types\";\nimport { equalColorString } from \"../utils/compare\";\nimport { rgbaStringToHsva, hsvaToRgbaString } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: \"rgba(0, 0, 0, 1)\",\n toHsva: rgbaStringToHsva,\n fromHsva: hsvaToRgbaString,\n equal: equalColorString,\n};\n\nexport const RgbaStringColorPicker = (\n props: Partial>\n): JSX.Element => ;\n", "import React from \"react\";\n\nimport { ColorPicker } from \"./common/ColorPicker\";\nimport { ColorModel, ColorPickerBaseProps, RgbColor } from \"../types\";\nimport { equalColorObjects } from \"../utils/compare\";\nimport { rgbaToHsva, hsvaToRgba, rgbaToRgb } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: { r: 0, g: 0, b: 0 },\n toHsva: ({ r, g, b }) => rgbaToHsva({ r, g, b, a: 1 }),\n fromHsva: (hsva) => rgbaToRgb(hsvaToRgba(hsva)),\n equal: equalColorObjects,\n};\n\nexport const RgbColorPicker = (props: Partial>): JSX.Element => (\n \n);\n", "import React from \"react\";\n\nimport { ColorPicker } from \"./common/ColorPicker\";\nimport { ColorModel, ColorPickerBaseProps } from \"../types\";\nimport { equalColorString } from \"../utils/compare\";\nimport { rgbStringToHsva, hsvaToRgbString } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: \"rgb(0, 0, 0)\",\n toHsva: rgbStringToHsva,\n fromHsva: hsvaToRgbString,\n equal: equalColorString,\n};\n\nexport const RgbStringColorPicker = (props: Partial>): JSX.Element => (\n \n);\n", "const matcher = /^#?([0-9A-F]{3,8})$/i;\n\nexport const validHex = (value: string, alpha?: boolean): boolean => {\n const match = matcher.exec(value);\n const length = match ? match[1].length : 0;\n\n return (\n length === 3 || // '#rgb' format\n length === 6 || // '#rrggbb' format\n (!!alpha && length === 4) || // '#rgba' format\n (!!alpha && length === 8) // '#rrggbbaa' format\n );\n};\n", "import React, { useState, useEffect, useCallback } from \"react\";\n\nimport { useEventCallback } from \"../../hooks/useEventCallback\";\nimport { ColorInputBaseProps } from \"../../types\";\n\ninterface Props extends ColorInputBaseProps {\n /** Blocks typing invalid characters and limits string length */\n escape: (value: string) => string;\n /** Checks that value is valid color string */\n validate: (value: string) => boolean;\n /** Processes value before displaying it in the input */\n format?: (value: string) => string;\n /** Processes value before sending it in `onChange` */\n process?: (value: string) => string;\n}\n\nexport const ColorInput = (props: Props): JSX.Element => {\n const { color = \"\", onChange, onBlur, escape, validate, format, process, ...rest } = props;\n const [value, setValue] = useState(() => escape(color));\n const onChangeCallback = useEventCallback(onChange);\n const onBlurCallback = useEventCallback>(onBlur);\n\n // Trigger `onChange` handler only if the input value is a valid color\n const handleChange = useCallback(\n (e: React.ChangeEvent) => {\n const inputValue = escape(e.target.value);\n setValue(inputValue);\n if (validate(inputValue)) onChangeCallback(process ? process(inputValue) : inputValue);\n },\n [escape, process, validate, onChangeCallback]\n );\n\n // Take the color from props if the last typed color (in local state) is not valid\n const handleBlur = useCallback(\n (e: React.FocusEvent) => {\n if (!validate(e.target.value)) setValue(escape(color));\n onBlurCallback(e);\n },\n [color, escape, validate, onBlurCallback]\n );\n\n // Update the local state when `color` property value is changed\n useEffect(() => {\n setValue(escape(color));\n }, [color, escape]);\n\n return (\n \n );\n};\n", "import React, { useCallback } from \"react\";\nimport { ColorInputBaseProps } from \"../types\";\n\nimport { validHex } from \"../utils/validate\";\nimport { ColorInput } from \"./common/ColorInput\";\n\ninterface HexColorInputProps extends ColorInputBaseProps {\n /** Enables `#` prefix displaying */\n prefixed?: boolean;\n /** Allows `#rgba` and `#rrggbbaa` color formats */\n alpha?: boolean;\n}\n\n/** Adds \"#\" symbol to the beginning of the string */\nconst prefix = (value: string) => \"#\" + value;\n\nexport const HexColorInput = (props: HexColorInputProps): JSX.Element => {\n const { prefixed, alpha, ...rest } = props;\n\n /** Escapes all non-hexadecimal characters including \"#\" */\n const escape = useCallback(\n (value: string) => value.replace(/([^0-9A-F]+)/gi, \"\").substring(0, alpha ? 8 : 6),\n [alpha]\n );\n\n /** Validates hexadecimal strings */\n const validate = useCallback((value: string) => validHex(value, alpha), [alpha]);\n\n return (\n \n );\n};\n", "import { onHexChange, setLightness, setLuminance, setStateFromValue } from \"./ColorConverter\";\nimport OptionPreview from \"./OptionPreview\";\nimport RangeSlider from \"./RangeSlider\";\nimport Panel from \"./Panel\";\n\nexport default Panel;\nexport { onHexChange, setLuminance, setStateFromValue, OptionPreview, setLightness, RangeSlider };\n", "// @ts-ignore\nimport React from \"react\";\nimport * as stylex from \"@stylexjs/stylex\";\nimport \"../Tokens.stylex\";\nimport { fonts } from \"../Tokens.stylex\";\nexport default function HexOutput({\n hex\n}: {\n hex: string | null | undefined;\n}) {\n if (!hex) {\n return \"\";\n }\n return {hex};\n}", "import React, { useState, useEffect } from \"react\";\nimport { Circle, Dots } from \"./Elements\";\nimport { neos } from \"@neos-project/neos-ui-decorators\";\nimport * as stylex from \"@stylexjs/stylex\";\nconst styles = {\n container: heightMultiplier => [{\n display: \"xrvj5dj\",\n gridTemplate: \"xd3rg8h\",\n gridTemplateAreas: null,\n gridTemplateColumns: null,\n gridTemplateRows: null,\n alignItems: \"x6s0dn4\",\n justifyItems: \"x1o2pa38\",\n width: \"xh8yej3\",\n minHeight: \"x1gu4hsp\",\n $$css: true\n }, {\n \"--minHeight\": (val => typeof val === \"number\" ? val + \"px\" : val != null ? val : \"initial\")(`calc(var(--spacing-GoldenUnit) * ${heightMultiplier})`)\n }],\n item: active => [{\n gridArea: \"x1fdo2jl\",\n gridRow: null,\n gridRowStart: null,\n gridRowEnd: null,\n gridColumn: null,\n gridColumnStart: null,\n gridColumnEnd: null,\n transition: \"xc8avi6\",\n transitionBehavior: null,\n transitionDelay: null,\n transitionDuration: null,\n transitionProperty: null,\n transitionTimingFunction: null,\n opacity: \"x1u4uod0\",\n transform: \"x1v0jg1i\",\n $$css: true\n }, {\n \"--opacity\": (active ? 1 : 0) != null ? active ? 1 : 0 : \"initial\",\n \"--transform\": `scale(${active ? 1 : 0})` != null ? `scale(${active ? 1 : 0})` : \"initial\"\n }]\n};\nfunction Loading({\n id,\n title = \"Neos.Neos:Main:loading\",\n isLoading = false,\n delayTime = 500,\n timeoutTime = 5000,\n i18nRegistry,\n heightMultiplier = 1\n}) {\n const [showLoading, setShowLoading] = useState(0);\n const translatedTitle = title ? i18nRegistry.translate(title) : null;\n useEffect(() => {\n if (!isLoading) {\n setShowLoading(0);\n return;\n }\n const delay = setTimeout(() => {\n setShowLoading(1);\n }, delayTime);\n const timeout = setTimeout(() => {\n setShowLoading(2);\n }, delayTime + timeoutTime);\n return () => {\n clearTimeout(delay);\n clearTimeout(timeout);\n };\n }, [isLoading]);\n if (!isLoading) {\n return null;\n }\n return
\n \n \n
;\n}\nconst neosifier = neos(globalRegistry => ({\n i18nRegistry: globalRegistry.get(\"i18n\")\n}));\nexport default neosifier(Loading);", "import React from \"react\";\n\nexport function Circle({ style, className, size = 30 }) {\n return (\n \n \n \n {[\n {\n attribute: \"dasharray\",\n values: \"0 150;42 150;42 150;42 150\",\n },\n {\n attribute: \"dashoffset\",\n values: \"0;-16;-59;-59\",\n },\n ].map(({ attribute, values }) => (\n \n ))}\n \n \n \n \n );\n}\n\nexport function Dots({ style, className, size = 30 }) {\n return (\n \n {[1, 2, 3].map((number) => {\n const cx = number * 6;\n const beginn = Math.round((100 / 3) * (number - 1)) / 100;\n return (\n \n \n \n );\n })}\n \n );\n}\n", "import manifest from \"@neos-project/neos-ui-extensibility\";\n\nimport ColorPicker from \"./ColorPicker\";\n\nmanifest(\"Carbon.ColorPicker:OKLCH\", {}, (globalRegistry) => {\n const editorsRegistry = globalRegistry.get(\"in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AAI,QAAS,IAAMe,EAAQ,EAAI,EAAG,UAAW,GAAM,CAC7I,CACJ,CACJ,EAAM,EAAAN,QAAA,cAACmB,GAAA,CAAO,GAAGjB,EAAS,MAAOK,EAAO,SAAUC,EAAU,UAAWnB,EAAW,aAAcC,EAAc,GAAIC,EAAI,UAAW,GAAO,CAChJ,CACJ,CACR,CACA,IAAM6B,MAAY,SAAKC,IAAmB,CACxC,aAAcA,EAAe,IAAI,MAAM,EACvC,OAAQA,EAAe,IAAI,uBAAuB,EAAE,IAAI,0BAA0B,EAElF,sBAAuBA,EAAe,IAAI,aAAa,EAAE,IAAI,aAAa,CAC5E,EAAE,EACIC,MAAY,YAASf,IAAgB,CAEzC,gBAAiB,aAAU,GAAG,MAAM,wBAAwBA,CAAK,CACnE,EAAE,EACKgB,GAAQH,GAAUE,GAAUrC,EAAM,CAAC,EyF/R1CuC,GAAS,2BAA4B,CAAC,EAAIC,GAAmB,CACjCA,EAAe,IAAI,WAAW,EAAE,IAAI,SAAS,EAErD,IAAI,2BAA4B,CAC5C,UAAWC,GACX,YAAa,EACjB,CAAC,CACL,CAAC", + "names": ["readFromConsumerApi", "key", "args", "init_readFromConsumerApi", "__esmMin", "require_react", "__commonJSMin", "exports", "module", "init_readFromConsumerApi", "readFromConsumerApi", "require_neos_ui_decorators", "__commonJSMin", "exports", "module", "init_readFromConsumerApi", "readFromConsumerApi", "require_react_redux", "__commonJSMin", "exports", "module", "init_readFromConsumerApi", "readFromConsumerApi", "require_react_ui_components", "__commonJSMin", "exports", "module", "init_readFromConsumerApi", "readFromConsumerApi", "require_neos_ui_redux_store", "__commonJSMin", "exports", "module", "init_readFromConsumerApi", "readFromConsumerApi", "init_readFromConsumerApi", "dist_default", "readFromConsumerApi", "import_react", "import_neos_ui_decorators", "import_react_redux", "multiplyMatrices", "A", "B", "m", "x", "p", "B_cols", "_", "i", "product", "row", "col", "ret", "isString", "str", "type", "o", "serializeNumber", "n", "precision", "unit", "isNone", "toPrecision", "toPrecision", "n", "precision", "integer", "digits", "multiplier", "angleFactor", "parseFunction", "str", "isFunctionRegex", "isNumberRegex", "unitValueRegex", "singleArgument", "parts", "args", "$0", "rawArg", "match", "arg", "unit", "unitlessArg", "last", "arr", "interpolate", "start", "end", "p", "interpolateInv", "value", "mapRange", "from", "to", "parseCoordGrammar", "coordGrammars", "coordGrammar", "type", "range", "ret", "clamp", "min", "val", "max", "copySign", "spow", "base", "exp", "zdiv", "d", "bisectLeft", "lo", "hi", "mid", "Hooks", "name", "callback", "first", "env", "hooks", "hooks_default", "WHITES", "getWhite", "name", "adapt", "W1", "W2", "XYZ", "options", "env", "hooks_default", "multiplyMatrices", "defaults_default", "msg", "noneTypes", "coerceCoords", "space", "format", "name", "coords", "id", "coordMeta", "i", "coordGrammar", "arg", "providedType", "type", "c", "coordName", "fromRange", "toRange", "mapRange", "parse", "str", "meta", "env", "hooks_default", "parseFunction", "alternateId", "ids", "alpha", "ColorSpace", "colorSpec", "specId", "_", "types", "defaults_default", "didYouMean", "registryId", "cssId", "last", "formatId", "color", "getColor", "color", "isString", "parse", "space", "ColorSpace", "\u03B5", "_ColorSpace", "options", "coords", "name", "white", "getWhite", "format", "getPath", "hooks_default", "epsilon", "coordMeta", "c", "i", "meta", "min", "max", "coord", "id", "processFormat", "ret", "space", "color", "getColor", "myPath", "otherPath", "connectionSpace", "connectionSpaceIndex", "range", "alias", "alternatives", "type", "ref", "workingSpace", "coordType", "normalizedCoord", "__publicField", "ColorSpace", "s", "parseCoordGrammar", "coordFormats", "outputType", "fromRange", "toRange", "suffix", "precision", "mapRange", "serializeNumber", "xyz_d65_default", "ColorSpace", "RGBColorSpace", "ColorSpace", "options", "xyz_d65_default", "rgb", "xyz", "multiplyMatrices", "adapt", "getAll", "color", "space", "getColor", "ColorSpace", "get", "color", "prop", "getColor", "space", "index", "ColorSpace", "getAll", "setAll", "color", "space", "coords", "getColor", "ColorSpace", "set", "color", "prop", "value", "getColor", "type", "object", "p", "get", "space", "index", "ColorSpace", "coords", "getAll", "setAll", "xyz_d50_default", "ColorSpace", "xyz_d65_default", "coords", "adapt", "\u03B5", "\u03B53", "\u03BA", "white", "WHITES", "lab_default", "ColorSpace", "xyz_d50_default", "XYZ", "f", "value", "i", "Lab", "constrain", "angle", "lch_default", "ColorSpace", "lab_default", "Lab", "L", "a", "b", "hue", "\u03B5", "constrain", "LCH", "Lightness", "Chroma", "Hue", "Gfactor", "\u03C0", "r2d", "d2r", "pow7", "x", "x2", "deltaE2000_default", "color", "sample", "kL", "kC", "kH", "getColor", "L1", "a1", "b1", "lab_default", "C1", "lch_default", "L2", "a2", "b2", "C2", "Cbar", "C7", "G", "adash1", "adash2", "Cdash1", "Cdash2", "h1", "h2", "\u0394L", "\u0394C", "hdiff", "hsum", "habs", "\u0394h", "defaults_default", "\u0394H", "Ldash", "Cdash", "Cdash7", "hdash", "lsq", "SL", "SC", "T", "SH", "\u0394\u03B8", "RC", "RT", "dE", "XYZtoLMS_M", "LMStoXYZ_M", "LMStoLab_M", "LabtoLMS_M", "oklab_default", "ColorSpace", "xyz_d65_default", "XYZ", "LMSg", "multiplyMatrices", "val", "OKLab", "LMS", "deltaEOK_default", "color", "sample", "getColor", "L1", "a1", "b1", "oklab_default", "L2", "a2", "b2", "\u0394L", "\u0394a", "\u0394b", "\u03B5", "inGamut", "color", "space", "epsilon", "getColor", "ColorSpace", "coords", "clone", "color", "distance", "color1", "color2", "space", "ColorSpace", "coords1", "coords2", "acc", "c1", "i", "c2", "deltaE76", "color", "sample", "distance", "\u03C0", "d2r", "deltaECMC_default", "color", "sample", "l", "c", "getColor", "L1", "a1", "b1", "lab_default", "C1", "H1", "lch_default", "L2", "a2", "b2", "C2", "\u0394L", "\u0394C", "\u0394a", "\u0394b", "H2", "SL", "SC", "T", "C4", "F", "SH", "dE", "Yw", "xyz_abs_d65_default", "ColorSpace", "xyz_d65_default", "XYZ", "v", "AbsXYZ", "b", "g", "n", "ninv", "c1", "c2", "c3", "p", "pinv", "d", "d0", "XYZtoCone_M", "ConetoXYZ_M", "ConetoIab_M", "IabtoCone_M", "jzazbz_default", "ColorSpace", "xyz_abs_d65_default", "XYZ", "Xa", "Ya", "Za", "Xm", "Ym", "PQLMS", "multiplyMatrices", "val", "num", "denom", "Iz", "az", "bz", "Jzazbz", "Jz", "LMS", "jzczhz_default", "ColorSpace", "jzazbz_default", "jzazbz", "Jz", "az", "bz", "hue", "\u03B5", "constrain", "jzczhz", "deltaEJz_default", "color", "sample", "getColor", "Jz1", "Cz1", "Hz1", "jzczhz_default", "Jz2", "Cz2", "Hz2", "\u0394J", "\u0394C", "\u0394h", "\u0394H", "c1", "c2", "c3", "m1", "m2", "im1", "im2", "XYZtoLMS_M", "LMStoIPT_M", "IPTtoLMS_M", "LMStoXYZ_M", "ictcp_default", "ColorSpace", "xyz_abs_d65_default", "XYZ", "LMS", "multiplyMatrices", "LMStoICtCp", "ICtCp", "ICtCptoLMS", "PQLMS", "val", "num", "denom", "deltaEITP_default", "color", "sample", "getColor", "I1", "T1", "P1", "ictcp_default", "I2", "T2", "P2", "white", "WHITES", "adaptedCoef", "adaptedCoefInv", "tau", "cat16", "cat16Inv", "m1", "surroundMap", "hueQuadMap", "rad2deg", "deg2rad", "adapt", "coords", "fl", "c", "x", "spow", "copySign", "unadapt", "adapted", "constant", "cabs", "hueQuadrature", "h", "hp", "constrain", "i", "bisectLeft", "hi", "hii", "ei", "eii", "Hi", "t", "invHueQuadrature", "H", "Hp", "environment", "refWhite", "adaptingLuminance", "backgroundLuminance", "surround", "discounting", "env", "xyzW", "yw", "rgbW", "multiplyMatrices", "f", "k4", "interpolate", "rgbCW", "rgbAW", "viewingConditions", "fromCam16", "cam16", "hRad", "cosh", "sinh", "Jroot", "alpha", "et", "A", "p1", "p2", "r", "zdiv", "a", "b", "rgb_c", "toCam16", "xyzd65", "xyz100", "rgbA", "J", "Q", "C", "M", "s", "cam16_default", "ColorSpace", "xyz_d65_default", "xyz", "white", "WHITES", "\u03B5", "\u03BA", "toLstar", "y", "fromLstar", "lstar", "fromHct", "coords", "env", "h", "c", "t", "xyz", "j", "threshold", "max_attempts", "attempt", "last", "best", "fromCam16", "delta", "toHct", "cam16", "toCam16", "viewingConditions", "constrain", "environment", "hct_default", "ColorSpace", "xyz_d65_default", "hct", "rad2deg", "deg2rad", "ucsCoeff", "convertUcsAb", "coords", "hct_default", "M", "viewingConditions", "hrad", "a", "b", "deltaEHCT_default", "color", "sample", "getColor", "t1", "a1", "b1", "t2", "a2", "b2", "deltaE_default", "deltaE76", "deltaECMC_default", "deltaE2000_default", "deltaEJz_default", "deltaEITP_default", "deltaEOK_default", "deltaEHCT_default", "calcEpsilon", "jnd", "order", "GMAPPRESET", "toGamut", "color", "method", "defaults_default", "space", "deltaEMethod", "blackWhiteClamp", "getColor", "isString", "ColorSpace", "inGamut", "spaceColor", "toGamutCSS", "de", "deltaE2000_default", "m", "deltaE_default", "clipped", "to", "channelMeta", "channel", "get", "isNone", "WHITES", "coordMeta", "mapSpace", "coordId", "mappedColor", "c", "i", "min", "\u03B5", "low", "high", "clone", "set", "bounds", "max", "COLORS", "oklab_default", "origin", "oklchSpace", "origin_OKLCH", "L", "white", "black", "clip", "_color", "destColor", "spaceCoords", "coord", "index", "clamp", "min_inGamut", "current", "E", "deltaEOK_default", "chroma", "to", "color", "space", "inGamut", "getColor", "ColorSpace", "coords", "ret", "toGamut", "serialize", "color", "precision", "defaults_default", "format", "inGamut", "customOptions", "ret", "getColor", "formatId", "ColorSpace", "coords", "toGamut", "clone", "name", "c", "serializeNumber", "args", "cssId", "alpha", "strAlpha", "toXYZ_M", "fromXYZ_M", "srgb_linear_default", "RGBColorSpace", "keywords_default", "coordGrammar", "coordGrammarNumber", "srgb_default", "RGBColorSpace", "srgb_linear_default", "rgb", "val", "sign", "abs", "str", "rgba", "component", "coords", "alpha", "collapse", "c", "collapsible", "ret", "keywords_default", "hsl_default", "ColorSpace", "srgb_default", "rgb", "max", "min", "r", "g", "b", "h", "d", "hsl", "s", "l", "f", "n", "k", "a", "oklch_default", "ColorSpace", "oklab_default", "oklab", "L", "a", "b", "h", "\u03B5", "constrain", "oklch", "C", "ColorSpace", "srgb_default", "oklch_default", "hsl_default", "setStateFromValue", "value", "mode", "precision", "hex", "color", "parse", "lightness", "getLightness", "convertOKLCHFromValue", "onHexChange", "rgb", "to", "serialize", "convertToOkLchCoords", "setLightness", "hsl", "setLuminance", "oklch", "luminance", "coords", "anglePrecision", "round", "factor", "import_react", "styleq$1", "styleq_2", "cache", "compiledKey", "createStyleq", "options", "disableCache", "disableMix", "transform", "definedProperties", "className", "inlineStyle", "nextCache", "styles", "i", "possibleStyle", "_i", "style", "classNameChunk", "cacheEntry", "definedPropertiesChunk", "prop", "value", "weakMap", "subStyle", "_prop", "_value", "styleProps", "styleq", "errorForFn", "name", "errorForType", "key", "props", "_len", "_key", "__implementations", "result", "attrs", "stylexCreate", "create", "stylexDefineVars", "stylexCreateTheme", "baseTokens", "overrides", "stylexInclude", "defineVars", "createTheme", "include", "types", "_v", "keyframes", "firstThatWorks", "_stylex", "_len2", "_key2", "colors", "transitions", "styles", "OptionPreview", "option", "onClick", "isHighlighted", "onMouseEnter", "label", "capitalizeFirstLetter", "React", "props", "string", "import_react", "styles", "RangeSlider", "value", "onChange", "label", "disabled", "id", "number", "setNumber", "min", "max", "handleChange", "event", "numLength", "minWidthInput", "React", "props", "import_react", "useEventCallback", "handler", "callbackRef", "useRef", "fn", "value", "current", "clamp", "number", "min", "max", "isTouch", "event", "getParentWindow", "node", "ownerDocument", "defaultView", "self", "getRelativePosition", "touchId", "rect", "getBoundingClientRect", "pointer", "touches", "i", "length", "identifier", "left", "pageX", "pageXOffset", "width", "top", "pageY", "pageYOffset", "height", "preventDefaultMove", "preventDefault", "Interactive", "React", "memo", "o", "onMove", "onKey", "rest", "container", "onMoveCallback", "onKeyCallback", "hasTouch", "x", "useMemo", "handleMove", "buttons", "toggleDocumentEvents", "handleMoveEnd", "state", "touch", "parentWindow", "toggleEvent", "addEventListener", "removeEventListener", "e", "nativeEvent", "el", "changedTouches", "focus", "keyCode", "which", "handleMoveStart", "handleKeyDown", "useEffect", "onTouchStart", "onMouseDown", "className", "ref", "onKeyDown", "tabIndex", "role", "formatClassName", "names", "filter", "Boolean", "join", "Pointer", "r", "color", "nodeClassName", "style", "backgroundColor", "round", "digits", "base", "Math", "pow", "angleUnits", "grad", "turn", "rad", "PI", "hexToHsva", "hex", "rgbaToHsva", "hexToRgba", "substring", "parseInt", "g", "b", "a", "current", "hsvaToHex", "hsva", "rgbaToHex", "hsvaToRgba", "hsvaToHsla", "s", "v", "a", "hh", "h", "round", "l", "hsvaToHslString", "r", "current", "hsvaToRgba", "h", "s", "v", "a", "hh", "Math", "floor", "b", "c", "d", "module", "r", "round", "g", "current", "format", "number", "hex", "toString", "length", "rgbaToHex", "r", "g", "b", "a", "alphaHex", "round", "rgbaToHsva", "max", "Math", "delta", "min", "hh", "h", "s", "v", "current", "Hue", "React", "memo", "r", "hue", "onChange", "nodeClassName", "formatClassName", "className", "Interactive", "onMove", "interaction", "h", "left", "onKey", "offset", "clamp", "aria-label", "aria-valuenow", "round", "aria-valuemax", "aria-valuemin", "Pointer", "color", "hsvaToHslString", "s", "v", "a", "Saturation", "hsva", "containerStyle", "backgroundColor", "style", "top", "aria-valuetext", "equalColorObjects", "first", "second", "prop", "current", "equalHex", "first", "second", "toLowerCase", "equalColorObjects", "hexToRgba", "useColorManipulation", "colorModel", "color", "onChange", "onChangeCallback", "useEventCallback", "useState", "toHsva", "hsva", "updateHsva", "cache", "useRef", "useEffect", "equal", "newHsva", "newColor", "fromHsva", "handleChange", "useCallback", "params", "Object", "assign", "nonce", "useIsomorphicLayoutEffect", "window", "useLayoutEffect", "getNonce", "__webpack_nonce__", "handleChange", "styleElementMap", "Map", "useStyleSheet", "nodeRef", "useIsomorphicLayoutEffect", "parentDocument", "current", "ownerDocument", "document", "has", "styleElement", "createElement", "innerHTML", "set", "nonce", "getNonce", "setAttribute", "head", "appendChild", "ColorPicker", "t", "className", "colorModel", "color", "defaultColor", "onChange", "rest", "useRef", "useColorManipulation", "hsva", "updateHsva", "nodeClassName", "formatClassName", "React", "ref", "Saturation", "Hue", "hue", "h", "toHsva", "hexToHsva", "fromHsva", "hsvaToHex", "s", "v", "a", "equal", "equalHex", "HexColorPicker", "props", "handleChange", "matcher", "ColorInput", "props", "color", "onChange", "onBlur", "escape", "validate", "format", "process", "rest", "useState", "value", "setValue", "onChangeCallback", "useEventCallback", "onBlurCallback", "useCallback", "e", "inputValue", "target", "handleBlur", "useEffect", "React", "spellCheck", "prefix", "HexColorInput", "prefixed", "alpha", "replace", "substring", "match", "exec", "length", "import_react_ui_components", "styles", "color", "colors", "Panel", "allowEmpty", "precision", "presets", "showHexInput", "showLightness", "showLuminance", "showPicker", "showPresets", "i18nRegistry", "highlight", "state", "setState", "id", "onFocus", "collapsed", "handleHexChange", "hex", "onHexChange", "handleLightnessChange", "lightness", "setLightness", "handleLuminanceChange", "luminance", "setLuminance", "presetOptions", "key", "preset", "React", "Z", "props", "RangeSlider", "Oe", "OptionPreview", "Components_default", "Panel", "import_react_ui_components", "import_neos_ui_redux_store", "import_react", "HexOutput", "hex", "React", "import_react", "import_react", "Circle", "style", "className", "size", "React", "attribute", "values", "Dots", "number", "cx", "beginn", "import_neos_ui_decorators", "styles", "heightMultiplier", "val", "active", "Loading", "id", "title", "isLoading", "delayTime", "timeoutTime", "i18nRegistry", "showLoading", "setShowLoading", "translatedTitle", "delay", "timeout", "React", "props", "Circle", "Dots", "neosifier", "globalRegistry", "LoadingWithStyleX_default", "getDataLoaderOptionsForProps", "props", "ColorName", "defaultOptions", "styles", "color", "luminance", "contrastThreshold", "colors", "open", "transitions", "Editor", "mergedOptions", "value", "commit", "highlight", "i18nRegistry", "id", "dataSourcesDataLoader", "renderHelpIcon", "label", "mode", "precision", "dataSourceIdentifier", "dataSourceUri", "dataSourceAdditionalData", "React", "hasDataSource", "options", "setOptions", "isLoading", "setIsLoading", "setOpen", "state", "setState", "setStateFromValue", "dataSourceOptionsAsJSON", "setDataSourceOptionsAsJSON", "dataAsJSON", "values", "customProperty", "enableCollapsed", "LoadingWithStyleX_default", "HexOutput", "event", "Components_default", "neosifier", "globalRegistry", "connector", "ColorPicker_default", "dist_default", "globalRegistry", "ColorPicker_default"] } diff --git a/package.json b/package.json index 658d1c6..ce1b6ae 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "@stylexjs/stylex": "^0.8.0", "@types/nearest-color": "^0.4.1", "@types/react-redux": "^7.1.34", - "carbon-neos-loadinganimation": "^1.1.0", + "carbon-neos-loadinganimation": "^1.1.1", "color-name-list": "^10.28.0", "colorjs.io": "^0.5.2", "esbuild": "^0.24.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 528aeb0..f3cbfb3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -27,8 +27,8 @@ importers: specifier: ^7.1.34 version: 7.1.34 carbon-neos-loadinganimation: - specifier: ^1.1.0 - version: 1.1.0(@neos-project/neos-ui-extensibility@8.3.11) + specifier: ^1.1.1 + version: 1.1.1(@neos-project/neos-ui-extensibility@8.3.11) color-name-list: specifier: ^10.28.0 version: 10.28.0 @@ -746,8 +746,8 @@ packages: caniuse-lite@1.0.30001669: resolution: {integrity: sha512-DlWzFDJqstqtIVx1zeSpIMLjunf5SmwOw0N2Ck/QSQdS8PLS4+9HrLaYei4w8BIAL7IB/UEDu889d8vhCTPA0w==} - carbon-neos-loadinganimation@1.1.0: - resolution: {integrity: sha512-4fSv/Sy7uFLfksQTtq99CM1yy1yIcQTZ1e4OE5yQL65iJfPCiGwsVgeoBQCGlpM+LZQ347xEX6jaBHAzjJuzNA==} + carbon-neos-loadinganimation@1.1.1: + resolution: {integrity: sha512-x0xjMyMdYEEZxe+Qn2Q077PPdr7SAuJ6b7B7mTT/550KZPaHCIKdPHNnWt9O20/811cPGv+tU4wSXCaDvExJVw==} peerDependencies: '@neos-project/neos-ui-extensibility': ^8.3.0 || ^9.0.0 @@ -2061,7 +2061,7 @@ snapshots: caniuse-lite@1.0.30001669: {} - carbon-neos-loadinganimation@1.1.0(@neos-project/neos-ui-extensibility@8.3.11): + carbon-neos-loadinganimation@1.1.1(@neos-project/neos-ui-extensibility@8.3.11): dependencies: '@neos-project/neos-ui-extensibility': 8.3.11