1import{a as e}from"./jsx-runtime-D_MnEzuy.js";import{t}from"./react-DBEjWt7A.js";import{s as n}from"./link-Di2oYaad.js";import{i as r}from"./useBaseQuery-DXVpLECH.js";import{t as i}from"./useQuery-B_tVWEJs.js";import{n as a,r as o}from"./smart-image-YG08YgzI.js";var s=(e,t)=>{if(typeof e==`number`){if(t===3)return{mode:`rgb`,r:(e>>8&15|e>>4&240)/255,g:(e>>4&15|e&240)/255,b:(e&15|e<<4&240)/255};if(t===4)return{mode:`rgb`,r:(e>>12&15|e>>8&240)/255,g:(e>>8&15|e>>4&240)/255,b:(e>>4&15|e&240)/255,alpha:(e&15|e<<4&240)/255};if(t===6)return{mode:`rgb`,r:(e>>16&255)/255,g:(e>>8&255)/255,b:(e&255)/255};if(t===8)return{mode:`rgb`,r:(e>>24&255)/255,g:(e>>16&255)/255,b:(e>>8&255)/255,alpha:(e&255)/255}}},c={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},l=e=>s(c[e.toLowerCase()],6),u=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,d=e=>{let t;return(t=e.match(u))?s(parseInt(t[1],16),t[1].length):void 0},f=`([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)`;`${f}`;var p=`${f}%`;`${f}`;var m=`(?:${f}%|${f})`,h=`(?:${f}%|${f}|none)`,g=`(?:${f}(deg|grad|rad|turn)|${f})`;`${f}${f}`;var _=`\\s*,\\s*`;RegExp(`^`+h+`$`);var v=RegExp(`^rgba?\\(\\s*${f}${_}${f}${_}${f}\\s*(?:,\\s*${m}\\s*)?\\)$`),y=RegExp(`^rgba?\\(\\s*${p}${_}${p}${_}${p}\\s*(?:,\\s*${m}\\s*)?\\)$`),b=e=>{let t={mode:`rgb`},n;if(n=e.match(v))n[1]!==void 0&&(t.r=n[1]/255),n[2]!==void 0&&(t.g=n[2]/255),n[3]!==void 0&&(t.b=n[3]/255);else if(n=e.match(y))n[1]!==void 0&&(t.r=n[1]/100),n[2]!==void 0&&(t.g=n[2]/100),n[3]!==void 0&&(t.b=n[3]/100);else return;return n[4]===void 0?n[5]!==void 0&&(t.alpha=Math.max(0,Math.min(1,+n[5]))):t.alpha=Math.max(0,Math.min(1,n[4]/100)),t},x=(e,t)=>e===void 0?void 0:typeof e==`object`?e.mode===void 0?t?{...e,mode:t}:void 0:e:pe(e),S=(e=`rgb`)=>t=>(t=x(t,e))===void 0?void 0:t.mode===e?t:C[t.mode][e]?C[t.mode][e](t):e===`rgb`?C[t.mode].rgb(t):C.rgb[e](C[t.mode].rgb(t)),C={},w={},T=[],ee={},te=e=>e,E=e=>(C[e.mode]={...C[e.mode],...e.toMode},Object.keys(e.fromMode||{}
vendor: 4,223 bytes, lines 1-4
1).forEach(t=>{C[t]||(C[t]={}),C[t][e.mode]=e.fromMode[t]}),e.ranges||={},e.difference||={},e.channels.forEach(t=>{if(e.ranges[t]===void 0&&(e.ranges[t]=[0,1]),!e.interpolate[t])throw Error(`Missing interpolator for: ${t}`);typeof e.interpolate[t]==`function`&&(e.interpolate[t]={use:e.interpolate[t]}),e.interpolate[t].fixup||(e.interpolate[t].fixup=te)}),w[e.mode]=e,(e.parse||[]).forEach(t=>{ne(t,e.mode)}),S(e.mode)),D=e=>w[e],ne=(e,t)=>{if(typeof e==`string`){if(!t)throw Error(`'mode' required when 'parser' is a string`);ee[e]=t}else typeof e==`function`&&T.indexOf(e)<0&&T.push(e)},O=/[^\x00-\x7F]|[a-zA-Z_]/,re=/[^\x00-\x7F]|[-\w]/,k={Function:`function`,Ident:`ident`,Number:`number`,Percentage:`percentage`,ParenClose:`)`,None:`none`,Hue:`hue`,Alpha:`alpha`},A=0;function j(e){let t=e[A],n=e[A+1];return t===`-`||t===`+`?/\d/.test(n)||n===`.`&&/\d/.test(e[A+2]):t===`.`?/\d/.test(n):/\d/.test(t)}function ie(e){if(A>=e.length)return!1;let t=e[A];if(O.test(t))return!0;if(t===`-`){if(e.length-A<2)return!1;let t=e[A+1];return!!(t===`-`||O.test(t))}return!1}var ae={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function M(e){let t=``;if((e[A]===`-`||e[A]===`+`)&&(t+=e[A++]),t+=oe(e),e[A]===`.`&&/\d/.test(e[A+1])&&(t+=e[A++]+oe(e)),(e[A]===`e`||e[A]===`E`)&&((e[A+1]===`-`||e[A+1]===`+`)&&/\d/.test(e[A+2])?t+=e[A++]+e[A++]+oe(e):/\d/.test(e[A+1])&&(t+=e[A++]+oe(e))),ie(e)){let n=se(e);return n===`deg`||n===`rad`||n===`turn`||n===`grad`?{type:k.Hue,value:t*ae[n]}:void 0}return e[A]===`%`?(A++,{type:k.Percentage,value:+t}):{type:k.Number,value:+t}}function oe(e){let t=``;for(;/\d/.test(e[A]);)t+=e[A++];return t}function se(e){let t=``;for(;A<e.length&&re.test(e[A]);)t+=e[A++];return t}function ce(e){let t=se(e);return e[A]===`(`?(A++,{type:k.Function,value:t}):t===`none`?{type:k.None,value:void 0}:{type:k.Ident,value:t}}function le(e=``){let t=e.trim(),n=[],r;for(A=0;A<t.length;){if(r=t[A++],r===` 2`||r===` `||r===` `){for(;A<t.length&&(t[A]===` 3`||t[A]===` `||t[A]===` `);)A++;continue}if(r===`,`)return;if(r===`)`){n.push({type:k.ParenClose});continue}if(r===`+`){if(A--,j(t)){n.push(M(t));continue}return}if(r===`-`){if(A--,j(t)){n.push(M(t));continue}if(ie(t)){n.push({type:k.Ident,value:se(t)});continue}return}if(r===`.`){if(A--,j(t)){n.push(M(t));continue}return}if(r===`/`){for(;A<t.length&&(t[A]===` 4`||t[A]===` `||t[A]===` `);)A++;let e;if(j(t)&&(e=M(t),e.type!==k.Hue)){n.push({type:k.Alpha,value:e});continue}if(ie(t)&&se(t)===`none`){n.push({type:k.Alpha,value:{type:k.None,value:void 0}});continue}return}if(/\d/.test(r)){A--,n.push(M(t));continue}if(O.test(r)){A--,n.push(ce(t));continue}return}return n}function ue(e){e._i=0;let t=e[e._i++];if(!t||t.type!==k.Function||t.value!==`color`||(t=e[e._i++],t.type!==k.Ident))return;let n=ee[t.value];if(!n)return;let r={mode:n},i=de(e,!1);if(!i)return;let a=D(n).channels;for(let e=0,t,n;e<a.length;e++)t=i[e],n=a[e],t.type!==k.None&&(r[n]=t.type===k.Number?t.value:t.value/100,n===`alpha`&&(r[n]=Math.max(0,Math.min(1,r[n]))));return r}function de(e,t){let n=[],r;for(;e._i<e.length;){if(r=e[e._i++],r.type===k.None||r.type===k.Number||r.type===k.Alpha||r.type===k.Percentage||t&&r.type===k.Hue){n.push(r);continue}if(r.type===k.ParenClose){if(e._i<e.length)return;continue}return}if(!(n.length<3||n.length>4)){if(n.length===4){if(n[3].type!==k.Alpha)return;n[3]=n[3].value}return n.length===3&&n.push({type:k.None,value:void 0}),n.every(e=>e.type!==k.Alpha)?n:void 0}}function fe(e,t){e._i=0;let n=e[e._i++];if(!n||n.type!==k.Function)return;let r=de(e,t);if(r)return r.unshift(n.value),r}var pe=e=>{if(typeof e!=`string`)return;let t=le(e),n=t?fe(t,!0):void 0,r,i=0,a=T.length;for(;i<a;)if((r=T[i++](e,n))!==void 0)return r;return t?ue(t):void 0};function me(e,t){if(!t||t[0]!==`rgb`&&t[0]!==`rgba`)return;let n={mode:`rgb`},[,r,i,a,o]=t;if(!(r.type===k.Hue||i.type===k.Hue||a.type===k.Hue))return r.type!==k.None&&(n.r=r.type===k.Number?r.value/255:r.value/100),i.type!==k.None&&(n.g=i.type===k.Number?i.value/255:i.value/100),a.type!==k.None&&(n.b=a.type===k.Number?a.value/255:a.value/100),o.type!==k.None&&(n.alpha=Math.min(1,Math.max(0,o.type===k.Number?o.value:o.value/100))),n}var he=e=>e===`transparent`?{mode:`rgb`,r:0,g:0,b:0,alpha:0}
4:void 0,ge=(e,t,n)=>e+n*(t-e),_e=e=>{let t=[];for(let n=0;n<e.length-1;n++){let r=e[n],i=e[n+1];r===void 0&&i===void 0?t.push(void 0):r!==void 0&&i!==void 0?t.push([r,i]):t.push(r===void 0?[i,i]:[r,r])}return t},N=(e=>t=>{let n=_e(t);return t=>{let r=t*n.length,i=t>=1?n.length-1:Math.max(Math.floor(r),0),a=n[i];return a===void 0?void 0:e(a[0],a[1],r-i)}})(ge),P=e=>{let t=!1,n=e.map(e=>e===void 0?1:(t=!0,e));return t?n:e},ve={mode:`rgb`,channels:[`r`,`g`,`b`,`alpha`],parse:[me,d,b,l,he,`srgb`],serialize:`srgb`,interpolate:{r:N,g:N,b:N,alpha:{use:N,fixup:P}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},ye=(e=0)=>Math.abs(e)**(563/256)*Math.sign(e),be=e=>{let t=ye(e.r),n=ye(e.g),r=ye(e.b),i={mode:`xyz65`,x:.5766690429101305*t+.1855582379065463*n+.1882286462349947*r,y:.297344975250536*t+.6273635662554661*n+.0752914584939979*r,z:.0270313613864123*t+.0706888525358272*n+.9913375368376386*r};return e.alpha!==void 0&&(i.alpha=e.alpha),i},xe=e=>Math.abs(e)**(256/563)*Math.sign(e),Se=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i={mode:`a98`,r:xe(e*2.0415879038107465-t*.5650069742788597-.3447313507783297*n),g:xe(e*-.9692436362808798+t*1.8759675015077206+.0415550574071756*n),b:xe(e*.0134442806320312-t*.1183623922310184+1.0151749943912058*n)};return r!==void 0&&(i.alpha=r),i},Ce=(e=0)=>{let t=Math.abs(e);return t<=.04045?e/12.92:(Math.sign(e)||1)*((t+.055)/1.055)**2.4},we=({r:e,g:t,b:n,alpha:r})=>{let i={mode:`lrgb`,r:Ce(e),g:Ce(t),b:Ce(n)};return r!==void 0&&(i.alpha=r),i},Te=e=>{let{r:t,g:n,b:r,alpha:i}=we(e),a={mode:`xyz65`,x:.4123907992659593*t+.357584339383878*n+.1804807884018343*r,y:.2126390058715102*t+.715168678767756*n+.0721923153607337*r,z:.0193308187155918*t+.119194779794626*n+.9505321522496607*r};return i!==void 0&&(a.alpha=i),a},Ee=(e=0)=>{let t=Math.abs(e);return t>.0031308?(Math.sign(e)||1)*(1.055*t**(1/2.4)-.055):e*12.92},De=({r:e,g:t,b:n,alpha:r},i=`rgb`)=>{let a={mode:i,r:Ee(e),g:Ee(t),b:Ee(n)};return r!==void 0&&(a.alpha=r),a},Oe=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=De({r:e*3.2409699419045226-t*1.537383177570094-.4986107602930034*n,g:e*-.9692436362808796+t*1.8759675015077204+.0415550574071756*n,b:e*.0556300796969936-t*.2039769588889765+1.0569715142428784*n});return r!==void 0&&(i.alpha=r),i},ke={...ve,mode:`a98`,parse:[`a98-rgb`],serialize:`a98-rgb`,fromMode:{rgb:e=>Se(Te(e)),xyz65:Se},toMode:{rgb:e=>Oe(be(e)),xyz65:be}},F=e=>(e%=360)<0?e+360:e,Ae=(e,t)=>e.map((n,r,i)=>{if(n===void 0)return n;let a=F(n);return r===0||e[r-1]===void 0?a:t(a-F(i[r-1]))}).reduce((e,t)=>!e.length||t===void 0||e[e.length-1]===void 0?(e.push(t),e):(e.push(t+e[e.length-1]),e),[]),I=e=>Ae(e,e=>Math.abs(e)<=180?e:e-360*Math.sign(e)),L=[-.14861,1.78277,-.29227,-.90649,1.97294,0],je=Math.PI/180,Me=180/Math.PI,Ne=L[3]*L[4],Pe=L[1]*L[4],Fe=L[1]*L[2]-L[0]*L[3],Ie=({r:e,g:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=(Fe*n+e*Ne-t*Pe)/(Fe+Ne-Pe),a=n-i,o=(L[4]*(t-i)-L[2]*a)/L[3],s={mode:`cubehelix`,l:i,s:i===0||i===1?void 0:Math.sqrt(a*a+o*o)/(L[4]*i*(1-i))};return s.s&&(s.h=Math.atan2(o,a)*Me-120),r!==void 0&&(s.alpha=r),s},Le=({h:e,s:t,l:n,alpha:r})=>{let i={mode:`rgb`};e=(e===void 0?0:e+120)*je,n===void 0&&(n=0);let a=t===void 0?0:t*n*(1-n),o=Math.cos(e),s=Math.sin(e);return i.r=n+a*(L[0]*o+L[1]*s),i.g=n+a*(L[2]*o+L[3]*s),i.b=n+a*(L[4]*o+L[5]*s),r!==void 0&&(i.alpha=r),i},Re=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.s||!t.s)return 0;let n=F(e.h),r=F(t.h),i=Math.sin((r-n+360)/2*Math.PI/180);return 2*Math.sqrt(e.s*t.s)*i},ze=(e,t)=>{if(e.h===void 0||t.h===void 0)return 0;let n=F(e.h),r=F(t.h);return Math.abs(r-n)>180?n-(r-360*Math.sign(r-n)):r-n},Be=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.c||!t.c)return 0;let n=F(e.h),r=F(t.h),i=Math.sin((r-n+360)/2*Math.PI/180);return 2*Math.sqrt(e.c*t.c)*i},R=e=>{let t=e.reduce((e,t)=>{if(t!==void 0){let n=t*Math.PI/180;e.sin+=Math.sin(n),e.cos+=Math.cos(n)}return e},{sin:0,cos:0}),n=Math.atan2(t.sin,t.cos)*180/Math.PI;return n<0?360+n:n},Ve={mode:`cubehelix`,channels:[`h`,`s`,`l`,`alpha`],parse:[`--cubehelix`],serialize:`--cubehelix`,ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:Ie},toMode:{rgb:Le},interpolate:{h:{use:N,fixup:I},s:N,l:N,alpha:{use:N,fixup:P}},difference:{h:Re},average:{h:R}},z=({l:e,a:t,b:n,alpha:r},i=`lch`)=>{t===void 0&&(t=0),n===void 0&&(n=0);let a=Math.sqrt(t*t+n*n),o={mode:i,l:e,c:a};return a&&(o.h=F(Math.atan2(n,t)*180/Math.PI)),r!==void 0&&(o.alpha=r),o},B=({l:e,c:t,h:n,alpha:r},i=`lab`)=>{n===void 0&&(n=0);let a={mode:i,l:e,a:t?t*Math.cos(n/180*Math.PI):0,b:t?t*Math.sin(n/180*Math.PI):0};return r!==void 0&&(a.alpha=r),a}
4,He=29**3/3**3,Ue=6**3/29**3,V={X:.3457/.3585,Y:1,Z:.2958/.3585},We={X:.3127/.329,Y:1,Z:.3583/.329},Ge=e=>e**3>Ue?e**3:(116*e-16)/He,Ke=({l:e,a:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=(e+16)/116,a=t/500+i,o=i-n/200,s={mode:`xyz65`,x:Ge(a)*We.X,y:Ge(i)*We.Y,z:Ge(o)*We.Z};return r!==void 0&&(s.alpha=r),s},qe=e=>Oe(Ke(e)),Je=e=>e>Ue?Math.cbrt(e):(He*e+16)/116,Ye=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=Je(e/We.X),a=Je(t/We.Y),o=Je(n/We.Z),s={mode:`lab65`,l:116*a-16,a:500*(i-a),b:200*(a-o)};return r!==void 0&&(s.alpha=r),s},Xe=e=>{let t=Ye(Te(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},Ze=26/180*Math.PI,Qe=Math.cos(Ze),$e=Math.sin(Ze),et=100/Math.log(139/100),tt=({l:e,c:t,h:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i={mode:`lab65`,l:(Math.exp(e*1/et)-1)/.0039},a=(Math.exp(.0435*t*1*1)-1)/.075,o=a*Math.cos(n/180*Math.PI-Ze),s=a*Math.sin(n/180*Math.PI-Ze);return i.a=o*Qe-s/.83*$e,i.b=o*$e+s/.83*Qe,r!==void 0&&(i.alpha=r),i},nt=({l:e,a:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=t*Qe+n*$e,a=.83*(n*Qe-t*$e),o=Math.sqrt(i*i+a*a),s={mode:`dlch`,l:et/1*Math.log(1+.0039*e),c:Math.log(1+.075*o)/(.0435*1*1)};return s.c&&(s.h=F((Math.atan2(a,i)+Ze)/Math.PI*180)),r!==void 0&&(s.alpha=r),s},rt=e=>tt(z(e,`dlch`)),it=e=>B(nt(e),`dlab`),at={mode:`dlab`,parse:[`--din99o-lab`],serialize:`--din99o-lab`,toMode:{lab65:rt,rgb:e=>qe(rt(e))},fromMode:{lab65:it,rgb:e=>it(Xe(e))},channels:[`l`,`a`,`b`,`alpha`],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:N,a:N,b:N,alpha:{use:N,fixup:P}}},ot={mode:`dlch`,parse:[`--din99o-lch`],serialize:`--din99o-lch`,toMode:{lab65:tt,dlab:e=>B(e,`dlab`),rgb:e=>qe(tt(e))},fromMode:{lab65:nt,dlab:e=>z(e,`dlch`),rgb:e=>nt(Xe(e))},channels:[`l`,`c`,`h`,`alpha`],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:N,c:N,h:{use:N,fixup:I},alpha:{use:N,fixup:P}},difference:{h:Be},average:{h:R}};function st({h:e,s:t,i:n,alpha:r}){e=F(e===void 0?0:e),t===void 0&&(t=0),n===void 0&&(n=0);let i=Math.abs(e/60%2-1),a;switch(Math.floor(e/60)){case 0:a={r:n*(1+t*(3/(2-i)-1)),g:n*(1+t*(3*(1-i)/(2-i)-1)),b:n*(1-t)};break;case 1:a={r:n*(1+t*(3*(1-i)/(2-i)-1)),g:n*(1+t*(3/(2-i)-1)),b:n*(1-t)};break;case 2:a={r:n*(1-t),g:n*(1+t*(3/(2-i)-1)),b:n*(1+t*(3*(1-i)/(2-i)-1))};break;case 3:a={r:n*(1-t),g:n*(1+t*(3*(1-i)/(2-i)-1)),b:n*(1+t*(3/(2-i)-1))};break;case 4:a={r:n*(1+t*(3*(1-i)/(2-i)-1)),g:n*(1-t),b:n*(1+t*(3/(2-i)-1))};break;case 5:a={r:n*(1+t*(3/(2-i)-1)),g:n*(1-t),b:n*(1+t*(3*(1-i)/(2-i)-1))};break;default:a={r:n*(1-t),g:n*(1-t),b:n*(1-t)}}return a.mode=`rgb`,r!==void 0&&(a.alpha=r),a}function ct({r:e,g:t,b:n,alpha:r}){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=Math.max(e,t,n),a=Math.min(e,t,n),o={mode:`hsi`,s:e+t+n===0?0:1-3*a/(e+t+n),i:(e+t+n)/3};return i-a!==0&&(o.h=(i===e?(t-n)/(i-a)+(t<n)*6:i===t?(n-e)/(i-a)+2:(e-t)/(i-a)+4)*60),r!==void 0&&(o.alpha=r),o}var lt={mode:`hsi`,toMode:{rgb:st},parse:[`--hsi`],serialize:`--hsi`,fromMode:{rgb:ct},channels:[`h`,`s`,`i`,`alpha`],ranges:{h:[0,360]},gamut:`rgb`,interpolate:{h:{use:N,fixup:I},s:N,i:N,alpha:{use:N,fixup:P}},difference:{h:Re},average:{h:R}};function ut({h:e,s:t,l:n,alpha:r}){e=F(e===void 0?0:e),t===void 0&&(t=0),n===void 0&&(n=0);let i=n+t*(n<.5?n:1-n),a=i-(i-n)*2*Math.abs(e/60%2-1),o;switch(Math.floor(e/60)){case 0:o={r:i,g:a,b:2*n-i};break;case 1:o={r:a,g:i,b:2*n-i};break;case 2:o={r:2*n-i,g:i,b:a};break;case 3:o={r:2*n-i,g:a,b:i};break;case 4:o={r:a,g:2*n-i,b:i};break;case 5:o={r:i,g:2*n-i,b:a};break;default:o={r:2*n-i,g:2*n-i,b:2*n-i}}return o.mode=`rgb`,r!==void 0&&(o.alpha=r),o}function dt({r:e,g:t,b:n,alpha:r}){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=Math.max(e,t,n),a=Math.min(e,t,n),o={mode:`hsl`,s:i===a?0:(i-a)/(1-Math.abs(i+a-1)),l:.5*(i+a)};return i-a!==0&&(o.h=(i===e?(t-n)/(i-a)+(t<n)*6:i===t?(n-e)/(i-a)+2:(e-t)/(i-a)+4)*60),r!==void 0&&(o.alpha=r),o}var ft=(e,t)=>{switch(t){case`deg`:return+e;case`rad`:return e/Math.PI*180;case`grad`:return e/10*9;case`turn`:return e*360}},pt=RegExp(`^hsla?\\(\\s*${g}${_}${p}${_}${p}\\s*(?:,\\s*${m}\\s*)?\\)$`),mt=e=>{let t=e.match(pt);if(!t)return;let n={mode:`hsl`};return t[3]===void 0?t[1]!==void 0&&t[2]!==void 0&&(n.h=ft(t[1],t[2])):n.h=+t[3],t[4]!==void 0&&(n.s=Math.min(Math.max(0,t[4]/100),1)),t[5]!==void 0&&(n.l=Math.min(Math.max(0,t[5]/100),1)),t[6]===void 0?t[7]!==void 0&&(n.alpha=Math.max(0,Math.min(1,+t[7]))):n.alpha=Math.max(0,Math.min(1,t[6]/100)),n};function ht(e,t){if(!t||t[0]!==`hsl`&&t[0]!==`hsla`)return;let n={mode:`hsl`},[,r,i,a,o]=t;if(r.type!==k.None){if(r.type===k.Percentage)return;n.h=r.value}if(i.type!==k.None){if(i.type===k.Hue)return;n.s=i.value/100}if(a.type!==k.None){if(a.type===k.Hue)return;n.l=a.value/100}return o.type!==k.None&&(n.alpha=Math.min(1,Math.max(0,o.type===k.Number?o.value:o.value/100))),n}var gt={mode:`hsl`,toMode:{rgb:ut},fromMode:{rgb:dt},channels:[`h`,`s`,`l`,`alpha`],ranges:{h:[0,360]},gamut:`rgb`,parse:[ht,mt],serialize:e=>`hsl(${e.h===void 0?`none`:e.h} ${e.s===void 0?`none`:e.s*100+`%`} ${e.l===void 0?`none`:e.l*100+`%`}${e.alpha<1?` / ${e.alpha}`:``})`,interpolate:{h:{use:N,fixup:I},s:N,l:N,alpha:{use:N,fixup:P}},difference:{h:Re},average:{h:R}};function _t({h:e,s:t,v:n,alpha:r}){e=F(e===void 0?0:e),t===void 0&&(t=0),n===void 0&&(n=0);let i=Math.abs(e/60%2-1),a;switch(Math.floor(e/60)){case 0:a={r:n,g:n*(1-t*i),b:n*(1-t)};break;case 1:a={r:n*(1-t*i),g:n,b:n*(1-t)};break;case 2:a={r:n*(1-t),g:n,b:n*(1-t*i)};break;case 3:a={r:n*(1-t),g:n*(1-t*i),b:n};break;case 4:a={r:n*(1-t*i),g:n*(1-t),b:n};break;case 5:a={r:n,g:n*(1-t),b:n*(1-t*i)};break;default:a={r:n*(1-t),g:n*(1-t),b:n*(1-t)}}return a.mode=`rgb`,r!==void 0&&(a.alpha=r),a}function vt({r:e,g:t,b:n,alpha:r}){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);
4let i=Math.max(e,t,n),a=Math.min(e,t,n),o={mode:`hsv`,s:i===0?0:1-a/i,v:i};return i-a!==0&&(o.h=(i===e?(t-n)/(i-a)+(t<n)*6:i===t?(n-e)/(i-a)+2:(e-t)/(i-a)+4)*60),r!==void 0&&(o.alpha=r),o}var yt={mode:`hsv`,toMode:{rgb:_t},parse:[`--hsv`],serialize:`--hsv`,fromMode:{rgb:vt},channels:[`h`,`s`,`v`,`alpha`],ranges:{h:[0,360]},gamut:`rgb`,interpolate:{h:{use:N,fixup:I},s:N,v:N,alpha:{use:N,fixup:P}},difference:{h:Re},average:{h:R}};function bt({h:e,w:t,b:n,alpha:r}){if(t===void 0&&(t=0),n===void 0&&(n=0),t+n>1){let e=t+n;t/=e,n/=e}return _t({h:e,s:n===1?1:1-t/(1-n),v:1-n,alpha:r})}function xt(e){let t=vt(e);if(t===void 0)return;let n=t.s===void 0?0:t.s,r=t.v===void 0?0:t.v,i={mode:`hwb`,w:(1-n)*r,b:1-r};return t.h!==void 0&&(i.h=t.h),t.alpha!==void 0&&(i.alpha=t.alpha),i}function St(e,t){if(!t||t[0]!==`hwb`)return;let n={mode:`hwb`},[,r,i,a,o]=t;if(r.type!==k.None){if(r.type===k.Percentage)return;n.h=r.value}if(i.type!==k.None){if(i.type===k.Hue)return;n.w=i.value/100}if(a.type!==k.None){if(a.type===k.Hue)return;n.b=a.value/100}return o.type!==k.None&&(n.alpha=Math.min(1,Math.max(0,o.type===k.Number?o.value:o.value/100))),n}var Ct={mode:`hwb`,toMode:{rgb:bt},fromMode:{rgb:xt},channels:[`h`,`w`,`b`,`alpha`],ranges:{h:[0,360]},gamut:`rgb`,parse:[St],serialize:e=>`hwb(${e.h===void 0?`none`:e.h} ${e.w===void 0?`none`:e.w*100+`%`} ${e.b===void 0?`none`:e.b*100+`%`}${e.alpha<1?` / ${e.alpha}`:``})`,interpolate:{h:{use:N,fixup:I},w:N,b:N,alpha:{use:N,fixup:P}},difference:{h:ze},average:{h:R}},wt=.1593017578125,Tt=78.84375,Et=.8359375,Dt=18.8515625,Ot=18.6875;function kt(e){if(e<0)return 0;let t=e**(1/Tt);return 1e4*(Math.max(0,t-Et)/(Dt-Ot*t))**(1/wt)}function At(e){if(e<0)return 0;let t=(e/1e4)**wt;return((Et+Dt*t)/(1+Ot*t))**+Tt}var jt=e=>Math.max(e/203,0),Mt=({i:e,t,p:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=kt(e+.008609037037932761*t+.11102962500302593*n),a=kt(e-.00860903703793275*t-.11102962500302599*n),o=kt(e+.5600313357106791*t-.32062717498731885*n),s={mode:`xyz65`,x:jt(2.070152218389422*i-1.3263473389671556*a+.2066510476294051*o),y:jt(.3647385209748074*i+.680566024947227*a-.0453045459220346*o),z:jt(-.049747207535812*i-.0492609666966138*a+1.1880659249923042*o)};return r!==void 0&&(s.alpha=r),s},Nt=(e=0)=>Math.max(e*203,0),Pt=({x:e,y:t,z:n,alpha:r})=>{let i=Nt(e),a=Nt(t),o=Nt(n),s=At(.3592832590121217*i+.6976051147779502*a-.0358915932320289*o),c=At(-.1920808463704995*i+1.1004767970374323*a+.0753748658519118*o),l=At(.0070797844607477*i+.0748396662186366*a+.8433265453898765*o),u={mode:`itp`,i:.5*s+.5*c,t:1.61376953125*s-3.323486328125*c+1.709716796875*l,p:4.378173828125*s-4.24560546875*c-.132568359375*l};return r!==void 0&&(u.alpha=r),u},Ft={mode:`itp`,channels:[`i`,`t`,`p`,`alpha`],parse:[`--ictcp`],serialize:`--ictcp`,toMode:{xyz65:Mt,rgb:e=>Oe(Mt(e))},fromMode:{xyz65:Pt,rgb:e=>Pt(Te(e))},ranges:{i:[0,.581],t:[-.369,.272],p:[-.164,.331]},interpolate:{i:N,t:N,p:N,alpha:{use:N,fixup:P}}},It=134.03437499999998,Lt=16295499532821565e-27,Rt=e=>{if(e<0)return 0;let t=(e/1e4)**wt;return((Et+Dt*t)/(1+Ot*t))**+It},zt=(e=0)=>Math.max(e*203,0),Bt=({x:e,y:t,z:n,alpha:r})=>{e=zt(e),t=zt(t),n=zt(n);let i=1.15*e-.15*n,a=.66*t+.34*e,o=Rt(.41478972*i+.579999*a+.014648*n),s=Rt(-.20151*i+1.120649*a+.0531008*n),c=Rt(-.0166008*i+.2648*a+.6684799*n),l=(o+s)/2,u={mode:`jab`,j:.44*l/(1-.56*l)-Lt,a:3.524*o-4.066708*s+.542708*c,b:.199076*o+1.096799*s-1.295875*c};return r!==void 0&&(u.alpha=r),u},Vt=134.03437499999998,Ht=16295499532821565e-27,Ut=e=>{if(e<0)return 0;let t=e**(1/Vt);return 1e4*((Et-t)/(Ot*t-Dt))**(1/wt)},Wt=e=>e/203,Gt=({j:e,a:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=(e+Ht)/(.44+.56*(e+Ht)),a=Ut(i+.13860504*t+.058047316*n),o=Ut(i-.13860504*t-.058047316*n),s=Ut(i-.096019242*t-.8118919*n),c={mode:`xyz65`,x:Wt(1.661373024652174*a-.914523081304348*o+.23136208173913045*s),y:Wt(-.3250758611844533*a+1.571847026732543*o-.21825383453227928*s),z:Wt(-.090982811*a-.31272829*o+1.5227666*s)};return r!==void 0&&(c.alpha=r),c},Kt=e=>{let t=Bt(Te(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},qt=e=>Oe(Gt(e)),Jt={mode:`jab`,channels:[`j`,`a`,`b`,`alpha`],parse:[`--jzazbz`],seri
4alize:`--jzazbz`,fromMode:{rgb:Kt,xyz65:Bt},toMode:{rgb:qt,xyz65:Gt},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:N,a:N,b:N,alpha:{use:N,fixup:P}}},Yt=({j:e,a:t,b:n,alpha:r})=>{t===void 0&&(t=0),n===void 0&&(n=0);let i=Math.sqrt(t*t+n*n),a={mode:`jch`,j:e,c:i};return i&&(a.h=F(Math.atan2(n,t)*180/Math.PI)),r!==void 0&&(a.alpha=r),a},Xt=({j:e,c:t,h:n,alpha:r})=>{n===void 0&&(n=0);let i={mode:`jab`,j:e,a:t?t*Math.cos(n/180*Math.PI):0,b:t?t*Math.sin(n/180*Math.PI):0};return r!==void 0&&(i.alpha=r),i},Zt={mode:`jch`,parse:[`--jzczhz`],serialize:`--jzczhz`,toMode:{jab:Xt,rgb:e=>qt(Xt(e))},fromMode:{rgb:e=>Yt(Kt(e)),jab:Yt},channels:[`j`,`c`,`h`,`alpha`],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:N,fixup:I},c:N,j:N,alpha:{use:N,fixup:P}},difference:{h:Be},average:{h:R}},Qt=29**3/3**3,$t=6**3/29**3,en=e=>e**3>$t?e**3:(116*e-16)/Qt,tn=({l:e,a:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=(e+16)/116,a=t/500+i,o=i-n/200,s={mode:`xyz50`,x:en(a)*V.X,y:en(i)*V.Y,z:en(o)*V.Z};return r!==void 0&&(s.alpha=r),s},nn=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=De({r:e*3.1341359569958707-t*1.6173863321612538-.4906619460083532*n,g:e*-.978795502912089+t*1.916254567259524+.03344273116131949*n,b:e*.07195537988411677-t*.2289768264158322+1.405386058324125*n});return r!==void 0&&(i.alpha=r),i},rn=e=>nn(tn(e)),an=e=>{let{r:t,g:n,b:r,alpha:i}=we(e),a={mode:`xyz50`,x:.436065742824811*t+.3851514688337912*n+.14307845442264197*r,y:.22249319175623702*t+.7168870538238823*n+.06061979053616537*r,z:.013923904500943465*t+.09708128566574634*n+.7140993584005155*r};return i!==void 0&&(a.alpha=i),a},on=e=>e>$t?Math.cbrt(e):(Qt*e+16)/116,sn=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=on(e/V.X),a=on(t/V.Y),o=on(n/V.Z),s={mode:`lab`,l:116*a-16,a:500*(i-a),b:200*(a-o)};return r!==void 0&&(s.alpha=r),s},cn=e=>{let t=sn(an(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t};function ln(e,t){if(!t||t[0]!==`lab`)return;let n={mode:`lab`},[,r,i,a,o]=t;if(!(r.type===k.Hue||i.type===k.Hue||a.type===k.Hue))return r.type!==k.None&&(n.l=Math.min(Math.max(0,r.value),100)),i.type!==k.None&&(n.a=i.type===k.Number?i.value:i.value*125/100),a.type!==k.None&&(n.b=a.type===k.Number?a.value:a.value*125/100),o.type!==k.None&&(n.alpha=Math.min(1,Math.max(0,o.type===k.Number?o.value:o.value/100))),n}var un={mode:`lab`,toMode:{xyz50:tn,rgb:rn},fromMode:{xyz50:sn,rgb:cn},channels:[`l`,`a`,`b`,`alpha`],ranges:{l:[0,100],a:[-125,125],b:[-125,125]},parse:[ln],serialize:e=>`lab(${e.l===void 0?`none`:e.l} ${e.a===void 0?`none`:e.a} ${e.b===void 0?`none`:e.b}${e.alpha<1?` / ${e.alpha}`:``})`,interpolate:{l:N,a:N,b:N,alpha:{use:N,fixup:P}}},dn={...un,mode:`lab65`,parse:[`--lab-d65`],serialize:`--lab-d65`,toMode:{xyz65:Ke,rgb:qe},fromMode:{xyz65:Ye,rgb:Xe},ranges:{l:[0,100],a:[-125,125],b:[-125,125]}};function fn(e,t){if(!t||t[0]!==`lch`)return;let n={mode:`lch`},[,r,i,a,o]=t;if(r.type!==k.None){if(r.type===k.Hue)return;n.l=Math.min(Math.max(0,r.value),100)}if(i.type!==k.None&&(n.c=Math.max(0,i.type===k.Number?i.value:i.value*150/100)),a.type!==k.None){if(a.type===k.Percentage)return;n.h=a.value}return o.type!==k.None&&(n.alpha=Math.min(1,Math.max(0,o.type===k.Number?o.value:o.value/100))),n}var pn={mode:`lch`,toMode:{lab:B,rgb:e=>rn(B(e))},fromMode:{rgb:e=>z(cn(e)),lab:z},channels:[`l`,`c`,`h`,`alpha`],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[fn],serialize:e=>`lch(${e.l===void 0?`none`:e.l} ${e.c===void 0?`none`:e.c} ${e.h===void 0?`none`:e.h}${e.alpha<1?` / ${e.alpha}`:``})`,interpolate:{h:{use:N,fixup:I},c:N,l:N,alpha:{use:N,fixup:P}},difference:{h:Be},average:{h:R}},mn={...pn,mode:`lch65`,parse:[`--lch-d65`],serialize:`--lch-d65`,toMode:{lab65:e=>B(e,`lab65`),rgb:e=>qe(B(e,`lab65`))},fromMode:{rgb:e=>z(Xe(e),`lch65`),lab65:e=>z(e,`lch65`)},ranges:{l:[0,100],c:[0,150],h:[0,360]}},hn=({l:e,u:t,v:n,alpha:r})=>{t===void 0&&(t=0),n===void 0&&(n=0);let i=Math.sqrt(t*t+n*n),a={mode:`lchuv`,l:e,c:i};return i&&(a.h=F(Math.atan2(n,t)*180/Math.PI)),r!==void 0&&(a.alpha=r),a},gn=({l:e,c:t,h:n,alpha:r})=>{n===void 0&&(n=0);let i={mode:`luv`,l:e,u:t?t*Math.cos(n/180*Math.PI):0,v:t?t*Math.sin(n/180*Math.PI):0};return r!==void 0&&(i.alpha=r),i},_n=(e,t,n)=>4*e/(e+15*t+3*n),vn=(e,t,n)=>9*t/(e+15*t+3*n),yn=_n(V.X,V.Y,V.Z),bn=vn(V.X,V.Y,V.Z),xn=e=>e<=$t?Qt*e:116*Math.cbrt(e)-16,Sn=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=xn(t/V.Y),a=_n(e,t,n),o=vn(e,t,n);!isFinite(a)||!isFinite(o)?i=a=o=0:(a=13*i*(a-yn),o=13*i*(o-bn));let s={mode:`luv`,l:i,u:a,v:o};return r!==void 0&&(s.alpha=r),s},Cn=(e,t,n)=>4*e/(e+15*t+3*n),wn=(e,t,n)=>9*t/(e+15*t+3*n),Tn=Cn(V.X,V.Y,V.Z),En=wn(V.X,V.Y,V.Z),Dn=({l:e,u:t,v:n,alpha:r})=>{if(e===void 0&&(e=0),e===0)return{mode:`xyz50`,x:0,y:0,z:0};t===void 0&&(t=0),n===void 0&&(n=0);let i=t/(13*e)+Tn,a=n/(13*e)+En,o=V.Y*(e<=8?e/Qt:((e+16)/116)**3),s={mode:`xyz50`,x:9*i*o/(4*a),y:o,z:o*(12-3*i-20*a)/(4*a)};return r!==void 0&&(s.alpha=r),s},On={mode:`lchuv`,toMode:{luv:gn,rgb:e=>nn(Dn(gn(e)))},fromMode:{rgb:e=>hn(Sn(an(e))),luv:hn},channels:[`l`,`c`,`h`,`alpha`],parse:[`--lchuv`],serialize:`--lchuv`,ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:N,fixup:I},c:N,l:N,alpha:{use:N,fixup:P}},difference:{h:Be},average:{h:R}},kn={...ve,mode:`lrgb`,toMode:{rgb:De},fromMode:{rgb:we},parse:[`srgb-linear`],serialize:`srgb-linear`},An={mode:`luv`,toMode:{xyz50:Dn,rgb:e=>nn(Dn(e))},fromMode:{xyz50:Sn,rgb:e=>Sn(an(e))},channels:[`l`,`u`,`v`,`alpha`],parse:[`--luv`],serialize:`--luv`,ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:N,u:N,v:N,alpha:{use:N,fixup:P}}},jn=({r:e,g:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=Math.cbrt(.412221469470763*e+.5363325372617348*t+.0514459932675022*n),a=Math.cbrt(.2119034958178252*e+.6806995506452344*t+.1073969535369406*n),o=Math.cbrt(.0883024591900564*e+.2817188391361215*t+.6299787016738222*n),s={mode:`oklab`,l:.210454268309314*i+.7936177747023054*a-.0040720430116193*o,a:1.9779985324311684*i-2.42859224204858*a+.450593709617411*o,b:.0259040424655478*i+.7827717124575296*a-.8086757549230774*o};return r!==void 0&&(s.alpha=r),s},Mn=e=>{let t=jn(we(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},Nn=({l:e,a:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=(e+.3963377773761749*t+.2158037573099136*n)**3,a=(e-.1055613458156586*t-.0638541728258133*n)**3,o=(e-.0894841775298119*t-1.2914855480194092*n)**3,s={mode:`lrgb`,r:4.076741636075957*i-3.3077115392580616*a+.2309699031821044*o,g:-1.2684379732850317*i+2.6097573492876887*a-.3413193760026573*o,b:-.0041960761386756*i-.7034186179359362*a+1.7076146940746117*o};return r!==void 0&&(s.alpha=r),s},Pn=e=>De(Nn(e));function Fn(e){let t=.206,n=1.206/1.03;return .5*(n*e-t+Math.sqrt((n*e-t)*(n*e-t)+4*.03*n*e))}function In(e){return(e*e+.206*e)/(1.206/1.03*(e+.03))}function Ln(e,t){let n,r,i,a,o,s,c,l;-1.88170328*e-.80936493*t>1?(n=1.19086277,r=1.76576728,i=.59662641,a=.75515197,o=.56771245,s=4.0767416621,c=-3.3077115913,l=.2309699292):1.81444104*e-1.19445276*t>1?(n=.73956515,r=-.45954404,i=.08285427,a=.1254107,o=.14503204,s=-1.2684380046,c=2.6097574011,l=-.3413193965):(n=1.35733652,r=-.00915799,i=-1.1513021,a=-.50559606,o=.00692167,s=-.0041960863,c=-.7034186147,l=1.707614701);let u=n+r*e+i*t+a*e*e+o*e*t,d=.3963377774*e+.2158037573*t,f=-.1055613458*e-.0638541728*t,p=-.0894841775*e-1.291485548*t;{let e=1+u*d,t=1+u*f,n=1+u*p,r=e*e*e,i=t*t*t,a=n*n*n,o=3*d*e*e,m=3*f*t*t,h=3*p*n*n,g=6*d*d*e,_=6*f*f*t,v=6*p*p*n,y=s*r+c*i+l*a,b=s*o+c*m+l*h,x=s*g+c*_+l*v;u-=y*b/(b*b-.5*y*x)}return u}function Rn(e,t){let n=Ln(e,t),r=Nn({l:1,a:n*e,b:n*t}),i=Math.cbrt(1/Math.max(r.r,r.g,r.b));return[i,i*n]}function zn(e,t,n,r,i,a=null){a||=Rn(e,t);let o;
vendor: 5,092 bytes, line 4
4if((n-i)*a[1]-(a[0]-i)*r<=0)o=a[1]*i/(r*a[0]+a[1]*(i-n));else{o=a[1]*(i-1)/(r*(a[0]-1)+a[1]*(i-n));{let a=n-i,s=r,c=.3963377774*e+.2158037573*t,l=-.1055613458*e-.0638541728*t,u=-.0894841775*e-1.291485548*t,d=a+s*c,f=a+s*l,p=a+s*u;{let e=i*(1-o)+o*n,t=o*r,a=e+t*c,s=e+t*l,m=e+t*u,h=a*a*a,g=s*s*s,_=m*m*m,v=3*d*a*a,y=3*f*s*s,b=3*p*m*m,x=6*d*d*a,S=6*f*f*s,C=6*p*p*m,w=4.0767416621*h-3.3077115913*g+.2309699292*_-1,T=4.0767416621*v-3.3077115913*y+.2309699292*b,ee=4.0767416621*x-3.3077115913*S+.2309699292*C,te=T/(T*T-.5*w*ee),E=-w*te,D=-1.2684380046*h+2.6097574011*g-.3413193965*_-1,ne=-1.2684380046*v+2.6097574011*y-.3413193965*b,O=-1.2684380046*x+2.6097574011*S-.3413193965*C,re=ne/(ne*ne-.5*D*O),k=-D*re,A=-.0041960863*h-.7034186147*g+1.707614701*_-1,j=-.0041960863*v-.7034186147*y+1.707614701*b,ie=-.0041960863*x-.7034186147*S+1.707614701*C,ae=j/(j*j-.5*A*ie),M=-A*ae;E=te>=0?E:1e6,k=re>=0?k:1e6,M=ae>=0?M:1e6,o+=Math.min(E,Math.min(k,M))}}}return o}function Bn(e,t,n=null){n||=Rn(e,t);let r=n[0],i=n[1];return[i/r,i/(1-r)]}function Vn(e,t,n){let r=Rn(t,n),i=zn(t,n,e,1,e,r),a=Bn(t,n,r),o=.11516993+1/(7.4477897+4.1590124*n+t*(-2.19557347+1.75198401*n+t*(-2.13704948-10.02301043*n+t*(-4.24894561+5.38770819*n+4.69891013*t)))),s=.11239642+1/(1.6132032-.68124379*n+t*(.40370612+.90148123*n+t*(-.27087943+.6122399*n+t*(.00299215-.45399568*n-.14661872*t)))),c=i/Math.min(e*a[0],(1-e)*a[1]),l=e*o,u=(1-e)*s,d=.9*c*Math.sqrt(Math.sqrt(1/(1/(l*l*l*l)+1/(u*u*u*u))));return l=e*.4,u=(1-e)*.8,[Math.sqrt(1/(1/(l*l)+1/(u*u))),d,i]}function Hn(e){let t=e.l===void 0?0:e.l,n=e.a===void 0?0:e.a,r=e.b===void 0?0:e.b,i={mode:`okhsl`,l:Fn(t)};e.alpha!==void 0&&(i.alpha=e.alpha);let a=Math.sqrt(n*n+r*r);if(!a)return i.s=0,i;let[o,s,c]=Vn(t,n/a,r/a),l;if(a<s){let e=.8*o,t=1-e/s;l=(a-0)/(e+t*(a-0))*.8}else{let e=s,t=.2*s*s*1.25*1.25/o,n=1-t/(c-s);l=.8+.2*((a-e)/(t+n*(a-e)))}return l&&(i.s=l,i.h=F(Math.atan2(r,n)*180/Math.PI)),i}function Un(e){let t=e.h===void 0?0:e.h,n=e.s===void 0?0:e.s,r=e.l===void 0?0:e.l,i={mode:`oklab`,l:In(r)};if(e.alpha!==void 0&&(i.alpha=e.alpha),!n||r===1)return i.a=i.b=0,i;let a=Math.cos(t/180*Math.PI),o=Math.sin(t/180*Math.PI),[s,c,l]=Vn(i.l,a,o),u,d,f,p;n<.8?(u=1.25*n,d=0,f=.8*s,p=1-f/c):(u=5*(n-.8),d=c,f=.2*c*c*1.25*1.25/s,p=1-f/(l-c));let m=d+u*f/(1-p*u);return i.a=m*a,i.b=m*o,i}var Wn={...gt,mode:`okhsl`,channels:[`h`,`s`,`l`,`alpha`],parse:[`--okhsl`],serialize:`--okhsl`,fromMode:{oklab:Hn,rgb:e=>Hn(Mn(e))},toMode:{oklab:Un,rgb:e=>Pn(Un(e))}};function Gn(e){let t=e.l===void 0?0:e.l,n=e.a===void 0?0:e.a,r=e.b===void 0?0:e.b,i=Math.sqrt(n*n+r*r),a=i?n/i:1,o=i?r/i:1,[s,c]=Bn(a,o),l=.5,u=1-l/s,d=c/(i+t*c),f=d*t,p=d*i,m=In(f),h=p*m/f,g=Nn({l:m,a:a*h,b:o*h}),_=Math.cbrt(1/Math.max(g.r,g.g,g.b,0));t/=_,i=i/_*Fn(t)/t,t=Fn(t);let v={mode:`okhsv`,s:i?(l+c)*p/(c*l+c*u*p):0,v:t?t/f:0};return v.s&&(v.h=F(Math.atan2(r,n)*180/Math.PI)),e.alpha!==void 0&&(v.alpha=e.alpha),v}function Kn(e){let t={mode:`oklab`};e.alpha!==void 0&&(t.alpha=e.alpha);let n=e.h===void 0?0:e.h,r=e.s===void 0?0:e.s,i=e.v===void 0?0:e.v,a=Math.cos(n/180*Math.PI),o=Math.sin(n/180*Math.PI),[s,c]=Bn(a,o),l=.5,u=1-l/s,d=1-r*l/(l+c-c*u*r),f=r*c*l/(l+c-c*u*r),p=In(d),m=f*p/d,h=Nn({l:p,a:a*m,b:o*m}),g=Math.cbrt(1/Math.max(h.r,h.g,h.b,0)),_=In(i*d),v=f*_/d;return t.l=_*g,t.a=v*a*g,t.b=v*o*g,t}var qn={...yt,mode:`okhsv`,channels:[`h`,`s`,`v`,`alpha`],parse:[`--okhsv`],serialize:`--okhsv`,fromMode:{oklab:Gn,rgb:e=>Gn(Mn(e))},toMode:{oklab:Kn,rgb:e=>Pn(Kn(e))}};function Jn(e,t){if(!t||t[0]!==`oklab`)return;let n={mode:`oklab`},[,r,i,a,o]=t;if(!(r.type===k.Hue||i.type===k.Hue||a.type===k.Hue))return r.type!==k.None&&(n.l=Math.min(Math.max(0,r.type===k.Number?r.value:r.value/100),1)),i.type!==k.None&&(n.a=i.type===k.Number?i.value:i.value*.4/100),a.type!==k.None&&(n.b=a.type===k.Number?a.value:a.value*.4/100),o.type!==k.None&&(n.alpha=Math.min(1,Math.max(0,o.type===k.Number?o.value:o.value/100))),n}var Yn={...un,mode:`oklab`,toMode:{lrgb:Nn,rgb:Pn},fromMode:{lrgb:jn,rgb:Mn},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[Jn],serialize:e=>`oklab(${e.l===void 0?`none`:e.l} ${e.a===void 0?`none`:e.a} ${e.b===void 0?`none`:e.b}${e.alpha<1?` / ${e.alpha}`:``})`};function Xn(e,t){if(!t||t[0]!==`oklch`)return;let n={mode:`oklch`},[,r,i,a,o]=t;if(r.type!==k.None){if(r.type===k.Hue)return;n.l=Math.min(Math.max(0,r.type===k.Number?r.value:r.value/100),1)}if(i.type!==k.None&&(n.c=Math.max(0,i.type===k.Number?i.value:i.value*.4/100)),a.type!==k.None){if(a.type===k.Percentage)return;n.h=a.value}return o.type!==k.None&&(n.alpha=Math.min(1,Math.max(0,o.type===k.Number?o.value:o.value/100))),n}var Zn={...pn,mode:`oklch`,toMode:{oklab:e=>B(e,`oklab`),rgb:e=>Pn(B(e,`oklab`))},fromMode:{rgb:e=>z(Mn(e),`oklch`),oklab:e=>z(e,`oklch`)},parse:[Xn],serialize:e=>`oklch(${e.l===void 0?`none`:e.l} ${e.c===void 0?`none`:e.c} ${e.h===void 0?`none`:e.h}${e.alpha<1?` / ${e.alpha}`:``})`,ranges:{l:[0,1],c:[0,.4],h:[0,360]}},Qn=e=>{let{r:t,g:n,b:r,alpha:i}=we(e),a={mode:`xyz65`,x:.486570948648216*t+.265667693169093*n+.1982172852343625*r,y:.2289745640697487*t+.6917385218365062*n+.079286914093745*r,z
4:0*t+.0451133818589026*n+1.043944368900976*r};return i!==void 0&&(a.alpha=i),a},$n=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=De({r:e*2.4934969119414263-t*.9313836179191242-.402710784450717*n,g:e*-.8294889695615749+t*1.7626640603183465+.0236246858419436*n,b:e*.0358458302437845-t*.0761723892680418+.9568845240076871*n},`p3`);return r!==void 0&&(i.alpha=r),i},er={...ve,mode:`p3`,parse:[`display-p3`],serialize:`display-p3`,fromMode:{rgb:e=>$n(Te(e)),xyz65:$n},toMode:{rgb:e=>Oe(Qn(e)),xyz65:Qn}},tr=e=>{let t=Math.abs(e);return t>=1/512?Math.sign(e)*t**(1/1.8):16*e},nr=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i={mode:`prophoto`,r:tr(e*1.3457868816471585-t*.2555720873797946-.0511018649755453*n),g:tr(e*-.5446307051249019+t*1.5082477428451466+.0205274474364214*n),b:tr(e*0+t*0+1.2119675456389452*n)};return r!==void 0&&(i.alpha=r),i},rr=(e=0)=>{let t=Math.abs(e);return t>=16/512?Math.sign(e)*t**1.8:e/16},ir=e=>{let t=rr(e.r),n=rr(e.g),r=rr(e.b),i={mode:`xyz50`,x:.7977666449006423*t+.1351812974005331*n+.0313477341283922*r,y:.2880748288194013*t+.7118352342418731*n+899369387256e-16*r,z:0*t+0*n+.8251046025104602*r};return e.alpha!==void 0&&(i.alpha=e.alpha),i},ar={...ve,mode:`prophoto`,parse:[`prophoto-rgb`],serialize:`prophoto-rgb`,fromMode:{xyz50:nr,rgb:e=>nr(an(e))},toMode:{xyz50:ir,rgb:e=>nn(ir(e))}},or=1.09929682680944,sr=.018053968510807,cr=e=>{let t=Math.abs(e);return t>sr?(Math.sign(e)||1)*(or*t**.45-(or-1)):4.5*e},lr=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i={mode:`rec2020`,r:cr(e*1.7166511879712683-t*.3556707837763925-.2533662813736599*n),g:cr(e*-.6666843518324893+t*1.6164812366349395+.0157685458139111*n),b:cr(e*.0176398574453108-t*.0427706132578085+.9421031212354739*n)};return r!==void 0&&(i.alpha=r),i},ur=1.09929682680944,dr=.018053968510807,fr=(e=0)=>{let t=Math.abs(e);return t<dr*4.5?e/4.5:(Math.sign(e)||1)*((t+ur-1)/ur)**(1/.45)},pr=e=>{let t=fr(e.r),n=fr(e.g),r=fr(e.b),i={mode:`xyz65`,x:.6369580483012911*t+.1446169035862083*n+.1688809751641721*r,y:.262700212011267*t+.6779980715188708*n+.059301716469862*r,z:0*t+.0280726930490874*n+1.0609850577107909*r};return e.alpha!==void 0&&(i.alpha=e.alpha),i},mr={...ve,mode:`rec2020`,fromMode:{xyz65:lr,rgb:e=>lr(Te(e))},toMode:{xyz65:pr,rgb:e=>Oe(pr(e))},parse:[`rec2020`],serialize:`rec2020`},hr=.0037930732552754493,gr=Math.cbrt(hr),_r=e=>Math.cbrt(e)-gr,vr=e=>{let{r:t,g:n,b:r,alpha:i}=we(e),a=_r(.3*t+.622*n+.078*r+hr),o=_r(.23*t+.692*n+.078*r+hr),s=_r(.2434226892454782*t+.2047674442449682*n+.5518098665095535*r+hr),c={mode:`xyb`,x:(a-o)/2,y:(a+o)/2,b:s-(a+o)/2};return i!==void 0&&(c.alpha=i),c},yr=e=>(e+gr)**3,br={mode:`xyb`,channels:[`x`,`y`,`b`,`alpha`],parse:[`--xyb`],serialize:`--xyb`,toMode:{rgb:({x:e,y:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i=yr(e+t)-hr,a=yr(t-e)-hr,o=yr(n+t)-hr,s=De({r:11.031566904639861*i-9.866943908131562*a-.16462299650829934*o,g:-3.2541473810744237*i+4.418770377582723*a-.16462299650829934*o,b:-3.6588512867136815*i+2.7129230459360922*a+1.9459282407775895*o});return r!==void 0&&(s.alpha=r),s}},fromMode:{rgb:vr},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:N,y:N,b:N,alpha:{use:N,fixup:P}}},xr={mode:`xyz50`,parse:[`xyz-d50`],serialize:`xyz-d50`,toMode:{rgb:nn,lab:sn},fromMode:{rgb:an,lab:tn},channels:[`x`,`y`,`z`,`alpha`],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:N,y:N,z:N,alpha:{use:N,fixup:P}}},Sr={mode:`xyz65`,toMode:{rgb:Oe,xyz50:e=>{let{x:t,y:n,z:r,alpha:i}=e;t===void 0&&(t=0),n===void 0&&(n=0),r===void 0&&(r=0);let a={mode:`xyz50`,x:1.0479298208405488*t+.0229467933410191*n-.0501922295431356*r,y:.0296278156881593*t+.990434484573249*n-.0170738250293851*r,z:-.0092430581525912*t+.0150551448965779*n+.7518742899580008*r};return i!==void 0&&(a.alpha=i),a}},fromMode:{rgb:Te,xyz50:e=>{let{x:t,y:n,z:r,alpha:i}=e;t===void 0&&(t=0),n===void 0&&(n=0),r===void 0&&(r=0);let a={mode:`xyz65`,x:.9554734527042182*t-.0230985368742614*n+.0632593086610217*r,y:-.0283697069632081*t+1.0099954580058226*n+.021041398966943*r,z:.0123140016883199*t-.0205076964334779*n+1.3303659366080753*r};return i!==void 0&&(a.alpha=i),a}},ranges:{x:[0,.95],y:[0,1],z:[0,1.088]},channels:[`x`,`y`,`z`,`alpha`],parse:[`xyz`,`xyz-d65`],serialize:`xyz-d65`,interpolate:{x:N,y:N,z:N,alpha:{use:N,fixup:P}}},Cr={mode:`yiq`,toMode:{rgb:({y:e,i:t,q:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i={mode:`rgb`,r:e+.95608445*t+.6208885*n,g:e-.27137664*t-.6486059*n,b:e
4-1.10561724*t+1.70250126*n};return r!==void 0&&(i.alpha=r),i}},fromMode:{rgb:({r:e,g:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let i={mode:`yiq`,y:.29889531*e+.58662247*t+.11448223*n,i:.59597799*e-.2741761*t-.32180189*n,q:.21147017*e-.52261711*t+.31114694*n};return r!==void 0&&(i.alpha=r),i}},channels:[`y`,`i`,`q`,`alpha`],parse:[`--yiq`],serialize:`--yiq`,ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:N,i:N,q:N,alpha:{use:N,fixup:P}}},wr=(e,t)=>Math.round(e*(t=10**t))/t;((e=4)=>t=>typeof t==`number`?wr(t,e):t)(2);var Tr=e=>Math.max(0,Math.min(1,e||0)),Er=e=>Math.round(Tr(e)*255),Dr=S(`rgb`),Or=e=>{if(e===void 0)return;let t=Er(e.r),n=Er(e.g),r=Er(e.b);return`#`+(1<<24|t<<16|n<<8|r).toString(16).slice(1)},kr=e=>{let t=x(e);if(!t)return;let n=D(t.mode);if(!n.serialize||typeof n.serialize==`string`){let e=`color(${n.serialize||`--${t.mode}`} `;return n.channels.forEach((n,r)=>{n!==`alpha`&&(e+=(r?` `:``)+(t[n]===void 0?`none`:t[n]))}),t.alpha!==void 0&&t.alpha<1&&(e+=` / ${t.alpha}`),e+`)`}if(typeof n.serialize==`function`)return n.serialize(t)},Ar=e=>Or(Dr(e));E(ke),E(Ve),E(at),E(ot),E(lt);var jr=E(gt);E(yt),E(Ct),E(Ft),E(Jt),E(Zt),E(un),E(dn),E(pn),E(mn),E(On),E(kn),E(An),E(Wn),E(qn),E(Yn);var Mr=E(Zn);E(er),E(ar),E(mr);var Nr=E(ve);E(br),E(xr),E(Sr),E(Cr);var Pr=e(t(),1);function H(e){return e<0?-1:e===0?0:1}function Fr(e,t,n){return(1-n)*e+n*t}function Ir(e,t,n){return n<e?e:n>t?t:n}function Lr(e,t,n){return n<e?e:n>t?t:n}function Rr(e){return e%=360,e<0&&(e+=360),e}function zr(e){return e%=360,e<0&&(e+=360),e}function Br(e,t){return 180-Math.abs(Math.abs(e-t)-180)}function Vr(e,t){return[e[0]*t[0][0]+e[1]*t[0][1]+e[2]*t[0][2],e[0]*t[1][0]+e[1]*t[1][1]+e[2]*t[1][2],e[0]*t[2][0]+e[1]*t[2][1]+e[2]*t[2][2]]}var Hr=[[.41233895,.35762064,.18051042],[.2126,.7152,.0722],[.01932141,.11916382,.95034478]],Ur=[[3.2413774792388685,-1.5376652402851851,-.49885366846268053],[-.9691452513005321,1.8758853451067872,.04156585616912061],[.05562093689691305,-.20395524564742123,1.0571799111220335]],Wr=[95.047,100,108.883];function Gr(e,t,n){return(255<<24|(e&255)<<16|(t&255)<<8|n&255)>>>0}function Kr(e){return Gr(ni(e[0]),ni(e[1]),ni(e[2]))}function qr(e){return e>>16&255}function Jr(e){return e>>8&255}function Yr(e){return e&255}function Xr(e,t,n){let r=Ur,i=r[0][0]*e+r[0][1]*t+r[0][2]*n,a=r[1][0]*e+r[1][1]*t+r[1][2]*n,o=r[2][0]*e+r[2][1]*t+r[2][2]*n;return Gr(ni(i),ni(a),ni(o))}function Zr(e){return Vr([ti(qr(e)),ti(Jr(e)),ti(Yr(e))],Hr)}function Qr(e){let t=ni(U(e));return Gr(t,t,t)}function $r(e){let t=Zr(e)[1];return 116*ii(t/100)-16}function U(e){return 100*ai((e+16)/116)}function ei(e){return ii(e/100)*116-16}function ti(e){let t=e/255;return t<=.040449936?t/12.92*100:((t+.055)/1.055)**2.4*100}function ni(e){let t=e/100,n=0;return n=t<=.0031308?t*12.92:1.055*t**(1/2.4)-.055,Ir(0,255,Math.round(n*255))}function ri(){return Wr}function ii(e){return e>.008856451679035631?e**(1/3):(903.2962962962963*e+16)/116}function ai(e){let t=e*e*e;return t>.008856451679035631?t:(116*e-16)/903.2962962962963}var W=class e{static make(t=ri(),n=200/Math.PI*U(50)/100,r=50,i=2,a=!1){let o=t,s=o[0]*.401288+o[1]*.650173+o[2]*-.051461,c=o[0]*-.250268+o[1]*1.204414+o[2]*.045854,l=o[0]*-.002079+o[1]*.048952+o[2]*.953127,u=.8+i/10,d=u>=.9?Fr(.59,.69,(u-.9)*10):Fr(.525,.59,(u-.8)*10),f=a?1:u*(1-1/3.6*Math.exp((-n-42)/92));f=f>1?1:f<0?0:f;let p=u,m=[100/s*f+1-f,100/c*f+1-f,100/l*f+1-f],h=1/(5*n+1),g=h*h*h*h,_=1-g,v=g*n+.1*_*_*Math.cbrt(5*n),y=U(r)/t[1],b=1.48+Math.sqrt(y),x=.725/y**.2,S=x,C=[(v*m[0]*s/100)**.42,(v*m[1]*c/100)**.42,(v*m[2]*l/100)**.42],w=[400*C[0]/(C[0]+27.13),400*C[1]/(C[1]+27.13),400*C[2]/(C[2]+27.13)],T=(2*w[0]+w[1]+.05*w[2])*x;return new e(y,T,x,S,d,p,m,v,v**.25,b)}constructor(e,t,n,r,i,a,o,s,c,l){this.n=e,this.aw=t,this.nbb=n,this.ncb=r,this.c=i,this.nc=a,this.rgbD=o,this.fl=s,this.fLRoot=c,this.z=l}};W.DEFAULT=W.make();var oi=class e{constructor(e,t,n,r,i,a,o,s,c){this.hue=e,this.chroma=t,this.j=n,this.q=r,this.m=i,this.s=a,this.jstar=o,this.astar=s,this.bstar=c}distance(e){let t=this.jstar-e.jstar,n=this.astar-e.astar,r=this.bstar-e.bstar;return 1.41*Math.sqrt(t*t+n*n+r*r)**.63}static fromInt(t){return e.fromIntInViewingConditions(t,W.DEFAULT)}static fromIntInViewingConditions(t,n){let r=(t&16711680)>>16,i=(t&65280)>>8,a=t&255,o=ti(r),s=ti(i),c=ti(a),l=.41233895*o+.35762064*s+.18051042*c,u=.2126*o+.7152*s+.0722*c,d=.01932141*o+.11916382*s+.95034478*c,f=.401288*l+.650173*u-.051461*d,p=-.250268*l+1.204414*u+.045854*d,m=-.002079*l+.048952*u+.953127*d,h=n.rgbD[0]*f,g=n.rgbD[1]*p,_=n.rgbD[2]*m,v=(n.fl*Math.abs(h)/100)**.42,y=(n.fl*Math.abs(g)/100)**.42,b=(n.fl*Math.abs(_)/100)**.42,x=H(h)*400*v/(v+27.13),S=H(g)*400*y/(y+27.13),C=H(_)*400*b/(b+27.
413),w=(11*x+-12*S+C)/11,T=(x+S-2*C)/9,ee=(20*x+20*S+21*C)/20,te=(40*x+20*S+C)/20,E=Math.atan2(T,w)*180/Math.PI,D=E<0?E+360:E>=360?E-360:E,ne=D*Math.PI/180,O=100*(te*n.nbb/n.aw)**+(n.c*n.z),re=4/n.c*Math.sqrt(O/100)*(n.aw+4)*n.fLRoot,k=D<20.14?D+360:D,A=(5e4/13*(.25*(Math.cos(k*Math.PI/180+2)+3.8))*n.nc*n.ncb*Math.sqrt(w*w+T*T)/(ee+.305))**.9*(1.64-.29**n.n)**.73,j=A*Math.sqrt(O/100),ie=j*n.fLRoot,ae=50*Math.sqrt(A*n.c/(n.aw+4)),M=1.7000000000000002*O/(1+.007*O),oe=1/.0228*Math.log(1+.0228*ie),se=oe*Math.cos(ne),ce=oe*Math.sin(ne);return new e(D,j,O,re,ie,ae,M,se,ce)}static fromJch(t,n,r){return e.fromJchInViewingConditions(t,n,r,W.DEFAULT)}static fromJchInViewingConditions(t,n,r,i){let a=4/i.c*Math.sqrt(t/100)*(i.aw+4)*i.fLRoot,o=n*i.fLRoot,s=n/Math.sqrt(t/100),c=50*Math.sqrt(s*i.c/(i.aw+4)),l=r*Math.PI/180,u=1.7000000000000002*t/(1+.007*t),d=1/.0228*Math.log(1+.0228*o),f=d*Math.cos(l),p=d*Math.sin(l);return new e(r,n,t,a,o,c,u,f,p)}static fromUcs(t,n,r){return e.fromUcsInViewingConditions(t,n,r,W.DEFAULT)}static fromUcsInViewingConditions(t,n,r,i){let a=n,o=r,s=Math.sqrt(a*a+o*o),c=(Math.exp(s*.0228)-1)/.0228/i.fLRoot,l=180/Math.PI*Math.atan2(o,a);l<0&&(l+=360);let u=t/(1-(t-100)*.007);return e.fromJchInViewingConditions(u,c,l,i)}toInt(){return this.viewed(W.DEFAULT)}viewed(e){let t=((this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100))/(1.64-.29**e.n)**.73)**(1/.9),n=this.hue*Math.PI/180,r=.25*(Math.cos(n+2)+3.8),i=e.aw*(this.j/100)**(1/e.c/e.z),a=5e4/13*r*e.nc*e.ncb,o=i/e.nbb,s=Math.sin(n),c=Math.cos(n),l=23*(o+.305)*t/(23*a+11*t*c+108*t*s),u=l*c,d=l*s,f=(460*o+451*u+288*d)/1403,p=(460*o-891*u-261*d)/1403,m=(460*o-220*u-6300*d)/1403,h=Math.max(0,27.13*Math.abs(f)/(400-Math.abs(f))),g=H(f)*(100/e.fl)*h**(1/.42),_=Math.max(0,27.13*Math.abs(p)/(400-Math.abs(p))),v=H(p)*(100/e.fl)*_**(1/.42),y=Math.max(0,27.13*Math.abs(m)/(400-Math.abs(m))),b=H(m)*(100/e.fl)*y**(1/.42),x=g/e.rgbD[0],S=v/e.rgbD[1],C=b/e.rgbD[2];return Xr(1.86206786*x-1.01125463*S+.14918677*C,.38752654*x+.62144744*S-.00897398*C,-.0158415*x-.03412294*S+1.04996444*C)}static fromXyzInViewingConditions(t,n,r,i){let a=.401288*t+.650173*n-.051461*r,o=-.250268*t+1.204414*n+.045854*r,s=-.002079*t+.048952*n+.953127*r,c=i.rgbD[0]*a,l=i.rgbD[1]*o,u=i.rgbD[2]*s,d=(i.fl*Math.abs(c)/100)**.42,f=(i.fl*Math.abs(l)/100)**.42,p=(i.fl*Math.abs(u)/100)**.42,m=H(c)*400*d/(d+27.13),h=H(l)*400*f/(f+27.13),g=H(u)*400*p/(p+27.13),_=(11*m+-12*h+g)/11,v=(m+h-2*g)/9,y=(20*m+20*h+21*g)/20,b=(40*m+20*h+g)/20,x=Math.atan2(v,_)*180/Math.PI,S=x<0?x+360:x>=360?x-360:x,C=S*Math.PI/180,w=100*(b*i.nbb/i.aw)**+(i.c*i.z),T=4/i.c*Math.sqrt(w/100)*(i.aw+4)*i.fLRoot,ee=S<20.14?S+360:S,te=(5e4/13*(1/4*(Math.cos(ee*Math.PI/180+2)+3.8))*i.nc*i.ncb*Math.sqrt(_*_+v*v)/(y+.305))**.9*(1.64-.29**i.n)**.73,E=te*Math.sqrt(w/100),D=E*i.fLRoot,ne=50*Math.sqrt(te*i.c/(i.aw+4)),O=1.7000000000000002*w/(1+.007*w),re=Math.log(1+.0228*D)/.0228,k=re*Math.cos(C),A=re*Math.sin(C);return new e(S,E,w,T,D,ne,O,k,A)}xyzInViewingConditions(e){let t=((this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100))/(1.64-.29**e.n)**.73)**(1/.9),n=this.hue*Math.PI/180,r=.25*(Math.cos(n+2)+3.8),i=e.aw*(this.j/100)**(1/e.c/e.z),a=5e4/13*r*e.nc*e.ncb,o=i/e.nbb,s=Math.sin(n),c=Math.cos(n),l=23*(o+.305)*t/(23*a+11*t*c+108*t*s),u=l*c,d=l*s,f=(460*o+451*u+288*d)/1403,p=(460*o-891*u-261*d)/1403,m=(460*o-220*u-6300*d)/1403,h=Math.max(0,27.13*Math.abs(f)/(400-Math.abs(f))),g=H(f)*(100/e.fl)*h**(1/.42),_=Math.max(0,27.13*Math.abs(p)/(400-Math.abs(p))),v=H(p)*(100/e.fl)*_**(1/.42),y=Math.max(0,27.13*Math.abs(m)/(400-Math.abs(m))),b=H(m)*(100/e.fl)*y**(1/.42),x=g/e.rgbD[0],S=v/e.rgbD[1],C=b/e.rgbD[2];return[1.86206786*x-1.01125463*S+.14918677*C,.38752654*x+.62144744*S-.00897398*C,-.0158415*x-.03412294*S+1.04996444*C]}},G=class e{static sanitizeRadians(e){return(e+Math.PI*8)%(Math.PI*2)}static trueDelinearized(e){let t=e/100,n=0;return n=t<=.0031308?t*12.92:1.055*t**(1/2.4)-.055,n*255}static chromaticAdaptation(e){let t=Math.abs(e)**.42;return H(e)*400*t/(t+27.13)}static hueOf(t){let n=Vr(t,e.SCALED_DISCOUNT_FROM_LINRGB),r=e.chromaticAdaptation(n[0]),i=e.chromaticAdaptation(n[1]),a=e.chromaticAdaptation(n[2]),o=(11*r+-12*i+a)/11,s=(r+i-2*a)/9;return Math.atan2(s,o)}static areInCyclicOrder(t,n,r){return e.sanitizeRadians(n-t)<e.sanitizeRadians(r-t)}static intercept(e,t,n){return(t-e)/(n-e)}static lerpPoint(e,t,n){return[e[0]+(n[0]-e[0])*t,e[1]+(n[1]-e[1])*t,e[2]+(n[2]-e[2])*t]}static setCoordinate(t,n,r,i){let a=e.intercept(t[i],n,r[i]);return e.lerpPoint(t,a,r)}static isBounded(e){return 0<=e&&e<=100}static nthVertex(t,n){let r=e.Y_FROM_LINRGB[0],i=e.Y_FROM_LINRGB[1],a=e.Y_FROM_LINRGB[2],o=n%4<=1?0:100,s=n%2==0?0:100;if(n<4){let n=o,c=s,l=(t-n*i-c*a)/r;return e.isBounded(l)?[l,n,c]:[-1,-1,-1]}else if(n<8){let n=o,c=s,l=(t-c*r-n*a)/i;return e.isBounded(l)?[c,l,n]:[-1,-1,-1]}else{let n=o,c=s,l=(t-n*r-c*i)/a;return e.isBounded(l)?[n,c,l]:[-1,-1,-1]}}static bisectToSegment(t,n){let r=[-1,-1,-1],i=r,a=0,o=0,s=!1,c=!0;for(let l=0;l<12;l++){let u=e.nthVertex(t,l);if(u[0]<0)continue;let d=e.hueOf(u);
4if(!s){r=u,i=u,a=d,o=d,s=!0;continue}(c||e.areInCyclicOrder(a,d,o))&&(c=!1,e.areInCyclicOrder(a,n,d)?(i=u,o=d):(r=u,a=d))}return[r,i]}static midpoint(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2,(e[2]+t[2])/2]}static criticalPlaneBelow(e){return Math.floor(e-.5)}static criticalPlaneAbove(e){return Math.ceil(e-.5)}static bisectToLimit(t,n){let r=e.bisectToSegment(t,n),i=r[0],a=e.hueOf(i),o=r[1];for(let t=0;t<3;t++)if(i[t]!==o[t]){let r=-1,s=255;i[t]<o[t]?(r=e.criticalPlaneBelow(e.trueDelinearized(i[t])),s=e.criticalPlaneAbove(e.trueDelinearized(o[t]))):(r=e.criticalPlaneAbove(e.trueDelinearized(i[t])),s=e.criticalPlaneBelow(e.trueDelinearized(o[t])));for(let c=0;c<8&&!(Math.abs(s-r)<=1);c++){let c=Math.floor((r+s)/2),l=e.CRITICAL_PLANES[c],u=e.setCoordinate(i,l,o,t),d=e.hueOf(u);e.areInCyclicOrder(a,n,d)?(o=u,s=c):(i=u,a=d,r=c)}}return e.midpoint(i,o)}static inverseChromaticAdaptation(e){let t=Math.abs(e),n=Math.max(0,27.13*t/(400-t));return H(e)*n**(1/.42)}static findResultByJ(t,n,r){let i=Math.sqrt(r)*11,a=W.DEFAULT,o=1/(1.64-.29**a.n)**.73,s=.25*(Math.cos(t+2)+3.8)*(5e4/13)*a.nc*a.ncb,c=Math.sin(t),l=Math.cos(t);for(let t=0;t<5;t++){let u=i/100,d=((n===0||i===0?0:n/Math.sqrt(u))*o)**(1/.9),f=a.aw*u**(1/a.c/a.z)/a.nbb,p=23*(f+.305)*d/(23*s+11*d*l+108*d*c),m=p*l,h=p*c,g=(460*f+451*m+288*h)/1403,_=(460*f-891*m-261*h)/1403,v=(460*f-220*m-6300*h)/1403,y=Vr([e.inverseChromaticAdaptation(g),e.inverseChromaticAdaptation(_),e.inverseChromaticAdaptation(v)],e.LINRGB_FROM_SCALED_DISCOUNT);if(y[0]<0||y[1]<0||y[2]<0)return 0;let b=e.Y_FROM_LINRGB[0],x=e.Y_FROM_LINRGB[1],S=e.Y_FROM_LINRGB[2],C=b*y[0]+x*y[1]+S*y[2];if(C<=0)return 0;if(t===4||Math.abs(C-r)<.002)return y[0]>100.01||y[1]>100.01||y[2]>100.01?0:Kr(y);i-=(C-r)*i/(2*C)}return 0}static solveToInt(t,n,r){if(n<1e-4||r<1e-4||r>99.9999)return Qr(r);t=zr(t);let i=t/180*Math.PI,a=U(r),o=e.findResultByJ(i,n,a);return o===0?Kr(e.bisectToLimit(a,i)):o}static solveToCam(t,n,r){return oi.fromInt(e.solveToInt(t,n,r))}};G.SCALED_DISCOUNT_FROM_LINRGB=[[.001200833568784504,.002389694492170889,.0002795742885861124],[.0005891086651375999,.0029785502573438758,.0003270666104008398],[.00010146692491640572,.0005364214359186694,.0032979401770712076]],G.LINRGB_FROM_SCALED_DISCOUNT=[[1373.2198709594231,-1100.4251190754821,-7.278681089101213],[-271.815969077903,559.6580465940733,-32.46047482791194],[1.9622899599665666,-57.173814538844006,308.7233197812385]],G.Y_FROM_LINRGB=[.2126,.7152,.0722],G.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.42984823
40738664,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];var K=class e{static from(t,n,r){return new e(G.solveToInt(t,n,r))}static fromInt(t){return new e(t)}toInt(){return this.argb}get hue(){return this.internalHue}set hue(e){this.setInternalState(G.solveToInt(e,this.internalChroma,this.internalTone))}get chroma(){return this.internalChroma}set chroma(e){this.setInternalState(G.solveToInt(this.internalHue,e,this.internalTone))}get tone(){return this.internalTone}set tone(e){this.setInternalState(G.solveToInt(this.internalHue,this.internalChroma,e))}constructor(e){this.argb=e;let t=oi.fromInt(e);this.internalHue=t.hue,this.internalChroma=t.chroma,this.internalTone=$r(e),this.argb=e}setInternalState(e){let t=oi.fromInt(e);this.internalHue=t.hue,this.internalChroma=t.chroma,this.internalTone=$r(e),this.argb=e}inViewingConditions(t){let n=oi.fromInt(this.toInt()).xyzInViewingConditions(t),r=oi.fromXyzInViewingConditions(n[0],n[1],n[2],W.make());return e.from(r.hue,r.chroma,ei(n[1]))}},q=class e{static ratioOfTones(t,n){return t=Lr(0,100,t),n=Lr(0,100,n),e.ratioOfYs(U(t),U(n))}static ratioOfYs(e,t){let n=e>t?e:t,r=n===t?e:t;return(n+5)/(r+5)}static lighter(t,n){if(t<0||t>100)return-1;let r=U(t),i=n*(r+5)-5,a=e.ratioOfYs(i,r),o=Math.abs(a-n);if(a<n&&o>.04)return-1;let s=ei(i)+.4;return s<0||s>100?-1:s}static darker(t,n){if(t<0||t>100)return-1;let r=U(t),i=(r+5)/n-5,a=e.ratioOfYs(r,i),o=Math.abs(a-n);if(a<n&&o>.04)return-1;let s=ei(i)-.4;return s<0||s>100?-1:s}static lighterUnsafe(t,n){let r=e.lighter(t,n);return r<0?100:r}static darkerUnsafe(t,n){let r=e.darker(t,n);return r<0?0:r}},si=class e{static isDisliked(e){let t=Math.round(e.hue)>=90&&Math.round(e.hue)<=111,n=Math.round(e.chroma)>16,r=Math.round(e.tone)<65;return t&&n&&r}static fixIfDisliked(t){return e.isDisliked(t)?K.from(t.hue,t.chroma,70):t}},J=class e{static fromPalette(t){return new e(t.name??``,t.palette,t.tone,t.isBackground??!1,t.background,t.secondBackground,t.contrastCurve,t.toneDeltaPair)}constructor(e,t,n,r,i,a,o,s){if(this.name=e,this.palette=t,this.tone=n,this.isBackground=r,this.background=i,this.secondBackgroun
4d=a,this.contrastCurve=o,this.toneDeltaPair=s,this.hctCache=new Map,!i&&a)throw Error(`Color ${e} has secondBackgrounddefined, but background is not defined.`);if(!i&&o)throw Error(`Color ${e} has contrastCurvedefined, but background is not defined.`);if(i&&!o)throw Error(`Color ${e} has backgrounddefined, but contrastCurve is not defined.`)}getArgb(e){return this.getHct(e).toInt()}getHct(e){let t=this.hctCache.get(e);if(t!=null)return t;let n=this.getTone(e),r=this.palette(e).getHct(n);return this.hctCache.size>4&&this.hctCache.clear(),this.hctCache.set(e,r),r}getTone(t){let n=t.contrastLevel<0;if(this.toneDeltaPair){let r=this.toneDeltaPair(t),i=r.roleA,a=r.roleB,o=r.delta,s=r.polarity,c=r.stayTogether,l=this.background(t).getTone(t),u=s===`nearer`||s===`lighter`&&!t.isDark||s===`darker`&&t.isDark,d=u?i:a,f=u?a:i,p=this.name===d.name,m=t.isDark?1:-1,h=d.contrastCurve.get(t.contrastLevel),g=f.contrastCurve.get(t.contrastLevel),_=d.tone(t),v=q.ratioOfTones(l,_)>=h?_:e.foregroundTone(l,h),y=f.tone(t),b=q.ratioOfTones(l,y)>=g?y:e.foregroundTone(l,g);return n&&(v=e.foregroundTone(l,h),b=e.foregroundTone(l,g)),(b-v)*m>=o||(b=Lr(0,100,v+o*m),(b-v)*m>=o||(v=Lr(0,100,b-o*m))),50<=v&&v<60?m>0?(v=60,b=Math.max(b,v+o*m)):(v=49,b=Math.min(b,v+o*m)):50<=b&&b<60&&(c?m>0?(v=60,b=Math.max(b,v+o*m)):(v=49,b=Math.min(b,v+o*m)):b=m>0?60:49),p?v:b}else{let r=this.tone(t);if(this.background==null)return r;let i=this.background(t).getTone(t),a=this.contrastCurve.get(t.contrastLevel);if(q.ratioOfTones(i,r)>=a||(r=e.foregroundTone(i,a)),n&&(r=e.foregroundTone(i,a)),this.isBackground&&50<=r&&r<60&&(r=q.ratioOfTones(49,i)>=a?49:60),this.secondBackground){let[n,i]=[this.background,this.secondBackground],[o,s]=[n(t).getTone(t),i(t).getTone(t)],[c,l]=[Math.max(o,s),Math.min(o,s)];if(q.ratioOfTones(c,r)>=a&&q.ratioOfTones(l,r)>=a)return r;let u=q.lighter(c,a),d=q.darker(l,a),f=[];return u!==-1&&f.push(u),d!==-1&&f.push(d),e.tonePrefersLightForeground(o)||e.tonePrefersLightForeground(s)?u<0?100:u:f.length===1?f[0]:d<0?0:d}return r}}static foregroundTone(t,n){let r=q.lighterUnsafe(t,n),i=q.darkerUnsafe(t,n),a=q.ratioOfTones(r,t),o=q.ratioOfTones(i,t);if(e.tonePrefersLightForeground(t)){let e=Math.abs(a-o)<.1&&a<n&&o<n;return a>=n||a>=o||e?r:i}else return o>=n||o>=a?i:r}static tonePrefersLightForeground(e){return Math.round(e)<60}static toneAllowsLightForeground(e){return Math.round(e)<=49}static enableLightForeground(t){return e.tonePrefersLightForeground(t)&&!e.toneAllowsLightForeground(t)?49:t}},Y=class e{static fromInt(t){let n=K.fromInt(t);return e.fromHct(n)}static fromHct(t){return new e(t.hue,t.chroma,t)}static fromHueAndChroma(t,n){let r=new ci(t,n).create();return new e(t,n,r)}constructor(e,t,n){this.hue=e,this.chroma=t,this.keyColor=n,this.cache=new Map}tone(e){let t=this.cache.get(e);return t===void 0&&(t=K.from(this.hue,this.chroma,e).toInt(),this.cache.set(e,t)),t}getHct(e){return K.fromInt(this.tone(e))}},ci=class{constructor(e,t){this.hue=e,this.requestedChroma=t,this.chromaCache=new Map,this.maxChromaValue=200}create(){let e=0,t=100;for(;e<t;){let n=Math.floor((e+t)/2),r=this.maxChroma(n)<this.maxChroma(n+1);if(this.maxChroma(n)>=this.requestedChroma-.01)if(Math.abs(e-50)<Math.abs(t-50))t=n;else{if(e===n)return K.from(this.hue,this.requestedChroma,e);e=n}else r?e=n+1:t=n}return K.from(this.hue,this.requestedChroma,e)}maxChroma(e){if(this.chromaCache.has(e))return this.chromaCache.get(e);let t=K.from(this.hue,this.maxChromaValue,e).chroma;return this.chromaCache.set(e,t),t}},X=class{constructor(e,t,n,r){this.low=e,this.normal=t,this.medium=n,this.high=r}get(e){return e<=-1?this.low:e<0?Fr(this.low,this.normal,(e- -1)/1):e<.5?Fr(this.normal,this.medium,(e-0)/.5):e<1?Fr(this.medium,this.high,(e-.5)/.5):this.high}},Z=class{constructor(e,t,n,r,i){this.roleA=e,this.roleB=t,this.delta=n,this.polarity=r,this.stayTogether=i}},li;(function(e){e[e.MONOCHROME=0]=`MONOCHROME`,e[e.NEUTRAL=1]=`NEUTRAL`,e[e.TONAL_SPOT=2]=`TONAL_SPOT`,e[e.VIBRANT=3]=`VIBRANT`,e[e.EXPRESSIVE=4]=`EXPRESSIVE`,e[e.FIDELITY=5]=`FIDELITY`,e[e.CONTENT=6]=`CONTENT`,e[e.RAINBOW=7]=`RAINBOW`,e[e.FRUIT_SALAD=8]=`FRUIT_SALAD`})(li||={});function ui(e){return e.variant===li.FIDELITY||e.variant===li.CONTENT}function Q(e){return e.variant===li.MONOCHROME}function di(e,t,n,r){let i=n,a=K.from(e,t,n);if(a.chroma<t){let n=a.chroma;for(;a.chroma<t;){i+=r?-1:1;let o=K.from(e,t,i);if(n>o.chroma||Math.abs(o.chroma-t)<.4)break;Math.abs(o.chroma-t)<Math.abs(a.chroma-t)&&(a=o),n=Math.max(n,o.chroma)}}return i}var $=class e{static highestSurface(t){return t.isDark?e.surfaceBright:e.surfaceDim}};
vendor: 10,623 bytes, line 4
4$.contentAccentToneDelta=15,$.primaryPaletteKeyColor=J.fromPalette({name:`primary_palette_key_color`,palette:e=>e.primaryPalette,tone:e=>e.primaryPalette.keyColor.tone}),$.secondaryPaletteKeyColor=J.fromPalette({name:`secondary_palette_key_color`,palette:e=>e.secondaryPalette,tone:e=>e.secondaryPalette.keyColor.tone}),$.tertiaryPaletteKeyColor=J.fromPalette({name:`tertiary_palette_key_color`,palette:e=>e.tertiaryPalette,tone:e=>e.tertiaryPalette.keyColor.tone}),$.neutralPaletteKeyColor=J.fromPalette({name:`neutral_palette_key_color`,palette:e=>e.neutralPalette,tone:e=>e.neutralPalette.keyColor.tone}),$.neutralVariantPaletteKeyColor=J.fromPalette({name:`neutral_variant_palette_key_color`,palette:e=>e.neutralVariantPalette,tone:e=>e.neutralVariantPalette.keyColor.tone}),$.background=J.fromPalette({name:`background`,palette:e=>e.neutralPalette,tone:e=>e.isDark?6:98,isBackground:!0}),$.onBackground=J.fromPalette({name:`on_background`,palette:e=>e.neutralPalette,tone:e=>e.isDark?90:10,background:e=>$.background,contrastCurve:new X(3,3,4.5,7)}),$.surface=J.fromPalette({name:`surface`,palette:e=>e.neutralPalette,tone:e=>e.isDark?6:98,isBackground:!0}),$.surfaceDim=J.fromPalette({name:`surface_dim`,palette:e=>e.neutralPalette,tone:e=>e.isDark?6:new X(87,87,80,75).get(e.contrastLevel),isBackground:!0}),$.surfaceBright=J.fromPalette({name:`surface_bright`,palette:e=>e.neutralPalette,tone:e=>e.isDark?new X(24,24,29,34).get(e.contrastLevel):98,isBackground:!0}),$.surfaceContainerLowest=J.fromPalette({name:`surface_container_lowest`,palette:e=>e.neutralPalette,tone:e=>e.isDark?new X(4,4,2,0).get(e.contrastLevel):100,isBackground:!0}),$.surfaceContainerLow=J.fromPalette({name:`surface_container_low`,palette:e=>e.neutralPalette,tone:e=>e.isDark?new X(10,10,11,12).get(e.contrastLevel):new X(96,96,96,95).get(e.contrastLevel),isBackground:!0}),$.surfaceContainer=J.fromPalette({name:`surface_container`,palette:e=>e.neutralPalette,tone:e=>e.isDark?new X(12,12,16,20).get(e.contrastLevel):new X(94,94,92,90).get(e.contrastLevel),isBackground:!0}),$.surfaceContainerHigh=J.fromPalette({name:`surface_container_high`,palette:e=>e.neutralPalette,tone:e=>e.isDark?new X(17,17,21,25).get(e.contrastLevel):new X(92,92,88,85).get(e.contrastLevel),isBackground:!0}),$.surfaceContainerHighest=J.fromPalette({name:`surface_container_highest`,palette:e=>e.neutralPalette,tone:e=>e.isDark?new X(22,22,26,30).get(e.contrastLevel):new X(90,90,84,80).get(e.contrastLevel),isBackground:!0}),$.onSurface=J.fromPalette({name:`on_surface`,palette:e=>e.neutralPalette,tone:e=>e.isDark?90:10,background:e=>$.highestSurface(e),contrastCurve:new X(4.5,7,11,21)}),$.surfaceVariant=J.fromPalette({name:`surface_variant`,palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?30:90,isBackground:!0}),$.onSurfaceVariant=J.fromPalette({name:`on_surface_variant`,palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?80:30,background:e=>$.highestSurface(e),contrastCurve:new X(3,4.5,7,11)}),$.inverseSurface=J.fromPalette({name:`inverse_surface`,palette:e=>e.neutralPalette,tone:e=>e.isDark?90:20}),$.inverseOnSurface=J.fromPalette({name:`inverse_on_surface`,palette:e=>e.neutralPalette,tone:e=>e.isDark?20:95,background:e=>$.inverseSurface,contrastCurve:new X(4.5,7,11,21)}),$.outline=J.fromPalette({name:`outline`,palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?60:50,background:e=>$.highestSurface(e),contrastCurve:new X(1.5,3,4.5,7)}),$.outlineVariant=J.fromPalette({name:`outline_variant`,palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?30:80,background:e=>$.highestSurface(e),contrastCurve:new X(1,1,3,4.5)}),$.shadow=J.fromPalette({name:`shadow`,palette:e=>e.neutralPalette,tone:e=>0}),$.scrim=J.fromPalette({name:`scrim`,palette:e=>e.neutralPalette,tone:e=>0}),$.surfaceTint=J.fromPalette({name:`surface_tint`,palette:e=>e.primaryPalette,tone:e=>e.isDark?80:40,isBackground:!0}),$.primary=J.fromPalette({name:`primary`,palette:e=>e.primaryPalette,tone:e=>Q(e)?e.isDark?100:0:e.isDark?80:40,isBackground:!0,background:e=>$.highestSurface(e),contrastCurve:new X(3,4.5,7,7),toneDeltaPair:e=>new Z($.primaryContainer,$.primary,10,`nearer`,!1)}),$.onPrimary=J.fromPalette({name:`on_primary`,palette:e=>e.primaryPalette,tone:e=>Q(e)?e.isDark?10:90:e.isDark?20:100,background:e=>$.primary,contrastCurve:new X(4.5,7,11,21)}),$.primaryContainer=J.fromPalette({name:`primary_container`,palette:e=>e.primaryPalette,tone:e=>ui(e)?e.sourceColorHct.tone:Q(e)?e.isDark?85:25:e.isDark?30:90,isBackground:!0,background:e=>$.highestSurface(e),contrastCurve:new X(1,1,3,4.5),toneDeltaPair:e=>new Z($.primaryContainer,$.primary,10,`nearer`,!1)}),$.onPrimaryContainer=J.fromPalette({name:`on_primary_container`,palette:e=>e.primaryPalette,tone:e=>ui(e)?J.foregroundTone($.primaryContainer.tone(e),4.5):Q(e)?e.isDark?0:100:e.isDark?90:30,background:e=>$.primaryContainer,contrastCurve:new X(3,4.5,7,11)}),$.inversePrimary=J.fromPalette({name:`inverse_primary`,palette:e=>e.primaryPalette,tone:e=>e.isDark?40:80,background:e=>$.inverseSurface,contrastCurve:new X(3,4.5,7,7)}),$.secondary=J.fromPalette({name:`secondary`,palette:e=>e.secondaryPalette,tone:e=>e.isDark?80:40,isBackground:!0,background:e=>$.highestSurface(e),contrastCurve:new X(3,4.5,7,7),toneDeltaPair:e=>new Z($.secondaryContainer,$.secondary,10,`nearer`,!1)}),$.onSecondary=J.fromPalette({name:`on_secondary`,palette:e=>e.secondaryPalette,tone:e=>Q(e)?e.isDark?10:100:e.isDark?20:100,background:e=>$.secondary,contrastCurve:new X(4.5,7,11,21)}),$.secondaryContainer=J.fromPalette({name:`secondary_container`,palette:e=>e.secondaryPalette,tone:e=>{let t=e.isDark?30:90;return Q(e)?e.isDark?30:85:ui(e)?di(e.secondaryPalette.hue,e.secondaryPalette.chroma,t,!e.isDark):t},isBackground:!0,background:e=>$.highestSurface(e),contrastCurve:new X(1,1,3,4.5),toneDeltaPair:e=>new Z($.secondaryContainer,$.secondary,10,`nearer`,!1)}),$.onSecondaryContainer=J.fromPalette({name:`on_secondary_container`,palette:e=>e.secondaryPalette,tone:e=>Q(e)?e.isDark?90:10:ui(e)?J.foregroundTone($.secondaryContainer.tone(e),4.5):e.isDark?90:30,background:e=>$.secondaryContainer,contrastCurve:new X(3,4.5,7,11)}),$.tertiary=J.fromPalette({name:`tertiary`,palette:e=>e.tertiaryPalette,tone:e=>Q(e)?e.isDark?90:25:e.isDark?80:40,isBackground:!0,background:e=>$.highestSurface(e),contrastCurve:new X(3,4.5,7,7),toneDeltaPair:e=>new Z($.tertiaryContainer,$.tertiary,10,`nearer`,!1)}),$.onTertiary=J.fromPalette({name:`on_tertiary`,palette:e=>e.tertiaryPalette,tone:e=>Q(e)?e.isDark?10:90:e.isDark?20:100,background:e=>$.tertiary,contrastCurve:new X(4.5,7,11,21)}),$.tertiaryContainer=J.fromPalette({name:`tertiary_container`,palette:e=>e.tertiaryPalette,tone:e=>{if(Q(e))return e.isDark?60:49;if(!ui(e))return e.isDark?30:90;let t=e.tertiaryPalette.getHct(e.sourceColorHct.tone);return si.fixIfDisliked(t).tone},isBackground:!0,background:e=>$.highestSurface(e),contrastCurve:new X(1,1,3,4.5),toneDeltaPair:e=>new Z($.tertiaryContainer,$.tertiary,10,`nearer`,!1)}),$.onTertiaryContainer=J.fromPalette({name:`on_tertiary_container`,palette:e=>e.tertiaryPalette,tone:e=>Q(e)?e.isDark?0:100:ui(e)?J.foregroundTone($.tertiaryContainer.tone(e),4.5):e.isDark?90:30,background:e=>$.tertiaryContainer,contrastCurve:new X(3,4.5,7,11)}),$.error=J.fromPalette({name:`error`,palette:e=>e.errorPalette,tone:e=>e.isDark?80:40,isBackground:!0,background:e=>$.highestSurface(e),contrastCurve:new X(3,4.5,7,7),toneDeltaPair:e=>new Z($.errorContainer,$.error,10,`nearer`,!1)}),$.onError=J.fromPalette({name:`on_error`,palette:e=>e.errorPalette,tone:e=>e.isDark?20:100,background:e=>$.error,contrastCurve:new X(4.5,7,11,21)}),$.errorContainer=J.fromPalette({name:`error_container`,palette:e=>e.errorPalette,tone:e=>e.isDark?30:90,isBackground:!0,background:e=>$.highestSurface(e),contrastCurve:new X(1,1,3,4.5),toneDeltaPair:e=>new Z($.errorContainer,$.error,10,`nearer`,!1)}),$.onErrorContainer=J.fromPalette({name:`on_error_container`,palette:e=>e.errorPalette,tone:e=>Q(e)?e.isDark?90:10:e.isDark?90:30,background:e=>$.errorContainer,contrastCurve:new X(3,4.5,7,11)}),$.primaryFixed=J.fromPalette({name:`primary_fixed`,palette:e=>e.primaryPalette,tone:e=>Q(e)?40:90,isBackground:!0,background:e=>$.highestSurface(e),contrastCurve:new X(1,1,3,4.5),toneDeltaPair:e=>new Z($.primaryFixed,$.primaryFixedDim,10,`lighter`,!0)}),$.primaryFixedDim=J.fromPalette({name:`primary_fixed_dim`,palette:e=>e.primaryPalette,tone:e=>Q(e)?30:80,isBackground:!0,background:e=>$.highestSurface(e),contrastCurve:new X(1,1,3,4.5),toneDeltaPair:e=>new Z($.primaryFixed,$.primaryFixedDim,10,`lighter`,!0)}),$.onPrimaryFixed=J.fromPalette({name:`on_primary_fixed`,palette:e=>e.primaryPalette,tone:e=>Q(e)?100:10,background:e=>$.primaryFixedDim,secondBackground:e=>$.primaryFixed,contrastCurve:new X(4.5,7,11,21)}),$.onPrimaryFixedVariant=J.fromPalette({name:`on_primary_fixed_variant`,palette:e=>e.primaryPalette,tone:e=>Q(e)?90:30,background:e=>$.primaryFixedDim,secondBackground:e=>$.primaryFixed,contrastCurve:new X(3,4.5,7,11)}),$.secondaryFixed=J.fromPalette({name:`secondary_fixed`,palette:e=>e.secondaryPalette,tone:e=>Q(e)?80:90,isBackground:!0,background:e=>$.highestSurface(e),contrastCurve:new X(1,1,3,4.5),toneDeltaPair:e=>new Z($.secondaryFixed,$.secondaryFixedDim,10,`lighter`,!0)}),$.secondaryFixedDim=J.fromPalette({name:`secondary_fixed_dim`,palette:e=>e.secondaryPalette,tone:e=>Q(e)?70:80,isBackground:!0,background:e=>$.highestSurface(e),contrastCurve:new X(1,1,3,4.5),toneDeltaPair:e=>new Z($.secondaryFixed,$.secondaryFixedDim,10,`lighter`,!0)}),$.onSecondaryFixed=J.fromPalette({name:`on_secondary_fixed`,palette:e=>e.secondaryPalette,tone:e=>10,background:e=>$.secondaryFixedDim,secondBackground:e=>$.secondaryFixed,contrastCurve:new X(4.5,7,11,21)}),$.onSecondaryFixedVariant=J.fromPalette({name:`on_secondary_fixed_variant`,palette:e=>e.secondaryPalette,tone:e=>Q(e)?25:30,background:e=>$.secondaryFixedDim,secondBackground:e=>$.secondaryFixed,contrastCurve:new X(3,4.5,7,11)}),$.tertiaryFixed=J.fromPalette({name:`tertiary_fixed`,palette:e=>e.tertiaryPalette,tone:e=>Q(e)?40:90,isBackground:!0,background:e=>$.highestSurface(e),contrastCurve:new X(1,1,3,4.5),toneDeltaPair:e=>new Z($.tertiaryFixed,$.tertiaryFixedDim,10,`lighter`,!0)}),$.tertiaryFixedDim=J.fromPalette({name:`tertiary_fixed_dim`,palette:e=>e.tertiaryPalette,tone:e=>Q(e)?30:80,isBackground:!0,background:e=>$.highestSurface(e),contrastCurve:new X(1,1,3,4.5),toneDeltaPair:e=>new Z($.tertiaryFixed,$.tertiaryFixedDim,10,`lighter`,!0)}),$.onTertiaryFixed=J.fromPalette({name:`on_tertiary_fixed`,palette:e=>e.tertiaryPalette,tone:e=>Q(e)?100:10,background:e=>
4$.tertiaryFixedDim,secondBackground:e=>$.tertiaryFixed,contrastCurve:new X(4.5,7,11,21)}),$.onTertiaryFixedVariant=J.fromPalette({name:`on_tertiary_fixed_variant`,palette:e=>e.tertiaryPalette,tone:e=>Q(e)?90:30,background:e=>$.tertiaryFixedDim,secondBackground:e=>$.tertiaryFixed,contrastCurve:new X(3,4.5,7,11)});var fi=class{constructor(e){this.sourceColorArgb=e.sourceColorArgb,this.variant=e.variant,this.contrastLevel=e.contrastLevel,this.isDark=e.isDark,this.sourceColorHct=K.fromInt(e.sourceColorArgb),this.primaryPalette=e.primaryPalette,this.secondaryPalette=e.secondaryPalette,this.tertiaryPalette=e.tertiaryPalette,this.neutralPalette=e.neutralPalette,this.neutralVariantPalette=e.neutralVariantPalette,this.errorPalette=Y.fromHueAndChroma(25,84)}static getRotatedHue(e,t,n){let r=e.hue;if(t.length!==n.length)throw Error(`mismatch between hue length ${t.length} & rotations ${n.length}`);if(n.length===1)return zr(e.hue+n[0]);let i=t.length;for(let e=0;e<=i-2;e++){let i=t[e],a=t[e+1];if(i<r&&r<a)return zr(r+n[e])}return r}getArgb(e){return e.getArgb(this)}getHct(e){return e.getHct(this)}get primaryPaletteKeyColor(){return this.getArgb($.primaryPaletteKeyColor)}get secondaryPaletteKeyColor(){return this.getArgb($.secondaryPaletteKeyColor)}get tertiaryPaletteKeyColor(){return this.getArgb($.tertiaryPaletteKeyColor)}
4get neutralPaletteKeyColor(){return this.getArgb($.neutralPaletteKeyColor)}get neutralVariantPaletteKeyColor(){return this.getArgb($.neutralVariantPaletteKeyColor)}get background(){return this.getArgb($.background)}get onBackground(){return this.getArgb($.onBackground)}get surface(){return this.getArgb($.surface)}get surfaceDim(){return this.getArgb($.surfaceDim)}get surfaceBright(){return this.getArgb($.surfaceBright)}get surfaceContainerLowest(){return this.getArgb($.surfaceContainerLowest)}get surfaceContainerLow(){return this.getArgb($.surfaceContainerLow)}get surfaceContainer(){return this.getArgb($.surfaceContainer)}get surfaceContainerHigh(){return this.getArgb($.surfaceContainerHigh)}get surfaceContainerHighest(){return this.getArgb($.surfaceContainerHighest)}get onSurface(){return this.getArgb($.onSurface)}get surfaceVariant(){return this.getArgb($.surfaceVariant)}get onSurfaceVariant(){return this.getArgb($.onSurfaceVariant)}get inverseSurface(){return this.getArgb($.inverseSurface)}get inverseOnSurface(){return this.getArgb($.inverseOnSurface)}get outline(){return this.getArgb($.outline)}get outlineVariant(){return this.getArgb($.outlineVariant)}get shadow(){return this.getArgb($.shadow)}get scrim(){return this.getArgb($.scrim)}get surfaceTint(){return this.getArgb($.surfaceTint)}get primary(){return this.getArgb($.primary)}get onPrimary(){return this.getArgb($.onPrimary)}get primaryContainer(){return this.getArgb($.primaryContainer)}get onPrimaryContainer(){return this.getArgb($.onPrimaryContainer)}get inversePrimary(){return this.getArgb($.inversePrimary)}get secondary(){return this.getArgb($.secondary)}get onSecondary(){return this.getArgb($.onSecondary)}get secondaryContainer(){return this.getArgb($.secondaryContainer)}get onSecondaryContainer(){return this.getArgb($.onSecondaryContainer)}get tertiary(){return this.getArgb($.tertiary)}get onTertiary(){return this.getArgb($.onTertiary)}get tertiaryContainer(){return this.getArgb($.tertiaryContainer)}get onTertiaryContainer(){return this.getArgb($.onTertiaryContainer)}get error(){return this.getArgb($.error)}get onError(){return this.getArgb($.onError)}get errorContainer(){return this.getArgb($.errorContainer)}
4get onErrorContainer(){return this.getArgb($.onErrorContainer)}get primaryFixed(){return this.getArgb($.primaryFixed)}get primaryFixedDim(){return this.getArgb($.primaryFixedDim)}get onPrimaryFixed(){return this.getArgb($.onPrimaryFixed)}get onPrimaryFixedVariant(){return this.getArgb($.onPrimaryFixedVariant)}get secondaryFixed(){return this.getArgb($.secondaryFixed)}get secondaryFixedDim(){return this.getArgb($.secondaryFixedDim)}get onSecondaryFixed(){return this.getArgb($.onSecondaryFixed)}get onSecondaryFixedVariant(){return this.getArgb($.onSecondaryFixedVariant)}get tertiaryFixed(){return this.getArgb($.tertiaryFixed)}get tertiaryFixedDim(){return this.getArgb($.tertiaryFixedDim)}get onTertiaryFixed(){return this.getArgb($.onTertiaryFixed)}get onTertiaryFixedVariant(){return this.getArgb($.onTertiaryFixedVariant)}},pi=class e extends fi{constructor(t,n,r){super({sourceColorArgb:t.toInt(),variant:li.EXPRESSIVE,contrastLevel:r,isDark:n,primaryPalette:Y.fromHueAndChroma(zr(t.hue+240),40),secondaryPalette:Y.fromHueAndChroma(fi.getRotatedHue(t,e.hues,e.secondaryRotations),24),tertiaryPalette:Y.fromHueAndChroma(fi.getRotatedHue(t,e.hues,e.tertiaryRotations),32),neutralPalette:Y.fromHueAndChroma(t.hue+15,8),neutralVariantPalette:Y.fromHueAndChroma(t.hue+15,12)})}};pi.hues=[0,21,51,121,151,191,271,321,360],pi.secondaryRotations=[45,95,45,20,45,90,45,45,45],pi.tertiaryRotations=[120,120,20,45,20,15,20,120,120];var mi=class e extends fi{constructor(t,n,r){super({sourceColorArgb:t.toInt(),variant:li.VIBRANT,contrastLevel:r,isDark:n,primaryPalette:Y.fromHueAndChroma(t.hue,200),secondaryPalette:Y.fromHueAndChroma(fi.getRotatedHue(t,e.hues,e.secondaryRotations),24),tertiaryPalette:Y.fromHueAndChroma(fi.getRotatedHue(t,e.hues,e.tertiaryRotations),32),neutralPalette:Y.fromHueAndChroma(t.hue,10),neutralVariantPalette:Y.fromHueAndChroma(t.hue,12)})}};mi.hues=[0,41,61,101,131,181,251,301,360],mi.secondaryRotations=[18,15,10,12,15,18,15,12,12],mi.tertiaryRotations=[35,30,20,25,30,35,30,25,25];var hi={desired:4,fallbackColorARGB:4282549748,filter:!0};function gi(e,t){return e.score>t.score?-1:+(e.score<t.score)}var _i=class e{constructor(){}static score(t,n){let{desired:r,fallbackColorARGB:i,filter:a}={...hi,...n},o=[],s=Array(360).fill(0),c=0;for(let[e,n]of t.entries()){let t=K.fromInt(e);o.push(t);let r=Math.floor(t.hue);s[r]+=n,c+=n}let l=Array(360).fill(0);for(let e=0;e<360;e++){let t=s[e]/c;for(let n=e-14;n<e+16;n++){let e=Rr(n);l[e]+=t}}let u=[];for(let t of o){let n=l[Rr(Math.round(t.hue))];if(a&&(t.chroma<e.CUTOFF_CHROMA||n<=e.CUTOFF_EXCITED_PROPORTION))continue;let r=n*100*e.WEIGHT_PROPORTION,i=t.chroma<e.TARGET_CHROMA?e.WEIGHT_CHROMA_BELOW:e.WEIGHT_CHROMA_ABOVE,o=r+(t.chroma-e.TARGET_CHROMA)*i;u.push({hct:t,score:o})}u.sort(gi);let d=[];for(let e=90;e>=15;e--){d.length=0;for(let{hct:t}of u)if(d.find(n=>Br(t.hue,n.hue)<e)||d.push(t),d.length>=r)break;if(d.length>=r)break}let f=[];d.length===0&&f.push(i);for(let e of d)f.push(e.toInt());return f}};_i.TARGET_CHROMA=48,_i.WEIGHT_PROPORTION=.7,_i.WEIGHT_CHROMA_ABOVE=.3,_i.WEIGHT_CHROMA_BELOW=.1,_i.CUTOFF_CHROMA=5,_i.CUTOFF_EXCITED_PROPORTION=.01;var vi={backgroundColor:`#333`,alternativeColor:`#333`,color:`#D9A84A`,originalColor:`#D9A84A`},yi=e=>{let t=jr(e);if(!t)throw Error(`Unable to parse color: ${e}`);return kr(t).match(/hsl\((.*)\)/)?.[1]??e},bi=(e=>{let t=Mr(pe(e.backgroundColor));if(!t)throw Error(`Unable to parse palette background`);let n=t.l;t.l*=.88,t.c*=.88,t.l<.25&&(t.l=.25);let r=.6;t.l>r&&(t.l=r+(t.l-r)*.5),t.c>.15&&(t.c=.15);let i=Mr(pe(e.backgroundColor));if(!i)throw Error(`Unable to parse palette background`);i.l>r&&(i.l=r+(i.l-r)*.5),i.c>.15&&(i.c=.15);let a={...t,l:.3},o=t.l<=.63?`dark`:`light`,s=o===`light`?`#000000`:`#ffffff`,c=o===`light`?`#000000`:`#ffffffee`,l={...t};o===`light`&&(l.l=n);let u=Mr(pe(e.color));if(!u)throw Error(`Unable to parse palette color`);let d=[{...t},u].reduce((e,t)=>e.c>t.c?e:t);d.l=.8,d.c<.01&&(d.h=270),d.c<.16&&(d.c=.16),d.c>.2&&(d.c=.2);let f={text:s,cardText:c,vibrant:Ar(d),vibrantSafe:Ar(d),...e,backgroundMuted:Ar(a),backgroundCard:Ar(t),backgroundCard2:Ar(i),backgroundCardShare:Ar(l)};return{...Object.fromEntries(Object.entries(f).map(([e,t])=>[e,yi(t)])),cardTheme:o}})(vi),xi=256,Si=new Map,Ci=new Map,wi=new Map,Ti,Ei=1,Di=(e,t)=>{if(Si.delete(e),Si.set(e,t),Si.size>xi){let e=Si.keys().next().value;e&&Si.delete(e)}},Oi=()=>(Ti??=new Worker(new URL(`/assets/worker-B004TPZb.js`,``+import.meta.url),{type:`module`,name:`adaptive-color`}),Ti.onmessage=({data:e})=>{let t=wi.get(e.id);t&&(wi.delete(e.id),`error`in e?t.reject(Error(e.error)):t.resolve(e.palette))},Ti.onerror=e=>{let t=Error(e.message||`Adaptive color Worker failed`);wi.forEach(({reject:e})=>{e(t)}),wi.clear(),Ti?.terminate(),Ti=void 0},Ti),ki=(e,t=`auto`,n=`perimeter`)=>{let r=`${t}:${n}:${e}`,i=Si.get(r);if(i)return Di(r,i),Promise.resolve(i);let a=Ci.get(r);if(a)return a;Oi();let s=o(e).then(e=>new Promise((r,i)=>{let a=Ei++;wi.set(a,{resolve:r,reject:i});try{Oi().postMessage({id:a,backend:t,edgeSampling:n,bitmap:e},[e])}catch(t){wi.delete(a),e.close(),i(t instanceof Error?t:Error(`Unable to transfer cover bitmap`))}})).catch(()=>bi).then(e=>(Di(r,e),e)).finally(()=>Ci.delete(r));return Ci.set(r,s),s},Ai=async(e,t,n,r)=>{let i=!1,a;e.then(e=>{i&&setTimeout(()=>n(e),0)});let o=new Promise(e=>{a=setTimeout(()=>{i=!0,e(t)},r)}),s=await Promise.race([e,o]);return a&&clearTimeout(a),s},ji=`webgpu-celebi-v4`,Mi=1e3,Ni=e=>{let t=jr(e);
4if(!t)throw Error(`Unable to parse color: ${e}`);return kr(t).match(/hsl\((.*)\)/)?.[1]??e},Pi=(e,t={})=>{let o=n(),s=r(),c=t.edgeSampling??`perimeter`,[l,u]=(0,Pr.useState)(o?e:null);(0,Pr.useEffect)(()=>{o&&u(e)},[e,o]);let d=a(l),f=[`adaptiveColor`,ji,c,l],{data:p}=i({queryKey:f,queryFn:async()=>{if(!d)throw Error(`Adaptive color query requires an image URL`);return Ai(ki(d,`auto`,c),bi,e=>s.setQueryData(f,e),Mi)},enabled:o&&!!(l&&d),throwOnError:!1,staleTime:`static`,gcTime:1/0});return p};export{Ar as a,S as c,Nr as i,Pi as n,pe as o,Mr as r,D as s,Ni as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.