stac-layer
Version:
Visualize a STAC Item or Collection on a Leaflet Map
2 lines • 1.25 MB
JavaScript
/*! For license information please see stac-layer.min.js.LICENSE.txt */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("leaflet")):"function"==typeof define&&define.amd?define(["leaflet"],e):"object"==typeof exports?exports.STACLayer=e(require("leaflet")):t.STACLayer=e(t.L)}(self,(t=>(()=>{var e={801:t=>{"use strict";var e=Math.PI/180,r=180/Math.PI;function n(t){var e=i(t[0]+1,t[2]);return[i(t[0],t[2]),o(t[1]+1,t[2]),e,o(t[1],t[2])]}function i(t,e){return t/Math.pow(2,e)*360-180}function o(t,e){var n=Math.PI-2*Math.PI*t/Math.pow(2,e);return r*Math.atan(.5*(Math.exp(n)-Math.exp(-n)))}function a(t,e,r){var n=f(t,e,r);return n[0]=Math.floor(n[0]),n[1]=Math.floor(n[1]),n}function s(t){return[[2*t[0],2*t[1],t[2]+1],[2*t[0]+1,2*t[1],t[2]+1],[2*t[0]+1,2*t[1]+1,t[2]+1],[2*t[0],2*t[1]+1,t[2]+1]]}function l(t){return[t[0]>>1,t[1]>>1,t[2]-1]}function h(t){return s(l(t))}function u(t,e){for(var r=0;r<t.length;r++)if(c(t[r],e))return!0;return!1}function c(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function f(t,r,n){var i=Math.sin(r*e),o=Math.pow(2,n),a=o*(t/360+.5);return(a%=o)<0&&(a+=o),[a,o*(.5-.25*Math.log((1+i)/(1-i))/Math.PI),n]}t.exports={tileToGeoJSON:function(t){var e=n(t);return{type:"Polygon",coordinates:[[[e[0],e[3]],[e[0],e[1]],[e[2],e[1]],[e[2],e[3]],[e[0],e[3]]]]}},tileToBBOX:n,getChildren:s,getParent:l,getSiblings:h,hasTile:u,hasSiblings:function(t,e){for(var r=h(t),n=0;n<r.length;n++)if(!u(e,r[n]))return!1;return!0},tilesEqual:c,tileToQuadkey:function(t){for(var e="",r=t[2];r>0;r--){var n=0,i=1<<r-1;0!=(t[0]&i)&&n++,0!=(t[1]&i)&&(n+=2),e+=n.toString()}return e},quadkeyToTile:function(t){for(var e=0,r=0,n=t.length,i=n;i>0;i--){var o=1<<i-1,a=+t[n-i];1===a&&(e|=o),2===a&&(r|=o),3===a&&(e|=o,r|=o)}return[e,r,n]},pointToTile:a,bboxToTile:function(t){var e=a(t[0],t[1],32),r=a(t[2],t[3],32),n=[e[0],e[1],r[0],r[1]],i=function(t){for(var e=0;e<28;e++){var r=1<<32-(e+1);if((t[0]&r)!=(t[2]&r)||(t[1]&r)!=(t[3]&r))return e}return 28}(n);return 0===i?[0,0,0]:[n[0]>>>32-i,n[1]>>>32-i,i]},pointToTileFraction:f}},580:(t,e,r)=>{var n,i={};function o(t,e){var r=e&&e.debug||!1,n=e&&e.useCache||!1,o=e&&e.crossOrigin||null;if(r&&console.log("[easy-image-loader] starting to load",t),n&&i[t])return i[t];var a=new Promise((function(n,i){var a=document.createElement("img");a.onload=function(){r&&console.log("[easy-image-loader] successfully loaded",t),n(a)},a.onerror=function(e){r&&console.error("[easy-image-loader] failed to load",t),i(e)},a.src=t,a.crossOrigin=o,e&&"number"==typeof e.timeout&&setTimeout((function(){r&&console.error("[easy-image-loader] timed out loading",t),i(new Error("timeout"))}),e.timeout)}));return n&&(i[t]=a),a}void 0===(n=function(){return o}.call(e,r,e,t))||(t.exports=n),"undefined"!=typeof window&&(window.loadImage=o),"undefined"!=typeof self&&(self.loadImage=o),void 0!==r.g&&(r.g.loadImage=o),t.exports=o},905:(t,e,r)=>{var n,i,o,a;function s(){"use strict";s=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",o=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var i=e&&e.prototype instanceof f?e:f,o=Object.create(i.prototype),a=new E(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return{value:void 0,done:!0}}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=w(a,r);if(s){if(s===c)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=u(t,e,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===c)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}(t,r,a),o}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=h;var c={};function f(){}function d(){}function p(){}var _={};l(_,i,(function(){return this}));var g=Object.getPrototypeOf,m=g&&g(g(C([])));m&&m!==e&&r.call(m,i)&&(_=m);var v=p.prototype=f.prototype=Object.create(_);function b(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(i,o,a,s){var l=u(t[i],t,o);if("throw"!==l.type){var h=l.arg,c=h.value;return c&&"object"==y(c)&&r.call(c,"__await")?e.resolve(c.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(c).then((function(t){h.value=t,a(h)}),(function(t){return n("throw",t,a,s)}))}s(l.arg)}var i;this._invoke=function(t,r){function o(){return new e((function(e,i){n(t,r,e,i)}))}return i=i?i.then(o,o):o()}}function w(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return c;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,c;var i=n.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,c):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,c)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function M(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function C(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return d.prototype=p,l(v,"constructor",p),l(p,"constructor",d),d.displayName=l(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,l(t,a,"GeneratorFunction")),t.prototype=Object.create(v),t},t.awrap=function(t){return{__await:t}},b(k.prototype),l(k.prototype,o,(function(){return this})),t.AsyncIterator=k,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new k(h(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(v),l(v,a,"Generator"),l(v,i,(function(){return this})),l(v,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=C,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(M),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,c):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),c},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),M(r),c}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;M(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),c}},t}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h(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 u(t){return function(t){if(Array.isArray(t))return g(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_(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 c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function f(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?c(Object(r),!0).forEach((function(e){d(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function d(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function p(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,i,o=[],a=!0,s=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}}(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 _(t,e){if(t){if("string"==typeof t)return g(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)?g(t,e):void 0}}function g(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 y(t){return y="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},y(t)}t=r.nmd(t),self,a=function(n){return function(){var i={1950:function(t,e,r){var n;t=r.nmd(t),function(){var r,i,o,a,s,l,h,u,c,f,d,p,_,g,y,m,v,b,k,w,x,M,E,C,S,A,O,T,I,P,R,L,j,D,N,B,G,F,U,q,z,Q,H,W,K,V,Z,Y,X,J,$,tt,et,rt,nt,it,ot,at,st,lt,ht,ut,ct,ft,dt,pt,_t,gt,yt,mt,vt,bt,kt,wt,xt,Mt,Et,Ct,St,At,Ot=[].slice;Mt=function(){var t,e,r,n,i;for(t={},n=0,e=(i="Boolean Number String Function Array Date RegExp Undefined Null".split(" ")).length;n<e;n++)r=i[n],t["[object "+r+"]"]=r.toLowerCase();return function(e){var r;return r=Object.prototype.toString.call(e),t[r]||"object"}}(),Z=function(t,e,r){return null==e&&(e=0),null==r&&(r=1),t<e&&(t=e),t>r&&(t=r),t},Et=function(t){return t.length>=3?Array.prototype.slice.call(t):t[0]},x=function(t){var e,r;for(t._clipped=!1,t._unclipped=t.slice(0),e=r=0;r<3;e=++r)e<3?((t[e]<0||t[e]>255)&&(t._clipped=!0),t[e]<0&&(t[e]=0),t[e]>255&&(t[e]=255)):3===e&&(t[e]<0&&(t[e]=0),t[e]>1&&(t[e]=1));return t._clipped||delete t._unclipped,t},a=Math.PI,vt=Math.round,E=Math.cos,T=Math.floor,nt=Math.pow,Y=Math.log,kt=Math.sin,wt=Math.sqrt,g=Math.atan2,$=Math.max,_=Math.abs,h=2*a,s=a/3,i=a/180,l=180/a,w=function(){return arguments[0]instanceof r?arguments[0]:function(t,e,r){r.prototype=t.prototype;var n=new r,i=t.apply(n,e);return Object(i)===i?i:n}(r,arguments,(function(){}))},w.default=w,p=[],null!==t&&null!=t.exports&&(t.exports=w),void 0===(n=function(){return w}.apply(e,[]))||(t.exports=n),w.version="1.4.1",d={},c=[],f=!1,r=function(){function t(){var t,e,r,n,i,o,a,s,l;for(o=this,e=[],s=0,n=arguments.length;s<n;s++)null!=(t=arguments[s])&&e.push(t);if(e.length>1&&(a=e[e.length-1]),null!=d[a])o._rgb=x(d[a](Et(e.slice(0,-1))));else{for(f||(c=c.sort((function(t,e){return e.p-t.p})),f=!0),l=0,i=c.length;l<i&&!(a=(r=c[l]).test.apply(r,e));l++);a&&(o._rgb=x(d[a].apply(d,e)))}null==o._rgb&&console.warn("unknown format: "+e),null==o._rgb&&(o._rgb=[0,0,0]),3===o._rgb.length&&o._rgb.push(1)}return t.prototype.toString=function(){return this.hex()},t}(),w._input=d,w.brewer=b={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},function(){var t,e;for(t in e=[],b)e.push(b[t.toLowerCase()]=b[t])}(),w.colors=Ct={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflower:"#6495ed",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},Q=function(){var t,e,r,n,i,a,s;return n=(e=Et(arguments))[0],t=e[1],r=e[2],a=(n+16)/116,i=isNaN(t)?a:a+t/500,s=isNaN(r)?a:a-r/200,a=o.Yn*H(a),i=o.Xn*H(i),s=o.Zn*H(s),[At(3.2404542*i-1.5371385*a-.4985314*s),At(-.969266*i+1.8760108*a+.041556*s),r=At(.0556434*i-.2040259*a+1.0572252*s),e.length>3?e[3]:1]},At=function(t){return 255*(t<=.00304?12.92*t:1.055*nt(t,1/2.4)-.055)},H=function(t){return t>o.t1?t*t*t:o.t2*(t-o.t0)},o={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452},ct=function(){var t,e,r,n,i,o,a;return r=(n=Et(arguments))[0],e=n[1],t=n[2],o=(i=gt(r,e,t))[0],[116*(a=i[1])-16,500*(o-a),200*(a-i[2])]},yt=function(t){return(t/=255)<=.04045?t/12.92:nt((t+.055)/1.055,2.4)},St=function(t){return t>o.t3?nt(t,1/3):t/o.t2+o.t0},gt=function(){var t,e,r,n;return r=(n=Et(arguments))[0],e=n[1],t=n[2],r=yt(r),e=yt(e),t=yt(t),[St((.4124564*r+.3575761*e+.1804375*t)/o.Xn),St((.2126729*r+.7151522*e+.072175*t)/o.Yn),St((.0193339*r+.119192*e+.9503041*t)/o.Zn)]},w.lab=function(){return function(t,e,r){r.prototype=t.prototype;var n=new r,i=t.apply(n,e);return Object(i)===i?i:n}(r,Ot.call(arguments).concat(["lab"]),(function(){}))},d.lab=Q,r.prototype.lab=function(){return ct(this._rgb)},y=function(t){var e,r,n,i,o,a,s,l,h,u,c;return 2===(t=function(){var e,r,n;for(n=[],r=0,e=t.length;r<e;r++)i=t[r],n.push(w(i));return n}()).length?(h=function(){var e,r,n;for(n=[],r=0,e=t.length;r<e;r++)i=t[r],n.push(i.lab());return n}(),o=h[0],a=h[1],e=function(t){var e,r;return r=function(){var r,n;for(n=[],e=r=0;r<=2;e=++r)n.push(o[e]+t*(a[e]-o[e]));return n}(),w.lab.apply(w,r)}):3===t.length?(u=function(){var e,r,n;for(n=[],r=0,e=t.length;r<e;r++)i=t[r],n.push(i.lab());return n}(),o=u[0],a=u[1],s=u[2],e=function(t){var e,r;return r=function(){var r,n;for(n=[],e=r=0;r<=2;e=++r)n.push((1-t)*(1-t)*o[e]+2*(1-t)*t*a[e]+t*t*s[e]);return n}(),w.lab.apply(w,r)}):4===t.length?(c=function(){var e,r,n;for(n=[],r=0,e=t.length;r<e;r++)i=t[r],n.push(i.lab());return n}(),o=c[0],a=c[1],s=c[2],l=c[3],e=function(t){var e,r;return r=function(){var r,n;for(n=[],e=r=0;r<=2;e=++r)n.push((1-t)*(1-t)*(1-t)*o[e]+3*(1-t)*(1-t)*t*a[e]+3*(1-t)*t*t*s[e]+t*t*t*l[e]);return n}(),w.lab.apply(w,r)}):5===t.length&&(r=y(t.slice(0,3)),n=y(t.slice(2,5)),e=function(t){return t<.5?r(2*t):n(2*(t-.5))}),e},w.bezier=function(t){var e;return(e=y(t)).scale=function(){return w.scale(e)},e},w.cubehelix=function(t,e,r,n,i){var o,a,s;return null==t&&(t=300),null==e&&(e=-1.5),null==r&&(r=1),null==n&&(n=1),null==i&&(i=[0,1]),o=0,"array"===Mt(i)?a=i[1]-i[0]:(a=0,i=[i,i]),(s=function(s){var l,u,c,f,d;return l=h*((t+120)/360+e*s),f=nt(i[0]+a*s,n),u=(0!==o?r[0]+s*o:r)*f*(1-f)/2,c=E(l),d=kt(l),w(x([255*(f+u*(-.14861*c+1.78277*d)),255*(f+u*(-.29227*c-.90649*d)),255*(f+u*(1.97294*c)),1]))}).start=function(e){return null==e?t:(t=e,s)},s.rotations=function(t){return null==t?e:(e=t,s)},s.gamma=function(t){return null==t?n:(n=t,s)},s.hue=function(t){return null==t?r:("array"===Mt(r=t)?0==(o=r[1]-r[0])&&(r=r[1]):o=0,s)},s.lightness=function(t){return null==t?i:("array"===Mt(t)?(i=t,a=t[1]-t[0]):(i=[t,t],a=0),s)},s.scale=function(){return w.scale(s)},s.hue(r),s},w.random=function(){var t,e;for(t="#",e=0;e<6;++e)t+="0123456789abcdef".charAt(T(16*Math.random()));return new r(t)},p=[],N=function(t,e,r,n){var i,o,a,s;for(null==r&&(r=.5),null==n&&(n="rgb"),"object"!==Mt(t)&&(t=w(t)),"object"!==Mt(e)&&(e=w(e)),a=0,o=p.length;a<o;a++)if(n===(i=p[a])[0]){s=i[1](t,e,r,n);break}if(null==s)throw"color mode "+n+" is not supported";return s.alpha(t.alpha()+r*(e.alpha()-t.alpha()))},w.interpolate=N,r.prototype.interpolate=function(t,e,r){return N(this,t,e,r)},w.mix=N,r.prototype.mix=r.prototype.interpolate,d.rgb=function(){var t,e,r,n;for(t in r=[],e=Et(arguments))n=e[t],r.push(n);return r},w.rgb=function(){return function(t,e,r){r.prototype=t.prototype;var n=new r,i=t.apply(n,e);return Object(i)===i?i:n}(r,Ot.call(arguments).concat(["rgb"]),(function(){}))},r.prototype.rgb=function(t){return null==t&&(t=!0),t?this._rgb.map(Math.round).slice(0,3):this._rgb.slice(0,3)},r.prototype.rgba=function(t){return null==t&&(t=!0),t?[Math.round(this._rgb[0]),Math.round(this._rgb[1]),Math.round(this._rgb[2]),this._rgb[3]]:this._rgb.slice(0)},c.push({p:3,test:function(t){var e;return e=Et(arguments),"array"===Mt(e)&&3===e.length||4===e.length&&"number"===Mt(e[3])&&e[3]>=0&&e[3]<=1?"rgb":void 0}}),d.lrgb=d.rgb,F=function(t,e,n,i){var o,a;return o=t._rgb,a=e._rgb,new r(wt(nt(o[0],2)*(1-n)+nt(a[0],2)*n),wt(nt(o[1],2)*(1-n)+nt(a[1],2)*n),wt(nt(o[2],2)*(1-n)+nt(a[2],2)*n),i)},u=function(t){var e,n,i,o,a;for(e=1/t.length,a=[0,0,0,0],i=0,n=t.length;i<n;i++)o=t[i]._rgb,a[0]+=nt(o[0],2)*e,a[1]+=nt(o[1],2)*e,a[2]+=nt(o[2],2)*e,a[3]+=o[3]*e;return a[0]=wt(a[0]),a[1]=wt(a[1]),a[2]=wt(a[2]),a[3]>1&&(a[3]=1),new r(x(a))},p.push(["lrgb",F]),w.average=function(t,e){var r,n,i,o,s,l,h,c,f,d,p,_,y;if(null==e&&(e="rgb"),f=t.length,h=(t=t.map((function(t){return w(t)}))).splice(0,1)[0],"lrgb"===e)return u(t);for(c in o=[],s=0,l=0,_=h.get(e))_[c]=_[c]||0,o.push(isNaN(_[c])?0:1),"h"!==e.charAt(c)||isNaN(_[c])||(r=_[c]/180*a,s+=E(r),l+=kt(r));for(n=h.alpha(),p=0,d=t.length;p<d;p++)for(c in y=(i=t[p]).get(e),n+=i.alpha(),_)isNaN(y[c])||(o[c]+=1,"h"===e.charAt(c)?(r=y[c]/180*a,s+=E(r),l+=kt(r)):_[c]+=y[c]);for(c in _)if("h"===e.charAt(c)){for(r=g(l/o[c],s/o[c])/a*180;r<0;)r+=360;for(;r>=360;)r-=360;_[c]=r}else _[c]=_[c]/o[c];return w(_,e).alpha(n/f)},P=function(t){var e,r;if(t.match(/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/))return 4!==t.length&&7!==t.length||(t=t.substr(1)),3===t.length&&(t=(t=t.split(""))[0]+t[0]+t[1]+t[1]+t[2]+t[2]),[(r=parseInt(t,16))>>16,r>>8&255,255&r,1];if(t.match(/^#?([A-Fa-f0-9]{8})$/))return 9===t.length&&(t=t.substr(1)),[(r=parseInt(t,16))>>24&255,r>>16&255,r>>8&255,vt((255&r)/255*100)/100];if(null!=d.css&&(e=d.css(t)))return e;throw"unknown color: "+t},st=function(t,e){var r,n,i,o,a,s;return null==e&&(e="auto"),a=t[0],i=t[1],n=t[2],r=t[3],"auto"===e&&(e=r<1?"rgba":"rgb"),a=Math.round(a),i=Math.round(i),n=Math.round(n),s=(s="000000"+(a<<16|i<<8|n).toString(16)).substr(s.length-6),o=(o="0"+vt(255*r).toString(16)).substr(o.length-2),"#"+function(){switch(e.toLowerCase()){case"rgba":return s+o;case"argb":return o+s;default:return s}}()},d.hex=function(t){return P(t)},w.hex=function(){return function(t,e,r){r.prototype=t.prototype;var n=new r,i=t.apply(n,e);return Object(i)===i?i:n}(r,Ot.call(arguments).concat(["hex"]),(function(){}))},r.prototype.hex=function(t){return null==t&&(t="auto"),st(this._rgb,t)},c.push({p:4,test:function(t){if(1===arguments.length&&"string"===Mt(t))return"hex"}}),j=function(){var t,e,r,n,i,o,a,s,l,h,u,c,f,d;if(i=(t=Et(arguments))[0],u=t[1],a=t[2],0===u)l=n=e=255*a;else{for(r=[0,0,0],c=2*a-(f=a<.5?a*(1+u):a+u-a*u),(d=[0,0,0])[0]=(i/=360)+1/3,d[1]=i,d[2]=i-1/3,o=s=0;s<=2;o=++s)d[o]<0&&(d[o]+=1),d[o]>1&&(d[o]-=1),6*d[o]<1?r[o]=c+6*(f-c)*d[o]:2*d[o]<1?r[o]=f:3*d[o]<2?r[o]=c+(f-c)*(2/3-d[o])*6:r[o]=c;l=(h=[vt(255*r[0]),vt(255*r[1]),vt(255*r[2])])[0],n=h[1],e=h[2]}return t.length>3?[l,n,e,t[3]]:[l,n,e]},ht=function(t,e,r){var n,i,o,a,s;return void 0!==t&&t.length>=3&&(t=(a=t)[0],e=a[1],r=a[2]),t/=255,e/=255,r/=255,o=Math.min(t,e,r),i=(($=Math.max(t,e,r))+o)/2,$===o?(s=0,n=Number.NaN):s=i<.5?($-o)/($+o):($-o)/(2-$-o),t===$?n=(e-r)/($-o):e===$?n=2+(r-t)/($-o):r===$&&(n=4+(t-e)/($-o)),(n*=60)<0&&(n+=360),[n,s,i]},w.hsl=function(){return function(t,e,r){r.prototype=t.prototype;var n=new r,i=t.apply(n,e);return Object(i)===i?i:n}(r,Ot.call(arguments).concat(["hsl"]),(function(){}))},d.hsl=j,r.prototype.hsl=function(){return ht(this._rgb)},D=function(){var t,e,r,n,i,o,a,s,l,h,u,c,f,d,p,_,g,y;if(i=(t=Et(arguments))[0],_=t[1],y=t[2],y*=255,0===_)l=n=e=y;else switch(360===i&&(i=0),i>360&&(i-=360),i<0&&(i+=360),a=y*(1-_),s=y*(1-_*(r=(i/=60)-(o=T(i)))),g=y*(1-_*(1-r)),o){case 0:l=(h=[y,g,a])[0],n=h[1],e=h[2];break;case 1:l=(u=[s,y,a])[0],n=u[1],e=u[2];break;case 2:l=(c=[a,y,g])[0],n=c[1],e=c[2];break;case 3:l=(f=[a,s,y])[0],n=f[1],e=f[2];break;case 4:l=(d=[g,a,y])[0],n=d[1],e=d[2];break;case 5:l=(p=[y,a,s])[0],n=p[1],e=p[2]}return[l,n,e,t.length>3?t[3]:1]},ut=function(){var t,e,r,n,i,o,a,s,l;return o=(a=Et(arguments))[0],r=a[1],t=a[2],i=Math.min(o,r,t),e=($=Math.max(o,r,t))-i,l=$/255,0===$?(n=Number.NaN,s=0):(s=e/$,o===$&&(n=(r-t)/e),r===$&&(n=2+(t-o)/e),t===$&&(n=4+(o-r)/e),(n*=60)<0&&(n+=360)),[n,s,l]},w.hsv=function(){return function(t,e,r){r.prototype=t.prototype;var n=new r,i=t.apply(n,e);return Object(i)===i?i:n}(r,Ot.call(arguments).concat(["hsv"]),(function(){}))},d.hsv=D,r.prototype.hsv=function(){return ut(this._rgb)},et=function(t){return"number"===Mt(t)&&t>=0&&t<=16777215?[t>>16,t>>8&255,255&t,1]:(console.warn("unknown num color: "+t),[0,0,0,1])},pt=function(){var t;return((t=Et(arguments))[0]<<16)+(t[1]<<8)+t[2]},w.num=function(t){return new r(t,"num")},r.prototype.num=function(t){return null==t&&(t="rgb"),pt(this._rgb,t)},d.num=et,c.push({p:1,test:function(t){if(1===arguments.length&&"number"===Mt(t)&&t>=0&&t<=16777215)return"num"}}),I=function(){var t,e,r,n,i,o,a,s,l,h,u,c,f,d,p,_,g,y,m,v;if(s=(r=Et(arguments))[0],i=r[1],e=r[2],a=a/100*255,t=255*(i/=100),0===i)c=a=n=e;else switch(360===s&&(s=0),s>360&&(s-=360),s<0&&(s+=360),u=(h=e*(1-i))+t*(1-(o=(s/=60)-(l=T(s)))),m=h+t*o,v=h+t,l){case 0:c=(f=[v,m,h])[0],a=f[1],n=f[2];break;case 1:c=(d=[u,v,h])[0],a=d[1],n=d[2];break;case 2:c=(p=[h,v,m])[0],a=p[1],n=p[2];break;case 3:c=(_=[h,u,v])[0],a=_[1],n=_[2];break;case 4:c=(g=[m,h,v])[0],a=g[1],n=g[2];break;case 5:c=(y=[v,h,u])[0],a=y[1],n=y[2]}return[c,a,n,r.length>3?r[3]:1]},at=function(){var t,e,r,n,i,o,a,s,l;return s=(l=Et(arguments))[0],i=l[1],e=l[2],a=Math.min(s,i,e),r=100*(n=($=Math.max(s,i,e))-a)/255,t=a/(255-n)*100,0===n?o=Number.NaN:(s===$&&(o=(i-e)/n),i===$&&(o=2+(e-s)/n),e===$&&(o=4+(s-i)/n),(o*=60)<0&&(o+=360)),[o,r,t]},w.hcg=function(){return function(t,e,r){r.prototype=t.prototype;var n=new r,i=t.apply(n,e);return Object(i)===i?i:n}(r,Ot.call(arguments).concat(["hcg"]),(function(){}))},d.hcg=I,r.prototype.hcg=function(){return at(this._rgb)},C=function(t){var e,r,n,i,o,a,s,l;if(t=t.toLowerCase(),null!=w.colors&&w.colors[t])return P(w.colors[t]);if(o=t.match(/rgb\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*\)/)){for(s=o.slice(1,4),i=a=0;a<=2;i=++a)s[i]=+s[i];s[3]=1}else if(o=t.match(/rgba\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*,\s*([01]|[01]?\.\d+)\)/))for(s=o.slice(1,5),i=l=0;l<=3;i=++l)s[i]=+s[i];else if(o=t.match(/rgb\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/)){for(s=o.slice(1,4),i=e=0;e<=2;i=++e)s[i]=vt(2.55*s[i]);s[3]=1}else if(o=t.match(/rgba\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/)){for(s=o.slice(1,5),i=r=0;r<=2;i=++r)s[i]=vt(2.55*s[i]);s[3]=+s[3]}else(o=t.match(/hsl\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/))?((n=o.slice(1,4))[1]*=.01,n[2]*=.01,(s=j(n))[3]=1):(o=t.match(/hsla\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/))&&((n=o.slice(1,4))[1]*=.01,n[2]*=.01,(s=j(n))[3]=+o[4]);return s},ot=function(t){var e;return"rgb"==(e=t[3]<1?"rgba":"rgb")?e+"("+t.slice(0,3).map(vt).join(",")+")":"rgba"===e?e+"("+t.slice(0,3).map(vt).join(",")+","+t[3]+")":void 0},mt=function(t){return vt(100*t)/100},L=function(t,e){var r;return r=e<1?"hsla":"hsl",t[0]=mt(t[0]||0),t[1]=mt(100*t[1])+"%",t[2]=mt(100*t[2])+"%","hsla"===r&&(t[3]=e),r+"("+t.join(",")+")"},d.css=function(t){return C(t)},w.css=function(){return function(t,e,r){r.prototype=t.prototype;var n=new r,i=t.apply(n,e);return Object(i)===i?i:n}(r,Ot.call(arguments).concat(["css"]),(function(){}))},r.prototype.css=function(t){return null==t&&(t="rgb"),"rgb"===t.slice(0,3)?ot(this._rgb):"hsl"===t.slice(0,3)?L(this.hsl(),this.alpha()):void 0},d.named=function(t){return P(Ct[t])},c.push({p:5,test:function(t){if(1===arguments.length&&null!=Ct[t])return"named"}}),r.prototype.name=function(t){var e,r;for(r in arguments.length&&(Ct[t]&&(this._rgb=P(Ct[t])),this._rgb[3]=1),e=this.hex("rgb"),Ct)if(e===Ct[r])return r;return e},W=function(){var t,e,r,n;return r=(n=Et(arguments))[0],t=n[1],e=n[2],[r,E(e*=i)*t,kt(e)*t]},K=function(){var t,e,r,n,i,o,a,s,l;return a=(r=Et(arguments))[0],i=r[1],o=r[2],t=(s=W(a,i,o))[0],e=s[1],n=s[2],[(l=Q(t,e,n))[0],l[1],n=l[2],r.length>3?r[3]:1]},z=function(){var t,e,r,n,i,o;return i=(o=Et(arguments))[0],t=o[1],e=o[2],r=wt(t*t+e*e),n=(g(e,t)*l+360)%360,0===vt(1e4*r)&&(n=Number.NaN),[i,r,n]},ft=function(){var t,e,r,n,i,o,a;return i=(o=Et(arguments))[0],r=o[1],e=o[2],n=(a=ct(i,r,e))[0],t=a[1],e=a[2],z(n,t,e)},w.lch=function(){var t;return t=Et(arguments),new r(t,"lch")},w.hcl=function(){var t;return t=Et(arguments),new r(t,"hcl")},d.lch=K,d.hcl=function(){var t,e,r,n;return e=(n=Et(arguments))[0],t=n[1],r=n[2],K([r,t,e])},r.prototype.lch=function(){return ft(this._rgb)},r.prototype.hcl=function(){return ft(this._rgb).reverse()},it=function(t){var e,r,n,i,o,a;return null==t&&(t="rgb"),o=(a=Et(arguments))[0],n=a[1],e=a[2],n/=255,e/=255,[(1-(o/=255)-(i=1-Math.max(o,Math.max(n,e))))*(r=i<1?1/(1-i):0),(1-n-i)*r,(1-e-i)*r,i]},M=function(){var t,e,r,n,i,o;return r=(e=Et(arguments))[0],i=e[1],o=e[2],n=e[3],t=e.length>4?e[4]:1,1===n?[0,0,0,t]:[r>=1?0:255*(1-r)*(1-n),i>=1?0:255*(1-i)*(1-n),o>=1?0:255*(1-o)*(1-n),t]},d.cmyk=function(){return M(Et(arguments))},w.cmyk=function(){return function(t,e,r){r.prototype=t.prototype;var n=new r,i=t.apply(n,e);return Object(i)===i?i:n}(r,Ot.call(arguments).concat(["cmyk"]),(function(){}))},r.prototype.cmyk=function(){return it(this._rgb)},d.gl=function(){var t,e,r,n,i;for(n=function(){var t,r;for(e in r=[],t=Et(arguments))i=t[e],r.push(i);return r}.apply(this,arguments),t=r=0;r<=2;t=++r)n[t]*=255;return n},w.gl=function(){return function(t,e,r){r.prototype=t.prototype;var n=new r,i=t.apply(n,e);return Object(i)===i?i:n}(r,Ot.call(arguments).concat(["gl"]),(function(){}))},r.prototype.gl=function(){var t;return[(t=this._rgb)[0]/255,t[1]/255,t[2]/255,t[3]]},dt=function(t,e,r){var n;return t=(n=Et(arguments))[0],e=n[1],r=n[2],.2126*(t=X(t))+.7152*(e=X(e))+.0722*X(r)},X=function(t){return(t/=255)<=.03928?t/12.92:nt((t+.055)/1.055,2.4)},q=function(t,e,n,i){var o,a;return o=t._rgb,a=e._rgb,new r(o[0]+n*(a[0]-o[0]),o[1]+n*(a[1]-o[1]),o[2]+n*(a[2]-o[2]),i)},p.push(["rgb",q]),r.prototype.luminance=function(t,e){var r,n,i,o,a;return null==e&&(e="rgb"),arguments.length?(o=this._rgb,0===t?o=[0,0,0,this._rgb[3]]:1===t?o=[255,255,255,this[3]]:(r=dt(this._rgb),n=1e-7,i=20,a=function(r,o){var s,l;return s=(l=r.interpolate(o,.5,e)).luminance(),Math.abs(t-s)<n||!i--?l:s>t?a(r,l):a(l,o)},o=r>t?a(w("black"),this).rgba():a(this,w("white")).rgba()),w(o).alpha(this.alpha())):dt(this._rgb)},xt=function(t){var e,r,n,i;return(i=t/100)<66?(n=255,r=-155.25485562709179-.44596950469579133*(r=i-2)+104.49216199393888*Y(r),e=i<20?0:.8274096064007395*(e=i-10)-254.76935184120902+115.67994401066147*Y(e)):(n=351.97690566805693+.114206453784165*(n=i-55)-40.25366309332127*Y(n),r=325.4494125711974+.07943456536662342*(r=i-50)-28.0852963507957*Y(r),e=255),[n,r,e]},_t=function(){var t,e,r,n,i,o,a,s;for(i=(o=Et(arguments))[0],o[1],t=o[2],n=1e3,r=4e4,e=.4;r-n>e;)(a=xt(s=.5*(r+n)))[2]/a[0]>=t/i?r=s:n=s;return vt(s)},w.temperature=w.kelvin=function(){return function(t,e,r){r.prototype=t.prototype;var n=new r,i=t.apply(n,e);return Object(i)===i?i:n}(r,Ot.call(arguments).concat(["temperature"]),(function(){}))},d.temperature=d.kelvin=d.K=xt,r.prototype.temperature=function(){return _t(this._rgb)},r.prototype.kelvin=r.prototype.temperature,w.contrast=function(t,e){var n,i,o,a;return"string"!==(o=Mt(t))&&"number"!==o||(t=new r(t)),"string"!==(a=Mt(e))&&"number"!==a||(e=new r(e)),(n=t.luminance())>(i=e.luminance())?(n+.05)/(i+.05):(i+.05)/(n+.05)},w.distance=function(t,e,n){var i,o,a,s,l,h,u;for(o in null==n&&(n="lab"),"string"!==(l=Mt(t))&&"number"!==l||(t=new r(t)),"string"!==(h=Mt(e))&&"number"!==h||(e=new r(e)),a=t.get(n),s=e.get(n),u=0,a)u+=(i=(a[o]||0)-(s[o]||0))*i;return Math.sqrt(u)},w.deltaE=function(t,e,n,i){var o,s,l,h,u,c,f,d,p,y,m,v,b,k,w,x,M,C,S,A,O,T,I,P;for(null==n&&(n=1),null==i&&(i=1),"string"!==(w=Mt(t))&&"number"!==w||(t=new r(t)),"string"!==(x=Mt(e))&&"number"!==x||(e=new r(e)),o=(M=t.lab())[0],l=M[1],u=M[2],s=(C=e.lab())[0],h=C[1],c=C[2],f=wt(l*l+u*u),d=wt(h*h+c*c),A=o<16?.511:.040975*o/(1+.01765*o),S=.0638*f/(1+.0131*f)+.638,k=f<1e-6?0:180*g(u,l)/a;k<0;)k+=360;for(;k>=360;)k-=360;return O=k>=164&&k<=345?.56+_(.2*E(a*(k+168)/180)):.36+_(.4*E(a*(k+35)/180)),b=wt((p=f*f*f*f)/(p+1900)),wt((T=(o-s)/(n*A))*T+(I=(v=f-d)/(i*S))*I+((y=l-h)*y+(m=u-c)*m-v*v)/((P=S*(b*O+1-b))*P))},r.prototype.get=function(t){var e,r,n,i,o;return n=(i=t.split("."))[0],e=i[1],o=this[n](),e?(r=n.indexOf(e))>-1?o[r]:console.warn("unknown channel "+e+" in mode "+n):o},r.prototype.set=function(t,e){var r,n,i,o,a;if(i=(o=t.split("."))[0],r=o[1])if(a=this[i](),(n=i.indexOf(r))>-1)if("string"===Mt(e))switch(e.charAt(0)){case"+":case"-":a[n]+=+e;break;case"*":a[n]*=+e.substr(1);break;case"/":a[n]/=+e.substr(1);break;default:a[n]=+e}else a[n]=e;else console.warn("unknown channel "+r+" in mode "+i);else a=e;return w(a,i).alpha(this.alpha())},r.prototype.clipped=function(){return this._rgb._clipped||!1},r.prototype.alpha=function(t){return arguments.length?w.rgb([this._rgb[0],this._rgb[1],this._rgb[2],t]):this._rgb[3]},r.prototype.darken=function(t){var e;return null==t&&(t=1),(e=this.lab())[0]-=o.Kn*t,w.lab(e).alpha(this.alpha())},r.prototype.brighten=function(t){return null==t&&(t=1),this.darken(-t)},r.prototype.darker=r.prototype.darken,r.prototype.brighter=r.prototype.brighten,r.prototype.saturate=function(t){var e;return null==t&&(t=1),(e=this.lch())[1]+=t*o.Kn,e[1]<0&&(e[1]=0),w.lch(e).alpha(this.alpha())},r.prototype.desaturate=function(t){return null==t&&(t=1),this.saturate(-t)},r.prototype.premultiply=function(){var t,e;return e=this.rgb(),t=this.alpha(),w(e[0]*t,e[1]*t,e[2]*t,t)},tt=function(t,e){return t*e/255},S=function(t,e){return t>e?e:t},V=function(t,e){return t>e?t:e},bt=function(t,e){return 255*(1-(1-t/255)*(1-e/255))},rt=function(t,e){return e<128?2*t*e/255:255*(1-2*(1-t/255)*(1-e/255))},k=function(t,e){return 255*(1-(1-e/255)/(t/255))},A=function(t,e){return 255===t||(t=e/255*255/(1-t/255))>255?255:t},(m=function(t,e,r){if(!m[r])throw"unknown blend mode "+r;return m[r](t,e)}).normal=(v=function(t){return function(e,r){var n,i;return n=w(r).rgb(),i=w(e).rgb(),w(t(n,i),"rgb")}})((O=function(t){return function(e,r){var n,i,o;for(o=[],n=i=0;i<=3;n=++i)o[n]=t(e[n],r[n]);return o}})((function(t,e){return t}))),m.multiply=v(O(tt)),m.screen=v(O(bt)),m.overlay=v(O(rt)),m.darken=v(O(S)),m.lighten=v(O(V)),m.dodge=v(O(A)),m.burn=v(O(k)),w.blend=m,w.analyze=function(t){var e,r,n,i;for(n={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0},r=0,e=t.length;r<e;r++)null==(i=t[r])||isNaN(i)||(n.values.push(i),n.sum+=i,i<n.min&&(n.min=i),i>n.max&&(n.max=i),n.count+=1);return n.domain=[n.min,n.max],n.limits=function(t,e){return w.limits(n,t,e)},n},w.scale=function(t,e){var r,n,i,o,a,s,l,h,u,c,f,d,p,_,g,y,m,v,b,k,x;return u="rgb",c=w("#ccc"),_=0,a=[0,1],p=[],d=[0,0],r=!1,i=[],f=!1,h=0,l=1,o=!1,n={},g=!0,s=1,k=function(t){var e,r,n,o,a,s;if(null==t&&(t=["#fff","#000"]),null!=t&&"string"===Mt(t)&&null!=w.brewer&&(t=w.brewer[t]||w.brewer[t.toLowerCase()]||t),"array"===Mt(t)){for(1===t.length&&(t=[t[0],t[0]]),e=n=0,o=(t=t.slice(0)).length-1;0<=o?n<=o:n>=o;e=0<=o?++n:--n)r=t[e],"string"===Mt(r)&&(t[e]=w(r));for(p.length=0,e=s=0,a=t.length-1;0<=a?s<=a:s>=a;e=0<=a?++s:--s)p.push(e/(t.length-1))}return b(),i=t},m=function(t){var e,n;if(null!=r){for(n=r.length-1,e=0;e<n&&t>=r[e];)e++;return e-1}return 0},x=function(t){return t},v=function(t,e){var o,a,f,_,y,v,b;if(null==e&&(e=!1),isNaN(t)||null===t)return c;if(b=e?t:r&&r.length>2?m(t)/(r.length-2):l!==h?(t-h)/(l-h):1,e||(b=x(b)),1!==s&&(b=nt(b,s)),b=d[0]+b*(1-d[0]-d[1]),b=Math.min(1,Math.max(0,b)),f=Math.floor(1e4*b),g&&n[f])o=n[f];else{if("array"===Mt(i))for(a=_=0,v=p.length-1;0<=v?_<=v:_>=v;a=0<=v?++_:--_){if(b<=(y=p[a])){o=i[a];break}if(b>=y&&a===p.length-1){o=i[a];break}if(b>y&&b<p[a+1]){b=(b-y)/(p[a+1]-y),o=w.interpolate(i[a],i[a+1],b,u);break}}else"function"===Mt(i)&&(o=i(b));g&&(n[f]=o)}return o},b=function(){return n={}},k(t),(y=function(t){var e;return e=w(v(t)),f&&e[f]?e[f]():e}).classes=function(t){var e;return null!=t?("array"===Mt(t)?(r=t,a=[t[0],t[t.length-1]]):(e=w.analyze(a),r=0===t?[e.min,e.max]:w.limits(e,"e",t)),y):r},y.domain=function(t){var e,r,n,o,s,u,c;if(!arguments.length)return a;if(h=t[0],l=t[t.length-1],p=[],n=i.length,t.length===n&&h!==l)for(s=0,o=t.length;s<o;s++)r=t[s],p.push((r-h)/(l-h));else for(e=c=0,u=n-1;0<=u?c<=u:c>=u;e=0<=u?++c:--c)p.push(e/(n-1));return a=[h,l],y},y.mode=function(t){return arguments.length?(u=t,b(),y):u},y.range=function(t,e){return k(t),y},y.out=function(t){return f=t,y},y.spread=function(t){return arguments.length?(_=t,y):_},y.correctLightness=function(t){return null==t&&(t=!0),o=t,b(),x=o?function(t){var e,r,n,i,o,a,s,l;for(a=(e=v(0,!0).lab()[0])>(r=v(1,!0).lab()[0]),n=v(t,!0).lab()[0]-(i=e+(r-e)*t),s=0,l=1,o=20;Math.abs(n)>.01&&o-- >0;)a&&(n*=-1),n<0?(s=t,t+=.5*(l-t)):(l=t,t+=.5*(s-t)),n=v(t,!0).lab()[0]-i;return t}:function(t){return t},y},y.padding=function(t){return null!=t?("number"===Mt(t)&&(t=[t,t]),d=t,y):d},y.colors=function(e,n){var o,s,l,h,u,c,f,d;if(arguments.length<2&&(n="hex"),u=[],0===arguments.length)u=i.slice(0);else if(1===e)u=[y(.5)];else if(e>1)s=a[0],o=a[1]-s,u=function(){c=[];for(var t=0;0<=e?t<e:t>e;0<=e?t++:t--)c.push(t);return c}.apply(this).map((function(t){return y(s+t/(e-1)*o)}));else{if(t=[],f=[],r&&r.length>2)for(l=d=1,h=r.length;1<=h?d<h:d>h;l=1<=h?++d:--d)f.push(.5*(r[l-1]+r[l]));else f=a;u=f.map((function(t){return y(t)}))}return w[n]&&(u=u.map((function(t){return t[n]()}))),u},y.cache=function(t){return null!=t?(g=t,y):g},y.gamma=function(t){return null!=t?(s=t,y):s},y.nodata=function(t){return null!=t?(c=w(t),y):c},y},null==w.scales&&(w.scales={}),w.scales.cool=function(){return w.scale([w.hsl(180,1,.9),w.hsl(250,.7,.4)])},w.scales.hot=function(){return w.scale(["#000","#f00","#ff0","#fff"],[0,.25,.75,1]).mode("rgb")},w.analyze=function(t,e,r){var n,i,o,a,s,l;if(s={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0},null==r&&(r=function(){return!0}),n=function(t){null==t||isNaN(t)||(s.values.push(t),s.sum+=t,t<s.min&&(s.min=t),t>s.max&&(s.max=t),s.count+=1)},l=function(t,i){if(r(t,i))return null!=e&&"function"===Mt(e)?n(e(t)):null!=e&&"string"===Mt(e)||"number"===Mt(e)?n(t[e]):n(t)},"array"===Mt(t))for(a=0,o=t.length;a<o;a++)l(t[a]);else for(i in t)l(t[i],i);return s.domain=[s.min,s.max],s.limits=function(t,e){return w.limits(s,t,e)},s},w.limits=function(t,e,r){var n,i,o,a,s,l,h,u,c,f,d,p,g,y,m,v,b,k,x,M,E,C,S,A,O,I,P,R,L,j,D,N,B,G,F,U,q,z,Q,H,W,K,V,Z,X,J,tt,et,rt,it,ot,at,st,lt,ht;if(null==e&&(e="equal"),null==r&&(r=7),"array"===Mt(t)&&(t=w.analyze(t)),O=t.min,$=t.max,t.sum,lt=t.values.sort((function(t,e){return t-e})),1===r)return[O,$];if(S=[],"c"===e.substr(0,1)&&(S.push(O),S.push($)),"e"===e.substr(0,1)){for(S.push(O),M=D=1,F=r-1;1<=F?D<=F:D>=F;M=1<=F?++D:--D)S.push(O+M/r*($-O));S.push($)}else if("l"===e.substr(0,1)){if(O<=0)throw"Logarithmic scales are only possible for values > 0";for(I=Math.LOG10E*Y(O),A=Math.LOG10E*Y($),S.push(O),M=ht=1,U=r-1;1<=U?ht<=U:ht>=U;M=1<=U?++ht:--ht)S.push(nt(10,I+M/r*(A-I)));S.push($)}else if("q"===e.substr(0,1)){for(S.push(O),M=n=1,K=r-1;1<=K?n<=K:n>=K;M=1<=K?++n:--n)N=(lt.length-1)*M/r,(B=T(N))===N?S.push(lt[B]):(G=N-B,S.push(lt[B]*(1-G)+lt[B+1]*G));S.push($)}else if("k"===e.substr(0,1)){for(R=lt.length,y=new Array(R),k=new Array(r),it=!0,L=0,v=null,(v=[]).push(O),M=i=1,V=r-1;1<=V?i<=V:i>=V;M=1<=V?++i:--i)v.push(O+M/r*($-O));for(v.push($);it;){for(E=o=0,Z=r-1;0<=Z?o<=Z:o>=Z;E=0<=Z?++o:--o)k[E]=0;for(M=a=0,X=R-1;0<=X?a<=X:a>=X;M=0<=X?++a:--a){for(st=lt[M],P=Number.MAX_VALUE,E=s=0,J=r-1;0<=J?s<=J:s>=J;E=0<=J?++s:--s)(x=_(v[E]-st))<P&&(P=x,m=E);k[m]++,y[M]=m}for(j=new Array(r),E=l=0,tt=r-1;0<=tt?l<=tt:l>=tt;E=0<=tt?++l:--l)j[E]=null;for(M=h=0,et=R-1;0<=et?h<=et:h>=et;M=0<=et?++h:--h)null===j[b=y[M]]?j[b]=lt[M]:j[b]+=lt[M];for(E=u=0,rt=r-1;0<=rt?u<=rt:u>=rt;E=0<=rt?++u:--u)j[E]*=1/k[E];for(it=!1,E=c=0,q=r-1;0<=q?c<=q:c>=q;E=0<=q?++c:--c)if(j[E]!==v[M]){it=!0;break}v=j,++L>200&&(it=!1)}for(C={},E=f=0,z=r-1;0<=z?f<=z:f>=z;E=0<=z?++f:--f)C[E]=[];for(M=d=0,Q=R-1;0<=Q?d<=Q:d>=Q;M=0<=Q?++d:--d)C[b=y[M]].push(lt[M]);for(ot=[],E=p=0,H=r-1;0<=H?p<=H:p>=H;E=0<=H?++p:--p)ot.push(C[E][0]),ot.push(C[E][C[E].length-1]);for(ot=ot.sort((function(t,e){return t-e})),S.push(ot[0]),M=g=1,W=ot.length-1;g<=W;M=g+=2)at=ot[M],isNaN(at)||-1!==S.indexOf(at)||S.push(at)}return S},R=function(t,e,r){var n,i,o,a;return t=(n=Et(arguments))[0],e=n[1],r=n[2],isNaN(t)&&(t=0),(t/=360)<1/3?o=1-((i=(1-e)/3)+(a=(1+e*E(h*t)/E(s-h*t))/3)):t<2/3?i=1-((a=(1-e)/3)+(o=(1+e*E(h*(t-=1/3))/E(s-h*t))/3)):a=1-((o=(1-e)/3)+(i=(1+e*E(h*(t-=2/3))/E(s-h*t))/3)),[255*(a=Z(r*a*3)),255*(o=Z(r*o*3)),255*(i=Z(r*i*3)),n.length>3?n[3]:1]},lt=function(){var t,e,r,n,i,o,a;return i=(o=Et(arguments))[0],e=o[1],t=o[2],h=2*Math.PI,i/=255,e/=255,t/=255,0==(a=1-Math.min(i,e,t)/(n=(i+e+t)/3))?r=0:(r=(i-e+(i-t))/2,r/=Math.sqrt((i-e)*(i-e)+(i-t)*(e-t)),r=Math.acos(r),t>e&&(r=h-r),r/=h),[360*r,a,n]},w.hsi=function(){return function(t,e,r){r.prototype=t.prototype;var n=new r,i=t.apply(n,e);return Object(i)===i?i:n}(r,Ot.call(arguments).concat(["hsi"]),(function(){}))},d.hsi=R,r.prototype.hsi=function(){return lt(this._rgb)},B=function(t,e,r,n){var i,o,a,s,l,h,u,c,f,d;return"hsl"===n?(f=t.hsl(),d=e.hsl()):"hsv"===n?(f=t.hsv(),d=e.hsv()):"hcg"===n?(f=t.hcg(),d=e.hcg()):"hsi"===n?(f=t.hsi(),d=e.hsi()):"lch"!==n&&"hcl"!==n||(n="hcl",f=t.hcl(),d=e.hcl()),"h"===n.substr(0,1)&&(o=f[0],u=f[1],s=f[2],a=d[0],c=d[1],l=d[2]),isNaN(o)||isNaN(a)?isNaN(o)?isNaN(a)?i=Number.NaN:(i=a,1!==s&&0!==s||"hsv"===n||(h=c)):(i=o,1!==l&&0!==l||"hsv"===n||(h=u)):i=o+r*(a>o&&a-o>180?a-(o+360):a<o&&o-a>180?a+360-o:a-o),null==h&&(h=u+r*(c-u)),w[n](i,h,s+r*(l-s))},U=function(t,e,r,n){var i,o;return i=t.num(),o=e.num(),w.num(i+(o-i)*r,"num")},(p=p.concat(function(){var t,e,r,n;for(n=[],e=0,t=(r=["hsv","hsl","hsi","hcl","lch","hcg"]).length;e<t;e++)J=r[e],n.push([J,B]);return n}())).push(["num",U]),G=function(t,e,n,i){var o,a;return o=t.lab(),a=e.lab(),new r(o[0]+n*(a[0]-o[0]),o[1]+n*(a[1]-o[1]),o[2]+n*(a[2]-o[2]),i)},p.push(["lab",G])}.call(this)},4976:function(t,e,r){var n=r(5020),i=r(6711),o=r(3692),a=r(3612),s=r(7613),l=r(696),h=r(6826),u=r(7173),c=r(5219),f=r(2502),d=r(6508);t.exports=function(t){var e=t.raster_bbox,r=t.raster_height,_=t.raster_width,g=t.pixel_height,y=t.pixel_width,m=t.geometry,v=t.per_pixel,b=t.per_row_segment,k=p(e,4),w=k[0],x=(k[1],k[2],k[3]),M=[];if(0!==r){for(var E=0;E<r;E++){var C=x-g*E-g/2,S=n([w,C],[w+1,C]);M.push(S)}u(m).map(l).forEach((function(t){for(var l=d(r).map((function(){return[]})),u=t.length,m=0;m<u;m++){var k,x,E,C,S=t[m],A=p(S,2),O=A[0],T=A[1],I=p(O,2),P=I[0],R=I[1],L=p(T,2),j=L[0],D=L[1],N=Math.sign(D-R),B=R===D,G=P===j,F=R,U=n(O,T),q=Math.min(R,D),z=Math.max(R,D),Q=void 0,H=void 0,W=void 0,K=void 0;if(P<j?(Q=(k=p(O,2))[0],H=k[1],K=(x=p(T,2))[0],W=x[1]):(Q=(E=p(T,2))[0],H=E[1],K=(C=p(O,2))[0],W=C[1]),void 0===Q)throw Error("startLng is "+Q);var V=Math.round((e[3]-.5*g-H)/g),Z=Math.round((e[3]-.5*g-W)/g),Y=void 0,X=void 0;V<Z?(Y=V,X=Z):(Y=Z,X=V),Y=o(Y,0,r-1),X=o(X,0,r-1);for(var J=Y;J<X+1;J++){var $=M[J];if(void 0===$)throw console.error("j:",J),console.error("imageLines:",M),Error("imageLines");var tt=-1*$.c,et=R===tt,rt=D===tt,nt=!rt,it=void 0,ot=void 0;if(B){if(F!==tt)continue;it=Q,ot=K}else if(G)tt>=q&&tt<=z&&(it=Q,ot=K);else if(et)it=ot=P;else if(rt)it=ot=j;else try{it=ot=h(U,$).x}catch(t){throw t}it&&ot&&(B||it>=Q&&ot<=K&&tt<=z&&tt>=q)&&l[J].push({direction:N,index:m,edge:S,endsOnLine:rt,endsOffLine:nt,horizontal:B,startsOnLine:et,vertical:G,xmin:it,xmax:ot,imageLineY:tt})}}l.map((function(t,e){if(t.length>0){var r=s(t,u).map(i),n=f(r,(function(t){return t.through})),o=p(n,2),l=o[0],h=o[1];if(l.length%2==1)throw Error("throughs.length for "+e+" is odd with "+l.length);var d=h.map((function(t){return[t.xmin,t.xmax]}));l.sort((function(t,e){return t.xmin-e.xmin}));var g=a(l).map((function(t){var e=p(t,2),r=e[0],n=e[1];return[r.xmin,n.xmax]}));d=d.concat(g),(d=c(d)).forEach((function(t){var r=p(t,2),n=r[0],i=r[1],o=Math.round((n-(w+.5*y))/y),a=Math.round((i-(w+.5*y))/y);if(!(o>=_||a<0)){var s=Math.max(o,0),l=Math.min(a,_-1);if(b&&b({row:e,columns:[s,l]}),v)for(var h=s;h<=l;h++)v({row:e,column:h})}}))}}))}))}}},479:function(t,e,r){var n=r(4976),i=r(2057),o=r(9451);t.exports=function(t){var e,r,a=t.debug,s=void 0!==a&&a,l=t.raster_bbox,h=t.raster_height,u=t.raster_width,c=t.pixel_height,f=t.pixel_width,d=t.geometry,_=t.per_pixel,g=t.per_row_segment,y=p(l,4),m=y[0],v=y[1],b=y[2],k=y[3];null!==(e=c)&&void 0!==e||(c=(k-v)/h),null!==(r=f)&&void 0!==r||(f=(b-m)/u);var w=new Array(h);n({raster_bbox:l,raster_height:h,raster_width:u,pixel_height:c,pixel_width:f,geometry:d,per_pixel:_,per_row_segment:function(t){var e