@nzlov/dsh-bing-wallpaper 0.0.0-stage → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +25 -0
- package/README.md +50 -2
- package/README.zh-CN.md +51 -0
- package/THIRD_PARTY_NOTICES.md +18 -0
- package/bing-source.js +212 -0
- package/boot-theme.js +84 -0
- package/client.js +144 -0
- package/cordis.patch.yml +4 -0
- package/icon.svg +6 -0
- package/index.js +120 -0
- package/locale/en.json +59 -0
- package/locale/zh.json +59 -0
- package/package.json +63 -4
- package/third-party/material-color-utilities-LICENSE.txt +191 -0
- package/wallpaper-filter.js +55 -0
package/client.js
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
// Generated by npm run build. Edit palette.js / client-main.js / appearance.js / boot-theme.js / compatibility.js / palette-preview.js instead.
|
|
2
|
+
(()=>{var Re=Object.defineProperty;var Ne=(t,e)=>{for(var r in e)Re(t,r,{get:e[r],enumerable:!0})};var te={};Ne(te,{DEFAULTS:()=>mt,PALETTE_MODES:()=>pe,WALLPAPER_VEIL:()=>Gt,backgroundAlpha:()=>fe,contrast:()=>pt,extractAccent:()=>Ke,hslToRgb:()=>Je,localDate:()=>Ye,luminance:()=>Zt,makeTokens:()=>tr,normalizeSettings:()=>qe,normalizeStrength:()=>qt,rgbToHsl:()=>ge,scheduledScheme:()=>We,wallpaperShade:()=>Ge});function J(t){return t<0?-1:t===0?0:1}function bt(t,e,r){return(1-r)*t+r*e}function se(t,e,r){return r<t?t:r>e?e:r}function vt(t,e,r){return r<t?t:r>e?e:r}function At(t){return t=t%360,t<0&&(t=t+360),t}function W(t){return t=t%360,t<0&&(t=t+360),t}function Yt(t,e){return 180-Math.abs(Math.abs(t-e)-180)}function Ot(t,e){let r=t[0]*e[0][0]+t[1]*e[0][1]+t[2]*e[0][2],a=t[0]*e[1][0]+t[1]*e[1][1]+t[2]*e[1][2],n=t[0]*e[2][0]+t[1]*e[2][1]+t[2]*e[2][2];return[r,a,n]}var ie=[[.41233895,.35762064,.18051042],[.2126,.7152,.0722],[.01932141,.11916382,.95034478]],He=[[3.2413774792388685,-1.5376652402851851,-.49885366846268053],[-.9691452513005321,1.8758853451067872,.04156585616912061],[.05562093689691305,-.20395524564742123,1.0571799111220335]],le=[95.047,100,108.883];function wt(t,e,r){return(255<<24|(t&255)<<16|(e&255)<<8|r&255)>>>0}function Jt(t){let e=yt(t[0]),r=yt(t[1]),a=yt(t[2]);return wt(e,r,a)}function Mt(t){return t>>16&255}function St(t){return t>>8&255}function Tt(t){return t&255}function ce(t,e,r){let a=He,n=a[0][0]*t+a[0][1]*e+a[0][2]*r,i=a[1][0]*t+a[1][1]*e+a[1][2]*r,o=a[2][0]*t+a[2][1]*e+a[2][2]*r,c=yt(n),m=yt(i),l=yt(o);return wt(c,m,l)}function Le(t){let e=it(Mt(t)),r=it(St(t)),a=it(Tt(t));return Ot([e,r,a],ie)}function Kt(t){let e=it(Mt(t)),r=it(St(t)),a=it(Tt(t)),n=ie,i=n[0][0]*e+n[0][1]*r+n[0][2]*a,o=n[1][0]*e+n[1][1]*r+n[1][2]*a,c=n[2][0]*e+n[2][1]*r+n[2][2]*a,m=le,l=i/m[0],d=o/m[1],u=c/m[2],f=Rt(l),h=Rt(d),b=Rt(u),p=116*h-16,P=500*(f-h),S=200*(h-b);return[p,P,S]}function de(t){let e=rt(t),r=yt(e);return wt(r,r,r)}function Lt(t){let e=Le(t)[1];return 116*Rt(e/100)-16}function rt(t){return 100*ze((t+16)/116)}function Nt(t){return Rt(t/100)*116-16}function it(t){let e=t/255;return e<=.040449936?e/12.92*100:Math.pow((e+.055)/1.055,2.4)*100}function yt(t){let e=t/100,r=0;return e<=.0031308?r=e*12.92:r=1.055*Math.pow(e,1/2.4)-.055,se(0,255,Math.round(r*255))}function me(){return le}function Rt(t){let e=.008856451679035631,r=24389/27;return t>e?Math.pow(t,1/3):(r*t+16)/116}function ze(t){let e=.008856451679035631,r=24389/27,a=t*t*t;return a>e?a:(116*t-16)/r}var tt=class t{static make(e=me(),r=200/Math.PI*rt(50)/100,a=50,n=2,i=!1){let o=e,c=o[0]*.401288+o[1]*.650173+o[2]*-.051461,m=o[0]*-.250268+o[1]*1.204414+o[2]*.045854,l=o[0]*-.002079+o[1]*.048952+o[2]*.953127,d=.8+n/10,u=d>=.9?bt(.59,.69,(d-.9)*10):bt(.525,.59,(d-.8)*10),f=i?1:d*(1-1/3.6*Math.exp((-r-42)/92));f=f>1?1:f<0?0:f;let h=d,b=[f*(100/c)+1-f,f*(100/m)+1-f,f*(100/l)+1-f],p=1/(5*r+1),P=p*p*p*p,S=1-P,T=P*r+.1*S*S*Math.cbrt(5*r),C=rt(a)/e[1],O=1.48+Math.sqrt(C),M=.725/Math.pow(C,.2),H=M,I=[Math.pow(T*b[0]*c/100,.42),Math.pow(T*b[1]*m/100,.42),Math.pow(T*b[2]*l/100,.42)],B=[400*I[0]/(I[0]+27.13),400*I[1]/(I[1]+27.13),400*I[2]/(I[2]+27.13)],V=(2*B[0]+B[1]+.05*B[2])*M;return new t(C,V,M,H,u,h,b,T,Math.pow(T,.25),O)}constructor(e,r,a,n,i,o,c,m,l,d){this.n=e,this.aw=r,this.nbb=a,this.ncb=n,this.c=i,this.nc=o,this.rgbD=c,this.fl=m,this.fLRoot=l,this.z=d}};tt.DEFAULT=tt.make();var lt=class t{constructor(e,r,a,n,i,o,c,m,l){this.hue=e,this.chroma=r,this.j=a,this.q=n,this.m=i,this.s=o,this.jstar=c,this.astar=m,this.bstar=l}distance(e){let r=this.jstar-e.jstar,a=this.astar-e.astar,n=this.bstar-e.bstar,i=Math.sqrt(r*r+a*a+n*n);return 1.41*Math.pow(i,.63)}static fromInt(e){return t.fromIntInViewingConditions(e,tt.DEFAULT)}static fromIntInViewingConditions(e,r){let a=(e&16711680)>>16,n=(e&65280)>>8,i=e&255,o=it(a),c=it(n),m=it(i),l=.41233895*o+.35762064*c+.18051042*m,d=.2126*o+.7152*c+.0722*m,u=.01932141*o+.11916382*c+.95034478*m,f=.401288*l+.650173*d-.051461*u,h=-.250268*l+1.204414*d+.045854*u,b=-.002079*l+.048952*d+.953127*u,p=r.rgbD[0]*f,P=r.rgbD[1]*h,S=r.rgbD[2]*b,T=Math.pow(r.fl*Math.abs(p)/100,.42),C=Math.pow(r.fl*Math.abs(P)/100,.42),O=Math.pow(r.fl*Math.abs(S)/100,.42),M=J(p)*400*T/(T+27.13),H=J(P)*400*C/(C+27.13),I=J(S)*400*O/(O+27.13),B=(11*M+-12*H+I)/11,V=(M+H-2*I)/9,x=(20*M+20*H+21*I)/20,E=(40*M+20*H+I)/20,_=Math.atan2(V,B)*180/Math.PI,G=_<0?_+360:_>=360?_-360:_,ut=G*Math.PI/180,Ct=E*r.nbb,ot=100*Math.pow(Ct/r.aw,r.c*r.z),Pt=4/r.c*Math.sqrt(ot/100)*(r.aw+4)*r.fLRoot,Bt=G<20.14?G+360:G,y=.25*(Math.cos(Bt*Math.PI/180+2)+3.8),D=5e4/13*y*r.nc*r.ncb*Math.sqrt(B*B+V*V)/(x+.305),U=Math.pow(D,.9)*Math.pow(1.64-Math.pow(.29,r.n),.73),q=U*Math.sqrt(ot/100),N=q*r.fLRoot,Q=50*Math.sqrt(U*r.c/(r.aw+4)),K=(1+100*.007)*ot/(1+.007*ot),st=1/.0228*Math.log(1+.0228*N),et=st*Math.cos(ut),ft=st*Math.sin(ut);return new t(G,q,ot,Pt,N,Q,K,et,ft)}static fromJch(e,r,a){return t.fromJchInViewingConditions(e,r,a,tt.DEFAULT)}static fromJchInViewingConditions(e,r,a,n){let i=4/n.c*Math.sqrt(e/100)*(n.aw+4)*n.fLRoot,o=r*n.fLRoot,c=r/Math.sqrt(e/100),m=50*Math.sqrt(c*n.c/(n.aw+4)),l=a*Math.PI/180,d=(1+100*.007)*e/(1+.007*e),u=1/.0228*Math.log(1+.0228*o),f=u*Math.cos(l),h=u*Math.sin(l);return new t(a,r,e,i,o,m,d,f,h)}static fromUcs(e,r,a){return t.fromUcsInViewingConditions(e,r,a,tt.DEFAULT)}static fromUcsInViewingConditions(e,r,a,n){let i=r,o=a,c=Math.sqrt(i*i+o*o),l=(Math.exp(c*.0228)-1)/.0228/n.fLRoot,d=Math.atan2(o,i)*(180/Math.PI);d<0&&(d+=360);let u=e/(1-(e-100)*.007);return t.fromJchInViewingConditions(u,l,d,n)}toInt(){return this.viewed(tt.DEFAULT)}viewed(e){let r=this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100),a=Math.pow(r/Math.pow(1.64-Math.pow(.29,e.n),.73),1/.9),n=this.hue*Math.PI/180,i=.25*(Math.cos(n+2)+3.8),o=e.aw*Math.pow(this.j/100,1/e.c/e.z),c=i*(5e4/13)*e.nc*e.ncb,m=o/e.nbb,l=Math.sin(n),d=Math.cos(n),u=23*(m+.305)*a/(23*c+11*a*d+108*a*l),f=u*d,h=u*l,b=(460*m+451*f+288*h)/1403,p=(460*m-891*f-261*h)/1403,P=(460*m-220*f-6300*h)/1403,S=Math.max(0,27.13*Math.abs(b)/(400-Math.abs(b))),T=J(b)*(100/e.fl)*Math.pow(S,1/.42),C=Math.max(0,27.13*Math.abs(p)/(400-Math.abs(p))),O=J(p)*(100/e.fl)*Math.pow(C,1/.42),M=Math.max(0,27.13*Math.abs(P)/(400-Math.abs(P))),H=J(P)*(100/e.fl)*Math.pow(M,1/.42),I=T/e.rgbD[0],B=O/e.rgbD[1],V=H/e.rgbD[2],x=1.86206786*I-1.01125463*B+.14918677*V,E=.38752654*I+.62144744*B-.00897398*V,R=-.0158415*I-.03412294*B+1.04996444*V;return ce(x,E,R)}static fromXyzInViewingConditions(e,r,a,n){let i=.401288*e+.650173*r-.051461*a,o=-.250268*e+1.204414*r+.045854*a,c=-.002079*e+.048952*r+.953127*a,m=n.rgbD[0]*i,l=n.rgbD[1]*o,d=n.rgbD[2]*c,u=Math.pow(n.fl*Math.abs(m)/100,.42),f=Math.pow(n.fl*Math.abs(l)/100,.42),h=Math.pow(n.fl*Math.abs(d)/100,.42),b=J(m)*400*u/(u+27.13),p=J(l)*400*f/(f+27.13),P=J(d)*400*h/(h+27.13),S=(11*b+-12*p+P)/11,T=(b+p-2*P)/9,C=(20*b+20*p+21*P)/20,O=(40*b+20*p+P)/20,H=Math.atan2(T,S)*180/Math.PI,I=H<0?H+360:H>=360?H-360:H,B=I*Math.PI/180,V=O*n.nbb,x=100*Math.pow(V/n.aw,n.c*n.z),E=4/n.c*Math.sqrt(x/100)*(n.aw+4)*n.fLRoot,R=I<20.14?I+360:I,_=1/4*(Math.cos(R*Math.PI/180+2)+3.8),ut=5e4/13*_*n.nc*n.ncb*Math.sqrt(S*S+T*T)/(C+.305),Ct=Math.pow(ut,.9)*Math.pow(1.64-Math.pow(.29,n.n),.73),ot=Ct*Math.sqrt(x/100),Pt=ot*n.fLRoot,Bt=50*Math.sqrt(Ct*n.c/(n.aw+4)),y=(1+100*.007)*x/(1+.007*x),g=Math.log(1+.0228*Pt)/.0228,D=g*Math.cos(B),U=g*Math.sin(B);return new t(I,ot,x,E,Pt,Bt,y,D,U)}xyzInViewingConditions(e){let r=this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100),a=Math.pow(r/Math.pow(1.64-Math.pow(.29,e.n),.73),1/.9),n=this.hue*Math.PI/180,i=.25*(Math.cos(n+2)+3.8),o=e.aw*Math.pow(this.j/100,1/e.c/e.z),c=i*(5e4/13)*e.nc*e.ncb,m=o/e.nbb,l=Math.sin(n),d=Math.cos(n),u=23*(m+.305)*a/(23*c+11*a*d+108*a*l),f=u*d,h=u*l,b=(460*m+451*f+288*h)/1403,p=(460*m-891*f-261*h)/1403,P=(460*m-220*f-6300*h)/1403,S=Math.max(0,27.13*Math.abs(b)/(400-Math.abs(b))),T=J(b)*(100/e.fl)*Math.pow(S,1/.42),C=Math.max(0,27.13*Math.abs(p)/(400-Math.abs(p))),O=J(p)*(100/e.fl)*Math.pow(C,1/.42),M=Math.max(0,27.13*Math.abs(P)/(400-Math.abs(P))),H=J(P)*(100/e.fl)*Math.pow(M,1/.42),I=T/e.rgbD[0],B=O/e.rgbD[1],V=H/e.rgbD[2],x=1.86206786*I-1.01125463*B+.14918677*V,E=.38752654*I+.62144744*B-.00897398*V,R=-.0158415*I-.03412294*B+1.04996444*V;return[x,E,R]}};var nt=class t{static sanitizeRadians(e){return(e+Math.PI*8)%(Math.PI*2)}static trueDelinearized(e){let r=e/100,a=0;return r<=.0031308?a=r*12.92:a=1.055*Math.pow(r,1/2.4)-.055,a*255}static chromaticAdaptation(e){let r=Math.pow(Math.abs(e),.42);return J(e)*400*r/(r+27.13)}static hueOf(e){let r=Ot(e,t.SCALED_DISCOUNT_FROM_LINRGB),a=t.chromaticAdaptation(r[0]),n=t.chromaticAdaptation(r[1]),i=t.chromaticAdaptation(r[2]),o=(11*a+-12*n+i)/11,c=(a+n-2*i)/9;return Math.atan2(c,o)}static areInCyclicOrder(e,r,a){let n=t.sanitizeRadians(r-e),i=t.sanitizeRadians(a-e);return n<i}static intercept(e,r,a){return(r-e)/(a-e)}static lerpPoint(e,r,a){return[e[0]+(a[0]-e[0])*r,e[1]+(a[1]-e[1])*r,e[2]+(a[2]-e[2])*r]}static setCoordinate(e,r,a,n){let i=t.intercept(e[n],r,a[n]);return t.lerpPoint(e,i,a)}static isBounded(e){return 0<=e&&e<=100}static nthVertex(e,r){let a=t.Y_FROM_LINRGB[0],n=t.Y_FROM_LINRGB[1],i=t.Y_FROM_LINRGB[2],o=r%4<=1?0:100,c=r%2===0?0:100;if(r<4){let m=o,l=c,d=(e-m*n-l*i)/a;return t.isBounded(d)?[d,m,l]:[-1,-1,-1]}else if(r<8){let m=o,l=c,d=(e-l*a-m*i)/n;return t.isBounded(d)?[l,d,m]:[-1,-1,-1]}else{let m=o,l=c,d=(e-m*a-l*n)/i;return t.isBounded(d)?[m,l,d]:[-1,-1,-1]}}static bisectToSegment(e,r){let a=[-1,-1,-1],n=a,i=0,o=0,c=!1,m=!0;for(let l=0;l<12;l++){let d=t.nthVertex(e,l);if(d[0]<0)continue;let u=t.hueOf(d);if(!c){a=d,n=d,i=u,o=u,c=!0;continue}(m||t.areInCyclicOrder(i,u,o))&&(m=!1,t.areInCyclicOrder(i,r,u)?(n=d,o=u):(a=d,i=u))}return[a,n]}static midpoint(e,r){return[(e[0]+r[0])/2,(e[1]+r[1])/2,(e[2]+r[2])/2]}static criticalPlaneBelow(e){return Math.floor(e-.5)}static criticalPlaneAbove(e){return Math.ceil(e-.5)}static bisectToLimit(e,r){let a=t.bisectToSegment(e,r),n=a[0],i=t.hueOf(n),o=a[1];for(let c=0;c<3;c++)if(n[c]!==o[c]){let m=-1,l=255;n[c]<o[c]?(m=t.criticalPlaneBelow(t.trueDelinearized(n[c])),l=t.criticalPlaneAbove(t.trueDelinearized(o[c]))):(m=t.criticalPlaneAbove(t.trueDelinearized(n[c])),l=t.criticalPlaneBelow(t.trueDelinearized(o[c])));for(let d=0;d<8&&!(Math.abs(l-m)<=1);d++){let u=Math.floor((m+l)/2),f=t.CRITICAL_PLANES[u],h=t.setCoordinate(n,f,o,c),b=t.hueOf(h);t.areInCyclicOrder(i,r,b)?(o=h,l=u):(n=h,i=b,m=u)}}return t.midpoint(n,o)}static inverseChromaticAdaptation(e){let r=Math.abs(e),a=Math.max(0,27.13*r/(400-r));return J(e)*Math.pow(a,1/.42)}static findResultByJ(e,r,a){let n=Math.sqrt(a)*11,i=tt.DEFAULT,o=1/Math.pow(1.64-Math.pow(.29,i.n),.73),m=.25*(Math.cos(e+2)+3.8)*(5e4/13)*i.nc*i.ncb,l=Math.sin(e),d=Math.cos(e);for(let u=0;u<5;u++){let f=n/100,h=r===0||n===0?0:r/Math.sqrt(f),b=Math.pow(h*o,1/.9),P=i.aw*Math.pow(f,1/i.c/i.z)/i.nbb,S=23*(P+.305)*b/(23*m+11*b*d+108*b*l),T=S*d,C=S*l,O=(460*P+451*T+288*C)/1403,M=(460*P-891*T-261*C)/1403,H=(460*P-220*T-6300*C)/1403,I=t.inverseChromaticAdaptation(O),B=t.inverseChromaticAdaptation(M),V=t.inverseChromaticAdaptation(H),x=Ot([I,B,V],t.LINRGB_FROM_SCALED_DISCOUNT);if(x[0]<0||x[1]<0||x[2]<0)return 0;let E=t.Y_FROM_LINRGB[0],R=t.Y_FROM_LINRGB[1],_=t.Y_FROM_LINRGB[2],G=E*x[0]+R*x[1]+_*x[2];if(G<=0)return 0;if(u===4||Math.abs(G-a)<.002)return x[0]>100.01||x[1]>100.01||x[2]>100.01?0:Jt(x);n=n-(G-a)*n/(2*G)}return 0}static solveToInt(e,r,a){if(r<1e-4||a<1e-4||a>99.9999)return de(a);e=W(e);let n=e/180*Math.PI,i=rt(a),o=t.findResultByJ(n,r,i);if(o!==0)return o;let c=t.bisectToLimit(i,n);return Jt(c)}static solveToCam(e,r,a){return lt.fromInt(t.solveToInt(e,r,a))}};nt.SCALED_DISCOUNT_FROM_LINRGB=[[.001200833568784504,.002389694492170889,.0002795742885861124],[.0005891086651375999,.0029785502573438758,.0003270666104008398],[.00010146692491640572,.0005364214359186694,.0032979401770712076]];nt.LINRGB_FROM_SCALED_DISCOUNT=[[1373.2198709594231,-1100.4251190754821,-7.278681089101213],[-271.815969077903,559.6580465940733,-32.46047482791194],[1.9622899599665666,-57.173814538844006,308.7233197812385]];nt.Y_FROM_LINRGB=[.2126,.7152,.0722];nt.CRITICAL_PLANES=[.015176349177441876,.045529047532325624,.07588174588720938,.10623444424209313,.13658714259697685,.16693984095186062,.19729253930674434,.2276452376616281,.2579979360165119,.28835063437139563,.3188300904430532,.350925934958123,.3848314933096426,.42057480301049466,.458183274052838,.4976837250274023,.5391024159806381,.5824650784040898,.6277969426914107,.6751227633498623,.7244668422128921,.775853049866786,.829304845476233,.8848452951698498,.942497089126609,1.0022825574869039,1.0642236851973577,1.1283421258858297,1.1946592148522128,1.2631959812511864,1.3339731595349034,1.407011200216447,1.4823302800086415,1.5599503113873272,1.6398909516233677,1.7221716113234105,1.8068114625156377,1.8938294463134073,1.9832442801866852,2.075074464868551,2.1693382909216234,2.2660538449872063,2.36523901573795,2.4669114995532007,2.5710888059345764,2.6777882626779785,2.7870270208169257,2.898822059350997,3.0131901897720907,3.1301480604002863,3.2497121605402226,3.3718988244681087,3.4967242352587946,3.624204428461639,3.754355295633311,3.887192587735158,4.022731918402185,4.160988767090289,4.301978482107941,4.445716283538092,4.592217266055746,4.741496401646282,4.893568542229298,5.048448422192488,5.20615066083972,5.3666897647573375,5.5300801301023865,5.696336044816294,5.865471690767354,6.037501145825082,6.212438385869475,6.390297286737924,6.571091626112461,6.7548350853498045,6.941541251256611,7.131223617812143,7.323895587840543,7.5195704746346665,7.7182615035334345,7.919981813454504,8.124744458384042,8.332562408825165,8.543448553206703,8.757415699253682,8.974476575321063,9.194643831691977,9.417930041841839,9.644347703669503,9.873909240696694,10.106627003236781,10.342513269534024,10.58158024687427,10.8238400726681,11.069304815507364,11.317986476196008,11.569896988756009,11.825048221409341,12.083451977536606,12.345119996613247,12.610063955123938,12.878295467455942,13.149826086772048,13.42466730586372,13.702830557985108,13.984327217668513,14.269168601521828,14.55736596900856,14.848930523210871,15.143873411576273,15.44220572664832,15.743938506781891,16.04908273684337,16.35764934889634,16.66964922287304,16.985093187232053,17.30399201960269,17.62635644741625,17.95219714852476,18.281524751807332,18.614349837764564,18.95068293910138,19.290534541298456,19.633915083172692,19.98083495742689,20.331304511189067,20.685334046541502,21.042933821039977,21.404114048223256,21.76888489811322,22.137256497705877,22.50923893145328,22.884842241736916,23.264076429332462,23.6469514538663,24.033477234264016,24.42366364919083,24.817520537484558,25.21505769858089,25.61628489293138,26.021211842414342,26.429848230738664,26.842203703840827,27.258287870275353,27.678110301598522,28.10168053274597,28.529008062403893,28.96010235337422,29.39497283293396,29.83362889318845,30.276079891419332,30.722335150426627,31.172403958865512,31.62629557157785,32.08401920991837,32.54558406207592,33.010999283389665,33.4802739966603,33.953417292456834,34.430438229418264,34.911345834551085,35.39614910352207,35.88485700094671,36.37747846067349,36.87402238606382,37.37449765026789,37.87891309649659,38.38727753828926,38.89959975977785,39.41588851594697,39.93615253289054,40.460400508064545,40.98864111053629,41.520882981230194,42.05713473317016,42.597404951718396,43.141702194811224,43.6900349931913,44.24241185063697,44.798841244188324,45.35933162437017,45.92389141541209,46.49252901546552,47.065252796817916,47.64207110610409,48.22299226451468,48.808024568002054,49.3971762874833,49.9904556690408,50.587870934119984,51.189430279724725,51.79514187861014,52.40501387947288,53.0190544071392,53.637271562750364,54.259673423945976,54.88626804504493,55.517063457223934,56.15206766869424,56.79128866487574,57.43473440856916,58.08241284012621,58.734331877617365,59.39049941699807,60.05092333227251,60.715611475655585,61.38457167773311,62.057811747619894,62.7353394731159,63.417162620860914,64.10328893648692,64.79372614476921,65.48848194977529,66.18756403501224,66.89098006357258,67.59873767827808,68.31084450182222,69.02730813691093,69.74813616640164,70.47333615344107,71.20291564160104,71.93688215501312,72.67524319850172,73.41800625771542,74.16517879925733,74.9167682708136,75.67278210128072,76.43322770089146,77.1981124613393,77.96744375590167,78.74122893956174,79.51947534912904,80.30219030335869,81.08938110306934,81.88105503125999,82.67721935322541,83.4778813166706,84.28304815182372,85.09272707154808,85.90692527145302,86.72564993000343,87.54890820862819,88.3767072518277,89.2090541872801,90.04595612594655,90.88742016217518,91.73345337380438,92.58406282226491,93.43925555268066,94.29903859396902,95.16341895893969,96.03240364439274,96.9059996312159,97.78421388448044,98.6670533535366,99.55452497210776];var F=class t{static from(e,r,a){return new t(nt.solveToInt(e,r,a))}static fromInt(e){return new t(e)}toInt(){return this.argb}get hue(){return this.internalHue}set hue(e){this.setInternalState(nt.solveToInt(e,this.internalChroma,this.internalTone))}get chroma(){return this.internalChroma}set chroma(e){this.setInternalState(nt.solveToInt(this.internalHue,e,this.internalTone))}get tone(){return this.internalTone}set tone(e){this.setInternalState(nt.solveToInt(this.internalHue,this.internalChroma,e))}constructor(e){this.argb=e;let r=lt.fromInt(e);this.internalHue=r.hue,this.internalChroma=r.chroma,this.internalTone=Lt(e),this.argb=e}setInternalState(e){let r=lt.fromInt(e);this.internalHue=r.hue,this.internalChroma=r.chroma,this.internalTone=Lt(e),this.argb=e}inViewingConditions(e){let a=lt.fromInt(this.toInt()).xyzInViewingConditions(e),n=lt.fromXyzInViewingConditions(a[0],a[1],a[2],tt.make());return t.from(n.hue,n.chroma,Nt(a[1]))}};var Z=class t{static ratioOfTones(e,r){return e=vt(0,100,e),r=vt(0,100,r),t.ratioOfYs(rt(e),rt(r))}static ratioOfYs(e,r){let a=e>r?e:r,n=a===r?e:r;return(a+5)/(n+5)}static lighter(e,r){if(e<0||e>100)return-1;let a=rt(e),n=r*(a+5)-5,i=t.ratioOfYs(n,a),o=Math.abs(i-r);if(i<r&&o>.04)return-1;let c=Nt(n)+.4;return c<0||c>100?-1:c}static darker(e,r){if(e<0||e>100)return-1;let a=rt(e),n=(a+5)/r-5,i=t.ratioOfYs(a,n),o=Math.abs(i-r);if(i<r&&o>.04)return-1;let c=Nt(n)-.4;return c<0||c>100?-1:c}static lighterUnsafe(e,r){let a=t.lighter(e,r);return a<0?100:a}static darkerUnsafe(e,r){let a=t.darker(e,r);return a<0?0:a}};var ht=class t{static isDisliked(e){let r=Math.round(e.hue)>=90&&Math.round(e.hue)<=111,a=Math.round(e.chroma)>16,n=Math.round(e.tone)<65;return r&&a&&n}static fixIfDisliked(e){return t.isDisliked(e)?F.from(e.hue,e.chroma,70):e}};var k=class t{static fromPalette(e){return new t(e.name??"",e.palette,e.tone,e.isBackground??!1,e.background,e.secondBackground,e.contrastCurve,e.toneDeltaPair)}constructor(e,r,a,n,i,o,c,m){if(this.name=e,this.palette=r,this.tone=a,this.isBackground=n,this.background=i,this.secondBackground=o,this.contrastCurve=c,this.toneDeltaPair=m,this.hctCache=new Map,!i&&o)throw new Error(`Color ${e} has secondBackgrounddefined, but background is not defined.`);if(!i&&c)throw new Error(`Color ${e} has contrastCurvedefined, but background is not defined.`);if(i&&!c)throw new Error(`Color ${e} has backgrounddefined, but contrastCurve is not defined.`)}getArgb(e){return this.getHct(e).toInt()}getHct(e){let r=this.hctCache.get(e);if(r!=null)return r;let a=this.getTone(e),n=this.palette(e).getHct(a);return this.hctCache.size>4&&this.hctCache.clear(),this.hctCache.set(e,n),n}getTone(e){let r=e.contrastLevel<0;if(this.toneDeltaPair){let a=this.toneDeltaPair(e),n=a.roleA,i=a.roleB,o=a.delta,c=a.polarity,m=a.stayTogether,d=this.background(e).getTone(e),u=c==="nearer"||c==="lighter"&&!e.isDark||c==="darker"&&e.isDark,f=u?n:i,h=u?i:n,b=this.name===f.name,p=e.isDark?1:-1,P=f.contrastCurve.get(e.contrastLevel),S=h.contrastCurve.get(e.contrastLevel),T=f.tone(e),C=Z.ratioOfTones(d,T)>=P?T:t.foregroundTone(d,P),O=h.tone(e),M=Z.ratioOfTones(d,O)>=S?O:t.foregroundTone(d,S);return r&&(C=t.foregroundTone(d,P),M=t.foregroundTone(d,S)),(M-C)*p>=o||(M=vt(0,100,C+o*p),(M-C)*p>=o||(C=vt(0,100,M-o*p))),50<=C&&C<60?p>0?(C=60,M=Math.max(M,C+o*p)):(C=49,M=Math.min(M,C+o*p)):50<=M&&M<60&&(m?p>0?(C=60,M=Math.max(M,C+o*p)):(C=49,M=Math.min(M,C+o*p)):p>0?M=60:M=49),b?C:M}else{let a=this.tone(e);if(this.background==null)return a;let n=this.background(e).getTone(e),i=this.contrastCurve.get(e.contrastLevel);if(Z.ratioOfTones(n,a)>=i||(a=t.foregroundTone(n,i)),r&&(a=t.foregroundTone(n,i)),this.isBackground&&50<=a&&a<60&&(Z.ratioOfTones(49,n)>=i?a=49:a=60),this.secondBackground){let[o,c]=[this.background,this.secondBackground],[m,l]=[o(e).getTone(e),c(e).getTone(e)],[d,u]=[Math.max(m,l),Math.min(m,l)];if(Z.ratioOfTones(d,a)>=i&&Z.ratioOfTones(u,a)>=i)return a;let f=Z.lighter(d,i),h=Z.darker(u,i),b=[];return f!==-1&&b.push(f),h!==-1&&b.push(h),t.tonePrefersLightForeground(m)||t.tonePrefersLightForeground(l)?f<0?100:f:b.length===1?b[0]:h<0?0:h}return a}}static foregroundTone(e,r){let a=Z.lighterUnsafe(e,r),n=Z.darkerUnsafe(e,r),i=Z.ratioOfTones(a,e),o=Z.ratioOfTones(n,e);if(t.tonePrefersLightForeground(e)){let m=Math.abs(i-o)<.1&&i<r&&o<r;return i>=r||i>=o||m?a:n}else return o>=r||o>=i?n:a}static tonePrefersLightForeground(e){return Math.round(e)<60}static toneAllowsLightForeground(e){return Math.round(e)<=49}static enableLightForeground(e){return t.tonePrefersLightForeground(e)&&!t.toneAllowsLightForeground(e)?49:e}};var w=class t{static fromInt(e){let r=F.fromInt(e);return t.fromHct(r)}static fromHct(e){return new t(e.hue,e.chroma,e)}static fromHueAndChroma(e,r){let a=new Xt(e,r).create();return new t(e,r,a)}constructor(e,r,a){this.hue=e,this.chroma=r,this.keyColor=a,this.cache=new Map}tone(e){let r=this.cache.get(e);return r===void 0&&(r=F.from(this.hue,this.chroma,e).toInt(),this.cache.set(e,r)),r}getHct(e){return F.fromInt(this.tone(e))}},Xt=class{constructor(e,r){this.hue=e,this.requestedChroma=r,this.chromaCache=new Map,this.maxChromaValue=200}create(){let n=0,i=100;for(;n<i;){let o=Math.floor((n+i)/2),c=this.maxChroma(o)<this.maxChroma(o+1);if(this.maxChroma(o)>=this.requestedChroma-.01)if(Math.abs(n-50)<Math.abs(i-50))i=o;else{if(n===o)return F.from(this.hue,this.requestedChroma,n);n=o}else c?n=o+1:i=o}return F.from(this.hue,this.requestedChroma,n)}maxChroma(e){if(this.chromaCache.has(e))return this.chromaCache.get(e);let r=F.from(this.hue,this.maxChromaValue,e).chroma;return this.chromaCache.set(e,r),r}};var v=class{constructor(e,r,a,n){this.low=e,this.normal=r,this.medium=a,this.high=n}get(e){return e<=-1?this.low:e<0?bt(this.low,this.normal,(e- -1)/1):e<.5?bt(this.normal,this.medium,(e-0)/.5):e<1?bt(this.medium,this.high,(e-.5)/.5):this.high}};var Y=class{constructor(e,r,a,n,i){this.roleA=e,this.roleB=r,this.delta=a,this.polarity=n,this.stayTogether=i}};var L;(function(t){t[t.MONOCHROME=0]="MONOCHROME",t[t.NEUTRAL=1]="NEUTRAL",t[t.TONAL_SPOT=2]="TONAL_SPOT",t[t.VIBRANT=3]="VIBRANT",t[t.EXPRESSIVE=4]="EXPRESSIVE",t[t.FIDELITY=5]="FIDELITY",t[t.CONTENT=6]="CONTENT",t[t.RAINBOW=7]="RAINBOW",t[t.FRUIT_SALAD=8]="FRUIT_SALAD"})(L||(L={}));function It(t){return t.variant===L.FIDELITY||t.variant===L.CONTENT}function $(t){return t.variant===L.MONOCHROME}function $e(t,e,r,a){let n=r,i=F.from(t,e,r);if(i.chroma<e){let o=i.chroma;for(;i.chroma<e;){n+=a?-1:1;let c=F.from(t,e,n);if(o>c.chroma||Math.abs(c.chroma-e)<.4)break;let m=Math.abs(c.chroma-e),l=Math.abs(i.chroma-e);m<l&&(i=c),o=Math.max(o,c.chroma)}}return n}var s=class t{static highestSurface(e){return e.isDark?t.surfaceBright:t.surfaceDim}};s.contentAccentToneDelta=15;s.primaryPaletteKeyColor=k.fromPalette({name:"primary_palette_key_color",palette:t=>t.primaryPalette,tone:t=>t.primaryPalette.keyColor.tone});s.secondaryPaletteKeyColor=k.fromPalette({name:"secondary_palette_key_color",palette:t=>t.secondaryPalette,tone:t=>t.secondaryPalette.keyColor.tone});s.tertiaryPaletteKeyColor=k.fromPalette({name:"tertiary_palette_key_color",palette:t=>t.tertiaryPalette,tone:t=>t.tertiaryPalette.keyColor.tone});s.neutralPaletteKeyColor=k.fromPalette({name:"neutral_palette_key_color",palette:t=>t.neutralPalette,tone:t=>t.neutralPalette.keyColor.tone});s.neutralVariantPaletteKeyColor=k.fromPalette({name:"neutral_variant_palette_key_color",palette:t=>t.neutralVariantPalette,tone:t=>t.neutralVariantPalette.keyColor.tone});s.background=k.fromPalette({name:"background",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:98,isBackground:!0});s.onBackground=k.fromPalette({name:"on_background",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:10,background:t=>s.background,contrastCurve:new v(3,3,4.5,7)});s.surface=k.fromPalette({name:"surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:98,isBackground:!0});s.surfaceDim=k.fromPalette({name:"surface_dim",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:new v(87,87,80,75).get(t.contrastLevel),isBackground:!0});s.surfaceBright=k.fromPalette({name:"surface_bright",palette:t=>t.neutralPalette,tone:t=>t.isDark?new v(24,24,29,34).get(t.contrastLevel):98,isBackground:!0});s.surfaceContainerLowest=k.fromPalette({name:"surface_container_lowest",palette:t=>t.neutralPalette,tone:t=>t.isDark?new v(4,4,2,0).get(t.contrastLevel):100,isBackground:!0});s.surfaceContainerLow=k.fromPalette({name:"surface_container_low",palette:t=>t.neutralPalette,tone:t=>t.isDark?new v(10,10,11,12).get(t.contrastLevel):new v(96,96,96,95).get(t.contrastLevel),isBackground:!0});s.surfaceContainer=k.fromPalette({name:"surface_container",palette:t=>t.neutralPalette,tone:t=>t.isDark?new v(12,12,16,20).get(t.contrastLevel):new v(94,94,92,90).get(t.contrastLevel),isBackground:!0});s.surfaceContainerHigh=k.fromPalette({name:"surface_container_high",palette:t=>t.neutralPalette,tone:t=>t.isDark?new v(17,17,21,25).get(t.contrastLevel):new v(92,92,88,85).get(t.contrastLevel),isBackground:!0});s.surfaceContainerHighest=k.fromPalette({name:"surface_container_highest",palette:t=>t.neutralPalette,tone:t=>t.isDark?new v(22,22,26,30).get(t.contrastLevel):new v(90,90,84,80).get(t.contrastLevel),isBackground:!0});s.onSurface=k.fromPalette({name:"on_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:10,background:t=>s.highestSurface(t),contrastCurve:new v(4.5,7,11,21)});s.surfaceVariant=k.fromPalette({name:"surface_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?30:90,isBackground:!0});s.onSurfaceVariant=k.fromPalette({name:"on_surface_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?80:30,background:t=>s.highestSurface(t),contrastCurve:new v(3,4.5,7,11)});s.inverseSurface=k.fromPalette({name:"inverse_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:20});s.inverseOnSurface=k.fromPalette({name:"inverse_on_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?20:95,background:t=>s.inverseSurface,contrastCurve:new v(4.5,7,11,21)});s.outline=k.fromPalette({name:"outline",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?60:50,background:t=>s.highestSurface(t),contrastCurve:new v(1.5,3,4.5,7)});s.outlineVariant=k.fromPalette({name:"outline_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?30:80,background:t=>s.highestSurface(t),contrastCurve:new v(1,1,3,4.5)});s.shadow=k.fromPalette({name:"shadow",palette:t=>t.neutralPalette,tone:t=>0});s.scrim=k.fromPalette({name:"scrim",palette:t=>t.neutralPalette,tone:t=>0});s.surfaceTint=k.fromPalette({name:"surface_tint",palette:t=>t.primaryPalette,tone:t=>t.isDark?80:40,isBackground:!0});s.primary=k.fromPalette({name:"primary",palette:t=>t.primaryPalette,tone:t=>$(t)?t.isDark?100:0:t.isDark?80:40,isBackground:!0,background:t=>s.highestSurface(t),contrastCurve:new v(3,4.5,7,7),toneDeltaPair:t=>new Y(s.primaryContainer,s.primary,10,"nearer",!1)});s.onPrimary=k.fromPalette({name:"on_primary",palette:t=>t.primaryPalette,tone:t=>$(t)?t.isDark?10:90:t.isDark?20:100,background:t=>s.primary,contrastCurve:new v(4.5,7,11,21)});s.primaryContainer=k.fromPalette({name:"primary_container",palette:t=>t.primaryPalette,tone:t=>It(t)?t.sourceColorHct.tone:$(t)?t.isDark?85:25:t.isDark?30:90,isBackground:!0,background:t=>s.highestSurface(t),contrastCurve:new v(1,1,3,4.5),toneDeltaPair:t=>new Y(s.primaryContainer,s.primary,10,"nearer",!1)});s.onPrimaryContainer=k.fromPalette({name:"on_primary_container",palette:t=>t.primaryPalette,tone:t=>It(t)?k.foregroundTone(s.primaryContainer.tone(t),4.5):$(t)?t.isDark?0:100:t.isDark?90:30,background:t=>s.primaryContainer,contrastCurve:new v(3,4.5,7,11)});s.inversePrimary=k.fromPalette({name:"inverse_primary",palette:t=>t.primaryPalette,tone:t=>t.isDark?40:80,background:t=>s.inverseSurface,contrastCurve:new v(3,4.5,7,7)});s.secondary=k.fromPalette({name:"secondary",palette:t=>t.secondaryPalette,tone:t=>t.isDark?80:40,isBackground:!0,background:t=>s.highestSurface(t),contrastCurve:new v(3,4.5,7,7),toneDeltaPair:t=>new Y(s.secondaryContainer,s.secondary,10,"nearer",!1)});s.onSecondary=k.fromPalette({name:"on_secondary",palette:t=>t.secondaryPalette,tone:t=>$(t)?t.isDark?10:100:t.isDark?20:100,background:t=>s.secondary,contrastCurve:new v(4.5,7,11,21)});s.secondaryContainer=k.fromPalette({name:"secondary_container",palette:t=>t.secondaryPalette,tone:t=>{let e=t.isDark?30:90;return $(t)?t.isDark?30:85:It(t)?$e(t.secondaryPalette.hue,t.secondaryPalette.chroma,e,!t.isDark):e},isBackground:!0,background:t=>s.highestSurface(t),contrastCurve:new v(1,1,3,4.5),toneDeltaPair:t=>new Y(s.secondaryContainer,s.secondary,10,"nearer",!1)});s.onSecondaryContainer=k.fromPalette({name:"on_secondary_container",palette:t=>t.secondaryPalette,tone:t=>$(t)?t.isDark?90:10:It(t)?k.foregroundTone(s.secondaryContainer.tone(t),4.5):t.isDark?90:30,background:t=>s.secondaryContainer,contrastCurve:new v(3,4.5,7,11)});s.tertiary=k.fromPalette({name:"tertiary",palette:t=>t.tertiaryPalette,tone:t=>$(t)?t.isDark?90:25:t.isDark?80:40,isBackground:!0,background:t=>s.highestSurface(t),contrastCurve:new v(3,4.5,7,7),toneDeltaPair:t=>new Y(s.tertiaryContainer,s.tertiary,10,"nearer",!1)});s.onTertiary=k.fromPalette({name:"on_tertiary",palette:t=>t.tertiaryPalette,tone:t=>$(t)?t.isDark?10:90:t.isDark?20:100,background:t=>s.tertiary,contrastCurve:new v(4.5,7,11,21)});s.tertiaryContainer=k.fromPalette({name:"tertiary_container",palette:t=>t.tertiaryPalette,tone:t=>{if($(t))return t.isDark?60:49;if(!It(t))return t.isDark?30:90;let e=t.tertiaryPalette.getHct(t.sourceColorHct.tone);return ht.fixIfDisliked(e).tone},isBackground:!0,background:t=>s.highestSurface(t),contrastCurve:new v(1,1,3,4.5),toneDeltaPair:t=>new Y(s.tertiaryContainer,s.tertiary,10,"nearer",!1)});s.onTertiaryContainer=k.fromPalette({name:"on_tertiary_container",palette:t=>t.tertiaryPalette,tone:t=>$(t)?t.isDark?0:100:It(t)?k.foregroundTone(s.tertiaryContainer.tone(t),4.5):t.isDark?90:30,background:t=>s.tertiaryContainer,contrastCurve:new v(3,4.5,7,11)});s.error=k.fromPalette({name:"error",palette:t=>t.errorPalette,tone:t=>t.isDark?80:40,isBackground:!0,background:t=>s.highestSurface(t),contrastCurve:new v(3,4.5,7,7),toneDeltaPair:t=>new Y(s.errorContainer,s.error,10,"nearer",!1)});s.onError=k.fromPalette({name:"on_error",palette:t=>t.errorPalette,tone:t=>t.isDark?20:100,background:t=>s.error,contrastCurve:new v(4.5,7,11,21)});s.errorContainer=k.fromPalette({name:"error_container",palette:t=>t.errorPalette,tone:t=>t.isDark?30:90,isBackground:!0,background:t=>s.highestSurface(t),contrastCurve:new v(1,1,3,4.5),toneDeltaPair:t=>new Y(s.errorContainer,s.error,10,"nearer",!1)});s.onErrorContainer=k.fromPalette({name:"on_error_container",palette:t=>t.errorPalette,tone:t=>$(t)?t.isDark?90:10:t.isDark?90:30,background:t=>s.errorContainer,contrastCurve:new v(3,4.5,7,11)});s.primaryFixed=k.fromPalette({name:"primary_fixed",palette:t=>t.primaryPalette,tone:t=>$(t)?40:90,isBackground:!0,background:t=>s.highestSurface(t),contrastCurve:new v(1,1,3,4.5),toneDeltaPair:t=>new Y(s.primaryFixed,s.primaryFixedDim,10,"lighter",!0)});s.primaryFixedDim=k.fromPalette({name:"primary_fixed_dim",palette:t=>t.primaryPalette,tone:t=>$(t)?30:80,isBackground:!0,background:t=>s.highestSurface(t),contrastCurve:new v(1,1,3,4.5),toneDeltaPair:t=>new Y(s.primaryFixed,s.primaryFixedDim,10,"lighter",!0)});s.onPrimaryFixed=k.fromPalette({name:"on_primary_fixed",palette:t=>t.primaryPalette,tone:t=>$(t)?100:10,background:t=>s.primaryFixedDim,secondBackground:t=>s.primaryFixed,contrastCurve:new v(4.5,7,11,21)});s.onPrimaryFixedVariant=k.fromPalette({name:"on_primary_fixed_variant",palette:t=>t.primaryPalette,tone:t=>$(t)?90:30,background:t=>s.primaryFixedDim,secondBackground:t=>s.primaryFixed,contrastCurve:new v(3,4.5,7,11)});s.secondaryFixed=k.fromPalette({name:"secondary_fixed",palette:t=>t.secondaryPalette,tone:t=>$(t)?80:90,isBackground:!0,background:t=>s.highestSurface(t),contrastCurve:new v(1,1,3,4.5),toneDeltaPair:t=>new Y(s.secondaryFixed,s.secondaryFixedDim,10,"lighter",!0)});s.secondaryFixedDim=k.fromPalette({name:"secondary_fixed_dim",palette:t=>t.secondaryPalette,tone:t=>$(t)?70:80,isBackground:!0,background:t=>s.highestSurface(t),contrastCurve:new v(1,1,3,4.5),toneDeltaPair:t=>new Y(s.secondaryFixed,s.secondaryFixedDim,10,"lighter",!0)});s.onSecondaryFixed=k.fromPalette({name:"on_secondary_fixed",palette:t=>t.secondaryPalette,tone:t=>10,background:t=>s.secondaryFixedDim,secondBackground:t=>s.secondaryFixed,contrastCurve:new v(4.5,7,11,21)});s.onSecondaryFixedVariant=k.fromPalette({name:"on_secondary_fixed_variant",palette:t=>t.secondaryPalette,tone:t=>$(t)?25:30,background:t=>s.secondaryFixedDim,secondBackground:t=>s.secondaryFixed,contrastCurve:new v(3,4.5,7,11)});s.tertiaryFixed=k.fromPalette({name:"tertiary_fixed",palette:t=>t.tertiaryPalette,tone:t=>$(t)?40:90,isBackground:!0,background:t=>s.highestSurface(t),contrastCurve:new v(1,1,3,4.5),toneDeltaPair:t=>new Y(s.tertiaryFixed,s.tertiaryFixedDim,10,"lighter",!0)});s.tertiaryFixedDim=k.fromPalette({name:"tertiary_fixed_dim",palette:t=>t.tertiaryPalette,tone:t=>$(t)?30:80,isBackground:!0,background:t=>s.highestSurface(t),contrastCurve:new v(1,1,3,4.5),toneDeltaPair:t=>new Y(s.tertiaryFixed,s.tertiaryFixedDim,10,"lighter",!0)});s.onTertiaryFixed=k.fromPalette({name:"on_tertiary_fixed",palette:t=>t.tertiaryPalette,tone:t=>$(t)?100:10,background:t=>s.tertiaryFixedDim,secondBackground:t=>s.tertiaryFixed,contrastCurve:new v(4.5,7,11,21)});s.onTertiaryFixedVariant=k.fromPalette({name:"on_tertiary_fixed_variant",palette:t=>t.tertiaryPalette,tone:t=>$(t)?90:30,background:t=>s.tertiaryFixedDim,secondBackground:t=>s.tertiaryFixed,contrastCurve:new v(3,4.5,7,11)});var z=class{constructor(e){this.sourceColorArgb=e.sourceColorArgb,this.variant=e.variant,this.contrastLevel=e.contrastLevel,this.isDark=e.isDark,this.sourceColorHct=F.fromInt(e.sourceColorArgb),this.primaryPalette=e.primaryPalette,this.secondaryPalette=e.secondaryPalette,this.tertiaryPalette=e.tertiaryPalette,this.neutralPalette=e.neutralPalette,this.neutralVariantPalette=e.neutralVariantPalette,this.errorPalette=w.fromHueAndChroma(25,84)}static getRotatedHue(e,r,a){let n=e.hue;if(r.length!==a.length)throw new Error(`mismatch between hue length ${r.length} & rotations ${a.length}`);if(a.length===1)return W(e.hue+a[0]);let i=r.length;for(let o=0;o<=i-2;o++){let c=r[o],m=r[o+1];if(c<n&&n<m)return W(n+a[o])}return n}getArgb(e){return e.getArgb(this)}getHct(e){return e.getHct(this)}get primaryPaletteKeyColor(){return this.getArgb(s.primaryPaletteKeyColor)}get secondaryPaletteKeyColor(){return this.getArgb(s.secondaryPaletteKeyColor)}get tertiaryPaletteKeyColor(){return this.getArgb(s.tertiaryPaletteKeyColor)}get neutralPaletteKeyColor(){return this.getArgb(s.neutralPaletteKeyColor)}get neutralVariantPaletteKeyColor(){return this.getArgb(s.neutralVariantPaletteKeyColor)}get background(){return this.getArgb(s.background)}get onBackground(){return this.getArgb(s.onBackground)}get surface(){return this.getArgb(s.surface)}get surfaceDim(){return this.getArgb(s.surfaceDim)}get surfaceBright(){return this.getArgb(s.surfaceBright)}get surfaceContainerLowest(){return this.getArgb(s.surfaceContainerLowest)}get surfaceContainerLow(){return this.getArgb(s.surfaceContainerLow)}get surfaceContainer(){return this.getArgb(s.surfaceContainer)}get surfaceContainerHigh(){return this.getArgb(s.surfaceContainerHigh)}get surfaceContainerHighest(){return this.getArgb(s.surfaceContainerHighest)}get onSurface(){return this.getArgb(s.onSurface)}get surfaceVariant(){return this.getArgb(s.surfaceVariant)}get onSurfaceVariant(){return this.getArgb(s.onSurfaceVariant)}get inverseSurface(){return this.getArgb(s.inverseSurface)}get inverseOnSurface(){return this.getArgb(s.inverseOnSurface)}get outline(){return this.getArgb(s.outline)}get outlineVariant(){return this.getArgb(s.outlineVariant)}get shadow(){return this.getArgb(s.shadow)}get scrim(){return this.getArgb(s.scrim)}get surfaceTint(){return this.getArgb(s.surfaceTint)}get primary(){return this.getArgb(s.primary)}get onPrimary(){return this.getArgb(s.onPrimary)}get primaryContainer(){return this.getArgb(s.primaryContainer)}get onPrimaryContainer(){return this.getArgb(s.onPrimaryContainer)}get inversePrimary(){return this.getArgb(s.inversePrimary)}get secondary(){return this.getArgb(s.secondary)}get onSecondary(){return this.getArgb(s.onSecondary)}get secondaryContainer(){return this.getArgb(s.secondaryContainer)}get onSecondaryContainer(){return this.getArgb(s.onSecondaryContainer)}get tertiary(){return this.getArgb(s.tertiary)}get onTertiary(){return this.getArgb(s.onTertiary)}get tertiaryContainer(){return this.getArgb(s.tertiaryContainer)}get onTertiaryContainer(){return this.getArgb(s.onTertiaryContainer)}get error(){return this.getArgb(s.error)}get onError(){return this.getArgb(s.onError)}get errorContainer(){return this.getArgb(s.errorContainer)}get onErrorContainer(){return this.getArgb(s.onErrorContainer)}get primaryFixed(){return this.getArgb(s.primaryFixed)}get primaryFixedDim(){return this.getArgb(s.primaryFixedDim)}get onPrimaryFixed(){return this.getArgb(s.onPrimaryFixed)}get onPrimaryFixedVariant(){return this.getArgb(s.onPrimaryFixedVariant)}get secondaryFixed(){return this.getArgb(s.secondaryFixed)}get secondaryFixedDim(){return this.getArgb(s.secondaryFixedDim)}get onSecondaryFixed(){return this.getArgb(s.onSecondaryFixed)}get onSecondaryFixedVariant(){return this.getArgb(s.onSecondaryFixedVariant)}get tertiaryFixed(){return this.getArgb(s.tertiaryFixed)}get tertiaryFixedDim(){return this.getArgb(s.tertiaryFixedDim)}get onTertiaryFixed(){return this.getArgb(s.onTertiaryFixed)}get onTertiaryFixedVariant(){return this.getArgb(s.onTertiaryFixedVariant)}};var Dt=class t{constructor(e){this.input=e,this.hctsByTempCache=[],this.hctsByHueCache=[],this.tempsByHctCache=new Map,this.inputRelativeTemperatureCache=-1,this.complementCache=null}get hctsByTemp(){if(this.hctsByTempCache.length>0)return this.hctsByTempCache;let e=this.hctsByHue.concat([this.input]),r=this.tempsByHct;return e.sort((a,n)=>r.get(a)-r.get(n)),this.hctsByTempCache=e,e}get warmest(){return this.hctsByTemp[this.hctsByTemp.length-1]}get coldest(){return this.hctsByTemp[0]}analogous(e=5,r=12){let a=Math.round(this.input.hue),n=this.hctsByHue[a],i=this.relativeTemperature(n),o=[n],c=0;for(let b=0;b<360;b++){let p=At(a+b),P=this.hctsByHue[p],S=this.relativeTemperature(P),T=Math.abs(S-i);i=S,c+=T}let m=1,l=c/r,d=0;for(i=this.relativeTemperature(n);o.length<r;){let b=At(a+m),p=this.hctsByHue[b],P=this.relativeTemperature(p),S=Math.abs(P-i);d+=S;let T=o.length*l,C=d>=T,O=1;for(;C&&o.length<r;){o.push(p);let M=(o.length+O)*l;C=d>=M,O++}if(i=P,m++,m>360){for(;o.length<r;)o.push(p);break}}let u=[this.input],f=Math.floor((e-1)/2);for(let b=1;b<f+1;b++){let p=0-b;for(;p<0;)p=o.length+p;p>=o.length&&(p=p%o.length),u.splice(0,0,o[p])}let h=e-f-1;for(let b=1;b<h+1;b++){let p=b;for(;p<0;)p=o.length+p;p>=o.length&&(p=p%o.length),u.push(o[p])}return u}get complement(){if(this.complementCache!=null)return this.complementCache;let e=this.coldest.hue,r=this.tempsByHct.get(this.coldest),a=this.warmest.hue,i=this.tempsByHct.get(this.warmest)-r,o=t.isBetween(this.input.hue,e,a),c=o?a:e,m=o?e:a,l=1,d=1e3,u=this.hctsByHue[Math.round(this.input.hue)],f=1-this.inputRelativeTemperature;for(let h=0;h<=360;h+=1){let b=W(c+l*h);if(!t.isBetween(b,c,m))continue;let p=this.hctsByHue[Math.round(b)],P=(this.tempsByHct.get(p)-r)/i,S=Math.abs(f-P);S<d&&(d=S,u=p)}return this.complementCache=u,this.complementCache}relativeTemperature(e){let r=this.tempsByHct.get(this.warmest)-this.tempsByHct.get(this.coldest),a=this.tempsByHct.get(e)-this.tempsByHct.get(this.coldest);return r===0?.5:a/r}get inputRelativeTemperature(){return this.inputRelativeTemperatureCache>=0?this.inputRelativeTemperatureCache:(this.inputRelativeTemperatureCache=this.relativeTemperature(this.input),this.inputRelativeTemperatureCache)}get tempsByHct(){if(this.tempsByHctCache.size>0)return this.tempsByHctCache;let e=this.hctsByHue.concat([this.input]),r=new Map;for(let a of e)r.set(a,t.rawTemperature(a));return this.tempsByHctCache=r,r}get hctsByHue(){if(this.hctsByHueCache.length>0)return this.hctsByHueCache;let e=[];for(let r=0;r<=360;r+=1){let a=F.from(r,this.input.chroma,this.input.tone);e.push(a)}return this.hctsByHueCache=e,this.hctsByHueCache}static isBetween(e,r,a){return r<a?r<=e&&e<=a:r<=e||e<=a}static rawTemperature(e){let r=Kt(e.toInt()),a=W(Math.atan2(r[2],r[1])*180/Math.PI),n=Math.sqrt(r[1]*r[1]+r[2]*r[2]);return-.5+.02*Math.pow(n,1.07)*Math.cos(W(a-50)*Math.PI/180)}};var zt=class extends z{constructor(e,r,a){super({sourceColorArgb:e.toInt(),variant:L.CONTENT,contrastLevel:a,isDark:r,primaryPalette:w.fromHueAndChroma(e.hue,e.chroma),secondaryPalette:w.fromHueAndChroma(e.hue,Math.max(e.chroma-32,e.chroma*.5)),tertiaryPalette:w.fromInt(ht.fixIfDisliked(new Dt(e).analogous(3,6)[2]).toInt()),neutralPalette:w.fromHueAndChroma(e.hue,e.chroma/8),neutralVariantPalette:w.fromHueAndChroma(e.hue,e.chroma/8+4)})}};var xt=class t extends z{constructor(e,r,a){super({sourceColorArgb:e.toInt(),variant:L.EXPRESSIVE,contrastLevel:a,isDark:r,primaryPalette:w.fromHueAndChroma(W(e.hue+240),40),secondaryPalette:w.fromHueAndChroma(z.getRotatedHue(e,t.hues,t.secondaryRotations),24),tertiaryPalette:w.fromHueAndChroma(z.getRotatedHue(e,t.hues,t.tertiaryRotations),32),neutralPalette:w.fromHueAndChroma(e.hue+15,8),neutralVariantPalette:w.fromHueAndChroma(e.hue+15,12)})}};xt.hues=[0,21,51,121,151,191,271,321,360];xt.secondaryRotations=[45,95,45,20,45,90,45,45,45];xt.tertiaryRotations=[120,120,20,45,20,15,20,120,120];var $t=class extends z{constructor(e,r,a){super({sourceColorArgb:e.toInt(),variant:L.FIDELITY,contrastLevel:a,isDark:r,primaryPalette:w.fromHueAndChroma(e.hue,e.chroma),secondaryPalette:w.fromHueAndChroma(e.hue,Math.max(e.chroma-32,e.chroma*.5)),tertiaryPalette:w.fromInt(ht.fixIfDisliked(new Dt(e).complement).toInt()),neutralPalette:w.fromHueAndChroma(e.hue,e.chroma/8),neutralVariantPalette:w.fromHueAndChroma(e.hue,e.chroma/8+4)})}};var Vt=class extends z{constructor(e,r,a){super({sourceColorArgb:e.toInt(),variant:L.FRUIT_SALAD,contrastLevel:a,isDark:r,primaryPalette:w.fromHueAndChroma(W(e.hue-50),48),secondaryPalette:w.fromHueAndChroma(W(e.hue-50),36),tertiaryPalette:w.fromHueAndChroma(e.hue,36),neutralPalette:w.fromHueAndChroma(e.hue,10),neutralVariantPalette:w.fromHueAndChroma(e.hue,16)})}};var Ut=class extends z{constructor(e,r,a){super({sourceColorArgb:e.toInt(),variant:L.MONOCHROME,contrastLevel:a,isDark:r,primaryPalette:w.fromHueAndChroma(e.hue,0),secondaryPalette:w.fromHueAndChroma(e.hue,0),tertiaryPalette:w.fromHueAndChroma(e.hue,0),neutralPalette:w.fromHueAndChroma(e.hue,0),neutralVariantPalette:w.fromHueAndChroma(e.hue,0)})}};var Ht=class extends z{constructor(e,r,a){super({sourceColorArgb:e.toInt(),variant:L.NEUTRAL,contrastLevel:a,isDark:r,primaryPalette:w.fromHueAndChroma(e.hue,12),secondaryPalette:w.fromHueAndChroma(e.hue,8),tertiaryPalette:w.fromHueAndChroma(e.hue,16),neutralPalette:w.fromHueAndChroma(e.hue,2),neutralVariantPalette:w.fromHueAndChroma(e.hue,2)})}};var jt=class extends z{constructor(e,r,a){super({sourceColorArgb:e.toInt(),variant:L.RAINBOW,contrastLevel:a,isDark:r,primaryPalette:w.fromHueAndChroma(e.hue,48),secondaryPalette:w.fromHueAndChroma(e.hue,16),tertiaryPalette:w.fromHueAndChroma(W(e.hue+60),24),neutralPalette:w.fromHueAndChroma(e.hue,0),neutralVariantPalette:w.fromHueAndChroma(e.hue,0)})}};var _t=class extends z{constructor(e,r,a){super({sourceColorArgb:e.toInt(),variant:L.TONAL_SPOT,contrastLevel:a,isDark:r,primaryPalette:w.fromHueAndChroma(e.hue,36),secondaryPalette:w.fromHueAndChroma(e.hue,16),tertiaryPalette:w.fromHueAndChroma(W(e.hue+60),24),neutralPalette:w.fromHueAndChroma(e.hue,6),neutralVariantPalette:w.fromHueAndChroma(e.hue,8)})}};var kt=class t extends z{constructor(e,r,a){super({sourceColorArgb:e.toInt(),variant:L.VIBRANT,contrastLevel:a,isDark:r,primaryPalette:w.fromHueAndChroma(e.hue,200),secondaryPalette:w.fromHueAndChroma(z.getRotatedHue(e,t.hues,t.secondaryRotations),24),tertiaryPalette:w.fromHueAndChroma(z.getRotatedHue(e,t.hues,t.tertiaryRotations),32),neutralPalette:w.fromHueAndChroma(e.hue,10),neutralVariantPalette:w.fromHueAndChroma(e.hue,12)})}};kt.hues=[0,41,61,101,131,181,251,301,360];kt.secondaryRotations=[18,15,10,12,15,18,15,12,12];kt.tertiaryRotations=[35,30,20,25,30,35,30,25,25];var Ve={desired:4,fallbackColorARGB:4282549748,filter:!0};function Ue(t,e){return t.score>e.score?-1:t.score<e.score?1:0}var ct=class t{constructor(){}static score(e,r){let{desired:a,fallbackColorARGB:n,filter:i}={...Ve,...r},o=[],c=new Array(360).fill(0),m=0;for(let[h,b]of e.entries()){let p=F.fromInt(h);o.push(p);let P=Math.floor(p.hue);c[P]+=b,m+=b}let l=new Array(360).fill(0);for(let h=0;h<360;h++){let b=c[h]/m;for(let p=h-14;p<h+16;p++){let P=At(p);l[P]+=b}}let d=new Array;for(let h of o){let b=At(Math.round(h.hue)),p=l[b];if(i&&(h.chroma<t.CUTOFF_CHROMA||p<=t.CUTOFF_EXCITED_PROPORTION))continue;let P=p*100*t.WEIGHT_PROPORTION,S=h.chroma<t.TARGET_CHROMA?t.WEIGHT_CHROMA_BELOW:t.WEIGHT_CHROMA_ABOVE,T=(h.chroma-t.TARGET_CHROMA)*S,C=P+T;d.push({hct:h,score:C})}d.sort(Ue);let u=[];for(let h=90;h>=15;h--){u.length=0;for(let{hct:b}of d)if(u.find(P=>Yt(b.hue,P.hue)<h)||u.push(b),u.length>=a)break;if(u.length>=a)break}let f=[];u.length===0&&f.push(n);for(let h of u)f.push(h.toInt());return f}};ct.TARGET_CHROMA=48;ct.WEIGHT_PROPORTION=.7;ct.WEIGHT_CHROMA_ABOVE=.3;ct.WEIGHT_CHROMA_BELOW=.1;ct.CUTOFF_CHROMA=5;ct.CUTOFF_EXCITED_PROPORTION=.01;function he(){let t=Object.freeze({blur:Object.freeze({max:32,initial:12,unit:"px"}),frosted:Object.freeze({max:32,initial:12,unit:"px"}),blue:Object.freeze({max:60,initial:25,unit:"%"}),grayscale:Object.freeze({max:100,initial:100,unit:"%"}),dim:Object.freeze({max:60,initial:24,unit:"%"})}),e=Object.freeze(["none",...Object.keys(t)]);function r(i){let o=i?.filterMode,c=i?.filterAmounts,m=Object.fromEntries(Object.entries(t).map(([l,{max:d,initial:u}])=>{let f=c!=null&&Object.hasOwn(c,l)?c[l]:void 0;return[l,Number.isFinite(f)?Math.round(Math.min(d,Math.max(0,f))):u]}));return{filterMode:e.includes(o)?o:"none",filterAmounts:m}}function a(i){let{filterMode:o,filterAmounts:c}=r(i),m=c[o];if(!m)return null;switch(o){case"blur":case"frosted":return{filter:`blur(${m}px)`,bleed:m*3,...o==="frosted"?{tint:`rgb(255 255 255 / ${Math.round(m*.75)}%)`}:{}};case"blue":return{tint:`rgb(48 110 246 / ${m}%)`};case"grayscale":return{filter:`grayscale(${m}%)`};case"dim":return{filter:`brightness(${100-m}%)`};default:return null}}function n({selector:i,image:o,overlays:c,settings:m,fixed:l=!1}){let d=a(m);if(!o||!d)return"";let u=l?"fixed":"absolute",f=d.tint?[...c,d.tint]:c;return`${l?"":`${i}{position:relative;isolation:isolate;overflow:hidden}`}${i}::before{content:"";position:${u};inset:${d.bleed?`-${d.bleed}px`:"0"};z-index:-2;pointer-events:none;background:${o} center/cover no-repeat;${d.filter?`filter:${d.filter};`:""}}${i}::after{content:"";position:${u};inset:0;z-index:-1;pointer-events:none;background-image:${f.map(b=>`linear-gradient(${b},${b})`).join(",")}}`}return{modes:e,options:t,normalize:r,effect:a,css:n}}var dt=he();var pe=Object.freeze(["content","tonal-spot","fruit-salad","rainbow","monochrome","vibrant","faithful","soft","dysfunctional","muted"]),{filterMode:je,filterAmounts:_e}=dt.normalize(),mt=Object.freeze({enabled:!0,dynamic:!0,market:"zh-CN",paletteMode:"content",mode:"schedule",day:"07:00",night:"19:00",strength:28,filterMode:je,filterAmounts:Object.freeze(_e)});function qt(t){return Number.isFinite(t)?Math.round(Math.min(100,Math.max(10,t))):mt.strength}function fe(t){return Math.sqrt(1-qt(t)/100)}var Gt=Object.freeze({light:.56,dark:.62});function Ge(t){return t==="dark"?`rgba(0, 0, 0, ${Gt.dark})`:`rgba(255, 255, 255, ${Gt.light})`}function qe(t={}){(!t||typeof t!="object")&&(t={});let e=r=>typeof r=="string"&&/^([01]\d|2[0-3]):[0-5]\d$/.test(r);return{enabled:typeof t.enabled=="boolean"?t.enabled:!0,dynamic:typeof t.dynamic=="boolean"?t.dynamic:!0,market:["zh-CN","en-US"].includes(t.market)?t.market:mt.market,paletteMode:pe.includes(t.paletteMode)?t.paletteMode:mt.paletteMode,mode:["follow","schedule","system","light","dark"].includes(t.mode)?t.mode:"schedule",day:e(t.day)?t.day:mt.day,night:e(t.night)?t.night:mt.night,strength:qt(t.strength),...dt.normalize(t)}}function We(t,e,r){let a=c=>Number(c.slice(0,2))*60+Number(c.slice(3)),n=t.getHours()*60+t.getMinutes(),i=a(e),o=a(r);return i===o?null:(i<o?n>=i&&n<o:n>=i||n<o)?"light":"dark"}function Ye(t=new Date){return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}function ge([t,e,r]){t/=255,e/=255,r/=255;let a=Math.max(t,e,r),n=Math.min(t,e,r),i=a-n,o=(a+n)/2,c=0,m=0;return i&&(m=i/(1-Math.abs(2*o-1)),c=a===t?(e-r)/i%6:a===e?(r-t)/i+2:(t-e)/i+4,c=(c*60+360)%360),[c,m*100,o*100]}function Je([t,e,r]){e/=100,r/=100;let a=(1-Math.abs(2*r-1))*e,n=a*(1-Math.abs(t/60%2-1)),i=r-a/2;return(t<60?[a,n,0]:t<120?[n,a,0]:t<180?[0,a,n]:t<240?[0,n,a]:t<300?[n,0,a]:[a,0,n]).map(c=>Math.round((c+i)*255))}function Zt(t){let e=t.map(r=>(r/=255,r<=.04045?r/12.92:((r+.055)/1.055)**2.4));return e[0]*.2126+e[1]*.7152+e[2]*.0722}function pt(t,e){let r=Zt(t),a=Zt(e);return(Math.max(r,a)+.05)/(Math.min(r,a)+.05)}function Ke(t){let e=new Map;for(let a=0;a+3<t.length;a+=4){if(t[a+3]<200)continue;let n=[t[a],t[a+1],t[a+2]],[i,o,c]=ge(n);if(o<18||c<12||c>88)continue;let m=Math.floor(i/15),l=(.25+o/100)*(1-Math.abs(c-50)/65),d=e.get(m)||{weight:0,rgb:[0,0,0]};d.weight+=l,n.forEach((u,f)=>{d.rgb[f]+=u*l}),e.set(m,d)}let r=[...e.values()].sort((a,n)=>n.weight-a.weight)[0];if(!r){let a=0,n=[0,0,0];for(let i=0;i+3<t.length;i+=4)t[i+3]>=200&&(a++,n.forEach((o,c)=>{n[c]+=t[i+c]}));return a?n.map(i=>Math.round(i/a)):[92,116,132]}return r.rgb.map(a=>Math.round(a/r.weight))}var Qt=class extends Ht{constructor(e,r,a){super(e,r,a);let n=e.hue;Object.assign(this,{primaryPalette:w.fromHueAndChroma(n,Math.min(e.chroma,20)),secondaryPalette:w.fromHueAndChroma(n,Math.min(e.chroma,8)),tertiaryPalette:w.fromHueAndChroma((n+30)%360,Math.min(e.chroma,12)),neutralPalette:w.fromHueAndChroma(n,2),neutralVariantPalette:w.fromHueAndChroma(n,4)})}},be=Object.freeze({content:zt,"tonal-spot":_t,"fruit-salad":Vt,rainbow:jt,monochrome:Ut,vibrant:kt,faithful:$t,soft:Ht,dysfunctional:xt,muted:Qt}),Ft=new Map,j=t=>[Mt(t),St(t),Tt(t)],Xe=t=>`rgb(${t.join(", ")})`;function Ze(t,e){let r=wt(...t),a=`${e}:${r}`;if(!Ft.has(a)){let n=be[e],i=F.fromInt(r);Ft.set(a,[new n(i,!1,0),new n(i,!0,0)]),Ft.size>22&&Ft.delete(Ft.keys().next().value)}return Ft.get(a)}function Qe(t,e,r){let a={},n=fe(e);for(let[i,o]of Ze(t,r).entries()){let c=i===1,m=c?"dark":"light",l={"--dsw-alias-bg-base":j(o.surface),"--dsw-alias-bg-layer-1":j(o.surfaceContainerLow),"--dsw-alias-bg-layer-2":j(o.surfaceContainer),"--dsw-specific-sidebar-fill":j(o.surfaceContainerHigh),"--dsw-alias-border-l1":j(o.outlineVariant),"--dsw-alias-border-l2":j(o.outline)},d=(x,E,R)=>x.map((_,G)=>Math.round(_*(1-R)+E[G]*R));l["--dsw-alias-bg-layer-2"]=d(l["--dsw-alias-bg-layer-2"],j(o.secondaryContainer),.08),l["--dsw-specific-sidebar-fill"]=d(l["--dsw-specific-sidebar-fill"],j(o.tertiaryContainer),.18);let u=l["--dsw-alias-bg-layer-1"],f=d(l["--dsw-alias-bg-layer-2"],j(o.secondaryContainer),.2);l["--dsw-alias-bg-overlay"]=d(u,j(o.secondaryContainer),.04);let h=d(u,j(o.secondaryContainer),.24),b={"--dsw-alias-bg-layer-3":f,"--dsw-alias-bg-module-platform":f,"--dsw-alias-bg-multi-select":f,"--dsw-alias-card-fill":u,"--dsw-alias-card-fill-hover":h,"--dsw-alias-card-tile-fill":u,"--dsw-alias-onboarding-card-fill":u,"--dsw-alias-onboarding-secondary-fill":l["--dsw-alias-bg-layer-2"],"--dsw-alias-button-elevated-fill":u,"--dsw-alias-button-floating-fill":u,"--dsw-alias-button-floating-hover":h,"--dsw-alias-button-ghost-active-fill":f,"--dsw-alias-button-ghost-active-hover":h,"--dsw-alias-button-primary-dimmed":f,"--dsw-alias-interactive-bg-active":f,"--dsw-alias-interactive-bg-hover":h,"--dsw-alias-interactive-bg-hover-solid":h,"--dsw-alias-interactive-bg-hover-accent":f,"--dsw-menu-surface-fill":l["--dsw-alias-bg-overlay"],"--dsw-alias-menu-group-header-fill":u,"--dsw-specific-menu":l["--dsw-alias-bg-overlay"],"--dsw-specific-input-major":u,"--dsw-specific-login-input":l["--dsw-alias-bg-layer-2"],"--dsw-specific-selector":f,"--dsw-specific-tip":u,"--dsw-specific-sidebar-nav-item-active":f,"--dsw-specific-sidebar-nav-item-active-accent":f,"--dsw-specific-bubble":l["--dsw-alias-bg-layer-2"],"--dsw-specific-bubble-highlight":f,"--dsw-alias-markdown-code-block":l["--dsw-alias-bg-layer-2"],"--dsw-alias-markdown-code-block-banner":u,"--dsw-alias-markdown-inline-code":l["--dsw-alias-bg-layer-2"],"--dsw-alias-markdown-code-segment-selected":u,"--dsw-alias-markdown-code-segment-unselected":l["--dsw-alias-bg-layer-2"],"--dsw-alias-markdown-placeholder":f,"--dsw-alias-markdown-tag":f,"--dsw-alias-markdown-citation":f};Object.assign(l,b);let p=[u,l["--dsw-alias-bg-layer-2"],l["--dsw-alias-bg-overlay"],l["--dsw-specific-sidebar-fill"],f,h],P=Gt[m],S=c?0:255;for(let x of[0,255]){let E=x*(1-P)+S*P;p.push([E,E,E]),p.push(l["--dsw-alias-bg-base"].map(R=>R*n+E*(1-n)))}let T=(x,E,R=4.6)=>{let _=Math.round(E);for(;p.some(G=>pt(j(x.tone(_)),G)<R)&&_>0&&_<100;)_+=c?1:-1;return j(x.tone(_))},C=T(o.primaryPalette,F.fromInt(o.primary).tone),O=j(o.primaryPalette.tone(Math.max(0,Math.min(100,F.fromInt(wt(...C)).tone+(c?7:-7))))),M=[[0,0,0],[255,255,255]].sort((x,E)=>Math.min(pt(E,C),pt(E,O))-Math.min(pt(x,C),pt(x,O)))[0];l["--dsw-alias-brand-primary"]=C,l["--dsw-alias-label-primary"]=T(o.neutralPalette,F.fromInt(o.onSurface).tone),l["--dsw-alias-label-secondary"]=T(o.neutralVariantPalette,F.fromInt(o.onSurfaceVariant).tone);let H=T(o.neutralVariantPalette,c?70:50);for(let x of["--dsw-alias-label-tertiary","--dsw-alias-label-caption","--dsw-alias-label-dimmed"])l[x]=H;for(let x of["--dsw-alias-brand-text","--dsw-alias-brand-primary-new-colorprimary-new-color","--dsw-alias-link"])l[x]=C;for(let x of["--dsw-alias-label-primary-bluish","--dsw-alias-label-primary-dimmed","--dsw-alias-menu-icon"])l[x]=l["--dsw-alias-label-primary"];for(let x of["--dsw-alias-button-primary-fill","--dsw-alias-button-contrast-fill"])l[x]=C;l["--dsw-alias-button-primary-hover"]=O,l["--dsw-alias-button-info-fill"]=j(o.primaryPalette.tone(35)),l["--dsw-alias-button-info-hover"]=j(o.primaryPalette.tone(28));for(let x of["--dsw-alias-label-primary-foreground","--dsw-alias-label-primary-inverted"])l[x]=M;l["--dsw-focus-ring-color"]=C,l["--dsw-alias-border-l2"]=T(o.neutralVariantPalette,c?60:50,3.1);for(let x of["--dsw-alias-border-selected","--dsw-alias-button-ghost-active-border"])l[x]=C;for(let x of["--dsw-alias-border-l3","--dsw-alias-border-l4","--dsw-alias-border-l2-darkmode-thin","--dsw-alias-onboarding-checkbox-border","--dsw-alias-scrollbar-bg-l1","--dsw-alias-scrollbar-bg-l2"])l[x]=l["--dsw-alias-border-l2"];for(let x of["--dsw-alias-scrollbar-hover-l1","--dsw-alias-scrollbar-hover-l2"])l[x]=C;let I=l["--dsw-alias-border-l3"];l["--dsw-alias-switch-thumb"]=pt([0,0,0],I)>pt([255,255,255],I)?[0,0,0]:[255,255,255];let B=j(o.neutralPalette.tone(14)),V=j(o.neutralPalette.tone(98));for(let x of["--dsw-alias-tooltip-bg","--dsw-alias-toast-bg","--dsw-alias-hovercard-bg"])l[x]=B;for(let x of["--dsw-alias-tooltip-label","--dsw-alias-toast-label","--dsw-alias-hovercard-label-primary"])l[x]=V;l["--dsw-alias-tooltip-key-bg"]=d(B,[255,255,255],.18),l["--dsw-alias-toast-action"]=j(o.primaryPalette.tone(80)),l["--dsw-alias-hovercard-label-secondary"]=j(o.neutralPalette.tone(85)),l["--dsw-alias-hovercard-label-tertiary"]=j(o.neutralPalette.tone(78));for(let[x,E]of Object.entries(l))a[x]||={},a[x][m]=x==="--dsw-alias-bg-base"?`rgba(${E.join(", ")}, ${n})`:Xe(E)}return a}function tr(t,e=mt.strength,r=mt.paletteMode){e=qt(e);let a=[92,116,132];t=(Array.isArray(t)||ArrayBuffer.isView(t))&&t.length>=3?a.map((i,o)=>Number.isFinite(t[o])?Math.round(Math.max(0,Math.min(255,t[o]))):i):a;let n=typeof r=="string"&&Object.hasOwn(be,r)?r:mt.paletteMode;return Qe(t,e,n)}var ye="dsh.bing-daily-theme.preferences.v1",ee="dsh.bing-daily-theme.boot.v1",re="bdt-boot-theme";function we(t,e,r){if(!t.enabled||!t.dynamic)return null;let a={background:"--dsw-alias-bg-layer-1",primary:"--dsw-alias-label-primary",secondary:"--dsw-alias-label-secondary",tertiary:"--dsw-alias-label-tertiary",border:"--dsw-alias-border-l2",brand:"--dsw-alias-brand-primary"},n={};for(let i of["light","dark"])n[i]=Object.fromEntries(Object.entries(a).map(([o,c])=>[o,e[c][i]]));return{version:1,market:t.market||"zh-CN",paletteMode:t.paletteMode,strength:t.strength,colors:n,imageUrl:r}}var Ce="body .nUhMVa_confirmPanel{--fold-bg:var(--dsw-alias-bg-layer-2)!important;--fold-border:var(--dsw-alias-border-l2)!important;--fold-ink:var(--dsw-alias-label-primary)!important;--fold-on-ink:var(--dsw-alias-bg-layer-1)!important}",xe='[data-sidebar-right-panel="fullscreen"] :is([data-dockkit-host="dock"] > [data-dockkit-pane], [data-dockkit-empty])',ae="var(--dsw-alias-bg-layer-1)",er=`color-mix(in srgb, ${ae}, var(--dsw-alias-brand-primary, ${ae}) 14%)`;function Pe(t){let e=`${xe}{background-color:${ae}}`;return t?`${e}@supports (background-color:color-mix(in srgb, black, white)){${xe}{background-color:${er}}}`:e}var ne="[data-conversation-composer-overlay]:has([data-trajectory-scroll])",ve=`${ne} [data-trajectory-scroll] > table[data-scroll-ready]`,oe="body :is(.lc-root:not(:is([data-sidebar-right-panel], .lc-modal-card) *), [data-global-panel] .lc-ov-page)",Ae='[data-global-panel] [data-studio-mount] [data-testid="native-template-library"]',ke=`
|
|
3
|
+
${ne},${ne} div:has(> [data-trajectory-scroll]),${Ae}{background-color:transparent}
|
|
4
|
+
${oe}{--lc-canvas:transparent}
|
|
5
|
+
/* One extra light/dark matte for dense ledger text, not one per wrapper.
|
|
6
|
+
Sticky toolbar, timeline, selection and details keep their own fills. */
|
|
7
|
+
${ve}{background-color:color-mix(in srgb,var(--dsw-alias-bg-layer-1) 40%,transparent)}
|
|
8
|
+
`,rr={background:"bg-layer-1",foreground:"label-primary",muted:"bg-layer-2","muted-foreground":"label-secondary",secondary:"interactive-bg-active","secondary-foreground":"label-primary",accent:"interactive-bg-hover","accent-foreground":"label-primary",border:"border-l2",input:"border-l2",ring:"brand-primary",primary:"button-primary-fill","primary-foreground":"label-primary-foreground","action-background":"button-primary-fill","action-hover":"button-primary-hover","action-pressed":"button-primary-hover","action-foreground":"label-primary-foreground","action-pressed-foreground":"label-primary-foreground"},ar=`
|
|
9
|
+
${ve}{--dsw-alias-trajectory-accent:var(--dsw-alias-brand-primary)}
|
|
10
|
+
${oe}{--lc-control-track:var(--dsw-alias-bg-layer-2)}
|
|
11
|
+
${oe} :is(.lc-card:not(.lc-recom), .lc-pulse-header):not(.lc-modal-card *){background-color:color-mix(in srgb,var(--dsw-alias-bg-layer-1),var(--dsw-alias-brand-primary) 7%)}
|
|
12
|
+
${Ae}{${Object.entries(rr).map(([t,e])=>`--${t}:var(--dsw-alias-${e})`).join(";")}}
|
|
13
|
+
`;function Me(t){return t?ke+ar:ke}var nr=Object.freeze({canvas:"--dsw-specific-sidebar-fill",surface:"--dsw-alias-bg-layer-1",raised:"--dsw-alias-bg-layer-2",selected:"--dsw-specific-sidebar-nav-item-active",ink:"--dsw-alias-label-primary",muted:"--dsw-alias-label-secondary",border:"--dsw-alias-border-l2",brand:"--dsw-alias-brand-primary","on-brand":"--dsw-alias-label-primary-foreground",bubble:"--dsw-specific-bubble",code:"--dsw-alias-markdown-code-block",input:"--dsw-specific-input-major"});function Te(t,e){let r=e==="dark"?"dark":"light";return Object.fromEntries(Object.entries(nr).map(([a,n])=>[`--bdt-mini-${a}`,t[n][r]]))}function Ie(t,e){return t("span",{className:"bdt-mini-split","aria-hidden":!0,style:Te(e,"light")},Se(t,e,"light"),Se(t,e,"dark"),t("svg",{className:"bdt-mini-diagonal",viewBox:"0 0 100 100",preserveAspectRatio:"none","aria-hidden":!0,focusable:!1},t("line",{x1:100,y1:0,x2:0,y2:100,vectorEffect:"non-scaling-stroke"})))}function Se(t,e,r){return t("span",{className:`bdt-mini bdt-mini-${r}`,"aria-hidden":!0,style:Te(e,r)},t("span",{className:"bdt-mini-app"},t("span",{className:"bdt-mini-sidebar"},t("span",{className:"bdt-mini-logo"},"DSH"),t("span",{className:"bdt-mini-nav bdt-mini-nav-active"},t("span",{className:"bdt-mini-line"})),t("span",{className:"bdt-mini-nav"},t("span",{className:"bdt-mini-line"})),t("span",{className:"bdt-mini-nav"},t("span",{className:"bdt-mini-line bdt-mini-short"})),t("span",{className:"bdt-mini-sidebar-footer"},t("span",{className:"bdt-mini-line bdt-mini-short"}))),t("span",{className:"bdt-mini-chat"},t("span",{className:"bdt-mini-heading"},t("span",{className:"bdt-mini-line"}),t("span",{className:"bdt-mini-badge"})),t("span",{className:"bdt-mini-bubble"},t("span",{className:"bdt-mini-line"})),t("span",{className:"bdt-mini-reply"},t("span",{className:"bdt-mini-line"}),t("span",{className:"bdt-mini-line bdt-mini-short"}),t("span",{className:"bdt-mini-code"},t("span",{className:"bdt-mini-code-line"}),t("span",{className:"bdt-mini-code-line bdt-mini-short"}))),t("span",{className:"bdt-mini-composer"},t("span",{className:"bdt-mini-line"}),t("span",{className:"bdt-mini-send"},"\u2191")))))}var De=`
|
|
14
|
+
.bdt-mini-split{position:relative;display:block;height:116px;overflow:hidden;border-radius:7px;color:var(--bdt-mini-border);pointer-events:none;user-select:none}
|
|
15
|
+
.bdt-mini-split>.bdt-mini{position:absolute;inset:0}.bdt-mini-light{clip-path:polygon(0 0,100% 0,0 100%)}.bdt-mini-dark{clip-path:polygon(100% 0,100% 100%,0 100%)}
|
|
16
|
+
.bdt-mini-diagonal{position:absolute;inset:0;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.5}
|
|
17
|
+
.bdt-mini{display:block;border-radius:8px;color:var(--bdt-mini-ink);font-size:9px;line-height:1.2;user-select:none;pointer-events:none}
|
|
18
|
+
.bdt-mini-app{display:grid;grid-template-columns:29% minmax(0,1fr);height:116px;overflow:hidden;border:1px solid var(--bdt-mini-border);border-radius:7px;background:var(--bdt-mini-surface)}
|
|
19
|
+
.bdt-mini-sidebar{display:flex;flex-direction:column;gap:5px;min-width:0;padding:7px 5px;background:var(--bdt-mini-canvas);border-inline-end:1px solid var(--bdt-mini-border)}
|
|
20
|
+
.bdt-mini-logo{display:block;padding:0 3px 3px;font-weight:700;font-size:9px;letter-spacing:.3px}
|
|
21
|
+
.bdt-mini-nav{display:flex;align-items:center;min-height:12px;padding:4px;border-radius:3px;color:var(--bdt-mini-muted)}.bdt-mini-nav-active{background:var(--bdt-mini-selected);color:var(--bdt-mini-brand)}.bdt-mini-sidebar-footer{display:block;margin-top:auto;padding:4px;color:var(--bdt-mini-muted)}
|
|
22
|
+
.bdt-mini-line{display:block;width:85%;height:3px;flex-shrink:1;border-radius:2px;background:currentColor}.bdt-mini-short{width:58%}
|
|
23
|
+
.bdt-mini-chat{display:flex;flex-direction:column;gap:6px;min-width:0;padding:7px}
|
|
24
|
+
.bdt-mini-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--bdt-mini-muted)}.bdt-mini-heading>.bdt-mini-line{width:52%}.bdt-mini-badge{display:block;width:13px;height:6px;border-radius:3px;background:var(--bdt-mini-raised)}
|
|
25
|
+
.bdt-mini-bubble{display:block;align-self:flex-end;width:75%;padding:5px 6px;border-radius:5px;background:var(--bdt-mini-bubble)}
|
|
26
|
+
.bdt-mini-reply{display:flex;flex-direction:column;gap:4px;min-width:0}.bdt-mini-code{display:flex;flex-direction:column;gap:3px;padding:5px 6px;border-radius:4px;background:var(--bdt-mini-code)}.bdt-mini-code-line{display:block;width:80%;height:2px;border-radius:2px;background:var(--bdt-mini-muted)}.bdt-mini-code-line.bdt-mini-short{width:54%}
|
|
27
|
+
.bdt-mini-composer{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:22px;margin-top:auto;padding:3px 4px 3px 6px;border:1px solid var(--bdt-mini-border);border-radius:5px;background:var(--bdt-mini-input);color:var(--bdt-mini-muted)}.bdt-mini-composer>.bdt-mini-line{width:48%}.bdt-mini-send{display:flex;align-items:center;justify-content:center;flex:0 0 14px;height:14px;border-radius:4px;background:var(--bdt-mini-brand);color:var(--bdt-mini-on-brand);font-size:11px;font-weight:600}
|
|
28
|
+
`;function Fe(t,e,r,a){let n=t.createElement,i="bing-daily-theme",o="@nzlov/dsh-bing-wallpaper",c=ye;return{inject:["slots","theme","locale"],apply(m){m.effect(()=>m.locale.register(i,"en",r.en)),m.effect(()=>m.locale.register(i,"zh",r.zh));let l=m.locale.bind(i),d;try{d=e.normalizeSettings(JSON.parse(localStorage.getItem(c)||"{}"))}catch{d=e.normalizeSettings()}let u={settings:d,busy:!1,issue:"",meta:null,url:"",accent:[92,116,132],scheme:m.theme.getTheme().active.colorScheme,storageIssue:!1},f=new Set,h=y=>{u={...u,...y},f.forEach(g=>g())},b=y=>(f.add(y),()=>f.delete(y)),p=()=>t.useSyncExternalStore(b,()=>u),P=!0,S,T,C="",O=a(m.theme,()=>{d={...d,mode:"follow"},B(),h({settings:d})},e.scheduledScheme),M=0,H="",I=0;function B(){try{localStorage.setItem(c,JSON.stringify(d)),h({storageIssue:!1})}catch{h({storageIssue:!0})}}function V(){O.restore()}function x(){O.sync(d)}function E(){if(!d.enabled||!d.dynamic||u.meta&&u.meta.market!==d.market)try{localStorage.removeItem(ee)}catch{}if(!d.enabled||!u.url){S?.(),S=void 0;return}let y=e.makeTokens(d.dynamic?u.accent:[112,112,112],d.strength,d.dynamic?d.paletteMode:"monochrome");if(!d.dynamic)for(let D of Object.keys(y))D!=="--dsw-alias-bg-base"&&delete y[D];let g=S;if(S=m.theme.overrideTokens(o,y),g?.(),d.dynamic&&u.meta?.market===d.market)try{localStorage.setItem(ee,JSON.stringify(we(d,y,u.meta?.imageUrl)))}catch{}}function R(y){let g=e.normalizeSettings({...d,...y}),D=Object.keys(g).every(N=>N==="filterMode"||N==="filterAmounts"||g[N]===d[N]);if(!D&&g.day===g.night){h({issue:"sameTime"});return}if(JSON.stringify(g)===JSON.stringify(d))return;if(D){d=g,B(),h({settings:d});return}let U=d.enabled,q=g.market!==d.market;q&&(I++,T?.abort(),M=0,H="",h({busy:!1})),(g.mode!==d.mode||!g.enabled)&&V(),d=g,B(),h({settings:d,issue:""}),E(),x(),d.enabled?(!U||q)&&G():(I++,T?.abort(),h({busy:!1}))}async function _(y,g){let D=URL.createObjectURL(y),U=new Image,q;try{if(g.throwIfAborted(),U.src=D,await Promise.race([U.decode(),new Promise((st,et)=>{q=()=>et(new DOMException("Aborted","AbortError")),g.addEventListener("abort",q,{once:!0})})]),g.aborted)throw new DOMException("Aborted","AbortError");let N=document.createElement("canvas");N.width=64,N.height=64;let Q=N.getContext("2d",{willReadFrequently:!0});if(!Q)throw new Error("Canvas unavailable");Q.drawImage(U,0,0,64,64);let K=e.extractAccent(Q.getImageData(0,0,64,64).data);return{url:D,accent:K}}catch(N){throw URL.revokeObjectURL(D),N}finally{q&&g.removeEventListener("abort",q)}}async function G(){if(!P||!d.enabled||u.busy)return;let y=++I,g=d.market,D=new AbortController;T=D;let U=D.signal,q=setTimeout(()=>D.abort(),3e4);h({busy:!0,issue:""}),M=Date.now();let N;try{let Q=await fetch(`/bing-daily-theme/api/daily?market=${g}`,{signal:U,credentials:"same-origin",cache:"no-store"});if(!Q.ok)throw new Error(`Metadata HTTP ${Q.status}`);let K=await Q.json(),st=g==="en-US"?/^\/bing-daily-theme\/api\/image\?market=en-US&id=OHR\.[A-Za-z0-9][A-Za-z0-9_-]*_1920x1080\.jpg$/:/^\/bing-daily-theme\/api\/image\?id=OHR\.[A-Za-z0-9][A-Za-z0-9_-]*_1920x1080\.jpg$/;if(K.market!==g||typeof K.imageUrl!="string"||K.imageUrl.length>300||!st.test(K.imageUrl))throw new Error("Invalid wallpaper source or URL");if(!u.meta||K.imageUrl!==u.meta.imageUrl||!u.url){let ft=await fetch(K.imageUrl,{signal:U,credentials:"same-origin"});if(!ft.ok)throw new Error(`Image HTTP ${ft.status}`);let Et=await ft.blob();if(Et.size>12*1024*1024||!Et.type.startsWith("image/"))throw new Error("Invalid wallpaper image");N=await _(Et,U)}if(!P||y!==I){N&&URL.revokeObjectURL(N.url);return}let et=C;N&&(C=N.url),h({meta:K,...N||{},issue:K.stale?"stale":""}),E(),et&&et!==C&&URL.revokeObjectURL(et),H=e.localDate()}catch{P&&y===I&&h({issue:u.url?u.meta?.market!==g?"sourceFailed":"fetchFailed":"firstFetchFailed"})}finally{clearTimeout(q),P&&y===I&&h({busy:!1})}}function ut(){x(),d.enabled&&(e.localDate()!==H||u.meta?.market!==d.market||["fetchFailed","firstFetchFailed","sourceFailed","stale"].includes(u.issue)||Date.now()-M>=36e5)&&Date.now()-M>=6e4&&G()}m.on("theme/change",y=>{h({scheme:y.active.colorScheme}),O.changed(y)});function Ct(){t.useSyncExternalStore(y=>m.locale.subscribe(y),()=>m.locale.getSnapshot())}let ot=`
|
|
29
|
+
.bdt-page{max-width:720px;padding:24px;color:var(--dsw-alias-label-primary);font-size:14px;line-height:1.6}
|
|
30
|
+
.bdt-page h2{font-size:20px;margin:0 0 16px;font-weight:600}.bdt-page p{margin:6px 0 18px;color:var(--dsw-alias-label-secondary)}
|
|
31
|
+
.bdt-photo{position:relative;margin:0;overflow:hidden;border-radius:12px;background:var(--dsw-alias-bg-layer-2)}.bdt-preview{position:relative;overflow:hidden;width:100%;aspect-ratio:16/9;min-height:240px;background:var(--dsw-alias-bg-layer-2)}
|
|
32
|
+
.bdt-preview-image,.bdt-preview-tint{position:absolute;inset:0;width:100%;height:100%}.bdt-preview-image{display:block;object-fit:cover;max-width:none}.bdt-preview-tint{pointer-events:none}
|
|
33
|
+
.bdt-card{padding:16px;border:1px solid var(--dsw-alias-border-l1);border-radius:12px;background:var(--dsw-alias-bg-layer-1);margin:16px 0}
|
|
34
|
+
.bdt-row{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:12px 0;flex-wrap:wrap}.bdt-row+ .bdt-row{border-top:1px solid var(--dsw-alias-border-l1)}
|
|
35
|
+
.bdt-control{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.bdt-page select,.bdt-page input[type=time],.bdt-page button{font:inherit;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:8px;padding:7px 10px;min-height:36px;max-width:100%}
|
|
36
|
+
.bdt-page button{cursor:pointer}.bdt-page button:disabled{cursor:wait;opacity:.55}.bdt-page :focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:3px}.bdt-page input{accent-color:var(--dsw-alias-brand-primary)}
|
|
37
|
+
.bdt-page .bdt-wallpaper-select{box-sizing:border-box;width:12rem;min-height:44px}.bdt-filter-range{min-width:0;min-height:44px}
|
|
38
|
+
.bdt-page a{color:var(--dsw-alias-brand-primary)}.bdt-muted{color:var(--dsw-alias-label-secondary);font-size:12px}.bdt-swatches{display:flex;gap:8px;margin-top:10px}.bdt-swatch{width:24px;height:24px;border-radius:50%;border:1px solid var(--dsw-alias-border-l2)}
|
|
39
|
+
.bdt-photo-caption{position:absolute;inset:auto 0 0;max-height:calc(100% - 64px);overflow:auto;padding:30px 16px 14px;color:var(--dsw-alias-tooltip-label);background:linear-gradient(to bottom,transparent,color-mix(in srgb,var(--dsw-alias-tooltip-bg) 82%,transparent) 26px,color-mix(in srgb,var(--dsw-alias-tooltip-bg) 90%,transparent));font-size:12px;line-height:1.5;overflow-wrap:anywhere}
|
|
40
|
+
.bdt-photo-heading{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 10px}.bdt-photo-heading strong{min-width:0;font-size:14px}.bdt-photo-date{white-space:nowrap}.bdt-photo-details{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:5px}.bdt-page .bdt-photo-caption a{min-width:0;color:inherit;text-underline-offset:2px}.bdt-photo-caption .bdt-swatches{flex-shrink:0;margin:0;gap:6px}.bdt-photo-caption .bdt-swatch{width:20px;height:20px;border-color:color-mix(in srgb,var(--dsw-alias-tooltip-label) 55%,transparent)}
|
|
41
|
+
.bdt-page .bdt-photo-refresh{position:absolute;top:12px;inset-inline-end:12px;display:flex;align-items:center;justify-content:center;width:44px;height:44px;min-height:44px;padding:0;border-radius:50%;border:1px solid color-mix(in srgb,var(--dsw-alias-tooltip-label) 55%,transparent);background:color-mix(in srgb,var(--dsw-alias-tooltip-bg) 86%,transparent);color:var(--dsw-alias-tooltip-label)}.bdt-photo-refresh svg{width:20px;height:20px}.bdt-page .bdt-photo-refresh:disabled{cursor:not-allowed}.bdt-page .bdt-photo-refresh[aria-busy=true]{cursor:wait}.bdt-page .bdt-photo-refresh:focus-visible{outline-color:var(--dsw-alias-tooltip-label);box-shadow:0 0 0 5px var(--dsw-alias-tooltip-bg)}.bdt-photo-refresh[aria-busy=true] svg{animation:bdt-refresh-spin 1s linear infinite}.bdt-photo-status{display:block;margin:8px 0 0;color:var(--dsw-alias-label-secondary);font-size:12px}
|
|
42
|
+
@keyframes bdt-refresh-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.bdt-photo-refresh[aria-busy=true] svg{animation:none}}
|
|
43
|
+
.bdt-palette-group{min-width:0;padding:12px 0;margin:0;border:0}.bdt-palette-group legend{padding:0;font:inherit}.bdt-palette-group+.bdt-row{border-top:1px solid var(--dsw-alias-border-l1)}
|
|
44
|
+
.bdt-palette-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr));gap:12px;margin-top:12px}
|
|
45
|
+
.bdt-palette-option{display:block;position:relative;min-width:0}.bdt-palette-choice{position:absolute;inset-inline-start:12px;top:12px;width:1px;height:1px;opacity:0;margin:0}
|
|
46
|
+
.bdt-palette-card{display:flex;flex-direction:column;gap:9px;height:100%;padding:8px;border:1px solid var(--dsw-alias-border-l2);border-radius:10px;background:var(--dsw-alias-bg-layer-1);cursor:pointer}
|
|
47
|
+
.bdt-palette-choice:enabled+.bdt-palette-card:hover{border-color:var(--dsw-alias-brand-primary)}.bdt-palette-choice:checked+.bdt-palette-card{border-color:var(--dsw-alias-brand-primary);box-shadow:0 0 0 1px var(--dsw-alias-brand-primary)}.bdt-palette-choice:focus-visible+.bdt-palette-card{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:4px}
|
|
48
|
+
.bdt-palette-caption{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:24px}.bdt-palette-name{min-width:0;overflow-wrap:anywhere;line-height:1.4}.bdt-palette-check{display:flex;align-items:center;justify-content:center;flex:0 0 18px;height:18px;border-radius:50%;font-size:12px;visibility:hidden;background:var(--dsw-alias-brand-primary);color:var(--dsw-alias-label-primary-foreground)}.bdt-palette-choice:checked+.bdt-palette-card .bdt-palette-check{visibility:visible}
|
|
49
|
+
.bdt-palette-group:disabled .bdt-palette-card{cursor:not-allowed}.bdt-palette-group:disabled .bdt-palette-name{color:var(--dsw-alias-label-secondary)}
|
|
50
|
+
.bdt-palette-group,.bdt-palette-card,.bdt-mini,.bdt-mini *{box-sizing:border-box}
|
|
51
|
+
${De}
|
|
52
|
+
@media(max-width:560px){.bdt-page{padding:16px}.bdt-row{gap:8px}.bdt-row>label{width:100%}.bdt-row:has(.bdt-wallpaper-select,.bdt-filter-range)>.bdt-control,.bdt-page .bdt-wallpaper-select{width:100%}.bdt-filter-range{flex:1}}`;function Pt(){t.useEffect(()=>{document.getElementById(re)?.remove()},[]);let y=p();if(!y.settings.enabled||!y.url)return null;let g=e.wallpaperShade(y.scheme),D=`url(${JSON.stringify(y.url)})`,U=dt.css({selector:"html",image:D,overlays:[g],settings:y.settings,fixed:!0});return n("style",null,`html{background-image:linear-gradient(${g},${g}),${D};background-size:cover;background-position:center;background-attachment:fixed}body{background-color:transparent!important}${U}${Pe(y.settings.dynamic)}${y.settings.dynamic?Ce:""}${Me(y.settings.dynamic)}`)}function Bt(){Ct();let y=p(),g=y.settings,D=(A,gt,Oe)=>n("div",{className:"bdt-row"},n("label",{htmlFor:`bdt-${A}`},l(A)),n("div",{className:"bdt-control"},gt,Oe)),U=A=>n("input",{id:`bdt-${A}`,type:"checkbox",checked:g[A],onChange:gt=>R({[A]:gt.target.checked})}),q=dt.options[g.filterMode],N=g.filterAmounts[g.filterMode],Q=`filterAmount.${g.filterMode}`,K=`bdt-${Q}`,st=g.enabled?dt.effect(g):null,et=st?.bleed??0,ft=t.useMemo(()=>e.makeTokens(g.dynamic?y.accent:[112,112,112],g.strength,g.dynamic?g.paletteMode:"monochrome"),[y.accent,g.strength,g.paletteMode,g.dynamic]),Et=t.useMemo(()=>e.PALETTE_MODES.map(A=>({mode:A,tokens:e.makeTokens(y.accent,g.strength,A)})),[y.accent,g.strength]),Wt=t.useId(),Ee=typeof y.meta?.copyrightUrl=="string"&&/^https:\/\/(?:www|cn)\.bing\.com\//.test(y.meta.copyrightUrl)?y.meta.copyrightUrl:"https://www.bing.com/";return n("section",{className:"bdt-page","aria-label":l("title")},n("style",null,ot),n("h2",null,l("title")),n("figure",{className:"bdt-photo"},y.url?n("div",{className:"bdt-preview"},n("img",{className:"bdt-preview-image",src:y.url,alt:y.meta?.title||l("preview"),style:{filter:st?.filter,...et?{inset:-et,width:`calc(100% + ${et*2}px)`,height:`calc(100% + ${et*2}px)`}:{}}}),st?.tint&&n("span",{className:"bdt-preview-tint","aria-hidden":!0,style:{backgroundColor:st.tint}})):n("div",{className:"bdt-preview",role:"img","aria-label":l("preview")}),y.meta&&n("figcaption",{className:"bdt-photo-caption"},n("div",{className:"bdt-photo-heading"},n("strong",null,y.meta.title||l("preview")),n("span",{className:"bdt-photo-date"},`${y.meta.date} \xB7 ${l(`market.${y.meta.market}`)}`)),n("div",{className:"bdt-photo-details"},n("a",{href:Ee,target:"_blank",rel:"noopener noreferrer"},y.meta.copyright||l("source")),g.dynamic&&n("div",{className:"bdt-swatches","aria-label":l("palette")},...["light","dark"].map(A=>n("span",{key:A,className:"bdt-swatch",title:l(A),style:{backgroundColor:ft["--dsw-alias-brand-primary"][A]}}))))),n("button",{className:"bdt-photo-refresh",type:"button",disabled:y.busy||!g.enabled,"aria-label":l("refresh"),title:l("refresh"),"aria-busy":y.busy,onClick:()=>{G()}},n("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,focusable:!1},n("path",{d:"M3 12a9 9 0 0 1 15.36-6.36L21 8M21 3v5h-5M21 12a9 9 0 0 1-15.36 6.36L3 16M8 16H3v5"})))),n("span",{className:"bdt-photo-status",role:"status","aria-live":"polite"},g.enabled?y.busy?l("loading"):y.issue?l(y.issue):l(y.meta?y.meta.market===g.market?"ready":"sourceFailed":"waiting"):l("paused")),n("div",{className:"bdt-card"},D("enabled",U("enabled")),D("market",n("select",{id:"bdt-market",value:g.market,onChange:A=>R({market:A.target.value}),className:"bdt-wallpaper-select"},...["zh-CN","en-US"].map(A=>n("option",{key:A,value:A},l(`market.${A}`))))),D("filterMode",n("select",{id:"bdt-filterMode",className:"bdt-wallpaper-select",value:g.filterMode,disabled:!g.enabled,onChange:A=>R({filterMode:A.target.value})},...dt.modes.map(A=>n("option",{key:A,value:A},l(`filter.${A}`))))),q&&D(Q,n("input",{id:K,className:"bdt-filter-range",type:"range",min:0,max:q.max,step:1,value:N,disabled:!g.enabled,"aria-valuetext":q.unit==="px"?`${N} ${l("filterPixels")}`:`${N}%`,onChange:A=>R({filterAmounts:{...g.filterAmounts,[g.filterMode]:Number(A.target.value)}})}),n("output",{htmlFor:K},`${N}${q.unit}`)),D("dynamic",U("dynamic")),n("fieldset",{className:"bdt-palette-group",disabled:!g.dynamic},n("legend",null,l("paletteMode")),n("div",{className:"bdt-palette-grid"},...Et.map(({mode:A,tokens:gt})=>n("label",{key:A,className:"bdt-palette-option",htmlFor:`${Wt}-${A}`},n("input",{id:`${Wt}-${A}`,className:"bdt-palette-choice",type:"radio",name:Wt,value:A,checked:g.paletteMode===A,onChange:()=>R({paletteMode:A})}),n("span",{className:"bdt-palette-card"},Ie(n,gt),n("span",{className:"bdt-palette-caption"},n("span",{className:"bdt-palette-name"},l(`palette.${A}`)),n("span",{className:"bdt-palette-check","aria-hidden":!0},"\u2713"))))))),D("mode",n("select",{id:"bdt-mode",value:g.mode,onChange:A=>R({mode:A.target.value})},...["schedule","system","follow","light","dark"].map(A=>n("option",{key:A,value:A},l(A))))),g.mode==="schedule"&&n("div",null,...["day","night"].map(A=>D(A,n("input",{id:`bdt-${A}`,type:"time",value:g[A],onChange:gt=>R({[A]:gt.target.value})})))),D("strength",n("input",{id:"bdt-strength",type:"range",min:10,max:100,step:1,value:g.strength,"aria-valuetext":`${g.strength}%`,onChange:A=>R({strength:Number(A.target.value)})}),n("output",{htmlFor:"bdt-strength"},`${g.strength}%`))),y.storageIssue&&n("p",{role:"status"},l("storageFailed")))}m.slots.inject("shell.overlay",()=>m.slots.register({name:"shell.overlay",id:"bing-daily-theme.wallpaper",order:-100},Pt)),m.effect(()=>{let y=()=>m.slots.inject("settings.section",()=>m.slots.register({name:"settings.section",id:"bing-daily-theme",order:25,label:()=>l("title")},Bt)),g=y(),D=m.locale.subscribe(()=>{g(),g=y()});return()=>{D(),g()}}),m.effect(()=>{let y=setInterval(ut,6e4),g=()=>{document.visibilityState==="visible"&&ut()},D=()=>{M=0,ut()},U=q=>{if(q.key===c)try{R(e.normalizeSettings(JSON.parse(q.newValue||"{}")))}catch{}};return document.addEventListener("visibilitychange",g),window.addEventListener("online",D),window.addEventListener("storage",U),x(),G(),()=>{P=!1,I++,clearInterval(y),T?.abort(),document.removeEventListener("visibilitychange",g),window.removeEventListener("online",D),window.removeEventListener("storage",U),document.getElementById(re)?.remove(),S?.(),V(),C&&URL.revokeObjectURL(C),f.clear()}})}}}function Be(t,e,r){let a=t.getTheme().preference,n="",i=!1;function o(){if(n&&t.getTheme().preference===n){i=!0;try{t.setTheme(a)}finally{i=!1}}n=""}return{restore:o,sync(c,m=new Date){if(!c.enabled||c.mode==="follow"){o();return}let l=c.mode==="schedule"?r(m,c.day,c.night):c.mode;if(l){n||(a=t.getTheme().preference),i=!0;try{t.getTheme().preference!==l&&t.setTheme(l),n=l}finally{i=!1}}},changed(c){!i&&n&&c.preference!==n&&(n="",e())}}}window.__ModuleLoader__.load({id:"@nzlov/dsh-bing-wallpaper",factory(t){return Fe(t("react"),te,{en:{title:"Bing daily wallpaper",paletteMode:"Colour mode","palette.content":"M3 Content","palette.tonal-spot":"M3 Tonal Spot","palette.fruit-salad":"M3 Fruit Salad","palette.rainbow":"M3 Rainbow","palette.monochrome":"M3 Monochrome","palette.vibrant":"Vibrant","palette.faithful":"Faithful","palette.soft":"Soft","palette.dysfunctional":"Dysfunctional","palette.muted":"Muted",enabled:"Wallpaper enabled",dynamic:"Extract theme colours",market:"Wallpaper source","market.zh-CN":"China","market.en-US":"International (US)",sourceFailed:"Could not switch sources. The previous source\u2019s wallpaper is still shown; check your connection and retry.",mode:"Day/night mode",schedule:"Local time schedule",system:"Follow system",follow:"Follow DSH appearance",light:"Light",dark:"Dark",day:"Light from",night:"Dark from",strength:"Wallpaper visibility",filterMode:"Background filter",filterPixels:"pixels","filter.none":"None","filter.blur":"Blur","filter.frosted":"Frosted glass","filter.blue":"Blue tint","filter.grayscale":"Grayscale","filter.dim":"Dim","filterAmount.blur":"Blur radius","filterAmount.frosted":"Frosted glass radius","filterAmount.blue":"Blue tint intensity","filterAmount.grayscale":"Grayscale intensity","filterAmount.dim":"Dimming intensity",refresh:"Check for updates",loading:"Updating\u2026",ready:"Wallpaper is up to date",waiting:"Wallpaper paused or not yet loaded",preview:"Daily wallpaper preview",palette:"Light and dark accent colours",source:"View on Bing",paused:"Wallpaper and dynamic theme are paused",firstFetchFailed:"Wallpaper could not be loaded. Check your connection and retry.",fetchFailed:"Update failed. The previous wallpaper is kept; check your connection and retry.",stale:"Bing is unavailable. Showing the last successful wallpaper.",sameTime:"Light and dark times must be different.",storageFailed:"These controls could not be saved in this browser."},zh:{title:"Bing \u6BCF\u65E5\u58C1\u7EB8",paletteMode:"\u53D6\u8272\u6A21\u5F0F","palette.content":"M3 Content","palette.tonal-spot":"M3 Tonal Spot","palette.fruit-salad":"M3 Fruit Salad","palette.rainbow":"M3 Rainbow","palette.monochrome":"M3 Monochrome","palette.vibrant":"Vibrant","palette.faithful":"Faithful","palette.soft":"Soft","palette.dysfunctional":"Dysfunctional","palette.muted":"Muted",enabled:"\u542F\u7528\u58C1\u7EB8",dynamic:"\u4ECE\u58C1\u7EB8\u63D0\u53D6\u4E3B\u9898\u8272",market:"\u58C1\u7EB8\u6765\u6E90","market.zh-CN":"\u56FD\u5185\uFF08\u4E2D\u56FD\uFF09","market.en-US":"\u56FD\u9645\uFF08\u7F8E\u56FD\uFF09",sourceFailed:"\u5207\u6362\u6765\u6E90\u5931\u8D25\uFF0C\u4ECD\u663E\u793A\u4E0A\u4E00\u6765\u6E90\u7684\u58C1\u7EB8\uFF1B\u8BF7\u68C0\u67E5\u7F51\u7EDC\u540E\u91CD\u8BD5\u3002",mode:"\u65E5\u591C\u5207\u6362\u65B9\u5F0F",schedule:"\u6309\u672C\u5730\u65F6\u95F4\u5207\u6362",system:"\u8DDF\u968F\u7CFB\u7EDF",follow:"\u8DDF\u968F DSH \u5916\u89C2",light:"\u6D45\u8272",dark:"\u6DF1\u8272",day:"\u6D45\u8272\u5F00\u59CB\u65F6\u95F4",night:"\u6DF1\u8272\u5F00\u59CB\u65F6\u95F4",strength:"\u58C1\u7EB8\u53EF\u89C1\u5EA6",filterMode:"\u80CC\u666F\u6EE4\u955C",filterPixels:"\u50CF\u7D20","filter.none":"\u65E0","filter.blur":"\u6A21\u7CCA\uFF08Blur\uFF09","filter.frosted":"\u6BDB\u73BB\u7483","filter.blue":"\u84DD\u8272\u8C03","filter.grayscale":"\u9ED1\u767D","filter.dim":"\u538B\u6697","filterAmount.blur":"\u6A21\u7CCA\u534A\u5F84","filterAmount.frosted":"\u6BDB\u73BB\u7483\u534A\u5F84","filterAmount.blue":"\u84DD\u8272\u8C03\u5F3A\u5EA6","filterAmount.grayscale":"\u9ED1\u767D\u5F3A\u5EA6","filterAmount.dim":"\u538B\u6697\u5F3A\u5EA6",refresh:"\u68C0\u67E5\u66F4\u65B0",loading:"\u6B63\u5728\u66F4\u65B0\u2026",ready:"\u58C1\u7EB8\u5DF2\u66F4\u65B0",waiting:"\u58C1\u7EB8\u5DF2\u6682\u505C\u6216\u5C1A\u672A\u52A0\u8F7D",preview:"\u6BCF\u65E5\u58C1\u7EB8\u9884\u89C8",palette:"\u6D45\u8272\u4E0E\u6DF1\u8272\u4E3B\u9898\u7684\u5F3A\u8C03\u8272",source:"\u5728 Bing \u67E5\u770B",paused:"\u58C1\u7EB8\u548C\u52A8\u6001\u4E3B\u9898\u5DF2\u6682\u505C",firstFetchFailed:"\u6682\u65F6\u65E0\u6CD5\u83B7\u53D6\u58C1\u7EB8\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u540E\u91CD\u8BD5\u3002",fetchFailed:"\u66F4\u65B0\u5931\u8D25\uFF0C\u5DF2\u4FDD\u7559\u4E0A\u4E00\u5F20\u58C1\u7EB8\uFF1B\u8BF7\u68C0\u67E5\u7F51\u7EDC\u540E\u91CD\u8BD5\u3002",stale:"Bing \u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u6B63\u5728\u663E\u793A\u4E0A\u6B21\u6210\u529F\u83B7\u53D6\u7684\u58C1\u7EB8\u3002",sameTime:"\u65E5\u95F4\u548C\u591C\u95F4\u7684\u5F00\u59CB\u65F6\u95F4\u4E0D\u80FD\u76F8\u540C\u3002",storageFailed:"\u65E0\u6CD5\u5728\u6B64\u6D4F\u89C8\u5668\u4FDD\u5B58\u8FD9\u4E9B\u63A7\u5236\u9879\u3002"}},Be)}});})();
|
|
53
|
+
/*! Bundled license information:
|
|
54
|
+
|
|
55
|
+
@material/material-color-utilities/utils/math_utils.js:
|
|
56
|
+
@material/material-color-utilities/utils/color_utils.js:
|
|
57
|
+
@material/material-color-utilities/hct/viewing_conditions.js:
|
|
58
|
+
@material/material-color-utilities/hct/cam16.js:
|
|
59
|
+
@material/material-color-utilities/hct/hct_solver.js:
|
|
60
|
+
@material/material-color-utilities/hct/hct.js:
|
|
61
|
+
@material/material-color-utilities/blend/blend.js:
|
|
62
|
+
@material/material-color-utilities/palettes/tonal_palette.js:
|
|
63
|
+
@material/material-color-utilities/palettes/core_palette.js:
|
|
64
|
+
@material/material-color-utilities/quantize/lab_point_provider.js:
|
|
65
|
+
@material/material-color-utilities/quantize/quantizer_wsmeans.js:
|
|
66
|
+
@material/material-color-utilities/quantize/quantizer_map.js:
|
|
67
|
+
@material/material-color-utilities/quantize/quantizer_wu.js:
|
|
68
|
+
@material/material-color-utilities/quantize/quantizer_celebi.js:
|
|
69
|
+
@material/material-color-utilities/scheme/scheme.js:
|
|
70
|
+
@material/material-color-utilities/scheme/scheme_android.js:
|
|
71
|
+
@material/material-color-utilities/score/score.js:
|
|
72
|
+
@material/material-color-utilities/utils/string_utils.js:
|
|
73
|
+
@material/material-color-utilities/utils/image_utils.js:
|
|
74
|
+
@material/material-color-utilities/utils/theme_utils.js:
|
|
75
|
+
@material/material-color-utilities/index.js:
|
|
76
|
+
(**
|
|
77
|
+
* @license
|
|
78
|
+
* Copyright 2021 Google LLC
|
|
79
|
+
*
|
|
80
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
81
|
+
* you may not use this file except in compliance with the License.
|
|
82
|
+
* You may obtain a copy of the License at
|
|
83
|
+
*
|
|
84
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
85
|
+
*
|
|
86
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
87
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
88
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
89
|
+
* See the License for the specific language governing permissions and
|
|
90
|
+
* limitations under the License.
|
|
91
|
+
*)
|
|
92
|
+
|
|
93
|
+
@material/material-color-utilities/contrast/contrast.js:
|
|
94
|
+
@material/material-color-utilities/dynamiccolor/dynamic_color.js:
|
|
95
|
+
@material/material-color-utilities/dynamiccolor/variant.js:
|
|
96
|
+
@material/material-color-utilities/dynamiccolor/material_dynamic_colors.js:
|
|
97
|
+
@material/material-color-utilities/dynamiccolor/dynamic_scheme.js:
|
|
98
|
+
@material/material-color-utilities/scheme/scheme_expressive.js:
|
|
99
|
+
@material/material-color-utilities/scheme/scheme_fruit_salad.js:
|
|
100
|
+
@material/material-color-utilities/scheme/scheme_monochrome.js:
|
|
101
|
+
@material/material-color-utilities/scheme/scheme_neutral.js:
|
|
102
|
+
@material/material-color-utilities/scheme/scheme_rainbow.js:
|
|
103
|
+
@material/material-color-utilities/scheme/scheme_tonal_spot.js:
|
|
104
|
+
@material/material-color-utilities/scheme/scheme_vibrant.js:
|
|
105
|
+
(**
|
|
106
|
+
* @license
|
|
107
|
+
* Copyright 2022 Google LLC
|
|
108
|
+
*
|
|
109
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
110
|
+
* you may not use this file except in compliance with the License.
|
|
111
|
+
* You may obtain a copy of the License at
|
|
112
|
+
*
|
|
113
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
114
|
+
*
|
|
115
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
116
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
117
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
118
|
+
* See the License for the specific language governing permissions and
|
|
119
|
+
* limitations under the License.
|
|
120
|
+
*)
|
|
121
|
+
|
|
122
|
+
@material/material-color-utilities/dislike/dislike_analyzer.js:
|
|
123
|
+
@material/material-color-utilities/dynamiccolor/contrast_curve.js:
|
|
124
|
+
@material/material-color-utilities/dynamiccolor/tone_delta_pair.js:
|
|
125
|
+
@material/material-color-utilities/temperature/temperature_cache.js:
|
|
126
|
+
@material/material-color-utilities/scheme/scheme_content.js:
|
|
127
|
+
@material/material-color-utilities/scheme/scheme_fidelity.js:
|
|
128
|
+
(**
|
|
129
|
+
* @license
|
|
130
|
+
* Copyright 2023 Google LLC
|
|
131
|
+
*
|
|
132
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
133
|
+
* you may not use this file except in compliance with the License.
|
|
134
|
+
* You may obtain a copy of the License at
|
|
135
|
+
*
|
|
136
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
137
|
+
*
|
|
138
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
139
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
140
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
141
|
+
* See the License for the specific language governing permissions and
|
|
142
|
+
* limitations under the License.
|
|
143
|
+
*)
|
|
144
|
+
*/
|
package/cordis.patch.yml
ADDED
package/icon.svg
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36" fill="none">
|
|
2
|
+
<circle cx="23.5" cy="11.5" r="4" fill="#C9A05B"/>
|
|
3
|
+
<path d="M5 26L14 12L23 26H5Z" fill="#5D8A8E"/>
|
|
4
|
+
<path d="M14 26L22 17L31 26H14Z" fill="#465F82"/>
|
|
5
|
+
<path d="M11.4 16L14 12L16.6 16L14 15L11.4 16Z" fill="#B9CDD0"/>
|
|
6
|
+
</svg>
|
package/index.js
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { createBingSource, DAILY_PATH, IMAGE_PATH, MARKET, isBingImageId, isBingMarket } from './bing-source.js'
|
|
2
|
+
import { bootThemeInjection } from './boot-theme.js'
|
|
3
|
+
|
|
4
|
+
// The carrier does not authenticate named routes. Connection is a real dependency.
|
|
5
|
+
export const inject = ['webServer', 'connection']
|
|
6
|
+
|
|
7
|
+
function response(request, status, value, extraHeaders = {}) {
|
|
8
|
+
const body = JSON.stringify(value)
|
|
9
|
+
return new Response(request.method === 'HEAD' ? null : body, {
|
|
10
|
+
status,
|
|
11
|
+
headers: {
|
|
12
|
+
'content-type': 'application/json; charset=utf-8',
|
|
13
|
+
'cache-control': 'private, no-store',
|
|
14
|
+
'x-content-type-options': 'nosniff',
|
|
15
|
+
'cross-origin-resource-policy': 'same-origin',
|
|
16
|
+
...extraHeaders,
|
|
17
|
+
},
|
|
18
|
+
})
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function waitFor(promise, signal) {
|
|
22
|
+
if (signal.aborted) return Promise.reject(signal.reason)
|
|
23
|
+
return new Promise((resolve, reject) => {
|
|
24
|
+
const abort = () => { signal.removeEventListener('abort', abort); reject(signal.reason) }
|
|
25
|
+
signal.addEventListener('abort', abort, { once: true })
|
|
26
|
+
// One disconnected reader must not cancel the refresh other readers share.
|
|
27
|
+
promise.then(value => {
|
|
28
|
+
signal.removeEventListener('abort', abort)
|
|
29
|
+
resolve(value)
|
|
30
|
+
}, error => {
|
|
31
|
+
signal.removeEventListener('abort', abort)
|
|
32
|
+
reject(error)
|
|
33
|
+
})
|
|
34
|
+
})
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function createResources({ source, admit }) {
|
|
38
|
+
async function serve(request, peer, kind) {
|
|
39
|
+
if (request.method !== 'GET' && request.method !== 'HEAD') {
|
|
40
|
+
return response(request, 405, { error: 'Method not allowed' }, { allow: 'GET, HEAD' })
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
// readResource callers have already admitted their Peer. HTTP has no Peer:
|
|
44
|
+
// re-use DSH's signed cookie / Host / Origin policy, never URL authority.
|
|
45
|
+
const admission = peer ? { peer } : admit(request)
|
|
46
|
+
if ('rejection' in admission) return response(request, admission.rejection, { error: 'Authentication required' })
|
|
47
|
+
if (admission.peer.signal.aborted) return response(request, 401, { error: 'Peer expired' })
|
|
48
|
+
if (admission.peer.principal.kind !== 'owner') return response(request, 403, { error: 'Owner access required' })
|
|
49
|
+
} catch {
|
|
50
|
+
// A missing/unavailable auth provider must never turn this into a public proxy.
|
|
51
|
+
return response(request, 503, { error: 'DSH authentication unavailable' })
|
|
52
|
+
}
|
|
53
|
+
if (request.signal.aborted) return response(request, 408, { error: 'Request cancelled' })
|
|
54
|
+
const url = new URL(request.url)
|
|
55
|
+
const expectedPath = kind === 'daily' ? DAILY_PATH : IMAGE_PATH
|
|
56
|
+
if (url.pathname !== expectedPath) return response(request, 404, { error: 'Not found' })
|
|
57
|
+
if (url.search.length > 1024) return response(request, 400, { error: 'Invalid query' })
|
|
58
|
+
const allowedKeys = kind === 'daily' ? ['market'] : ['market', 'id']
|
|
59
|
+
if ([...url.searchParams.keys()].some(name => !allowedKeys.includes(name))
|
|
60
|
+
|| allowedKeys.some(name => url.searchParams.getAll(name).length > 1)) {
|
|
61
|
+
return response(request, 400, { error: 'Invalid query' })
|
|
62
|
+
}
|
|
63
|
+
const market = url.searchParams.has('market') ? url.searchParams.get('market') : MARKET
|
|
64
|
+
if (!isBingMarket(market)) return response(request, 400, { error: 'Unsupported Bing market' })
|
|
65
|
+
if (kind === 'daily') {
|
|
66
|
+
try {
|
|
67
|
+
const metadata = await waitFor(source.daily(market), request.signal)
|
|
68
|
+
return response(request, 200, metadata)
|
|
69
|
+
} catch {
|
|
70
|
+
if (request.signal.aborted) return response(request, 408, { error: 'Request cancelled' })
|
|
71
|
+
return response(request, 502, { error: 'Bing wallpaper unavailable; please retry later' }, { 'retry-after': '60' })
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const id = url.searchParams.get('id')
|
|
75
|
+
if (!isBingImageId(id)) return response(request, 400, { error: 'Invalid Bing image ID' })
|
|
76
|
+
const image = source.image(id, market)
|
|
77
|
+
if (!image) return response(request, 404, { error: 'Image not cached; refresh daily metadata first' })
|
|
78
|
+
return new Response(request.method === 'HEAD' ? null : image.bytes, {
|
|
79
|
+
headers: {
|
|
80
|
+
'content-type': image.contentType,
|
|
81
|
+
'content-length': String(image.bytes.byteLength),
|
|
82
|
+
'cache-control': 'private, max-age=3600',
|
|
83
|
+
'x-content-type-options': 'nosniff',
|
|
84
|
+
'cross-origin-resource-policy': 'same-origin',
|
|
85
|
+
},
|
|
86
|
+
})
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
daily: (request, peer) => serve(request, peer, 'daily'),
|
|
90
|
+
image: (request, peer) => serve(request, peer, 'image'),
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function apply(ctx) {
|
|
95
|
+
// Structured injection runs before Client plugin loading. No index replacement.
|
|
96
|
+
ctx.on('webserver/index-inject', (table, peer) => {
|
|
97
|
+
if (peer.principal.kind === 'owner') table.push(bootThemeInjection())
|
|
98
|
+
})
|
|
99
|
+
ctx.effect(() => {
|
|
100
|
+
const source = createBingSource()
|
|
101
|
+
const resources = createResources({
|
|
102
|
+
source,
|
|
103
|
+
admit: request => ctx.connection.admit({ headers: request.headers }),
|
|
104
|
+
})
|
|
105
|
+
const disposers = []
|
|
106
|
+
try {
|
|
107
|
+
// webServer.register() returns a plain disposer; it is not context-owned.
|
|
108
|
+
disposers.push(ctx.webServer.register({ kind: 'exact', path: DAILY_PATH, resource: resources.daily }))
|
|
109
|
+
disposers.push(ctx.webServer.register({ kind: 'exact', path: IMAGE_PATH, resource: resources.image }))
|
|
110
|
+
} catch (error) {
|
|
111
|
+
source.dispose()
|
|
112
|
+
for (const dispose of disposers.reverse()) dispose()
|
|
113
|
+
throw error
|
|
114
|
+
}
|
|
115
|
+
return () => {
|
|
116
|
+
source.dispose() // Abort every outstanding upstream fetch before releasing routes.
|
|
117
|
+
for (const dispose of disposers.reverse()) dispose()
|
|
118
|
+
}
|
|
119
|
+
})
|
|
120
|
+
}
|
package/locale/en.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "Bing daily wallpaper",
|
|
4
|
+
"description": "Daily Bing wallpaper with image-derived colours, ten HCT styles, visibility up to 100%, and automatic light/dark appearance. Open Settings → Bing daily wallpaper. Offers Bing China and international (US) sources, keeps the last image when updates fail, and offers system, schedule and fixed appearance modes. Browser-local controls; appearance changes use DSH’s shared theme preference. Images remain subject to Bing and photographer rights."
|
|
5
|
+
},
|
|
6
|
+
"title": "Bing daily wallpaper",
|
|
7
|
+
"paletteMode": "Colour mode",
|
|
8
|
+
"palette.content": "M3 Content",
|
|
9
|
+
"palette.tonal-spot": "M3 Tonal Spot",
|
|
10
|
+
"palette.fruit-salad": "M3 Fruit Salad",
|
|
11
|
+
"palette.rainbow": "M3 Rainbow",
|
|
12
|
+
"palette.monochrome": "M3 Monochrome",
|
|
13
|
+
"palette.vibrant": "Vibrant",
|
|
14
|
+
"palette.faithful": "Faithful",
|
|
15
|
+
"palette.soft": "Soft",
|
|
16
|
+
"palette.dysfunctional": "Dysfunctional",
|
|
17
|
+
"palette.muted": "Muted",
|
|
18
|
+
"enabled": "Wallpaper enabled",
|
|
19
|
+
"dynamic": "Extract theme colours",
|
|
20
|
+
"market": "Wallpaper source",
|
|
21
|
+
"market.zh-CN": "China",
|
|
22
|
+
"market.en-US": "International (US)",
|
|
23
|
+
"sourceFailed": "Could not switch sources. The previous source’s wallpaper is still shown; check your connection and retry.",
|
|
24
|
+
"mode": "Day/night mode",
|
|
25
|
+
"schedule": "Local time schedule",
|
|
26
|
+
"system": "Follow system",
|
|
27
|
+
"follow": "Follow DSH appearance",
|
|
28
|
+
"light": "Light",
|
|
29
|
+
"dark": "Dark",
|
|
30
|
+
"day": "Light from",
|
|
31
|
+
"night": "Dark from",
|
|
32
|
+
"strength": "Wallpaper visibility",
|
|
33
|
+
"filterMode": "Background filter",
|
|
34
|
+
"filterPixels": "pixels",
|
|
35
|
+
"filter.none": "None",
|
|
36
|
+
"filter.blur": "Blur",
|
|
37
|
+
"filter.frosted": "Frosted glass",
|
|
38
|
+
"filter.blue": "Blue tint",
|
|
39
|
+
"filter.grayscale": "Grayscale",
|
|
40
|
+
"filter.dim": "Dim",
|
|
41
|
+
"filterAmount.blur": "Blur radius",
|
|
42
|
+
"filterAmount.frosted": "Frosted glass radius",
|
|
43
|
+
"filterAmount.blue": "Blue tint intensity",
|
|
44
|
+
"filterAmount.grayscale": "Grayscale intensity",
|
|
45
|
+
"filterAmount.dim": "Dimming intensity",
|
|
46
|
+
"refresh": "Check for updates",
|
|
47
|
+
"loading": "Updating…",
|
|
48
|
+
"ready": "Wallpaper is up to date",
|
|
49
|
+
"waiting": "Wallpaper paused or not yet loaded",
|
|
50
|
+
"preview": "Daily wallpaper preview",
|
|
51
|
+
"palette": "Light and dark accent colours",
|
|
52
|
+
"source": "View on Bing",
|
|
53
|
+
"paused": "Wallpaper and dynamic theme are paused",
|
|
54
|
+
"firstFetchFailed": "Wallpaper could not be loaded. Check your connection and retry.",
|
|
55
|
+
"fetchFailed": "Update failed. The previous wallpaper is kept; check your connection and retry.",
|
|
56
|
+
"stale": "Bing is unavailable. Showing the last successful wallpaper.",
|
|
57
|
+
"sameTime": "Light and dark times must be different.",
|
|
58
|
+
"storageFailed": "These controls could not be saved in this browser."
|
|
59
|
+
}
|
package/locale/zh.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "Bing 每日壁纸",
|
|
4
|
+
"description": "每天更新 Bing 壁纸,从图片提取主题色,提供十种 HCT 风格,背景可见度可调至 100%,支持按时间、跟随系统或固定明暗模式。入口:设置 → Bing 每日壁纸。支持国内(中国)及国际(美国)Bing 壁纸来源,更新失败保留上一张。插件控制项保存在当前浏览器,明暗切换使用 DSH profile 共享的外观偏好。图片版权归 Bing 及原摄影作者所有。"
|
|
5
|
+
},
|
|
6
|
+
"title": "Bing 每日壁纸",
|
|
7
|
+
"paletteMode": "取色模式",
|
|
8
|
+
"palette.content": "M3 Content",
|
|
9
|
+
"palette.tonal-spot": "M3 Tonal Spot",
|
|
10
|
+
"palette.fruit-salad": "M3 Fruit Salad",
|
|
11
|
+
"palette.rainbow": "M3 Rainbow",
|
|
12
|
+
"palette.monochrome": "M3 Monochrome",
|
|
13
|
+
"palette.vibrant": "Vibrant",
|
|
14
|
+
"palette.faithful": "Faithful",
|
|
15
|
+
"palette.soft": "Soft",
|
|
16
|
+
"palette.dysfunctional": "Dysfunctional",
|
|
17
|
+
"palette.muted": "Muted",
|
|
18
|
+
"enabled": "启用壁纸",
|
|
19
|
+
"dynamic": "从壁纸提取主题色",
|
|
20
|
+
"market": "壁纸来源",
|
|
21
|
+
"market.zh-CN": "国内(中国)",
|
|
22
|
+
"market.en-US": "国际(美国)",
|
|
23
|
+
"sourceFailed": "切换来源失败,仍显示上一来源的壁纸;请检查网络后重试。",
|
|
24
|
+
"mode": "日夜切换方式",
|
|
25
|
+
"schedule": "按本地时间切换",
|
|
26
|
+
"system": "跟随系统",
|
|
27
|
+
"follow": "跟随 DSH 外观",
|
|
28
|
+
"light": "浅色",
|
|
29
|
+
"dark": "深色",
|
|
30
|
+
"day": "浅色开始时间",
|
|
31
|
+
"night": "深色开始时间",
|
|
32
|
+
"strength": "壁纸可见度",
|
|
33
|
+
"filterMode": "背景滤镜",
|
|
34
|
+
"filterPixels": "像素",
|
|
35
|
+
"filter.none": "无",
|
|
36
|
+
"filter.blur": "模糊(Blur)",
|
|
37
|
+
"filter.frosted": "毛玻璃",
|
|
38
|
+
"filter.blue": "蓝色调",
|
|
39
|
+
"filter.grayscale": "黑白",
|
|
40
|
+
"filter.dim": "压暗",
|
|
41
|
+
"filterAmount.blur": "模糊半径",
|
|
42
|
+
"filterAmount.frosted": "毛玻璃半径",
|
|
43
|
+
"filterAmount.blue": "蓝色调强度",
|
|
44
|
+
"filterAmount.grayscale": "黑白强度",
|
|
45
|
+
"filterAmount.dim": "压暗强度",
|
|
46
|
+
"refresh": "检查更新",
|
|
47
|
+
"loading": "正在更新…",
|
|
48
|
+
"ready": "壁纸已更新",
|
|
49
|
+
"waiting": "壁纸已暂停或尚未加载",
|
|
50
|
+
"preview": "每日壁纸预览",
|
|
51
|
+
"palette": "浅色与深色主题的强调色",
|
|
52
|
+
"source": "在 Bing 查看",
|
|
53
|
+
"paused": "壁纸和动态主题已暂停",
|
|
54
|
+
"firstFetchFailed": "暂时无法获取壁纸,请检查网络后重试。",
|
|
55
|
+
"fetchFailed": "更新失败,已保留上一张壁纸;请检查网络后重试。",
|
|
56
|
+
"stale": "Bing 暂时不可用,正在显示上次成功获取的壁纸。",
|
|
57
|
+
"sameTime": "日间和夜间的开始时间不能相同。",
|
|
58
|
+
"storageFailed": "无法在此浏览器保存这些控制项。"
|
|
59
|
+
}
|