mp-darkmode 1.2.2 → 1.2.3-beta.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/dist/darkmode.js +763 -768
- package/dist/darkmode.js.map +1 -1
- package/dist/darkmode.min.js +1 -1
- package/package.json +1 -1
package/dist/darkmode.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Darkmode",[],e):"object"==typeof exports?exports.Darkmode=e():t.Darkmode=e()}(self,()=>(()=>{var t={31(t){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},40(t,e,r){var n=r(31),o={};for(var a in n)n.hasOwnProperty(a)&&(o[n[a]]=a);var i=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var l in i)if(i.hasOwnProperty(l)){if(!("channels"in i[l]))throw new Error("missing channels property: "+l);if(!("labels"in i[l]))throw new Error("missing channel labels property: "+l);if(i[l].labels.length!==i[l].channels)throw new Error("channel and label counts mismatch: "+l);var u=i[l].channels,s=i[l].labels;delete i[l].channels,delete i[l].labels,Object.defineProperty(i[l],"channels",{value:u}),Object.defineProperty(i[l],"labels",{value:s})}function c(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2)}i.rgb.hsl=function(t){var e,r,n=t[0]/255,o=t[1]/255,a=t[2]/255,i=Math.min(n,o,a),l=Math.max(n,o,a),u=l-i;return l===i?e=0:n===l?e=(o-a)/u:o===l?e=2+(a-n)/u:a===l&&(e=4+(n-o)/u),(e=Math.min(60*e,360))<0&&(e+=360),r=(i+l)/2,[e,100*(l===i?0:r<=.5?u/(l+i):u/(2-l-i)),100*r]},i.rgb.hsv=function(t){var e,r,n,o,a,i=t[0]/255,l=t[1]/255,u=t[2]/255,s=Math.max(i,l,u),c=s-Math.min(i,l,u),h=function(t){return(s-t)/6/c+.5};return 0===c?o=a=0:(a=c/s,e=h(i),r=h(l),n=h(u),i===s?o=n-r:l===s?o=1/3+e-n:u===s&&(o=2/3+r-e),o<0?o+=1:o>1&&(o-=1)),[360*o,100*a,100*s]},i.rgb.hwb=function(t){var e=t[0],r=t[1],n=t[2];return[i.rgb.hsl(t)[0],1/255*Math.min(e,Math.min(r,n))*100,100*(n=1-1/255*Math.max(e,Math.max(r,n)))]},i.rgb.cmyk=function(t){var e,r=t[0]/255,n=t[1]/255,o=t[2]/255;return[100*((1-r-(e=Math.min(1-r,1-n,1-o)))/(1-e)||0),100*((1-n-e)/(1-e)||0),100*((1-o-e)/(1-e)||0),100*e]},i.rgb.keyword=function(t){var e=o[t];if(e)return e;var r,a=1/0;for(var i in n)if(n.hasOwnProperty(i)){var l=c(t,n[i]);l<a&&(a=l,r=i)}return r},i.keyword.rgb=function(t){return n[t]},i.rgb.xyz=function(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255;return[100*(.4124*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*e+.7152*r+.0722*n),100*(.0193*e+.1192*r+.9505*n)]},i.rgb.lab=function(t){var e=i.rgb.xyz(t),r=e[0],n=e[1],o=e[2];return n/=100,o/=108.883,r=(r/=95.047)>.008856?Math.pow(r,1/3):7.787*r+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(r-n),200*(n-(o=o>.008856?Math.pow(o,1/3):7.787*o+16/116))]},i.hsl.rgb=function(t){var e,r,n,o,a,i=t[0]/360,l=t[1]/100,u=t[2]/100;if(0===l)return[a=255*u,a,a];e=2*u-(r=u<.5?u*(1+l):u+l-u*l),o=[0,0,0];for(var s=0;s<3;s++)(n=i+1/3*-(s-1))<0&&n++,n>1&&n--,a=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,o[s]=255*a;return o},i.hsl.hsv=function(t){var e=t[0],r=t[1]/100,n=t[2]/100,o=r,a=Math.max(n,.01);return r*=(n*=2)<=1?n:2-n,o*=a<=1?a:2-a,[e,100*(0===n?2*o/(a+o):2*r/(n+r)),(n+r)/2*100]},i.hsv.rgb=function(t){var e=t[0]/60,r=t[1]/100,n=t[2]/100,o=Math.floor(e)%6,a=e-Math.floor(e),i=255*n*(1-r),l=255*n*(1-r*a),u=255*n*(1-r*(1-a));switch(n*=255,o){case 0:return[n,u,i];case 1:return[l,n,i];case 2:return[i,n,u];case 3:return[i,l,n];case 4:return[u,i,n];case 5:return[n,i,l]}},i.hsv.hsl=function(t){var e,r,n,o=t[0],a=t[1]/100,i=t[2]/100,l=Math.max(i,.01);return n=(2-a)*i,r=a*l,[o,100*(r=(r/=(e=(2-a)*l)<=1?e:2-e)||0),100*(n/=2)]},i.hwb.rgb=function(t){var e,r,n,o,a,i,l,u=t[0]/360,s=t[1]/100,c=t[2]/100,h=s+c;switch(h>1&&(s/=h,c/=h),n=6*u-(e=Math.floor(6*u)),1&e&&(n=1-n),o=s+n*((r=1-c)-s),e){default:case 6:case 0:a=r,i=o,l=s;break;case 1:a=o,i=r,l=s;break;case 2:a=s,i=r,l=o;break;case 3:a=s,i=o,l=r;break;case 4:a=o,i=s,l=r;break;case 5:a=r,i=s,l=o}return[255*a,255*i,255*l]},i.cmyk.rgb=function(t){var e=t[0]/100,r=t[1]/100,n=t[2]/100,o=t[3]/100;return[255*(1-Math.min(1,e*(1-o)+o)),255*(1-Math.min(1,r*(1-o)+o)),255*(1-Math.min(1,n*(1-o)+o))]},i.xyz.rgb=function(t){var e,r,n,o=t[0]/100,a=t[1]/100,i=t[2]/100;return r=-.9689*o+1.8758*a+.0415*i,n=.0557*o+-.204*a+1.057*i,e=(e=3.2406*o+-1.5372*a+-.4986*i)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,[255*(e=Math.min(Math.max(0,e),1)),255*(r=Math.min(Math.max(0,r),1)),255*(n=Math.min(Math.max(0,n),1))]},i.xyz.lab=function(t){var e=t[0],r=t[1],n=t[2];return r/=100,n/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(e-r),200*(r-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]},i.lab.xyz=function(t){var e,r,n,o=t[0];e=t[1]/500+(r=(o+16)/116),n=r-t[2]/200;var a=Math.pow(r,3),i=Math.pow(e,3),l=Math.pow(n,3);return r=a>.008856?a:(r-16/116)/7.787,e=i>.008856?i:(e-16/116)/7.787,n=l>.008856?l:(n-16/116)/7.787,[e*=95.047,r*=100,n*=108.883]},i.lab.lch=function(t){var e,r=t[0],n=t[1],o=t[2];return(e=360*Math.atan2(o,n)/2/Math.PI)<0&&(e+=360),[r,Math.sqrt(n*n+o*o),e]},i.lch.lab=function(t){var e,r=t[0],n=t[1];return e=t[2]/360*2*Math.PI,[r,n*Math.cos(e),n*Math.sin(e)]},i.rgb.ansi16=function(t){var e=t[0],r=t[1],n=t[2],o=1 in arguments?arguments[1]:i.rgb.hsv(t)[2];if(0===(o=Math.round(o/50)))return 30;var a=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(e/255));return 2===o&&(a+=60),a},i.hsv.ansi16=function(t){return i.rgb.ansi16(i.hsv.rgb(t),t[2])},i.rgb.ansi256=function(t){var e=t[0],r=t[1],n=t[2];return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},i.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var r=.5*(1+~~(t>50));return[(1&e)*r*255,(e>>1&1)*r*255,(e>>2&1)*r*255]},i.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var r;return t-=16,[Math.floor(t/36)/5*255,Math.floor((r=t%36)/6)/5*255,r%6/5*255]},i.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},i.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var r=e[0];3===e[0].length&&(r=r.split("").map(function(t){return t+t}).join(""));var n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},i.rgb.hcg=function(t){var e,r=t[0]/255,n=t[1]/255,o=t[2]/255,a=Math.max(Math.max(r,n),o),i=Math.min(Math.min(r,n),o),l=a-i;return e=l<=0?0:a===r?(n-o)/l%6:a===n?2+(o-r)/l:4+(r-n)/l+4,e/=6,[360*(e%=1),100*l,100*(l<1?i/(1-l):0)]},i.hsl.hcg=function(t){var e,r=t[1]/100,n=t[2]/100,o=0;return(e=n<.5?2*r*n:2*r*(1-n))<1&&(o=(n-.5*e)/(1-e)),[t[0],100*e,100*o]},i.hsv.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=e*r,o=0;return n<1&&(o=(r-n)/(1-n)),[t[0],100*n,100*o]},i.hcg.rgb=function(t){var e=t[0]/360,r=t[1]/100,n=t[2]/100;if(0===r)return[255*n,255*n,255*n];var o,a=[0,0,0],i=e%1*6,l=i%1,u=1-l;switch(Math.floor(i)){case 0:a[0]=1,a[1]=l,a[2]=0;break;case 1:a[0]=u,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=l;break;case 3:a[0]=0,a[1]=u,a[2]=1;break;case 4:a[0]=l,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=u}return o=(1-r)*n,[255*(r*a[0]+o),255*(r*a[1]+o),255*(r*a[2]+o)]},i.hcg.hsv=function(t){var e=t[1]/100,r=e+t[2]/100*(1-e),n=0;return r>0&&(n=e/r),[t[0],100*n,100*r]},i.hcg.hsl=function(t){var e=t[1]/100,r=t[2]/100*(1-e)+.5*e,n=0;return r>0&&r<.5?n=e/(2*r):r>=.5&&r<1&&(n=e/(2*(1-r))),[t[0],100*n,100*r]},i.hcg.hwb=function(t){var e=t[1]/100,r=e+t[2]/100*(1-e);return[t[0],100*(r-e),100*(1-r)]},i.hwb.hcg=function(t){var e=t[1]/100,r=1-t[2]/100,n=r-e,o=0;return n<1&&(o=(r-n)/(1-n)),[t[0],100*n,100*o]},i.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},i.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},i.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},i.gray.hsl=i.gray.hsv=function(t){return[0,0,t[0]]},i.gray.hwb=function(t){return[0,100,t[0]]},i.gray.cmyk=function(t){return[0,0,0,t[0]]},i.gray.lab=function(t){return[t[0],0,0]},i.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),r=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(r.length)+r},i.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}},156(t){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},195(t){t.exports=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}},507(t,e,r){var n=r(40);function o(t,e){return function(r){return e(t(r))}}function a(t,e){for(var r=[e[t].parent,t],a=n[e[t].parent][t],i=e[t].parent;e[i].parent;)r.unshift(e[i].parent),a=o(n[e[i].parent][i],a),i=e[i].parent;return a.conversion=r,a}t.exports=function(t){for(var e=function(t){var e=function(){for(var t={},e=Object.keys(n),r=e.length,o=0;o<r;o++)t[e[o]]={distance:-1,parent:null};return t}(),r=[t];for(e[t].distance=0;r.length;)for(var o=r.pop(),a=Object.keys(n[o]),i=a.length,l=0;l<i;l++){var u=a[l],s=e[u];-1===s.distance&&(s.distance=e[o].distance+1,s.parent=o,r.unshift(u))}return e}(t),r={},o=Object.keys(e),i=o.length,l=0;l<i;l++){var u=o[l];null!==e[u].parent&&(r[u]=a(u,e))}return r}},520(t,e,r){"use strict";var n=r(854),o=r(734),a=[].slice,i=["keyword","gray","hex"],l={};Object.keys(o).forEach(function(t){l[a.call(o[t].labels).sort().join("")]=t});var u={};function s(t,e){if(!(this instanceof s))return new s(t,e);if(e&&e in i&&(e=null),e&&!(e in o))throw new Error("Unknown model: "+e);var r,c;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof s)this.model=t.model,this.color=t.color.slice(),this.valpha=t.valpha;else if("string"==typeof t){var h=n.get(t);if(null===h)throw new Error("Unable to parse color from string: "+t);this.model=h.model,c=o[this.model].channels,this.color=h.value.slice(0,c),this.valpha="number"==typeof h.value[c]?h.value[c]:1}else if(t.length){this.model=e||"rgb",c=o[this.model].channels;var g=a.call(t,0,c);this.color=f(g,c),this.valpha="number"==typeof t[c]?t[c]:1}else if("number"==typeof t)t&=16777215,this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;var d=Object.keys(t);"alpha"in t&&(d.splice(d.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);var b=d.sort().join("");if(!(b in l))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=l[b];var y=o[this.model].labels,p=[];for(r=0;r<y.length;r++)p.push(t[y[r]]);this.color=f(p)}if(u[this.model])for(c=o[this.model].channels,r=0;r<c;r++){var m=u[this.model][r];m&&(this.color[r]=m(this.color[r]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}function c(t,e,r){return(t=Array.isArray(t)?t:[t]).forEach(function(t){(u[t]||(u[t]=[]))[e]=r}),t=t[0],function(n){var o;return arguments.length?(r&&(n=r(n)),(o=this[t]()).color[e]=n,o):(o=this[t]().color[e],r&&(o=r(o)),o)}}function h(t){return function(e){return Math.max(0,Math.min(t,e))}}function f(t,e){for(var r=0;r<e;r++)"number"!=typeof t[r]&&(t[r]=0);return t}s.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(t){var e=this.model in n.to?this:this.rgb(),r=1===(e=e.round("number"==typeof t?t:1)).valpha?e.color:e.color.concat(this.valpha);return n.to[e.model](r)},percentString:function(t){var e=this.rgb().round("number"==typeof t?t:1),r=1===e.valpha?e.color:e.color.concat(this.valpha);return n.to.rgb.percent(r)},array:function(){return 1===this.valpha?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var t={},e=o[this.model].channels,r=o[this.model].labels,n=0;n<e;n++)t[r[n]]=this.color[n];return 1!==this.valpha&&(t.alpha=this.valpha),t},unitArray:function(){var t=this.rgb().color;return t[0]/=255,t[1]/=255,t[2]/=255,1!==this.valpha&&t.push(this.valpha),t},unitObject:function(){var t=this.rgb().object();return t.r/=255,t.g/=255,t.b/=255,1!==this.valpha&&(t.alpha=this.valpha),t},round:function(t){return t=Math.max(t||0,0),new s(this.color.map(function(t){return function(e){return function(t,e){return Number(t.toFixed(e))}(e,t)}}(t)).concat(this.valpha),this.model)},alpha:function(t){return arguments.length?new s(this.color.concat(Math.max(0,Math.min(1,t))),this.model):this.valpha},red:c("rgb",0,h(255)),green:c("rgb",1,h(255)),blue:c("rgb",2,h(255)),hue:c(["hsl","hsv","hsl","hwb","hcg"],0,function(t){return(t%360+360)%360}),saturationl:c("hsl",1,h(100)),lightness:c("hsl",2,h(100)),saturationv:c("hsv",1,h(100)),value:c("hsv",2,h(100)),chroma:c("hcg",1,h(100)),gray:c("hcg",2,h(100)),white:c("hwb",1,h(100)),wblack:c("hwb",2,h(100)),cyan:c("cmyk",0,h(100)),magenta:c("cmyk",1,h(100)),yellow:c("cmyk",2,h(100)),black:c("cmyk",3,h(100)),x:c("xyz",0,h(100)),y:c("xyz",1,h(100)),z:c("xyz",2,h(100)),l:c("lab",0,h(100)),a:c("lab",1),b:c("lab",2),keyword:function(t){return arguments.length?new s(t):o[this.model].keyword(this.color)},hex:function(t){return arguments.length?new s(t):n.to.hex(this.rgb().round().color)},rgbNumber:function(){var t=this.rgb().color;return(255&t[0])<<16|(255&t[1])<<8|255&t[2]},luminosity:function(){for(var t=this.rgb().color,e=[],r=0;r<t.length;r++){var n=t[r]/255;e[r]=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),r=t.luminosity();return e>r?(e+.05)/(r+.05):(r+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},isDark:function(){var t=this.rgb().color;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},isLight:function(){return!this.isDark()},negate:function(){for(var t=this.rgb(),e=0;e<3;e++)t.color[e]=255-t.color[e];return t},lighten:function(t){var e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken:function(t){var e=this.hsl();return e.color[2]-=e.color[2]*t,e},saturate:function(t){var e=this.hsl();return e.color[1]+=e.color[1]*t,e},desaturate:function(t){var e=this.hsl();return e.color[1]-=e.color[1]*t,e},whiten:function(t){var e=this.hwb();return e.color[1]+=e.color[1]*t,e},blacken:function(t){var e=this.hwb();return e.color[2]+=e.color[2]*t,e},grayscale:function(){var t=this.rgb().color,e=.3*t[0]+.59*t[1]+.11*t[2];return s.rgb(e,e,e)},fade:function(t){return this.alpha(this.valpha-this.valpha*t)},opaquer:function(t){return this.alpha(this.valpha+this.valpha*t)},rotate:function(t){var e=this.hsl(),r=e.color[0];return r=(r=(r+t)%360)<0?360+r:r,e.color[0]=r,e},mix:function(t,e){if(!t||!t.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof t);var r=t.rgb(),n=this.rgb(),o=void 0===e?.5:e,a=2*o-1,i=r.alpha()-n.alpha(),l=((a*i===-1?a:(a+i)/(1+a*i))+1)/2,u=1-l;return s.rgb(l*r.red()+u*n.red(),l*r.green()+u*n.green(),l*r.blue()+u*n.blue(),r.alpha()*o+n.alpha()*(1-o))}},Object.keys(o).forEach(function(t){if(-1===i.indexOf(t)){var e=o[t].channels;s.prototype[t]=function(){if(this.model===t)return new s(this);if(arguments.length)return new s(arguments,t);var r,n="number"==typeof arguments[e]?e:this.valpha;return new s((r=o[this.model][t].raw(this.color),Array.isArray(r)?r:[r]).concat(n),t)},s[t]=function(r){return"number"==typeof r&&(r=f(a.call(arguments),e)),new s(r,t)}}}),t.exports=s},734(t,e,r){var n=r(40),o=r(507),a={};Object.keys(n).forEach(function(t){a[t]={},Object.defineProperty(a[t],"channels",{value:n[t].channels}),Object.defineProperty(a[t],"labels",{value:n[t].labels});var e=o(t);Object.keys(e).forEach(function(r){var n=e[r];a[t][r]=function(t){var e=function(e){if(null==e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var r=t(e);if("object"==typeof r)for(var n=r.length,o=0;o<n;o++)r[o]=Math.round(r[o]);return r};return"conversion"in t&&(e.conversion=t.conversion),e}(n),a[t][r].raw=function(t){var e=function(e){return null==e?e:(arguments.length>1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(n)})}),t.exports=a},854(t,e,r){var n=r(156),o=r(872),a=Object.hasOwnProperty,i=Object.create(null);for(var l in n)a.call(n,l)&&(i[n[l]]=l);var u=t.exports={to:{},get:{}};function s(t,e,r){return Math.min(Math.max(e,t),r)}function c(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}u.get=function(t){var e,r;switch(t.substring(0,3).toLowerCase()){case"hsl":e=u.get.hsl(t),r="hsl";break;case"hwb":e=u.get.hwb(t),r="hwb";break;default:e=u.get.rgb(t),r="rgb"}return e?{model:r,value:e}:null},u.get.rgb=function(t){if(!t)return null;var e,r,o,i=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(o=e[2],e=e[1],r=0;r<3;r++){var l=2*r;i[r]=parseInt(e.slice(l,l+2),16)}o&&(i[3]=parseInt(o,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(o=(e=e[1])[3],r=0;r<3;r++)i[r]=parseInt(e[r]+e[r],16);o&&(i[3]=parseInt(o+o,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(r=0;r<3;r++)i[r]=parseInt(e[r+1],0);e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:a.call(n,e[1])?((i=n[e[1]])[3]=1,i):null:null;for(r=0;r<3;r++)i[r]=Math.round(2.55*parseFloat(e[r+1]));e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}for(r=0;r<3;r++)i[r]=s(i[r],0,255);return i[3]=s(i[3],0,1),i},u.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var r=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,s(parseFloat(e[2]),0,100),s(parseFloat(e[3]),0,100),s(isNaN(r)?1:r,0,1)]}return null},u.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var r=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,s(parseFloat(e[2]),0,100),s(parseFloat(e[3]),0,100),s(isNaN(r)?1:r,0,1)]}return null},u.to.hex=function(){var t=o(arguments);return"#"+c(t[0])+c(t[1])+c(t[2])+(t[3]<1?c(Math.round(255*t[3])):"")},u.to.rgb=function(){var t=o(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},u.to.rgb.percent=function(){var t=o(arguments),e=Math.round(t[0]/255*100),r=Math.round(t[1]/255*100),n=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+r+"%, "+n+"%)":"rgba("+e+"%, "+r+"%, "+n+"%, "+t[3]+")"},u.to.hsl=function(){var t=o(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},u.to.hwb=function(){var t=o(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},u.to.keyword=function(t){return i[t.slice(0,3)]}},872(t,e,r){"use strict";var n=r(195),o=Array.prototype.concat,a=Array.prototype.slice,i=t.exports=function(t){for(var e=[],r=0,i=t.length;r<i;r++){var l=t[r];n(l)?e=o.call(e,a.call(l)):e.push(l)}return e};i.wrap=function(t){return function(){return t(i(arguments))}}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var a=e[n]={exports:{}};return t[n](a,a.exports,r),a.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{convertBg:()=>Be,extend:()=>Ae,getContrast:()=>Te,init:()=>Pe,run:()=>Oe,updateStyle:()=>Ee});var t={};r.r(t),r.d(t,{color:()=>Yt,colorBurn:()=>Jt,colorDodge:()=>zt,darken:()=>Vt,difference:()=>Qt,exclusion:()=>Gt,hardLight:()=>Ht,hue:()=>Wt,lighten:()=>Kt,luminosity:()=>Zt,multiply:()=>qt,normal:()=>It,overlay:()=>$t,saturation:()=>Xt,screen:()=>Rt,softLight:()=>Ut});var e="(prefers-color-scheme: dark)",o="js_darkmode__",a=new RegExp("".concat(o,"\\d+")),i="data_color_scheme_dark",l="".concat(1*new Date).concat(Math.round(10*Math.random())),u="data-darkmode-color-".concat(l),s="data-darkmode-bgcolor-".concat(l),c="data-darkmode-original-color-".concat(l),h="data-darkmode-original-bgcolor-".concat(l),f="data-darkmode-bgimage-".concat(l),g="data-darkmode-complementary-bgimagecolor-".concat(l),d="|",b=.05,y=window.getInnerHeight&&window.getInnerHeight()||window.innerHeight||document.documentElement.clientHeight,p={BG_COLOR:["background-color","background-image","background"],TEXT_SHADOW:["text-shadow"],TEXT_COLOR:["-webkit-text-stroke","-webkit-text-stroke-color","text-decoration","text-decoration-color","text-emphasis-color","color","-webkit-text-fill-color"],BORDER_COLOR:["border-image","-webkit-border-image","border","border-top","border-right","border-bottom","border-left","border-color","border-top-color","border-right-color","border-bottom-color","border-left-color","border-block-color","border-block-start-color","border-block-end-color","border-inline-color","border-inline-start-color","border-inline-end-color","outline","outline-color","box-shadow","column-rule","column-rule-color"]},m=Object.keys(p).map(function(t){return p[t].join("|")}).join("|").split("|"),v=["TABLE","TR","TD","TH"],w=/ !important$/,k=/<\$#_SEMICOLON_#\$>/g,x=/\brgba?\([^)]+\)/i,M=/\brgba?\([^)]+\)/gi;const C={hasInit:!1,begin:null,showFirstPage:null,error:null,mode:"",whitelist:{tagName:["MPCPS","IFRAME"],attribute:[]},needJudgeFirstPage:!0,delayBgJudge:!1,container:null,cssSelectorsPrefix:"",defaultLightTextColor:"#191919",defaultLightBgColor:"#fff",defaultDarkTextColor:"#a3a3a3",defaultDarkBgColor:"#191919",set:function(t,e,r){var n=e[r];switch(t){case"boolean":"boolean"==typeof n&&(this[r]=n);break;case"string":"string"==typeof n&&""!==n&&(this[r]=n);break;case"function":"function"==typeof n&&(this[r]=n);break;case"dom":n instanceof HTMLElement&&(this[r]=n)}}};function S(t,e,r){return(e=B(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _(t){return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_(t)}function j(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function O(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,B(n.key),n)}}function P(t,e,r){return e&&O(t.prototype,e),r&&O(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function B(t){var e=function(t){if("object"!=_(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=_(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==_(e)?e:e+""}var E=[],T=[],A=function(){return P(function t(){j(this,t)},[{key:"loopTimes",get:function(){return me.loopTimes}},{key:"isDarkmode",get:function(){return Me.isDarkmode}},{key:"addCss",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]&&!arguments[2]?T:E).push(ke.genCss(t,e.map(function(t){var e=t.key,r=t.value;return ke.genCssKV(e,r)}).join("")))}}])}(),D=function(){return P(function t(){j(this,t),S(this,"_plugins",[]),S(this,"length",0),S(this,"loopTimes",0),S(this,"firstPageStyle",""),S(this,"otherPageStyle",""),S(this,"firstPageStyleNoMQ",""),S(this,"otherPageStyleNoMQ","")},[{key:"extend",value:function(t){this._plugins.push(new(t(A))),this.length++}},{key:"emit",value:function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];this._plugins.forEach(function(e){"function"==typeof e[t]&&e[t].apply(e,r)})}},{key:"addCss",value:function(t){t?(this.firstPageStyle+=E.join(""),this.firstPageStyleNoMQ+=T.join("")):(this.otherPageStyle+=E.join(""),this.otherPageStyleNoMQ+=T.join(""))}},{key:"resetCss",value:function(){E=[],T=[]}}])}();function F(t){return F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},F(t)}function N(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,I(n.key),n)}}function L(t,e,r){return(e=I(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function I(t){var e=function(t){if("object"!=F(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=F(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==F(e)?e:e+""}var q=function(){return function(t,e){return e&&N(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),L(this,"_queue",[]),L(this,"_idx",0),this._prefix=e},[{key:"length",get:function(){return this._queue.length}},{key:"push",value:function(t){var e="".concat(this._prefix).concat(this._idx++);t.classList.add(e),this._queue.push({el:t,className:e,updated:!C.delayBgJudge})}},{key:"forEach",value:function(t){var e=[];for(this._queue.forEach(function(r,n){r.updated&&(e.unshift(n),F(t)&&t(r.el))});e.length;)this._queue.splice(e.shift(),1)}},{key:"update",value:function(t){this._queue.forEach(function(e){e.updated||Array.prototype.some.call(t,function(t){return!(1!==t.nodeType||!t.classList.contains(e.className)||(e.el=t,e.updated=!0,0))})})}}])}();function R(t){return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},R(t)}function $(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,K(n.key),n)}}function V(t,e,r){return(e=K(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function K(t){var e=function(t){if("object"!=R(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=R(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==R(e)?e:e+""}var z=function(){return function(t,e){return e&&$(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),V(this,"_stack",[]),V(this,"_idx",0),this._prefix=e,this.classNameReg=new RegExp("".concat(this._prefix,"\\d+"))},[{key:"push",value:function(t,e,r){var n="".concat(this._prefix).concat(this._idx++);t.classList.add(n),this._stack.unshift({el:t,className:n,cssKV:e,updated:!C.delayBgJudge,cb:r})}},{key:"contains",value:function(t,e){var r=t.getBoundingClientRect(),n=[];for(this._stack.forEach(function(t,e){if(t.updated){t.rect||(t.rect=t.el.getBoundingClientRect());var o=t.rect;r.top>=o.bottom||r.bottom<=o.top||r.left>=o.right||r.right<=o.left||n.unshift(e)}});n.length;){var o,a=n.shift();o=C.delayBgJudge?this._stack[a]:this._stack.splice(a,1)[0],"function"==typeof e&&e(o)}}},{key:"update",value:function(t){this._stack.forEach(function(e){e.updated||Array.prototype.some.call(t,function(t){return!(1!==t.nodeType||!t.classList.contains(e.className)||(e.el=t,e.updated=!0,0))})})}},{key:"clear",value:function(){this._stack=[]}}])}();function J(t){return J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},J(t)}function H(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function U(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,G(n.key),n)}}function Q(t,e,r){return(e=G(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function G(t){var e=function(t){if("object"!=J(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=J(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==J(e)?e:e+""}var W=function(){return function(t,e){return e&&U(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Q(this,"_firstPageStyle",""),Q(this,"_otherPageStyle",""),Q(this,"_watcher",{}),Q(this,"isFinish",!1)},[{key:"genCssKV",value:function(t,e){var r,n;return null===(r=(n=this._watcher)[t])||void 0===r||r.call(n),"".concat(t,": ").concat(e," !important;")}},{key:"genCss",value:function(t,e){return"".concat("dark"===C.mode?"html.".concat(i," "):"").concat(C.cssSelectorsPrefix&&"".concat(C.cssSelectorsPrefix," "),".").concat(t,"{").concat(e,"}")}},{key:"addCss",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this[e?"_firstPageStyle":"_otherPageStyle"]+=t,me.addCss(e)}},{key:"writeStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];!t&&Me.isDarkmode&&(this.isFinish=!0);var r=(Me.isDarkmode?[{target:this,key:["_firstPageStyle","_otherPageStyle"],needMediaQuery:!0}]:[]).concat([{target:me,key:["firstPageStyle","otherPageStyle"],needMediaQuery:!0},{target:me,key:["firstPageStyleNoMQ","otherPageStyleNoMQ"],needMediaQuery:!1}]).map(function(r){var n=r.target,o=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,l=[],u=!0,s=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(s)throw o}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return H(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?H(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(r.key,2),a=o[0],i=o[1],l=r.needMediaQuery,u="";t?u=a:(n[i]=n[a]+n[i],n[a]="",u=i);var s=n[u];return s?(n[u]="","dark"!==C.mode&&l?"@media ".concat(e," {").concat(s,"}"):s):""}).join("");r&&document.head.insertAdjacentHTML("beforeend",'<style type="text/css">'.concat(r,"</style>"))}},{key:"watch",value:function(t,e){this._watcher[t]=e}},{key:"unwatch",value:function(t){delete this._watcher[t]}}])}();function X(t){return X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},X(t)}function Y(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,tt(n.key),n)}}function Z(t,e,r){return(e=tt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function tt(t){var e=function(t){if("object"!=X(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=X(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==X(e)?e:e+""}function et(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function rt(t){var e;return(e=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?[]:[t]).concat.apply(e,function(t){return function(t){if(Array.isArray(t))return et(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return et(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?et(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t.querySelectorAll("*")))}var nt={"ue-table-interlace-color-single":"#fcfcfc","ue-table-interlace-color-double":"#f7faff"},ot=function(){return function(t,e){return e&&Y(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Z(this,"_els",[]),Z(this,"_firstPageEls",[]),Z(this,"_delayEls",[]),Z(this,"showFirstPage",!1)},[{key:"length",get:function(){return this._els.length}},{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this._els=t}},{key:"get",value:function(){var t=[];return this._els.length?(t=this._els,Me.isDarkmode&&(this._els=[])):this._delayEls.length?(t=this._delayEls,this._delayEls=[]):C.container&&(t=C.container.querySelectorAll("*")),t}},{key:"delay",value:function(){var t=this;Array.prototype.forEach.call(this._els,function(e){return t._delayEls.push(e)}),this._els=[]}},{key:"hasDelay",value:function(){return!this._els.length&&(this._delayEls.length>0||null!==C.container)}},{key:"addFirstPageNode",value:function(t){this._firstPageEls.push(t)}},{key:"showFirstPageNodes",value:function(){this._firstPageEls.forEach(function(t){return!t.style.visibility&&(t.style.visibility="visible")}),this.showFirstPage=!0}},{key:"emptyFirstPageNodes",value:function(){this._firstPageEls=[]}}])}(),at=r(520),it=r.n(at),lt=r(156),ut=r.n(lt);function st(t,e,r){return{r:255*r(t.r/255,e.r/255),g:255*r(t.g/255,e.g/255),b:255*r(t.b/255,e.b/255)}}function ct(t,e){return e}function ht(t,e){return t*e}function ft(t,e){return t+e-t*e}function gt(t,e){return mt(e,t)}function dt(t,e){return Math.min(t,e)}function bt(t,e){return Math.min(Math.max(t,e),1)}function yt(t,e){return 0===t?0:1===e?1:Math.min(1,t/(1-e))}function pt(t,e){return 1===t?1:0===e?0:1-Math.min(1,(1-t)/e)}function mt(t,e){return e<=.5?ht(t,2*e):ft(t,2*e-1)}function vt(t,e){return e<=.5?t-(1-2*e)*t*(1-t):t+(2*e-1)*((t<=.25?((16*t-12)*t+4)*t:Math.sqrt(t))-t)}function wt(t,e){return Math.abs(t-e)}function kt(t,e){return t+e-2*t*e}function xt(t,e,r){return Math.min(Math.max(t||0,e),r)}function Mt(t){return{r:xt(t.r,0,255),g:xt(t.g,0,255),b:xt(t.b,0,255),a:xt(t.a,0,1)}}function Ct(t){return{r:255*t.r,g:255*t.g,b:255*t.b,a:t.a}}function St(t){return{r:t.r/255,g:t.g/255,b:t.b/255,a:t.a}}function _t(t,e){void 0===e&&(e=0);var r=Math.pow(10,e);return{r:Math.round(t.r*r)/r,g:Math.round(t.g*r)/r,b:Math.round(t.b*r)/r,a:t.a}}function jt(t,e,r,n,o,a){return(1-e/r)*n+e/r*Math.round((1-t)*o+t*a)}function Ot(t,e,r,n,o){void 0===o&&(o={unitInput:!1,unitOutput:!1,roundOutput:!0}),o.unitInput&&(t=Ct(t),e=Ct(e)),t=Mt(t);var a=(e=Mt(e)).a+t.a-e.a*t.a,i=r(t,e,n),l=Mt({r:jt(t.a,e.a,a,t.r,e.r,i.r),g:jt(t.a,e.a,a,t.g,e.g,i.g),b:jt(t.a,e.a,a,t.b,e.b,i.b),a});return l=o.unitOutput?St(l):o.roundOutput?_t(l):function(t){return _t(t,9)}(l),l}function Pt(t,e,r){return Ct(r(St(t),St(e)))}function Bt(t){return.3*t.r+.59*t.g+.11*t.b}function Et(t,e){var r=e-Bt(t);return function(t){var e=Bt(t),r=t.r,n=t.g,o=t.b,a=Math.min(r,n,o),i=Math.max(r,n,o);function l(t){return e+(t-e)*e/(e-a)}function u(t){return e+(t-e)*(1-e)/(i-e)}return a<0&&(r=l(r),n=l(n),o=l(o)),i>1&&(r=u(r),n=u(n),o=u(o)),{r,g:n,b:o}}({r:t.r+r,g:t.g+r,b:t.b+r})}function Tt(t){return Math.max(t.r,t.g,t.b)-Math.min(t.r,t.g,t.b)}function At(t,e){var r=["r","g","b"].sort(function(e,r){return t[e]-t[r]}),n=r[0],o=r[1],a=r[2],i={r:t.r,g:t.g,b:t.b};return i[a]>i[n]?(i[o]=(i[o]-i[n])*e/(i[a]-i[n]),i[a]=e):i[o]=i[a]=0,i[n]=0,i}function Dt(t,e){return Et(At(e,Tt(t)),Bt(t))}function Ft(t,e){return Et(At(t,Tt(e)),Bt(t))}function Nt(t,e){return Et(e,Bt(t))}function Lt(t,e){return Et(t,Bt(e))}function It(t,e){return Ot(t,e,st,ct)}function qt(t,e){return Ot(t,e,st,ht)}function Rt(t,e){return Ot(t,e,st,ft)}function $t(t,e){return Ot(t,e,st,gt)}function Vt(t,e){return Ot(t,e,st,dt)}function Kt(t,e){return Ot(t,e,st,bt)}function zt(t,e){return Ot(t,e,st,yt)}function Jt(t,e){return Ot(t,e,st,pt)}function Ht(t,e){return Ot(t,e,st,mt)}function Ut(t,e){return Ot(t,e,st,vt)}function Qt(t,e){return Ot(t,e,st,wt)}function Gt(t,e){return Ot(t,e,st,kt)}function Wt(t,e){return Ot(t,e,Pt,Dt)}function Xt(t,e){return Ot(t,e,Pt,Ft)}function Yt(t,e){return Ot(t,e,Pt,Nt)}function Zt(t,e){return Ot(t,e,Pt,Lt)}ut().windowtext=[0,0,0],ut().transparent=[255,255,255,0];var te=new RegExp(Object.keys(ut()).map(function(t){return"\\b".concat(t,"\\b")}).join("|"),"ig"),ee=function(t){var e=t.object();return e.a=e.alpha||1,delete e.alpha,e},re=function(t){return t.alpha=t.a,delete t.a,ne(t)},ne=function(t){var e=null;try{e=t instanceof it()?t:it()(t)}catch(e){console.log("ignore the invalid color: `".concat(t,"`"))}return e},oe=function(t,e){return t.replace(w,"").replace(te,function(t){if(!e&&"transparent"===t)return t;var r=ut()[t.toLowerCase()];return"".concat(r.length>3?"rgba":"rgb","(").concat(r.toString(),")")})},ae=function(t){var e=oe(t);return x.test(e)?e:""},ie=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"mix";if("[object Array]"!==Object.prototype.toString.call(e)||e.length<1)return null;if(1===e.length)return e[0];for(var n=ne(e.shift()),o=ne(e.shift());o;){if(!n&&o)n=o;else if(n||o)n&&o&&(n="mix"===r?n.mix(o,o.alpha()):re(t[r](ee(n),ee(o))));else{if(0===e.length)break;n=ne(e.shift())}if(0===e.length)break;o=ne(e.shift())}return n||null},le=function(t){return(299*t[0]+587*t[1]+114*t[2])/1e3},ue=function(t,e){var r=t/le(e),n=Math.min(255,e[0]*r),o=Math.min(255,e[1]*r),a=Math.min(255,e[2]*r);return 0===o||255===n||255===a?o=(1e3*t-299*n-114*a)/587:0===n?n=(1e3*t-587*o-114*a)/299:0!==a&&255!==o||(a=(1e3*t-299*n-587*o)/114),it().rgb(n,o,a)};function se(t){return se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},se(t)}function ce(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,l=[],u=!0,s=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(s)throw o}}return l}}(t,e)||fe(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function he(t){return function(t){if(Array.isArray(t))return ge(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||fe(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fe(t,e){if(t){if("string"==typeof t)return ge(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ge(t,e):void 0}}function ge(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function de(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ye(n.key),n)}}function be(t,e,r){return(e=ye(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ye(t){var e=function(t){if("object"!=se(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=se(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==se(e)?e:e+""}var pe=function(){return function(t,e){return e&&de(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),be(this,"_idx",0),be(this,"_defaultDarkTextColorRgb",null),be(this,"_defaultDarkBgColorRgb",null),be(this,"_defaultDarkBgColorHSL",null),be(this,"_defaultDarkTextColorBrightness",null),be(this,"_defaultDarkBgColorBrightness",null),be(this,"_defaultDarkBgColorHslBrightness",null),be(this,"_maxLimitOffsetBrightness",null),be(this,"isDarkmode",!1)},[{key:"_adjustBrightness",value:function(t,e,r,n,o){var a,i=t.alpha(),l="";if(r.isBgColor){if(i>=b&&(e[f]&&delete e[f],e[g])){if(e[g]===t.toString()||this.getContrast(e[g],t.toString())<1.1)return{newColor:o?t.toString():"",extStyle:l};rt(e).forEach(function(t){delete t[g]})}if(a=this._adjustBackgroundBrightness(t),!r.hasInlineColor){var u=e[c]||C.defaultLightTextColor,h=ne(u);if(h){var d=this._adjustBrightness(h,e,{isTextColor:!0,parentElementBgColorStr:a||t},n,o);d.newColor?l+=ke.genCssKV("color",d.newColor):l+=ke.genCssKV("color",h)}}}else if(r.isTextColor||r.isBorderColor){var y=r.parentElementBgColorStr||r.isTextColor&&e[s]||C.defaultDarkBgColor,p=ne(y);if(p&&!e[f]){a=this._adjustTextBrightness(t,p);var m="";n?m="ByUpdateStyle":o&&(m="ByReset"),me.emit("afterConvertTextColor".concat(m),e,{fontColor:a,bgColor:p})}}else r.isTextShadow&&(e[f]||(a=this._adjustBackgroundBrightness(t)));return{newColor:a&&t.toString()!==a.toString()&&a.alpha(i).rgb(),extStyle:l}}},{key:"_adjustTextBrightness",value:function(t,e){var r=e.rgb().array(),n=e.alpha(),o=le(r)*n+this._defaultDarkBgColorBrightness*(1-n),a=t.rgb().array(),i=t.hsl().array(),l=t.alpha(),u=le(a),s=Math.abs(o-u);if(u>=250)return t;if(s>this._maxLimitOffsetBrightness&&o<=this._defaultDarkBgColorBrightness+2)return ue(this._maxLimitOffsetBrightness+o,a).alpha(l);if(s>=65)return t;if(o>=100){if(i[2]>50){i[2]=90-i[2];var c=it().hsl.apply(it(),he(i)).alpha(l);return this._adjustTextBrightness(c,e)}return ue(Math.min(this._maxLimitOffsetBrightness,o-65),a).alpha(l)}if(i[2]<=40){i[2]=90-i[2];var h=it().hsl.apply(it(),he(i)).alpha(l);return this._adjustTextBrightness(h,e)}return ue(Math.min(this._maxLimitOffsetBrightness,o+65),a).alpha(l)}},{key:"_adjustBackgroundBrightness",value:function(t){var e=t.rgb().array(),r=t.hsl().array(),n=t.alpha(),o=le(e),a=t;return 0===r[1]&&r[2]>40||o>250?a=it().hsl(0,0,Math.min(100,100+this._defaultDarkBgColorHslBrightness-r[2])):o>190?a=ue(190,e).alpha(n):r[2]<22&&(r[2]=22,a=it().hsl.apply(it(),he(r))),a.alpha(n).rgb()}},{key:"_updateBgWithGradient",value:function(t,e,r,n,o,a,i){var l=ie([e[s]||C.defaultDarkBgColor,t],"normal"),u=(e[h]||C.defaultLightBgColor).split(d).concat(t.toString()).join(d);rt(e).forEach(function(t){t[s]=l,t[h]=u});var c=n.slice(-1)[0];if("color"===c[0]){var f=this._adjustBrightness(ne(oe(c[1])),e,{isBgColor:!1,isTextShadow:!1,isTextColor:!0,isBorderColor:!1,hasInlineColor:o},a,i);if(f.newColor)return ke.genCss(r,ke.genCssKV("color",f.newColor))}return""}},{key:"_try",value:function(t){try{return t()}catch(t){console.log("An error occurred when running the dark mode conversion algorithm\n",t),"function"==typeof C.error&&C.error(t)}}},{key:"init",value:function(){this._defaultDarkTextColorRgb=ne(C.defaultDarkTextColor).rgb().array(),this._defaultDarkBgColorRgb=ne(C.defaultDarkBgColor).rgb().array(),this._defaultDarkBgColorHSL=ne(C.defaultDarkBgColor).hsl().array(),this._defaultDarkTextColorBrightness=le(this._defaultDarkTextColorRgb),this._defaultDarkBgColorBrightness=le(this._defaultDarkBgColorRgb),this._defaultDarkBgColorHslBrightness=this._defaultDarkBgColorHSL[2],this._maxLimitOffsetBrightness=this._defaultDarkTextColorBrightness-this._defaultDarkBgColorBrightness}},{key:"convert",value:function(t,e,r,n){var i=this;me.resetCss();var l="";r?l="ByUpdateStyle":n&&(l="ByReset"),me.emit("beforeConvertNode".concat(l),t);var y="",S="";if(this.isDarkmode||r||n){var _=t.nodeName;if(C.whitelist.tagName.indexOf(_)>-1)return"";if(C.whitelist.attribute.some(function(e){return t.hasAttribute(e)}))return"";var j=t.style;e||(e=(j.cssText&&j.cssText.replace(/("[^;]*);([^;]*")|('[^;]*);([^;]*')/g,"$1$3".concat("<$#_SEMICOLON_#$>","$2$4")).split(";")||[]).map(function(t){var e=t.indexOf(":");return[t.slice(0,e).toLowerCase(),t.slice(e+1).replace(k,";")].map(function(t){return(t||"").replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")})}));var O=!1,P=!1,B=!1,E=null,T=null;e=e.filter(function(t){var e=ce(t,2),r=e[0],n=e[1];return"color"===r?O=!0:/background/i.test(r)&&(P=!0,"background-position"===r?E=n:"background-size"===r&&(T=n)),(/background/i.test(r)||/^(-webkit-)?border-image/.test(r))&&/url\([^)]*\)/i.test(n)&&(B=!0),m.indexOf(r)>-1}).sort(function(t,e){var r=ce(t,1)[0],n=ce(e,1)[0];return"color"===r||"background-image"===r&&"background-color"===n||0===n.indexOf("-webkit-text")?1:-1}),v.indexOf(_)>-1&&!P&&this._try(function(){var r=function(t){var e=null;return Array.prototype.some.call(t.classList,function(t){return!!nt[t]&&(e=nt[t],!0)}),e}(t);if(r||(r=t.getAttribute("bgcolor")),r){var n=ne(r);n&&(e.unshift(["background-color",n.toString()]),P=!0)}}),"FONT"!==_||O||this._try(function(){var r=t.getAttribute("color");if(r){var n=ne(r);n&&(e.push(["color",n.toString()]),O=!0)}});var A="",D="",F=0;e.some(function(t,e){var r=ce(t,2),n=r[0],o=r[1];return i._try(function(){if(0!==n.indexOf("-webkit-text"))return F=e,!0;switch(n){case"-webkit-text-fill-color":A=ae(o);break;case"-webkit-text-stroke":var t=o.split(" ");2===t.length&&(D=ae(t[1]));break;case"-webkit-text-stroke-color":D=ae(o)}return!1})}),A&&(O?e[e.length-1]=["-webkit-text-fill-color",A]:(e.push(["-webkit-text-fill-color",A]),O=!0)),F&&(e.splice(0,F),D&&e.unshift(["-webkit-text-stroke-color",D]));var N="",L="";if((r||n)&&t.className&&"string"==typeof t.className){var I=t.className.match(a);I&&(N=I[0]),(I=t.className.match(we.classNameReg))&&(L=I[0])}var q="",R=n;R&&ke.watch("color",function(){R=!1,ke.unwatch("color")}),e.forEach(function(o){var a=ce(o,2),l=a[0],m=a[1];return i._try(function(){var o,a=m,v=!1,k=p.BG_COLOR.indexOf(l)>-1,_=p.TEXT_SHADOW.indexOf(l)>-1,A=p.TEXT_COLOR.indexOf(l),D=p.BORDER_COLOR.indexOf(l)>-1,F=/gradient/.test(m),N=[],I="";if(m=oe(m,F),x.test(m)){if(F){for(var $=M.exec(m);$;)N.push($[0]),$=M.exec(m);o=ie(N)}var V=0;m=m.replace(M,function(e){F&&(e=o,v=!0);var a=ne(e);if((null==a?void 0:a.alpha())>=b){var l=i._adjustBrightness(a,t,{isBgColor:k,isTextShadow:_,isTextColor:A>-1,isBorderColor:D,hasInlineColor:O},r,n),g=!B&&l.newColor;if(I+=l.extStyle,k||A>=5){var y=g?g.toString():e;0===V&&rt(t).forEach(function(t){k?(t[s]=y,t[h]=(t[h]||C.defaultLightBgColor).split(d).concat(e).join(d)):(t[u]=y,t[c]=e);var r=ne(y);k&&(null==r?void 0:r.alpha())>=b&&t[f]&&delete t[f]})}return g&&(v=!0),V++,g||e}return e}).replace(/\s?!\s?important/gi,"")}if(I&&(q+=I),!(t instanceof SVGElement)){var K=/^background/.test(l),z=/^(-webkit-)?border-image/.test(l);if((K||z)&&/url\([^)]*\)/i.test(m)){v=!0;var J=ie((t[h]||C.defaultLightBgColor).split(d),"normal").toString();if(m=m.replace(/^(.*?)url\(([^)]*)\)(.*)$/i,function(e){var r=e,o="";return t[f]||rt(t).forEach(function(t){t[f]=!0}),K?(o=ke.genCssKV(l,J?"".concat(r,",linear-gradient(").concat(J,", ").concat(J,")"):r),E&&(q+=ke.genCssKV("background-position",E),o+=ke.genCssKV("background-position",J?"".concat(E,",top left"):E)),T&&(q+=ke.genCssKV("background-size",T),o+=ke.genCssKV("background-size",J?"".concat(T,",100%"):T)),n||(L?(S+=ke.genCss(L,o),rt(t).forEach(function(t){t[g]=J||r})):we.push(t,o,function(){rt(t).forEach(function(t){t[g]=J||r})}))):!J||P||n||(o=ke.genCssKV("background-image","linear-gradient(".concat(J,", ").concat(J,")")),L?S+=ke.genCss(L,o):we.push(t,o)),r}),!O){var H=t[c]||C.defaultLightTextColor;q+=ke.genCssKV("color",H),rt(t).forEach(function(t){t[u]=H})}}}(v||n)&&(!r&&!n&&w.test(a)&&(j[l]=a.replace(w,"")),F?n||(L?(S+=ke.genCss(L,ke.genCssKV(l,m)),/^background/.test(l)&&!/url\([^)]*\)/i.test(m)&&(y+=i._updateBgWithGradient(o,t,L,e,O,r,n))):we.push(t,ke.genCssKV(l,m),function(a){/^background/.test(l)&&!/url\([^)]*\)/i.test(m)&&(y+=i._updateBgWithGradient(o,t,a.className,e,O,r,n))})):("color"===l&&(R=!1,ke.unwatch("color")),q+=ke.genCssKV(l,!v&&n?t.style[l]:m)))})}),R&&(q+=ke.genCssKV("color",t.style.color||t[u]||C.defaultDarkTextColor),ke.unwatch("color")),q&&(N||(N="".concat(o).concat(this._idx++),t.classList.add(N)),y+=q?ke.genCss(N,q):""),y+=S,r||!function(t){return t.textContent.replace(/\s/g,"").length>0}(t)||n||(C.delayBgJudge?ve.push(t):we.contains(t,function(t){y+=ke.genCss(t.className,t.cssKV),"function"==typeof t.cb&&t.cb(t)}))}return me.emit("afterConvertNode".concat(l),t),y}},{key:"getContrast",value:function(t,e){var r=ne(t),n=ne(e);return r&&n?r.contrast(n):0}}])}(),me=new D,ve=new q("".concat(o,"text__")),we=new z("".concat(o,"bg__")),ke=new W,xe=new ot,Me=new pe;function Ce(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var Se=new RegExp("".concat(o,"[^ ]+"),"g"),_e=null,je=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{type:"dom"};if(e.force&&(ke.isFinish=!1),!ke.isFinish)try{Me.isDarkmode=C.mode?"dark"===C.mode:t.matches,"dom"===e.type?(Me.isDarkmode&&"function"==typeof C.begin&&C.begin(xe.hasDelay()),Array.prototype.forEach.call(xe.get(),function(t){if(Me.isDarkmode&&t.className&&"string"==typeof t.className&&(t.className=t.className.replace(Se,"")),Me.isDarkmode||me.length)if(C.needJudgeFirstPage){var e=t.getBoundingClientRect(),r=e.top,n=e.bottom;r<=0&&n<=0?ke.addCss(Me.convert(t)):r>0&&r<y||n>0&&n<y?(xe.addFirstPageNode(t),ke.addCss(Me.convert(t),!0)):(C.needJudgeFirstPage=!1,ke.writeStyle(!0),xe.showFirstPageNodes(),"function"==typeof C.showFirstPage&&C.showFirstPage(),ke.addCss(Me.convert(t)))}else ke.addCss(Me.convert(t))}),me.loopTimes++):"bg"===e.type&&Me.isDarkmode&&ve.forEach(function(t){return we.contains(t,function(t){var e,r,n,o,a,i;ke.addCss(ke.genCss(t.className,t.cssKV)),"function"==typeof t.cb&&t.cb(t);var l=t.el,d=[[u,null!==(e=l[u])&&void 0!==e?e:null],[s,null!==(r=l[s])&&void 0!==r?r:null],[c,null!==(n=l[c])&&void 0!==n?n:null],[h,null!==(o=l[h])&&void 0!==o?o:null],[f,null!==(a=l[f])&&void 0!==a?a:null],[g,null!==(i=l[g])&&void 0!==i?i:null]],b=rt(l,!0);b.forEach(function(t){d.forEach(function(e){var r=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,l=[],u=!0,s=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(s)throw o}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Ce(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ce(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e,2),n=r[0],o=r[1];null===o?delete t[n]:t[n]=o})}),b.forEach(function(t){ke.addCss(Me.convert(t,void 0,!1,!0))})})}),(C.needJudgeFirstPage||!C.needJudgeFirstPage&&!xe.showFirstPage)&&"function"==typeof C.showFirstPage&&C.showFirstPage(),ke.writeStyle(),xe.emptyFirstPageNodes(),Me.isDarkmode||(C.needJudgeFirstPage=!1,C.delayBgJudge=!1,null===C.container&&"dom"===e.type&&xe.length&&xe.delay())}catch(t){console.log("An error occurred when running the dark mode conversion algorithm\n",t),"function"==typeof C.error&&C.error(t)}};function Oe(t,e){Pe(e),xe.set(t),je(_e,{force:!0,type:"dom"})}function Pe(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!C.hasInit){C.hasInit=!0;var r=C.whitelist.tagName,n=C.whitelist.attribute;t.whitelist&&(t.whitelist.tagName instanceof Array&&t.whitelist.tagName.forEach(function(t){t=t.toUpperCase(),-1===r.indexOf(t)&&r.push(t)}),t.whitelist.attribute instanceof Array&&t.whitelist.attribute.forEach(function(t){-1===n.indexOf(t)&&n.push(t)})),["dark","light"].indexOf(t.mode)>-1&&(C.set("string",t,"mode"),"dark"===t.mode&&document.getElementsByTagName("html")[0].classList.add(i)),C.set("function",t,"begin"),C.set("function",t,"showFirstPage"),C.set("function",t,"error"),C.set("boolean",t,"needJudgeFirstPage"),C.set("boolean",t,"delayBgJudge"),C.set("dom",t,"container"),C.set("string",t,"cssSelectorsPrefix"),C.set("string",t,"defaultLightTextColor"),C.set("string",t,"defaultLightBgColor"),C.set("string",t,"defaultDarkTextColor"),C.set("string",t,"defaultDarkBgColor"),Me.init(),!C.mode&&null===_e&&window.matchMedia&&(_e=window.matchMedia(e)).addListener(je)}}function Be(t){xe.set(t),null!==C.container&&(we.update(t),ve.update(t)),je(_e,{force:!0,type:"bg"}),C.delayBgJudge&&0===ve.length&&we.clear()}function Ee(t,e){ke.isFinish&&(ke.addCss(Me.convert(t,e?Object.keys(e).map(function(t){return[t,e[t]]}):void 0,!0),!1),ke.writeStyle())}function Te(t,e){return Me.getContrast(t,e)}function Ae(t){t.forEach(function(t){return me.extend(t)})}})(),n})());
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Darkmode",[],e):"object"==typeof exports?exports.Darkmode=e():t.Darkmode=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var a=e[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)r.d(n,a,function(e){return t[e]}.bind(null,a));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=9)}([function(t,e,r){"use strict";var n=r(3),a=r(6),o=[].slice,i=["keyword","gray","hex"],l={};Object.keys(a).forEach((function(t){l[o.call(a[t].labels).sort().join("")]=t}));var u={};function s(t,e){if(!(this instanceof s))return new s(t,e);if(e&&e in i&&(e=null),e&&!(e in a))throw new Error("Unknown model: "+e);var r,c;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof s)this.model=t.model,this.color=t.color.slice(),this.valpha=t.valpha;else if("string"==typeof t){var h=n.get(t);if(null===h)throw new Error("Unable to parse color from string: "+t);this.model=h.model,c=a[this.model].channels,this.color=h.value.slice(0,c),this.valpha="number"==typeof h.value[c]?h.value[c]:1}else if(t.length){this.model=e||"rgb",c=a[this.model].channels;var f=o.call(t,0,c);this.color=d(f,c),this.valpha="number"==typeof t[c]?t[c]:1}else if("number"==typeof t)t&=16777215,this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;var g=Object.keys(t);"alpha"in t&&(g.splice(g.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);var b=g.sort().join("");if(!(b in l))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=l[b];var p=a[this.model].labels,y=[];for(r=0;r<p.length;r++)y.push(t[p[r]]);this.color=d(y)}if(u[this.model])for(c=a[this.model].channels,r=0;r<c;r++){var m=u[this.model][r];m&&(this.color[r]=m(this.color[r]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}function c(t,e,r){return(t=Array.isArray(t)?t:[t]).forEach((function(t){(u[t]||(u[t]=[]))[e]=r})),t=t[0],function(n){var a;return arguments.length?(r&&(n=r(n)),(a=this[t]()).color[e]=n,a):(a=this[t]().color[e],r&&(a=r(a)),a)}}function h(t){return function(e){return Math.max(0,Math.min(t,e))}}function f(t){return Array.isArray(t)?t:[t]}function d(t,e){for(var r=0;r<e;r++)"number"!=typeof t[r]&&(t[r]=0);return t}s.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(t){var e=this.model in n.to?this:this.rgb(),r=1===(e=e.round("number"==typeof t?t:1)).valpha?e.color:e.color.concat(this.valpha);return n.to[e.model](r)},percentString:function(t){var e=this.rgb().round("number"==typeof t?t:1),r=1===e.valpha?e.color:e.color.concat(this.valpha);return n.to.rgb.percent(r)},array:function(){return 1===this.valpha?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var t={},e=a[this.model].channels,r=a[this.model].labels,n=0;n<e;n++)t[r[n]]=this.color[n];return 1!==this.valpha&&(t.alpha=this.valpha),t},unitArray:function(){var t=this.rgb().color;return t[0]/=255,t[1]/=255,t[2]/=255,1!==this.valpha&&t.push(this.valpha),t},unitObject:function(){var t=this.rgb().object();return t.r/=255,t.g/=255,t.b/=255,1!==this.valpha&&(t.alpha=this.valpha),t},round:function(t){return t=Math.max(t||0,0),new s(this.color.map(function(t){return function(e){return function(t,e){return Number(t.toFixed(e))}(e,t)}}(t)).concat(this.valpha),this.model)},alpha:function(t){return arguments.length?new s(this.color.concat(Math.max(0,Math.min(1,t))),this.model):this.valpha},red:c("rgb",0,h(255)),green:c("rgb",1,h(255)),blue:c("rgb",2,h(255)),hue:c(["hsl","hsv","hsl","hwb","hcg"],0,(function(t){return(t%360+360)%360})),saturationl:c("hsl",1,h(100)),lightness:c("hsl",2,h(100)),saturationv:c("hsv",1,h(100)),value:c("hsv",2,h(100)),chroma:c("hcg",1,h(100)),gray:c("hcg",2,h(100)),white:c("hwb",1,h(100)),wblack:c("hwb",2,h(100)),cyan:c("cmyk",0,h(100)),magenta:c("cmyk",1,h(100)),yellow:c("cmyk",2,h(100)),black:c("cmyk",3,h(100)),x:c("xyz",0,h(100)),y:c("xyz",1,h(100)),z:c("xyz",2,h(100)),l:c("lab",0,h(100)),a:c("lab",1),b:c("lab",2),keyword:function(t){return arguments.length?new s(t):a[this.model].keyword(this.color)},hex:function(t){return arguments.length?new s(t):n.to.hex(this.rgb().round().color)},rgbNumber:function(){var t=this.rgb().color;return(255&t[0])<<16|(255&t[1])<<8|255&t[2]},luminosity:function(){for(var t=this.rgb().color,e=[],r=0;r<t.length;r++){var n=t[r]/255;e[r]=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),r=t.luminosity();return e>r?(e+.05)/(r+.05):(r+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},isDark:function(){var t=this.rgb().color;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},isLight:function(){return!this.isDark()},negate:function(){for(var t=this.rgb(),e=0;e<3;e++)t.color[e]=255-t.color[e];return t},lighten:function(t){var e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken:function(t){var e=this.hsl();return e.color[2]-=e.color[2]*t,e},saturate:function(t){var e=this.hsl();return e.color[1]+=e.color[1]*t,e},desaturate:function(t){var e=this.hsl();return e.color[1]-=e.color[1]*t,e},whiten:function(t){var e=this.hwb();return e.color[1]+=e.color[1]*t,e},blacken:function(t){var e=this.hwb();return e.color[2]+=e.color[2]*t,e},grayscale:function(){var t=this.rgb().color,e=.3*t[0]+.59*t[1]+.11*t[2];return s.rgb(e,e,e)},fade:function(t){return this.alpha(this.valpha-this.valpha*t)},opaquer:function(t){return this.alpha(this.valpha+this.valpha*t)},rotate:function(t){var e=this.hsl(),r=e.color[0];return r=(r=(r+t)%360)<0?360+r:r,e.color[0]=r,e},mix:function(t,e){if(!t||!t.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof t);var r=t.rgb(),n=this.rgb(),a=void 0===e?.5:e,o=2*a-1,i=r.alpha()-n.alpha(),l=((o*i==-1?o:(o+i)/(1+o*i))+1)/2,u=1-l;return s.rgb(l*r.red()+u*n.red(),l*r.green()+u*n.green(),l*r.blue()+u*n.blue(),r.alpha()*a+n.alpha()*(1-a))}},Object.keys(a).forEach((function(t){if(-1===i.indexOf(t)){var e=a[t].channels;s.prototype[t]=function(){if(this.model===t)return new s(this);if(arguments.length)return new s(arguments,t);var r="number"==typeof arguments[e]?e:this.valpha;return new s(f(a[this.model][t].raw(this.color)).concat(r),t)},s[t]=function(r){return"number"==typeof r&&(r=d(o.call(arguments),e)),new s(r,t)}}})),t.exports=s},function(t,e,r){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},function(t,e,r){var n=r(7),a={};for(var o in n)n.hasOwnProperty(o)&&(a[n[o]]=o);var i=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var l in i)if(i.hasOwnProperty(l)){if(!("channels"in i[l]))throw new Error("missing channels property: "+l);if(!("labels"in i[l]))throw new Error("missing channel labels property: "+l);if(i[l].labels.length!==i[l].channels)throw new Error("channel and label counts mismatch: "+l);var u=i[l].channels,s=i[l].labels;delete i[l].channels,delete i[l].labels,Object.defineProperty(i[l],"channels",{value:u}),Object.defineProperty(i[l],"labels",{value:s})}i.rgb.hsl=function(t){var e,r,n=t[0]/255,a=t[1]/255,o=t[2]/255,i=Math.min(n,a,o),l=Math.max(n,a,o),u=l-i;return l===i?e=0:n===l?e=(a-o)/u:a===l?e=2+(o-n)/u:o===l&&(e=4+(n-a)/u),(e=Math.min(60*e,360))<0&&(e+=360),r=(i+l)/2,[e,100*(l===i?0:r<=.5?u/(l+i):u/(2-l-i)),100*r]},i.rgb.hsv=function(t){var e,r,n,a,o,i=t[0]/255,l=t[1]/255,u=t[2]/255,s=Math.max(i,l,u),c=s-Math.min(i,l,u),h=function(t){return(s-t)/6/c+.5};return 0===c?a=o=0:(o=c/s,e=h(i),r=h(l),n=h(u),i===s?a=n-r:l===s?a=1/3+e-n:u===s&&(a=2/3+r-e),a<0?a+=1:a>1&&(a-=1)),[360*a,100*o,100*s]},i.rgb.hwb=function(t){var e=t[0],r=t[1],n=t[2];return[i.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(r,n))),100*(n=1-1/255*Math.max(e,Math.max(r,n)))]},i.rgb.cmyk=function(t){var e,r=t[0]/255,n=t[1]/255,a=t[2]/255;return[100*((1-r-(e=Math.min(1-r,1-n,1-a)))/(1-e)||0),100*((1-n-e)/(1-e)||0),100*((1-a-e)/(1-e)||0),100*e]},i.rgb.keyword=function(t){var e=a[t];if(e)return e;var r,o,i,l=1/0;for(var u in n)if(n.hasOwnProperty(u)){var s=n[u],c=(o=t,i=s,Math.pow(o[0]-i[0],2)+Math.pow(o[1]-i[1],2)+Math.pow(o[2]-i[2],2));c<l&&(l=c,r=u)}return r},i.keyword.rgb=function(t){return n[t]},i.rgb.xyz=function(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255;return[100*(.4124*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*e+.7152*r+.0722*n),100*(.0193*e+.1192*r+.9505*n)]},i.rgb.lab=function(t){var e=i.rgb.xyz(t),r=e[0],n=e[1],a=e[2];return n/=100,a/=108.883,r=(r/=95.047)>.008856?Math.pow(r,1/3):7.787*r+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(r-n),200*(n-(a=a>.008856?Math.pow(a,1/3):7.787*a+16/116))]},i.hsl.rgb=function(t){var e,r,n,a,o,i=t[0]/360,l=t[1]/100,u=t[2]/100;if(0===l)return[o=255*u,o,o];e=2*u-(r=u<.5?u*(1+l):u+l-u*l),a=[0,0,0];for(var s=0;s<3;s++)(n=i+1/3*-(s-1))<0&&n++,n>1&&n--,o=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,a[s]=255*o;return a},i.hsl.hsv=function(t){var e=t[0],r=t[1]/100,n=t[2]/100,a=r,o=Math.max(n,.01);return r*=(n*=2)<=1?n:2-n,a*=o<=1?o:2-o,[e,100*(0===n?2*a/(o+a):2*r/(n+r)),100*((n+r)/2)]},i.hsv.rgb=function(t){var e=t[0]/60,r=t[1]/100,n=t[2]/100,a=Math.floor(e)%6,o=e-Math.floor(e),i=255*n*(1-r),l=255*n*(1-r*o),u=255*n*(1-r*(1-o));switch(n*=255,a){case 0:return[n,u,i];case 1:return[l,n,i];case 2:return[i,n,u];case 3:return[i,l,n];case 4:return[u,i,n];case 5:return[n,i,l]}},i.hsv.hsl=function(t){var e,r,n,a=t[0],o=t[1]/100,i=t[2]/100,l=Math.max(i,.01);return n=(2-o)*i,r=o*l,[a,100*(r=(r/=(e=(2-o)*l)<=1?e:2-e)||0),100*(n/=2)]},i.hwb.rgb=function(t){var e,r,n,a,o,i,l,u=t[0]/360,s=t[1]/100,c=t[2]/100,h=s+c;switch(h>1&&(s/=h,c/=h),n=6*u-(e=Math.floor(6*u)),0!=(1&e)&&(n=1-n),a=s+n*((r=1-c)-s),e){default:case 6:case 0:o=r,i=a,l=s;break;case 1:o=a,i=r,l=s;break;case 2:o=s,i=r,l=a;break;case 3:o=s,i=a,l=r;break;case 4:o=a,i=s,l=r;break;case 5:o=r,i=s,l=a}return[255*o,255*i,255*l]},i.cmyk.rgb=function(t){var e=t[0]/100,r=t[1]/100,n=t[2]/100,a=t[3]/100;return[255*(1-Math.min(1,e*(1-a)+a)),255*(1-Math.min(1,r*(1-a)+a)),255*(1-Math.min(1,n*(1-a)+a))]},i.xyz.rgb=function(t){var e,r,n,a=t[0]/100,o=t[1]/100,i=t[2]/100;return r=-.9689*a+1.8758*o+.0415*i,n=.0557*a+-.204*o+1.057*i,e=(e=3.2406*a+-1.5372*o+-.4986*i)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,[255*(e=Math.min(Math.max(0,e),1)),255*(r=Math.min(Math.max(0,r),1)),255*(n=Math.min(Math.max(0,n),1))]},i.xyz.lab=function(t){var e=t[0],r=t[1],n=t[2];return r/=100,n/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(e-r),200*(r-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]},i.lab.xyz=function(t){var e,r,n,a=t[0];e=t[1]/500+(r=(a+16)/116),n=r-t[2]/200;var o=Math.pow(r,3),i=Math.pow(e,3),l=Math.pow(n,3);return r=o>.008856?o:(r-16/116)/7.787,e=i>.008856?i:(e-16/116)/7.787,n=l>.008856?l:(n-16/116)/7.787,[e*=95.047,r*=100,n*=108.883]},i.lab.lch=function(t){var e,r=t[0],n=t[1],a=t[2];return(e=360*Math.atan2(a,n)/2/Math.PI)<0&&(e+=360),[r,Math.sqrt(n*n+a*a),e]},i.lch.lab=function(t){var e,r=t[0],n=t[1];return e=t[2]/360*2*Math.PI,[r,n*Math.cos(e),n*Math.sin(e)]},i.rgb.ansi16=function(t){var e=t[0],r=t[1],n=t[2],a=1 in arguments?arguments[1]:i.rgb.hsv(t)[2];if(0===(a=Math.round(a/50)))return 30;var o=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(e/255));return 2===a&&(o+=60),o},i.hsv.ansi16=function(t){return i.rgb.ansi16(i.hsv.rgb(t),t[2])},i.rgb.ansi256=function(t){var e=t[0],r=t[1],n=t[2];return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},i.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var r=.5*(1+~~(t>50));return[(1&e)*r*255,(e>>1&1)*r*255,(e>>2&1)*r*255]},i.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var r;return t-=16,[Math.floor(t/36)/5*255,Math.floor((r=t%36)/6)/5*255,r%6/5*255]},i.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},i.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var r=e[0];3===e[0].length&&(r=r.split("").map((function(t){return t+t})).join(""));var n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},i.rgb.hcg=function(t){var e,r=t[0]/255,n=t[1]/255,a=t[2]/255,o=Math.max(Math.max(r,n),a),i=Math.min(Math.min(r,n),a),l=o-i;return e=l<=0?0:o===r?(n-a)/l%6:o===n?2+(a-r)/l:4+(r-n)/l+4,e/=6,[360*(e%=1),100*l,100*(l<1?i/(1-l):0)]},i.hsl.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=1,a=0;return(n=r<.5?2*e*r:2*e*(1-r))<1&&(a=(r-.5*n)/(1-n)),[t[0],100*n,100*a]},i.hsv.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=e*r,a=0;return n<1&&(a=(r-n)/(1-n)),[t[0],100*n,100*a]},i.hcg.rgb=function(t){var e=t[0]/360,r=t[1]/100,n=t[2]/100;if(0===r)return[255*n,255*n,255*n];var a,o=[0,0,0],i=e%1*6,l=i%1,u=1-l;switch(Math.floor(i)){case 0:o[0]=1,o[1]=l,o[2]=0;break;case 1:o[0]=u,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=l;break;case 3:o[0]=0,o[1]=u,o[2]=1;break;case 4:o[0]=l,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=u}return a=(1-r)*n,[255*(r*o[0]+a),255*(r*o[1]+a),255*(r*o[2]+a)]},i.hcg.hsv=function(t){var e=t[1]/100,r=e+t[2]/100*(1-e),n=0;return r>0&&(n=e/r),[t[0],100*n,100*r]},i.hcg.hsl=function(t){var e=t[1]/100,r=t[2]/100*(1-e)+.5*e,n=0;return r>0&&r<.5?n=e/(2*r):r>=.5&&r<1&&(n=e/(2*(1-r))),[t[0],100*n,100*r]},i.hcg.hwb=function(t){var e=t[1]/100,r=e+t[2]/100*(1-e);return[t[0],100*(r-e),100*(1-r)]},i.hwb.hcg=function(t){var e=t[1]/100,r=1-t[2]/100,n=r-e,a=0;return n<1&&(a=(r-n)/(1-n)),[t[0],100*n,100*a]},i.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},i.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},i.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},i.gray.hsl=i.gray.hsv=function(t){return[0,0,t[0]]},i.gray.hwb=function(t){return[0,100,t[0]]},i.gray.cmyk=function(t){return[0,0,0,t[0]]},i.gray.lab=function(t){return[t[0],0,0]},i.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),r=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(r.length)+r},i.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}},function(t,e,r){var n=r(1),a=r(4),o=Object.hasOwnProperty,i={};for(var l in n)o.call(n,l)&&(i[n[l]]=l);var u=t.exports={to:{},get:{}};function s(t,e,r){return Math.min(Math.max(e,t),r)}function c(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}u.get=function(t){var e,r;switch(t.substring(0,3).toLowerCase()){case"hsl":e=u.get.hsl(t),r="hsl";break;case"hwb":e=u.get.hwb(t),r="hwb";break;default:e=u.get.rgb(t),r="rgb"}return e?{model:r,value:e}:null},u.get.rgb=function(t){if(!t)return null;var e,r,a,i=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(a=e[2],e=e[1],r=0;r<3;r++){var l=2*r;i[r]=parseInt(e.slice(l,l+2),16)}a&&(i[3]=parseInt(a,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(a=(e=e[1])[3],r=0;r<3;r++)i[r]=parseInt(e[r]+e[r],16);a&&(i[3]=parseInt(a+a,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(r=0;r<3;r++)i[r]=parseInt(e[r+1],0);e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:o.call(n,e[1])?((i=n[e[1]])[3]=1,i):null:null;for(r=0;r<3;r++)i[r]=Math.round(2.55*parseFloat(e[r+1]));e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}for(r=0;r<3;r++)i[r]=s(i[r],0,255);return i[3]=s(i[3],0,1),i},u.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var r=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,s(parseFloat(e[2]),0,100),s(parseFloat(e[3]),0,100),s(isNaN(r)?1:r,0,1)]}return null},u.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var r=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,s(parseFloat(e[2]),0,100),s(parseFloat(e[3]),0,100),s(isNaN(r)?1:r,0,1)]}return null},u.to.hex=function(){var t=a(arguments);return"#"+c(t[0])+c(t[1])+c(t[2])+(t[3]<1?c(Math.round(255*t[3])):"")},u.to.rgb=function(){var t=a(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},u.to.rgb.percent=function(){var t=a(arguments),e=Math.round(t[0]/255*100),r=Math.round(t[1]/255*100),n=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+r+"%, "+n+"%)":"rgba("+e+"%, "+r+"%, "+n+"%, "+t[3]+")"},u.to.hsl=function(){var t=a(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},u.to.hwb=function(){var t=a(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},u.to.keyword=function(t){return i[t.slice(0,3)]}},function(t,e,r){"use strict";var n=r(5),a=Array.prototype.concat,o=Array.prototype.slice,i=t.exports=function(t){for(var e=[],r=0,i=t.length;r<i;r++){var l=t[r];n(l)?e=a.call(e,o.call(l)):e.push(l)}return e};i.wrap=function(t){return function(){return t(i(arguments))}}},function(t,e){t.exports=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}},function(t,e,r){var n=r(2),a=r(8),o={};Object.keys(n).forEach((function(t){o[t]={},Object.defineProperty(o[t],"channels",{value:n[t].channels}),Object.defineProperty(o[t],"labels",{value:n[t].labels});var e=a(t);Object.keys(e).forEach((function(r){var n=e[r];o[t][r]=function(t){var e=function(e){if(null==e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var r=t(e);if("object"==typeof r)for(var n=r.length,a=0;a<n;a++)r[a]=Math.round(r[a]);return r};return"conversion"in t&&(e.conversion=t.conversion),e}(n),o[t][r].raw=function(t){var e=function(e){return null==e?e:(arguments.length>1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(n)}))})),t.exports=o},function(t,e,r){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},function(t,e,r){var n=r(2);function a(t){var e=function(){for(var t={},e=Object.keys(n),r=e.length,a=0;a<r;a++)t[e[a]]={distance:-1,parent:null};return t}(),r=[t];for(e[t].distance=0;r.length;)for(var a=r.pop(),o=Object.keys(n[a]),i=o.length,l=0;l<i;l++){var u=o[l],s=e[u];-1===s.distance&&(s.distance=e[a].distance+1,s.parent=a,r.unshift(u))}return e}function o(t,e){return function(r){return e(t(r))}}function i(t,e){for(var r=[e[t].parent,t],a=n[e[t].parent][t],i=e[t].parent;e[i].parent;)r.unshift(e[i].parent),a=o(n[e[i].parent][i],a),i=e[i].parent;return a.conversion=r,a}t.exports=function(t){for(var e=a(t),r={},n=Object.keys(e),o=n.length,l=0;l<o;l++){var u=n[l];null!==e[u].parent&&(r[u]=i(u,e))}return r}},function(t,e,r){"use strict";r.r(e),r.d(e,"run",(function(){return me})),r.d(e,"init",(function(){return ve})),r.d(e,"convertBg",(function(){return ke})),r.d(e,"updateStyle",(function(){return we})),r.d(e,"getContrast",(function(){return xe})),r.d(e,"extend",(function(){return Me}));var n={};r.r(n),r.d(n,"color",(function(){return Kt})),r.d(n,"colorBurn",(function(){return Nt})),r.d(n,"colorDodge",(function(){return Ft})),r.d(n,"darken",(function(){return Tt})),r.d(n,"difference",(function(){return qt})),r.d(n,"exclusion",(function(){return Rt})),r.d(n,"hardLight",(function(){return Lt})),r.d(n,"hue",(function(){return $t})),r.d(n,"lighten",(function(){return Dt})),r.d(n,"luminosity",(function(){return zt})),r.d(n,"multiply",(function(){return Pt})),r.d(n,"normal",(function(){return Bt})),r.d(n,"overlay",(function(){return At})),r.d(n,"saturation",(function(){return Vt})),r.d(n,"screen",(function(){return Et})),r.d(n,"softLight",(function(){return It}));var a="(prefers-color-scheme: dark)",o=new RegExp("".concat("js_darkmode__","\\d+")),i="data_color_scheme_dark",l="".concat(1*new Date).concat(Math.round(10*Math.random())),u="data-darkmode-color-".concat(l),s="data-darkmode-bgcolor-".concat(l),c="data-darkmode-original-color-".concat(l),h="data-darkmode-original-bgcolor-".concat(l),f="data-darkmode-bgimage-".concat(l),d="data-darkmode-complementary-bgimagecolor-".concat(l),g=window.getInnerHeight&&window.getInnerHeight()||window.innerHeight||document.documentElement.clientHeight,b={BG_COLOR:["background-color","background-image","background"],TEXT_SHADOW:["text-shadow"],TEXT_COLOR:["-webkit-text-stroke","-webkit-text-stroke-color","text-decoration","text-decoration-color","text-emphasis-color","color","-webkit-text-fill-color"],BORDER_COLOR:["border-image","-webkit-border-image","border","border-top","border-right","border-bottom","border-left","border-color","border-top-color","border-right-color","border-bottom-color","border-left-color","border-block-color","border-block-start-color","border-block-end-color","border-inline-color","border-inline-start-color","border-inline-end-color","outline","outline-color","box-shadow","column-rule","column-rule-color"]},p=Object.keys(b).map((function(t){return b[t].join("|")})).join("|").split("|"),y=["TABLE","TR","TD","TH"],m=/ !important$/,v=/<\$#_SEMICOLON_#\$>/g,k=/\brgba?\([^)]+\)/i,w=/\brgba?\([^)]+\)/gi,x={hasInit:!1,begin:null,showFirstPage:null,error:null,mode:"",whitelist:{tagName:["MPCPS","IFRAME"],attribute:[]},needJudgeFirstPage:!0,delayBgJudge:!1,container:null,cssSelectorsPrefix:"",defaultLightTextColor:"#191919",defaultLightBgColor:"#fff",defaultDarkTextColor:"#a3a3a3",defaultDarkBgColor:"#191919",set:function(t,e,r){var n=e[r];switch(t){case"boolean":"boolean"==typeof n&&(this[r]=n);break;case"string":"string"==typeof n&&""!==n&&(this[r]=n);break;case"function":"function"==typeof n&&(this[r]=n);break;case"dom":n instanceof HTMLElement&&(this[r]=n)}}};function M(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function C(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function O(t,e,r){return e&&_(t.prototype,e),r&&_(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var S=[],j=[],B=function(){function t(){C(this,t)}return O(t,[{key:"loopTimes",get:function(){return le.loopTimes}},{key:"isDarkmode",get:function(){return fe.isDarkmode}},{key:"addCss",value:function(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];(r?S:j).push(ce.genCss(t,e.map((function(t){var e=t.key,r=t.value;return ce.genCssKV(e,r)})).join("")))}}]),t}(),P=function(){function t(){C(this,t),M(this,"_plugins",[]),M(this,"length",0),M(this,"loopTimes",0),M(this,"firstPageStyle",""),M(this,"otherPageStyle",""),M(this,"firstPageStyleNoMQ",""),M(this,"otherPageStyleNoMQ","")}return O(t,[{key:"extend",value:function(t){this._plugins.push(new(t(B))),this.length++}},{key:"emit",value:function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];this._plugins.forEach((function(e){"function"==typeof e[t]&&e[t].apply(e,r)}))}},{key:"addCss",value:function(t){t?(this.firstPageStyle+=S.join(""),this.firstPageStyleNoMQ+=j.join("")):(this.otherPageStyle+=S.join(""),this.otherPageStyleNoMQ+=j.join(""))}},{key:"resetCss",value:function(){S=[],j=[]}}]),t}();function E(t){return(E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function A(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function T(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var D=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),T(this,"_queue",[]),T(this,"_idx",0),this._prefix=e}var e,r,n;return e=t,(r=[{key:"length",get:function(){return this._queue.length}},{key:"push",value:function(t){var e="".concat(this._prefix).concat(this._idx++);t.classList.add(e),this._queue.push({el:t,className:e,updated:!x.delayBgJudge})}},{key:"forEach",value:function(t){var e=[];for(this._queue.forEach((function(r,n){r.updated&&(e.unshift(n),E(t)&&t(r.el))}));e.length;)this._queue.splice(e.shift(),1)}},{key:"update",value:function(t){this._queue.forEach((function(e){e.updated||Array.prototype.some.call(t,(function(t){return!(1!==t.nodeType||!t.classList.contains(e.className)||(e.el=t,e.updated=!0,0))}))}))}}])&&A(e.prototype,r),n&&A(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function F(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function N(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var L=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),N(this,"_stack",[]),N(this,"_idx",0),this._prefix=e,this.classNameReg=new RegExp("".concat(this._prefix,"\\d+"))}var e,r,n;return e=t,(r=[{key:"push",value:function(t,e,r){var n="".concat(this._prefix).concat(this._idx++);t.classList.add(n),this._stack.unshift({elOld:t,el:t,className:n,cssKV:e,updated:!x.delayBgJudge,cb:r})}},{key:"contains",value:function(t,e){var r=t.getBoundingClientRect(),n=[];for(this._stack.forEach((function(t,e){if(t.updated){t.rect||(t.rect=t.el.getBoundingClientRect());var a=t.rect;r.top>=a.bottom||r.bottom<=a.top||r.left>=a.right||r.right<=a.left||n.unshift(e)}}));n.length;){var a=n.shift(),o=this._stack.splice(a,1)[0];"function"==typeof e&&e(o)}}},{key:"update",value:function(t){this._stack.forEach((function(e){e.updated||Array.prototype.some.call(t,(function(t){return!(1!==t.nodeType||!t.classList.contains(e.className)||(e.el=t,e.updated=!0,0))}))}))}}])&&F(e.prototype,r),n&&F(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function I(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,a,o=[],i=!0,l=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);i=!0);}catch(t){l=!0,a=t}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return q(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return q(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function q(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function R(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function $(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var V=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),$(this,"_firstPageStyle",""),$(this,"_otherPageStyle",""),$(this,"_watcher",{}),$(this,"isFinish",!1)}var e,r,n;return e=t,(r=[{key:"genCssKV",value:function(t,e){var r,n;return null===(r=(n=this._watcher)[t])||void 0===r||r.call(n),"".concat(t,": ").concat(e," !important;")}},{key:"genCss",value:function(t,e){return"".concat("dark"===x.mode?"html.".concat(i," "):"").concat(x.cssSelectorsPrefix&&"".concat(x.cssSelectorsPrefix," "),".").concat(t,"{").concat(e,"}")}},{key:"addCss",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this[e?"_firstPageStyle":"_otherPageStyle"]+=t,le.addCss(e)}},{key:"writeStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];!t&&fe.isDarkmode&&(this.isFinish=!0);var e=(fe.isDarkmode?[{target:this,key:["_firstPageStyle","_otherPageStyle"],needMediaQuery:!0}]:[]).concat([{target:le,key:["firstPageStyle","otherPageStyle"],needMediaQuery:!0},{target:le,key:["firstPageStyleNoMQ","otherPageStyleNoMQ"],needMediaQuery:!1}]).map((function(e){var r=e.target,n=I(e.key,2),o=n[0],i=n[1],l=e.needMediaQuery,u="";t?u=o:(r[i]=r[o]+r[i],r[o]="",u=i);var s=r[u];return s?(r[u]="","dark"!==x.mode&&l?"@media ".concat(a," {").concat(s,"}"):s):""})).join("");e&&document.head.insertAdjacentHTML("beforeend",'<style type="text/css">'.concat(e,"</style>"))}},{key:"watch",value:function(t,e){this._watcher[t]=e}},{key:"unwatch",value:function(t){delete this._watcher[t]}}])&&R(e.prototype,r),n&&R(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function K(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function z(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function H(t){return function(t){if(Array.isArray(t))return J(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return J(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return J(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function J(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function U(t){var e,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(e=r?[]:[t]).concat.apply(e,H(t.querySelectorAll("*")))}var Q={"ue-table-interlace-color-single":"#fcfcfc","ue-table-interlace-color-double":"#f7faff"};var G=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),z(this,"_els",[]),z(this,"_firstPageEls",[]),z(this,"_delayEls",[]),z(this,"showFirstPage",!1)}var e,r,n;return e=t,(r=[{key:"length",get:function(){return this._els.length}},{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this._els=t}},{key:"get",value:function(){var t=[];return this._els.length?(t=this._els,fe.isDarkmode&&(this._els=[])):this._delayEls.length?(t=this._delayEls,this._delayEls=[]):x.container&&(t=x.container.querySelectorAll("*")),t}},{key:"delay",value:function(){var t=this;Array.prototype.forEach.call(this._els,(function(e){return t._delayEls.push(e)})),this._els=[]}},{key:"hasDelay",value:function(){return!this._els.length&&(this._delayEls.length>0||null!==x.container)}},{key:"addFirstPageNode",value:function(t){this._firstPageEls.push(t)}},{key:"showFirstPageNodes",value:function(){this._firstPageEls.forEach((function(t){return!t.style.visibility&&(t.style.visibility="visible")})),this.showFirstPage=!0}},{key:"emptyFirstPageNodes",value:function(){this._firstPageEls=[]}}])&&K(e.prototype,r),n&&K(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),W=r(0),X=r.n(W),Y=r(1),Z=r.n(Y);function tt(t,e,r){return{r:255*r(t.r/255,e.r/255),g:255*r(t.g/255,e.g/255),b:255*r(t.b/255,e.b/255)}}function et(t,e){return e}function rt(t,e){return t*e}function nt(t,e){return t+e-t*e}function at(t,e){return st(e,t)}function ot(t,e){return Math.min(t,e)}function it(t,e){return Math.min(Math.max(t,e),1)}function lt(t,e){return 0===t?0:1===e?1:Math.min(1,t/(1-e))}function ut(t,e){return 1===t?1:0===e?0:1-Math.min(1,(1-t)/e)}function st(t,e){return e<=.5?rt(t,2*e):nt(t,2*e-1)}function ct(t,e){return e<=.5?t-(1-2*e)*t*(1-t):t+(2*e-1)*((t<=.25?((16*t-12)*t+4)*t:Math.sqrt(t))-t)}function ht(t,e){return Math.abs(t-e)}function ft(t,e){return t+e-2*t*e}function dt(t,e,r){return Math.min(Math.max(t||0,e),r)}function gt(t){return{r:dt(t.r,0,255),g:dt(t.g,0,255),b:dt(t.b,0,255),a:dt(t.a,0,1)}}function bt(t){return{r:255*t.r,g:255*t.g,b:255*t.b,a:t.a}}function pt(t){return{r:t.r/255,g:t.g/255,b:t.b/255,a:t.a}}function yt(t,e){void 0===e&&(e=0);var r=Math.pow(10,e);return{r:Math.round(t.r*r)/r,g:Math.round(t.g*r)/r,b:Math.round(t.b*r)/r,a:t.a}}function mt(t,e,r,n,a,o){return(1-e/r)*n+e/r*Math.round((1-t)*a+t*o)}function vt(t,e,r,n,a){void 0===a&&(a={unitInput:!1,unitOutput:!1,roundOutput:!0}),a.unitInput&&(t=bt(t),e=bt(e)),t=gt(t);var o=(e=gt(e)).a+t.a-e.a*t.a,i=r(t,e,n),l=gt({r:mt(t.a,e.a,o,t.r,e.r,i.r),g:mt(t.a,e.a,o,t.g,e.g,i.g),b:mt(t.a,e.a,o,t.b,e.b,i.b),a:o});return l=a.unitOutput?pt(l):a.roundOutput?yt(l):function(t){return yt(t,9)}(l)}function kt(t,e,r){return bt(r(pt(t),pt(e)))}function wt(t){return.3*t.r+.59*t.g+.11*t.b}function xt(t,e){var r=e-wt(t);return function(t){var e=wt(t),r=t.r,n=t.g,a=t.b,o=Math.min(r,n,a),i=Math.max(r,n,a);function l(t){return e+(t-e)*e/(e-o)}function u(t){return e+(t-e)*(1-e)/(i-e)}return o<0&&(r=l(r),n=l(n),a=l(a)),i>1&&(r=u(r),n=u(n),a=u(a)),{r:r,g:n,b:a}}({r:t.r+r,g:t.g+r,b:t.b+r})}function Mt(t){return Math.max(t.r,t.g,t.b)-Math.min(t.r,t.g,t.b)}function Ct(t,e){var r=["r","g","b"].sort((function(e,r){return t[e]-t[r]})),n=r[0],a=r[1],o=r[2],i={r:t.r,g:t.g,b:t.b};return i[o]>i[n]?(i[a]=(i[a]-i[n])*e/(i[o]-i[n]),i[o]=e):i[a]=i[o]=0,i[n]=0,i}function _t(t,e){return xt(Ct(e,Mt(t)),wt(t))}function Ot(t,e){return xt(Ct(t,Mt(e)),wt(t))}function St(t,e){return xt(e,wt(t))}function jt(t,e){return xt(t,wt(e))}function Bt(t,e){return vt(t,e,tt,et)}function Pt(t,e){return vt(t,e,tt,rt)}function Et(t,e){return vt(t,e,tt,nt)}function At(t,e){return vt(t,e,tt,at)}function Tt(t,e){return vt(t,e,tt,ot)}function Dt(t,e){return vt(t,e,tt,it)}function Ft(t,e){return vt(t,e,tt,lt)}function Nt(t,e){return vt(t,e,tt,ut)}function Lt(t,e){return vt(t,e,tt,st)}function It(t,e){return vt(t,e,tt,ct)}function qt(t,e){return vt(t,e,tt,ht)}function Rt(t,e){return vt(t,e,tt,ft)}function $t(t,e){return vt(t,e,kt,_t)}function Vt(t,e){return vt(t,e,kt,Ot)}function Kt(t,e){return vt(t,e,kt,St)}function zt(t,e){return vt(t,e,kt,jt)}Z.a.windowtext=[0,0,0],Z.a.transparent=[255,255,255,0];var Ht=new RegExp(Object.keys(Z.a).map((function(t){return"\\b".concat(t,"\\b")})).join("|"),"ig"),Jt=function(t){var e=t.object();return e.a=e.alpha||1,delete e.alpha,e},Ut=function(t){return t.alpha=t.a,delete t.a,Qt(t)},Qt=function(t){var e=null;try{e=t instanceof X.a?t:X()(t)}catch(e){console.log("ignore the invalid color: `".concat(t,"`"))}return e},Gt=function(t,e){return t.replace(m,"").replace(Ht,(function(t){if(!e&&"transparent"===t)return t;var r=Z.a[t.toLowerCase()];return"".concat(r.length>3?"rgba":"rgb","(").concat(r.toString(),")")}))},Wt=function(t){var e=Gt(t);return k.test(e)?e:""},Xt=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"mix";if("[object Array]"!==Object.prototype.toString.call(t)||t.length<1)return null;if(1===t.length)return t[0];for(var r=Qt(t.shift()),a=Qt(t.shift());a;){if(!r&&a)r=a;else if(r||a)r&&a&&(r="mix"===e?r.mix(a,a.alpha()):Ut(n[e](Jt(r),Jt(a))));else{if(0===t.length)break;r=Qt(t.shift())}if(0===t.length)break;a=Qt(t.shift())}return r||null},Yt=function(t){return(299*t[0]+587*t[1]+114*t[2])/1e3},Zt=function(t,e){var r=t/Yt(e),n=Math.min(255,e[0]*r),a=Math.min(255,e[1]*r),o=Math.min(255,e[2]*r);return 0===a||255===n||255===o?a=(1e3*t-299*n-114*o)/587:0===n?n=(1e3*t-587*a-114*o)/299:0!==o&&255!==a||(o=(1e3*t-299*n-587*a)/114),X.a.rgb(n,a,o)};function te(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,a,o=[],i=!0,l=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);i=!0);}catch(t){l=!0,a=t}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}(t,e)||re(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ee(t){return function(t){if(Array.isArray(t))return ne(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||re(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function re(t,e){if(t){if("string"==typeof t)return ne(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ne(t,e):void 0}}function ne(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ae(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function oe(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var ie=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),oe(this,"_idx",0),oe(this,"_defaultDarkTextColorRgb",null),oe(this,"_defaultDarkBgColorRgb",null),oe(this,"_defaultDarkBgColorHSL",null),oe(this,"_defaultDarkTextColorBrightness",null),oe(this,"_defaultDarkBgColorBrightness",null),oe(this,"_defaultDarkBgColorHslBrightness",null),oe(this,"_maxLimitOffsetBrightness",null),oe(this,"isDarkmode",!1)}var e,r,n;return e=t,(r=[{key:"_adjustBrightness",value:function(t,e,r,n,a){var o,i=t.alpha(),l="";if(r.isBgColor){if(i>=.05&&(e[f]&&delete e[f],e[d])){if(e[d]===t.toString()||this.getContrast(e[d],t.toString())<1.1)return{newColor:a?t.toString():"",extStyle:l};U(e).forEach((function(t){delete t[d]}))}if(o=this._adjustBackgroundBrightness(t),!r.hasInlineColor){var u=e[c]||x.defaultLightTextColor,h=Qt(u);if(h){var g=this._adjustBrightness(h,e,{isTextColor:!0,parentElementBgColorStr:o||t},n,a);g.newColor?l+=ce.genCssKV("color",g.newColor):l+=ce.genCssKV("color",h)}}}else if(r.isTextColor||r.isBorderColor){var b=r.parentElementBgColorStr||r.isTextColor&&e[s]||x.defaultDarkBgColor,p=Qt(b);if(p&&!e[f]){o=this._adjustTextBrightness(t,p);var y="";n?y="ByUpdateStyle":a&&(y="ByReset"),le.emit("afterConvertTextColor".concat(y),e,{fontColor:o,bgColor:p})}}else r.isTextShadow&&(e[f]||(o=this._adjustBackgroundBrightness(t)));return{newColor:o&&t.toString()!==o.toString()&&o.alpha(i).rgb(),extStyle:l}}},{key:"_adjustTextBrightness",value:function(t,e){var r=e.rgb().array(),n=e.alpha(),a=Yt(r)*n+this._defaultDarkBgColorBrightness*(1-n),o=t.rgb().array(),i=t.hsl().array(),l=t.alpha(),u=Yt(o),s=Math.abs(a-u);if(u>=250)return t;if(s>this._maxLimitOffsetBrightness&&a<=this._defaultDarkBgColorBrightness+2)return Zt(this._maxLimitOffsetBrightness+a,o).alpha(l);if(s>=65)return t;if(a>=100){if(i[2]>50){i[2]=90-i[2];var c=X.a.hsl.apply(X.a,ee(i)).alpha(l);return this._adjustTextBrightness(c,e)}return Zt(Math.min(this._maxLimitOffsetBrightness,a-65),o).alpha(l)}if(i[2]<=40){i[2]=90-i[2];var h=X.a.hsl.apply(X.a,ee(i)).alpha(l);return this._adjustTextBrightness(h,e)}return Zt(Math.min(this._maxLimitOffsetBrightness,a+65),o).alpha(l)}},{key:"_adjustBackgroundBrightness",value:function(t){var e=t.rgb().array(),r=t.hsl().array(),n=t.alpha(),a=Yt(e),o=t;return 0===r[1]&&r[2]>40||a>250?o=X.a.hsl(0,0,Math.min(100,100+this._defaultDarkBgColorHslBrightness-r[2])):a>190?o=Zt(190,e).alpha(n):r[2]<22&&(r[2]=22,o=X.a.hsl.apply(X.a,ee(r))),o.alpha(n).rgb()}},{key:"_updateBgWithGradient",value:function(t,e,r,n,a,o,i){var l=Xt([e[s]||x.defaultDarkBgColor,t],"normal"),u=(e[h]||x.defaultLightBgColor).split("|").concat(t.toString()).join("|");U(e).forEach((function(t){t[s]=l,t[h]=u}));var c=n.slice(-1)[0];if("color"===c[0]){var f=this._adjustBrightness(Qt(Gt(c[1])),e,{isBgColor:!1,isTextShadow:!1,isTextColor:!0,isBorderColor:!1,hasInlineColor:a},o,i);if(f.newColor)return ce.genCss(r,ce.genCssKV("color",f.newColor))}return""}},{key:"_try",value:function(t){try{return t()}catch(t){console.log("An error occurred when running the dark mode conversion algorithm\n",t),"function"==typeof x.error&&x.error(t)}}},{key:"init",value:function(){this._defaultDarkTextColorRgb=Qt(x.defaultDarkTextColor).rgb().array(),this._defaultDarkBgColorRgb=Qt(x.defaultDarkBgColor).rgb().array(),this._defaultDarkBgColorHSL=Qt(x.defaultDarkBgColor).hsl().array(),this._defaultDarkTextColorBrightness=Yt(this._defaultDarkTextColorRgb),this._defaultDarkBgColorBrightness=Yt(this._defaultDarkBgColorRgb),this._defaultDarkBgColorHslBrightness=this._defaultDarkBgColorHSL[2],this._maxLimitOffsetBrightness=this._defaultDarkTextColorBrightness-this._defaultDarkBgColorBrightness}},{key:"convert",value:function(t,e,r,n){var a=this;le.resetCss();var i="";r?i="ByUpdateStyle":n&&(i="ByReset"),le.emit("beforeConvertNode".concat(i),t);var l="",g="";if(this.isDarkmode||r||n){var M=t.nodeName;if(x.whitelist.tagName.indexOf(M)>-1)return"";if(x.whitelist.attribute.some((function(e){return t.hasAttribute(e)})))return"";var C=t.style;e||(e=(C.cssText&&C.cssText.replace(/("[^;]*);([^;]*")|('[^;]*);([^;]*')/g,"$1$3".concat("<$#_SEMICOLON_#$>","$2$4")).split(";")||[]).map((function(t){var e=t.indexOf(":");return[t.slice(0,e).toLowerCase(),t.slice(e+1).replace(v,";")].map((function(t){return(t||"").replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}))})));var _=!1,O=!1,S=!1,j=null,B=null;e=e.filter((function(t){var e=te(t,2),r=e[0],n=e[1];return"color"===r?_=!0:/background/i.test(r)&&(O=!0,"background-position"===r?j=n:"background-size"===r&&(B=n)),(/background/i.test(r)||/^(-webkit-)?border-image/.test(r))&&/url\([^)]*\)/i.test(n)&&(S=!0),p.indexOf(r)>-1})).sort((function(t,e){var r=te(t,1)[0],n=te(e,1)[0];return"color"===r||"background-image"===r&&"background-color"===n||0===n.indexOf("-webkit-text")?1:-1})),y.indexOf(M)>-1&&!O&&this._try((function(){var r=function(t){var e=null;return Array.prototype.some.call(t.classList,(function(t){return!!Q[t]&&(e=Q[t],!0)})),e}(t);if(r||(r=t.getAttribute("bgcolor")),r){var n=Qt(r);n&&(e.unshift(["background-color",n.toString()]),O=!0)}})),"FONT"!==M||_||this._try((function(){var r=t.getAttribute("color");if(r){var n=Qt(r);n&&(e.push(["color",n.toString()]),_=!0)}}));var P="",E="",A=0;e.some((function(t,e){var r=te(t,2),n=r[0],o=r[1];return a._try((function(){if(0!==n.indexOf("-webkit-text"))return A=e,!0;switch(n){case"-webkit-text-fill-color":P=Wt(o);break;case"-webkit-text-stroke":var t=o.split(" ");2===t.length&&(E=Wt(t[1]));break;case"-webkit-text-stroke-color":E=Wt(o)}return!1}))})),P&&(_?e[e.length-1]=["-webkit-text-fill-color",P]:(e.push(["-webkit-text-fill-color",P]),_=!0)),A&&(e.splice(0,A),E&&e.unshift(["-webkit-text-stroke-color",E]));var T="",D="";if((r||n)&&t.className&&"string"==typeof t.className){var F=t.className.match(o);F&&(T=F[0]),(F=t.className.match(se.classNameReg))&&(D=F[0])}var N="",L=n;L&&ce.watch("color",(function(){L=!1,ce.unwatch("color")})),e.forEach((function(o){var i=te(o,2),p=i[0],y=i[1];return a._try((function(){var o,i=y,v=!1,M=b.BG_COLOR.indexOf(p)>-1,P=b.TEXT_SHADOW.indexOf(p)>-1,E=b.TEXT_COLOR.indexOf(p),A=b.BORDER_COLOR.indexOf(p)>-1,T=/gradient/.test(y),F=[],I="";if(y=Gt(y,T),k.test(y)){if(T){for(var q=w.exec(y);q;)F.push(q[0]),q=w.exec(y);o=Xt(F)}var R=0;y=y.replace(w,(function(e){T&&(e=o,v=!0);var i=Qt(e);if((null==i?void 0:i.alpha())>=.05){var l=a._adjustBrightness(i,t,{isBgColor:M,isTextShadow:P,isTextColor:E>-1,isBorderColor:A,hasInlineColor:_},r,n),d=!S&&l.newColor;if(I+=l.extStyle,M||E>=5){var g=d?d.toString():e;0===R&&U(t).forEach((function(t){M?(t[s]=g,t[h]=(t[h]||x.defaultLightBgColor).split("|").concat(e).join("|")):(t[u]=g,t[c]=e);var r=Qt(g);M&&(null==r?void 0:r.alpha())>=.05&&t[f]&&delete t[f]}))}return d&&(v=!0),R++,d||e}return e})).replace(/\s?!\s?important/gi,"")}if(I&&(N+=I),!(t instanceof SVGElement)){var $=/^background/.test(p),V=/^(-webkit-)?border-image/.test(p);if(($||V)&&/url\([^)]*\)/i.test(y)){v=!0;var K=Xt((t[h]||x.defaultLightBgColor).split("|"),"normal").toString();if(y=y.replace(/^(.*?)url\(([^)]*)\)(.*)$/i,(function(e){var r=e,a="";return t[f]||U(t).forEach((function(t){t[f]=!0})),$?(a=ce.genCssKV(p,K?"".concat(r,",linear-gradient(").concat(K,", ").concat(K,")"):r),j&&(N+=ce.genCssKV("background-position",j),a+=ce.genCssKV("background-position",K?"".concat(j,",top left"):j)),B&&(N+=ce.genCssKV("background-size",B),a+=ce.genCssKV("background-size",K?"".concat(B,",100%"):B)),n||(D?(g+=ce.genCss(D,a),U(t).forEach((function(t){t[d]=K||r}))):se.push(t,a,(function(){U(t).forEach((function(t){t[d]=K||r}))})))):!K||O||n||(a=ce.genCssKV("background-image","linear-gradient(".concat(K,", ").concat(K,")")),D?g+=ce.genCss(D,a):se.push(t,a)),r})),!_){var z=t[c]||x.defaultLightTextColor;N+=ce.genCssKV("color",z),U(t).forEach((function(t){t[u]=z}))}}}(v||n)&&(!r&&!n&&m.test(i)&&(C[p]=i.replace(m,"")),T?n||(D?(g+=ce.genCss(D,ce.genCssKV(p,y)),/^background/.test(p)&&!/url\([^)]*\)/i.test(y)&&(l+=a._updateBgWithGradient(o,t,D,e,_,r,n))):se.push(t,ce.genCssKV(p,y),(function(i){/^background/.test(p)&&!/url\([^)]*\)/i.test(y)&&(l+=a._updateBgWithGradient(o,t,i.className,e,_,r,n))}))):("color"===p&&(L=!1,ce.unwatch("color")),N+=ce.genCssKV(p,!v&&n?t.style[p]:y)))}))})),L&&(N+=ce.genCssKV("color",t.style.color||t[u]||x.defaultDarkTextColor),ce.unwatch("color")),N&&(T||(T="".concat("js_darkmode__").concat(this._idx++),t.classList.add(T)),l+=N?ce.genCss(T,N):""),l+=g,r||!function(t){return t.textContent.replace(/\s/g,"").length>0}(t)||n||(x.delayBgJudge?ue.push(t):se.contains(t,(function(t){l+=ce.genCss(t.className,t.cssKV),"function"==typeof t.cb&&t.cb(t)})))}return le.emit("afterConvertNode".concat(i),t),l}},{key:"getContrast",value:function(t,e){var r=Qt(t),n=Qt(e);return r&&n?r.contrast(n):0}}])&&ae(e.prototype,r),n&&ae(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),le=new P,ue=new D("".concat("js_darkmode__","text__")),se=new L("".concat("js_darkmode__","bg__")),ce=new V,he=new G,fe=new ie;function de(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,a,o=[],i=!0,l=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);i=!0);}catch(t){l=!0,a=t}finally{try{i||null==r.return||r.return()}finally{if(l)throw a}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return ge(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ge(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ge(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var be=new RegExp("".concat("js_darkmode__","[^ ]+"),"g"),pe=null,ye=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{type:"dom"};if(e.force&&(ce.isFinish=!1),!ce.isFinish)try{fe.isDarkmode=x.mode?"dark"===x.mode:t.matches,"dom"===e.type?(fe.isDarkmode&&"function"==typeof x.begin&&x.begin(he.hasDelay()),Array.prototype.forEach.call(he.get(),(function(t){if(fe.isDarkmode&&t.className&&"string"==typeof t.className&&(t.className=t.className.replace(be,"")),fe.isDarkmode||le.length)if(x.needJudgeFirstPage){var e=t.getBoundingClientRect(),r=e.top,n=e.bottom;r<=0&&n<=0?ce.addCss(fe.convert(t)):r>0&&r<g||n>0&&n<g?(he.addFirstPageNode(t),ce.addCss(fe.convert(t),!0)):(x.needJudgeFirstPage=!1,ce.writeStyle(!0),he.showFirstPageNodes(),"function"==typeof x.showFirstPage&&x.showFirstPage(),ce.addCss(fe.convert(t)))}else ce.addCss(fe.convert(t))})),le.loopTimes++):"bg"===e.type&&fe.isDarkmode&&ue.forEach((function(t){return se.contains(t,(function(t){ce.addCss(ce.genCss(t.className,t.cssKV)),"function"==typeof t.cb&&t.cb(t),[t.elOld,t.el].forEach((function(t){var e,r,n,a,o,i,l=[[u,null!==(e=t[u])&&void 0!==e?e:null],[s,null!==(r=t[s])&&void 0!==r?r:null],[c,null!==(n=t[c])&&void 0!==n?n:null],[h,null!==(a=t[h])&&void 0!==a?a:null],[f,null!==(o=t[f])&&void 0!==o?o:null],[d,null!==(i=t[d])&&void 0!==i?i:null]],g=U(t,!0);g.forEach((function(t){l.forEach((function(e){var r=de(e,2),n=r[0],a=r[1];null===a?delete t[n]:t[n]=a}))})),g.forEach((function(t){ce.addCss(fe.convert(t,void 0,!1,!0))}))}))}))})),(x.needJudgeFirstPage||!x.needJudgeFirstPage&&!he.showFirstPage)&&"function"==typeof x.showFirstPage&&x.showFirstPage(),ce.writeStyle(),he.emptyFirstPageNodes(),fe.isDarkmode||(x.needJudgeFirstPage=!1,x.delayBgJudge=!1,null===x.container&&"dom"===e.type&&he.length&&he.delay())}catch(t){console.log("An error occurred when running the dark mode conversion algorithm\n",t),"function"==typeof x.error&&x.error(t)}};function me(t,e){ve(e),he.set(t),ye(pe,{force:!0,type:"dom"})}function ve(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!x.hasInit){x.hasInit=!0;var e=x.whitelist.tagName,r=x.whitelist.attribute;t.whitelist&&(t.whitelist.tagName instanceof Array&&t.whitelist.tagName.forEach((function(t){t=t.toUpperCase(),-1===e.indexOf(t)&&e.push(t)})),t.whitelist.attribute instanceof Array&&t.whitelist.attribute.forEach((function(t){-1===r.indexOf(t)&&r.push(t)}))),["dark","light"].indexOf(t.mode)>-1&&(x.set("string",t,"mode"),"dark"===t.mode&&document.getElementsByTagName("html")[0].classList.add(i)),x.set("function",t,"begin"),x.set("function",t,"showFirstPage"),x.set("function",t,"error"),x.set("boolean",t,"needJudgeFirstPage"),x.set("boolean",t,"delayBgJudge"),x.set("dom",t,"container"),x.set("string",t,"cssSelectorsPrefix"),x.set("string",t,"defaultLightTextColor"),x.set("string",t,"defaultLightBgColor"),x.set("string",t,"defaultDarkTextColor"),x.set("string",t,"defaultDarkBgColor"),fe.init(),!x.mode&&null===pe&&window.matchMedia&&(pe=window.matchMedia(a)).addListener(ye)}}function ke(t){he.set(t),null!==x.container&&(se.update(t),ue.update(t)),ye(pe,{force:!0,type:"bg"})}function we(t,e){ce.isFinish&&(ce.addCss(fe.convert(t,e?Object.keys(e).map((function(t){return[t,e[t]]})):void 0,!0),!1),ce.writeStyle())}function xe(t,e){return fe.getContrast(t,e)}function Me(t){t.forEach((function(t){return le.extend(t)}))}}])}));
|