Move config files from config to chezmoi Add script to auto install packages with DNF and Cargo
10 lines
No EOL
54 KiB
JavaScript
10 lines
No EOL
54 KiB
JavaScript
!async function(){for(;!Spicetify.React||!Spicetify.ReactDOM;)await new Promise(e=>setTimeout(e,10));var i,f,u,s,l,h,e,t,a,o,c,r,d,p,n,b,g,m,v,y,w,k,M,S,_,N,$,x,L,j,O,C,E,P;i=Object.create,f=Object.defineProperty,u=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,l=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty,e={"node_modules/.pnpm/chroma-js@2.4.2/node_modules/chroma-js/chroma.js"(e,t){var r;r=function(){"use strict";for(var e=function(e,t,r){return void 0===r&&(r=1),e<(t=void 0===t?0:t)?t:r<e?r:e},A=e,U={},t=0,q=["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"];t<q.length;t+=1){var F=q[t];U["[object "+F+"]"]=F.toLowerCase()}function r(e){return U[Object.prototype.toString.call(e)]||"object"}function W(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if("object"===V(e[0])&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];var r=!1;if(!(o=H(e))){r=!0,i.sorted||(i.autodetect=i.autodetect.sort(function(e,t){return t.p-e.p}),i.sorted=!0);for(var n=0,a=i.autodetect;n<a.length;n+=1){var o,c=a[n];if(o=c.test.apply(c,e))break}}if(!i.format[o])throw new Error("unknown format: "+e);r=i.format[o].apply(null,r?e:e.slice(0,-1)),this._rgb=X(r),3===this._rgb.length&&this._rgb.push(1)}function n(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(n.Color,[null].concat(e)))}function D(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=(e=Q(e,"cmyk"))[0],n=e[1],a=e[2],o=e[3],c=4<e.length?e[4]:1;return 1===o?[0,0,0,c]:[1<=r?0:255*(1-r)*(1-o),1<=n?0:255*(1-n)*(1-o),1<=a?0:255*(1-a)*(1-o),c]}function a(e){return Math.round(100*e)/100}function G(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r,n,a=(e=ce(e,"rgba"))[0],o=e[1],c=e[2],i=(a/=255,o/=255,c/=255,Math.min(a,o,c)),f=Math.max(a,o,c),u=(f+i)/2;return f===i?(r=0,n=Number.NaN):r=u<.5?(f-i)/(f+i):(f-i)/(2-f-i),a==f?n=(o-c)/(f-i):o==f?n=2+(c-a)/(f-i):c==f&&(n=4+(a-o)/(f-i)),(n*=60)<0&&(n+=360),3<e.length&&void 0!==e[3]?[n,r,u,e[3]]:[n,r,u]}function B(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=ie(e,"rgba"),n=fe(e)||"rgb";return"hsl"==n.substr(0,3)?ue(se(r),n):(r[0]=le(r[0]),r[1]=le(r[1]),r[2]=le(r[2]),("rgba"===n||3<r.length&&r[3]<1)&&(r[3]=3<r.length?r[3]:1,n="rgba"),n+"("+r.slice(0,"rgb"===n?3:4).join(",")+")")}function T(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r,n,a,o=(e=he(e,"hsl"))[0],c=e[1],i=e[2];if(0===c)r=n=a=255*i;else{var f=[0,0,0],u=[0,0,0],s=i<.5?i*(1+c):i+c-i*c,l=2*i-s,c=o/360;f[0]=c+1/3,f[1]=c,f[2]=c-1/3;for(var h=0;h<3;h++)f[h]<0&&(f[h]+=1),1<f[h]&&--f[h],u[h]=6*f[h]<1?l+6*(s-l)*f[h]:2*f[h]<1?s:3*f[h]<2?l+(s-l)*(2/3-f[h])*6:l;r=(i=[de(255*u[0]),de(255*u[1]),de(255*u[2])])[0],n=i[1],a=i[2]}return 3<e.length?[r,n,a,e[3]]:[r,n,a,1]}function z(e){var t,r;if(e=e.toLowerCase().trim(),be.format.named)try{return be.format.named(e)}catch(e){}if(t=e.match(ge)){for(var n=t.slice(1,4),a=0;a<3;a++)n[a]=+n[a];return n[3]=1,n}if(t=e.match(me)){for(var o=t.slice(1,5),c=0;c<4;c++)o[c]=+o[c];return o}if(t=e.match(ve)){for(var i=t.slice(1,4),f=0;f<3;f++)i[f]=Me(2.55*i[f]);return i[3]=1,i}if(t=e.match(ye)){for(var u=t.slice(1,5),s=0;s<3;s++)u[s]=Me(2.55*u[s]);return u[3]=+u[3],u}return(t=e.match(we))?((r=t.slice(1,4))[1]*=.01,r[2]*=.01,(r=pe(r))[3]=1,r):(t=e.match(ke))?((r=t.slice(1,4))[1]*=.01,r[2]*=.01,(e=pe(r))[3]=+t[4],e):void 0}var Y=r,J=r,o=Math.PI,e={clip_rgb:function(e){e._clipped=!1,e._unclipped=e.slice(0);for(var t=0;t<=3;t++)t<3?((e[t]<0||255<e[t])&&(e._clipped=!0),e[t]=A(e[t],0,255)):3===t&&(e[t]=A(e[t],0,1));return e},limit:e,type:r,unpack:function(t,e){return void 0===e&&(e=null),3<=t.length?Array.prototype.slice.call(t):"object"==Y(t[0])&&e?e.split("").filter(function(e){return void 0!==t[0][e]}).map(function(e){return t[0][e]}):t[0]},last:function(e){var t;return!(e.length<2)&&(t=e.length-1,"string"==J(e[t]))?e[t].toLowerCase():null},PI:o,TWOPI:2*o,PITHIRD:o/3,DEG2RAD:o/180,RAD2DEG:180/o},o={format:{},autodetect:[]},H=e.last,X=e.clip_rgb,V=e.type,i=o,c=(W.prototype.toString=function(){return"function"==V(this.hex)?this.hex():"["+this._rgb.join(",")+"]"},W),f=(n.Color=c,n.version="2.4.2",n),Z=e.unpack,K=Math.max,Q=e.unpack,u=f,ee=c,s=o,te=e.unpack,re=e.type,ne=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=Z(e,"rgb"),n=r[0],a=r[1],r=r[2],o=1-K(n/=255,K(a/=255,r/=255)),c=o<1?1/(1-o):0;return[(1-n-o)*c,(1-a-o)*c,(1-r-o)*c,o]},ae=(ee.prototype.cmyk=function(){return ne(this._rgb)},u.cmyk=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(ee,[null].concat(e,["cmyk"])))},s.format.cmyk=D,s.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=te(e,"cmyk"),"array"===re(e)&&4===e.length)return"cmyk"}}),e.unpack),oe=e.last,ce=e.unpack,ie=e.unpack,fe=e.last,ue=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=ae(e,"hsla"),n=oe(e)||"lsa";return r[0]=a(r[0]||0),r[1]=a(100*r[1])+"%",r[2]=a(100*r[2])+"%","hsla"===n||3<r.length&&r[3]<1?(r[3]=3<r.length?r[3]:1,n="hsla"):r.length=3,n+"("+r.join(",")+")"},se=G,le=Math.round,he=e.unpack,de=Math.round,pe=T,be=o,ge=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,me=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,ve=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,ye=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,we=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,ke=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,Me=Math.round;z.test=function(e){return ge.test(e)||me.test(e)||ve.test(e)||ye.test(e)||we.test(e)||ke.test(e)};function Se(){for(var e,t=[],r=arguments.length;r--;)t[r]=arguments[r];var n,a,o,c=(t=Ye(t,"hcg"))[0],i=t[1],f=t[2],u=(f*=255,255*i);if(0===i)n=a=o=f;else{360<(c=360===c?0:c)&&(c-=360),c<0&&(c+=360);var s=Je(c/=60),c=c-s,l=f*(1-i),h=l+u*(1-c),d=l+u*c,p=l+u;switch(s){case 0:n=(e=[p,d,l])[0],a=e[1],o=e[2];break;case 1:n=(e=[h,p,l])[0],a=e[1],o=e[2];break;case 2:n=(e=[l,p,d])[0],a=e[1],o=e[2];break;case 3:n=(e=[l,h,p])[0],a=e[1],o=e[2];break;case 4:n=(e=[d,l,p])[0],a=e[1],o=e[2];break;case 5:n=(e=[p,l,h])[0],a=e[1],o=e[2]}}return[n,a,o,3<t.length?t[3]:1]}function _e(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=(o=Ke(e,"rgba"))[0],n=o[1],a=o[2],o=o[3],c=Qe(e)||"auto",i=(void 0===o&&(o=1),"auto"===c&&(c=o<1?"rgba":"rgb"),(i="000000"+(l(r)<<16|l(n)<<8|l(a)).toString(16)).substr(i.length-6)),f=(f="0"+l(255*o).toString(16)).substr(f.length-2);switch(c.toLowerCase()){case"rgba":return"#"+i+f;case"argb":return"#"+f+i;default:return"#"+i}}function Ne(e){var t;if(e.match(et))return 3===(e=4!==e.length&&7!==e.length?e:e.substr(1)).length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]),[(t=parseInt(e,16))>>16,t>>8&255,255&t,1];if(e.match(tt))return 4===(e=5!==e.length&&9!==e.length?e:e.substr(1)).length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]),[(t=parseInt(e,16))>>24&255,t>>16&255,t>>8&255,Math.round((255&t)/255*100)/100];throw new Error("unknown hex color: "+e)}function $e(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r,n,a,o=(e=st(e,"hsi"))[0],c=e[1],i=e[2];return isNaN(o)&&(o=0),isNaN(c)&&(c=0),360<o&&(o-=360),o<0&&(o+=360),(o/=360)<1/3?n=1-((a=(1-c)/3)+(r=(1+c*d(h*o)/d(ht-h*o))/3)):o<2/3?a=1-((r=(1-c)/3)+(n=(1+c*d(h*(o-=1/3))/d(ht-h*o))/3)):r=1-((n=(1-c)/3)+(a=(1+c*d(h*(o-=2/3))/d(ht-h*o))/3)),[255*(r=lt(i*r*3)),255*(n=lt(i*n*3)),255*(a=lt(i*a*3)),3<e.length?e[3]:1]}function xe(){for(var e,t=[],r=arguments.length;r--;)t[r]=arguments[r];var n,a,o,c=(t=_t(t,"hsv"))[0],i=t[1],f=t[2];if(f*=255,0===i)n=a=o=f;else{360<(c=360===c?0:c)&&(c-=360),c<0&&(c+=360);var u=Nt(c/=60),c=c-u,s=f*(1-i),l=f*(1-i*c),h=f*(1-i*(1-c));switch(u){case 0:n=(e=[f,h,s])[0],a=e[1],o=e[2];break;case 1:n=(e=[l,f,s])[0],a=e[1],o=e[2];break;case 2:n=(e=[s,f,h])[0],a=e[1],o=e[2];break;case 3:n=(e=[s,l,f])[0],a=e[1],o=e[2];break;case 4:n=(e=[h,s,f])[0],a=e[1],o=e[2];break;case 5:n=(e=[f,s,l])[0],a=e[1],o=e[2]}}return[n,a,o,3<t.length?t[3]:1]}function Le(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=(a=Ot(e,"rgb"))[0],n=a[1],a=a[2];return n=n,a=a,r=Et(r=r),n=Et(n),a=Et(a),[(a=116*(n=(r=[Pt((.4124564*r+.3575761*n+.1804375*a)/p.Xn),Pt((.2126729*r+.7151522*n+.072175*a)/p.Yn),Pt((.0193339*r+.119192*n+.9503041*a)/p.Zn)])[1])-16)<0?0:a,500*(r[0]-n),200*(n-r[2])]}function je(e){return 255*(e<=.00304?12.92*e:1.055*It(e,1/2.4)-.055)}function Oe(e){return e>b.t1?e*e*e:b.t2*(e-b.t0)}function Ce(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=(e=Rt(e,"lab"))[0],n=e[1],a=e[2],r=(r+16)/116,n=isNaN(n)?r:r+n/500,a=isNaN(a)?r:r-a/200;return r=b.Yn*Oe(r),n=b.Xn*Oe(n),a=b.Zn*Oe(a),[je(3.2404542*n-1.5371385*r-.4985314*a),je(-.969266*n+1.8760108*r+.041556*a),je(.0556434*n-.2040259*r+1.0572252*a),3<e.length?e[3]:1]}function Ee(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=(a=Wt(e,"lab"))[0],n=a[1],a=a[2],o=Gt(n*n+a*a),a=(Bt(a,n)*Dt+360)%360;return[r,o,a=0===Tt(1e4*o)?Number.NaN:a]}function Pe(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=(a=Ht(e,"lch"))[0],n=a[1],a=a[2];return isNaN(a)&&(a=0),[r,Zt(a*=Xt)*n,Vt(a)*n]}function Re(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=(e=Kt(e,"lch"))[0],n=e[1],a=e[2],n=(r=Qt(r,n,a))[0],a=r[1],r=r[2];return[(n=er(n,a,r))[0],n[1],n[2],3<e.length?e[3]:1]}function Ie(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=tr(e,"hcl").reverse();return rr.apply(void 0,r)}function Ae(e){if("number"==lr(e)&&0<=e&&e<=16777215)return[e>>16,e>>8&255,255&e,1];throw new Error("unknown num color: "+e)}function Ue(e){var t,r,n=(e=e/100)<66?(t=255,r=e<6?0:-155.25485562709179-.44596950469579133*(r=e-2)+104.49216199393888*w(r),e<20?0:.8274096064007395*(n=e-10)-254.76935184120902+115.67994401066147*w(n)):(t=351.97690566805693+.114206453784165*(t=e-55)-40.25366309332127*w(t),r=325.4494125711974+.07943456536662342*(r=e-50)-28.0852963507957*w(r),255);return[t,r,n,1]}function qe(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=(a=Sr(e,"rgb"))[0],n=a[1],a=a[2],r=[xr(r/255),xr(n/255),xr(a/255)],o=_r(.4122214708*(n=r[0])+.5363325363*(a=r[1])+.0514459929*(r=r[2])),c=_r(.2119034982*n+.6806995451*a+.1073969566*r),n=_r(.0883024619*n+.2817188376*a+.6299787005*r);return[.2104542553*o+.793617785*c-.0040720468*n,1.9779984951*o-2.428592205*c+.4505937099*n,.0259040371*o+.7827717662*c-.808675766*n]}var u=f,Fe=c,s=o,We=e.type,De=B,Ge=z,Be=(Fe.prototype.css=function(e){return De(this._rgb,e)},u.css=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(Fe,[null].concat(e,["css"])))},s.format.css=Ge,s.autodetect.push({p:5,test:function(e){for(var t=[],r=arguments.length-1;0<r--;)t[r]=arguments[r+1];if(!t.length&&"string"===We(e)&&Ge.test(e))return"css"}}),c),u=f,s=o,Te=e.unpack,ze=(s.format.gl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=Te(e,"rgba");return r[0]*=255,r[1]*=255,r[2]*=255,r},u.gl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(Be,[null].concat(e,["gl"])))},Be.prototype.gl=function(){var e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]},e.unpack),Ye=e.unpack,Je=Math.floor,He=e.unpack,Xe=e.type,s=f,Ve=c,u=o,Ze=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r,n=ze(e,"rgb"),a=n[0],o=n[1],n=n[2],c=Math.min(a,o,n),i=Math.max(a,o,n),f=i-c;return 0==f?r=Number.NaN:(a===i&&(r=(o-n)/f),o===i&&(r=2+(n-a)/f),n===i&&(r=4+(a-o)/f),(r*=60)<0&&(r+=360)),[r,100*f/255,c/(255-f)*100]},Ke=(Ve.prototype.hcg=function(){return Ze(this._rgb)},s.hcg=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(Ve,[null].concat(e,["hcg"])))},u.format.hcg=Se,u.autodetect.push({p:1,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=He(e,"hcg"),"array"===Xe(e)&&3===e.length)return"hcg"}}),e.unpack),Qe=e.last,l=Math.round,et=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,tt=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,s=f,rt=c,nt=e.type,u=o,at=_e,ot=(rt.prototype.hex=function(e){return at(this._rgb,e)},s.hex=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(rt,[null].concat(e,["hex"])))},u.format.hex=Ne,u.autodetect.push({p:4,test:function(e){for(var t=[],r=arguments.length-1;0<r--;)t[r]=arguments[r+1];if(!t.length&&"string"===nt(e)&&0<=[3,4,5,6,7,8,9].indexOf(e.length))return"hex"}}),e.unpack),ct=e.TWOPI,it=Math.min,ft=Math.sqrt,ut=Math.acos,st=e.unpack,lt=e.limit,h=e.TWOPI,ht=e.PITHIRD,d=Math.cos,dt=e.unpack,pt=e.type,s=f,bt=c,u=o,gt=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r,n=ot(e,"rgb"),a=n[0],o=n[1],n=n[2],c=it(a/=255,o/=255,n/=255),i=(a+o+n)/3,c=0<i?1-c/i:0;return 0==c?r=NaN:(r=(a-o+(a-n))/2,r/=ft((a-o)*(a-o)+(a-n)*(o-n)),r=ut(r),o<n&&(r=ct-r),r/=ct),[360*r,c,i]},mt=(bt.prototype.hsi=function(){return gt(this._rgb)},s.hsi=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(bt,[null].concat(e,["hsi"])))},u.format.hsi=$e,u.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=dt(e,"hsi"),"array"===pt(e)&&3===e.length)return"hsi"}}),e.unpack),vt=e.type,s=f,yt=c,u=o,wt=G,kt=(yt.prototype.hsl=function(){return wt(this._rgb)},s.hsl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(yt,[null].concat(e,["hsl"])))},u.format.hsl=T,u.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=mt(e,"hsl"),"array"===vt(e)&&3===e.length)return"hsl"}}),e.unpack),Mt=Math.min,St=Math.max,_t=e.unpack,Nt=Math.floor,$t=e.unpack,xt=e.type,s=f,Lt=c,u=o,jt=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r,n,a=(e=kt(e,"rgb"))[0],o=e[1],c=e[2],i=Mt(a,o,c),f=St(a,o,c),i=f-i;return 0===f?(r=Number.NaN,n=0):(n=i/f,a===f&&(r=(o-c)/i),o===f&&(r=2+(c-a)/i),c===f&&(r=4+(a-o)/i),(r*=60)<0&&(r+=360)),[r,n,f/255]},s=(Lt.prototype.hsv=function(){return jt(this._rgb)},s.hsv=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(Lt,[null].concat(e,["hsv"])))},u.format.hsv=xe,u.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=$t(e,"hsv"),"array"===xt(e)&&3===e.length)return"hsv"}}),{Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452}),p=s,Ot=e.unpack,Ct=Math.pow,Et=function(e){return(e/=255)<=.04045?e/12.92:Ct((e+.055)/1.055,2.4)},Pt=function(e){return e>p.t3?Ct(e,1/3):e/p.t2+p.t0},b=s,Rt=e.unpack,It=Math.pow,At=e.unpack,Ut=e.type,u=f,qt=c,g=o,Ft=Le,Wt=(qt.prototype.lab=function(){return Ft(this._rgb)},u.lab=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(qt,[null].concat(e,["lab"])))},g.format.lab=Ce,g.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=At(e,"lab"),"array"===Ut(e)&&3===e.length)return"lab"}}),e.unpack),Dt=e.RAD2DEG,Gt=Math.sqrt,Bt=Math.atan2,Tt=Math.round,zt=e.unpack,Yt=Le,Jt=Ee,Ht=e.unpack,Xt=e.DEG2RAD,Vt=Math.sin,Zt=Math.cos,Kt=e.unpack,Qt=Pe,er=Ce,tr=e.unpack,rr=Re,nr=e.unpack,ar=e.type,u=f,m=c,or=o,cr=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=zt(e,"rgb"),n=r[0],a=r[1],r=r[2],n=Yt(n,a,r),a=n[0],r=n[1],n=n[2];return Jt(a,r,n)},g=(m.prototype.lch=function(){return cr(this._rgb)},m.prototype.hcl=function(){return cr(this._rgb).reverse()},u.lch=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(m,[null].concat(e,["lch"])))},u.hcl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(m,[null].concat(e,["hcl"])))},or.format.lch=Re,or.format.hcl=Ie,["lch","hcl"].forEach(function(r){return or.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=nr(e,r),"array"===ar(e)&&3===e.length)return r}})}),{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflower:"#6495ed",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}),u=c,v=o,ir=e.type,y=g,fr=Ne,ur=_e,sr=(u.prototype.name=function(){for(var e=ur(this._rgb,"rgb"),t=0,r=Object.keys(y);t<r.length;t+=1){var n=r[t];if(y[n]===e)return n.toLowerCase()}return e},v.format.named=function(e){if(e=e.toLowerCase(),y[e])return fr(y[e]);throw new Error("unknown color name: "+e)},v.autodetect.push({p:5,test:function(e){for(var t=[],r=arguments.length-1;0<r--;)t[r]=arguments[r+1];if(!t.length&&"string"===ir(e)&&y[e.toLowerCase()])return"named"}}),e.unpack),lr=e.type,u=f,hr=c,v=o,dr=e.type,pr=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=sr(e,"rgb");return(r[0]<<16)+(r[1]<<8)+r[2]},u=(hr.prototype.num=function(){return pr(this._rgb)},u.num=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(hr,[null].concat(e,["num"])))},v.format.num=Ae,v.autodetect.push({p:5,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(1===e.length&&"number"===dr(e[0])&&0<=e[0]&&e[0]<=16777215)return"num"}}),f),br=c,v=o,gr=e.unpack,mr=e.type,vr=Math.round,w=(br.prototype.rgb=function(e){return!1===(e=void 0===e?!0:e)?this._rgb.slice(0,3):this._rgb.slice(0,3).map(vr)},br.prototype.rgba=function(r){return void 0===r&&(r=!0),this._rgb.slice(0,4).map(function(e,t){return!(t<3)||!1===r?e:vr(e)})},u.rgb=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(br,[null].concat(e,["rgb"])))},v.format.rgb=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=gr(e,"rgba");return void 0===r[3]&&(r[3]=1),r},v.autodetect.push({p:3,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=gr(e,"rgba"),"array"===mr(e)&&(3===e.length||4===e.length&&"number"==mr(e[3])&&0<=e[3]&&e[3]<=1))return"rgb"}}),Math.log),yr=Ue,wr=e.unpack,kr=Math.round,u=f,k=c,v=o,Mr=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var r=wr(e,"rgb"),n=r[0],a=r[2],o=1e3,c=4e4;.4<c-o;){var i,f=yr(i=.5*(c+o));f[2]/f[0]>=a/n?c=i:o=i}return kr(i)},Sr=(k.prototype.temp=k.prototype.kelvin=k.prototype.temperature=function(){return Mr(this._rgb)},u.temp=u.kelvin=u.temperature=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(k,[null].concat(e,["temp"])))},v.format.temp=v.format.kelvin=v.format.temperature=Ue,e.unpack),_r=Math.cbrt,Nr=Math.pow,$r=Math.sign;function xr(e){var t=Math.abs(e);return t<.04045?e/12.92:($r(e)||1)*Nr((t+.055)/1.055,2.4)}function Lr(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=(e=jr(e,"lab"))[0],n=e[1],a=e[2],o=M(r+.3963377774*n+.2158037573*a,3),c=M(r-.1055613458*n-.0638541728*a,3),r=M(r-.0894841775*n-1.291485548*a,3);return[255*Cr(4.0767416621*o-3.3077115913*c+.2309699292*r),255*Cr(-1.2684380046*o+2.6097574011*c-.3413193965*r),255*Cr(-.0041960863*o-.7034186147*c+1.707614701*r),3<e.length?e[3]:1]}var jr=e.unpack,M=Math.pow,Or=Math.sign;function Cr(e){var t=Math.abs(e);return.0031308<t?(Or(e)||1)*(1.055*M(t,1/2.4)-.055):12.92*e}function Er(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=(e=Wr(e,"lch"))[0],n=e[1],a=e[2],n=(r=Dr(r,n,a))[0],a=r[1],r=r[2];return[(n=Gr(n,a,r))[0],n[1],n[2],3<e.length?e[3]:1]}var Pr=e.unpack,Rr=e.type,u=f,Ir=c,v=o,Ar=qe,Ur=(Ir.prototype.oklab=function(){return Ar(this._rgb)},u.oklab=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(Ir,[null].concat(e,["oklab"])))},v.format.oklab=Lr,v.autodetect.push({p:3,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=Pr(e,"oklab"),"array"===Rr(e)&&3===e.length)return"oklab"}}),e.unpack),qr=qe,Fr=Ee,Wr=e.unpack,Dr=Pe,Gr=Lr,Br=e.unpack,Tr=e.type,u=f,zr=c,v=o,Yr=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=Ur(e,"rgb"),n=r[0],a=r[1],r=r[2],n=qr(n,a,r),a=n[0],r=n[1],n=n[2];return Fr(a,r,n)},Jr=(zr.prototype.oklch=function(){return Yr(this._rgb)},u.oklch=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(zr,[null].concat(e,["oklch"])))},v.format.oklch=Er,v.autodetect.push({p:3,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=Br(e,"oklch"),"array"===Tr(e)&&3===e.length)return"oklch"}}),c),Hr=e.type;Jr.prototype.alpha=function(e,t){return void 0===t&&(t=!1),void 0!==e&&"number"===Hr(e)?t?(this._rgb[3]=e,this):new Jr([this._rgb[0],this._rgb[1],this._rgb[2],e],"rgb"):this._rgb[3]};c.prototype.clipped=function(){return this._rgb._clipped||!1};var S=c,Xr=s;S.prototype.darken=function(e){void 0===e&&(e=1);var t=this.lab();return t[0]-=Xr.Kn*e,new S(t,"lab").alpha(this.alpha(),!0)},S.prototype.brighten=function(e){return this.darken(-(e=void 0===e?1:e))},S.prototype.darker=S.prototype.darken,S.prototype.brighter=S.prototype.brighten;function Vr(e,t,r){void 0===r&&(r=.5);for(var n=[],a=arguments.length-3;0<a--;)n[a]=arguments[a+3];var o=n[0]||"lrgb";if($[o]||n.length||(o=Object.keys($)[0]),$[o])return"object"!==an(e)&&(e=new nn(e)),"object"!==an(t)&&(t=new nn(t)),$[o](e,t,r).alpha(e.alpha()+r*(t.alpha()-e.alpha()));throw new Error("interpolation mode "+o+" is not defined")}function _(e,t,r,n){var a,o,c,i,f,u,s,l,h,d;return"hsl"===n?(d=e.hsl(),a=t.hsl()):"hsv"===n?(d=e.hsv(),a=t.hsv()):"hcg"===n?(d=e.hcg(),a=t.hcg()):"hsi"===n?(d=e.hsi(),a=t.hsi()):"lch"===n||"hcl"===n?(n="hcl",d=e.hcl(),a=t.hcl()):"oklch"===n&&(d=e.oklch().reverse(),a=t.oklch().reverse()),"h"!==n.substr(0,1)&&"oklch"!==n||(o=(e=d)[0],i=e[1],u=e[2],c=(t=a)[0],f=t[1],s=t[2]),isNaN(o)||isNaN(c)?isNaN(o)?isNaN(c)?h=Number.NaN:(h=c,1!=u&&0!=u||"hsv"==n||(l=f)):(h=o,1!=s&&0!=s||"hsv"==n||(l=i)):h=o+r*(o<c&&180<c-o?c-(o+360):c<o&&180<o-c?c+360-o:c-o),void 0===l&&(l=i+r*(f-i)),d=u+r*(s-u),new gn("oklch"===n?[d,l,h]:[h,l,d],n)}function Zr(e,t,r){return mn(e,t,r,"lch")}function Kr(u){function r(e){if((e=e||["#fff","#000"])&&"string"===j(e)&&L.brewer&&L.brewer[e.toLowerCase()]&&(e=L.brewer[e.toLowerCase()]),"array"===j(e)){e=(e=1===e.length?[e[0],e[0]]:e).slice(0);for(var t=0;t<e.length;t++)e[t]=L(e[t]);for(var r=f.length=0;r<e.length;r++)f.push(r/(e.length-1))}n(),b=e}function s(e,t){var r,n;if(null==t&&(t=!1),isNaN(e)||null===e)return i;if(n=t?e:p&&2<p.length?k(e)/(p.length-2):m!==g?(e-g)/(m-g):1,n=S(n),t||(n=M(n)),1!==w&&(n=Pn(n,w)),n=d[0]+n*(1-d[0]-d[1]),n=Math.min(1,Math.max(0,n)),e=Math.floor(1e4*n),y&&v[e])r=v[e];else{if("array"===j(b))for(var a=0;a<f.length;a++){var o=f[a];if(n<=o){r=b[a];break}if(o<=n&&a===f.length-1){r=b[a];break}if(o<n&&n<f[a+1]){n=(n-o)/(f[a+1]-o),r=L.interpolate(b[a],b[a+1],n,c);break}}else"function"===j(b)&&(r=b(n));y&&(v[e]=r)}return r}function n(){v={}}function l(e){return e=L(s(e)),a&&e[a]?e[a]():e}var c="rgb",i=L("#ccc"),t=0,h=[0,1],f=[],d=[0,0],p=!1,b=[],a=!1,g=0,m=1,v={},y=!0,w=1,k=function(e){if(null==p)return 0;for(var t=p.length-1,r=0;r<t&&e>=p[r];)r++;return r-1},M=function(e){return e},S=function(e){return e};return r(u),l.classes=function(e){var t;return null!=e?("array"===j(e)?h=[(p=e)[0],e[e.length-1]]:(t=L.analyze(h),p=0===e?[t.min,t.max]:L.limits(t,"e",e)),l):p},l.domain=function(r){if(!arguments.length)return h;g=r[0],m=r[r.length-1],f=[];var e=b.length;if(r.length===e&&g!==m)for(var t=0,n=Array.from(r);t<n.length;t+=1){var a=n[t];f.push((a-g)/(m-g))}else{for(var o,c,i=0;i<e;i++)f.push(i/(e-1));2<r.length&&(o=r.map(function(e,t){return t/(r.length-1)}),(c=r.map(function(e){return(e-g)/(m-g)})).every(function(e,t){return o[t]===e})||(S=function(e){if(e<=0||1<=e)return e;for(var t=0;e>=c[t+1];)t++;var r=(e-c[t])/(c[t+1]-c[t]);return o[t]+r*(o[t+1]-o[t])}))}return h=[g,m],l},l.mode=function(e){return arguments.length?(c=e,n(),l):c},l.range=function(e,t){return r(e),l},l.out=function(e){return a=e,l},l.spread=function(e){return arguments.length?(t=e,l):t},l.correctLightness=function(e){return n(),M=(e=null==e?!0:e)?function(e){for(var t=s(0,!0).lab()[0],r=s(1,!0).lab()[0],n=r<t,a=s(e,!0).lab()[0],o=t+(r-t)*e,c=a-o,i=0,f=1,u=20;.01<Math.abs(c)&&0<u--;)n&&(c*=-1),e+=c<0?.5*(f-(i=e)):.5*(i-(f=e)),a=s(e,!0).lab()[0],c=a-o;return e}:function(e){return e},l},l.padding=function(e){return null!=e?("number"===j(e)&&(e=[e,e]),d=e,l):d},l.colors=function(t,r){arguments.length<2&&(r="hex");var e=[];if(0===arguments.length)e=b.slice(0);else if(1===t)e=[l(.5)];else if(1<t)var n=h[0],a=h[1]-n,e=function(e,t,r){for(var n=[],a=e<t,o=r?a?t+1:t-1:t,c=e;a?c<o:o<c;a?c++:c--)n.push(c);return n}(0,t,!1).map(function(e){return l(n+e/(t-1)*a)});else{u=[];var o=[];if(p&&2<p.length)for(var c=1,i=p.length,f=1<=i;f?c<i:i<c;f?c++:c--)o.push(.5*(p[c-1]+p[c]));else o=h;e=o.map(l)}return e=L[r]?e.map(function(e){return e[r]()}):e},l.cache=function(e){return null!=e?(y=e,l):y},l.gamma=function(e){return null!=e?(w=e,l):w},l.nodata=function(e){return null!=e?(i=L(e),l):i},l}c.prototype.get=function(e){var e=e.split("."),t=e[0],e=e[1],r=this[t]();if(e){var n=t.indexOf(e)-("ok"===t.substr(0,2)?2:0);if(-1<n)return r[n];throw new Error("unknown channel "+e+" in mode "+t)}return r};var N=c,Qr=e.type,en=Math.pow,tn=(N.prototype.luminance=function(a){var o,c,i,e;return void 0!==a&&"number"===Qr(a)?0===a?new N([0,0,0,this._rgb[3]],"rgb"):1===a?new N([255,255,255,this._rgb[3]],"rgb"):(e=this.luminance(),o="rgb",c=20,i=function(e,t){var r=e.interpolate(t,.5,o),n=r.luminance();return Math.abs(a-n)<1e-7||!c--?r:a<n?i(e,r):i(r,t)},e=(a<e?i(new N([0,0,0]),this):i(this,new N([255,255,255]))).rgb(),new N(e.concat([this._rgb[3]]))):tn.apply(void 0,this._rgb.slice(0,3))},function(e,t,r){return.2126*(e=rn(e))+.7152*(t=rn(t))+.0722*(r=rn(r))}),rn=function(e){return(e/=255)<=.03928?e/12.92:en((e+.055)/1.055,2.4)},o={},nn=c,an=e.type,$=o,u=c,on=Vr,cn=(u.prototype.mix=u.prototype.interpolate=function(e,t){void 0===t&&(t=.5);for(var r=[],n=arguments.length-2;0<n--;)r[n]=arguments[n+2];return on.apply(void 0,[this,e,t].concat(r))},c),fn=(cn.prototype.premultiply=function(e){var t=this._rgb,r=t[3];return(e=void 0===e?!1:e)?(this._rgb=[t[0]*r,t[1]*r,t[2]*r,r],this):new cn([t[0]*r,t[1]*r,t[2]*r,r],"rgb")},c),un=s,sn=(fn.prototype.saturate=function(e){void 0===e&&(e=1);var t=this.lch();return t[1]+=un.Kn*e,t[1]<0&&(t[1]=0),new fn(t,"lch").alpha(this.alpha(),!0)},fn.prototype.desaturate=function(e){return this.saturate(-(e=void 0===e?1:e))},c),ln=e.type,hn=(sn.prototype.set=function(e,t,r){void 0===r&&(r=!1);var e=e.split("."),n=e[0],e=e[1],a=this[n]();if(e){var o=n.indexOf(e)-("ok"===n.substr(0,2)?2:0);if(-1<o){if("string"==ln(t))switch(t.charAt(0)){case"+":case"-":a[o]+=+t;break;case"*":a[o]*=+t.substr(1);break;case"/":a[o]/=+t.substr(1);break;default:a[o]=+t}else{if("number"!==ln(t))throw new Error("unsupported value for Color.set");a[o]=t}var c=new sn(a,n);return r?(this._rgb=c._rgb,this):c}throw new Error("unknown channel "+e+" in mode "+n)}return a},c),dn=(o.rgb=function(e,t,r){e=e._rgb,t=t._rgb;return new hn(e[0]+r*(t[0]-e[0]),e[1]+r*(t[1]-e[1]),e[2]+r*(t[2]-e[2]),"rgb")},c),pn=Math.sqrt,x=Math.pow,bn=(o.lrgb=function(e,t,r){var e=e._rgb,n=e[0],a=e[1],e=e[2],t=t._rgb,o=t[0],c=t[1],t=t[2];return new dn(pn(x(n,2)*(1-r)+x(o,2)*r),pn(x(a,2)*(1-r)+x(c,2)*r),pn(x(e,2)*(1-r)+x(t,2)*r),"rgb")},c),gn=(o.lab=function(e,t,r){e=e.lab(),t=t.lab();return new bn(e[0]+r*(t[0]-e[0]),e[1]+r*(t[1]-e[1]),e[2]+r*(t[2]-e[2]),"lab")},c),mn=_,vn=(o.lch=Zr,o.hcl=Zr,c),yn=(o.num=function(e,t,r){e=e.num(),t=t.num();return new vn(e+r*(t-e),"num")},_),wn=(o.hcg=function(e,t,r){return yn(e,t,r,"hcg")},_),kn=(o.hsi=function(e,t,r){return wn(e,t,r,"hsi")},_),Mn=(o.hsl=function(e,t,r){return kn(e,t,r,"hsl")},_),Sn=(o.hsv=function(e,t,r){return Mn(e,t,r,"hsv")},c),_n=(o.oklab=function(e,t,r){e=e.oklab(),t=t.oklab();return new Sn(e[0]+r*(t[0]-e[0]),e[1]+r*(t[1]-e[1]),e[2]+r*(t[2]-e[2]),"oklab")},_),Nn=(o.oklch=function(e,t,r){return _n(e,t,r,"oklch")},c),$n=e.clip_rgb,xn=Math.pow,Ln=Math.sqrt,jn=Math.PI,On=Math.cos,Cn=Math.sin,En=Math.atan2,L=f,j=e.type,Pn=Math.pow;for(var O=c,Rn=Kr,In=function(e){for(var t=[1,1],r=1;r<e;r++){for(var n=[1],a=1;a<=t.length;a++)n[a]=(t[a]||0)+t[a-1];t=n}return t},An=f,C=function(e,t,r){if(C[r])return C[r](e,t);throw new Error("unknown blend mode "+r)},v=function(r){return function(e,t){t=An(t).rgb(),e=An(e).rgb();return An.rgb(r(t,e))}},u=function(n){return function(e,t){var r=[];return r[0]=n(e[0],t[0]),r[1]=n(e[1],t[1]),r[2]=n(e[2],t[2]),r}},s=(C.normal=v(u(function(e){return e})),C.multiply=v(u(function(e,t){return e*t/255})),C.screen=v(u(function(e,t){return 255*(1-(1-e/255)*(1-t/255))})),C.overlay=v(u(function(e,t){return t<128?2*e*t/255:255*(1-2*(1-e/255)*(1-t/255))})),C.darken=v(u(function(e,t){return t<e?t:e})),C.lighten=v(u(function(e,t){return t<e?e:t})),C.dodge=v(u(function(e,t){return 255===e||255<(e=t/255*255/(1-e/255))?255:e})),C.burn=v(u(function(e,t){return 255*(1-(1-t/255)/(e/255))})),C),Un=e.type,qn=e.clip_rgb,Fn=e.TWOPI,Wn=Math.pow,Dn=Math.sin,Gn=Math.cos,Bn=f,Tn=c,zn=Math.floor,Yn=Math.random,Jn=r,Hn=Math.log,Xn=Math.pow,Vn=Math.floor,Zn=Math.abs,Kn=function(e,t){void 0===t&&(t=null);var r={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0};return(e="object"===Jn(e)?Object.values(e):e).forEach(function(e){null==(e=t&&"object"===Jn(e)?e[t]:e)||isNaN(e)||(r.values.push(e),r.sum+=e,e<r.min&&(r.min=e),r.max<e&&(r.max=e),r.count+=1)}),r.domain=[r.min,r.max],r.limits=function(e,t){return Qn(r,e,t)},r},Qn=function(e,t,r){void 0===t&&(t="equal"),void 0===r&&(r=7);var n=(e="array"==Jn(e)?Kn(e):e).min,a=e.max,o=e.values.sort(function(e,t){return e-t});if(1===r)return[n,a];var c=[];if("c"===t.substr(0,1)&&(c.push(n),c.push(a)),"e"===t.substr(0,1)){c.push(n);for(var i=1;i<r;i++)c.push(n+i/r*(a-n));c.push(a)}else if("l"===t.substr(0,1)){if(n<=0)throw new Error("Logarithmic scales are only possible for values > 0");var f=Math.LOG10E*Hn(n),A=Math.LOG10E*Hn(a);c.push(n);for(var u=1;u<r;u++)c.push(Xn(10,f+u/r*(A-f)));c.push(a)}else if("q"===t.substr(0,1)){c.push(n);for(var s=1;s<r;s++){var l=(o.length-1)*s/r,h=Vn(l);c.push(h===l?o[h]:o[h]*(1-(l=l-h))+o[h+1]*l)}c.push(a)}else if("k"===t.substr(0,1)){var d,p=o.length,b=new Array(p),g=new Array(r),m=!0,U=0,v=null;(v=[]).push(n);for(var y=1;y<r;y++)v.push(n+y/r*(a-n));for(v.push(a);m;){for(var w=0;w<r;w++)g[w]=0;for(var k=0;k<p;k++)for(var q=o[k],F=Number.MAX_VALUE,M=void 0,S=0;S<r;S++){var W=Zn(v[S]-q);W<F&&(F=W,M=S),g[M]++,b[k]=M}for(var _=new Array(r),N=0;N<r;N++)_[N]=null;for(var $=0;$<p;$++)null===_[d=b[$]]?_[d]=o[$]:_[d]+=o[$];for(var x=0;x<r;x++)_[x]*=1/g[x];for(var m=!1,L=0;L<r;L++)if(_[L]!==v[L]){m=!0;break}v=_,200<++U&&(m=!1)}for(var j={},O=0;O<r;O++)j[O]=[];for(var C=0;C<p;C++)j[d=b[C]].push(o[C]);for(var E=[],P=0;P<r;P++)E.push(j[P][0]),E.push(j[P][j[P].length-1]);E=E.sort(function(e,t){return e-t}),c.push(E[0]);for(var R=1;R<E.length;R+=2){var I=E[R];isNaN(I)||-1!==c.indexOf(I)||c.push(I)}}return c},o=Kn,v=Qn,ea=c,ta=c,E=Math.sqrt,P=Math.pow,ra=Math.min,na=Math.max,aa=Math.atan2,oa=Math.abs,R=Math.cos,ca=Math.sin,ia=Math.exp,fa=Math.PI,ua=c,sa=c,la=f,ha=Kr,u={cool:function(){return ha([la.hsl(180,1,.9),la.hsl(250,.7,.4)])},hot:function(){return ha(["#000","#f00","#ff0","#fff"]).mode("rgb")}},I={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},da=0,pa=Object.keys(I);da<pa.length;da+=1){var ba=pa[da];I[ba.toLowerCase()]=I[ba]}e=I,c=f;return c.average=function(e,o,c){void 0===o&&(o="lrgb"),void 0===c&&(c=null);var t=e.length,r=t/(c=c||Array.from(new Array(t)).map(function(){return 1})).reduce(function(e,t){return e+t});if(c.forEach(function(e,t){c[t]*=r}),e=e.map(function(e){return new Nn(e)}),"lrgb"===o){for(var n=e,a=c,i=n.length,f=[0,0,0,0],u=0;u<n.length;u++){var s=n[u];var l=a[u]/i;s=s._rgb;f[0]+=xn(s[0],2)*l;f[1]+=xn(s[1],2)*l;f[2]+=xn(s[2],2)*l;f[3]+=s[3]*l}if(f[0]=Ln(f[0]),f[1]=Ln(f[1]),f[2]=Ln(f[2]),f[3]>.9999999)f[3]=1;return new Nn($n(f))}for(var h,d=e.shift(),p=d.get(o),b=[],g=0,m=0,v=0;v<p.length;v++)p[v]=(p[v]||0)*c[0],b.push(isNaN(p[v])?0:c[0]),"h"!==o.charAt(v)||isNaN(p[v])||(h=p[v]/180*jn,g+=On(h)*c[0],m+=Cn(h)*c[0]);var y=d.alpha()*c[0];e.forEach(function(e,t){var r=e.get(o);y+=e.alpha()*c[t+1];for(var n,a=0;a<p.length;a++)isNaN(r[a])||(b[a]+=c[t+1],"h"===o.charAt(a)?(n=r[a]/180*jn,g+=On(n)*c[t+1],m+=Cn(n)*c[t+1]):p[a]+=r[a]*c[t+1])});for(var w=0;w<p.length;w++)if("h"===o.charAt(w)){for(var k=En(m/b[w],g/b[w])/jn*180;k<0;)k+=360;for(;360<=k;)k-=360;p[w]=k}else p[w]=p[w]/b[w];return y/=t,new Nn(p,o).alpha(.99999<y?1:y,!0)},c.bezier=function(e){var t=function(e){if(2===(e=e.map(function(e){return new O(e)})).length)c=e.map(function(e){return e.lab()}),r=c[0],n=c[1],c=function(t){var e=[0,1,2].map(function(e){return r[e]+t*(n[e]-r[e])});return new O(e,"lab")};else if(3===e.length)t=e.map(function(e){return e.lab()}),r=t[0],n=t[1],a=t[2],c=function(t){var e=[0,1,2].map(function(e){return(1-t)*(1-t)*r[e]+2*(1-t)*t*n[e]+t*t*a[e]});return new O(e,"lab")};else if(4===e.length)var t,r=(t=e.map(function(e){return e.lab()}))[0],n=t[1],a=t[2],o=t[3],c=function(t){var e=[0,1,2].map(function(e){return(1-t)*(1-t)*(1-t)*r[e]+3*(1-t)*(1-t)*t*n[e]+3*(1-t)*t*t*a[e]+t*t*t*o[e]});return new O(e,"lab")};else{if(!(5<=e.length))throw new RangeError("No point in running bezier with only one color.");var i=e.map(function(e){return e.lab()}),f=e.length-1,u=In(f);c=function(a){var o=1-a,e=[0,1,2].map(function(n){return i.reduce(function(e,t,r){return e+u[r]*Math.pow(o,f-r)*Math.pow(a,r)*t[n]},0)});return new O(e,"lab")}}return c}(e);return t.scale=function(){return Rn(t)},t},c.blend=s,c.cubehelix=function(a,o,c,i,f){void 0===a&&(a=300),void 0===o&&(o=-1.5),void 0===c&&(c=1),void 0===i&&(i=1);function t(e){var t=Fn*((a+120)/360+o*e),r=Wn(f[0]+u*e,i),e=(0!==s?c[0]+e*s:c)*r*(1-r)/2,n=Gn(t),t=Dn(t);return Bn(qn([255*(r+e*(-.14861*n+1.78277*t)),255*(r+e*(-.29227*n-.90649*t)),255*(r+1.97294*n*e),1]))}var u,s=0;"array"===Un(f=void 0===f?[0,1]:f)?u=f[1]-f[0]:(u=0,f=[f,f]);return t.start=function(e){return null==e?a:(a=e,t)},t.rotations=function(e){return null==e?o:(o=e,t)},t.gamma=function(e){return null==e?i:(i=e,t)},t.hue=function(e){return null==e?c:("array"===Un(c=e)?0===(s=c[1]-c[0])&&(c=c[1]):s=0,t)},t.lightness=function(e){return null==e?f:(u="array"===Un(e)?(f=e)[1]-e[0]:(f=[e,e],0),t)},t.scale=function(){return Bn.scale(t)},t.hue(c),t},c.mix=c.interpolate=Vr,c.random=function(){for(var e="#",t=0;t<6;t++)e+="0123456789abcdef".charAt(zn(16*Yn()));return new Tn(e,"hex")},c.scale=Kr,c.analyze=o,c.contrast=function(e,t){e=new ea(e),t=new ea(t);e=e.luminance(),t=t.luminance();return t<e?(e+.05)/(t+.05):(t+.05)/(e+.05)},c.deltaE=function(e,t,r,n,a){void 0===r&&(r=1),void 0===n&&(n=1),void 0===a&&(a=1);function o(e){return 360*e/(2*fa)}function c(e){return 2*fa*e/360}e=new ta(e),t=new ta(t);var e=Array.from(e.lab()),i=e[0],f=e[1],e=e[2],t=Array.from(t.lab()),u=t[0],s=t[1],t=t[2],l=(i+u)/2,h=(E(P(f,2)+P(e,2))+E(P(s,2)+P(t,2)))/2,h=.5*(1-E(P(h,7)/(P(h,7)+P(25,7)))),f=f*(1+h),s=s*(1+h),h=E(P(f,2)+P(e,2)),d=E(P(s,2)+P(t,2)),p=(h+d)/2,e=o(aa(e,f)),f=o(aa(t,s)),t=0<=e?e:e+360,s=0<=f?f:f+360,e=180<oa(t-s)?(t+s+360)/2:(t+s)/2,f=1-.17*R(c(e-30))+.24*R(c(2*e))+.32*R(c(3*e+6))-.2*R(c(4*e-63)),b=oa(b=s-t)<=180?b:s<=t?360+b:b-360,s=(b=2*E(h*d)*ca(c(b)/2),u-i),t=d-h,u=1+.015*P(l-50,2)/E(20+P(l-50,2)),i=1+.045*p,d=1+.015*p*f,h=30*ia(-P((e-275)/25,2)),l=-(2*E(P(p,7)/(P(p,7)+P(25,7))))*ca(2*c(h)),f=E(P(s/(r*u),2)+P(t/(n*i),2)+P(b/(a*d),2)+t/(n*i)*l*(b/(a*d)));return na(0,ra(100,f))},c.distance=function(e,t,r){void 0===r&&(r="lab"),e=new ua(e),t=new ua(t);var n,a=e.get(r),o=t.get(r),c=0;for(n in a){var i=(a[n]||0)-(o[n]||0);c+=i*i}return Math.sqrt(c)},c.limits=v,c.valid=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];try{return new(Function.prototype.bind.apply(sa,[null].concat(e))),!0}catch(e){return!1}},c.scales=u,c.colors=g,c.brewer=e,c},"object"==typeof(e=e)&&void 0!==t?t.exports=r():"function"==typeof define&&define.amd?define(r):(e="undefined"!=typeof globalThis?globalThis:e||self).chroma=r()}},a="0.9.4",o="marketplace:installed-extensions",c="marketplace:installed-snippets",r="marketplace:installed-themes",d="marketplace:theme-installed",p="marketplace:albumArtBasedColors",n="marketplace:albumArtBasedColorsMode",b="marketplace:albumArtBasedColorsVibrancy",g="marketplace:colorShift",m=100,v=((e,t,r)=>{r=null!=e?i(l(e)):{};var n=!t&&e&&e.__esModule?r:f(r,"default",{value:e,enumerable:!0}),a=e,o=void 0,c=void 0;if(a&&"object"==typeof a||"function"==typeof a)for(let e of s(a))h.call(n,e)||e===o||f(n,e,{get:()=>a[e],enumerable:!(c=u(a,e))||c.enumerable});return n})(function(){return t||(0,e[s(e)[0]])((t={exports:{}}).exports,t),t.exports}()),y=(t,e)=>{t=localStorage.getItem(t);if(!t)return e;try{return JSON.parse(t)}catch(e){return t}},w=e=>{if(3===e.length)e=e.split("").map(e=>e+e).join("");else{if(6!=e.length)throw"Only 3- or 6-digit hex colours are allowed.";if(e.match(/[^0-9a-f]/i))throw"Only hex colours are allowed."}e=e.match(/.{1,2}/g);if(e&&3===e.length)return[parseInt(e[0],16),parseInt(e[1],16),parseInt(e[2],16)];throw"Could not parse hex colour."},k=(e,t)=>{let r=[];return e&&0<e.length?r=e.map(e=>({name:e.name,url:O(e.url)})):r.push({name:t,url:"https://github.com/"+t}),r},M=(...e)=>{console.debug("Resetting Marketplace");const t=[];0===e.length&&Object.keys(localStorage).forEach(e=>{e.startsWith("marketplace:")&&t.push(e)}),e.forEach(e=>{switch(e){case"extensions":t.push(...y(o,[])),t.push(o);break;case"snippets":t.push(...y(c,[])),t.push(c);break;case"theme":t.push(...y(r,[])),t.push(r),t.push(d);break;default:console.error("Unknown category: "+e)}}),t.forEach(e=>{localStorage.removeItem(e),console.debug("Removed "+e)}),console.debug("Marketplace has been reset"),location.reload()},S=()=>{const t={};return Object.keys(localStorage).forEach(e=>{e.startsWith("marketplace:")&&(t[e]=localStorage.getItem(e))}),t},_=r=>{var e=document.querySelector("style.marketplaceCSS.marketplaceScheme");if(e&&e.remove(),r){e=document.createElement("style");e.classList.add("marketplaceCSS"),e.classList.add("marketplaceScheme");let t=":root {";Object.keys(r).forEach(e=>{t=(t+=`--spice-${e}: #${r[e]};`)+`--spice-rgb-${e}: ${w(r[e])};`}),t+="}",e.innerHTML=t,document.body.appendChild(e)}},N=async e=>{let t=y(b);return t=t.replace(/([A-Z])/g,"_$1").toUpperCase(),(await Spicetify.colorExtractor(e))[t].substring(1)},$=async(e,t)=>{var r=y(n).replace(/([A-Z])/g,"-$1").toLowerCase();return(await fetch(`https://www.thecolorapi.com/scheme?hex=${e}&mode=${r}&count=`+t).then(e=>e.json())).colors.map(e=>e.hex.value.substring(1))},x=h=>{Spicetify.Player.addEventListener("songchange",async()=>{var t;t=1e3,await new Promise(e=>setTimeout(e,t));let r=Spicetify.Player.data?.item?.metadata?.image_xlarge_url;if(r=null==r?await new Promise(t=>{setInterval(()=>{var e=Spicetify.Player.data?.item?.metadata?.image_xlarge_url;e&&t(e)},50)}):r){var n,a,o=new Set(Object.values(h)).size,c=await N(r),i=await $(c,o);let e=new Map;for([n,a]of Object.entries(h))e.has(a)?e.get(a).push(n):e.set(a,[n]);var f,c=new Map([...e.entries()].sort((e,t)=>{e=(0,v.default)(e[0]),t=(0,v.default)(t[0]);return e.get("lab.l")-t.get("lab.l")})),u={};for([,f]of(e=c).entries()){var s=i.shift();if(s)for(const l of f)u[l]=s}_(u)}})},L=e=>{e=new URL(e);return e.host,"raw.githubusercontent.com"===e.host},j=e=>{e=e.match(/https:\/\/raw\.githubusercontent\.com\/(?<user>[^/]+)\/(?<repo>[^/]+)\/(?<branch>[^/]+)\/(?<filePath>.+$)/);return{user:e?e.groups?.user:null,repo:e?e.groups?.repo:null,branch:e?e.groups?.branch:null,filePath:e?e.groups?.filePath:null}},O=e=>{var t=decodeURI(e).trim().toLowerCase();return t.startsWith("javascript:")||t.startsWith("data:")||t.startsWith("vbscript:")?"about:blank":e},C=e=>{e&&(e=e.split("/").pop())&&-1===Spicetify.Config.extensions.indexOf(e)&&Spicetify.Config.extensions.push(e)},E=new Blob([`
|
|
self.addEventListener('message', async (event) => {
|
|
const url = event.data;
|
|
const response = await fetch(url);
|
|
const data = await response.json().catch(() => null);
|
|
self.postMessage(data);
|
|
});
|
|
`],{type:"application/javascript"}),P=URL.createObjectURL(E),async function e(){for(;!Spicetify?.LocalStorage||!Spicetify?.showNotification;)await new Promise(e=>setTimeout(e,10));var t=document.createElement("script");t.innerHTML="const global = globalThis;",document.body.appendChild(t),console.log("Initializing Spicetify Marketplace v"+a),window.Marketplace={reset:M,export:S,version:a};const f=await U();t=async t=>{t=y(t);if(t){if(console.debug("Initializing theme: ",t),t.schemes){var e=t.schemes[t.activeScheme];if(_(e),Spicetify.Config.color_scheme=t.activeScheme,"true"===localStorage.getItem(p))x(e);else if("true"===localStorage.getItem(g)){var r=t.schemes;let e=0;const i=Object.keys(r).length;setInterval(()=>{e%=i,_(Object.values(r)[e]),e++},6e4)}}else console.warn("No schemes found for theme");e=document.querySelector("link.marketplaceCSS"),e=(e&&e.remove(),await(async(e,t)=>{if(!e.cssURL)throw new Error("No CSS URL provided");t||=await U();var t=L(e.cssURL)?`https://cdn.jsdelivr.${t}/gh/${e.user}/${e.repo}@${e.branch}/`+e.manifest.usercss:e.cssURL,r=t.replace("/user.css","/assets/");console.debug("Parsing CSS: ",t);let n=await fetch(t+"?time="+Date.now()).then(e=>e.text());for(const c of n.matchAll(/url\(['|"](?<path>.+?)['|"]\)/gm)||[]){var a,o=c?.groups?.path;!o||o.startsWith("http")||o.startsWith("data")||(a=r+o.replace(/\.\//g,""),n=n.replace(o,a))}return n})(t,f));try{var n,a,o=document.querySelector("link[href='user.css']"),c=(o&&o.remove(),document.querySelector("style.marketplaceCSS.marketplaceUserCSS"));c&&c.remove(),e?((n=document.createElement("style")).classList.add("marketplaceCSS"),n.classList.add("marketplaceUserCSS"),n.innerHTML=e,document.body.appendChild(n)):((a=document.createElement("link")).setAttribute("rel","stylesheet"),a.setAttribute("href","user.css"),a.classList.add("userCSS"),document.body.appendChild(a))}catch(e){console.warn(e)}Spicetify.Config.current_theme=t.manifest?.name,t.include&&t.include.length&&t.include.forEach(e=>{var t=document.createElement("script");let r=e;if(L(e)){var{user:n,repo:a,branch:o,filePath:c}=j(e);if(!(n&&a&&o&&c))return;r=`https://cdn.jsdelivr.${f}/gh/${n}/${a}@${o}/`+c,c.endsWith(".mjs")&&(t.type="module")}t.src=r+"?time="+Date.now(),t.classList.add("marketplaceScript"),document.body.appendChild(t),C(e)})}else console.debug("No theme manifest found")};console.log("Loaded Marketplace extension");var r,n=y(c,[]).map(e=>y(e));n=n,(r=document.querySelector("style.marketplaceSnippets"))&&r.remove(),r=document.createElement("style"),n=n.reduce((e,t)=>e=(e+=`/* ${t.title} - ${t.description} */
|
|
`)+t.code+`
|
|
`,""),r.innerHTML=n,r.classList.add("marketplaceSnippets"),document.body.appendChild(r),f?(window.sessionStorage.setItem("marketplace-request-tld",f),Spicetify.Config.local_theme=Spicetify.Config.current_theme,Spicetify.Config.local_color_scheme=Spicetify.Config.color_scheme,(n=localStorage.getItem(d))&&t(n),y(o,[]).forEach(e=>{if((e=y(e))&&e.extensionURL){console.debug("Initializing extension: ",e);var t=document.createElement("script");if(t.defer=!0,t.src=e.extensionURL,L(t.src)){var{user:r,repo:n,branch:a,filePath:o}=j(e.extensionURL);if(!(r&&n&&a&&o))return;t.src=`https://cdn.jsdelivr.${f}/gh/${r}/${n}@${a}/`+o,o.endsWith(".mjs")&&(t.type="module")}t.src=t.src+"?time="+Date.now(),document.body.appendChild(t),C(e.manifest?.main)}})):window.navigator.onLine?(console.error(new Error("Unable to connect to the CDN, please check your Internet configuration.")),Spicetify.showNotification("Marketplace is unable to connect to the CDN. Please check your Internet configuration.",!0,5e3)):window.addEventListener("online",e,{once:!0})}(),async function(){console.debug("Preloading extensions and themes..."),window.sessionStorage.clear();var e=await(await fetch("https://raw.githubusercontent.com/spicetify/spicetify-marketplace/main/resources/blacklist.json").then(e=>e.json()).catch(()=>({}))).repos;window.sessionStorage.setItem("marketplace:blacklist",JSON.stringify(e)),await Promise.all([I("extension",0),I("theme",0),I("app",0)])}();function A(e,n){e&&e.forEach(e=>{var t=n||e.user+"-"+e.repo,r=window.sessionStorage.getItem(t),r=r?JSON.parse(r):[];r.push(e),window.sessionStorage.setItem(t,JSON.stringify(r))})}async function U(){for(const e of["net","xyz"])try{if("opaqueredirect"===(await fetch("https://cdn.jsdelivr."+e,{redirect:"manual",cache:"no-cache"})).type)return e}catch(e){console.error(e);continue}}async function R(e,t,r){var n=e+"-"+t,a=window.sessionStorage.getItem(n),o=JSON.parse(window.sessionStorage.getItem("noManifests")||"[]");if(a)return JSON.parse(a);a=`https://raw.githubusercontent.com/${e}/${t}/${r}/manifest.json`;if(o.includes(a))return null;let c=await async function(e){const n=new Worker(P);return new Promise(t=>{const r=e=>{n.terminate(),t(e)};n.postMessage(e),n.addEventListener("message",e=>r(e.data),{once:!0}),n.addEventListener("error",()=>r(null),{once:!0})})}(a);return c?(A(c=Array.isArray(c)?c:[c],n),c):A([a],"noManifests")}async function I(e,t){var r=await async function(e,t=1){const r=window.sessionStorage.getItem("marketplace:blacklist");let n=`https://api.github.com/search/repositories?per_page=${m}&q=`+encodeURIComponent(`topic:spicetify-${e}s`);t&&(n+="&page="+t);var a=JSON.parse(window.sessionStorage.getItem(`spicetify-${e}s-page-`+t)||"null")||await fetch(n).then(e=>e.json()).catch(()=>null);return a?.items?(window.sessionStorage.setItem(`spicetify-${e}s-page-`+t,JSON.stringify(a)),{...a,page_count:a.items.length,items:a.items.filter(e=>!r?.includes(e.html_url))}):(Spicetify.showNotification?.("Too Many Requests, Cool Down.",!0),{items:[]})}(e,t),n=(!async function(e,t){for(const r of e.items)"theme"===t?await async function(e,n,a){try{var t=e.match(/https:\/\/api\.github\.com\/repos\/(?<user>.+)\/(?<repo>.+)\/contents/);if(!t||!t.groups)return;const{user:o,repo:c}=t.groups;return(await R(o,c,n)).reduce((e,t)=>{var r=t.branch||n,r={manifest:t,title:t.name,subtitle:t.description,authors:k(t.authors,o),user:o,repo:c,branch:r,imageURL:t.preview&&t.preview.startsWith("http")?t.preview:`https://raw.githubusercontent.com/${o}/${c}/${r}/`+t.preview,readmeURL:t.readme&&t.readme.startsWith("http")?t.readme:`https://raw.githubusercontent.com/${o}/${c}/${r}/`+t.readme,stars:a,tags:t.tags,cssURL:t.usercss.startsWith("http")?t.usercss:`https://raw.githubusercontent.com/${o}/${c}/${r}/`+t.usercss,schemesURL:t.schemes?t.schemes.startsWith("http")?t.schemes:`https://raw.githubusercontent.com/${o}/${c}/${r}/`+t.schemes:null,include:t.include};return t?.name&&t?.usercss&&t?.description&&e.push(r),e},[])}catch{return}}(r.contents_url,r.default_branch,r.stargazers_count):"extension"===t?await async function(e,n,a,o=!1){try{var t=e.match(/https:\/\/api\.github\.com\/repos\/(?<user>.+)\/(?<repo>.+)\/contents/);if(!t||!t.groups)return;const{user:c,repo:i}=t.groups;return(await R(c,i,n)).reduce((e,t)=>{var r=t.branch||n,r={manifest:t,title:t.name,subtitle:t.description,authors:k(t.authors,c),user:c,repo:i,branch:r,imageURL:t.preview&&t.preview.startsWith("http")?t.preview:`https://raw.githubusercontent.com/${c}/${i}/${r}/`+t.preview,extensionURL:t.main.startsWith("http")?t.main:`https://raw.githubusercontent.com/${c}/${i}/${r}/`+t.main,readmeURL:t.readme&&t.readme.startsWith("http")?t.readme:`https://raw.githubusercontent.com/${c}/${i}/${r}/`+t.readme,stars:a,tags:t.tags};return t&&t.name&&t.description&&t.main&&(o&&localStorage.getItem(`marketplace:installed:${c}/${i}/`+t.main)||e.push(r)),e},[])}catch{return}}(r.contents_url,r.default_branch,r.stargazers_count):"app"===t&&await async function(e,n,a){try{var t=e.match(/https:\/\/api\.github\.com\/repos\/(?<user>.+)\/(?<repo>.+)\/contents/);if(!t||!t.groups)return;const{user:o,repo:c}=t.groups;return(await R(o,c,n)).reduce((e,t)=>{var r=t.branch||n,r={manifest:t,title:t.name,subtitle:t.description,authors:k(t.authors,o),user:o,repo:c,branch:r,imageURL:t.preview&&t.preview.startsWith("http")?t.preview:`https://raw.githubusercontent.com/${o}/${c}/${r}/`+t.preview,readmeURL:t.readme&&t.readme.startsWith("http")?t.readme:`https://raw.githubusercontent.com/${o}/${c}/${r}/`+t.readme,stars:a,tags:t.tags};return t&&t.name&&t.description&&e.push(r),e},[])}catch{return}}(r.contents_url,r.default_branch,r.stargazers_count)}(r,e),m*t+r.page_count),a=(console.debug({pageOfRepos:r}),r.total_count-n);if(console.debug(`Parsed ${n}/${r.total_count} ${e}s`),0<a)return I(e,t+1);console.debug(`No more ${e} results`)}}(); |