"use strict";/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function O(t){return t<0?-1:t===0?0:1}function K(t,e,r){return(1-r)*t+r*e}function Ft(t,e,r){return re?e:r}function tt(t,e,r){return re?e:r}function it(t){return t=t%360,t<0&&(t=t+360),t}function It(t,e){return it(e-t)<=180?1:-1}function wt(t,e){return 180-Math.abs(Math.abs(t-e)-180)}function ot(t,e){const r=t[0]*e[0][0]+t[1]*e[0][1]+t[2]*e[0][2],a=t[0]*e[1][0]+t[1]*e[1][1]+t[2]*e[1][2],n=t[0]*e[2][0]+t[1]*e[2][1]+t[2]*e[2][2];return[r,a,n]}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Tt=[[.41233895,.35762064,.18051042],[.2126,.7152,.0722],[.01932141,.11916382,.95034478]],Ct=[[3.2413774792388685,-1.5376652402851851,-.49885366846268053],[-.9691452513005321,1.8758853451067872,.04156585616912061],[.05562093689691305,-.20395524564742123,1.0571799111220335]],At=[95.047,100,108.883];function ut(t,e,r){return(255<<24|(t&255)<<16|(e&255)<<8|r&255)>>>0}function mt(t){const e=J(t[0]),r=J(t[1]),a=J(t[2]);return ut(e,r,a)}function gt(t){return t>>16&255}function pt(t){return t>>8&255}function bt(t){return t&255}function Bt(t,e,r){const a=Ct,n=a[0][0]*t+a[0][1]*e+a[0][2]*r,s=a[1][0]*t+a[1][1]*e+a[1][2]*r,c=a[2][0]*t+a[2][1]*e+a[2][2]*r,i=J(n),l=J(s),f=J(c);return ut(i,l,f)}function Lt(t){const e=X(gt(t)),r=X(pt(t)),a=X(bt(t));return ot([e,r,a],Tt)}function Rt(t){const e=G(t),r=J(e);return ut(r,r,r)}function st(t){const e=Lt(t)[1];return 116*Pt(e/100)-16}function G(t){return 100*Ot((t+16)/116)}function ct(t){return Pt(t/100)*116-16}function X(t){const e=t/255;return e<=.040449936?e/12.92*100:Math.pow((e+.055)/1.055,2.4)*100}function J(t){const e=t/100;let r=0;return e<=.0031308?r=e*12.92:r=1.055*Math.pow(e,1/2.4)-.055,Ft(0,255,Math.round(r*255))}function xt(){return At}function Pt(t){const e=.008856451679035631,r=24389/27;return t>e?Math.pow(t,1/3):(r*t+16)/116}function Ot(t){const e=.008856451679035631,r=24389/27,a=t*t*t;return a>e?a:(116*t-16)/r}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class S{static make(e=xt(),r=200/Math.PI*G(50)/100,a=50,n=2,s=!1){const c=e,i=c[0]*.401288+c[1]*.650173+c[2]*-.051461,l=c[0]*-.250268+c[1]*1.204414+c[2]*.045854,f=c[0]*-.002079+c[1]*.048952+c[2]*.953127,h=.8+n/10,g=h>=.9?K(.59,.69,(h-.9)*10):K(.525,.59,(h-.8)*10);let p=s?1:h*(1-1/3.6*Math.exp((-r-42)/92));p=p>1?1:p<0?0:p;const y=h,k=[p*(100/i)+1-p,p*(100/l)+1-p,p*(100/f)+1-p],b=1/(5*r+1),D=b*b*b*b,C=1-D,I=D*r+.1*C*C*Math.cbrt(5*r),M=G(a)/e[1],x=1.48+Math.sqrt(M),P=.725/Math.pow(M,.2),B=P,F=[Math.pow(I*k[0]*i/100,.42),Math.pow(I*k[1]*l/100,.42),Math.pow(I*k[2]*f/100,.42)],A=[400*F[0]/(F[0]+27.13),400*F[1]/(F[1]+27.13),400*F[2]/(F[2]+27.13)],R=(2*A[0]+A[1]+.05*A[2])*P;return new S(M,R,P,B,g,y,k,I,Math.pow(I,.25),x)}constructor(e,r,a,n,s,c,i,l,f,h){this.n=e,this.aw=r,this.nbb=a,this.ncb=n,this.c=s,this.nc=c,this.rgbD=i,this.fl=l,this.fLRoot=f,this.z=h}}S.DEFAULT=S.make();/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class _{constructor(e,r,a,n,s,c,i,l,f){this.hue=e,this.chroma=r,this.j=a,this.q=n,this.m=s,this.s=c,this.jstar=i,this.astar=l,this.bstar=f}distance(e){const r=this.jstar-e.jstar,a=this.astar-e.astar,n=this.bstar-e.bstar,s=Math.sqrt(r*r+a*a+n*n);return 1.41*Math.pow(s,.63)}static fromInt(e){return _.fromIntInViewingConditions(e,S.DEFAULT)}static fromIntInViewingConditions(e,r){const a=(e&16711680)>>16,n=(e&65280)>>8,s=e&255,c=X(a),i=X(n),l=X(s),f=.41233895*c+.35762064*i+.18051042*l,h=.2126*c+.7152*i+.0722*l,g=.01932141*c+.11916382*i+.95034478*l,p=.401288*f+.650173*h-.051461*g,y=-.250268*f+1.204414*h+.045854*g,k=-.002079*f+.048952*h+.953127*g,b=r.rgbD[0]*p,D=r.rgbD[1]*y,C=r.rgbD[2]*k,I=Math.pow(r.fl*Math.abs(b)/100,.42),M=Math.pow(r.fl*Math.abs(D)/100,.42),x=Math.pow(r.fl*Math.abs(C)/100,.42),P=O(b)*400*I/(I+27.13),B=O(D)*400*M/(M+27.13),F=O(C)*400*x/(x+27.13),A=(11*P+-12*B+F)/11,R=(P+B-2*F)/9,T=(20*P+20*B+21*F)/20,q=(40*P+20*B+F)/20,z=Math.atan2(R,A)*180/Math.PI,N=z<0?z+360:z>=360?z-360:z,Z=N*Math.PI/180,Q=q*r.nbb,V=100*Math.pow(Q/r.aw,r.c*r.z),H=4/r.c*Math.sqrt(V/100)*(r.aw+4)*r.fLRoot,et=N<20.14?N+360:N,rt=.25*(Math.cos(et*Math.PI/180+2)+3.8),nt=5e4/13*rt*r.nc*r.ncb*Math.sqrt(A*A+R*R)/(T+.305),v=Math.pow(nt,.9)*Math.pow(1.64-Math.pow(.29,r.n),.73),ht=v*Math.sqrt(V/100),ft=ht*r.fLRoot,kt=50*Math.sqrt(v*r.c/(r.aw+4)),Mt=(1+100*.007)*V/(1+.007*V),dt=1/.0228*Math.log(1+.0228*ft),yt=dt*Math.cos(Z),Dt=dt*Math.sin(Z);return new _(N,ht,V,H,ft,kt,Mt,yt,Dt)}static fromJch(e,r,a){return _.fromJchInViewingConditions(e,r,a,S.DEFAULT)}static fromJchInViewingConditions(e,r,a,n){const s=4/n.c*Math.sqrt(e/100)*(n.aw+4)*n.fLRoot,c=r*n.fLRoot,i=r/Math.sqrt(e/100),l=50*Math.sqrt(i*n.c/(n.aw+4)),f=a*Math.PI/180,h=(1+100*.007)*e/(1+.007*e),g=1/.0228*Math.log(1+.0228*c),p=g*Math.cos(f),y=g*Math.sin(f);return new _(a,r,e,s,c,l,h,p,y)}static fromUcs(e,r,a){return _.fromUcsInViewingConditions(e,r,a,S.DEFAULT)}static fromUcsInViewingConditions(e,r,a,n){const s=r,c=a,i=Math.sqrt(s*s+c*c),f=(Math.exp(i*.0228)-1)/.0228/n.fLRoot;let h=Math.atan2(c,s)*(180/Math.PI);h<0&&(h+=360);const g=e/(1-(e-100)*.007);return _.fromJchInViewingConditions(g,f,h,n)}toInt(){return this.viewed(S.DEFAULT)}viewed(e){const r=this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100),a=Math.pow(r/Math.pow(1.64-Math.pow(.29,e.n),.73),1/.9),n=this.hue*Math.PI/180,s=.25*(Math.cos(n+2)+3.8),c=e.aw*Math.pow(this.j/100,1/e.c/e.z),i=s*(5e4/13)*e.nc*e.ncb,l=c/e.nbb,f=Math.sin(n),h=Math.cos(n),g=23*(l+.305)*a/(23*i+11*a*h+108*a*f),p=g*h,y=g*f,k=(460*l+451*p+288*y)/1403,b=(460*l-891*p-261*y)/1403,D=(460*l-220*p-6300*y)/1403,C=Math.max(0,27.13*Math.abs(k)/(400-Math.abs(k))),I=O(k)*(100/e.fl)*Math.pow(C,1/.42),M=Math.max(0,27.13*Math.abs(b)/(400-Math.abs(b))),x=O(b)*(100/e.fl)*Math.pow(M,1/.42),P=Math.max(0,27.13*Math.abs(D)/(400-Math.abs(D))),B=O(D)*(100/e.fl)*Math.pow(P,1/.42),F=I/e.rgbD[0],A=x/e.rgbD[1],R=B/e.rgbD[2],T=1.86206786*F-1.01125463*A+.14918677*R,q=.38752654*F+.62144744*A-.00897398*R,Y=-.0158415*F-.03412294*A+1.04996444*R;return Bt(T,q,Y)}static fromXyzInViewingConditions(e,r,a,n){const s=.401288*e+.650173*r-.051461*a,c=-.250268*e+1.204414*r+.045854*a,i=-.002079*e+.048952*r+.953127*a,l=n.rgbD[0]*s,f=n.rgbD[1]*c,h=n.rgbD[2]*i,g=Math.pow(n.fl*Math.abs(l)/100,.42),p=Math.pow(n.fl*Math.abs(f)/100,.42),y=Math.pow(n.fl*Math.abs(h)/100,.42),k=O(l)*400*g/(g+27.13),b=O(f)*400*p/(p+27.13),D=O(h)*400*y/(y+27.13),C=(11*k+-12*b+D)/11,I=(k+b-2*D)/9,M=(20*k+20*b+21*D)/20,x=(40*k+20*b+D)/20,B=Math.atan2(I,C)*180/Math.PI,F=B<0?B+360:B>=360?B-360:B,A=F*Math.PI/180,R=x*n.nbb,T=100*Math.pow(R/n.aw,n.c*n.z),q=4/n.c*Math.sqrt(T/100)*(n.aw+4)*n.fLRoot,Y=F<20.14?F+360:F,z=1/4*(Math.cos(Y*Math.PI/180+2)+3.8),Z=5e4/13*z*n.nc*n.ncb*Math.sqrt(C*C+I*I)/(M+.305),Q=Math.pow(Z,.9)*Math.pow(1.64-Math.pow(.29,n.n),.73),V=Q*Math.sqrt(T/100),H=V*n.fLRoot,et=50*Math.sqrt(Q*n.c/(n.aw+4)),rt=(1+100*.007)*T/(1+.007*T),at=Math.log(1+.0228*H)/.0228,nt=at*Math.cos(A),v=at*Math.sin(A);return new _(F,V,T,q,H,et,rt,nt,v)}xyzInViewingConditions(e){const r=this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100),a=Math.pow(r/Math.pow(1.64-Math.pow(.29,e.n),.73),1/.9),n=this.hue*Math.PI/180,s=.25*(Math.cos(n+2)+3.8),c=e.aw*Math.pow(this.j/100,1/e.c/e.z),i=s*(5e4/13)*e.nc*e.ncb,l=c/e.nbb,f=Math.sin(n),h=Math.cos(n),g=23*(l+.305)*a/(23*i+11*a*h+108*a*f),p=g*h,y=g*f,k=(460*l+451*p+288*y)/1403,b=(460*l-891*p-261*y)/1403,D=(460*l-220*p-6300*y)/1403,C=Math.max(0,27.13*Math.abs(k)/(400-Math.abs(k))),I=O(k)*(100/e.fl)*Math.pow(C,1/.42),M=Math.max(0,27.13*Math.abs(b)/(400-Math.abs(b))),x=O(b)*(100/e.fl)*Math.pow(M,1/.42),P=Math.max(0,27.13*Math.abs(D)/(400-Math.abs(D))),B=O(D)*(100/e.fl)*Math.pow(P,1/.42),F=I/e.rgbD[0],A=x/e.rgbD[1],R=B/e.rgbD[2],T=1.86206786*F-1.01125463*A+.14918677*R,q=.38752654*F+.62144744*A-.00897398*R,Y=-.0158415*F-.03412294*A+1.04996444*R;return[T,q,Y]}}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class d{static sanitizeRadians(e){return(e+Math.PI*8)%(Math.PI*2)}static trueDelinearized(e){const r=e/100;let a=0;return r<=.0031308?a=r*12.92:a=1.055*Math.pow(r,1/2.4)-.055,a*255}static chromaticAdaptation(e){const r=Math.pow(Math.abs(e),.42);return O(e)*400*r/(r+27.13)}static hueOf(e){const r=ot(e,d.SCALED_DISCOUNT_FROM_LINRGB),a=d.chromaticAdaptation(r[0]),n=d.chromaticAdaptation(r[1]),s=d.chromaticAdaptation(r[2]),c=(11*a+-12*n+s)/11,i=(a+n-2*s)/9;return Math.atan2(i,c)}static areInCyclicOrder(e,r,a){const n=d.sanitizeRadians(r-e),s=d.sanitizeRadians(a-e);return n100.01||T[1]>100.01||T[2]>100.01?0:mt(T);n=n-(N-a)*n/(2*N)}return 0}static solveToInt(e,r,a){if(r<1e-4||a<1e-4||a>99.9999)return Rt(a);e=it(e);const n=e/180*Math.PI,s=G(a),c=d.findResultByJ(n,r,s);if(c!==0)return c;const i=d.bisectToLimit(s,n);return mt(i)}static solveToCam(e,r,a){return _.fromInt(d.solveToInt(e,r,a))}}d.SCALED_DISCOUNT_FROM_LINRGB=[[.001200833568784504,.002389694492170889,.0002795742885861124],[.0005891086651375999,.0029785502573438758,.0003270666104008398],[.00010146692491640572,.0005364214359186694,.0032979401770712076]];d.LINRGB_FROM_SCALED_DISCOUNT=[[1373.2198709594231,-1100.4251190754821,-7.278681089101213],[-271.815969077903,559.6580465940733,-32.46047482791194],[1.9622899599665666,-57.173814538844006,308.7233197812385]];d.Y_FROM_LINRGB=[.2126,.7152,.0722];d.CRITICAL_PLANES=[.015176349177441876,.045529047532325624,.07588174588720938,.10623444424209313,.13658714259697685,.16693984095186062,.19729253930674434,.2276452376616281,.2579979360165119,.28835063437139563,.3188300904430532,.350925934958123,.3848314933096426,.42057480301049466,.458183274052838,.4976837250274023,.5391024159806381,.5824650784040898,.6277969426914107,.6751227633498623,.7244668422128921,.775853049866786,.829304845476233,.8848452951698498,.942497089126609,1.0022825574869039,1.0642236851973577,1.1283421258858297,1.1946592148522128,1.2631959812511864,1.3339731595349034,1.407011200216447,1.4823302800086415,1.5599503113873272,1.6398909516233677,1.7221716113234105,1.8068114625156377,1.8938294463134073,1.9832442801866852,2.075074464868551,2.1693382909216234,2.2660538449872063,2.36523901573795,2.4669114995532007,2.5710888059345764,2.6777882626779785,2.7870270208169257,2.898822059350997,3.0131901897720907,3.1301480604002863,3.2497121605402226,3.3718988244681087,3.4967242352587946,3.624204428461639,3.754355295633311,3.887192587735158,4.022731918402185,4.160988767090289,4.301978482107941,4.445716283538092,4.592217266055746,4.741496401646282,4.893568542229298,5.048448422192488,5.20615066083972,5.3666897647573375,5.5300801301023865,5.696336044816294,5.865471690767354,6.037501145825082,6.212438385869475,6.390297286737924,6.571091626112461,6.7548350853498045,6.941541251256611,7.131223617812143,7.323895587840543,7.5195704746346665,7.7182615035334345,7.919981813454504,8.124744458384042,8.332562408825165,8.543448553206703,8.757415699253682,8.974476575321063,9.194643831691977,9.417930041841839,9.644347703669503,9.873909240696694,10.106627003236781,10.342513269534024,10.58158024687427,10.8238400726681,11.069304815507364,11.317986476196008,11.569896988756009,11.825048221409341,12.083451977536606,12.345119996613247,12.610063955123938,12.878295467455942,13.149826086772048,13.42466730586372,13.702830557985108,13.984327217668513,14.269168601521828,14.55736596900856,14.848930523210871,15.143873411576273,15.44220572664832,15.743938506781891,16.04908273684337,16.35764934889634,16.66964922287304,16.985093187232053,17.30399201960269,17.62635644741625,17.95219714852476,18.281524751807332,18.614349837764564,18.95068293910138,19.290534541298456,19.633915083172692,19.98083495742689,20.331304511189067,20.685334046541502,21.042933821039977,21.404114048223256,21.76888489811322,22.137256497705877,22.50923893145328,22.884842241736916,23.264076429332462,23.6469514538663,24.033477234264016,24.42366364919083,24.817520537484558,25.21505769858089,25.61628489293138,26.021211842414342,26.429848230738664,26.842203703840827,27.258287870275353,27.678110301598522,28.10168053274597,28.529008062403893,28.96010235337422,29.39497283293396,29.83362889318845,30.276079891419332,30.722335150426627,31.172403958865512,31.62629557157785,32.08401920991837,32.54558406207592,33.010999283389665,33.4802739966603,33.953417292456834,34.430438229418264,34.911345834551085,35.39614910352207,35.88485700094671,36.37747846067349,36.87402238606382,37.37449765026789,37.87891309649659,38.38727753828926,38.89959975977785,39.41588851594697,39.93615253289054,40.460400508064545,40.98864111053629,41.520882981230194,42.05713473317016,42.597404951718396,43.141702194811224,43.6900349931913,44.24241185063697,44.798841244188324,45.35933162437017,45.92389141541209,46.49252901546552,47.065252796817916,47.64207110610409,48.22299226451468,48.808024568002054,49.3971762874833,49.9904556690408,50.587870934119984,51.189430279724725,51.79514187861014,52.40501387947288,53.0190544071392,53.637271562750364,54.259673423945976,54.88626804504493,55.517063457223934,56.15206766869424,56.79128866487574,57.43473440856916,58.08241284012621,58.734331877617365,59.39049941699807,60.05092333227251,60.715611475655585,61.38457167773311,62.057811747619894,62.7353394731159,63.417162620860914,64.10328893648692,64.79372614476921,65.48848194977529,66.18756403501224,66.89098006357258,67.59873767827808,68.31084450182222,69.02730813691093,69.74813616640164,70.47333615344107,71.20291564160104,71.93688215501312,72.67524319850172,73.41800625771542,74.16517879925733,74.9167682708136,75.67278210128072,76.43322770089146,77.1981124613393,77.96744375590167,78.74122893956174,79.51947534912904,80.30219030335869,81.08938110306934,81.88105503125999,82.67721935322541,83.4778813166706,84.28304815182372,85.09272707154808,85.90692527145302,86.72564993000343,87.54890820862819,88.3767072518277,89.2090541872801,90.04595612594655,90.88742016217518,91.73345337380438,92.58406282226491,93.43925555268066,94.29903859396902,95.16341895893969,96.03240364439274,96.9059996312159,97.78421388448044,98.6670533535366,99.55452497210776];/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class j{static from(e,r,a){return new j(d.solveToInt(e,r,a))}static fromInt(e){return new j(e)}toInt(){return this.argb}get hue(){return this.internalHue}set hue(e){this.setInternalState(d.solveToInt(e,this.internalChroma,this.internalTone))}get chroma(){return this.internalChroma}set chroma(e){this.setInternalState(d.solveToInt(this.internalHue,e,this.internalTone))}get tone(){return this.internalTone}set tone(e){this.setInternalState(d.solveToInt(this.internalHue,this.internalChroma,e))}constructor(e){this.argb=e;const r=_.fromInt(e);this.internalHue=r.hue,this.internalChroma=r.chroma,this.internalTone=st(e),this.argb=e}setInternalState(e){const r=_.fromInt(e);this.internalHue=r.hue,this.internalChroma=r.chroma,this.internalTone=st(e),this.argb=e}inViewingConditions(e){const a=_.fromInt(this.toInt()).xyzInViewingConditions(e),n=_.fromXyzInViewingConditions(a[0],a[1],a[2],S.make());return j.from(n.hue,n.chroma,ct(a[1]))}}/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class L{static ratioOfTones(e,r){return e=tt(0,100,e),r=tt(0,100,r),L.ratioOfYs(G(e),G(r))}static ratioOfYs(e,r){const a=e>r?e:r,n=a===r?e:r;return(a+5)/(n+5)}static lighter(e,r){if(e<0||e>100)return-1;const a=G(e),n=r*(a+5)-5,s=L.ratioOfYs(n,a),c=Math.abs(s-r);if(s.04)return-1;const i=ct(n)+.4;return i<0||i>100?-1:i}static darker(e,r){if(e<0||e>100)return-1;const a=G(e),n=(a+5)/r-5,s=L.ratioOfYs(a,n),c=Math.abs(s-r);if(s.04)return-1;const i=ct(n)-.4;return i<0||i>100?-1:i}static lighterUnsafe(e,r){const a=L.lighter(e,r);return a<0?100:a}static darkerUnsafe(e,r){const a=L.darker(e,r);return a<0?0:a}}/** * @license * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class lt{static isDisliked(e){const r=Math.round(e.hue)>=90&&Math.round(e.hue)<=111,a=Math.round(e.chroma)>16,n=Math.round(e.tone)<65;return r&&a&&n}static fixIfDisliked(e){return lt.isDisliked(e)?j.from(e.hue,e.chroma,70):e}}/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class u{static fromPalette(e){return new u(e.name??"",e.palette,e.tone,e.isBackground??!1,e.background,e.secondBackground,e.contrastCurve,e.toneDeltaPair)}constructor(e,r,a,n,s,c,i,l){if(this.name=e,this.palette=r,this.tone=a,this.isBackground=n,this.background=s,this.secondBackground=c,this.contrastCurve=i,this.toneDeltaPair=l,this.hctCache=new Map,!s&&c)throw new Error(`Color ${e} has secondBackgrounddefined, but background is not defined.`);if(!s&&i)throw new Error(`Color ${e} has contrastCurvedefined, but background is not defined.`);if(s&&!i)throw new Error(`Color ${e} has backgrounddefined, but contrastCurve is not defined.`)}getArgb(e){return this.getHct(e).toInt()}getHct(e){const r=this.hctCache.get(e);if(r!=null)return r;const a=this.getTone(e),n=this.palette(e).getHct(a);return this.hctCache.size>4&&this.hctCache.clear(),this.hctCache.set(e,n),n}getTone(e){const r=e.contrastLevel<0;if(this.toneDeltaPair){const a=this.toneDeltaPair(e),n=a.roleA,s=a.roleB,c=a.delta,i=a.polarity,l=a.stayTogether,h=this.background(e).getTone(e),g=i==="nearer"||i==="lighter"&&!e.isDark||i==="darker"&&e.isDark,p=g?n:s,y=g?s:n,k=this.name===p.name,b=e.isDark?1:-1,D=p.contrastCurve.get(e.contrastLevel),C=y.contrastCurve.get(e.contrastLevel),I=p.tone(e);let M=L.ratioOfTones(h,I)>=D?I:u.foregroundTone(h,D);const x=y.tone(e);let P=L.ratioOfTones(h,x)>=C?x:u.foregroundTone(h,C);return r&&(M=u.foregroundTone(h,D),P=u.foregroundTone(h,C)),(P-M)*b>=c||(P=tt(0,100,M+c*b),(P-M)*b>=c||(M=tt(0,100,P-c*b))),50<=M&&M<60?b>0?(M=60,P=Math.max(P,M+c*b)):(M=49,P=Math.min(P,M+c*b)):50<=P&&P<60&&(l?b>0?(M=60,P=Math.max(P,M+c*b)):(M=49,P=Math.min(P,M+c*b)):b>0?P=60:P=49),k?M:P}else{let a=this.tone(e);if(this.background==null)return a;const n=this.background(e).getTone(e),s=this.contrastCurve.get(e.contrastLevel);if(L.ratioOfTones(n,a)>=s||(a=u.foregroundTone(n,s)),r&&(a=u.foregroundTone(n,s)),this.isBackground&&50<=a&&a<60&&(L.ratioOfTones(49,n)>=s?a=49:a=60),this.secondBackground){const[c,i]=[this.background,this.secondBackground],[l,f]=[c(e).getTone(e),i(e).getTone(e)],[h,g]=[Math.max(l,f),Math.min(l,f)];if(L.ratioOfTones(h,a)>=s&&L.ratioOfTones(g,a)>=s)return a;const p=L.lighter(h,s),y=L.darker(g,s),k=[];return p!==-1&&k.push(p),y!==-1&&k.push(y),u.tonePrefersLightForeground(l)||u.tonePrefersLightForeground(f)?p<0?100:p:k.length===1?k[0]:y<0?0:y}return a}}static foregroundTone(e,r){const a=L.lighterUnsafe(e,r),n=L.darkerUnsafe(e,r),s=L.ratioOfTones(a,e),c=L.ratioOfTones(n,e);if(u.tonePrefersLightForeground(e)){const l=Math.abs(s-c)<.1&&s=r||s>=c||l?a:n}else return c>=r||c>=s?n:a}static tonePrefersLightForeground(e){return Math.round(e)<60}static toneAllowsLightForeground(e){return Math.round(e)<=49}static enableLightForeground(e){return u.tonePrefersLightForeground(e)&&!u.toneAllowsLightForeground(e)?49:e}}/** * @license * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class m{constructor(e,r,a,n){this.low=e,this.normal=r,this.medium=a,this.high=n}get(e){return e<=-1?this.low:e<0?K(this.low,this.normal,(e- -1)/1):e<.5?K(this.normal,this.medium,(e-0)/.5):e<1?K(this.medium,this.high,(e-.5)/.5):this.high}}/** * @license * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class E{constructor(e,r,a,n,s){this.roleA=e,this.roleB=r,this.delta=a,this.polarity=n,this.stayTogether=s}}/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */var $;(function(t){t[t.MONOCHROME=0]="MONOCHROME",t[t.NEUTRAL=1]="NEUTRAL",t[t.TONAL_SPOT=2]="TONAL_SPOT",t[t.VIBRANT=3]="VIBRANT",t[t.EXPRESSIVE=4]="EXPRESSIVE",t[t.FIDELITY=5]="FIDELITY",t[t.CONTENT=6]="CONTENT",t[t.RAINBOW=7]="RAINBOW",t[t.FRUIT_SALAD=8]="FRUIT_SALAD"})($||($={}));/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function W(t){return t.variant===$.FIDELITY||t.variant===$.CONTENT}function w(t){return t.variant===$.MONOCHROME}function _t(t,e,r,a){let n=r,s=j.from(t,e,r);if(s.chromai.chroma||Math.abs(i.chroma-e)<.4)break;const l=Math.abs(i.chroma-e),f=Math.abs(s.chroma-e);lt.primaryPalette,tone:t=>t.primaryPalette.keyColor.tone});o.secondaryPaletteKeyColor=u.fromPalette({name:"secondary_palette_key_color",palette:t=>t.secondaryPalette,tone:t=>t.secondaryPalette.keyColor.tone});o.tertiaryPaletteKeyColor=u.fromPalette({name:"tertiary_palette_key_color",palette:t=>t.tertiaryPalette,tone:t=>t.tertiaryPalette.keyColor.tone});o.neutralPaletteKeyColor=u.fromPalette({name:"neutral_palette_key_color",palette:t=>t.neutralPalette,tone:t=>t.neutralPalette.keyColor.tone});o.neutralVariantPaletteKeyColor=u.fromPalette({name:"neutral_variant_palette_key_color",palette:t=>t.neutralVariantPalette,tone:t=>t.neutralVariantPalette.keyColor.tone});o.background=u.fromPalette({name:"background",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:98,isBackground:!0});o.onBackground=u.fromPalette({name:"on_background",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:10,background:t=>o.background,contrastCurve:new m(3,3,4.5,7)});o.surface=u.fromPalette({name:"surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:98,isBackground:!0});o.surfaceDim=u.fromPalette({name:"surface_dim",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:new m(87,87,80,75).get(t.contrastLevel),isBackground:!0});o.surfaceBright=u.fromPalette({name:"surface_bright",palette:t=>t.neutralPalette,tone:t=>t.isDark?new m(24,24,29,34).get(t.contrastLevel):98,isBackground:!0});o.surfaceContainerLowest=u.fromPalette({name:"surface_container_lowest",palette:t=>t.neutralPalette,tone:t=>t.isDark?new m(4,4,2,0).get(t.contrastLevel):100,isBackground:!0});o.surfaceContainerLow=u.fromPalette({name:"surface_container_low",palette:t=>t.neutralPalette,tone:t=>t.isDark?new m(10,10,11,12).get(t.contrastLevel):new m(96,96,96,95).get(t.contrastLevel),isBackground:!0});o.surfaceContainer=u.fromPalette({name:"surface_container",palette:t=>t.neutralPalette,tone:t=>t.isDark?new m(12,12,16,20).get(t.contrastLevel):new m(94,94,92,90).get(t.contrastLevel),isBackground:!0});o.surfaceContainerHigh=u.fromPalette({name:"surface_container_high",palette:t=>t.neutralPalette,tone:t=>t.isDark?new m(17,17,21,25).get(t.contrastLevel):new m(92,92,88,85).get(t.contrastLevel),isBackground:!0});o.surfaceContainerHighest=u.fromPalette({name:"surface_container_highest",palette:t=>t.neutralPalette,tone:t=>t.isDark?new m(22,22,26,30).get(t.contrastLevel):new m(90,90,84,80).get(t.contrastLevel),isBackground:!0});o.onSurface=u.fromPalette({name:"on_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:10,background:t=>o.highestSurface(t),contrastCurve:new m(4.5,7,11,21)});o.surfaceVariant=u.fromPalette({name:"surface_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?30:90,isBackground:!0});o.onSurfaceVariant=u.fromPalette({name:"on_surface_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?80:30,background:t=>o.highestSurface(t),contrastCurve:new m(3,4.5,7,11)});o.inverseSurface=u.fromPalette({name:"inverse_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:20});o.inverseOnSurface=u.fromPalette({name:"inverse_on_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?20:95,background:t=>o.inverseSurface,contrastCurve:new m(4.5,7,11,21)});o.outline=u.fromPalette({name:"outline",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?60:50,background:t=>o.highestSurface(t),contrastCurve:new m(1.5,3,4.5,7)});o.outlineVariant=u.fromPalette({name:"outline_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?30:80,background:t=>o.highestSurface(t),contrastCurve:new m(1,1,3,4.5)});o.shadow=u.fromPalette({name:"shadow",palette:t=>t.neutralPalette,tone:t=>0});o.scrim=u.fromPalette({name:"scrim",palette:t=>t.neutralPalette,tone:t=>0});o.surfaceTint=u.fromPalette({name:"surface_tint",palette:t=>t.primaryPalette,tone:t=>t.isDark?80:40,isBackground:!0});o.primary=u.fromPalette({name:"primary",palette:t=>t.primaryPalette,tone:t=>w(t)?t.isDark?100:0:t.isDark?80:40,isBackground:!0,background:t=>o.highestSurface(t),contrastCurve:new m(3,4.5,7,7),toneDeltaPair:t=>new E(o.primaryContainer,o.primary,10,"nearer",!1)});o.onPrimary=u.fromPalette({name:"on_primary",palette:t=>t.primaryPalette,tone:t=>w(t)?t.isDark?10:90:t.isDark?20:100,background:t=>o.primary,contrastCurve:new m(4.5,7,11,21)});o.primaryContainer=u.fromPalette({name:"primary_container",palette:t=>t.primaryPalette,tone:t=>W(t)?t.sourceColorHct.tone:w(t)?t.isDark?85:25:t.isDark?30:90,isBackground:!0,background:t=>o.highestSurface(t),contrastCurve:new m(1,1,3,4.5),toneDeltaPair:t=>new E(o.primaryContainer,o.primary,10,"nearer",!1)});o.onPrimaryContainer=u.fromPalette({name:"on_primary_container",palette:t=>t.primaryPalette,tone:t=>W(t)?u.foregroundTone(o.primaryContainer.tone(t),4.5):w(t)?t.isDark?0:100:t.isDark?90:30,background:t=>o.primaryContainer,contrastCurve:new m(3,4.5,7,11)});o.inversePrimary=u.fromPalette({name:"inverse_primary",palette:t=>t.primaryPalette,tone:t=>t.isDark?40:80,background:t=>o.inverseSurface,contrastCurve:new m(3,4.5,7,7)});o.secondary=u.fromPalette({name:"secondary",palette:t=>t.secondaryPalette,tone:t=>t.isDark?80:40,isBackground:!0,background:t=>o.highestSurface(t),contrastCurve:new m(3,4.5,7,7),toneDeltaPair:t=>new E(o.secondaryContainer,o.secondary,10,"nearer",!1)});o.onSecondary=u.fromPalette({name:"on_secondary",palette:t=>t.secondaryPalette,tone:t=>w(t)?t.isDark?10:100:t.isDark?20:100,background:t=>o.secondary,contrastCurve:new m(4.5,7,11,21)});o.secondaryContainer=u.fromPalette({name:"secondary_container",palette:t=>t.secondaryPalette,tone:t=>{const e=t.isDark?30:90;return w(t)?t.isDark?30:85:W(t)?_t(t.secondaryPalette.hue,t.secondaryPalette.chroma,e,!t.isDark):e},isBackground:!0,background:t=>o.highestSurface(t),contrastCurve:new m(1,1,3,4.5),toneDeltaPair:t=>new E(o.secondaryContainer,o.secondary,10,"nearer",!1)});o.onSecondaryContainer=u.fromPalette({name:"on_secondary_container",palette:t=>t.secondaryPalette,tone:t=>w(t)?t.isDark?90:10:W(t)?u.foregroundTone(o.secondaryContainer.tone(t),4.5):t.isDark?90:30,background:t=>o.secondaryContainer,contrastCurve:new m(3,4.5,7,11)});o.tertiary=u.fromPalette({name:"tertiary",palette:t=>t.tertiaryPalette,tone:t=>w(t)?t.isDark?90:25:t.isDark?80:40,isBackground:!0,background:t=>o.highestSurface(t),contrastCurve:new m(3,4.5,7,7),toneDeltaPair:t=>new E(o.tertiaryContainer,o.tertiary,10,"nearer",!1)});o.onTertiary=u.fromPalette({name:"on_tertiary",palette:t=>t.tertiaryPalette,tone:t=>w(t)?t.isDark?10:90:t.isDark?20:100,background:t=>o.tertiary,contrastCurve:new m(4.5,7,11,21)});o.tertiaryContainer=u.fromPalette({name:"tertiary_container",palette:t=>t.tertiaryPalette,tone:t=>{if(w(t))return t.isDark?60:49;if(!W(t))return t.isDark?30:90;const e=t.tertiaryPalette.getHct(t.sourceColorHct.tone);return lt.fixIfDisliked(e).tone},isBackground:!0,background:t=>o.highestSurface(t),contrastCurve:new m(1,1,3,4.5),toneDeltaPair:t=>new E(o.tertiaryContainer,o.tertiary,10,"nearer",!1)});o.onTertiaryContainer=u.fromPalette({name:"on_tertiary_container",palette:t=>t.tertiaryPalette,tone:t=>w(t)?t.isDark?0:100:W(t)?u.foregroundTone(o.tertiaryContainer.tone(t),4.5):t.isDark?90:30,background:t=>o.tertiaryContainer,contrastCurve:new m(3,4.5,7,11)});o.error=u.fromPalette({name:"error",palette:t=>t.errorPalette,tone:t=>t.isDark?80:40,isBackground:!0,background:t=>o.highestSurface(t),contrastCurve:new m(3,4.5,7,7),toneDeltaPair:t=>new E(o.errorContainer,o.error,10,"nearer",!1)});o.onError=u.fromPalette({name:"on_error",palette:t=>t.errorPalette,tone:t=>t.isDark?20:100,background:t=>o.error,contrastCurve:new m(4.5,7,11,21)});o.errorContainer=u.fromPalette({name:"error_container",palette:t=>t.errorPalette,tone:t=>t.isDark?30:90,isBackground:!0,background:t=>o.highestSurface(t),contrastCurve:new m(1,1,3,4.5),toneDeltaPair:t=>new E(o.errorContainer,o.error,10,"nearer",!1)});o.onErrorContainer=u.fromPalette({name:"on_error_container",palette:t=>t.errorPalette,tone:t=>w(t)?t.isDark?90:10:t.isDark?90:30,background:t=>o.errorContainer,contrastCurve:new m(3,4.5,7,11)});o.primaryFixed=u.fromPalette({name:"primary_fixed",palette:t=>t.primaryPalette,tone:t=>w(t)?40:90,isBackground:!0,background:t=>o.highestSurface(t),contrastCurve:new m(1,1,3,4.5),toneDeltaPair:t=>new E(o.primaryFixed,o.primaryFixedDim,10,"lighter",!0)});o.primaryFixedDim=u.fromPalette({name:"primary_fixed_dim",palette:t=>t.primaryPalette,tone:t=>w(t)?30:80,isBackground:!0,background:t=>o.highestSurface(t),contrastCurve:new m(1,1,3,4.5),toneDeltaPair:t=>new E(o.primaryFixed,o.primaryFixedDim,10,"lighter",!0)});o.onPrimaryFixed=u.fromPalette({name:"on_primary_fixed",palette:t=>t.primaryPalette,tone:t=>w(t)?100:10,background:t=>o.primaryFixedDim,secondBackground:t=>o.primaryFixed,contrastCurve:new m(4.5,7,11,21)});o.onPrimaryFixedVariant=u.fromPalette({name:"on_primary_fixed_variant",palette:t=>t.primaryPalette,tone:t=>w(t)?90:30,background:t=>o.primaryFixedDim,secondBackground:t=>o.primaryFixed,contrastCurve:new m(3,4.5,7,11)});o.secondaryFixed=u.fromPalette({name:"secondary_fixed",palette:t=>t.secondaryPalette,tone:t=>w(t)?80:90,isBackground:!0,background:t=>o.highestSurface(t),contrastCurve:new m(1,1,3,4.5),toneDeltaPair:t=>new E(o.secondaryFixed,o.secondaryFixedDim,10,"lighter",!0)});o.secondaryFixedDim=u.fromPalette({name:"secondary_fixed_dim",palette:t=>t.secondaryPalette,tone:t=>w(t)?70:80,isBackground:!0,background:t=>o.highestSurface(t),contrastCurve:new m(1,1,3,4.5),toneDeltaPair:t=>new E(o.secondaryFixed,o.secondaryFixedDim,10,"lighter",!0)});o.onSecondaryFixed=u.fromPalette({name:"on_secondary_fixed",palette:t=>t.secondaryPalette,tone:t=>10,background:t=>o.secondaryFixedDim,secondBackground:t=>o.secondaryFixed,contrastCurve:new m(4.5,7,11,21)});o.onSecondaryFixedVariant=u.fromPalette({name:"on_secondary_fixed_variant",palette:t=>t.secondaryPalette,tone:t=>w(t)?25:30,background:t=>o.secondaryFixedDim,secondBackground:t=>o.secondaryFixed,contrastCurve:new m(3,4.5,7,11)});o.tertiaryFixed=u.fromPalette({name:"tertiary_fixed",palette:t=>t.tertiaryPalette,tone:t=>w(t)?40:90,isBackground:!0,background:t=>o.highestSurface(t),contrastCurve:new m(1,1,3,4.5),toneDeltaPair:t=>new E(o.tertiaryFixed,o.tertiaryFixedDim,10,"lighter",!0)});o.tertiaryFixedDim=u.fromPalette({name:"tertiary_fixed_dim",palette:t=>t.tertiaryPalette,tone:t=>w(t)?30:80,isBackground:!0,background:t=>o.highestSurface(t),contrastCurve:new m(1,1,3,4.5),toneDeltaPair:t=>new E(o.tertiaryFixed,o.tertiaryFixedDim,10,"lighter",!0)});o.onTertiaryFixed=u.fromPalette({name:"on_tertiary_fixed",palette:t=>t.tertiaryPalette,tone:t=>w(t)?100:10,background:t=>o.tertiaryFixedDim,secondBackground:t=>o.tertiaryFixed,contrastCurve:new m(4.5,7,11,21)});o.onTertiaryFixedVariant=u.fromPalette({name:"on_tertiary_fixed_variant",palette:t=>t.tertiaryPalette,tone:t=>w(t)?90:30,background:t=>o.tertiaryFixedDim,secondBackground:t=>o.tertiaryFixed,contrastCurve:new m(3,4.5,7,11)});/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Et(t){const e=gt(t),r=pt(t),a=bt(t),n=[e.toString(16),r.toString(16),a.toString(16)];for(const[s,c]of n.entries())c.length===1&&(n[s]="0"+c);return"#"+n.join("")}function Nt(t){t=t.replace("#","");const e=t.length===3,r=t.length===6,a=t.length===8;if(!e&&!r&&!a)throw new Error("unexpected hex "+t);let n=0,s=0,c=0;return e?(n=U(t.slice(0,1).repeat(2)),s=U(t.slice(1,2).repeat(2)),c=U(t.slice(2,3).repeat(2))):r?(n=U(t.slice(0,2)),s=U(t.slice(2,4)),c=U(t.slice(4,6))):a&&(n=U(t.slice(2,4)),s=U(t.slice(4,6)),c=U(t.slice(6,8))),(255<<24|(n&255)<<16|(s&255)<<8|c&255)>>>0}function U(t){return parseInt(t,16)}exports.Cam16=_;exports.Hct=j;exports.argbFromHex=Nt;exports.differenceDegrees=wt;exports.hexFromArgb=Et;exports.lstarFromArgb=st;exports.rotationDirection=It;exports.sanitizeDegreesDouble=it;