1/*! For license information please see color-thief.min.js.LICENSE.txt */ 2var CanvasImage=function(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),document.body.appendChild(this.canvas),this.width=this.canvas.width=t.width,this.height=this.canvas.height=t.height,this.context.drawImage(t,0,0,this.width,this.height)};CanvasImage.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},CanvasImage.prototype.update=function(t){this.context.putImageData(t,0,0)},CanvasImage.prototype.getPixelCount=function(){return this.width*this.height},CanvasImage.prototype.getImageData=function(){return this.context.getImageData(0,0,this.width,this.height)},CanvasImage.prototype.removeCanvas=function(){this.canvas.parentNode.removeChild(this.canvas)};var ColorThief=function(){};if(ColorThief.prototype.getColor=function(t,r){return this.getPalette(t,5,r)[0]},ColorThief.prototype.getPalette=function(t,r,n){void 0===r&&(r=10),void 0===n&&(n=10);for(var o,e,a,i,u=new CanvasImage(t),c=u.getImageData().data,f=u.getPixelCount(),s=[],v=0;f>v;v+=n)e=c[(o=4*v)+0],a=c[o+1],i=c[o+2],c[o+3]>=125&&(e>250&&a>250&&i>250||s.push([e,a,i]));var h=MMCQ.quantize(s,r).palette();return u.removeCanvas(),h},!pv)var pv={map:function(t,r){var n={};return r?t.map((function(t,o){return n.index=o,r.call(n,t)})):t.slice()},naturalOrder:function(t,r){return r>t?-1:t>r?1:0},sum:function(t,r){var n={};return t.reduce(r?function(t,o,e){return n.index=e,t+r.call(n,o)}:function(t,r){return t+r},0)},max:function(t,r){return Math.max.apply(null,r?pv.map(t,r):t)}};var MMCQ=function(){function t(t,r,n){return(t<<2*u)+(r<<u)+n}function r(t){function r(){n.sort(t),o=!0}var n=[],o=!1;return{push:function(t){n.push(t),o=!1},peek:function(t){return o||r(),void 0===t&&(t=n.length-1),n[t]},pop:function(){return o||r(),n.pop()},size:function(){return n.length},map:function(t){return n.map(t)},debug:function(){return o||r(),n}}}function n(t,r,n,o,e,a,i){var u=this;u.r1=t,u.r2=r,u.g1=n,u.g2=o,u.b1=e,u.b2=a,u.histo=i}function o(){this.vboxes=new r((function(t,r){return pv.naturalOrder(t.vbox.count()*t.vbox.volume(),r.vbox.count()*r.vbox.volume())}))}function e(r){var n,o,e,a,i=new Array(1<<3*u);return r.forEach((function(r){o=r[0]>>c,e=r[1]>>c,a=r[2]>>c,n=t(o,e,a),i[n]=(i[n]||0)+1})),i}function a(t,r){var o,e,a,i=1e6,u=0,f=1e6,s=0,v=1e6,h=0;return t.forEach((function(t){o=t[0]>>c,e=t[1]>>c,a=t[2]>>c,i>o?i=o:o>u&&(u=o),f>e?f=e:e>s&&(s=e),v>a?v=a:a>h&&(h=a)})),new n(i,u,f,s,v,h,r)}function i(r,n){if(n.count()){var o=n.r2-n.r1+1,e=n.g2-n.g1+1,a=n.b2-n.b1+1,i=pv.max([o,e,a]);if(1==n.count())return[n.copy()];var u,c,f,s,v=0,h=[],p=[];if(i==o)for(u=n.r1;u<=n.r2;u++){for(s=0,c=n.g1;c<=n.g2;c++)for(f=n.b1;f<=n.b2;f++)s+=r[t(u,c,f)]||0;v+=s,h[u]=v}else if(i==e)for(u=n.g1;u<=n.g2;u++){for(s=0,c=n.r1;c<=n.r2;c++)for(f=n.b1;f<=n.b2;f++)s+=r[t(c,u,f)]||0;v+=s,h[u]=v}else for(u=n.b1;u<=n.b2;u++){for(s=0,c=n.r1;c<=n.r2;c++)for(f=n.g1;f<=n.g2;f++)s+=r[t(c,f,u)]||0;v+=s,h[u]=v}return h.forEach((function(t,r){p[r]=v-t})),function(t){var r,o,e,a,i,c=t+"1",f=t+"2",s=0;for(u=n[c];u<=n[f];u++)if(h[u]>v/2){for(e=n.copy(),a=n.copy(),r=u-n[c],i=(o=n[f]-u)>=r?Math.min(n[f]-1,~~(u+o/2)):Math.max(n[c],~~(u-1-r/2));!h[i];)i++;for(s=p[i];!s&&h[i-1];)s=p[--i];return e[f]=i,a[c]=e[f]+1,[e,a]}}(i==o?"r":i==e?"g":"b")}}var u=5,c=8-u,f=1e3,s=.75;return n.prototype={volume:function(t){var r=this;return(!r._volume||t)&&(r._volume=(r.r2-r.r1+1)*(r.g2-r.g1+1)*(r.b2-r.b1+1)),r._volume},count:function(r){var n=this,o=n.histo;if(!n._count_set||r){var e,a,i,u=0;for(e=n.r1;e<=n.r2;e++)for(a=n.g1;a<=n.g2;a++)for(i=n.b1;i<=n.b2;i++)index=t(e,a,i),u+=o[index]||0;n._count=u,n._count_set=!0}return n._count},copy:function(){var t=this;return new n(t.r1,t.r2,t.g1,t.g2,t.b1,t.b2,t.histo)},avg:function(r){var n=this,o=n.histo;if(!n._avg||r){var e,a,i,c,f=0,s=1<<8-u,v=0,h=0,p=0;for(a=n.r1;a<=n.r2;a++)for(i=n.g1;i<=n.g2;i++)for(c=n.b1;c<=n.b2;c++)f+=e=o[t(a,i,c)]||0,v+=e*(a+.5)*s,h+=e*(i+.5)*s,p+=e*(c+.5)*s;n._avg=f?[~~(v/f),~~(h/f),~~(p/f)]:[~~(s*(n.r1+n.r2+1)/2),~~(s*(n.g1+n.g2+1)/2),~~(s*(n.b1+n.b2+1)/2)]}return n._avg},contains:function(t){var r=this,n=t[0]>>c;return gval=t[1]>>c,bval=t[2]>>c,n>=r.r1&&n<=r.r2&&gval>=r.g1&&gval<=r.g2&&bval>=r.b1&&bval<=r.b2}},o.prototype={push:function(t){this.vboxes.push({vbox:t,color:t.avg()})},palette:function(){return this.vboxes.map((function(t){return t.color}))},size:function(){return this.vboxes.size()},map:function(t){for(var r=this.vboxes,n=0;n<r.size();n++)if(r.peek(n).vbox.contains(t))return r.peek(n).color;return this.nearest(t)},nearest:function(t){for(var r,n,o,e=this.vboxes,a=0;a<e.size();a++)(r>(n=Math.sqrt(Math.pow(t[0]-e.peek(a).color[0],2)+Math.pow(t[1]-e.peek(a).color[1],2)+Math.pow(t[2]-e.peek(a).color[2],2)))||void 0===r)&&(r=n,o=e.peek(a).color);return o},forcebw:function(){var t=this.vboxes;t.sort((function(t,r){return pv.naturalOrder(pv.sum(t.color),pv.sum(r.color))}));var r=t[0].color;r[0]<5&&r[1]<5&&r[2]<5&&(t[0].color=[0,0,0]);var n=t.length-1,o=t[n].color;o[0]>251&&o[1]>251&&o[2]>251&&(t[n].color=[255,255,255])}},{quantize:function(t,n){function u(t,r){for(var n,o=1,e=0;f>e;)if((n=t.pop()).count()){var a=i(c,n),u=a[0],s=a[1];if(!u)return;if(t.push(u),s&&(t.push(s),o++),o>=r)return;if(e++>f)return}else t.push(n),e++}if(!t.length||2>n||n>256)return!1;var c=e(t);
2c.forEach((function(){0}));var v=a(t,c),h=new r((function(t,r){return pv.naturalOrder(t.count(),r.count())}));h.push(v),u(h,s*n);for(var p=new r((function(t,r){return pv.naturalOrder(t.count()*t.volume(),r.count()*r.volume())}));h.size();)p.push(h.pop());u(p,n-p.size());for(var g=new o;p.size();)g.push(p.pop());return g}}}();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.