@cobalt-ui/core
Advanced tools
Comparing version 1.4.3 to 1.5.0
# @cobalt-ui/core | ||
## 1.5.0 | ||
### Minor Changes | ||
- [#114](https://github.com/drwpow/cobalt-ui/pull/114) [`9f62035`](https://github.com/drwpow/cobalt-ui/commit/9f620359ee6c426279645a29edc5854085dd6045) Thanks [@drwpow](https://github.com/drwpow)! - Add "inset" property for shadows | ||
- [#114](https://github.com/drwpow/cobalt-ui/pull/114) [`9f62035`](https://github.com/drwpow/cobalt-ui/commit/9f620359ee6c426279645a29edc5854085dd6045) Thanks [@drwpow](https://github.com/drwpow)! - Support arrays of shadows | ||
## 1.4.3 | ||
@@ -4,0 +12,0 @@ |
@@ -25,8 +25,8 @@ /** | ||
*/ | ||
var wr=typeof process<"u"?!process.env.NODE_DISABLE_COLORS&&(!process.env.NO_COLOR||process.env.NO_COLOR=="0"):!0,Lr=wr?"\x1B[0m":"";var Rr=wr?"\x1B[33m":"";var tn=["0-9","A-Za-z","_$","\xC0-\xFF","\u0100-\u017F","\u0180-\u024F","\u0370-\u03FF","\u0400-\u04FF","\u0530-\u058F","\u0590-\u05FF","\u0600-\u06FF","\u0900-\u097F","\u1100-\u11FF","\u3040-\u309F","\u30A0-\u30FF","\u3400-\u4DBF","\u4E00-\u9FFF"];var rn=/[^-_.\s][-_.\s]+[^-_.\s]/g,Pi=new RegExp(`^[${tn.join("")}]+$`);function _r(e){return e.length<2?e:e.replace(rn,t=>`${t[0].toLocaleLowerCase()}${t[t.length-1].toLocaleUpperCase()}`)}function De(e){if(!e||typeof e=="string"||typeof e=="boolean"||typeof e=="number")return e;if(Array.isArray(e)){let r=[];for(let n of e)r.push(De(n));return r}let t={};for(let[r,n]of Object.entries(e))t[r]=De(n);return t}var Sr=/^\{([^}]+)\}$/;function pe(e){let t=e.match(Sr);return t?t[1]??t[0]:e}function W(e){return typeof e!="string"?!1:Sr.test(e)}function D(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Hr(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:D(e)?Object.keys(e).length===0:!1}function vt(e,t){if(e==null&&t.undefined)return t.undefined(e);if(typeof e=="string"&&t.string)return t.string(e);if(typeof e=="number"&&t.number)return t.number(e);if(Array.isArray(e)&&t.array)return t.array(e);if(D(e)&&t.object)return t.object(e);if(t.default)return t.default(e)}var on=(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}}},Fe=on;var nn={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},Xr=nn;var an=e=>Fe(Xr[e.toLowerCase()],6),Ar=an;var fn=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,ln=e=>{let t;return(t=e.match(fn))?Fe(parseInt(t[1],16),t[1].length):void 0},Er=ln;var S="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",rf=`(?:${S}|none)`,ie=`${S}%`,of=`(?:${S}%|none)`,ke=`(?:${S}%|${S})`,sn=`(?:${S}%|${S}|none)`,Or=`(?:${S}(deg|grad|rad|turn)|${S})`,nf=`(?:${S}(deg|grad|rad|turn)|${S}|none)`,Z="\\s*,\\s*";var af=new RegExp("^"+sn+"$");var pn=new RegExp(`^rgba?\\(\\s*${S}${Z}${S}${Z}${S}\\s*(?:,\\s*${ke}\\s*)?\\)$`),un=new RegExp(`^rgba?\\(\\s*${ie}${Z}${ie}${Z}${ie}\\s*(?:,\\s*${ke}\\s*)?\\)$`),mn=e=>{let t={mode:"rgb"},r;if(r=e.match(pn))r[1]!==void 0&&(t.r=r[1]/255),r[2]!==void 0&&(t.g=r[2]/255),r[3]!==void 0&&(t.b=r[3]/255);else if(r=e.match(un))r[1]!==void 0&&(t.r=r[1]/100),r[2]!==void 0&&(t.g=r[2]/100),r[3]!==void 0&&(t.b=r[3]/100);else return;return r[4]!==void 0?t.alpha=r[4]/100:r[5]!==void 0&&(t.alpha=+r[5]),t},Nr=mn;var dn=(e,t)=>e===void 0?void 0:typeof e!="object"?$e(e):e.mode!==void 0?e:t?{...e,mode:t}:void 0,Cr=dn;var cn=(e="rgb")=>t=>(t=Cr(t,e))!==void 0?t.mode===e?t:q[t.mode][e]?q[t.mode][e](t):e==="rgb"?q[t.mode].rgb(t):q.rgb[e](q[t.mode].rgb(t)):void 0,ze=cn;var q={},Pr={},we=[],Mt={},bn=e=>e,T=e=>(q[e.mode]={...q[e.mode],...e.toMode},Object.keys(e.fromMode||{}).forEach(t=>{q[t]||(q[t]={}),q[t][e.mode]=e.fromMode[t]}),e.ranges||(e.ranges={}),e.difference||(e.difference={}),e.channels.forEach(t=>{if(e.ranges[t]===void 0&&(e.ranges[t]=[0,1]),!e.interpolate[t])throw new 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=bn)}),Pr[e.mode]=e,(e.parse||[]).forEach(t=>{hn(t,e.mode)}),ze(e.mode)),Ir=e=>Pr[e],hn=(e,t)=>{if(typeof e=="string"){if(!t)throw new Error("'mode' required when 'parser' is a string");Mt[e]=t}else typeof e=="function"&&we.indexOf(e)<0&&we.push(e)};var Tt=/[^\x00-\x7F]|[a-zA-Z_]/,xn=/[^\x00-\x7F]|[-\w]/,s={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"},x=0;function je(e){let t=e[x],r=e[x+1];return t==="-"||t==="+"?/\d/.test(r)||r==="."&&/\d/.test(e[x+2]):t==="."?/\d/.test(r):/\d/.test(t)}function kt(e){if(x>=e.length)return!1;let t=e[x];if(Tt.test(t))return!0;if(t==="-"){if(e.length-x<2)return!1;let r=e[x+1];return!!(r==="-"||Tt.test(r))}return!1}var gn={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function Le(e){let t="";if((e[x]==="-"||e[x]==="+")&&(t+=e[x++]),t+=Ve(e),e[x]==="."&&/\d/.test(e[x+1])&&(t+=e[x++]+Ve(e)),(e[x]==="e"||e[x]==="E")&&((e[x+1]==="-"||e[x+1]==="+")&&/\d/.test(e[x+2])?t+=e[x++]+e[x++]+Ve(e):/\d/.test(e[x+1])&&(t+=e[x++]+Ve(e))),kt(e)){let r=Be(e);return r==="deg"||r==="rad"||r==="turn"||r==="grad"?{type:s.Hue,value:t*gn[r]}:void 0}return e[x]==="%"?(x++,{type:s.Percentage,value:+t}):{type:s.Number,value:+t}}function Ve(e){let t="";for(;/\d/.test(e[x]);)t+=e[x++];return t}function Be(e){let t="";for(;x<e.length&&xn.test(e[x]);)t+=e[x++];return t}function yn(e){let t=Be(e);return e[x]==="("?(x++,{type:s.Function,value:t}):t==="none"?{type:s.None,value:void 0}:{type:s.Ident,value:t}}function vn(e=""){let t=e.trim(),r=[],n;for(x=0;x<t.length;){if(n=t[x++],n===` | ||
var wr=typeof process<"u"?!process.env.NODE_DISABLE_COLORS&&(!process.env.NO_COLOR||process.env.NO_COLOR=="0"):!0,Lr=wr?"\x1B[0m":"";var Rr=wr?"\x1B[33m":"";var tn=["0-9","A-Za-z","_$","\xC0-\xFF","\u0100-\u017F","\u0180-\u024F","\u0370-\u03FF","\u0400-\u04FF","\u0530-\u058F","\u0590-\u05FF","\u0600-\u06FF","\u0900-\u097F","\u1100-\u11FF","\u3040-\u309F","\u30A0-\u30FF","\u3400-\u4DBF","\u4E00-\u9FFF"];var rn=/[^-_.\s][-_.\s]+[^-_.\s]/g,Pi=new RegExp(`^[${tn.join("")}]+$`);function _r(e){return e.length<2?e:e.replace(rn,t=>`${t[0].toLocaleLowerCase()}${t[t.length-1].toLocaleUpperCase()}`)}function je(e){if(!e||typeof e=="string"||typeof e=="boolean"||typeof e=="number")return e;if(Array.isArray(e)){let r=[];for(let n of e)r.push(je(n));return r}let t={};for(let[r,n]of Object.entries(e))t[r]=je(n);return t}var Sr=/^\{([^}]+)\}$/;function pe(e){let t=e.match(Sr);return t?t[1]??t[0]:e}function W(e){return typeof e!="string"?!1:Sr.test(e)}function j(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Hr(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:j(e)?Object.keys(e).length===0:!1}function vt(e,t){if(e==null&&t.undefined)return t.undefined(e);if(typeof e=="string"&&t.string)return t.string(e);if(typeof e=="number"&&t.number)return t.number(e);if(Array.isArray(e)&&t.array)return t.array(e);if(j(e)&&t.object)return t.object(e);if(t.default)return t.default(e)}var on=(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}}},De=on;var nn={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},Xr=nn;var an=e=>De(Xr[e.toLowerCase()],6),Ar=an;var fn=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,ln=e=>{let t;return(t=e.match(fn))?De(parseInt(t[1],16),t[1].length):void 0},Er=ln;var S="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",rf=`(?:${S}|none)`,ie=`${S}%`,of=`(?:${S}%|none)`,$e=`(?:${S}%|${S})`,sn=`(?:${S}%|${S}|none)`,Or=`(?:${S}(deg|grad|rad|turn)|${S})`,nf=`(?:${S}(deg|grad|rad|turn)|${S}|none)`,Z="\\s*,\\s*";var af=new RegExp("^"+sn+"$");var pn=new RegExp(`^rgba?\\(\\s*${S}${Z}${S}${Z}${S}\\s*(?:,\\s*${$e}\\s*)?\\)$`),un=new RegExp(`^rgba?\\(\\s*${ie}${Z}${ie}${Z}${ie}\\s*(?:,\\s*${$e}\\s*)?\\)$`),mn=e=>{let t={mode:"rgb"},r;if(r=e.match(pn))r[1]!==void 0&&(t.r=r[1]/255),r[2]!==void 0&&(t.g=r[2]/255),r[3]!==void 0&&(t.b=r[3]/255);else if(r=e.match(un))r[1]!==void 0&&(t.r=r[1]/100),r[2]!==void 0&&(t.g=r[2]/100),r[3]!==void 0&&(t.b=r[3]/100);else return;return r[4]!==void 0?t.alpha=r[4]/100:r[5]!==void 0&&(t.alpha=+r[5]),t},Nr=mn;var cn=(e,t)=>e===void 0?void 0:typeof e!="object"?ke(e):e.mode!==void 0?e:t?{...e,mode:t}:void 0,Cr=cn;var dn=(e="rgb")=>t=>(t=Cr(t,e))!==void 0?t.mode===e?t:F[t.mode][e]?F[t.mode][e](t):e==="rgb"?F[t.mode].rgb(t):F.rgb[e](F[t.mode].rgb(t)):void 0,ze=dn;var F={},Pr={},we=[],Mt={},bn=e=>e,T=e=>(F[e.mode]={...F[e.mode],...e.toMode},Object.keys(e.fromMode||{}).forEach(t=>{F[t]||(F[t]={}),F[t][e.mode]=e.fromMode[t]}),e.ranges||(e.ranges={}),e.difference||(e.difference={}),e.channels.forEach(t=>{if(e.ranges[t]===void 0&&(e.ranges[t]=[0,1]),!e.interpolate[t])throw new 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=bn)}),Pr[e.mode]=e,(e.parse||[]).forEach(t=>{hn(t,e.mode)}),ze(e.mode)),Ir=e=>Pr[e],hn=(e,t)=>{if(typeof e=="string"){if(!t)throw new Error("'mode' required when 'parser' is a string");Mt[e]=t}else typeof e=="function"&&we.indexOf(e)<0&&we.push(e)};var Tt=/[^\x00-\x7F]|[a-zA-Z_]/,xn=/[^\x00-\x7F]|[-\w]/,p={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"},x=0;function qe(e){let t=e[x],r=e[x+1];return t==="-"||t==="+"?/\d/.test(r)||r==="."&&/\d/.test(e[x+2]):t==="."?/\d/.test(r):/\d/.test(t)}function $t(e){if(x>=e.length)return!1;let t=e[x];if(Tt.test(t))return!0;if(t==="-"){if(e.length-x<2)return!1;let r=e[x+1];return!!(r==="-"||Tt.test(r))}return!1}var gn={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function Le(e){let t="";if((e[x]==="-"||e[x]==="+")&&(t+=e[x++]),t+=Ve(e),e[x]==="."&&/\d/.test(e[x+1])&&(t+=e[x++]+Ve(e)),(e[x]==="e"||e[x]==="E")&&((e[x+1]==="-"||e[x+1]==="+")&&/\d/.test(e[x+2])?t+=e[x++]+e[x++]+Ve(e):/\d/.test(e[x+1])&&(t+=e[x++]+Ve(e))),$t(e)){let r=Be(e);return r==="deg"||r==="rad"||r==="turn"||r==="grad"?{type:p.Hue,value:t*gn[r]}:void 0}return e[x]==="%"?(x++,{type:p.Percentage,value:+t}):{type:p.Number,value:+t}}function Ve(e){let t="";for(;/\d/.test(e[x]);)t+=e[x++];return t}function Be(e){let t="";for(;x<e.length&&xn.test(e[x]);)t+=e[x++];return t}function yn(e){let t=Be(e);return e[x]==="("?(x++,{type:p.Function,value:t}):t==="none"?{type:p.None,value:void 0}:{type:p.Ident,value:t}}function vn(e=""){let t=e.trim(),r=[],n;for(x=0;x<t.length;){if(n=t[x++],n===` | ||
`||n===" "||n===" "){for(;x<t.length&&(t[x]===` | ||
`||t[x]===" "||t[x]===" ");)x++;continue}if(n===",")return;if(n===")"){r.push({type:s.ParenClose});continue}if(n==="+"){if(x--,je(t)){r.push(Le(t));continue}return}if(n==="-"){if(x--,je(t)){r.push(Le(t));continue}if(kt(t)){r.push({type:s.Ident,value:Be(t)});continue}return}if(n==="."){if(x--,je(t)){r.push(Le(t));continue}return}if(n==="/"){for(;x<t.length&&(t[x]===` | ||
`||t[x]===" "||t[x]===" ");)x++;let o;if(je(t)&&(o=Le(t),o.type!==s.Hue)){r.push({type:s.Alpha,value:o});continue}if(kt(t)&&Be(t)==="none"){r.push({type:s.Alpha,value:{type:s.None,value:void 0}});continue}return}if(/\d/.test(n)){x--,r.push(Le(t));continue}if(Tt.test(n)){x--,r.push(yn(t));continue}return}return r}function Mn(e){e._i=0;let t=e[e._i++];if(!t||t.type!==s.Function||t.value!=="color"||(t=e[e._i++],t.type!==s.Ident))return;let r=Mt[t.value];if(!r)return;let n={mode:r},o=qr(e,!1);if(!o)return;let a=Ir(r).channels;for(let i=0,l;i<a.length;i++)l=o[i],l.type!==s.None&&(n[a[i]]=l.type===s.Number?l.value:l.value/100);return n}function qr(e,t){let r=[],n;for(;e._i<e.length;){if(n=e[e._i++],n.type===s.None||n.type===s.Number||n.type===s.Alpha||n.type===s.Percentage||t&&n.type===s.Hue){r.push(n);continue}if(n.type===s.ParenClose){if(e._i<e.length)return;continue}return}if(!(r.length<3||r.length>4)){if(r.length===4){if(r[3].type!==s.Alpha)return;r[3]=r[3].value}return r.length===3&&r.push({type:s.None,value:void 0}),r.every(o=>o.type!==s.Alpha)?r:void 0}}function Tn(e,t){e._i=0;let r=e[e._i++];if(!r||r.type!==s.Function)return;let n=qr(e,t);if(n)return n.unshift(r.value),n}var kn=e=>{if(typeof e!="string")return;let t=vn(e),r=t?Tn(t,!0):void 0,n,o=0,a=we.length;for(;o<a;)if((n=we[o++](e,r))!==void 0)return n;return t?Mn(t):void 0},$e=kn;function $n(e,t){if(!t||t[0]!=="rgb"&&t[0]!=="rgba")return;let r={mode:"rgb"},[,n,o,a,i]=t;if(!(n.type===s.Hue||o.type===s.Hue||a.type===s.Hue))return n.type!==s.None&&(r.r=n.type===s.Number?n.value/255:n.value/100),o.type!==s.None&&(r.g=o.type===s.Number?o.value/255:o.value/100),a.type!==s.None&&(r.b=a.type===s.Number?a.value/255:a.value/100),i.type!==s.None&&(r.alpha=i.type===s.Number?i.value:i.value/100),r}var Dr=$n;var zn=e=>e==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,Fr=zn;var jr=(e,t,r)=>e+r*(t-e);var wn=e=>{let t=[];for(let r=0;r<e.length-1;r++){let n=e[r],o=e[r+1];n===void 0&&o===void 0?t.push(void 0):n!==void 0&&o!==void 0?t.push([n,o]):t.push(n!==void 0?[n,n]:[o,o])}return t},Vr=e=>t=>{let r=wn(t);return n=>{let o=n*r.length,a=n>=1?r.length-1:Math.max(Math.floor(o),0),i=r[a];return i===void 0?void 0:e(i[0],i[1],o-a)}};var m=Vr(jr);var v=e=>{let t=!1,r=e.map(n=>n!==void 0?(t=!0,n):1);return t?r:e};var Ln={mode:"rgb",channels:["r","g","b","alpha"],parse:[Dr,Er,Nr,Ar,Fr,"srgb"],serialize:"srgb",interpolate:{r:m,g:m,b:m,alpha:{use:m,fixup:v}},gamut:!0},E=Ln;var $t=e=>Math.pow(Math.abs(e),2.19921875)*Math.sign(e),Rn=e=>{let t=$t(e.r),r=$t(e.g),n=$t(e.b),o={mode:"xyz65",x:.5766690429101305*t+.1855582379065463*r+.1882286462349947*n,y:.297344975250536*t+.6273635662554661*r+.0752914584939979*n,z:.0270313613864123*t+.0706888525358272*r+.9913375368376386*n};return e.alpha!==void 0&&(o.alpha=e.alpha),o},zt=Rn;var wt=e=>Math.pow(Math.abs(e),.4547069271758437)*Math.sign(e),_n=({x:e,y:t,z:r,alpha:n})=>{let o={mode:"a98",r:wt(e*2.0415879038107465-t*.5650069742788597-.3447313507783297*r),g:wt(e*-.9692436362808798+t*1.8759675015077206+.0415550574071756*r),b:wt(e*.0134442806320312-t*.1183623922310184+1.0151749943912058*r)};return n!==void 0&&(o.alpha=n),o},Lt=_n;var Rt=e=>{let t=Math.abs(e);return t<.04045?e/12.92:(Math.sign(e)||1)*Math.pow((t+.055)/1.055,2.4)},Sn=({r:e,g:t,b:r,alpha:n})=>{let o={mode:"lrgb",r:Rt(e),g:Rt(t),b:Rt(r)};return n!==void 0&&(o.alpha=n),o},O=Sn;var Hn=e=>{let{r:t,g:r,b:n,alpha:o}=O(e),a={mode:"xyz65",x:.4123907992659593*t+.357584339383878*r+.1804807884018343*n,y:.2126390058715102*t+.715168678767756*r+.0721923153607337*n,z:.0193308187155918*t+.119194779794626*r+.9505321522496607*n};return o!==void 0&&(a.alpha=o),a},N=Hn;var _t=e=>{let t=Math.abs(e);return t>.0031308?(Math.sign(e)||1)*(1.055*Math.pow(t,.4166666666666667)-.055):e*12.92},Xn=({r:e,g:t,b:r,alpha:n},o="rgb")=>{let a={mode:o,r:_t(e),g:_t(t),b:_t(r)};return n!==void 0&&(a.alpha=n),a},C=Xn;var An=({x:e,y:t,z:r,alpha:n})=>{let o=C({r:e*3.2409699419045226-t*1.537383177570094-.4986107602930034*r,g:e*-.9692436362808796+t*1.8759675015077204+.0415550574071756*r,b:e*.0556300796969936-t*.2039769588889765+1.0569715142428784*r});return n!==void 0&&(o.alpha=n),o},P=An;var En={...E,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:e=>Lt(N(e)),xyz65:Lt},toMode:{rgb:e=>P(zt(e)),xyz65:zt}},Br=En;var On=e=>(e=e%360)<0?e+360:e,k=On;var Nn=(e,t)=>e.map((r,n,o)=>{if(r===void 0)return r;let a=k(r);return n===0||e[n-1]===void 0?a:t(a-k(o[n-1]))}).reduce((r,n)=>!r.length||n===void 0||r[r.length-1]===void 0?(r.push(n),r):(r.push(n+r[r.length-1]),r),[]),L=e=>Nn(e,t=>Math.abs(t)<=180?t:t-360*Math.sign(t));var w=[-.14861,1.78277,-.29227,-.90649,1.97294,0],Gr=Math.PI/180,Jr=180/Math.PI;var Yr=w[3]*w[4],Wr=w[1]*w[4],Zr=w[1]*w[2]-w[0]*w[3],Cn=({r:e,g:t,b:r,alpha:n})=>{let o=(Zr*r+e*Yr-t*Wr)/(Zr+Yr-Wr),a=r-o,i=(w[4]*(t-o)-w[2]*a)/w[3],l={mode:"cubehelix",l:o,s:o===0||o===1?void 0:Math.sqrt(a*a+i*i)/(w[4]*o*(1-o))};return l.s&&(l.h=Math.atan2(i,a)*Jr-120),n!==void 0&&(l.alpha=n),l},Ur=Cn;var Pn=({h:e,s:t,l:r,alpha:n})=>{let o={mode:"rgb"};e=(e===void 0?0:e+120)*Gr;let a=t===void 0?0:t*r*(1-r),i=Math.cos(e),l=Math.sin(e);return o.r=r+a*(w[0]*i+w[1]*l),o.g=r+a*(w[2]*i+w[3]*l),o.b=r+a*(w[4]*i+w[5]*l),n!==void 0&&(o.alpha=n),o},Kr=Pn;var U=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.s||!t.s)return 0;let r=k(e.h),n=k(t.h),o=Math.sin((n-r+360)/2*Math.PI/180);return 2*Math.sqrt(e.s*t.s)*o},Qr=(e,t)=>{if(e.h===void 0||t.h===void 0)return 0;let r=k(e.h),n=k(t.h);return Math.abs(n-r)>180?r-(n-360*Math.sign(n-r)):n-r},K=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.c||!t.c)return 0;let r=k(e.h),n=k(t.h),o=Math.sin((n-r+360)/2*Math.PI/180);return 2*Math.sqrt(e.c*t.c)*o};var R=e=>{let t=e.reduce((r,n)=>{if(n!==void 0){let o=n*Math.PI/180;r.sin+=Math.sin(o),r.cos+=Math.cos(o)}return r},{sin:0,cos:0});return Math.atan2(t.sin,t.cos)*180/Math.PI};var In={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:Ur},toMode:{rgb:Kr},interpolate:{h:{use:m,fixup:L},s:m,l:m,alpha:{use:m,fixup:v}},difference:{h:U},average:{h:R}},eo=In;var qn=({l:e,a:t,b:r,alpha:n},o="lch")=>{let a=Math.sqrt(t*t+r*r),i={mode:o,l:e,c:a};return a&&(i.h=k(Math.atan2(r,t)*180/Math.PI)),n!==void 0&&(i.alpha=n),i},X=qn;var Dn=({l:e,c:t,h:r,alpha:n},o="lab")=>{let a={mode:o,l:e,a:t?t*Math.cos(r/180*Math.PI):0,b:t?t*Math.sin(r/180*Math.PI):0};return n!==void 0&&(a.alpha=n),a},A=Dn;var Ge=Math.pow(29,3)/Math.pow(3,3),Je=Math.pow(6,3)/Math.pow(29,3);var $={X:.9642956764295677,Y:1,Z:.8251046025104602},Q={X:.3127/.329,Y:1,Z:(1-.3127-.329)/.329},y0=Math.pow(29,3)/Math.pow(3,3),v0=Math.pow(6,3)/Math.pow(29,3);var St=e=>Math.pow(e,3)>Je?Math.pow(e,3):(116*e-16)/Ge,Fn=({l:e,a:t,b:r,alpha:n})=>{let o=(e+16)/116,a=t/500+o,i=o-r/200,l={mode:"xyz65",x:St(a)*Q.X,y:St(o)*Q.Y,z:St(i)*Q.Z};return n!==void 0&&(l.alpha=n),l},Ye=Fn;var jn=e=>P(Ye(e)),ee=jn;var Ht=e=>e>Je?Math.cbrt(e):(Ge*e+16)/116,Vn=({x:e,y:t,z:r,alpha:n})=>{let o=Ht(e/Q.X),a=Ht(t/Q.Y),i=Ht(r/Q.Z),l={mode:"lab65",l:116*a-16,a:500*(o-a),b:200*(a-i)};return n!==void 0&&(l.alpha=n),l},We=Vn;var Bn=e=>{let t=We(N(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},te=Bn;var fe=.14444444444444443*Math.PI,ue=Math.cos(fe),me=Math.sin(fe),Ze=100/Math.log(139/100);var Gn=({l:e,c:t,h:r,alpha:n})=>{let o={mode:"lab65",l:(Math.exp(e*1/Ze)-1)/.0039};if(r===void 0)o.a=o.b=0;else{let a=(Math.exp(.0435*t*1*1)-1)/.075,i=a*Math.cos(r/180*Math.PI-fe),l=a*Math.sin(r/180*Math.PI-fe);o.a=i*ue-l/.83*me,o.b=i*me+l/.83*ue}return n!==void 0&&(o.alpha=n),o},_e=Gn;var Jn=({l:e,a:t,b:r,alpha:n})=>{let o=t*ue+r*me,a=.83*(r*ue-t*me),i=Math.sqrt(o*o+a*a),l={mode:"dlch",l:Ze/1*Math.log(1+.0039*e),c:Math.log(1+.075*i)/(.0435*1*1)};return l.c&&(l.h=k((Math.atan2(a,o)+fe)/Math.PI*180)),n!==void 0&&(l.alpha=n),l},Se=Jn;var to=e=>_e(X(e,"dlch")),ro=e=>A(Se(e),"dlab"),Yn={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:to,rgb:e=>ee(to(e))},fromMode:{lab65:ro,rgb:e=>ro(te(e))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:m,a:m,b:m,alpha:{use:m,fixup:v}}},oo=Yn;var Wn={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:_e,dlab:e=>A(e,"dlab"),rgb:e=>ee(_e(e))},fromMode:{lab65:Se,dlab:e=>X(e,"dlch"),rgb:e=>Se(te(e))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:m,c:m,h:{use:m,fixup:L},alpha:{use:m,fixup:v}},difference:{h:K},average:{h:R}},no=Wn;function At({h:e,s:t,i:r,alpha:n}){e=k(e);let o=Math.abs(e/60%2-1),a;switch(Math.floor(e/60)){case 0:a={r:r*(1+t*(3/(2-o)-1)),g:r*(1+t*(3*(1-o)/(2-o)-1)),b:r*(1-t)};break;case 1:a={r:r*(1+t*(3*(1-o)/(2-o)-1)),g:r*(1+t*(3/(2-o)-1)),b:r*(1-t)};break;case 2:a={r:r*(1-t),g:r*(1+t*(3/(2-o)-1)),b:r*(1+t*(3*(1-o)/(2-o)-1))};break;case 3:a={r:r*(1-t),g:r*(1+t*(3*(1-o)/(2-o)-1)),b:r*(1+t*(3/(2-o)-1))};break;case 4:a={r:r*(1+t*(3*(1-o)/(2-o)-1)),g:r*(1-t),b:r*(1+t*(3/(2-o)-1))};break;case 5:a={r:r*(1+t*(3/(2-o)-1)),g:r*(1-t),b:r*(1+t*(3*(1-o)/(2-o)-1))};break;default:a={r:r*(1-t),g:r*(1-t),b:r*(1-t)}}return a.mode="rgb",n!==void 0&&(a.alpha=n),a}function Et({r:e,g:t,b:r,alpha:n}){let o=Math.max(e,t,r),a=Math.min(e,t,r),i={mode:"hsi",s:e+t+r===0?0:1-3*a/(e+t+r),i:(e+t+r)/3};return o-a!==0&&(i.h=(o===e?(t-r)/(o-a)+(t<r)*6:o===t?(r-e)/(o-a)+2:(e-t)/(o-a)+4)*60),n!==void 0&&(i.alpha=n),i}var Zn={mode:"hsi",toMode:{rgb:At},parse:["--hsi"],serialize:"--hsi",fromMode:{rgb:Et},channels:["h","s","i","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:m,fixup:L},s:m,i:m,alpha:{use:m,fixup:v}},difference:{h:U},average:{h:R}},ao=Zn;function Ot({h:e,s:t,l:r,alpha:n}){e=k(e);let o=r+t*(r<.5?r:1-r),a=o-(o-r)*2*Math.abs(e/60%2-1),i;switch(Math.floor(e/60)){case 0:i={r:o,g:a,b:2*r-o};break;case 1:i={r:a,g:o,b:2*r-o};break;case 2:i={r:2*r-o,g:o,b:a};break;case 3:i={r:2*r-o,g:a,b:o};break;case 4:i={r:a,g:2*r-o,b:o};break;case 5:i={r:o,g:2*r-o,b:a};break;default:i={r:2*r-o,g:2*r-o,b:2*r-o}}return i.mode="rgb",n!==void 0&&(i.alpha=n),i}function Nt({r:e,g:t,b:r,alpha:n}){let o=Math.max(e,t,r),a=Math.min(e,t,r),i={mode:"hsl",s:o===a?0:(o-a)/(1-Math.abs(o+a-1)),l:.5*(o+a)};return o-a!==0&&(i.h=(o===e?(t-r)/(o-a)+(t<r)*6:o===t?(r-e)/(o-a)+2:(e-t)/(o-a)+4)*60),n!==void 0&&(i.alpha=n),i}var Un=(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}},io=Un;var Kn=new RegExp(`^hsla?\\(\\s*${Or}${Z}${ie}${Z}${ie}\\s*(?:,\\s*${ke}\\s*)?\\)$`),Qn=e=>{let t=e.match(Kn);if(!t)return;let r={mode:"hsl"};return t[3]!==void 0?r.h=+t[3]:t[1]!==void 0&&t[2]!==void 0&&(r.h=io(t[1],t[2])),t[4]!==void 0&&(r.s=Math.min(Math.max(0,t[4]/100),1)),t[5]!==void 0&&(r.l=Math.min(Math.max(0,t[5]/100),1)),t[6]!==void 0?r.alpha=t[6]/100:t[7]!==void 0&&(r.alpha=+t[7]),r},fo=Qn;function ea(e,t){if(!t||t[0]!=="hsl"&&t[0]!=="hsla")return;let r={mode:"hsl"},[,n,o,a,i]=t;if(n.type!==s.None){if(n.type===s.Percentage)return;r.h=n.value}if(o.type!==s.None){if(o.type===s.Hue)return;r.s=o.type===s.Number?o.value:o.value/100}if(a.type!==s.None){if(a.type===s.Hue)return;r.l=a.type===s.Number?a.value:a.value/100}return i.type!==s.None&&(r.alpha=i.type===s.Number?i.value:i.value/100),r}var lo=ea;var ta={mode:"hsl",toMode:{rgb:Ot},fromMode:{rgb:Nt},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[lo,fo],serialize:e=>`hsl(${e.h||0} ${e.s!==void 0?e.s*100+"%":"none"} ${e.l!==void 0?e.l*100+"%":"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:m,fixup:L},s:m,l:m,alpha:{use:m,fixup:v}},difference:{h:U},average:{h:R}},Ue=ta;function He({h:e,s:t,v:r,alpha:n}){e=k(e);let o=Math.abs(e/60%2-1),a;switch(Math.floor(e/60)){case 0:a={r,g:r*(1-t*o),b:r*(1-t)};break;case 1:a={r:r*(1-t*o),g:r,b:r*(1-t)};break;case 2:a={r:r*(1-t),g:r,b:r*(1-t*o)};break;case 3:a={r:r*(1-t),g:r*(1-t*o),b:r};break;case 4:a={r:r*(1-t*o),g:r*(1-t),b:r};break;case 5:a={r,g:r*(1-t),b:r*(1-t*o)};break;default:a={r:r*(1-t),g:r*(1-t),b:r*(1-t)}}return a.mode="rgb",n!==void 0&&(a.alpha=n),a}function Xe({r:e,g:t,b:r,alpha:n}){let o=Math.max(e,t,r),a=Math.min(e,t,r),i={mode:"hsv",s:o===0?0:1-a/o,v:o};return o-a!==0&&(i.h=(o===e?(t-r)/(o-a)+(t<r)*6:o===t?(r-e)/(o-a)+2:(e-t)/(o-a)+4)*60),n!==void 0&&(i.alpha=n),i}var ra={mode:"hsv",toMode:{rgb:He},parse:["--hsv"],serialize:"--hsv",fromMode:{rgb:Xe},channels:["h","s","v","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:m,fixup:L},s:m,v:m,alpha:{use:m,fixup:v}},difference:{h:U},average:{h:R}},Ke=ra;function Ct({h:e,w:t,b:r,alpha:n}){if(t+r>1){let o=t+r;t/=o,r/=o}return He({h:e,s:r===1?1:1-t/(1-r),v:1-r,alpha:n})}function Pt(e){let t=Xe(e);if(t===void 0)return;let r={mode:"hwb",w:(1-t.s)*t.v,b:1-t.v};return t.h!==void 0&&(r.h=t.h),t.alpha!==void 0&&(r.alpha=t.alpha),r}function oa(e,t){if(!t||t[0]!=="hwb")return;let r={mode:"hwb"},[,n,o,a,i]=t;if(n.type!==s.None){if(n.type===s.Percentage)return;r.h=n.value}if(o.type!==s.None){if(o.type===s.Hue)return;r.w=o.type===s.Number?o.value:o.value/100}if(a.type!==s.None){if(a.type===s.Hue)return;r.b=a.type===s.Number?a.value:a.value/100}return i.type!==s.None&&(r.alpha=i.type===s.Number?i.value:i.value/100),r}var so=oa;var na={mode:"hwb",toMode:{rgb:Ct},fromMode:{rgb:Pt},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[so],serialize:e=>`hwb(${e.h||0} ${e.w*100}% ${e.b*100}%${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:m,fixup:L},w:m,b:m,alpha:{use:m,fixup:v}},difference:{h:Qr},average:{h:R}},po=na;var aa=.1593017578125,ia=134.03437499999998,fa=.8359375,la=18.8515625,sa=18.6875,pa=16295499532821565e-27,It=e=>{let t=Math.pow(e/1e4,aa);return Math.pow((fa+la*t)/(1+sa*t),ia)||0},qt=e=>Math.max(e*203,0),ua=({x:e,y:t,z:r,alpha:n})=>{e=qt(e),t=qt(t),r=qt(r);let o=1.15*e-.15*r,a=.66*t+.34*e,i=It(.41478972*o+.579999*a+.014648*r),l=It(-.20151*o+1.120649*a+.0531008*r),b=It(-.0166008*o+.2648*a+.6684799*r),p=(i+l)/2,c={mode:"jab",j:.44*p/(1-.56*p)-pa,a:3.524*i-4.066708*l+.542708*b,b:.199076*i+1.096799*l-1.295875*b};return n!==void 0&&(c.alpha=n),c},Qe=ua;var ma=.1593017578125,da=134.03437499999998,ca=.8359375,ba=18.8515625,ha=18.6875,uo=16295499532821565e-27,Dt=e=>{let t=Math.pow(e,1/da);return 1e4*Math.pow((ca-t)/(ha*t-ba),1/ma)||0},Ft=e=>e/203,xa=({j:e,a:t,b:r,alpha:n})=>{let o=(e+uo)/(.44+.56*(e+uo)),a=Dt(o+.13860504*t+.058047316*r),i=Dt(o-.13860504*t-.058047316*r),l=Dt(o-.096019242*t-.8118919*r),b={mode:"xyz65",x:Ft(1.661373024652174*a-.914523081304348*i+.23136208173913045*l),y:Ft(-.3250758611844533*a+1.571847026732543*i-.21825383453227928*l),z:Ft(-.090982811*a-.31272829*i+1.5227666*l)};return n!==void 0&&(b.alpha=n),b},et=xa;var ga=e=>{let t=Qe(N(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},tt=ga;var ya=e=>P(et(e)),rt=ya;var va={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:tt,xyz65:Qe},toMode:{rgb:rt,xyz65:et},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:m,a:m,b:m,alpha:{use:m,fixup:v}}},mo=va;var Ma=({j:e,a:t,b:r,alpha:n})=>{let o=Math.sqrt(t*t+r*r),a={mode:"jch",j:e,c:o};return o&&(a.h=k(Math.atan2(r,t)*180/Math.PI)),n!==void 0&&(a.alpha=n),a},jt=Ma;var Ta=({j:e,c:t,h:r,alpha:n})=>{let o={mode:"jab",j:e,a:t?t*Math.cos(r/180*Math.PI):0,b:t?t*Math.sin(r/180*Math.PI):0};return n!==void 0&&(o.alpha=n),o},Vt=Ta;var ka={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:Vt,rgb:e=>rt(Vt(e))},fromMode:{rgb:e=>jt(tt(e)),jab:jt},channels:["j","c","h","alpha"],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:m,fixup:L},c:m,j:m,alpha:{use:m,fixup:v}},difference:{h:K},average:{h:R}},co=ka;var re=Math.pow(29,3)/Math.pow(3,3),de=Math.pow(6,3)/Math.pow(29,3);var Bt=e=>Math.pow(e,3)>de?Math.pow(e,3):(116*e-16)/re,$a=({l:e,a:t,b:r,alpha:n})=>{let o=(e+16)/116,a=t/500+o,i=o-r/200,l={mode:"xyz50",x:Bt(a)*$.X,y:Bt(o)*$.Y,z:Bt(i)*$.Z};return n!==void 0&&(l.alpha=n),l},ce=$a;var za=({x:e,y:t,z:r,alpha:n})=>{let o=C({r:e*3.1341359569958707-t*1.6173863321612538-.4906619460083532*r,g:e*-.978795502912089+t*1.916254567259524+.03344273116131949*r,b:e*.07195537988411677-t*.2289768264158322+1.405386058324125*r});return n!==void 0&&(o.alpha=n),o},F=za;var wa=e=>F(ce(e)),ot=wa;var La=e=>{let{r:t,g:r,b:n,alpha:o}=O(e),a={mode:"xyz50",x:.436065742824811*t+.3851514688337912*r+.14307845442264197*n,y:.22249319175623702*t+.7168870538238823*r+.06061979053616537*n,z:.013923904500943465*t+.09708128566574634*r+.7140993584005155*n};return o!==void 0&&(a.alpha=o),a},j=La;var Gt=e=>e>de?Math.cbrt(e):(re*e+16)/116,Ra=({x:e,y:t,z:r,alpha:n})=>{let o=Gt(e/$.X),a=Gt(t/$.Y),i=Gt(r/$.Z),l={mode:"lab",l:116*a-16,a:500*(o-a),b:200*(a-i)};return n!==void 0&&(l.alpha=n),l},be=Ra;var _a=e=>{let t=be(j(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},nt=_a;function Sa(e,t){if(!t||t[0]!=="lab")return;let r={mode:"lab"},[,n,o,a,i]=t;if(!(n.type===s.Hue||o.type===s.Hue||a.type===s.Hue))return n.type!==s.None&&(r.l=n.value),o.type!==s.None&&(r.a=o.type===s.Number?o.value:o.value*125/100),a.type!==s.None&&(r.b=a.type===s.Number?a.value:a.value*125/100),i.type!==s.None&&(r.alpha=i.type===s.Number?i.value:i.value/100),r}var bo=Sa;var Ha={mode:"lab",toMode:{xyz50:ce,rgb:ot},fromMode:{xyz50:be,rgb:nt},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-100,100],b:[-100,100]},parse:[bo],serialize:e=>`lab(${e.l!==void 0?e.l:"none"} ${e.a!==void 0?e.a:"none"} ${e.b!==void 0?e.b:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{l:m,a:m,b:m,alpha:{use:m,fixup:v}}},he=Ha;var Xa={...he,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:Ye,rgb:ee},fromMode:{xyz65:We,rgb:te},ranges:{l:[0,100],a:[-86.182,98.234],b:[-107.86,94.477]}},ho=Xa;function Aa(e,t){if(!t||t[0]!=="lch")return;let r={mode:"lch"},[,n,o,a,i]=t;if(n.type!==s.None){if(n.type===s.Hue)return;r.l=n.value}if(o.type!==s.None&&(r.c=Math.max(0,o.type===s.Number?o.value:o.value*150/100)),a.type!==s.None){if(a.type===s.Percentage)return;r.h=a.value}return i.type!==s.None&&(r.alpha=i.type===s.Number?i.value:i.value/100),r}var xo=Aa;var Ea={mode:"lch",toMode:{lab:A,rgb:e=>ot(A(e))},fromMode:{rgb:e=>X(nt(e)),lab:X},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[xo],serialize:e=>`lch(${e.l!==void 0?e.l:"none"} ${e.c!==void 0?e.c:"none"} ${e.h||0}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:m,fixup:L},c:m,l:m,alpha:{use:m,fixup:v}},difference:{h:K},average:{h:R}},xe=Ea;var Oa={...xe,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:e=>A(e,"lab65"),rgb:e=>ee(A(e,"lab65"))},fromMode:{rgb:e=>X(te(e),"lch65"),lab65:e=>X(e,"lch65")},ranges:{l:[0,100],c:[0,133.807],h:[0,360]}},go=Oa;var Na=({l:e,u:t,v:r,alpha:n})=>{let o=Math.sqrt(t*t+r*r),a={mode:"lchuv",l:e,c:o};return o&&(a.h=k(Math.atan2(r,t)*180/Math.PI)),n!==void 0&&(a.alpha=n),a},Jt=Na;var Ca=({l:e,c:t,h:r,alpha:n})=>{let o={mode:"luv",l:e,u:t?t*Math.cos(r/180*Math.PI):0,v:t?t*Math.sin(r/180*Math.PI):0};return n!==void 0&&(o.alpha=n),o},Yt=Ca;var yo=(e,t,r)=>4*e/(e+15*t+3*r),vo=(e,t,r)=>9*t/(e+15*t+3*r),Pa=yo($.X,$.Y,$.Z),Ia=vo($.X,$.Y,$.Z),qa=e=>e<=de?re*e:116*Math.cbrt(e)-16,Da=({x:e,y:t,z:r,alpha:n})=>{let o=qa(t/$.Y),a=yo(e,t,r),i=vo(e,t,r);!isFinite(a)||!isFinite(i)?o=a=i=0:(a=13*o*(a-Pa),i=13*o*(i-Ia));let l={mode:"luv",l:o,u:a,v:i};return n!==void 0&&(l.alpha=n),l},Ae=Da;var Fa=(e,t,r)=>4*e/(e+15*t+3*r),ja=(e,t,r)=>9*t/(e+15*t+3*r),Va=Fa($.X,$.Y,$.Z),Ba=ja($.X,$.Y,$.Z),Ga=({l:e,u:t,v:r,alpha:n})=>{let o=t/(13*e)+Va,a=r/(13*e)+Ba,i=$.Y*(e<=8?e/re:Math.pow((e+16)/116,3)),l=i*(9*o)/(4*a),b=i*(12-3*o-20*a)/(4*a),p={mode:"xyz50",x:l,y:i,z:b};return n!==void 0&&(p.alpha=n),p},Ee=Ga;var Ja=e=>Jt(Ae(j(e))),Ya=e=>F(Ee(Yt(e))),Wa={mode:"lchuv",toMode:{luv:Yt,rgb:Ya},fromMode:{rgb:Ja,luv:Jt},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:m,fixup:L},c:m,l:m,alpha:{use:m,fixup:v}},difference:{h:K},average:{h:R}},Mo=Wa;var Za={...E,mode:"lrgb",toMode:{rgb:C},fromMode:{rgb:O},parse:["srgb-linear"],serialize:"srgb-linear"},To=Za;var Ua={mode:"luv",toMode:{xyz50:Ee,rgb:e=>F(Ee(e))},fromMode:{xyz50:Ae,rgb:e=>Ae(j(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:m,u:m,v:m,alpha:{use:m,fixup:v}}},ko=Ua;var Ka=({r:e,g:t,b:r,alpha:n})=>{let o=Math.cbrt(.41222147079999993*e+.5363325363*t+.0514459929*r),a=Math.cbrt(.2119034981999999*e+.6806995450999999*t+.1073969566*r),i=Math.cbrt(.08830246189999998*e+.2817188376*t+.6299787005000002*r),l={mode:"oklab",l:.2104542553*o+.793617785*a-.0040720468*i,a:1.9779984951*o-2.428592205*a+.4505937099*i,b:.0259040371*o+.7827717662*a-.808675766*i};return n!==void 0&&(l.alpha=n),l},at=Ka;var Qa=e=>{let t=at(O(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},oe=Qa;var ei=({l:e,a:t,b:r,alpha:n})=>{let o=Math.pow(e*.9999999984505198+.39633779217376786*t+.2158037580607588*r,3),a=Math.pow(e*1.0000000088817609-.10556134232365635*t-.06385417477170591*r,3),i=Math.pow(e*1.0000000546724108-.08948418209496575*t-1.2914855378640917*r,3),l={mode:"lrgb",r:4.076741661347994*o-3.307711590408193*a+.230969928729428*i,g:-1.2684380040921763*o+2.6097574006633715*a-.3413193963102197*i,b:-.004196086541837188*o-.7034186144594493*a+1.7076147009309444*i};return n!==void 0&&(l.alpha=n),l},V=ei;var ti=e=>C(V(e)),ne=ti;function Oe(e){let n=1.170873786407767;return .5*(n*e-.206+Math.sqrt((n*e-.206)*(n*e-.206)+4*.03*n*e))}function le(e){let n=1.170873786407767;return(e*e+.206*e)/(n*(e+.03))}function ri(e,t){let r,n,o,a,i,l,b,p;-1.88170328*e-.80936493*t>1?(r=1.19086277,n=1.76576728,o=.59662641,a=.75515197,i=.56771245,l=4.0767416621,b=-3.3077115913,p=.2309699292):1.81444104*e-1.19445276*t>1?(r=.73956515,n=-.45954404,o=.08285427,a=.1254107,i=.14503204,l=-1.2684380046,b=2.6097574011,p=-.3413193965):(r=1.35733652,n=-.00915799,o=-1.1513021,a=-.50559606,i=.00692167,l=-.0041960863,b=-.7034186147,p=1.707614701);let c=r+n*e+o*t+a*e*e+i*e*t,y=.3963377774*e+.2158037573*t,d=-.1055613458*e-.0638541728*t,f=-.0894841775*e-1.291485548*t;{let g=1+c*y,u=1+c*d,h=1+c*f,M=g*g*g,z=u*u*u,B=h*h*h,H=3*y*g*g,G=3*d*u*u,_=3*f*h*h,ye=6*y*y*g,ve=6*d*d*u,Me=6*f*f*h,se=l*M+b*z+p*B,ae=l*H+b*G+p*_,Te=l*ye+b*ve+p*Me;c=c-se*ae/(ae*ae-.5*se*Te)}return c}function Wt(e,t){let r=ri(e,t),n=V({l:1,a:r*e,b:r*t}),o=Math.cbrt(1/Math.max(n.r,n.g,n.b)),a=o*r;return[o,a]}function oi(e,t,r,n,o,a=null){a||(a=Wt(e,t));let i;if((r-o)*a[1]-(a[0]-o)*n<=0)i=a[1]*o/(n*a[0]+a[1]*(o-r));else{i=a[1]*(o-1)/(n*(a[0]-1)+a[1]*(o-r));{let l=r-o,b=n,p=.3963377774*e+.2158037573*t,c=-.1055613458*e-.0638541728*t,y=-.0894841775*e-1.291485548*t,d=l+b*p,f=l+b*c,g=l+b*y;{let u=o*(1-i)+i*r,h=i*n,M=u+h*p,z=u+h*c,B=u+h*y,H=M*M*M,G=z*z*z,_=B*B*B,ye=3*d*M*M,ve=3*f*z*z,Me=3*g*B*B,se=6*d*d*M,ae=6*f*f*z,Te=6*g*g*B,vr=4.0767416621*H-3.3077115913*G+.2309699292*_-1,ct=4.0767416621*ye-3.3077115913*ve+.2309699292*Me,Ko=4.0767416621*se-3.3077115913*ae+.2309699292*Te,Mr=ct/(ct*ct-.5*vr*Ko),bt=-vr*Mr,Tr=-1.2684380046*H+2.6097574011*G-.3413193965*_-1,ht=-1.2684380046*ye+2.6097574011*ve-.3413193965*Me,Qo=-1.2684380046*se+2.6097574011*ae-.3413193965*Te,kr=ht/(ht*ht-.5*Tr*Qo),xt=-Tr*kr,$r=-.0041960863*H-.7034186147*G+1.707614701*_-1,gt=-.0041960863*ye-.7034186147*ve+1.707614701*Me,en=-.0041960863*se-.7034186147*ae+1.707614701*Te,zr=gt/(gt*gt-.5*$r*en),yt=-$r*zr;bt=Mr>=0?bt:1e6,xt=kr>=0?xt:1e6,yt=zr>=0?yt:1e6,i+=Math.min(bt,Math.min(xt,yt))}}}return i}function Ne(e,t,r=null){r||(r=Wt(e,t));let n=r[0],o=r[1];return[o/n,o/(1-n)]}function it(e,t,r){let n=Wt(t,r),o=oi(t,r,e,1,e,n),a=Ne(t,r,n),i=.11516993+1/(7.4477897+4.1590124*r+t*(-2.19557347+1.75198401*r+t*(-2.13704948-10.02301043*r+t*(-4.24894561+5.38770819*r+4.69891013*t)))),l=.11239642+1/(1.6132032-.68124379*r+t*(.40370612+.90148123*r+t*(-.27087943+.6122399*r+t*(.00299215-.45399568*r-.14661872*t)))),b=o/Math.min(e*a[0],(1-e)*a[1]),p=e*i,c=(1-e)*l,y=.9*b*Math.sqrt(Math.sqrt(1/(1/(p*p*p*p)+1/(c*c*c*c))));return p=e*.4,c=(1-e)*.8,[Math.sqrt(1/(1/(p*p)+1/(c*c))),y,o]}function ft(e){let t={mode:"okhsl",l:Oe(e.l)};e.alpha!==void 0&&(t.alpha=e.alpha);let r=Math.sqrt(e.a*e.a+e.b*e.b);if(!r)return t.s=0,t;let[n,o,a]=it(e.l,e.a/r,e.b/r),i;if(r<o){let l=0,b=.8*n,p=1-b/o;i=(r-l)/(b+p*(r-l))*.8}else{let l=o,b=.2*o*o*1.25*1.25/n,p=1-b/(a-o);i=.8+.2*((r-l)/(b+p*(r-l)))}return i&&(t.s=i,t.h=k(Math.atan2(e.b,e.a)*180/Math.PI)),t}function lt(e){let t=le(e.l),r={mode:"oklab",l:t};if(e.alpha!==void 0&&(r.alpha=e.alpha),!e.s||e.l===1)return r.a=r.b=0,r;let n=Math.cos(e.h/180*Math.PI),o=Math.sin(e.h/180*Math.PI),[a,i,l]=it(t,n,o),b,p,c,y;e.s<.8?(b=1.25*e.s,p=0,c=.8*a,y=1-c/i):(b=5*(e.s-.8),p=i,c=.2*i*i*1.25*1.25/a,y=1-c/(l-i));let d=p+b*c/(1-y*b);return r.a=d*n,r.b=d*o,r}var ni={...Ue,mode:"okhsl",channels:["h","s","l","alpha"],parse:["--okhsl"],serialize:"--okhsl",fromMode:{oklab:ft,rgb:e=>ft(oe(e))},toMode:{oklab:lt,rgb:e=>ne(lt(e))}},$o=ni;function st(e){let t=Math.sqrt(e.a*e.a+e.b*e.b),r=e.l,n=t?e.a/t:1,o=t?e.b/t:1,[a,i]=Ne(n,o),l=.5,b=1-l/a,p=i/(t+r*i),c=p*r,y=p*t,d=le(c),f=y*d/c,g=V({l:d,a:n*f,b:o*f}),u=Math.cbrt(1/Math.max(g.r,g.g,g.b,0));r=r/u,t=t/u*Oe(r)/r,r=Oe(r);let h={mode:"okhsv",s:t?(l+i)*y/(i*l+i*b*y):0,v:r?r/c:0};return h.s&&(h.h=k(Math.atan2(e.b,e.a)*180/Math.PI)),e.alpha!==void 0&&(h.alpha=e.alpha),h}function pt(e){let t={mode:"oklab"};e.alpha!==void 0&&(t.alpha=e.alpha);let r=e.h||0,n=Math.cos(r/180*Math.PI),o=Math.sin(r/180*Math.PI),[a,i]=Ne(n,o),l=.5,b=1-l/a,p=1-e.s*l/(l+i-i*b*e.s),c=e.s*i*l/(l+i-i*b*e.s),y=le(p),d=c*y/p,f=V({l:y,a:n*d,b:o*d}),g=Math.cbrt(1/Math.max(f.r,f.g,f.b,0)),u=le(e.v*p),h=c*u/p;return t.l=u*g,t.a=h*n*g,t.b=h*o*g,t}var ai={...Ke,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:st,rgb:e=>st(oe(e))},toMode:{oklab:pt,rgb:e=>ne(pt(e))}},zo=ai;function ii(e,t){if(!t||t[0]!=="oklab")return;let r={mode:"oklab"},[,n,o,a,i]=t;if(!(n.type===s.Hue||o.type===s.Hue||a.type===s.Hue))return n.type!==s.None&&(r.l=n.type===s.Number?n.value:n.value/100),o.type!==s.None&&(r.a=o.type===s.Number?o.value:o.value*.4/100),a.type!==s.None&&(r.b=a.type===s.Number?a.value:a.value*.4/100),i.type!==s.None&&(r.alpha=i.type===s.Number?i.value:i.value/100),r}var wo=ii;var fi={...he,mode:"oklab",toMode:{lrgb:V,rgb:ne},fromMode:{lrgb:at,rgb:oe},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[wo],serialize:e=>`oklab(${e.l!==void 0?e.l:"none"} ${e.a!==void 0?e.a:"none"} ${e.b!==void 0?e.b:"none"}${e.alpha<1?` / ${e.alpha}`:""})`},Lo=fi;function li(e,t){if(!t||t[0]!=="oklch")return;let r={mode:"oklch"},[,n,o,a,i]=t;if(n.type!==s.None){if(n.type===s.Hue)return;r.l=n.type===s.Number?n.value:n.value/100}if(o.type!==s.None&&(r.c=Math.max(0,o.type===s.Number?o.value:o.value*.4/100)),a.type!==s.None){if(a.type===s.Percentage)return;r.h=a.value}return i.type!==s.None&&(r.alpha=i.type===s.Number?i.value:i.value/100),r}var Ro=li;var si={...xe,mode:"oklch",toMode:{oklab:e=>A(e,"oklab"),rgb:e=>ne(A(e,"oklab"))},fromMode:{rgb:e=>X(oe(e),"oklch"),oklab:e=>X(e,"oklch")},parse:[Ro],serialize:e=>`oklch(${e.l!==void 0?e.l:"none"} ${e.c!==void 0?e.c:"none"} ${e.h||0}${e.alpha<1?` / ${e.alpha}`:""})`,ranges:{l:[0,1],c:[0,.4],h:[0,360]}},_o=si;var pi=e=>{let{r:t,g:r,b:n,alpha:o}=O(e),a={mode:"xyz65",x:.486570948648216*t+.265667693169093*r+.1982172852343625*n,y:.2289745640697487*t+.6917385218365062*r+.079286914093745*n,z:0*t+.0451133818589026*r+1.043944368900976*n};return o!==void 0&&(a.alpha=o),a},Zt=pi;var ui=({x:e,y:t,z:r,alpha:n})=>{let o=C({r:e*2.4934969119414263-t*.9313836179191242-.402710784450717*r,g:e*-.8294889695615749+t*1.7626640603183465+.0236246858419436*r,b:e*.0358458302437845-t*.0761723892680418+.9568845240076871*r},"p3");return n!==void 0&&(o.alpha=n),o},Ut=ui;var mi={...E,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:e=>Ut(N(e)),xyz65:Ut},toMode:{rgb:e=>P(Zt(e)),xyz65:Zt}},So=mi;var Kt=e=>{let t=Math.abs(e);return t>=.001953125?Math.sign(e)*Math.pow(t,.5555555555555556):16*e},di=({x:e,y:t,z:r,alpha:n})=>{let o={mode:"prophoto",r:Kt(e*1.3457868816471585-t*.2555720873797946-.0511018649755453*r),g:Kt(e*-.5446307051249019+t*1.5082477428451466+.0205274474364214*r),b:Kt(e*0+t*0+1.2119675456389452*r)};return n!==void 0&&(o.alpha=n),o},Qt=di;var er=e=>{let t=Math.abs(e);return t>=.03125?Math.sign(e)*Math.pow(t,1.8):e/16},ci=e=>{let t=er(e.r),r=er(e.g),n=er(e.b),o={mode:"xyz50",x:.7977666449006423*t+.1351812974005331*r+.0313477341283922*n,y:.2880748288194013*t+.7118352342418731*r+899369387256e-16*n,z:0*t+0*r+.8251046025104602*n};return e.alpha!==void 0&&(o.alpha=e.alpha),o},tr=ci;var bi={...E,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:Qt,rgb:e=>Qt(j(e))},toMode:{xyz50:tr,rgb:e=>F(tr(e))}},Ho=bi;var Xo=1.09929682680944,hi=.018053968510807,rr=e=>{let t=Math.abs(e);return t>hi?(Math.sign(e)||1)*(Xo*Math.pow(t,.45)-(Xo-1)):4.5*e},xi=({x:e,y:t,z:r,alpha:n})=>{let o={mode:"rec2020",r:rr(e*1.7166511879712683-t*.3556707837763925-.2533662813736599*r),g:rr(e*-.6666843518324893+t*1.6164812366349395+.0157685458139111*r),b:rr(e*.0176398574453108-t*.0427706132578085+.9421031212354739*r)};return n!==void 0&&(o.alpha=n),o},or=xi;var Ao=1.09929682680944,gi=.018053968510807,nr=e=>{let t=Math.abs(e);return t<gi*4.5?e/4.5:(Math.sign(e)||1)*Math.pow((t+Ao-1)/Ao,1/.45)},yi=e=>{let t=nr(e.r),r=nr(e.g),n=nr(e.b),o={mode:"xyz65",x:.6369580483012911*t+.1446169035862083*r+.1688809751641721*n,y:.262700212011267*t+.6779980715188708*r+.059301716469862*n,z:0*t+.0280726930490874*r+1.0609850577107909*n};return e.alpha!==void 0&&(o.alpha=e.alpha),o},ar=yi;var vi={...E,mode:"rec2020",fromMode:{xyz65:or,rgb:e=>or(N(e))},toMode:{xyz65:ar,rgb:e=>P(ar(e))},parse:["rec2020"],serialize:"rec2020"},Eo=vi;var J=.0037930732552754493,ut=Math.cbrt(J);var ir=e=>Math.cbrt(e)-ut,Mi=e=>{let{r:t,g:r,b:n,alpha:o}=O(e),a=ir(.3*t+.622*r+.078*n+J),i=ir(.23*t+.692*r+.078*n+J),l=ir(.2434226892454782*t+.2047674442449682*r+.5518098665095535*n+J),b={mode:"xyb",x:(a-i)/2,y:(a+i)/2,b:l-(a+i)/2};return o!==void 0&&(b.alpha=o),b},Oo=Mi;var fr=e=>Math.pow(e+ut,3),Ti=({x:e,y:t,b:r,alpha:n})=>{let o=fr(e+t)-J,a=fr(t-e)-J,i=fr(r+t)-J,l=C({r:11.031566904639861*o-9.866943908131562*a-.16462299650829934*i,g:-3.2541473810744237*o+4.418770377582723*a-.16462299650829934*i,b:-3.6588512867136815*o+2.7129230459360922*a+1.9459282407775895*i});return n!==void 0&&(l.alpha=n),l},No=Ti;var ki={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:No},fromMode:{rgb:Oo},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:m,y:m,b:m,alpha:{use:m,fixup:v}}},Co=ki;var $i={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:F,lab:be},fromMode:{rgb:j,lab:ce},channels:["x","y","z","alpha"],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:m,y:m,z:m,alpha:{use:m,fixup:v}}},Po=$i;var zi=e=>{let{x:t,y:r,z:n,alpha:o}=e,a={mode:"xyz50",x:1.0479298208405488*t+.0229467933410191*r-.0501922295431356*n,y:.0296278156881593*t+.990434484573249*r-.0170738250293851*n,z:-.0092430581525912*t+.0150551448965779*r+.7518742899580008*n};return o!==void 0&&(a.alpha=o),a},Io=zi;var wi=e=>{let{x:t,y:r,z:n,alpha:o}=e,a={mode:"xyz65",x:.9554734527042182*t-.0230985368742614*r+.0632593086610217*n,y:-.0283697069632081*t+1.0099954580058226*r+.021041398966943*n,z:.0123140016883199*t-.0205076964334779*r+1.3303659366080753*n};return o!==void 0&&(a.alpha=o),a},qo=wi;var Li={mode:"xyz65",toMode:{rgb:P,xyz50:Io},fromMode:{rgb:N,xyz50:qo},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:m,y:m,z:m,alpha:{use:m,fixup:v}}},Do=Li;var Ri=({r:e,g:t,b:r,alpha:n})=>{let o={mode:"yiq",y:.29889531*e+.58662247*t+.11448223*r,i:.59597799*e-.2741761*t-.32180189*r,q:.21147017*e-.52261711*t+.31114694*r};return n!==void 0&&(o.alpha=n),o},Fo=Ri;var _i=({y:e,i:t,q:r,alpha:n})=>{let o={mode:"rgb",r:e+.95608445*t+.6208885*r,g:e-.27137664*t-.6486059*r,b:e-1.10561724*t+1.70250126*r};return n!==void 0&&(o.alpha=n),o},jo=_i;var Si={mode:"yiq",toMode:{rgb:jo},fromMode:{rgb:Fo},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:m,i:m,q:m,alpha:{use:m,fixup:v}}},Vo=Si;var Hi=(e,t)=>Math.round(e*(t=Math.pow(10,t)))/t,Xi=(e=4)=>t=>typeof t=="number"?Hi(t,e):t,Bo=Xi;var Md=Bo(2),Ai=e=>Math.max(0,Math.min(1,e)),mt=e=>Math.round(Ai(e)*255),lr=e=>{if(e===void 0)return;let t=mt(e.r),r=mt(e.g),n=mt(e.b);return"#"+(1<<24|t<<16|r<<8|n).toString(16).slice(1)},Go=e=>{if(e===void 0)return;let t=mt(e.alpha!==void 0?e.alpha:1);return lr(e)+(256|t).toString(16).slice(1)};var sr=e=>lr(ze("rgb")(e)),pr=e=>Go(ze("rgb")(e));var nc=T(Br),ac=T(eo),ic=T(oo),fc=T(no),lc=T(ao),sc=T(Ue),pc=T(Ke),uc=T(po),mc=T(mo),dc=T(co),cc=T(he),bc=T(ho),hc=T(xe),xc=T(go),gc=T(Mo),yc=T(To),vc=T(ko),Mc=T($o),Tc=T(zo),kc=T(Lo),$c=T(_o),zc=T(So),wc=T(Ho),Lc=T(Eo),Rc=T(E),_c=T(Co),Sc=T(Po),Hc=T(Do),Xc=T(Vo);function Y(e,t){if(!e)throw new Error("missing value");if(typeof e=="string"){if(t.convertToHex===!1)return e;let r=$e(e);if(!r)throw new Error(`invalid color "${e}"`);return typeof r.alpha=="number"&&r.alpha<1?pr(r):sr(r)}throw new Error(`expected string, received ${typeof e}`)}function Ce(e){if(!e)throw new Error("missing value");if(typeof e=="string")return[e];if(Array.isArray(e)){if(e.every(t=>!!t&&typeof t=="string"))return e;throw new Error("expected array of strings")}throw new Error(`expected string or array of strings, received ${typeof e}`)}var Ei=/^\d+(\.\d+)?(ms|s)$/;function ge(e){if(typeof e=="number")return`${e}ms`;if(typeof e=="string"){if(parseFloat(e)===0)return"0ms";if(Ei.test(e))return e;throw new Error(`invalid duration "${e}"`)}throw new Error(`expected string, received ${typeof e}`)}function I(e){if(typeof e=="number"){if(e===0)return"0";throw new Error("missing units")}if(typeof e=="string")return parseFloat(e)===0?"0":e;throw new Error(`expected string, received ${typeof e}`)}function Pe(e){if(!e)throw new Error("missing value");if(!Array.isArray(e)||e.length!==4||e.some(t=>typeof t!="number"))throw new Error(`expected [\u{1D465}1, \u{1D466}1, \u{1D465}2, \u{1D466}2], received ${JSON.stringify(e)}`);return[Math.max(0,Math.min(1,e[0])),e[1],Math.max(0,Math.min(1,e[2])),e[3]]}function ur(e){if(!e)throw new Error("missing value");if(typeof e=="string")return e;throw new Error(`expected string, received ${typeof e}`)}var Jo=new Set(["solid","dashed","dotted","double","groove","ridge","outset","inset"]);function Ie(e){if(!Jo.has(e))throw new Error(`Unsupported stroke type "${e}", must be one of: | ||
`||t[x]===" "||t[x]===" ");)x++;continue}if(n===",")return;if(n===")"){r.push({type:p.ParenClose});continue}if(n==="+"){if(x--,qe(t)){r.push(Le(t));continue}return}if(n==="-"){if(x--,qe(t)){r.push(Le(t));continue}if($t(t)){r.push({type:p.Ident,value:Be(t)});continue}return}if(n==="."){if(x--,qe(t)){r.push(Le(t));continue}return}if(n==="/"){for(;x<t.length&&(t[x]===` | ||
`||t[x]===" "||t[x]===" ");)x++;let o;if(qe(t)&&(o=Le(t),o.type!==p.Hue)){r.push({type:p.Alpha,value:o});continue}if($t(t)&&Be(t)==="none"){r.push({type:p.Alpha,value:{type:p.None,value:void 0}});continue}return}if(/\d/.test(n)){x--,r.push(Le(t));continue}if(Tt.test(n)){x--,r.push(yn(t));continue}return}return r}function Mn(e){e._i=0;let t=e[e._i++];if(!t||t.type!==p.Function||t.value!=="color"||(t=e[e._i++],t.type!==p.Ident))return;let r=Mt[t.value];if(!r)return;let n={mode:r},o=Fr(e,!1);if(!o)return;let a=Ir(r).channels;for(let i=0,l;i<a.length;i++)l=o[i],l.type!==p.None&&(n[a[i]]=l.type===p.Number?l.value:l.value/100);return n}function Fr(e,t){let r=[],n;for(;e._i<e.length;){if(n=e[e._i++],n.type===p.None||n.type===p.Number||n.type===p.Alpha||n.type===p.Percentage||t&&n.type===p.Hue){r.push(n);continue}if(n.type===p.ParenClose){if(e._i<e.length)return;continue}return}if(!(r.length<3||r.length>4)){if(r.length===4){if(r[3].type!==p.Alpha)return;r[3]=r[3].value}return r.length===3&&r.push({type:p.None,value:void 0}),r.every(o=>o.type!==p.Alpha)?r:void 0}}function Tn(e,t){e._i=0;let r=e[e._i++];if(!r||r.type!==p.Function)return;let n=Fr(e,t);if(n)return n.unshift(r.value),n}var $n=e=>{if(typeof e!="string")return;let t=vn(e),r=t?Tn(t,!0):void 0,n,o=0,a=we.length;for(;o<a;)if((n=we[o++](e,r))!==void 0)return n;return t?Mn(t):void 0},ke=$n;function kn(e,t){if(!t||t[0]!=="rgb"&&t[0]!=="rgba")return;let r={mode:"rgb"},[,n,o,a,i]=t;if(!(n.type===p.Hue||o.type===p.Hue||a.type===p.Hue))return n.type!==p.None&&(r.r=n.type===p.Number?n.value/255:n.value/100),o.type!==p.None&&(r.g=o.type===p.Number?o.value/255:o.value/100),a.type!==p.None&&(r.b=a.type===p.Number?a.value/255:a.value/100),i.type!==p.None&&(r.alpha=i.type===p.Number?i.value:i.value/100),r}var jr=kn;var zn=e=>e==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,Dr=zn;var qr=(e,t,r)=>e+r*(t-e);var wn=e=>{let t=[];for(let r=0;r<e.length-1;r++){let n=e[r],o=e[r+1];n===void 0&&o===void 0?t.push(void 0):n!==void 0&&o!==void 0?t.push([n,o]):t.push(n!==void 0?[n,n]:[o,o])}return t},Vr=e=>t=>{let r=wn(t);return n=>{let o=n*r.length,a=n>=1?r.length-1:Math.max(Math.floor(o),0),i=r[a];return i===void 0?void 0:e(i[0],i[1],o-a)}};var m=Vr(qr);var v=e=>{let t=!1,r=e.map(n=>n!==void 0?(t=!0,n):1);return t?r:e};var Ln={mode:"rgb",channels:["r","g","b","alpha"],parse:[jr,Er,Nr,Ar,Dr,"srgb"],serialize:"srgb",interpolate:{r:m,g:m,b:m,alpha:{use:m,fixup:v}},gamut:!0},E=Ln;var kt=e=>Math.pow(Math.abs(e),2.19921875)*Math.sign(e),Rn=e=>{let t=kt(e.r),r=kt(e.g),n=kt(e.b),o={mode:"xyz65",x:.5766690429101305*t+.1855582379065463*r+.1882286462349947*n,y:.297344975250536*t+.6273635662554661*r+.0752914584939979*n,z:.0270313613864123*t+.0706888525358272*r+.9913375368376386*n};return e.alpha!==void 0&&(o.alpha=e.alpha),o},zt=Rn;var wt=e=>Math.pow(Math.abs(e),.4547069271758437)*Math.sign(e),_n=({x:e,y:t,z:r,alpha:n})=>{let o={mode:"a98",r:wt(e*2.0415879038107465-t*.5650069742788597-.3447313507783297*r),g:wt(e*-.9692436362808798+t*1.8759675015077206+.0415550574071756*r),b:wt(e*.0134442806320312-t*.1183623922310184+1.0151749943912058*r)};return n!==void 0&&(o.alpha=n),o},Lt=_n;var Rt=e=>{let t=Math.abs(e);return t<.04045?e/12.92:(Math.sign(e)||1)*Math.pow((t+.055)/1.055,2.4)},Sn=({r:e,g:t,b:r,alpha:n})=>{let o={mode:"lrgb",r:Rt(e),g:Rt(t),b:Rt(r)};return n!==void 0&&(o.alpha=n),o},O=Sn;var Hn=e=>{let{r:t,g:r,b:n,alpha:o}=O(e),a={mode:"xyz65",x:.4123907992659593*t+.357584339383878*r+.1804807884018343*n,y:.2126390058715102*t+.715168678767756*r+.0721923153607337*n,z:.0193308187155918*t+.119194779794626*r+.9505321522496607*n};return o!==void 0&&(a.alpha=o),a},N=Hn;var _t=e=>{let t=Math.abs(e);return t>.0031308?(Math.sign(e)||1)*(1.055*Math.pow(t,.4166666666666667)-.055):e*12.92},Xn=({r:e,g:t,b:r,alpha:n},o="rgb")=>{let a={mode:o,r:_t(e),g:_t(t),b:_t(r)};return n!==void 0&&(a.alpha=n),a},C=Xn;var An=({x:e,y:t,z:r,alpha:n})=>{let o=C({r:e*3.2409699419045226-t*1.537383177570094-.4986107602930034*r,g:e*-.9692436362808796+t*1.8759675015077204+.0415550574071756*r,b:e*.0556300796969936-t*.2039769588889765+1.0569715142428784*r});return n!==void 0&&(o.alpha=n),o},P=An;var En={...E,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:e=>Lt(N(e)),xyz65:Lt},toMode:{rgb:e=>P(zt(e)),xyz65:zt}},Br=En;var On=e=>(e=e%360)<0?e+360:e,$=On;var Nn=(e,t)=>e.map((r,n,o)=>{if(r===void 0)return r;let a=$(r);return n===0||e[n-1]===void 0?a:t(a-$(o[n-1]))}).reduce((r,n)=>!r.length||n===void 0||r[r.length-1]===void 0?(r.push(n),r):(r.push(n+r[r.length-1]),r),[]),L=e=>Nn(e,t=>Math.abs(t)<=180?t:t-360*Math.sign(t));var w=[-.14861,1.78277,-.29227,-.90649,1.97294,0],Gr=Math.PI/180,Jr=180/Math.PI;var Yr=w[3]*w[4],Wr=w[1]*w[4],Zr=w[1]*w[2]-w[0]*w[3],Cn=({r:e,g:t,b:r,alpha:n})=>{let o=(Zr*r+e*Yr-t*Wr)/(Zr+Yr-Wr),a=r-o,i=(w[4]*(t-o)-w[2]*a)/w[3],l={mode:"cubehelix",l:o,s:o===0||o===1?void 0:Math.sqrt(a*a+i*i)/(w[4]*o*(1-o))};return l.s&&(l.h=Math.atan2(i,a)*Jr-120),n!==void 0&&(l.alpha=n),l},Ur=Cn;var Pn=({h:e,s:t,l:r,alpha:n})=>{let o={mode:"rgb"};e=(e===void 0?0:e+120)*Gr;let a=t===void 0?0:t*r*(1-r),i=Math.cos(e),l=Math.sin(e);return o.r=r+a*(w[0]*i+w[1]*l),o.g=r+a*(w[2]*i+w[3]*l),o.b=r+a*(w[4]*i+w[5]*l),n!==void 0&&(o.alpha=n),o},Kr=Pn;var U=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.s||!t.s)return 0;let r=$(e.h),n=$(t.h),o=Math.sin((n-r+360)/2*Math.PI/180);return 2*Math.sqrt(e.s*t.s)*o},Qr=(e,t)=>{if(e.h===void 0||t.h===void 0)return 0;let r=$(e.h),n=$(t.h);return Math.abs(n-r)>180?r-(n-360*Math.sign(n-r)):n-r},K=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.c||!t.c)return 0;let r=$(e.h),n=$(t.h),o=Math.sin((n-r+360)/2*Math.PI/180);return 2*Math.sqrt(e.c*t.c)*o};var R=e=>{let t=e.reduce((r,n)=>{if(n!==void 0){let o=n*Math.PI/180;r.sin+=Math.sin(o),r.cos+=Math.cos(o)}return r},{sin:0,cos:0});return Math.atan2(t.sin,t.cos)*180/Math.PI};var In={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:Ur},toMode:{rgb:Kr},interpolate:{h:{use:m,fixup:L},s:m,l:m,alpha:{use:m,fixup:v}},difference:{h:U},average:{h:R}},eo=In;var Fn=({l:e,a:t,b:r,alpha:n},o="lch")=>{let a=Math.sqrt(t*t+r*r),i={mode:o,l:e,c:a};return a&&(i.h=$(Math.atan2(r,t)*180/Math.PI)),n!==void 0&&(i.alpha=n),i},X=Fn;var jn=({l:e,c:t,h:r,alpha:n},o="lab")=>{let a={mode:o,l:e,a:t?t*Math.cos(r/180*Math.PI):0,b:t?t*Math.sin(r/180*Math.PI):0};return n!==void 0&&(a.alpha=n),a},A=jn;var Ge=Math.pow(29,3)/Math.pow(3,3),Je=Math.pow(6,3)/Math.pow(29,3);var k={X:.9642956764295677,Y:1,Z:.8251046025104602},Q={X:.3127/.329,Y:1,Z:(1-.3127-.329)/.329},y0=Math.pow(29,3)/Math.pow(3,3),v0=Math.pow(6,3)/Math.pow(29,3);var St=e=>Math.pow(e,3)>Je?Math.pow(e,3):(116*e-16)/Ge,Dn=({l:e,a:t,b:r,alpha:n})=>{let o=(e+16)/116,a=t/500+o,i=o-r/200,l={mode:"xyz65",x:St(a)*Q.X,y:St(o)*Q.Y,z:St(i)*Q.Z};return n!==void 0&&(l.alpha=n),l},Ye=Dn;var qn=e=>P(Ye(e)),ee=qn;var Ht=e=>e>Je?Math.cbrt(e):(Ge*e+16)/116,Vn=({x:e,y:t,z:r,alpha:n})=>{let o=Ht(e/Q.X),a=Ht(t/Q.Y),i=Ht(r/Q.Z),l={mode:"lab65",l:116*a-16,a:500*(o-a),b:200*(a-i)};return n!==void 0&&(l.alpha=n),l},We=Vn;var Bn=e=>{let t=We(N(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},te=Bn;var fe=.14444444444444443*Math.PI,ue=Math.cos(fe),me=Math.sin(fe),Ze=100/Math.log(139/100);var Gn=({l:e,c:t,h:r,alpha:n})=>{let o={mode:"lab65",l:(Math.exp(e*1/Ze)-1)/.0039};if(r===void 0)o.a=o.b=0;else{let a=(Math.exp(.0435*t*1*1)-1)/.075,i=a*Math.cos(r/180*Math.PI-fe),l=a*Math.sin(r/180*Math.PI-fe);o.a=i*ue-l/.83*me,o.b=i*me+l/.83*ue}return n!==void 0&&(o.alpha=n),o},_e=Gn;var Jn=({l:e,a:t,b:r,alpha:n})=>{let o=t*ue+r*me,a=.83*(r*ue-t*me),i=Math.sqrt(o*o+a*a),l={mode:"dlch",l:Ze/1*Math.log(1+.0039*e),c:Math.log(1+.075*i)/(.0435*1*1)};return l.c&&(l.h=$((Math.atan2(a,o)+fe)/Math.PI*180)),n!==void 0&&(l.alpha=n),l},Se=Jn;var to=e=>_e(X(e,"dlch")),ro=e=>A(Se(e),"dlab"),Yn={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:to,rgb:e=>ee(to(e))},fromMode:{lab65:ro,rgb:e=>ro(te(e))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:m,a:m,b:m,alpha:{use:m,fixup:v}}},oo=Yn;var Wn={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:_e,dlab:e=>A(e,"dlab"),rgb:e=>ee(_e(e))},fromMode:{lab65:Se,dlab:e=>X(e,"dlch"),rgb:e=>Se(te(e))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:m,c:m,h:{use:m,fixup:L},alpha:{use:m,fixup:v}},difference:{h:K},average:{h:R}},no=Wn;function At({h:e,s:t,i:r,alpha:n}){e=$(e);let o=Math.abs(e/60%2-1),a;switch(Math.floor(e/60)){case 0:a={r:r*(1+t*(3/(2-o)-1)),g:r*(1+t*(3*(1-o)/(2-o)-1)),b:r*(1-t)};break;case 1:a={r:r*(1+t*(3*(1-o)/(2-o)-1)),g:r*(1+t*(3/(2-o)-1)),b:r*(1-t)};break;case 2:a={r:r*(1-t),g:r*(1+t*(3/(2-o)-1)),b:r*(1+t*(3*(1-o)/(2-o)-1))};break;case 3:a={r:r*(1-t),g:r*(1+t*(3*(1-o)/(2-o)-1)),b:r*(1+t*(3/(2-o)-1))};break;case 4:a={r:r*(1+t*(3*(1-o)/(2-o)-1)),g:r*(1-t),b:r*(1+t*(3/(2-o)-1))};break;case 5:a={r:r*(1+t*(3/(2-o)-1)),g:r*(1-t),b:r*(1+t*(3*(1-o)/(2-o)-1))};break;default:a={r:r*(1-t),g:r*(1-t),b:r*(1-t)}}return a.mode="rgb",n!==void 0&&(a.alpha=n),a}function Et({r:e,g:t,b:r,alpha:n}){let o=Math.max(e,t,r),a=Math.min(e,t,r),i={mode:"hsi",s:e+t+r===0?0:1-3*a/(e+t+r),i:(e+t+r)/3};return o-a!==0&&(i.h=(o===e?(t-r)/(o-a)+(t<r)*6:o===t?(r-e)/(o-a)+2:(e-t)/(o-a)+4)*60),n!==void 0&&(i.alpha=n),i}var Zn={mode:"hsi",toMode:{rgb:At},parse:["--hsi"],serialize:"--hsi",fromMode:{rgb:Et},channels:["h","s","i","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:m,fixup:L},s:m,i:m,alpha:{use:m,fixup:v}},difference:{h:U},average:{h:R}},ao=Zn;function Ot({h:e,s:t,l:r,alpha:n}){e=$(e);let o=r+t*(r<.5?r:1-r),a=o-(o-r)*2*Math.abs(e/60%2-1),i;switch(Math.floor(e/60)){case 0:i={r:o,g:a,b:2*r-o};break;case 1:i={r:a,g:o,b:2*r-o};break;case 2:i={r:2*r-o,g:o,b:a};break;case 3:i={r:2*r-o,g:a,b:o};break;case 4:i={r:a,g:2*r-o,b:o};break;case 5:i={r:o,g:2*r-o,b:a};break;default:i={r:2*r-o,g:2*r-o,b:2*r-o}}return i.mode="rgb",n!==void 0&&(i.alpha=n),i}function Nt({r:e,g:t,b:r,alpha:n}){let o=Math.max(e,t,r),a=Math.min(e,t,r),i={mode:"hsl",s:o===a?0:(o-a)/(1-Math.abs(o+a-1)),l:.5*(o+a)};return o-a!==0&&(i.h=(o===e?(t-r)/(o-a)+(t<r)*6:o===t?(r-e)/(o-a)+2:(e-t)/(o-a)+4)*60),n!==void 0&&(i.alpha=n),i}var Un=(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}},io=Un;var Kn=new RegExp(`^hsla?\\(\\s*${Or}${Z}${ie}${Z}${ie}\\s*(?:,\\s*${$e}\\s*)?\\)$`),Qn=e=>{let t=e.match(Kn);if(!t)return;let r={mode:"hsl"};return t[3]!==void 0?r.h=+t[3]:t[1]!==void 0&&t[2]!==void 0&&(r.h=io(t[1],t[2])),t[4]!==void 0&&(r.s=Math.min(Math.max(0,t[4]/100),1)),t[5]!==void 0&&(r.l=Math.min(Math.max(0,t[5]/100),1)),t[6]!==void 0?r.alpha=t[6]/100:t[7]!==void 0&&(r.alpha=+t[7]),r},fo=Qn;function ea(e,t){if(!t||t[0]!=="hsl"&&t[0]!=="hsla")return;let r={mode:"hsl"},[,n,o,a,i]=t;if(n.type!==p.None){if(n.type===p.Percentage)return;r.h=n.value}if(o.type!==p.None){if(o.type===p.Hue)return;r.s=o.type===p.Number?o.value:o.value/100}if(a.type!==p.None){if(a.type===p.Hue)return;r.l=a.type===p.Number?a.value:a.value/100}return i.type!==p.None&&(r.alpha=i.type===p.Number?i.value:i.value/100),r}var lo=ea;var ta={mode:"hsl",toMode:{rgb:Ot},fromMode:{rgb:Nt},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[lo,fo],serialize:e=>`hsl(${e.h||0} ${e.s!==void 0?e.s*100+"%":"none"} ${e.l!==void 0?e.l*100+"%":"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:m,fixup:L},s:m,l:m,alpha:{use:m,fixup:v}},difference:{h:U},average:{h:R}},Ue=ta;function He({h:e,s:t,v:r,alpha:n}){e=$(e);let o=Math.abs(e/60%2-1),a;switch(Math.floor(e/60)){case 0:a={r,g:r*(1-t*o),b:r*(1-t)};break;case 1:a={r:r*(1-t*o),g:r,b:r*(1-t)};break;case 2:a={r:r*(1-t),g:r,b:r*(1-t*o)};break;case 3:a={r:r*(1-t),g:r*(1-t*o),b:r};break;case 4:a={r:r*(1-t*o),g:r*(1-t),b:r};break;case 5:a={r,g:r*(1-t),b:r*(1-t*o)};break;default:a={r:r*(1-t),g:r*(1-t),b:r*(1-t)}}return a.mode="rgb",n!==void 0&&(a.alpha=n),a}function Xe({r:e,g:t,b:r,alpha:n}){let o=Math.max(e,t,r),a=Math.min(e,t,r),i={mode:"hsv",s:o===0?0:1-a/o,v:o};return o-a!==0&&(i.h=(o===e?(t-r)/(o-a)+(t<r)*6:o===t?(r-e)/(o-a)+2:(e-t)/(o-a)+4)*60),n!==void 0&&(i.alpha=n),i}var ra={mode:"hsv",toMode:{rgb:He},parse:["--hsv"],serialize:"--hsv",fromMode:{rgb:Xe},channels:["h","s","v","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:m,fixup:L},s:m,v:m,alpha:{use:m,fixup:v}},difference:{h:U},average:{h:R}},Ke=ra;function Ct({h:e,w:t,b:r,alpha:n}){if(t+r>1){let o=t+r;t/=o,r/=o}return He({h:e,s:r===1?1:1-t/(1-r),v:1-r,alpha:n})}function Pt(e){let t=Xe(e);if(t===void 0)return;let r={mode:"hwb",w:(1-t.s)*t.v,b:1-t.v};return t.h!==void 0&&(r.h=t.h),t.alpha!==void 0&&(r.alpha=t.alpha),r}function oa(e,t){if(!t||t[0]!=="hwb")return;let r={mode:"hwb"},[,n,o,a,i]=t;if(n.type!==p.None){if(n.type===p.Percentage)return;r.h=n.value}if(o.type!==p.None){if(o.type===p.Hue)return;r.w=o.type===p.Number?o.value:o.value/100}if(a.type!==p.None){if(a.type===p.Hue)return;r.b=a.type===p.Number?a.value:a.value/100}return i.type!==p.None&&(r.alpha=i.type===p.Number?i.value:i.value/100),r}var so=oa;var na={mode:"hwb",toMode:{rgb:Ct},fromMode:{rgb:Pt},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[so],serialize:e=>`hwb(${e.h||0} ${e.w*100}% ${e.b*100}%${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:m,fixup:L},w:m,b:m,alpha:{use:m,fixup:v}},difference:{h:Qr},average:{h:R}},po=na;var aa=.1593017578125,ia=134.03437499999998,fa=.8359375,la=18.8515625,sa=18.6875,pa=16295499532821565e-27,It=e=>{let t=Math.pow(e/1e4,aa);return Math.pow((fa+la*t)/(1+sa*t),ia)||0},Ft=e=>Math.max(e*203,0),ua=({x:e,y:t,z:r,alpha:n})=>{e=Ft(e),t=Ft(t),r=Ft(r);let o=1.15*e-.15*r,a=.66*t+.34*e,i=It(.41478972*o+.579999*a+.014648*r),l=It(-.20151*o+1.120649*a+.0531008*r),b=It(-.0166008*o+.2648*a+.6684799*r),s=(i+l)/2,d={mode:"jab",j:.44*s/(1-.56*s)-pa,a:3.524*i-4.066708*l+.542708*b,b:.199076*i+1.096799*l-1.295875*b};return n!==void 0&&(d.alpha=n),d},Qe=ua;var ma=.1593017578125,ca=134.03437499999998,da=.8359375,ba=18.8515625,ha=18.6875,uo=16295499532821565e-27,jt=e=>{let t=Math.pow(e,1/ca);return 1e4*Math.pow((da-t)/(ha*t-ba),1/ma)||0},Dt=e=>e/203,xa=({j:e,a:t,b:r,alpha:n})=>{let o=(e+uo)/(.44+.56*(e+uo)),a=jt(o+.13860504*t+.058047316*r),i=jt(o-.13860504*t-.058047316*r),l=jt(o-.096019242*t-.8118919*r),b={mode:"xyz65",x:Dt(1.661373024652174*a-.914523081304348*i+.23136208173913045*l),y:Dt(-.3250758611844533*a+1.571847026732543*i-.21825383453227928*l),z:Dt(-.090982811*a-.31272829*i+1.5227666*l)};return n!==void 0&&(b.alpha=n),b},et=xa;var ga=e=>{let t=Qe(N(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},tt=ga;var ya=e=>P(et(e)),rt=ya;var va={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:tt,xyz65:Qe},toMode:{rgb:rt,xyz65:et},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:m,a:m,b:m,alpha:{use:m,fixup:v}}},mo=va;var Ma=({j:e,a:t,b:r,alpha:n})=>{let o=Math.sqrt(t*t+r*r),a={mode:"jch",j:e,c:o};return o&&(a.h=$(Math.atan2(r,t)*180/Math.PI)),n!==void 0&&(a.alpha=n),a},qt=Ma;var Ta=({j:e,c:t,h:r,alpha:n})=>{let o={mode:"jab",j:e,a:t?t*Math.cos(r/180*Math.PI):0,b:t?t*Math.sin(r/180*Math.PI):0};return n!==void 0&&(o.alpha=n),o},Vt=Ta;var $a={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:Vt,rgb:e=>rt(Vt(e))},fromMode:{rgb:e=>qt(tt(e)),jab:qt},channels:["j","c","h","alpha"],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:m,fixup:L},c:m,j:m,alpha:{use:m,fixup:v}},difference:{h:K},average:{h:R}},co=$a;var re=Math.pow(29,3)/Math.pow(3,3),ce=Math.pow(6,3)/Math.pow(29,3);var Bt=e=>Math.pow(e,3)>ce?Math.pow(e,3):(116*e-16)/re,ka=({l:e,a:t,b:r,alpha:n})=>{let o=(e+16)/116,a=t/500+o,i=o-r/200,l={mode:"xyz50",x:Bt(a)*k.X,y:Bt(o)*k.Y,z:Bt(i)*k.Z};return n!==void 0&&(l.alpha=n),l},de=ka;var za=({x:e,y:t,z:r,alpha:n})=>{let o=C({r:e*3.1341359569958707-t*1.6173863321612538-.4906619460083532*r,g:e*-.978795502912089+t*1.916254567259524+.03344273116131949*r,b:e*.07195537988411677-t*.2289768264158322+1.405386058324125*r});return n!==void 0&&(o.alpha=n),o},D=za;var wa=e=>D(de(e)),ot=wa;var La=e=>{let{r:t,g:r,b:n,alpha:o}=O(e),a={mode:"xyz50",x:.436065742824811*t+.3851514688337912*r+.14307845442264197*n,y:.22249319175623702*t+.7168870538238823*r+.06061979053616537*n,z:.013923904500943465*t+.09708128566574634*r+.7140993584005155*n};return o!==void 0&&(a.alpha=o),a},q=La;var Gt=e=>e>ce?Math.cbrt(e):(re*e+16)/116,Ra=({x:e,y:t,z:r,alpha:n})=>{let o=Gt(e/k.X),a=Gt(t/k.Y),i=Gt(r/k.Z),l={mode:"lab",l:116*a-16,a:500*(o-a),b:200*(a-i)};return n!==void 0&&(l.alpha=n),l},be=Ra;var _a=e=>{let t=be(q(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},nt=_a;function Sa(e,t){if(!t||t[0]!=="lab")return;let r={mode:"lab"},[,n,o,a,i]=t;if(!(n.type===p.Hue||o.type===p.Hue||a.type===p.Hue))return n.type!==p.None&&(r.l=n.value),o.type!==p.None&&(r.a=o.type===p.Number?o.value:o.value*125/100),a.type!==p.None&&(r.b=a.type===p.Number?a.value:a.value*125/100),i.type!==p.None&&(r.alpha=i.type===p.Number?i.value:i.value/100),r}var bo=Sa;var Ha={mode:"lab",toMode:{xyz50:de,rgb:ot},fromMode:{xyz50:be,rgb:nt},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-100,100],b:[-100,100]},parse:[bo],serialize:e=>`lab(${e.l!==void 0?e.l:"none"} ${e.a!==void 0?e.a:"none"} ${e.b!==void 0?e.b:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{l:m,a:m,b:m,alpha:{use:m,fixup:v}}},he=Ha;var Xa={...he,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:Ye,rgb:ee},fromMode:{xyz65:We,rgb:te},ranges:{l:[0,100],a:[-86.182,98.234],b:[-107.86,94.477]}},ho=Xa;function Aa(e,t){if(!t||t[0]!=="lch")return;let r={mode:"lch"},[,n,o,a,i]=t;if(n.type!==p.None){if(n.type===p.Hue)return;r.l=n.value}if(o.type!==p.None&&(r.c=Math.max(0,o.type===p.Number?o.value:o.value*150/100)),a.type!==p.None){if(a.type===p.Percentage)return;r.h=a.value}return i.type!==p.None&&(r.alpha=i.type===p.Number?i.value:i.value/100),r}var xo=Aa;var Ea={mode:"lch",toMode:{lab:A,rgb:e=>ot(A(e))},fromMode:{rgb:e=>X(nt(e)),lab:X},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[xo],serialize:e=>`lch(${e.l!==void 0?e.l:"none"} ${e.c!==void 0?e.c:"none"} ${e.h||0}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:m,fixup:L},c:m,l:m,alpha:{use:m,fixup:v}},difference:{h:K},average:{h:R}},xe=Ea;var Oa={...xe,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:e=>A(e,"lab65"),rgb:e=>ee(A(e,"lab65"))},fromMode:{rgb:e=>X(te(e),"lch65"),lab65:e=>X(e,"lch65")},ranges:{l:[0,100],c:[0,133.807],h:[0,360]}},go=Oa;var Na=({l:e,u:t,v:r,alpha:n})=>{let o=Math.sqrt(t*t+r*r),a={mode:"lchuv",l:e,c:o};return o&&(a.h=$(Math.atan2(r,t)*180/Math.PI)),n!==void 0&&(a.alpha=n),a},Jt=Na;var Ca=({l:e,c:t,h:r,alpha:n})=>{let o={mode:"luv",l:e,u:t?t*Math.cos(r/180*Math.PI):0,v:t?t*Math.sin(r/180*Math.PI):0};return n!==void 0&&(o.alpha=n),o},Yt=Ca;var yo=(e,t,r)=>4*e/(e+15*t+3*r),vo=(e,t,r)=>9*t/(e+15*t+3*r),Pa=yo(k.X,k.Y,k.Z),Ia=vo(k.X,k.Y,k.Z),Fa=e=>e<=ce?re*e:116*Math.cbrt(e)-16,ja=({x:e,y:t,z:r,alpha:n})=>{let o=Fa(t/k.Y),a=yo(e,t,r),i=vo(e,t,r);!isFinite(a)||!isFinite(i)?o=a=i=0:(a=13*o*(a-Pa),i=13*o*(i-Ia));let l={mode:"luv",l:o,u:a,v:i};return n!==void 0&&(l.alpha=n),l},Ae=ja;var Da=(e,t,r)=>4*e/(e+15*t+3*r),qa=(e,t,r)=>9*t/(e+15*t+3*r),Va=Da(k.X,k.Y,k.Z),Ba=qa(k.X,k.Y,k.Z),Ga=({l:e,u:t,v:r,alpha:n})=>{let o=t/(13*e)+Va,a=r/(13*e)+Ba,i=k.Y*(e<=8?e/re:Math.pow((e+16)/116,3)),l=i*(9*o)/(4*a),b=i*(12-3*o-20*a)/(4*a),s={mode:"xyz50",x:l,y:i,z:b};return n!==void 0&&(s.alpha=n),s},Ee=Ga;var Ja=e=>Jt(Ae(q(e))),Ya=e=>D(Ee(Yt(e))),Wa={mode:"lchuv",toMode:{luv:Yt,rgb:Ya},fromMode:{rgb:Ja,luv:Jt},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:m,fixup:L},c:m,l:m,alpha:{use:m,fixup:v}},difference:{h:K},average:{h:R}},Mo=Wa;var Za={...E,mode:"lrgb",toMode:{rgb:C},fromMode:{rgb:O},parse:["srgb-linear"],serialize:"srgb-linear"},To=Za;var Ua={mode:"luv",toMode:{xyz50:Ee,rgb:e=>D(Ee(e))},fromMode:{xyz50:Ae,rgb:e=>Ae(q(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:m,u:m,v:m,alpha:{use:m,fixup:v}}},$o=Ua;var Ka=({r:e,g:t,b:r,alpha:n})=>{let o=Math.cbrt(.41222147079999993*e+.5363325363*t+.0514459929*r),a=Math.cbrt(.2119034981999999*e+.6806995450999999*t+.1073969566*r),i=Math.cbrt(.08830246189999998*e+.2817188376*t+.6299787005000002*r),l={mode:"oklab",l:.2104542553*o+.793617785*a-.0040720468*i,a:1.9779984951*o-2.428592205*a+.4505937099*i,b:.0259040371*o+.7827717662*a-.808675766*i};return n!==void 0&&(l.alpha=n),l},at=Ka;var Qa=e=>{let t=at(O(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},oe=Qa;var ei=({l:e,a:t,b:r,alpha:n})=>{let o=Math.pow(e*.9999999984505198+.39633779217376786*t+.2158037580607588*r,3),a=Math.pow(e*1.0000000088817609-.10556134232365635*t-.06385417477170591*r,3),i=Math.pow(e*1.0000000546724108-.08948418209496575*t-1.2914855378640917*r,3),l={mode:"lrgb",r:4.076741661347994*o-3.307711590408193*a+.230969928729428*i,g:-1.2684380040921763*o+2.6097574006633715*a-.3413193963102197*i,b:-.004196086541837188*o-.7034186144594493*a+1.7076147009309444*i};return n!==void 0&&(l.alpha=n),l},V=ei;var ti=e=>C(V(e)),ne=ti;function Oe(e){let n=1.170873786407767;return .5*(n*e-.206+Math.sqrt((n*e-.206)*(n*e-.206)+4*.03*n*e))}function le(e){let n=1.170873786407767;return(e*e+.206*e)/(n*(e+.03))}function ri(e,t){let r,n,o,a,i,l,b,s;-1.88170328*e-.80936493*t>1?(r=1.19086277,n=1.76576728,o=.59662641,a=.75515197,i=.56771245,l=4.0767416621,b=-3.3077115913,s=.2309699292):1.81444104*e-1.19445276*t>1?(r=.73956515,n=-.45954404,o=.08285427,a=.1254107,i=.14503204,l=-1.2684380046,b=2.6097574011,s=-.3413193965):(r=1.35733652,n=-.00915799,o=-1.1513021,a=-.50559606,i=.00692167,l=-.0041960863,b=-.7034186147,s=1.707614701);let d=r+n*e+o*t+a*e*e+i*e*t,y=.3963377774*e+.2158037573*t,c=-.1055613458*e-.0638541728*t,f=-.0894841775*e-1.291485548*t;{let g=1+d*y,u=1+d*c,h=1+d*f,M=g*g*g,z=u*u*u,B=h*h*h,H=3*y*g*g,G=3*c*u*u,_=3*f*h*h,ye=6*y*y*g,ve=6*c*c*u,Me=6*f*f*h,se=l*M+b*z+s*B,ae=l*H+b*G+s*_,Te=l*ye+b*ve+s*Me;d=d-se*ae/(ae*ae-.5*se*Te)}return d}function Wt(e,t){let r=ri(e,t),n=V({l:1,a:r*e,b:r*t}),o=Math.cbrt(1/Math.max(n.r,n.g,n.b)),a=o*r;return[o,a]}function oi(e,t,r,n,o,a=null){a||(a=Wt(e,t));let i;if((r-o)*a[1]-(a[0]-o)*n<=0)i=a[1]*o/(n*a[0]+a[1]*(o-r));else{i=a[1]*(o-1)/(n*(a[0]-1)+a[1]*(o-r));{let l=r-o,b=n,s=.3963377774*e+.2158037573*t,d=-.1055613458*e-.0638541728*t,y=-.0894841775*e-1.291485548*t,c=l+b*s,f=l+b*d,g=l+b*y;{let u=o*(1-i)+i*r,h=i*n,M=u+h*s,z=u+h*d,B=u+h*y,H=M*M*M,G=z*z*z,_=B*B*B,ye=3*c*M*M,ve=3*f*z*z,Me=3*g*B*B,se=6*c*c*M,ae=6*f*f*z,Te=6*g*g*B,vr=4.0767416621*H-3.3077115913*G+.2309699292*_-1,dt=4.0767416621*ye-3.3077115913*ve+.2309699292*Me,Ko=4.0767416621*se-3.3077115913*ae+.2309699292*Te,Mr=dt/(dt*dt-.5*vr*Ko),bt=-vr*Mr,Tr=-1.2684380046*H+2.6097574011*G-.3413193965*_-1,ht=-1.2684380046*ye+2.6097574011*ve-.3413193965*Me,Qo=-1.2684380046*se+2.6097574011*ae-.3413193965*Te,$r=ht/(ht*ht-.5*Tr*Qo),xt=-Tr*$r,kr=-.0041960863*H-.7034186147*G+1.707614701*_-1,gt=-.0041960863*ye-.7034186147*ve+1.707614701*Me,en=-.0041960863*se-.7034186147*ae+1.707614701*Te,zr=gt/(gt*gt-.5*kr*en),yt=-kr*zr;bt=Mr>=0?bt:1e6,xt=$r>=0?xt:1e6,yt=zr>=0?yt:1e6,i+=Math.min(bt,Math.min(xt,yt))}}}return i}function Ne(e,t,r=null){r||(r=Wt(e,t));let n=r[0],o=r[1];return[o/n,o/(1-n)]}function it(e,t,r){let n=Wt(t,r),o=oi(t,r,e,1,e,n),a=Ne(t,r,n),i=.11516993+1/(7.4477897+4.1590124*r+t*(-2.19557347+1.75198401*r+t*(-2.13704948-10.02301043*r+t*(-4.24894561+5.38770819*r+4.69891013*t)))),l=.11239642+1/(1.6132032-.68124379*r+t*(.40370612+.90148123*r+t*(-.27087943+.6122399*r+t*(.00299215-.45399568*r-.14661872*t)))),b=o/Math.min(e*a[0],(1-e)*a[1]),s=e*i,d=(1-e)*l,y=.9*b*Math.sqrt(Math.sqrt(1/(1/(s*s*s*s)+1/(d*d*d*d))));return s=e*.4,d=(1-e)*.8,[Math.sqrt(1/(1/(s*s)+1/(d*d))),y,o]}function ft(e){let t={mode:"okhsl",l:Oe(e.l)};e.alpha!==void 0&&(t.alpha=e.alpha);let r=Math.sqrt(e.a*e.a+e.b*e.b);if(!r)return t.s=0,t;let[n,o,a]=it(e.l,e.a/r,e.b/r),i;if(r<o){let l=0,b=.8*n,s=1-b/o;i=(r-l)/(b+s*(r-l))*.8}else{let l=o,b=.2*o*o*1.25*1.25/n,s=1-b/(a-o);i=.8+.2*((r-l)/(b+s*(r-l)))}return i&&(t.s=i,t.h=$(Math.atan2(e.b,e.a)*180/Math.PI)),t}function lt(e){let t=le(e.l),r={mode:"oklab",l:t};if(e.alpha!==void 0&&(r.alpha=e.alpha),!e.s||e.l===1)return r.a=r.b=0,r;let n=Math.cos(e.h/180*Math.PI),o=Math.sin(e.h/180*Math.PI),[a,i,l]=it(t,n,o),b,s,d,y;e.s<.8?(b=1.25*e.s,s=0,d=.8*a,y=1-d/i):(b=5*(e.s-.8),s=i,d=.2*i*i*1.25*1.25/a,y=1-d/(l-i));let c=s+b*d/(1-y*b);return r.a=c*n,r.b=c*o,r}var ni={...Ue,mode:"okhsl",channels:["h","s","l","alpha"],parse:["--okhsl"],serialize:"--okhsl",fromMode:{oklab:ft,rgb:e=>ft(oe(e))},toMode:{oklab:lt,rgb:e=>ne(lt(e))}},ko=ni;function st(e){let t=Math.sqrt(e.a*e.a+e.b*e.b),r=e.l,n=t?e.a/t:1,o=t?e.b/t:1,[a,i]=Ne(n,o),l=.5,b=1-l/a,s=i/(t+r*i),d=s*r,y=s*t,c=le(d),f=y*c/d,g=V({l:c,a:n*f,b:o*f}),u=Math.cbrt(1/Math.max(g.r,g.g,g.b,0));r=r/u,t=t/u*Oe(r)/r,r=Oe(r);let h={mode:"okhsv",s:t?(l+i)*y/(i*l+i*b*y):0,v:r?r/d:0};return h.s&&(h.h=$(Math.atan2(e.b,e.a)*180/Math.PI)),e.alpha!==void 0&&(h.alpha=e.alpha),h}function pt(e){let t={mode:"oklab"};e.alpha!==void 0&&(t.alpha=e.alpha);let r=e.h||0,n=Math.cos(r/180*Math.PI),o=Math.sin(r/180*Math.PI),[a,i]=Ne(n,o),l=.5,b=1-l/a,s=1-e.s*l/(l+i-i*b*e.s),d=e.s*i*l/(l+i-i*b*e.s),y=le(s),c=d*y/s,f=V({l:y,a:n*c,b:o*c}),g=Math.cbrt(1/Math.max(f.r,f.g,f.b,0)),u=le(e.v*s),h=d*u/s;return t.l=u*g,t.a=h*n*g,t.b=h*o*g,t}var ai={...Ke,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:st,rgb:e=>st(oe(e))},toMode:{oklab:pt,rgb:e=>ne(pt(e))}},zo=ai;function ii(e,t){if(!t||t[0]!=="oklab")return;let r={mode:"oklab"},[,n,o,a,i]=t;if(!(n.type===p.Hue||o.type===p.Hue||a.type===p.Hue))return n.type!==p.None&&(r.l=n.type===p.Number?n.value:n.value/100),o.type!==p.None&&(r.a=o.type===p.Number?o.value:o.value*.4/100),a.type!==p.None&&(r.b=a.type===p.Number?a.value:a.value*.4/100),i.type!==p.None&&(r.alpha=i.type===p.Number?i.value:i.value/100),r}var wo=ii;var fi={...he,mode:"oklab",toMode:{lrgb:V,rgb:ne},fromMode:{lrgb:at,rgb:oe},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[wo],serialize:e=>`oklab(${e.l!==void 0?e.l:"none"} ${e.a!==void 0?e.a:"none"} ${e.b!==void 0?e.b:"none"}${e.alpha<1?` / ${e.alpha}`:""})`},Lo=fi;function li(e,t){if(!t||t[0]!=="oklch")return;let r={mode:"oklch"},[,n,o,a,i]=t;if(n.type!==p.None){if(n.type===p.Hue)return;r.l=n.type===p.Number?n.value:n.value/100}if(o.type!==p.None&&(r.c=Math.max(0,o.type===p.Number?o.value:o.value*.4/100)),a.type!==p.None){if(a.type===p.Percentage)return;r.h=a.value}return i.type!==p.None&&(r.alpha=i.type===p.Number?i.value:i.value/100),r}var Ro=li;var si={...xe,mode:"oklch",toMode:{oklab:e=>A(e,"oklab"),rgb:e=>ne(A(e,"oklab"))},fromMode:{rgb:e=>X(oe(e),"oklch"),oklab:e=>X(e,"oklch")},parse:[Ro],serialize:e=>`oklch(${e.l!==void 0?e.l:"none"} ${e.c!==void 0?e.c:"none"} ${e.h||0}${e.alpha<1?` / ${e.alpha}`:""})`,ranges:{l:[0,1],c:[0,.4],h:[0,360]}},_o=si;var pi=e=>{let{r:t,g:r,b:n,alpha:o}=O(e),a={mode:"xyz65",x:.486570948648216*t+.265667693169093*r+.1982172852343625*n,y:.2289745640697487*t+.6917385218365062*r+.079286914093745*n,z:0*t+.0451133818589026*r+1.043944368900976*n};return o!==void 0&&(a.alpha=o),a},Zt=pi;var ui=({x:e,y:t,z:r,alpha:n})=>{let o=C({r:e*2.4934969119414263-t*.9313836179191242-.402710784450717*r,g:e*-.8294889695615749+t*1.7626640603183465+.0236246858419436*r,b:e*.0358458302437845-t*.0761723892680418+.9568845240076871*r},"p3");return n!==void 0&&(o.alpha=n),o},Ut=ui;var mi={...E,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:e=>Ut(N(e)),xyz65:Ut},toMode:{rgb:e=>P(Zt(e)),xyz65:Zt}},So=mi;var Kt=e=>{let t=Math.abs(e);return t>=.001953125?Math.sign(e)*Math.pow(t,.5555555555555556):16*e},ci=({x:e,y:t,z:r,alpha:n})=>{let o={mode:"prophoto",r:Kt(e*1.3457868816471585-t*.2555720873797946-.0511018649755453*r),g:Kt(e*-.5446307051249019+t*1.5082477428451466+.0205274474364214*r),b:Kt(e*0+t*0+1.2119675456389452*r)};return n!==void 0&&(o.alpha=n),o},Qt=ci;var er=e=>{let t=Math.abs(e);return t>=.03125?Math.sign(e)*Math.pow(t,1.8):e/16},di=e=>{let t=er(e.r),r=er(e.g),n=er(e.b),o={mode:"xyz50",x:.7977666449006423*t+.1351812974005331*r+.0313477341283922*n,y:.2880748288194013*t+.7118352342418731*r+899369387256e-16*n,z:0*t+0*r+.8251046025104602*n};return e.alpha!==void 0&&(o.alpha=e.alpha),o},tr=di;var bi={...E,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:Qt,rgb:e=>Qt(q(e))},toMode:{xyz50:tr,rgb:e=>D(tr(e))}},Ho=bi;var Xo=1.09929682680944,hi=.018053968510807,rr=e=>{let t=Math.abs(e);return t>hi?(Math.sign(e)||1)*(Xo*Math.pow(t,.45)-(Xo-1)):4.5*e},xi=({x:e,y:t,z:r,alpha:n})=>{let o={mode:"rec2020",r:rr(e*1.7166511879712683-t*.3556707837763925-.2533662813736599*r),g:rr(e*-.6666843518324893+t*1.6164812366349395+.0157685458139111*r),b:rr(e*.0176398574453108-t*.0427706132578085+.9421031212354739*r)};return n!==void 0&&(o.alpha=n),o},or=xi;var Ao=1.09929682680944,gi=.018053968510807,nr=e=>{let t=Math.abs(e);return t<gi*4.5?e/4.5:(Math.sign(e)||1)*Math.pow((t+Ao-1)/Ao,1/.45)},yi=e=>{let t=nr(e.r),r=nr(e.g),n=nr(e.b),o={mode:"xyz65",x:.6369580483012911*t+.1446169035862083*r+.1688809751641721*n,y:.262700212011267*t+.6779980715188708*r+.059301716469862*n,z:0*t+.0280726930490874*r+1.0609850577107909*n};return e.alpha!==void 0&&(o.alpha=e.alpha),o},ar=yi;var vi={...E,mode:"rec2020",fromMode:{xyz65:or,rgb:e=>or(N(e))},toMode:{xyz65:ar,rgb:e=>P(ar(e))},parse:["rec2020"],serialize:"rec2020"},Eo=vi;var J=.0037930732552754493,ut=Math.cbrt(J);var ir=e=>Math.cbrt(e)-ut,Mi=e=>{let{r:t,g:r,b:n,alpha:o}=O(e),a=ir(.3*t+.622*r+.078*n+J),i=ir(.23*t+.692*r+.078*n+J),l=ir(.2434226892454782*t+.2047674442449682*r+.5518098665095535*n+J),b={mode:"xyb",x:(a-i)/2,y:(a+i)/2,b:l-(a+i)/2};return o!==void 0&&(b.alpha=o),b},Oo=Mi;var fr=e=>Math.pow(e+ut,3),Ti=({x:e,y:t,b:r,alpha:n})=>{let o=fr(e+t)-J,a=fr(t-e)-J,i=fr(r+t)-J,l=C({r:11.031566904639861*o-9.866943908131562*a-.16462299650829934*i,g:-3.2541473810744237*o+4.418770377582723*a-.16462299650829934*i,b:-3.6588512867136815*o+2.7129230459360922*a+1.9459282407775895*i});return n!==void 0&&(l.alpha=n),l},No=Ti;var $i={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:No},fromMode:{rgb:Oo},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:m,y:m,b:m,alpha:{use:m,fixup:v}}},Co=$i;var ki={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:D,lab:be},fromMode:{rgb:q,lab:de},channels:["x","y","z","alpha"],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:m,y:m,z:m,alpha:{use:m,fixup:v}}},Po=ki;var zi=e=>{let{x:t,y:r,z:n,alpha:o}=e,a={mode:"xyz50",x:1.0479298208405488*t+.0229467933410191*r-.0501922295431356*n,y:.0296278156881593*t+.990434484573249*r-.0170738250293851*n,z:-.0092430581525912*t+.0150551448965779*r+.7518742899580008*n};return o!==void 0&&(a.alpha=o),a},Io=zi;var wi=e=>{let{x:t,y:r,z:n,alpha:o}=e,a={mode:"xyz65",x:.9554734527042182*t-.0230985368742614*r+.0632593086610217*n,y:-.0283697069632081*t+1.0099954580058226*r+.021041398966943*n,z:.0123140016883199*t-.0205076964334779*r+1.3303659366080753*n};return o!==void 0&&(a.alpha=o),a},Fo=wi;var Li={mode:"xyz65",toMode:{rgb:P,xyz50:Io},fromMode:{rgb:N,xyz50:Fo},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:m,y:m,z:m,alpha:{use:m,fixup:v}}},jo=Li;var Ri=({r:e,g:t,b:r,alpha:n})=>{let o={mode:"yiq",y:.29889531*e+.58662247*t+.11448223*r,i:.59597799*e-.2741761*t-.32180189*r,q:.21147017*e-.52261711*t+.31114694*r};return n!==void 0&&(o.alpha=n),o},Do=Ri;var _i=({y:e,i:t,q:r,alpha:n})=>{let o={mode:"rgb",r:e+.95608445*t+.6208885*r,g:e-.27137664*t-.6486059*r,b:e-1.10561724*t+1.70250126*r};return n!==void 0&&(o.alpha=n),o},qo=_i;var Si={mode:"yiq",toMode:{rgb:qo},fromMode:{rgb:Do},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:m,i:m,q:m,alpha:{use:m,fixup:v}}},Vo=Si;var Hi=(e,t)=>Math.round(e*(t=Math.pow(10,t)))/t,Xi=(e=4)=>t=>typeof t=="number"?Hi(t,e):t,Bo=Xi;var Mc=Bo(2),Ai=e=>Math.max(0,Math.min(1,e)),mt=e=>Math.round(Ai(e)*255),lr=e=>{if(e===void 0)return;let t=mt(e.r),r=mt(e.g),n=mt(e.b);return"#"+(1<<24|t<<16|r<<8|n).toString(16).slice(1)},Go=e=>{if(e===void 0)return;let t=mt(e.alpha!==void 0?e.alpha:1);return lr(e)+(256|t).toString(16).slice(1)};var sr=e=>lr(ze("rgb")(e)),pr=e=>Go(ze("rgb")(e));var nd=T(Br),ad=T(eo),id=T(oo),fd=T(no),ld=T(ao),sd=T(Ue),pd=T(Ke),ud=T(po),md=T(mo),cd=T(co),dd=T(he),bd=T(ho),hd=T(xe),xd=T(go),gd=T(Mo),yd=T(To),vd=T($o),Md=T(ko),Td=T(zo),$d=T(Lo),kd=T(_o),zd=T(So),wd=T(Ho),Ld=T(Eo),Rd=T(E),_d=T(Co),Sd=T(Po),Hd=T(jo),Xd=T(Vo);function Y(e,t){if(!e)throw new Error("missing value");if(typeof e=="string"){if(t.convertToHex===!1)return e;let r=ke(e);if(!r)throw new Error(`invalid color "${e}"`);return typeof r.alpha=="number"&&r.alpha<1?pr(r):sr(r)}throw new Error(`expected string, received ${typeof e}`)}function Ce(e){if(!e)throw new Error("missing value");if(typeof e=="string")return[e];if(Array.isArray(e)){if(e.every(t=>!!t&&typeof t=="string"))return e;throw new Error("expected array of strings")}throw new Error(`expected string or array of strings, received ${typeof e}`)}var Ei=/^\d+(\.\d+)?(ms|s)$/;function ge(e){if(typeof e=="number")return`${e}ms`;if(typeof e=="string"){if(parseFloat(e)===0)return"0ms";if(Ei.test(e))return e;throw new Error(`invalid duration "${e}"`)}throw new Error(`expected string, received ${typeof e}`)}function I(e){if(typeof e=="number"){if(e===0)return"0";throw new Error("missing units")}if(typeof e=="string")return parseFloat(e)===0?"0":e;throw new Error(`expected string, received ${typeof e}`)}function Pe(e){if(!e)throw new Error("missing value");if(!Array.isArray(e)||e.length!==4||e.some(t=>typeof t!="number"))throw new Error(`expected [\u{1D465}1, \u{1D466}1, \u{1D465}2, \u{1D466}2], received ${JSON.stringify(e)}`);return[Math.max(0,Math.min(1,e[0])),e[1],Math.max(0,Math.min(1,e[2])),e[3]]}function ur(e){if(!e)throw new Error("missing value");if(typeof e=="string")return e;throw new Error(`expected string, received ${typeof e}`)}var Jo=new Set(["solid","dashed","dotted","double","groove","ridge","outset","inset"]);function Ie(e){if(!Jo.has(e))throw new Error(`Unsupported stroke type "${e}", must be one of: | ||
- ${[...Jo].join(` | ||
- `)}`);return e}function mr(e,t){if(!D(e))throw new Error(`Expected object, received ${Array.isArray(e)?"array":typeof e}`);let r=e;if(!("color"in r))throw new Error('Token missing required "color" property');if(!("width"in r))throw new Error('Token missing required "width" property');if(!("style"in r))throw new Error('Token missing required "style" property');return{color:Y(r.color,t.color),width:I(r.width),style:Ie(r.style)}}var Oi=[.25,.1,.25,1];function dr(e){if(!e)throw new Error("missing value");if(typeof e!="object"||Array.isArray(e))throw new Error("invalid transition format, e");if(!Object.keys(e).length)throw new Error("At least 1 transition property is required");let t=e;return{duration:ge(t.duration||"0"),delay:ge(t.delay||"0"),timingFunction:Pe(t.timingFunction||Oi)}}function cr(e,t){if(!e)throw new Error("missing value");if(typeof e!="object"||Array.isArray(e))throw new Error("invalid shadow");let r=e;for(let n of["offsetX","offsetX","blur","spread","color"]){if(typeof r[n]=="number"&&r[n]>0)throw new Error(`${n} missing units`);if((n==="offsetX"||n==="offsetY")&&typeof r[n]!="string"&&r[n]!==0)throw new Error(`missing ${n}`)}return{offsetX:I(r.offsetX||"0"),offsetY:I(r.offsetY||"0"),blur:I(r.blur||"0"),spread:I(r.spread||"0"),color:Y(r.color,t.color)}}function br(e,t){if(!e)throw new Error("missing value");if(!Array.isArray(e))throw new Error(`expected array of gradient stops, received ${typeof e}`);if(e.some(r=>!r||!r.color))throw new Error("all gradient stops must have color");return e.map(r=>({color:Y(r.color,t.color),position:typeof r.position=="number"?Math.max(0,Math.min(1,r.position)):void 0}))}var Yo={thin:100,hairline:100,"extra-light":200,"ultra-light":200,light:300,normal:400,regular:400,book:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,"extra-bold":800,"ultra-bold":800,black:900,heavy:900,"extra-black":950,"ultra-black":950};function qe(e){if(!e)throw new Error("missing value");if(typeof e=="number")return e;if(typeof e=="string"&&e in Yo)return Yo[e];throw new Error(`expected number or font weight alias, received ${e} (${typeof e})`)}function hr(e){if(!e)throw new Error("missing value");if(typeof e!="object"||Array.isArray(e))throw new Error(`expected object, received ${Array.isArray(e)?"array":typeof e}`);if(!Object.keys(e).length)throw new Error("must specify at least 1 font property");let t={};for(let[r,n]of Object.entries(e)){let o=_r(r);switch(o){case"font":case"fontName":case"fontFamily":{t.fontFamily=Ce(n);break}case"fontWeight":{t.fontWeight=qe(n);break}default:{t[o]=typeof n=="string"&&parseFloat(n)>=0?I(n):n;break}}}return t}function xr(e){if(e==null)throw new Error("missing value");if(typeof e=="number")return e;throw new Error(`expected number, received ${typeof e}`)}function Wo(e){let t=[],r=[],n={};function o(i,l){let b=[...l],p=b.pop(),c=n;for(let y of b)y in c||(c[y]={}),c=c[y];c[p]=i}function a(i,l){if(!(!i||typeof i!="object")){for(let[b,p]of Object.entries(i))if(!b.startsWith("$")){if(p&&typeof p=="object"&&"type"in p&&"value"in p){let c=[...l,b].join("."),y=l[0];if(typeof p.value=="string")p.value.trim().startsWith("{")&&!p.value.trim().startsWith(`{${y}`)&&(p.value=p.value.trim().replace("{",`{${y}.`));else if(p.value&&typeof p.value=="object")for(let[d,f]of Object.entries(p.value))typeof f=="string"&&f.trim().startsWith("{")&&!f.trim().startsWith(`{${y}`)&&(p.value[d]=p.value[d].trim().replace("{",`{${y}.`));switch(p.type){case"border":{o({$type:"border",$value:p.value},[...l,b]);break}case"borderRadius":{if(typeof p.value!="string"){o({$type:"borderRadius",$value:p.value},[...l,b]);break}let d=p.value.split(" ").map(f=>f.trim()).filter(Boolean);if(d.length===1)o({$type:"dimension",$value:p.value.trim()},[...l,b]);else if(d.length===2||d.length===3||d.length===4){r.push(`Token "${c}" is a multi value borderRadius token. Expanding into ${c}TopLeft, ${c}TopRight, ${c}BottomRight, and ${c}BottomLeft.`);let f=[d[0],d[1],d[0],d[1]];d.length===3?f=[d[0],d[1],d[2],d[1]]:d.length===4&&(f=[d[0],d[1],d[2],d[3]]),o({$type:"dimension",$value:f[0]},[...l,`${b}TopLeft`]),o({$type:"dimension",$value:f[1]},[...l,`${b}TopRight`]),o({$type:"dimension",$value:f[2]},[...l,`${b}BottomRight`]),o({$type:"dimension",$value:f[3]},[...l,`${b}BottomLeft`])}else o({$type:"borderRadius",$value:p.value},[...l,b]);break}case"boxShadow":{if(!p.value||typeof p.value!="object"){o({$type:"shadow",$value:p.value},[...l,b]);break}o({$type:"shadow",$value:{offsetX:p.value.x,offsetY:p.value.y,blur:p.value.blur,spread:p.value.spread,color:p.value.color}},[...l,b]);break}case"color":{if(p.value.includes("linear-gradient(")){let d=[],[f,...g]=p.value.replace(")","").split(",");for(let u of g){let[h,M]=u.trim().split(" ");h.includes("$")&&(h=`{${y}.${h.replace("$","")}}`),M.includes("%")?M=parseFloat(M)/100:typeof M=="string"&&M.length&&(M=parseFloat(M)),d.push({color:h,position:M})}o({$type:"gradient",$value:d},[...l,b]);break}o({$type:"color",$value:p.value},[...l,b]);break}case"fontFamilies":{o({$type:"fontFamily",$value:p.value},[...l,b]);break}case"borderWidth":case"dimension":case"fontSizes":case"letterSpacing":case"lineHeights":case"opacity":case"sizing":{typeof p.value=="number"||typeof p.value=="string"&&String(Number(p.value))===p.value?o({$type:"number",$value:Number(p.value)},[...l,b]):o({$type:"dimension",$value:p.value},[...l,b]);break}case"fontWeights":{o({$type:"fontWeight",$value:parseInt(p.value,10)||p.value},[...l,b]);break}case"spacing":{if(typeof p.value!="string"){o({$type:"spacing",$value:p.value},[...l,b]);break}let d=p.value.split(" ").map(f=>f.trim()).filter(Boolean);if(d.length===1)o({$type:"dimension",$value:p.value.trim()},[...l,b]);else if(d.length===2||d.length===3||d.length===4){r.push(`Token "${c}" is a multi value spacing token. Expanding into ${c}Top, ${c}Right, ${c}Bottom, and ${c}Left.`);let f=[d[0],d[1],d[0],d[1]];d.length===3?f=[d[0],d[1],d[2],d[1]]:d.length===4&&(f=[d[0],d[1],d[2],d[3]]),o({$type:"dimension",$value:f[0]},[...l,`${b}Top`]),o({$type:"dimension",$value:f[1]},[...l,`${b}Right`]),o({$type:"dimension",$value:f[2]},[...l,`${b}Bottom`]),o({$type:"dimension",$value:f[3]},[...l,`${b}Left`])}else o({$type:"spacing",$value:p.value},[...l,b]);break}case"textDecoration":case"textCase":break;case"typography":{if(p.value&&typeof p.value=="object"){for(let d of["textCase","textDecoration"])if(d in p.value&&W(p.value[d])){let f=new Set,g=pe(p.value[d]).split("."),u=dt(e,[...g,"value"])??dt(e,[y,...g,"value"]);for(typeof u=="string"&&f.add(u);typeof u=="string"&&W(u);){let h=pe(u).split(".");if(u=dt(e,[...h,"value"])??dt(e,[y,...h,"value"]),typeof u=="string"&&f.has(u)){t.push(`Alias "${p.value[d]}" is a circular reference`),u=void 0;break}typeof u=="string"&&f.add(u)}u?p.value[d]=u:delete p.value[d]}}o({$type:"typography",$value:p.value},[...l,b]);break}}continue}a(p,[...l,b])}}}return a(e,[]),{errors:t.length?t:void 0,warnings:r.length?r:void 0,result:n}}function Zo(e){return!!e&&typeof e=="object"&&"$themes"in e&&Array.isArray(e.$themes)&&"$metadata"in e&&typeof e.$metadata=="object"}function dt(e,t){let r=e;for(let n of t){if(!r||typeof r!="object"||!(n in r))break;r=r[n]}return r}var Uo=new Set(["$description","$name","$type","$value","$extensions"]);function yr(e,t){let r=[],n=[],o={result:{metadata:{},tokens:[]}};if(!e||typeof e!="object"||Array.isArray(e))return r.push(`Invalid schema type. Expected object, received "${Array.isArray(e)?"Array":typeof e}"`),o.errors=r,o;let a=e;if(Zo(e)){let f=Wo(e);r.push(...f.errors??[]),n.push(...f.warnings??[]),a=f.result}let i={};function l(f,g=[],u={$extensions:{requiredModes:[]}}){if(!(!f||!D(f)))for(let[h,M]of Object.entries(f)){if(!M||!D(M)){r.push(`${h}: unexpected token format "${M}"`);continue}if(h.includes(".")||h.includes("{")||h.includes("}")||h.includes("#")){r.push(`${h}: IDs can\u2019t include any of the following: .{}#`);continue}Object.keys(M).length||r.push(`${h}: groups can\u2019t be empty`);let z={_original:De(M),_group:{id:g.join(".")||".",...u||{}},id:g.concat(h).join("."),$type:M.$type||u.$type,...M};if("$value"in z){if(h.startsWith("$")){r.push(`${h}: token ID can\u2019t start with the $ character`);continue}if(Hr(z.$value)){r.push(`${z.id}: missing "$value"`);continue}if(z.$extensions&&z.$extensions.mode&&!D(z.$extensions.mode)&&r.push(`${z.id}: "mode" must be an object`),u.$extensions.requiredModes.length)for(let H of u.$extensions.requiredModes)(!z.$extensions||!z.$extensions.mode||!z.$extensions.mode[H])&&r.push(`${z.id}: missing mode "${H}" required from parent group`);i[z.id]=z}else{let H={...u},G={};for(let _ of Object.keys(M))_.startsWith("$")?(_==="$extensions"?H.$extensions={...H.$extensions,...M.$extensions}:H[_]=M[_],Uo.has(_)||(o.warnings||(o.warnings=[]),o.warnings.push(`Unknown property "${_}"`))):G[_]=M[_];if(Object.values(G).every(_=>D(_)))l(G,[...g,h],H);else throw new Error(`${h}: missing $type`)}}}let b={$extensions:{requiredModes:[]}},p={};for(let f of Object.keys(a))f.startsWith("$")?(f==="$extensions"?b.$extensions={...a.$extensions,...b.$extensions}:b[f]=a[f],Uo.has(f)||(o.warnings||(o.warnings=[]),o.warnings.push(`Unknown property "${f}"`)),o.result.metadata[f]=a[f]):p[f]=a[f];if(l(p,[],b),r.length)return o.errors=r,o;let c={};for(let f of Object.values(i))if(c[f.id]=f.$value,f.$extensions&&f.$extensions.mode)for(let[g,u]of Object.entries(f.$extensions.mode||{}))c[`${f.id}#${g}`]=u;function y(f,g){return vt(g,{default(u){return u},string(u){if(!W(u))return u;let h=pe(u);if(!(h in c))throw new Error(`${f}: can\u2019t find ${u}`);let M=c[h];if(typeof M=="string"&&W(M)&&f===pe(M))throw new Error(`${f}: can\u2019t reference circular alias ${u}`);return c[h]},array(u){return u.map(h=>y(f,h))},object(u){for(let h of Object.keys(u))u[h]=y(f,u[h]);return u}})}for(;gr(c);)try{for(let[f,g]of Object.entries(c))c[f]=y(f,g)}catch(f){r.push(f.message||f);break}if(r.length)return o.errors=r,o;function d(f,g){let u=i[f];if(!(!u.$extensions||!u.$extensions.mode))for(let h of Object.keys(u.$extensions.mode||{}))i[f].$extensions.mode[h]=g(c[`${f}#${h}`])}for(let[f,g]of Object.entries(i))try{switch(g.$type){case"color":{i[f].$value=Y(c[f],t.color),d(f,u=>Y(u,t.color));break}case"dimension":{i[f].$value=I(c[f]),d(f,u=>I(u));break}case"font":case"fontFamily":{g.$type==="font"&&console.warn(`${Rr}@cobalt-ui/core${Lr} $type: "font" is deprecated. Please use "fontFamily" instead.`),i[f].$value=Ce(c[f]),d(f,u=>Ce(u));break}case"fontWeight":{i[f].$value=qe(c[f]),d(f,u=>qe(u));break}case"duration":{i[f].$value=ge(c[f]),d(f,u=>ge(u));break}case"cubicBezier":{i[f].$value=Pe(c[f]),d(f,u=>Pe(u));break}case"number":{i[f].$value=xr(c[f]),d(f,u=>xr(u));break}case"link":{i[f].$value=ur(c[f]),d(f,u=>ur(u));break}case"strokeStyle":{i[f].$value=Ie(c[f]),d(f,u=>Ie(u));break}case"border":{i[f].$value=mr(c[f],{color:t.color}),d(f,u=>mr(u,{color:t.color}));break}case"transition":{i[f].$value=dr(c[f]),d(f,u=>dr(u));break}case"shadow":{i[f].$value=cr(c[f],{color:t.color}),d(f,u=>cr(u,{color:t.color}));break}case"gradient":{i[f].$value=br(c[f],{color:t.color}),d(f,u=>br(u,{color:t.color}));break}case"typography":{i[f].$value=hr(c[f]),d(f,u=>hr(u));break}default:{i[f].value=c[f],d(f,u=>u);break}}}catch(u){r.push(`${f}: ${u.message||u}`)}return r.length&&(o.errors=r),n.length&&(o.warnings=n),o.result.tokens=Object.values(i),o.result.tokens.sort((f,g)=>f.id.localeCompare(g.id,"en-us",{numeric:!0})),o}function gr(e){return Object.values(e).some(t=>vt(t,{default:()=>!1,string:r=>W(r),array:r=>r.some(n=>typeof n=="string"?W(n):D(n)?gr(n):!1),object:r=>gr(r)}))}var H1={parse:yr};export{H1 as default,yr as parse}; | ||
- `)}`);return e}function mr(e,t){if(!j(e))throw new Error(`Expected object, received ${Array.isArray(e)?"array":typeof e}`);let r=e;if(!("color"in r))throw new Error('Token missing required "color" property');if(!("width"in r))throw new Error('Token missing required "width" property');if(!("style"in r))throw new Error('Token missing required "style" property');return{color:Y(r.color,t.color),width:I(r.width),style:Ie(r.style)}}var Oi=[.25,.1,.25,1];function cr(e){if(!e)throw new Error("missing value");if(typeof e!="object"||Array.isArray(e))throw new Error(`expected object, got ${typeof e}`);if(!("duration"in e))throw new Error("missing duration");if(!("timingFunction"in e))throw new Error("missing timingFunction");let t=e;return{duration:ge(t.duration||"0"),delay:ge(t.delay||"0"),timingFunction:Pe(t.timingFunction||Oi)}}function dr(e,t){if(!e)throw new Error("missing value");if(typeof e!="object"&&!Array.isArray(e))throw new Error(`expected object or array of objects, got ${typeof e}`);let r=Array.isArray(e)?e:[e];return r.map((n,o)=>{for(let a of["offsetX","offsetX","blur","spread","color"]){let i=r.length>1?`shadow #${o+1}: `:"";if(typeof n[a]=="number"&&n[a]>0)throw new Error(`${i}${a} missing units`);if((a==="offsetX"||a==="offsetY")&&typeof n[a]!="string"&&n[a]!==0)throw new Error(`${i}missing ${a}`)}return{offsetX:I(n.offsetX||"0"),offsetY:I(n.offsetY||"0"),blur:I(n.blur||"0"),spread:I(n.spread||"0"),color:Y(n.color,t.color),inset:n.inset??!1}})}function br(e,t){if(!e)throw new Error("missing value");if(!Array.isArray(e))throw new Error(`expected array, received ${typeof e}`);if(e.some(r=>!r||!r.color))throw new Error("all gradient stops must have color");return e.map(r=>({color:Y(r.color,t.color),position:typeof r.position=="number"?Math.max(0,Math.min(1,r.position)):void 0}))}var Yo={thin:100,hairline:100,"extra-light":200,"ultra-light":200,light:300,normal:400,regular:400,book:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,"extra-bold":800,"ultra-bold":800,black:900,heavy:900,"extra-black":950,"ultra-black":950};function Fe(e){if(!e)throw new Error("missing value");if(typeof e=="number")return e;if(typeof e=="string"&&e in Yo)return Yo[e];throw new Error(`expected number or font weight alias, received ${e} (${typeof e})`)}function hr(e){if(!e)throw new Error("missing value");if(typeof e!="object"||Array.isArray(e))throw new Error(`expected object, received ${Array.isArray(e)?"array":typeof e}`);if(!Object.keys(e).length)throw new Error("must specify at least 1 font property");let t={};for(let[r,n]of Object.entries(e)){let o=_r(r);switch(o){case"font":case"fontName":case"fontFamily":{t.fontFamily=Ce(n);break}case"fontWeight":{t.fontWeight=Fe(n);break}default:{t[o]=typeof n=="string"&&parseFloat(n)>=0?I(n):n;break}}}return t}function xr(e){if(e==null)throw new Error("missing value");if(typeof e=="number")return e;throw new Error(`expected number, received ${typeof e}`)}function Wo(e){let t=[],r=[],n={};function o(i,l){let b=[...l],s=b.pop(),d=n;for(let y of b)y in d||(d[y]={}),d=d[y];d[s]=i}function a(i,l){if(!(!i||typeof i!="object")){for(let[b,s]of Object.entries(i))if(!b.startsWith("$")){if(s&&typeof s=="object"&&"type"in s&&"value"in s){let d=[...l,b].join("."),y=l[0];if(typeof s.value=="string")s.value.trim().startsWith("{")&&!s.value.trim().startsWith(`{${y}`)&&(s.value=s.value.trim().replace("{",`{${y}.`));else if(s.value&&typeof s.value=="object")for(let[c,f]of Object.entries(s.value))typeof f=="string"&&f.trim().startsWith("{")&&!f.trim().startsWith(`{${y}`)&&(s.value[c]=s.value[c].trim().replace("{",`{${y}.`));switch(s.type){case"border":{o({$type:"border",$value:s.value},[...l,b]);break}case"borderRadius":{if(typeof s.value!="string"){o({$type:"borderRadius",$value:s.value},[...l,b]);break}let c=s.value.split(" ").map(f=>f.trim()).filter(Boolean);if(c.length===1)o({$type:"dimension",$value:s.value.trim()},[...l,b]);else if(c.length===2||c.length===3||c.length===4){r.push(`Token "${d}" is a multi value borderRadius token. Expanding into ${d}TopLeft, ${d}TopRight, ${d}BottomRight, and ${d}BottomLeft.`);let f=[c[0],c[1],c[0],c[1]];c.length===3?f=[c[0],c[1],c[2],c[1]]:c.length===4&&(f=[c[0],c[1],c[2],c[3]]),o({$type:"dimension",$value:f[0]},[...l,`${b}TopLeft`]),o({$type:"dimension",$value:f[1]},[...l,`${b}TopRight`]),o({$type:"dimension",$value:f[2]},[...l,`${b}BottomRight`]),o({$type:"dimension",$value:f[3]},[...l,`${b}BottomLeft`])}else o({$type:"borderRadius",$value:s.value},[...l,b]);break}case"boxShadow":{if(!s.value||typeof s.value!="object"){o({$type:"shadow",$value:s.value},[...l,b]);break}o({$type:"shadow",$value:[{offsetX:s.value.x,offsetY:s.value.y,blur:s.value.blur,spread:s.value.spread,color:s.value.color,inset:s.value.inset??!1}]},[...l,b]);break}case"color":{if(s.value.includes("linear-gradient(")){let c=[],[f,...g]=s.value.replace(")","").split(",");for(let u of g){let[h,M]=u.trim().split(" ");h.includes("$")&&(h=`{${y}.${h.replace("$","")}}`),M.includes("%")?M=parseFloat(M)/100:typeof M=="string"&&M.length&&(M=parseFloat(M)),c.push({color:h,position:M})}o({$type:"gradient",$value:c},[...l,b]);break}o({$type:"color",$value:s.value},[...l,b]);break}case"fontFamilies":{o({$type:"fontFamily",$value:s.value},[...l,b]);break}case"borderWidth":case"dimension":case"fontSizes":case"letterSpacing":case"lineHeights":case"opacity":case"sizing":{typeof s.value=="number"||typeof s.value=="string"&&String(Number(s.value))===s.value?o({$type:"number",$value:Number(s.value)},[...l,b]):o({$type:"dimension",$value:s.value},[...l,b]);break}case"fontWeights":{o({$type:"fontWeight",$value:parseInt(s.value,10)||s.value},[...l,b]);break}case"spacing":{if(typeof s.value!="string"){o({$type:"spacing",$value:s.value},[...l,b]);break}let c=s.value.split(" ").map(f=>f.trim()).filter(Boolean);if(c.length===1)o({$type:"dimension",$value:s.value.trim()},[...l,b]);else if(c.length===2||c.length===3||c.length===4){r.push(`Token "${d}" is a multi value spacing token. Expanding into ${d}Top, ${d}Right, ${d}Bottom, and ${d}Left.`);let f=[c[0],c[1],c[0],c[1]];c.length===3?f=[c[0],c[1],c[2],c[1]]:c.length===4&&(f=[c[0],c[1],c[2],c[3]]),o({$type:"dimension",$value:f[0]},[...l,`${b}Top`]),o({$type:"dimension",$value:f[1]},[...l,`${b}Right`]),o({$type:"dimension",$value:f[2]},[...l,`${b}Bottom`]),o({$type:"dimension",$value:f[3]},[...l,`${b}Left`])}else o({$type:"spacing",$value:s.value},[...l,b]);break}case"textDecoration":case"textCase":break;case"typography":{if(s.value&&typeof s.value=="object"){for(let c of["textCase","textDecoration"])if(c in s.value&&W(s.value[c])){let f=new Set,g=pe(s.value[c]).split("."),u=ct(e,[...g,"value"])??ct(e,[y,...g,"value"]);for(typeof u=="string"&&f.add(u);typeof u=="string"&&W(u);){let h=pe(u).split(".");if(u=ct(e,[...h,"value"])??ct(e,[y,...h,"value"]),typeof u=="string"&&f.has(u)){t.push(`Alias "${s.value[c]}" is a circular reference`),u=void 0;break}typeof u=="string"&&f.add(u)}u?s.value[c]=u:delete s.value[c]}}o({$type:"typography",$value:s.value},[...l,b]);break}}continue}a(s,[...l,b])}}}return a(e,[]),{errors:t.length?t:void 0,warnings:r.length?r:void 0,result:n}}function Zo(e){return!!e&&typeof e=="object"&&"$themes"in e&&Array.isArray(e.$themes)&&"$metadata"in e&&typeof e.$metadata=="object"}function ct(e,t){let r=e;for(let n of t){if(!r||typeof r!="object"||!(n in r))break;r=r[n]}return r}var Uo=new Set(["$description","$name","$type","$value","$extensions"]);function yr(e,t){let r=[],n=[],o={result:{metadata:{},tokens:[]}};if(!e||typeof e!="object"||Array.isArray(e))return r.push(`Invalid schema type. Expected object, received "${Array.isArray(e)?"Array":typeof e}"`),o.errors=r,o;let a=e;if(Zo(e)){let f=Wo(e);r.push(...f.errors??[]),n.push(...f.warnings??[]),a=f.result}let i={};function l(f,g=[],u={$extensions:{requiredModes:[]}}){if(!(!f||!j(f)))for(let[h,M]of Object.entries(f)){if(!M||!j(M)){r.push(`${h}: unexpected token format "${M}"`);continue}if(h.includes(".")||h.includes("{")||h.includes("}")||h.includes("#")){r.push(`${h}: IDs can\u2019t include any of the following: .{}#`);continue}Object.keys(M).length||r.push(`${h}: groups can\u2019t be empty`);let z={_original:je(M),_group:{id:g.join(".")||".",...u||{}},id:g.concat(h).join("."),$type:M.$type||u.$type,...M};if("$value"in z){if(h.startsWith("$")){r.push(`${h}: token ID can\u2019t start with the $ character`);continue}if(Hr(z.$value)){r.push(`${z.id}: missing "$value"`);continue}if(z.$extensions&&z.$extensions.mode&&!j(z.$extensions.mode)&&r.push(`${z.id}: "mode" must be an object`),u.$extensions.requiredModes.length)for(let H of u.$extensions.requiredModes)(!z.$extensions||!z.$extensions.mode||!z.$extensions.mode[H])&&r.push(`${z.id}: missing mode "${H}" required from parent group`);i[z.id]=z}else{let H={...u},G={};for(let _ of Object.keys(M))_.startsWith("$")?(_==="$extensions"?H.$extensions={...H.$extensions,...M.$extensions}:H[_]=M[_],Uo.has(_)||(o.warnings||(o.warnings=[]),o.warnings.push(`Unknown property "${_}"`))):G[_]=M[_];if(Object.values(G).every(_=>j(_)))l(G,[...g,h],H);else throw new Error(`${h}: missing $type`)}}}let b={$extensions:{requiredModes:[]}},s={};for(let f of Object.keys(a))f.startsWith("$")?(f==="$extensions"?b.$extensions={...a.$extensions,...b.$extensions}:b[f]=a[f],Uo.has(f)||(o.warnings||(o.warnings=[]),o.warnings.push(`Unknown property "${f}"`)),o.result.metadata[f]=a[f]):s[f]=a[f];if(l(s,[],b),r.length)return o.errors=r,o;let d={};for(let f of Object.values(i))if(d[f.id]=f.$value,f.$extensions&&f.$extensions.mode)for(let[g,u]of Object.entries(f.$extensions.mode||{}))d[`${f.id}#${g}`]=u;function y(f,g){return vt(g,{default(u){return u},string(u){if(!W(u))return u;let h=pe(u);if(!(h in d))throw new Error(`${f}: can\u2019t find ${u}`);let M=d[h];if(typeof M=="string"&&W(M)&&f===pe(M))throw new Error(`${f}: can\u2019t reference circular alias ${u}`);return d[h]},array(u){return u.map(h=>y(f,h))},object(u){for(let h of Object.keys(u))u[h]=y(f,u[h]);return u}})}for(;gr(d);)try{for(let[f,g]of Object.entries(d))d[f]=y(f,g)}catch(f){r.push(f.message||f);break}if(r.length)return o.errors=r,o;function c(f,g){let u=i[f];if(!(!u.$extensions||!u.$extensions.mode))for(let h of Object.keys(u.$extensions.mode||{}))i[f].$extensions.mode[h]=g(d[`${f}#${h}`])}for(let[f,g]of Object.entries(i))try{switch(g.$type){case"color":{i[f].$value=Y(d[f],t.color),c(f,u=>Y(u,t.color));break}case"dimension":{i[f].$value=I(d[f]),c(f,u=>I(u));break}case"font":case"fontFamily":{g.$type==="font"&&console.warn(`${Rr}@cobalt-ui/core${Lr} $type: "font" is deprecated. Please use "fontFamily" instead.`),i[f].$value=Ce(d[f]),c(f,u=>Ce(u));break}case"fontWeight":{i[f].$value=Fe(d[f]),c(f,u=>Fe(u));break}case"duration":{i[f].$value=ge(d[f]),c(f,u=>ge(u));break}case"cubicBezier":{i[f].$value=Pe(d[f]),c(f,u=>Pe(u));break}case"number":{i[f].$value=xr(d[f]),c(f,u=>xr(u));break}case"link":{i[f].$value=ur(d[f]),c(f,u=>ur(u));break}case"strokeStyle":{i[f].$value=Ie(d[f]),c(f,u=>Ie(u));break}case"border":{i[f].$value=mr(d[f],{color:t.color}),c(f,u=>mr(u,{color:t.color}));break}case"transition":{i[f].$value=cr(d[f]),c(f,u=>cr(u));break}case"shadow":{i[f].$value=dr(d[f],{color:t.color}),c(f,u=>dr(u,{color:t.color}));break}case"gradient":{i[f].$value=br(d[f],{color:t.color}),c(f,u=>br(u,{color:t.color}));break}case"typography":{i[f].$value=hr(d[f]),c(f,u=>hr(u));break}default:{i[f].value=d[f],c(f,u=>u);break}}}catch(u){r.push(`${f}: ${u.message||u}`)}return r.length&&(o.errors=r),n.length&&(o.warnings=n),o.result.tokens=Object.values(i),o.result.tokens.sort((f,g)=>f.id.localeCompare(g.id,"en-us",{numeric:!0})),o}function gr(e){return Object.values(e).some(t=>vt(t,{default:()=>!1,string:r=>W(r),array:r=>r.some(n=>typeof n=="string"?W(n):j(n)?gr(n):!1),object:r=>gr(r)}))}var H1={parse:yr};export{H1 as default,yr as parse}; | ||
//# sourceMappingURL=index.min.js.map |
@@ -93,10 +93,13 @@ /** | ||
$type: 'shadow', | ||
$value: { | ||
offsetX: v.value.x, | ||
offsetY: v.value.y, | ||
blur: v.value.blur, | ||
spread: v.value.spread, | ||
color: v.value.color, | ||
// type: ignore??? | ||
}, | ||
$value: [ | ||
{ | ||
offsetX: v.value.x, | ||
offsetY: v.value.y, | ||
blur: v.value.blur, | ||
spread: v.value.spread, | ||
color: v.value.color, | ||
inset: v.value.inset ?? false, | ||
// type: ignore??? | ||
}, | ||
], | ||
}, [...path, k]); | ||
@@ -103,0 +106,0 @@ break; |
@@ -17,3 +17,3 @@ import { normalizeColorValue } from './color.js'; | ||
if (!Array.isArray(value)) | ||
throw new Error(`expected array of gradient stops, received ${typeof value}`); | ||
throw new Error(`expected array, received ${typeof value}`); | ||
if (value.some((v) => !v || !v.color)) | ||
@@ -20,0 +20,0 @@ throw new Error('all gradient stops must have color'); |
@@ -1,2 +0,2 @@ | ||
import type { ShadowValue } from '../../token.js'; | ||
import type { ParsedShadowToken } from '../../token.js'; | ||
import { ParseColorOptions } from './color.js'; | ||
@@ -16,6 +16,7 @@ export interface ParseShadowOptions { | ||
* "blur": "1.5rem", | ||
* "spread": "0rem" | ||
* "spread": "0rem", | ||
* "inset": false | ||
* } | ||
* } | ||
*/ | ||
export declare function normalizeShadowValue(value: unknown, options: ParseShadowOptions): ShadowValue; | ||
export declare function normalizeShadowValue(value: unknown, options: ParseShadowOptions): ParsedShadowToken['$value']; |
@@ -13,3 +13,4 @@ import { normalizeColorValue } from './color.js'; | ||
* "blur": "1.5rem", | ||
* "spread": "0rem" | ||
* "spread": "0rem", | ||
* "inset": false | ||
* } | ||
@@ -21,22 +22,28 @@ * } | ||
throw new Error('missing value'); | ||
if (typeof value !== 'object' || Array.isArray(value)) | ||
throw new Error('invalid shadow'); | ||
const v = value; | ||
for (const k of ['offsetX', 'offsetX', 'blur', 'spread', 'color']) { | ||
if (typeof v[k] === 'number' && v[k] > 0) | ||
throw new Error(`${k} missing units`); | ||
if (k === 'offsetX' || k === 'offsetY') { | ||
if (typeof v[k] !== 'string' && v[k] !== 0) | ||
throw new Error(`missing ${k}`); | ||
if (typeof value !== 'object' && !Array.isArray(value)) | ||
throw new Error(`expected object or array of objects, got ${typeof value}`); | ||
const v = Array.isArray(value) ? value : [value]; | ||
return v.map((shadow, i) => { | ||
for (const k of ['offsetX', 'offsetX', 'blur', 'spread', 'color']) { | ||
const errorPrefix = v.length > 1 ? `shadow #${i + 1}: ` : ''; // in error message, show shadow number, but only if there are multiple shadows | ||
if (typeof shadow[k] === 'number' && shadow[k] > 0) { | ||
throw new Error(`${errorPrefix}${k} missing units`); | ||
} | ||
if (k === 'offsetX' || k === 'offsetY') { | ||
if (typeof shadow[k] !== 'string' && shadow[k] !== 0) { | ||
throw new Error(`${errorPrefix}missing ${k}`); | ||
} | ||
} | ||
} | ||
} | ||
return { | ||
offsetX: normalizeDimensionValue(v.offsetX || '0'), | ||
offsetY: normalizeDimensionValue(v.offsetY || '0'), | ||
blur: normalizeDimensionValue(v.blur || '0'), | ||
spread: normalizeDimensionValue(v.spread || '0'), | ||
color: normalizeColorValue(v.color, options.color), | ||
// extra values are discarded rather than throwing an error | ||
}; | ||
return { | ||
offsetX: normalizeDimensionValue(shadow.offsetX || '0'), | ||
offsetY: normalizeDimensionValue(shadow.offsetY || '0'), | ||
blur: normalizeDimensionValue(shadow.blur || '0'), | ||
spread: normalizeDimensionValue(shadow.spread || '0'), | ||
color: normalizeColorValue(shadow.color, options.color), | ||
inset: shadow.inset ?? false, | ||
// extra values are discarded rather than throwing an error | ||
}; | ||
}); | ||
} | ||
//# sourceMappingURL=shadow.js.map |
@@ -21,5 +21,8 @@ import { normalizeDurationValue } from './duration.js'; | ||
if (typeof value !== 'object' || Array.isArray(value)) | ||
throw new Error('invalid transition format, e'); | ||
if (!Object.keys(value).length) | ||
throw new Error('At least 1 transition property is required'); | ||
throw new Error(`expected object, got ${typeof value}`); | ||
if (!('duration' in value)) | ||
throw new Error('missing duration'); | ||
// currently delay is optional; is that right? | ||
if (!('timingFunction' in value)) | ||
throw new Error('missing timingFunction'); | ||
const v = value; | ||
@@ -26,0 +29,0 @@ return { |
@@ -124,7 +124,9 @@ export type Group = { | ||
color: ColorToken['$value']; | ||
/** is this shadow inset? */ | ||
inset?: boolean; | ||
} | ||
export interface ShadowToken extends TokenBase<Partial<ShadowValue>> { | ||
export interface ShadowToken extends TokenBase<Partial<ShadowValue> | Partial<ShadowValue>[]> { | ||
$type: 'shadow'; | ||
} | ||
export interface ParsedShadowToken extends ParsedTokenBase<ShadowValue> { | ||
export interface ParsedShadowToken extends ParsedTokenBase<ShadowValue[]> { | ||
$type: 'shadow'; | ||
@@ -131,0 +133,0 @@ _original: ShadowToken; |
{ | ||
"name": "@cobalt-ui/core", | ||
"description": "CLI for using the W3C design token format", | ||
"version": "1.4.3", | ||
"version": "1.5.0", | ||
"author": { | ||
@@ -30,3 +30,3 @@ "name": "Drew Powers", | ||
"dependencies": { | ||
"@cobalt-ui/utils": "^1.2.1", | ||
"@cobalt-ui/utils": "^1.2.2", | ||
"@types/culori": "^2.0.0", | ||
@@ -36,6 +36,6 @@ "culori": "^3.2.0" | ||
"devDependencies": { | ||
"@types/node": "^20.5.0", | ||
"@types/node": "^20.5.7", | ||
"esbuild": "^0.19.2", | ||
"npm-run-all": "^4.1.5", | ||
"vitest": "^0.34.2" | ||
"vitest": "^0.34.3" | ||
}, | ||
@@ -42,0 +42,0 @@ "scripts": { |
@@ -92,10 +92,13 @@ /** | ||
$type: 'shadow', | ||
$value: { | ||
offsetX: v.value.x, | ||
offsetY: v.value.y, | ||
blur: v.value.blur, | ||
spread: v.value.spread, | ||
color: v.value.color, | ||
// type: ignore??? | ||
}, | ||
$value: [ | ||
{ | ||
offsetX: v.value.x, | ||
offsetY: v.value.y, | ||
blur: v.value.blur, | ||
spread: v.value.spread, | ||
color: v.value.color, | ||
inset: v.value.inset ?? false, | ||
// type: ignore??? | ||
}, | ||
], | ||
}, | ||
@@ -102,0 +105,0 @@ [...path, k], |
@@ -21,3 +21,3 @@ import type {GradientStop, ParsedGradientToken} from '../../token.js'; | ||
if (!value) throw new Error('missing value'); | ||
if (!Array.isArray(value)) throw new Error(`expected array of gradient stops, received ${typeof value}`); | ||
if (!Array.isArray(value)) throw new Error(`expected array, received ${typeof value}`); | ||
if (value.some((v) => !v || !v.color)) throw new Error('all gradient stops must have color'); | ||
@@ -24,0 +24,0 @@ return (value as any).map((v: GradientStop) => ({ |
@@ -1,2 +0,2 @@ | ||
import type {ShadowValue} from '../../token.js'; | ||
import type {ParsedShadowToken} from '../../token.js'; | ||
import {ParseColorOptions, normalizeColorValue} from './color.js'; | ||
@@ -19,24 +19,33 @@ import {normalizeDimensionValue} from './dimension.js'; | ||
* "blur": "1.5rem", | ||
* "spread": "0rem" | ||
* "spread": "0rem", | ||
* "inset": false | ||
* } | ||
* } | ||
*/ | ||
export function normalizeShadowValue(value: unknown, options: ParseShadowOptions): ShadowValue { | ||
export function normalizeShadowValue(value: unknown, options: ParseShadowOptions): ParsedShadowToken['$value'] { | ||
if (!value) throw new Error('missing value'); | ||
if (typeof value !== 'object' || Array.isArray(value)) throw new Error('invalid shadow'); | ||
const v = value as any; | ||
for (const k of ['offsetX', 'offsetX', 'blur', 'spread', 'color']) { | ||
if (typeof v[k] === 'number' && v[k] > 0) throw new Error(`${k} missing units`); | ||
if (k === 'offsetX' || k === 'offsetY') { | ||
if (typeof v[k] !== 'string' && v[k] !== 0) throw new Error(`missing ${k}`); | ||
if (typeof value !== 'object' && !Array.isArray(value)) throw new Error(`expected object or array of objects, got ${typeof value}`); | ||
const v = Array.isArray(value) ? value : [value]; | ||
return v.map((shadow: any, i: number) => { | ||
for (const k of ['offsetX', 'offsetX', 'blur', 'spread', 'color']) { | ||
const errorPrefix = v.length > 1 ? `shadow #${i + 1}: ` : ''; // in error message, show shadow number, but only if there are multiple shadows | ||
if (typeof shadow[k] === 'number' && shadow[k] > 0) { | ||
throw new Error(`${errorPrefix}${k} missing units`); | ||
} | ||
if (k === 'offsetX' || k === 'offsetY') { | ||
if (typeof shadow[k] !== 'string' && shadow[k] !== 0) { | ||
throw new Error(`${errorPrefix}missing ${k}`); | ||
} | ||
} | ||
} | ||
} | ||
return { | ||
offsetX: normalizeDimensionValue(v.offsetX || '0'), | ||
offsetY: normalizeDimensionValue(v.offsetY || '0'), | ||
blur: normalizeDimensionValue(v.blur || '0'), | ||
spread: normalizeDimensionValue(v.spread || '0'), | ||
color: normalizeColorValue(v.color, options.color), | ||
// extra values are discarded rather than throwing an error | ||
}; | ||
return { | ||
offsetX: normalizeDimensionValue(shadow.offsetX || '0'), | ||
offsetY: normalizeDimensionValue(shadow.offsetY || '0'), | ||
blur: normalizeDimensionValue(shadow.blur || '0'), | ||
spread: normalizeDimensionValue(shadow.spread || '0'), | ||
color: normalizeColorValue(shadow.color, options.color), | ||
inset: shadow.inset ?? false, | ||
// extra values are discarded rather than throwing an error | ||
}; | ||
}); | ||
} |
@@ -22,4 +22,6 @@ import type {CubicBezierToken, ParsedTransitionToken} from '../../token.js'; | ||
if (!value) throw new Error('missing value'); | ||
if (typeof value !== 'object' || Array.isArray(value)) throw new Error('invalid transition format, e'); | ||
if (!Object.keys(value).length) throw new Error('At least 1 transition property is required'); | ||
if (typeof value !== 'object' || Array.isArray(value)) throw new Error(`expected object, got ${typeof value}`); | ||
if (!('duration' in value)) throw new Error('missing duration'); | ||
// currently delay is optional; is that right? | ||
if (!('timingFunction' in value)) throw new Error('missing timingFunction'); | ||
const v = value as any; | ||
@@ -26,0 +28,0 @@ return { |
@@ -199,7 +199,9 @@ // Base | ||
color: ColorToken['$value']; | ||
/** is this shadow inset? */ | ||
inset?: boolean; | ||
} | ||
export interface ShadowToken extends TokenBase<Partial<ShadowValue>> { | ||
export interface ShadowToken extends TokenBase<Partial<ShadowValue> | Partial<ShadowValue>[]> { | ||
$type: 'shadow'; | ||
} | ||
export interface ParsedShadowToken extends ParsedTokenBase<ShadowValue> { | ||
export interface ParsedShadowToken extends ParsedTokenBase<ShadowValue[]> { | ||
$type: 'shadow'; | ||
@@ -206,0 +208,0 @@ _original: ShadowToken; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
540774
3611
Updated@cobalt-ui/utils@^1.2.2