From 6f8af0dafbea3825a26b525c6e01f3f7ec2e4776 Mon Sep 17 00:00:00 2001 From: banesullivan Date: Tue, 10 May 2022 17:41:30 -0600 Subject: [PATCH] Add GeoJS static asset --- .../js/geojs/1.8.3/geo.min.js | 67 +++++++++++++++++++ .../django_large_image/_include/geojs.html | 5 +- 2 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 django_large_image/static/django_large_image/js/geojs/1.8.3/geo.min.js diff --git a/django_large_image/static/django_large_image/js/geojs/1.8.3/geo.min.js b/django_large_image/static/django_large_image/js/geojs/1.8.3/geo.min.js new file mode 100644 index 0000000..1a16d77 --- /dev/null +++ b/django_large_image/static/django_large_image/js/geojs/1.8.3/geo.min.js @@ -0,0 +1,67 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.geo=t():e.geo=t()}(self,(function(){return function(){var e={7839:function(e){e.exports={momentum:"geo_action_momentum",pan:"geo_action_pan",rotate:"geo_action_rotate",select:"geo_action_select",unzoomselect:"geo_action_unzoomselect",zoom:"geo_action_zoom",zoomrotate:"geo_action_zoom_rotate",zoomselect:"geo_action_zoomselect",annotation_line:"geo_annotation_line",annotation_polygon:"geo_annotation_polygon",annotation_rectangle:"geo_annotation_rectangle",annotation_edit_handle:"geo_annotation_edit_handle"}},7800:function(e,t,n){var r=n(5638),i=n(5699),o=n(5108),a=n(7839),s=n(6853),l=n(4634),u=n(4647).registerAnnotation,c=n(4708),d=n(7098),f=n(2557),p=n(4343),h=n(9757),m=0,g={create:"create",done:"done",highlight:"highlight",edit:"edit"},v="annotationAction",y={fill:!0,fillColor:function(e){return e.selected?{r:0,g:1,b:1}:{r:.3,g:.3,b:.3}},fillOpacity:function(e){return e.selected?.5:.25},radius:function(e){return"edge"===e.type||"rotate"===e.type?8:10},scaled:!1,stroke:!0,strokeColor:{r:0,g:0,b:1},strokeOpacity:1,strokeWidth:function(e){return"edge"===e.type||"rotate"===e.type?2:3},rotateHandleOffset:24,rotateHandleRotation:-Math.PI/4,resizeHandleOffset:48,resizeHandleRotation:-Math.PI/4,handles:{vertex:!0,edge:!0,center:!0,rotate:!0,resize:!0}},b=function e(t,n){"use strict";if(!(this instanceof e))return new e(t,n);var i=this,u=r.extend({},{showLabel:!0},n||{}),c=u.annotationId;delete u.annotationId,void 0===c||u.layer&&u.layer.annotationById(c)?(m+=1,void 0!==c&&console.warn("Annotation id "+c+" is in use; using "+m+" instead."),c=m):c>m&&(m=c);var d=u.name||t.charAt(0).toUpperCase()+t.substr(1)+" "+c,f=u.label||null,p=u.description||void 0,b=t,x=u.layer,w=u.state||g.done;delete u.state,delete u.layer,delete u.name,delete u.label,delete u.description,u.constraint&&(l.isFunction(u.constraint)?this._selectionConstraint=u.constraint:this._selectionConstraint=F(u.constraint)),this._exit=function(){},this.id=function(){return c},this.name=function(e){return void 0===e?d:(null!==e&&(""+e).trim()&&(e=(""+e).trim())!==d&&(d=e,i.modified()),i)},this.label=function(e,t){return void 0===e?null!==f||t?f:d:(e!==f&&(f=e,i.modified()),i)},this._labelPosition=function(){return l.centerFromPerimeter(i._coordinates())},this._rotateHandlePosition=function(e,t){var n,r,o,a=i.layer().map(),s=i._coordinates(),u=l.centerFromPerimeter(i._coordinates()),c=u?a.gcsToDisplay(u,null):void 0,d=0;if(u){for(e=e||0,t=t||0,s=s.outer?s.outer:s,n=0;n(t||i.options("style").closed?3:2)&&(d[s]={x:d[n].x,y:d[n].y},e.event===o.actionup&&(t&&r&&(i.options("style").closed=!0),d.splice(s,1))),(d.length!==f||d[s].x!==p.x||d[s].y!==p.y)&&(i._coordinates(c),!0)},this._convertCoordinates=function(e,t,n){var r=!n;return n=(n=n||i._coordinates()).outer?{outer:s.transformCoordinates(e,t,n.outer),inner:(n.inner||[]).map((function(n){return s.transformCoordinates(e,t,n)}))}:s.transformCoordinates(e,t,n),r&&i._coordinates(n),n}};function x(e,t,n,r,i){return n||(n=e.state()),n===g.create?[{action:a["annotation_"+r],name:r+" create",owner:v,input:"left",modifiers:{shift:!1,ctrl:!1}},{action:a["annotation_"+r],name:r+" create",owner:v,input:"pan"}]:t.apply(e,i)}function w(e,t,n){var r=e.layer();if(e.state()===g.create&&r&&t.state.action===a["annotation_"+n]){var i=r.options("continuousPointProximity"),s=r.options("continuousPointCollinearity"),l=r.options("continuousCloseProximity");if(i||0===i){var u=e.options("vertices"),c=!1;if(!u.length)return u.push(t.mouse.mapgcs),u.push(t.mouse.mapgcs),!0;var d=r.displayDistance(u[u.length-2],null,t.mouse.map,"display");if(d&&d>i){if(u.length>=(e._lastClickVertexCount||1)+3){var f=r.displayDistance(u[u.length-3],null,u[u.length-2],null),p=d,h=r.displayDistance(u[u.length-3],null,t.mouse.map,"display");if(f&&h)(h*h-f*f-p*p)/(2*f*p)>Math.cos(s)&&u.pop()}u[u.length-1]=t.mouse.mapgcs,u.push(t.mouse.mapgcs),c=!0}return(l||0===l)&&t.event===o.actionup&&(!0===l||r.displayDistance(u[0],null,t.mouse.map,"display")<=i)?u.length<3+("polygon"===n?1:0)?"remove":(u.pop(),e.state(g.done),"done"):c}}}var _=function e(t,n){"use strict";if(!(this instanceof e))return new e(t,n);(t=r.extend(!0,{},{style:{fill:!0,fillColor:{r:0,g:1,b:0},fillOpacity:.25,polygon:function(e){return e.polygon},stroke:!0,strokeColor:{r:0,g:0,b:0},strokeOpacity:1,strokeWidth:3,uniformPolygon:!0},highlightStyle:{fillColor:{r:0,g:1,b:1},fillOpacity:.5,strokeWidth:5},createStyle:{fillColor:{r:.3,g:.3,b:.3},fillOpacity:.25,strokeColor:{r:0,g:0,b:1}}},t||{})).corners=t.corners||t.coordinates||[],delete t.coordinates,b.call(this,n||"rectangle",t);var i=this,s=this.actions,l=this.processEditAction;this.actions=function(e){return e||(e=i.state()),e===g.create?[{action:a.annotation_rectangle,name:"rectangle create",owner:v,input:"left",modifiers:{shift:!1,ctrl:!1},selectionRectangle:!0,selectionConstraint:this._selectionConstraint}]:s.apply(i,arguments)},this.processAction=function(e){var t=i.layer();if(i.state()===g.create&&t&&e.event===o.actionselection&&e.state.action===a.annotation_rectangle){var n=t.map(),r=[n.displayToGcs({x:e.lowerLeft.x,y:e.lowerLeft.y},null),n.displayToGcs({x:e.lowerLeft.x,y:e.upperRight.y},null),n.displayToGcs({x:e.upperRight.x,y:e.upperRight.y},null),n.displayToGcs({x:e.upperRight.x,y:e.lowerLeft.y},null)];return this._selectionConstraint&&e.mouse&&e.state.origin&&this._selectionConstraint(e.mouse.mapgcs,e.state.origin.mapgcs,r),t.displayDistance(r[0],null,r[1],null)*t.displayDistance(r[0],null,r[3],null)<.01?"remove":(i.options("corners",r),i.state(g.done),"done")}},this.features=function(){var e,t=i.options(),n=i.state();return e=[],t.corners&&t.corners.length>=4&&(e=[{polygon:{polygon:t.corners,style:i.styleForState(n)}}]),n===g.edit&&i._addEditHandles(e,t.corners),e},this._coordinates=function(e){return e&&e.length>=4&&i.options("corners",e.slice(0,4)),i.options("corners")},this._coordinateOption="corners",this._geojsonCoordinates=function(e){var t=i.coordinates(e);if(t&&i.state()!==g.create&&!(t.length<4)){for(var n=[],r=0;r<4;r+=1)n.push([t[r].x,t[r].y]);return n.push([t[0].x,t[0].y]),[n]}},this._geojsonGeometryType=function(){return"Polygon"},this._geojsonStyles=function(){return["fill","fillColor","fillOpacity","lineCap","lineJoin","stroke","strokeColor","strokeOffset","strokeOpacity","strokeWidth"]},this._setCornersFromMouse=function(e,t){var n=i.layer().map(),o=n.gcsToDisplay({x:e[0].x,y:e[0].y},null),a=n.gcsToDisplay(t.mapgcs,null),s={x:a.x,y:o.y},l={x:o.x,y:a.y};e[2]=r.extend({},t.mapgcs),e[1]=n.displayToGcs(s,null),e[3]=n.displayToGcs(l,null),this._selectionConstraint&&this._selectionConstraint(t.mapgcs,e[0],e)},this.mouseMove=function(e){if(i.state()===g.create){var t=i.options("corners");return t.length?(i._setCornersFromMouse(t,e),!0):void 0}},this.mouseClick=function(e){var t=i.layer();if(i.state()===g.create&&t&&(e.buttonsDown.left||e.buttonsDown.right)){var n=i.options("corners");if(!e.buttonsDown.right||n.length)return e.handled=!0,n.length?(i._setCornersFromMouse(n,e),t.displayDistance(n[0],null,n[1],null)*t.displayDistance(n[0],null,n[3],null)<.01?"remove":(i.state(g.done),"done")):e.buttonsDown.left?(n.push(r.extend({},e.mapgcs)),n.push(r.extend({},e.mapgcs)),n.push(r.extend({},e.mapgcs)),n.push(r.extend({},e.mapgcs)),!0):void 0}},this.processEditAction=function(e){var t,n,r,o,a,s=i._editHandle.startCoordinates,u={x:e.mouse.mapgcs.x-e.state.origin.mapgcs.x,y:e.mouse.mapgcs.y-e.state.origin.mapgcs.y},c=i._editHandle.handle.type,d=i._editHandle.handle.index,f=[Math.atan2(s[1].y-s[0].y,s[1].x-s[0].x),Math.atan2(s[2].y-s[1].y,s[2].x-s[1].x),Math.atan2(s[3].y-s[2].y,s[3].x-s[2].x),Math.atan2(s[0].y-s[3].y,s[0].x-s[3].x)];switch(f[0]||f[1]||f[2]||f[3]||(f[1]=Math.PI/2,f[2]=Math.PI,f[3]=-Math.PI/2),f[0]||f[2]||(f[0]=f[1]-Math.PI/2,f[2]=f[1]+Math.PI/2),f[1]||f[3]||(f[1]=f[2]-Math.PI/2,f[3]=f[2]+Math.PI/2),c){case"vertex":return t=s.map((function(e){return{x:e.x,y:e.y}})),o=f[(d+1)%4],n={x:(u.x*Math.cos(o)+u.y*Math.sin(o))*Math.cos(o),y:(u.y*Math.sin(o)+u.x*Math.cos(o))*Math.sin(o)},a=f[d],r={x:(u.x*Math.cos(a)+u.y*Math.sin(a))*Math.cos(a),y:(u.y*Math.sin(a)+u.x*Math.cos(a))*Math.sin(a)},t[d].x+=u.x,t[d].y+=u.y,t[(d+1)%4].x+=n.x,t[(d+1)%4].y+=n.y,t[(d+3)%4].x+=r.x,t[(d+3)%4].y+=r.y,this._selectionConstraint&&(t=this._selectionConstraint(e.mouse.mapgcs,e.state.origin.mapgcs,t,"vertex",f,d).corners),i.options("corners",t),!0;case"edge":return t=s.map((function(e){return{x:e.x,y:e.y}})),o=f[(d+1)%4],u={x:(u.x*Math.cos(o)+u.y*Math.sin(o))*Math.cos(o),y:(u.y*Math.sin(o)+u.x*Math.cos(o))*Math.sin(o)},t[d].x+=u.x,t[d].y+=u.y,t[(d+1)%4].x+=u.x,t[(d+1)%4].y+=u.y,this._selectionConstraint&&(t=this._selectionConstraint(e.mouse.mapgcs,e.state.origin.mapgcs,t,"edge",f,d).corners),i.options("corners",t),!0}return l.apply(i,arguments)}};i(_,b);var C={};C[p.capabilities.feature]=!0,u("rectangle",_,C);var S=function e(t,n){"use strict";if(t=r.extend({},t,{constraint:1}),!(this instanceof e))return new e(t,n);_.call(this,t,n||"square")};i(S,_);var A={};A[p.capabilities.feature]=!0,u("square",S,A);var T=function e(t,n){"use strict";if(!(this instanceof e))return new e(t,n);_.call(this,t,n||"ellipse");var i=this;this.features=function(){var e,t=i.options(),n=i.state();if(e=[],t.corners&&t.corners.length>=4){var o=i.styleForState(n),a=Math.pow(Math.pow(t.corners[0].x-t.corners[1].x,2)+Math.pow(t.corners[0].y-t.corners[1].y,2),.5),s=Math.pow(Math.pow(t.corners[0].x-t.corners[3].x,2)+Math.pow(t.corners[0].y-t.corners[3].y,2),.5),l=Math.max(a,s)/2/i.layer().map().unitsPerPixel(0),u=a?s/a:1e20,c=-Math.atan2(t.corners[1].y-t.corners[0].y,t.corners[1].x-t.corners[0].x);e=[{marker:{x:(t.corners[0].x+t.corners[1].x+t.corners[2].x+t.corners[3].x)/4,y:(t.corners[0].y+t.corners[1].y+t.corners[2].y+t.corners[3].y)/4,style:r.extend({},o,{radius:l,symbolValue:u,rotation:c,strokeOffset:0,radiusIncludesStroke:!1,scaleWithZoom:d.scaleMode.fill,rotateWithMap:!0,strokeOpacity:!1===o.stroke?0:o.strokeOpacity,fillOpacity:!1===o.fill?0:o.fillOpacity})}}]}return n===g.edit&&i._addEditHandles(e,t.corners),e}};i(T,_);var P={};P[d.capabilities.feature]=!0,u("ellipse",T,P);var O=function e(t,n){"use strict";if(t=r.extend({},t,{constraint:1}),!(this instanceof e))return new e(t,n);T.call(this,t,n||"circle")};i(O,T);var M={};M[d.capabilities.feature]=!0,u("circle",O,M);var E=function e(t){"use strict";if(!(this instanceof e))return new e(t);(t=r.extend(!0,{},{style:{fill:!0,fillColor:{r:0,g:1,b:0},fillOpacity:.25,polygon:function(e){return e.polygon},stroke:!0,strokeColor:{r:0,g:0,b:0},strokeOpacity:1,strokeWidth:3,uniformPolygon:!0},highlightStyle:{fillColor:{r:0,g:1,b:1},fillOpacity:.5,strokeWidth:5},createStyle:{closed:!1,fillColor:{r:.3,g:.3,b:.3},fillOpacity:.25,line:function(e){var t=n._coordinates();return Array.apply(null,Array((t.outer||t).length)).map((function(){return e}))},position:function(e,t){return void 0!==e.x?e.x:n.options("vertices")[t]},stroke:!1,strokeColor:{r:0,g:0,b:1}}},t||{})).vertices=t.vertices||t.coordinates||[],delete t.coordinates,b.call(this,"polygon",t);var n=this,i=this.actions;this.features=function(){var e,t=n.options(),r=n.state(),i=n.styleForState(r);if(r===g.create)e=[],t.vertices&&(t.vertices.outer||t.vertices.length>=3)&&(e[1]={polygon:{polygon:t.vertices,style:i}}),t.vertices&&t.vertices.length>=2&&(e[2]={line:{line:t.vertices,style:i}});else e=[{polygon:{polygon:t.vertices,style:i}}],r===g.edit&&n._addEditHandles(e,t.vertices);return e},this._coordinates=function(e){return e&&n.options("vertices",e),n.options("vertices")},this.mouseMove=function(e){if(n.state()===g.create){var t=n.options("vertices");return t.length?(t[t.length-1]=e.mapgcs,!0):void 0}},this.mouseClick=function(e){var t=n.layer();if(n.state()===g.create&&t){var r,i=!!e.buttonsDown.right;if(e.buttonsDown.left||e.buttonsDown.right){var o=n.options("vertices");if(!e.buttonsDown.right||o.length)return e.handled=!0,e.buttonsDown.left&&(o.length?o.length>=2&&t.displayDistance(o[o.length-2],null,e.map,"display")<=t.options("adjacentPointProximity")?(r=!0,n._lastClick&&e.time-n._lastClick=2&&t.displayDistance(o[0],null,e.map,"display")<=t.options("finalPointProximity")?i=!0:o[o.length-1]=e.mapgcs:o.push(e.mapgcs),i||r||o.push(e.mapgcs),n._lastClick=e.time,n._lastClickVertexCount=o.length),i?o.length<4?"remove":(o.pop(),n.state(g.done),"done"):!r}}},this.actions=function(e){return x(n,i,e,"polygon",arguments)},this.processAction=function(e){return w(n,e,"polygon")},this._geojsonCoordinates=function(e){var t=n.coordinates(e);if(!(!t||!t.outer&&t.length<3||n.state()===g.create)){var r=[];return t.outer?((r=[t.outer.map((function(e){return[e.x,e.y]}))])[0].push(r[0][0].slice()),(t.inner||[]).forEach((function(e){var t=e.map((function(e){return[e.x,e.y]}));t.push(t[0].slice()),r.push(t)}))):(r=[t.map((function(e){return[e.x,e.y]}))])[0].push(r[0][0].slice()),r}},this._geojsonGeometryType=function(){return"Polygon"},this._geojsonStyles=function(){return["fill","fillColor","fillOpacity","lineCap","lineJoin","stroke","strokeColor","strokeOffset","strokeOpacity","strokeWidth"]}};i(E,b);var D={};D[p.capabilities.feature]=!0,D[c.capabilities.basic]=[g.create],u("polygon",E,D);var k=function e(t){"use strict";if(!(this instanceof e))return new e(t);(t=r.extend(!0,{},{style:{line:function(e){return Array.apply(null,Array(n.options("vertices").length)).map((function(){return e}))},position:function(e,t){return n.options("vertices")[t]},strokeColor:{r:0,g:0,b:0},strokeOpacity:1,strokeWidth:3,closed:!1,lineCap:"butt",lineJoin:"miter"},highlightStyle:{strokeWidth:5},createStyle:{line:function(e){return Array.apply(null,Array(n.options("vertices").length)).map((function(){return e}))},position:function(e,t){return n.options("vertices")[t]},strokeColor:{r:0,g:0,b:1},strokeOpacity:1,strokeWidth:3,closed:!1,lineCap:"butt",lineJoin:"miter"}},t||{})).vertices=t.vertices||t.coordinates||[],delete t.coordinates,b.call(this,"line",t);var n=this,i=this.actions,o=this.processEditAction;this.features=function(){var e,t=n.options(),r=n.state();if(r===g.create)e=[{line:{line:t.vertices,style:n.styleForState(r)}}];else e=[{line:{line:t.vertices,style:n.styleForState(r)}}],r===g.edit&&n._addEditHandles(e,t.vertices,void 0,!n.style("closed"));return e},this._coordinates=function(e){return e&&n.options("vertices",e),n.options("vertices")},this.mouseMove=function(e){if(n.state()===g.create){var t=n.options("vertices");return t.length?(t[t.length-1]=e.mapgcs,!0):void 0}},this.mouseClick=function(e){var t=n.layer();if(n.state()===g.create&&t){var r,i=!!e.buttonsDown.right;if(e.buttonsDown.left||e.buttonsDown.right){var o=n.options("vertices");if(!e.buttonsDown.right||o.length)return e.handled=!0,e.buttonsDown.left&&(o.length?o.length>=2&&t.displayDistance(o[o.length-2],null,e.map,"display")<=t.options("adjacentPointProximity")?(r=!0,n._lastClick&&e.time-n._lastClick=2&&t.displayDistance(o[0],null,e.map,"display")<=t.options("finalPointProximity")?i="close":o[o.length-1]=e.mapgcs:o.push(e.mapgcs),i||r||o.push(e.mapgcs),n._lastClick=e.time,n._lastClickVertexCount=o.length),i?o.length<3?"remove":(o.pop(),n.options("style").closed="close"===i,n.state(g.done),"done"):!r}}},this.actions=function(e){return x(n,i,e,"line",arguments)},this.processAction=function(e){return w(n,e,"line")},this._geojsonCoordinates=function(e){var t=n.coordinates(e);if(t&&!(t.length<2)&&n.state()!==g.create){for(var r=[],i=0;i=1&&n.options("position",e[0]),n.state()===g.create?[]:[n.options("position")]},this._coordinateOption="position",this.mouseClick=function(e){if(n.state()===g.create&&e.buttonsDown.left)return e.handled=!0,n.options("position",e.mapgcs),n.state(g.done),"done"},this._geojsonStyles=function(){return["fill","fillColor","fillOpacity","radius","scaled","stroke","strokeColor","strokeOpacity","strokeWidth"]},this._geojsonCoordinates=function(e){var t=n.coordinates(e);if(t&&n.state()!==g.create&&!(t.length<1)&&void 0!==t[0])return[t[0].x,t[0].y]},this._geojsonGeometryType=function(){return"Point"}};i(N,b);var R={};function F(e){var t=Array.isArray(e)?e:[e];return function(e,n,r,i,o,a){var s,l=e;if(r||(r=[{x:n.x,y:n.y},{x:e.x,y:n.y},{x:e.x,y:e.y},{x:n.x,y:e.y}]),i){var u,c,d=(a+1)%4,f=(a+2)%4,p=(a+3)%4,h=Math.pow(Math.pow(r[a].x-r[d].x,2)+Math.pow(r[a].y-r[d].y,2),.5),m=Math.pow(Math.pow(r[a].x-r[p].x,2)+Math.pow(r[a].y-r[p].y,2),.5),g=Math.abs(h*m);t.forEach((function(e){1===e||a%2||(e=1/e);var t=Math.pow(g*e,.5),n=Math.pow(t-m,2)+Math.pow(t/e-h,2);(void 0===s||n=0&&(e===y.currentAnnotation&&(y.currentAnnotation=null),e._exit(),A.splice(n,1),!1!==t&&(y.modified(),y.draw()),y.geoTrigger(a.annotation.remove,{annotation:e})),n>=0},this.removeAllAnnotations=function(e,t){for(var n,r=0,i=0;i=0)e=!!e&&["false","no","off"].indexOf((""+e).toLowerCase())<0;else{if(!v.isNonNullFinite(e))return;e=+e}break;case"coordinate2":if(""===e)break;if(e&&v.isNonNullFinite(e.x)&&v.isNonNullFinite(e.y)){e.x=+e.x,e.y=+e.y;break}try{e=JSON.parse(e)}catch(e){}if(e&&v.isNonNullFinite(e.x)&&v.isNonNullFinite(e.y)){e.x=+e.x,e.y=+e.y;break}if(Array.isArray(e)&&v.isNonNullFinite(e[0])&&v.isNonNullFinite(e[1])){e={x:+e[0],y:+e[1]};break}if(!(n=/^\s*([-.0-9eE]+)(?:\s+|\s*,)\s*([-.0-9eE]+)\s*$/.exec(""+e))||!isFinite(n[1])||!isFinite(n[2]))return;e={x:+n[1],y:+n[2]};break;case"color":if(void 0===(e=v.convertColor(e))||void 0===e.r)return;break;case"number":if(!v.isNonNullFinite(e))return;e=+e;break;case"numberOrBlank":if(""===e)break;if(!v.isNonNullFinite(e))return;e=+e;break;case"opacity":if(""===e)return;if(e=+e,isNaN(e)||e<0||e>1)return;break;case"positive":if(e=+e,!isFinite(e)||e<=0)return;break;case"text":e=""+e}return e}},this._update=function(){if(y.timestamp()>C.timestamp()){var e=y.options("showLabels")?[]:null,t=y.options("clickToEdit")||y.mode()===y.modes.edit;u.each(T,(function(e,t){u.each(t,(function(e,t){t.data=[],delete t.feature.scaleOnZoom}))})),u.each(A,(function(n,r){var i=r.features();if(e){var o=r.labelRecord();o&&e.push(o)}u.each(i,(function(e,n){void 0===T[e]&&(T[e]={}),u.each(n,(function(n,i){if(T[e][n])(o=T[e][n].feature).selectionAPI()!==!!t&&(o.selectionAPI(t),t?(o.geoOn(a.feature.mouseon,y._handleMouseOn),o.geoOn(a.feature.mouseoff,y._handleMouseOff)):(o.geoOff(a.feature.mouseon,y._handleMouseOn),o.geoOff(a.feature.mouseoff,y._handleMouseOff)));else{var o=y.createFeature(n,{gcs:y.map().gcs(),selectionAPI:t});if(!o){var s="error_feature_"+n;return void(y[s]||(console.warn("Cannot create a "+n+" feature for annotations."),y[s]=!0))}t&&(o.geoOn(a.feature.mouseon,y._handleMouseOn),o.geoOn(a.feature.mouseoff,y._handleMouseOff));var l={};u.each(["closed","fill","fillColor","fillOpacity","line","lineCap","lineJoin","polygon","position","radius","radiusIncludesStroke","rotateWithMap","rotation","scaleWithZoom","stroke","strokeColor","strokeOffset","strokeOpacity","strokeWidth","symbolValue","uniformPolygon"],(function(e,t){var n;void 0!==o.style()[t]&&(n=o.style.get(t)),l[t]=function(e,r,i,o){var a=e&&e.style?e.style:e&&e[2]&&e[2].style?e[2].style:i.style,s=a?a[t]:e;return v.isFunction(s)&&(s=s(e,r,i,o)),void 0===s&&n&&(s=n(e,r,i,o)),s}})),o.style(l),T[e][n]={feature:o,style:l,data:[]}}var c=i.data||i;Array.isArray(c)||(c=[c]),c.forEach((function(t){t.annotation=r,T[e][n].data.push(t),i.scaleOnZoom&&(T[e][n].feature.scaleOnZoom=!0)}))}))}))})),u.each(T,(function(e,t){u.each(t,(function(e,t){t.feature.data(t.data)}))})),y._updateLabels(e),C.modified()}return _.call(y,arguments),y},this._updateLabels=function(e){if(!e||!e.length)return y._removeLabelFeature(),y;if(!f){if(!(s.registries.features[y.rendererName()]||{}).text){var t=s.rendererForFeatures(["text"]);p=s.createLayer("feature",y.map(),{renderer:t}),y.addChild(p),p._update(),y.geoTrigger(a.layerAdd,{target:y,layer:p})}var n={};d.usedStyles.forEach((function(e){n[e]=function(t,n){return t.style&&void 0!==t.style[e]?t.style[e]:(y.options("defaultLabelStyle")||{})[e]}})),f=(p||y).createFeature("text",{style:n,gcs:y.map().gcs(),position:function(e){return e.position}})}return f.data(e),y},this._handleZoom=function(){var e,t=y.features();for(e=0;e0&&e.height>0))throw new Error("Invalid viewport dimensions");e.width===this._viewport.width&&e.height===this._viewport.height||(this._viewport.width&&this._viewport.height&&(this._scale([this._viewport.width/e.width,this._viewport.height/e.height,1]),this._translate([(e.width-this._viewport.width)/2,(e.height-this._viewport.height)/2,0])),this._viewport={width:e.width,height:e.height,left:e.left,top:e.top},this._update(),this.geoTrigger(r.camera.viewport,{camera:this,viewport:this.viewport}))}}),this._resetView=function(){return l.identity(this._view),this},this._translate=function(e){return l.translate(this._view,this._view,e),this},this._scale=function(e){return l.scale(this._view,this._view,e),this},this._worldToClip4=function(e){return u.transformMat4(e,e,this._transform)},this._clipToWorld4=function(e){return u.transformMat4(e,e,this._inverse)},this.applyProjection=function(e){var t;return"perspective"===this._projection?(t=1/(e[3]||1),e[0]=t*e[0],e[1]=t*e[1],e[2]=t*e[2],e[3]=t):e[3]=1,e},this.unapplyProjection=function(e){var t;return"perspective"===this._projection?(t=e[3]||1,e[0]=t*e[0],e[1]=t*e[1],e[2]=t*e[2],e[3]=t):e[3]=1,e},this.worldToDisplay4=function(e){return e=[e[0],e[1],e[2]||0,e[3]||1],(e=u.transformMat4(e,e,this.display))[3]&&1!==e[3]&&(e=[e[0]/e[3],e[1]/e[3],e[2]/e[3],1]),e},this.displayToWorld4=function(e){return e=[e[0],e[1],e[2]||0,e[3]||1],(e=u.transformMat4(e,e,this.world))[3]&&1!==e[3]&&(e=[e[0]/e[3],e[1]/e[3],e[2]/e[3],1]),e},this.worldToDisplay=function(e){var t=this._clipbounds[this._projection];return{x:(e=this.worldToDisplay4([e.x,e.y,-t.near]))[0],y:e[1]}},this.displayToWorld=function(e){return{x:(e=this.displayToWorld4([e.x,e.y,-1]))[0],y:e[1]}},this._getBounds=function(){var e,t,n,r,i={};return e=this.displayToWorld({x:0,y:0}),t=this.displayToWorld({x:this._viewport.width,y:0}),n=this.displayToWorld({x:0,y:this._viewport.height}),r=this.displayToWorld({x:this._viewport.width,y:this._viewport.height}),i.left=Math.min(e.x,t.x,n.x,r.x),i.bottom=Math.min(e.y,t.y,n.y,r.y),i.right=Math.max(e.x,t.x,n.x,r.x),i.top=Math.max(e.y,t.y,n.y,r.y),i},this._setBounds=function(e){var t={width:e.right-e.left,height:e.top-e.bottom},n={x:(e.left+e.right)/2,y:(e.bottom+e.top)/2};return this._viewFromCenterSizeRotation(n,t,0),this},this._viewFromCenterSizeRotation=function(e,t,n){var r,i,a,s=o.vec3AsArray(),l=o.vec3AsArray();return this._resetView(),(i=Math.abs(t.width))/(a=Math.abs(t.height))>=(r=this._viewport.width/this._viewport.height)?(a=i/r,l[0]=2/i,l[1]=2/a):(i=a*r,l[0]=2/i,l[1]=2/a),l[2]=1,this._scale(l),n&&this._rotate(n),s[0]=-e.x,s[1]=-e.y,s[2]=0,this._translate(s),this},this.viewFromCenterSizeRotation=function(e,t,n){return this._viewFromCenterSizeRotation(e,t,n),this._update(),this},this.pan=function(e){if(e.x||e.y||e.z)return this._translate([e.x,e.y,e.z||0]),this._update(),this},this.zoom=function(e){if(1!==e)return l.scale(this._view,this._view,[e,e,e]),this._update(),this},this._rotate=function(e,t,n){if(e){n=n||[0,0,-1],t?void 0!==t.x&&(t=[t.x||0,t.y||0,t.z||0]):t=[0,0,0];var r=[-t[0],-t[1],-t[2]];return l.translate(this._view,this._view,t),l.rotate(this._view,this._view,e,n),l.translate(this._view,this._view,r),this}},this.css=function(t){var n;switch((t||"").toLowerCase()){case"display":case"":n=this.display;break;case"world":n=this.world;break;default:throw new Error("Unknown transform "+t)}return e.css(n)},this.ppMatrix=function(e,t){var n=e;function r(e){var r=n[e],i=r.toExponential(t);return r>=0&&(i=" "+i),i}return t=t||2,[[r(0),r(4),r(8),r(12)].join(" "),[r(1),r(5),r(9),r(13)].join(" "),[r(2),r(6),r(10),r(14)].join(" "),[r(3),r(7),r(11),r(15)].join(" ")].join("\n")},this.toString=function(){return this.ppMatrix(this._transform)},this.debug=function(){return["bounds",JSON.stringify(this.bounds),"view:",this.ppMatrix(this._view),"projection:",this.ppMatrix(this._proj),"transform:",this.ppMatrix(this._transform)].join("\n")},this.valueOf=function(){return this._transform},this._clipbounds=this.constructor.clipbounds,this._resetView(),this.projection=t.projection||"parallel",t.viewport&&(this.viewport=t.viewport),this._update(),this};c.projection={perspective:!0,parallel:!0},c.clipbounds={perspective:{left:-1,right:1,top:1,bottom:-1,far:2e3,near:.01},parallel:{left:-1,right:1,top:1,bottom:-1,far:-1,near:1}},c.css=function(e){return"matrix3d("+e.map((function(e){return(e=(+e).toPrecision(15)).indexOf("e")>=0?e=(+e).toString():e.indexOf(".")>=0&&(e=e.replace(/(\.|)0+$/,"")),e})).join(",")+")"},c.vec3=s,c.mat3=a,c.vec4=u,c.mat4=l,r(c,i),e.exports=c},3086:function(e,t,n){var r,i=n(5699),o=n(4647).registerRenderer,a=n(3234),s=function e(t){"use strict";var r=n(5638);if(!(this instanceof e))return new e(t);t=t||{},a.call(this,t);var i=this,o=!0,s=this._init,l=this._exit;return this.clearCanvas=function(e){o=e},this.api=function(){return e.apiname},this._init=function(){if(i.initialized())return i;s.call(i);var e=t.canvas||r(document.createElement("canvas"));i.context2d=e[0].getContext("2d"),e.addClass("canvas-canvas"),r(i.layer().node().get(0)).append(e),i.canvas(e);var n=i.layer().map().size();return i._resize(0,0,n.width,n.height),i},this._resize=function(e,t,n,r){var o=i.canvas();return parseInt(o.attr("width"),10)===n&&parseInt(o.attr("height"),10)===r||(i._setWidthHeight(n,r),o.attr("width",n),o.attr("height",r),i._render()),i},this._render=function(){return i.layer().map().scheduleAnimationFrame(i._renderFrame),i},this._renderFrame=function(){var e,t=i.layer(),n=t.map(),r=n.size(),a=t.features?t.features():[];for(e=0;e=0;i-=1)o=t.worldToDisplay(s[i]),(a=(l(n[i],i)-u)/c)<=0||(e.globalAlpha=a<.01?.01:a>1?1:a,e.drawImage(p._circle,o.x-r,o.y-r))},this._renderBinnedData=function(e,t,n,r,i){var o,a,s,l,u,c,d,f,h=p.gcsPosition(),m=p.intensity(),g=p.minIntensity(),v=p.maxIntensity()-g||1,y=t.size(),b=[],x=Math.ceil(r/i),w=Math.ceil(y.width/i)+2*x+2,_=Math.ceil(y.height/i)+2*x+2,C=n.length;for(o=0;o=w||(u=Math.floor((a.y-f)/i)+x+1)<0||u>=_||(s=(m(n[o],o)-g)/v)<=0||(s>1&&(s=1),b[u]=b[u]||[],l*=4,(c=b[u])[l]?(c[l]+=s,c[l+1]+=(1-c[l+1])*s,c[l+2]+=a.x*s,c[l+3]+=a.y*s):(c[l]=c[l+1]=s,c[l+2]=a.x*s,c[l+3]=a.y*s)));for(u=b.length-1;u>=0;u-=1)if(c=b[u])for(l=c.length-4;l>=0;l-=4)c[l]&&(s=c[l+1],e.globalAlpha=s<.01?.01:s>1?1:s,e.drawImage(p._circle,c[l+2]/c[l]-r,c[l+3]/c[l]-r))},this._renderOnCanvas=function(e,t){if(g.timestamp()=o.length&&(s=0);(s<1||isNaN(s))&&(s=!1),p._binned=s,e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,f.width,f.height),c="",a>.5&&a<8192&&(t.scheduleAnimationFrame(p._setTransform,!1),l.canvas().css({transform:""}),p._createCircle(),p._computeGradient(),s?p._renderBinnedData(e,t,o,a,s):p._renderPoints(e,t,o,a),n=l.canvas()[0],r=e.getImageData(0,0,n.width,n.height),p._colorize(r.data,p._grad),e.putImageData(r,0,0)),u={zoom:t.zoom(),gcsOrigin:t.displayToGcs({x:0,y:0},null),rotation:t.rotation(),lastScale:void 0,lastOrigin:{x:0,y:0},lastRotation:void 0},g.modified(),l.renderer().clearCanvas(!1),d=Date.now()-i}return p},this._init=function(){return h.call(p,t),p.geoOn(f.pan,p._animatePan),p},this._update=function(){return m.call(p),(p.buildTime().timestamp()<=p.dataTime().timestamp()||p.updateTime().timestamp()=0&&i=0&&o=m)){for(o=l.m_info.imageData.data,s=l.m_info.indices,e=c;e<=m;e+=1)(t=s[e])!==n&&(n=t,i=u[t].color,d=u[t].update),d&&(o[4*e]=i[0],o[4*e+1]=i[1],o[4*e+2]=i[2],o[4*e+3]=i[3]);l.m_info.context.putImageData(l.m_info.imageData,0,0,0,Math.floor(c/l.m_info.width),l.m_info.width,Math.ceil((m+1)/l.m_info.width)),r||(r=l.layer().createFeature("quad",{selectionAPI:!1,gcs:l.gcs(),visible:l.visible(void 0,!0)}),l.dependentFeatures([r]),r.style({image:l.m_info.canvas,position:l.style.get("position")}).data([{}]).draw()),f&&l.geoTrigger(a.pixelmap.prepared,{pixelmap:l})}},this._exit=function(){return r&&l.layer()&&(l.layer().deleteFeature(r),r=null,l.dependentFeatures([])),i(),l},this._init(t),this};r(l,o),i("canvas","pixelmap",l),e.exports=l},9895:function(e,t,n){var r=n(5699),i=n(4647).registerFeature,o=n(5017),a=n(4634),s=function e(t){"use strict";if(!(this instanceof e))return new e(t);o.call(this,t),n(3160).call(this);var r,i=n(5638),s=this,l=this._exit,u=this._init,c=this._update;return this._build=function(){s.position()&&((r=s._generateQuads()).imgQuads&&r.imgQuads.sort((function(e,t){return e.pos[2]-t.pos[2]})),s.buildTime().modified())},this._checkQuadUpdate=function(e,t){s.layer().map().scheduleAnimationFrame(s._checkIfChanged)},this._checkIfChanged=function(){if(r&&r.vidQuads&&r.vidQuads.length){var e=!1,t=!1;i.each(r.vidQuads,(function(n,r){r.video&&void 0!==r.video.HAVE_CURRENT_DATA&&(!r.video.seeking&&r.video.readyState>=r.video.HAVE_CURRENT_DATA&&(e=!0),r.video.paused&&!r.video.seeking||(t=!0))})),e&&s.renderer()&&s.renderer()._render(),t&&s.layer().map().scheduleAnimationFrame(s._checkIfChanged)}},this._renderColorQuads=function(e,t){if(r.clrQuads&&r.clrQuads.length){var n=e.globalAlpha,o=n;i.each(r.clrQuads,(function(n,r){var i=t.gcsToDisplay({x:r.pos[0],y:r.pos[1]},null),s=t.gcsToDisplay({x:r.pos[3],y:r.pos[4]},null),l=t.gcsToDisplay({x:r.pos[6],y:r.pos[7]},null),u=t.gcsToDisplay({x:r.pos[9],y:r.pos[10]},null);r.opacity!==o&&(o=r.opacity,e.globalAlpha=o),e.fillStyle=a.convertColorToHex(r.color,!0),e.beginPath(),e.moveTo(i.x,i.y),e.lineTo(s.x,s.y),e.lineTo(u.x,u.y),e.lineTo(l.x,l.y),e.closePath(),e.fill()})),o!==n&&(e.globalAlpha=n)}},this._renderImageAndVideoQuads=function(e,t){if(r.imgQuads&&r.imgQuads.length||r.vidQuads&&r.vidQuads.length){var n=e.globalAlpha,o=n;i.each([r.imgQuads,r.vidQuads],(function(n,r){r&&i.each(r,(function(n,r){var i,a,s;if(r.image)a=(i=r.image).width,s=i.height;else if(r.video&&(a=(i=r.video).videoWidth,s=i.videoHeight,i.seeking))return;if(i&&a&&s&&!(r.opacity<=0)){var l=t.gcsToDisplay({x:r.pos[0],y:r.pos[1]},null),u=t.gcsToDisplay({x:r.pos[6],y:r.pos[7]},null),c=t.gcsToDisplay({x:r.pos[9],y:r.pos[10]},null);if(e.setTransform((c.x-u.x)/a,(c.y-u.y)/a,(l.x-u.x)/s,(l.y-u.y)/s,u.x,u.y),r.opacity!==o&&(o=r.opacity,e.globalAlpha=o),r.crop){var d=Math.min(a,r.crop.x||a),f=Math.min(s,r.crop.y||s),p=Math.max(0,r.crop.left||0),h=Math.max(0,r.crop.top||0),m=Math.min(a,r.crop.right||a),g=Math.min(s,r.crop.bottom||s);a&&s&&d>0&&f>0&&m>p&&g>h&&e.drawImage(i,p,h,Math.floor((m-p)*d/a),Math.floor((g-h)*f/s),0,0,d,f)}else e.drawImage(i,0,0)}}))})),o!==n&&(e.globalAlpha=n),e.setTransform(1,0,0,1,0,0)}},this._delayRender=function(){var e=!1;return r&&r.vidQuads&&r.vidQuads.length&&i.each(r.vidQuads,(function(t,n){n.video&&void 0!==n.video.HAVE_CURRENT_DATA&&(e|=n.video.seeking&&n.delayRenderWhenSeeking)})),e},this._renderOnCanvas=function(e,t){r&&(s._renderImageAndVideoQuads(e,t),s._renderColorQuads(e,t))},this._update=function(){c.call(s),(s.buildTime().timestamp()<=s.dataTime().timestamp()||s.updateTime().timestamp()0&&(u.x<-_||u.x>T.width+_||u.y<-_||u.y>T.height+_)||((c=i.style.get("visible")(t,x))||void 0===c)&&(d=a.convertColorAndOpacity(i.style.get("color")(t,x),i.style.get("textOpacity")(t,x)),p=a.convertColorAndOpacity(i.style.get("textStrokeColor")(t,x),i.style.get("textOpacity")(t,x),{r:0,g:0,b:0,a:0}),0===d.a&&0===p.a||(i._canvasProperty(e,"fillStyle",a.convertColorToRGBA(d)),r=C(t,x),i._canvasProperty(e,"font",i.getFontFromStyles(n,t,x)),i._canvasProperty(e,"textAlign",i.style.get("textAlign")(t,x)||"center"),i._canvasProperty(e,"textBaseline",i.style.get("textBaseline")(t,x)||"middle"),m=i.style.get("rotation")(t,x)||0,g=i.style.get("rotateWithMap")(t,x)&&S,v=i.style.get("textScaled")(t,x),v=a.isNonNullFinite(v)?Math.pow(2,A-v):null,y=i.style.get("offset")(t,x),b=a.mat3AsArray(),(m||g||v&&1!==v||y&&(y.x||y.y))&&(s.translate(b,b,[u.x,u.y]),g&&S&&s.rotate(b,b,S),s.translate(b,b,[y&&y.x?+y.x:0,y&&y.y?+y.y:0]),m&&s.rotate(b,b,m),v&&1!==v&&s.scale(b,b,[v,v]),s.translate(b,b,[-u.x,-u.y])),P[0]===b[0]&&P[1]===b[1]&&P[3]===b[3]&&P[4]===b[4]&&P[6]===b[6]&&P[7]===b[7]||(e.setTransform(b[0],b[1],b[3],b[4],b[6],b[7]),s.copy(P,b)),(d=a.convertColorAndOpacity(i.style.get("shadowColor")(t,x),void 0,{r:0,g:0,b:0,a:0})).a&&(y=i.style.get("shadowOffset")(t,x),f=i.style.get("shadowBlur")(t,x)),d.a&&(y&&(y.x||y.y)||f)?(i._canvasProperty(e,"shadowColor",a.convertColorToRGBA(d)),y&&(m||g)&&i.style.get("shadowRotate")(t,x)&&(b=[+y.x,+y.y,0],l.rotateZ(b,b,[0,0,0],m+(g?S:0)),y={x:b[0],y:b[1]}),i._canvasProperty(e,"shadowOffsetX",y&&y.x?+y.x:0),i._canvasProperty(e,"shadowOffsetY",y&&y.y?+y.y:0),i._canvasProperty(e,"shadowBlur",f||0)):i._canvasProperty(e,"shadowColor","rgba(0,0,0,0)"),p.a&&(h=i.style.get("textStrokeWidth")(t,x),isFinite(h)&&h>0&&(i._canvasProperty(e,"strokeStyle",a.convertColorToRGBA(p)),i._canvasProperty(e,"lineWidth",h),e.strokeText(r,u.x,u.y),i._canvasProperty(e,"shadowColor","rgba(0,0,0,0)"))),e.fillText(r,u.x,u.y)))})),i._canvasProperty(e,"globalAlpha",1),e.setTransform(1,0,0,1,0,0)},this};r(u,o);i("canvas","text",u,{}),e.exports=u},5993:function(e,t,n){var r=function(){"use strict";var e,t=this,n=this._init,r=this._exit,i=this._update,o=0,a=[];this._drawTile=function(n){if(e){var r=t._tileBounds(n),i=n.index.level||0,s=t._tileOffset(i),l=t.tileCropFromBounds(n),u={};l&&(u.crop=l),u.ul=t.fromLocal(t.fromLevel({x:r.left-s.x,y:r.top-s.y},i),0),u.ll=t.fromLocal(t.fromLevel({x:r.left-s.x,y:r.bottom-s.y},i),0),u.ur=t.fromLocal(t.fromLevel({x:r.right-s.x,y:r.top-s.y},i),0),u.lr=t.fromLocal(t.fromLevel({x:r.right-s.x,y:r.bottom-s.y},i),0),u.ul.z=u.ll.z=u.ur.z=u.lr.z=i,o+=1,u.id=o,n.quadId=u.id,u.image=n.image,a.push(u),e.data(a),e._update(),t.draw()}},this._remove=function(n){if(void 0!==n.quadId&&e){for(var r=0;r=3?[e[0],e[1],0]:[0,0,0]}},void 0===e.style?{}:e.style);s.style(t),s.contour(r.extend({},{minColor:"black",minOpacity:0,maxColor:"black",maxOpacity:0,colorRange:[{r:.07514311,g:.468049805,b:1},{r:.468487184,g:.588057293,b:1},{r:.656658579,g:.707001303,b:1},{r:.821573924,g:.837809045,b:1},{r:.943467973,g:.943498599,b:.943398095},{r:1,g:.788626485,b:.750707739},{r:1,g:.6289553,b:.568237474},{r:1,g:.472800903,b:.404551679},{r:.916482116,g:.236630659,b:.209939162}]},e.mesh||{},e.contour||{})),(e.mesh||e.contour)&&s.dataTime().modified()},this._init(t),this};r(o,i),e.exports=o},2805:function(e,t,n){var r=n(5699),i=n(3234),o=n(4647).registerRenderer,a=function e(t){"use strict";if(!(this instanceof e))return new e(t);i.call(this,t),t=t||{};var n=this;return this.api=function(){return"dom"},this._init=function(e){var t=n.layer().node();return!n.canvas()&&t&&t.length&&n.canvas(t[0]),n},this._init(t),this};r(a,i),o("dom",a),e.exports=a},5108:function(e){var t={layerAdd:"geo_layerAdd",layerRemove:"geo_layerRemove",layerMove:"geo_layerMove",zoom:"geo_zoom",rotate:"geo_rotate",pan:"geo_pan",resize:"geo_resize",draw:"geo_draw",drawEnd:"geo_drawEnd",unhidden:"geo_unhidden",hidden:"geo_hidden",mousemove:"geo_mousemove",mouseclick:"geo_mouseclick",brush:"geo_brush",brushend:"geo_brushend",brushstart:"geo_brushstart",select:"geo_select",zoomselect:"geo_zoomselect",unzoomselect:"geo_unzoomselect",actiondown:"geo_actiondown",actionmove:"geo_actionmove",actionup:"geo_actionup",actionselection:"geo_actionselection",actionwheel:"geo_actionwheel",keyaction:"geo_keyaction",transitionstart:"geo_transitionstart",transitionend:"geo_transitionend",transitioncancel:"geo_transitioncancel",parallelprojection:"geo_parallelprojection",feature:{mousemove:"geo_feature_mousemove",mouseover:"geo_feature_mouseover",mouseover_order:"geo_feature_mouseover_order",mouseout:"geo_feature_mouseout",mouseon:"geo_feature_mouseon",mouseoff:"geo_feature_mouseoff",mouseclick:"geo_feature_mouseclick",mouseclick_order:"geo_feature_mouseclick_order",brushend:"geo_feature_brushend",brush:"geo_feature_brush"},pixelmap:{prepared:"geo_pixelmap_prepared"},screenshot:{ready:"geo_screenshot_ready"},camera:{}};t.camera.view="geo_camera_view",t.camera.projection="geo_camera_projection",t.camera.viewport="geo_camera_viewport",t.annotation={},t.annotation.add="geo_annotation_add",t.annotation.add_before="geo_annotation_add_before",t.annotation.update="geo_annotation_update",t.annotation.coordinates="geo_annotation_coordinates",t.annotation.select_edit_handle="geo_annotation_select_edit_handle",t.annotation.edit_action="geo_annotation_edit_action",t.annotation.remove="geo_annotation_remove",t.annotation.state="geo_annotation_state",t.annotation.mode="geo_annotation_mode",e.exports=t},6837:function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var i=n(5638),o=n(5699),a=n(5358),s=n(6618),l=n(6853),u=n(5108),c=function e(t){"use strict";if(!(this instanceof e))return new e(t);a.call(this);var r=n(4634);t=t||{};var o,c=this,d=this._exit,f=this.geoOn,p=this.geoOff,h=void 0===t.selectionAPI?"auto":t.selectionAPI,m={},g=void 0===t.layer?null:t.layer,v=t.gcs,y=void 0===t.visible||t.visible,b=void 0===t.bin?null:t.bin,x=void 0===t.renderer||g&&t.renderer===g.renderer()?null:t.renderer,w=s(),_=s(),C=s(),S=[],A=[];return this._subfeatureStyles={},Object.defineProperty(this,"ready",{get:function(){return o}}),this._bindMouseHandlers=function(){c.selectionAPI()&&(c._unbindMouseHandlers(),c.geoOn(u.mousemove,c._handleMousemove),c.geoOn(u.mouseclick,c._handleMouseclick),c.geoOn(u.brushend,c._handleBrushend),c.geoOn(u.brush,c._handleBrush))},this._unbindMouseHandlers=function(){c.geoOff(u.mousemove,c._handleMousemove),c.geoOff(u.mouseclick,c._handleMouseclick),c.geoOff(u.brushend,c._handleBrushend),c.geoOff(u.brush,c._handleBrush)},this.pointSearch=function(e,t){return{index:[],found:[]}},this.boxSearch=function(e,t,n,r){return c.polygonSearch([e,{x:e.x,y:t.y},t,{x:t.x,y:e.y}],n,r)},this.polygonSearch=function(e,t,n){return{index:[],found:[]}},this._handleMousemove=function(t){var n,r=c.layer().map().interactor().mouse(),i=c.data(),o=c.pointSearch(r.geo),a=[],s=[],l=-1,d=-1;(A.length||o.index.length)&&(n=o.extra||{},o.index.length>1&&c.geoTrigger(u.feature.mouseover_order,{feature:c,mouse:r,previous:A,over:o,sourceEvent:t}),A.length&&(l=A[A.length-1]),a=o.index.filter((function(e){return A.indexOf(e)<0})),s=A.filter((function(e){return o.index.indexOf(e)<0})),e.eventID+=1,a.forEach((function(o,s){c.geoTrigger(u.feature.mouseover,{data:i[o],index:o,extra:n[o],mouse:r,eventID:e.eventID,top:s===a.length-1,sourceEvent:t},!0)})),e.eventID+=1,s.forEach((function(n,o){c.geoTrigger(u.feature.mouseout,{data:i[n],index:n,mouse:r,eventID:e.eventID,top:o===s.length-1,sourceEvent:t},!0)})),e.eventID+=1,o.index.forEach((function(a,s){c.geoTrigger(u.feature.mousemove,{data:i[a],index:a,extra:n[a],mouse:r,eventID:e.eventID,top:s===o.index.length-1,sourceEvent:t},!0)})),(A=o.index).length&&(d=A[A.length-1]),l!==d&&(-1!==l&&c.geoTrigger(u.feature.mouseoff,{data:i[l],index:l,mouse:r,sourceEvent:t},!0),-1!==d&&c.geoTrigger(u.feature.mouseon,{data:i[d],index:d,extra:n[d],mouse:r,sourceEvent:t},!0)))},this._clearSelectedFeatures=function(){return A=[],c},this._handleMouseclick=function(t){var n=c.layer().map().interactor().mouse(),r=c.data(),i=c.pointSearch(n.geo),o=i.extra||{};i.index.length>1&&c.geoTrigger(u.feature.mouseclick_order,{feature:c,mouse:n,over:i,sourceEvent:t}),n.buttonsDown=t.buttonsDown,e.eventID+=1,i.index.forEach((function(a,s){c.geoTrigger(u.feature.mouseclick,{data:r[a],index:a,extra:o[a],mouse:n,eventID:e.eventID,top:s===i.index.length-1,sourceEvent:t},!0)}))},this._handleBrush=function(t){var n=[t.gcs.lowerLeft,t.gcs.lowerRight,t.gcs.upperRight,t.gcs.upperLeft];if(c.layer()){var r=c.layer().map();n=l.transformCoordinates(r.gcs(),r.ingcs(),n)}var i=c.polygonSearch(n);e.eventID+=1,i.index.forEach((function(n,r){c.geoTrigger(u.feature.brush,{data:i.found[r],index:n,mouse:t.mouse,brush:t,eventID:e.eventID,top:r===i.index.length-1},!0)}))},this._handleBrushend=function(t){var n=[t.gcs.lowerLeft,t.gcs.lowerRight,t.gcs.upperRight,t.gcs.upperLeft];if(c.layer()){var r=c.layer().map();n=l.transformCoordinates(r.gcs(),r.ingcs(),n)}var i=c.polygonSearch(n);e.eventID+=1,i.index.forEach((function(n,r){c.geoTrigger(u.feature.brushend,{data:i.found[r],index:n,mouse:t.mouse,brush:t,eventID:e.eventID,top:r===i.index.length-1},!0)}))},this.style=function(e,t){return void 0===e?m:"string"==typeof e&&void 0===t?m[e]:void 0===t?(m=i.extend({},m,e),c.modified(),c):(m[e]=t,c.modified(),c)},this.style.get=function(e){var t;if(void 0===e){var n,i={};for(n in m)m.hasOwnProperty(n)&&(i[n]=c.style.get(n));return i}return t=e.toLowerCase().match(/color$/)?r.isFunction(m[e])?function(){return r.convertColor(m[e].apply(c,arguments))}:r.ensureFunction(r.convertColor(m[e])):r.ensureFunction(m[e]),t},this.updateStyleFromArray=function(e,t,n){if("string"!=typeof e)i.each(e,(function(e,t){c.updateStyleFromArray(e,t)}));else{var r;if(e.toLowerCase().match(/color$/)&&(r={r:0,g:0,b:0}),!Array.isArray(t))return c;c._subfeatureStyles[e]?t.length&&Array.isArray(t[0])?c.style(e,(function(e,n,i,o){var a=(t[o]||[])[n];return void 0!==a?a:r})):c.style(e,(function(e,n,i,o){var a=t[o];return void 0!==a?a:r})):c.style(e,(function(e,n){var i=t[n];return void 0!==i?i:r}))}return n&&c.visible()&&c.draw(),c},this.layer=function(){return g},this.renderer=function(){return x||g&&g.renderer()},this.gcs=function(e){return void 0===e?null==v&&g?g.map().ingcs():v:(v=e,c.modified(),c)},this.featureGcsToDisplay=function(e){var t=g.map();return e=t.gcsToWorld(e,c.gcs()),e=t.worldToDisplay(e),c.renderer().baseToLocal&&(e=c.renderer().baseToLocal(e)),e},this.visible=function(e,t){if(void 0===e)return!(!t&&g&&g.visible&&!g.visible())&&y;if(y!==e||t){y=e,c.modified(),g&&g.visible&&!g.visible()&&(e=!1),e?c._bindMouseHandlers():c._unbindMouseHandlers();for(var n=0;n=0?i:0}return b}return b=r.isNonNullFinite(e)?parseInt(e,10):null,c.modified(),c},this.dataTime=function(e){return void 0===e?w:(w=e,c.modified(),c)},this.buildTime=function(e){return void 0===e?_:(_=e,c.modified(),c)},this.updateTime=function(e){return void 0===e?C:(C=e,c.modified(),c)},this.data=function(e){return void 0===e?c.style("data")||[]:(c.style("data",e),c.dataTime().modified(),c.modified(),c)},this.selectionAPI=function(e,t){return void 0===e?!(!t&&g&&g.selectionAPI&&!g.selectionAPI())&&(t||"auto"!==h?h:!!c.geoIsOn(Object.values(u.feature))):("auto"!==e&&(e=!!e),(e!==h||t)&&(h=e,c._unbindMouseHandlers(),c._bindMouseHandlers()),c)},this.mouseOverOrderHighestIndex=function(e){e.over.index.sort();var t=e.feature.data();e.over.index.forEach((function(n,r){e.over.found[r]=t[n]}))},this._init=function(e){if(!g)throw new Error("Feature requires a valid layer");m=i.extend({},{opacity:1},void 0===e.style?{}:e.style),c._bindMouseHandlers(),o=!0},this._build=function(){},this._update=function(){},this.geoOn=function(e,t){var n="auto"===c.selectionAPI(void 0,!0),r=n&&c.selectionAPI(),i=f.apply(c,arguments);return n&&!r&&c.selectionAPI()&&c._bindMouseHandlers(),i},this.geoOff=function(e,t){var n="auto"===c.selectionAPI(void 0,!0),r=n&&c.selectionAPI(),i=p.apply(c,arguments);return n&&r&&!c.selectionAPI()&&c._unbindMouseHandlers(),i},this._exit=function(){c._unbindMouseHandlers(),A=[],m={},d(),o=!1},this._init(t),this};c.eventID=0,c.create=function(e,t){"use strict";if(!(e instanceof n(9105)))return console.warn("Invalid layer"),null;if("object"!==r(t))return console.warn("Invalid spec"),null;var i=t.type,o=e.createFeature(i,t);return o?(t.data=t.data||[],o.style(t)):(console.warn('Could not create feature type "'+i+'"'),null)},o(c,a),e.exports=c},3715:function(e,t,n){var r=n(5699),i=n(9105),o=n(5108),a=n(4647),s=function e(t){"use strict";if(!(this instanceof e))return new e(t);i.call(this,t);var n=this,r=[],s=this._init,l=this._exit,u=this._update,c=this.visible,d=this.selectionAPI,f=this.draw;return this.createFeature=function(e,t){var r=a.createFeature(e,n,n.renderer(),t);return r?n.addFeature(r):console.warn("Layer renderer ("+n.rendererName()+') does not support feature type "'+e+'"'),r},this.addFeature=function(e){return n.removeFeature(e),n.addChild(e),r.push(e),n.dataTime().modified(),n.modified(),n},this.removeFeature=function(e){var t;return(t=r.indexOf(e))>=0&&(r.splice(t,1),n.removeChild(e),n.dataTime().modified(),n.modified()),n},this.deleteFeature=function(e){return e&&(r.indexOf(e)>=0&&e._exit(),n.removeFeature(e)),n},this.features=function(e){if(void 0===e)return r.slice();var t,i=r.slice();for(t=0;t=0&&n.deleteFeature(i[t]);for(t=0;tn.updateTime().timestamp())for(t=0;t1&&e=0)return n._queue.splice(o,1),n._addToQueue(e,i),e}var a=r.Deferred(),s=r.Deferred();return a.done((function(){r.when(t.call(e)).always(s.resolve)})).fail(s.resolve),e.__fetchQueue=a,n._addToQueue(e,i),r.when(a,s).always((function(){n._processing>0&&(n._processing-=1),n._initialSize=0,n.next_item()})).promise(e),n.next_item(),e},this._addToQueue=function(e,t){if(e.__fetchQueue._batch=n._batch,t)n._queue.push(e);else if(this._batch){for(var r=0;r=0&&(n._queue.splice(t,1),!0)},this.batch=function(e){return void 0===e?n._batch:(e?(n._batch=i,i+=1):n._batch=!1,n)},this.next_item=function(){if(!n._innextitem){if(n._innextitem=!0,n._queue.length>n._track&&n._needed)for(var e=n._queue.length-1;e>=0;e-=1)if(!n._needed(n._queue[e])){var t=n._queue.splice(e,1)[0];n._processing+=1,t.__fetchQueue.reject(),delete t.__fetchQueue}for(;n._processing<(n._initialSize||n._size)&&n._queue.length;){var r=n._queue.shift();if(r.__fetchQueue)n._processing+=1,!n._needed||n._needed(r)?r.__fetchQueue.resolve():r.__fetchQueue.reject(),delete r.__fetchQueue}n._innextitem=!1}},this.clear(),this}},407:function(e,t,n){var r=n(5699),i=n(3715),o=n(3737),a=function e(t){"use strict";if(!(this instanceof e))return new e(t);if(o.call(this),!((t=t||{}).layer instanceof i))throw new Error("fileReader must be given a feature layer");var n=t.layer;return this.layer=function(){return n},this.canRead=function(e){return!1},this.read=function(e,t,n){var r=new Promise((function(e,n){throw t&&t(!1),new Error("The default file reader always fails")}));return this.addPromise(r),r},this._getString=function(e,t,n){var r=function(e,t){var n=new FileReader;return t&&(n.onprogress=t),n.onloadend=function(){e(n.error||n.result)},n}(t,n);r.readAsText(e)},this};r(a,o),e.exports=a},3088:function(e,t,n){function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=3?[e[0],e[1],0]:[0,0,0]}},void 0===e.style?{}:e.style);s.style(t),s.grid(r.extend({},{minColor:"black",minOpacity:0,maxColor:"black",maxOpacity:0,colorRange:[{r:.07514311,g:.468049805,b:1},{r:.468487184,g:.588057293,b:1},{r:.656658579,g:.707001303,b:1},{r:.821573924,g:.837809045,b:1},{r:.943467973,g:.943498599,b:.943398095},{r:1,g:.788626485,b:.750707739},{r:1,g:.6289553,b:.568237474},{r:1,g:.472800903,b:.404551679},{r:.916482116,g:.236630659,b:.209939162}]},e.mesh||{},e.grid||{})),(e.mesh||e.grid)&&s.dataTime().modified()},this._init(t),this};r(o,i),e.exports=o},1111:function(e,t,n){var r=n(5638),i=n(5699),o=n(6837),a=n(6853),s=function e(t){"use strict";if(!(this instanceof e))return new e(t);t=t||{},o.call(this,t);var n,i,s,l,u,c,d,f=this,p=this._init;return this.featureType="heatmap",n=t.position||function(e){return e},i=t.intensity||function(e){return 1},s=void 0!==t.maxIntensity?t.maxIntensity:null,l=void 0!==t.minIntensity?t.minIntensity:null,c=void 0!==t.binned?t.binned:"auto",u=t.updateDelay||0===t.updateDelay?parseInt(t.updateDelay,10):-1,this.maxIntensity=function(e){return void 0===e?s:(s=e,f.dataTime().modified(),f.modified(),f)},this.minIntensity=function(e){return void 0===e?l:(l=e,f.dataTime().modified(),f.modified(),f)},this.updateDelay=function(e){return void 0===e?u:(u=parseInt(e,10),f)},this.binned=function(e){return void 0===e?c:("true"===e?e=!0:("false"===e||"auto"!==e&&!0!==e&&!1!==e&&((e=parseInt(e,10))<=0||isNaN(e)))&&(e=!1),c=e,f.dataTime().modified(),f.modified(),f)},this.position=function(e){return void 0===e?n:(n=e,f.dataTime().modified(),f.modified(),f)},this.gcsPosition=function(){return f._update(),d},this.intensity=function(e){return void 0===e?i:(i=e,f.dataTime().modified(),f.modified(),f)},this._init=function(e){p.call(f,e);var t=r.extend({},{radius:10,blurRadius:10,gaussian:!0,color:{0:{r:0,g:0,b:0,a:0},.25:{r:0,g:0,b:1,a:.5},.5:{r:0,g:1,b:1,a:.6},.75:{r:1,g:1,b:0,a:.7},1:{r:1,g:0,b:0,a:.8}},scaleWithZoom:!1},void 0===e.style?{}:e.style);f.style(t),n&&f.dataTime().modified()},this._build=function(){var e=f.data(),t=null,n=[],r=null==s,i=null==l;return e.forEach((function(e,o){n.push(f.position()(e,o)),(r||i)&&(t=f.intensity()(e,o),null==s&&(s=t),null==l&&(l=t),r&&t>s&&(s=t),i&&t=0&&this._url.indexOf("/")===this._url.indexOf(":")+1&&(this._image.crossOrigin=this._cors),e=r.Deferred(),this._image.onload=e.resolve,this._image.onerror=e.reject,this._image.src=this._url,e.done(function(){this._fetched=!0}.bind(this)).promise(this)),this},this.fadeIn=function(e){var t=this.fetch(),n=r.Deferred();return r(this._image).css("display","none"),t.done(function(){r(this._image).fadeIn(e,(function(){n.resolve()}))}.bind(this)),n.promise(this)},this};r(o,i),e.exports=o},6062:function(e,t,n){ +/** + * GeoJS + * @copyright 2013-2022, Kitware, Inc. + * @license Apache-2.0 + * @namespace geo + */ +/* + * Bundled with the following libraries: + * + * vgl + * @copyright 2014-2016, Kitware, Inc. + * @license Apache-2.0 + * + * Proj4js + * @copyright 2014, Mike Adair, Richard Greenwood, Didier Richard, Stephen Irons, Olivier Terral and Calvin Metcalf + * @license MIT + * + * gl-matrix + * @copyright 2015, Brandon Jones, Colin MacKenzie IV + * @license MIT + * + * JQuery + * @copyright jQuery Foundation and other contributors + * @license MIT + * + * earcut + * @copyright 2016, Mapbox + * @license ISC + * + * kdbush + * @copyright 2017, Vladimir Agafonkin + * @license ISC + */ +var r=n(5638),i=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi;r.htmlPrefilter=function(e){return e.replace(i,"<$1>")},n(8701),e.exports=r.extend({annotation:n(7800),annotationLayer:n(836),camera:n(9986),choroplethFeature:n(8719),contourFeature:n(9005),domRenderer:n(2805),event:n(5108),feature:n(6837),featureLayer:n(3715),fetchQueue:n(3705),fileReader:n(407),geo_action:n(7839),graphFeature:n(4745),heatmapFeature:n(1111),imageTile:n(4665),isolineFeature:n(2367),geojsonReader:n(3088),gridFeature:n(1109),layer:n(9105),lineFeature:n(4708),map:n(2804),mapInteractor:n(3870),markerFeature:n(7098),meshFeature:n(9146),object:n(3737),osmLayer:n(8622),pathFeature:n(6565),pointFeature:n(2557),polygonFeature:n(4343),quadFeature:n(5017),pixelmapFeature:n(6374),pixelmapLayer:n(809),renderer:n(3234),sceneObject:n(5358),textFeature:n(9757),tile:n(8418),tileCache:n(6244),tileLayer:n(1940),timestamp:n(6618),trackFeature:n(6223),transform:n(6853),typedef:n(3762),vectorFeature:n(2623),inherit:n(5699),version:n(2978),sha:n(5381),util:n(4634),jQuery:r,canvas:n(7562),svg:n(2878),vtkjs:n(6653),webgl:n(9205),gui:n(253)},n(4647)),window&&!window.$&&(window.$=r),window&&!window.jQuery&&(window.jQuery=r)},5699:function(e){e.exports=function(e,t){var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},2367:function(e,t,n){var r=n(5699),i=n(9146),o=n(4647),a=n(4634),s={17:[{l0:1,h0:2,l1:0,h1:2}],18:[{l0:0,h0:1,l1:2,h1:1}],20:[{l0:2,h0:0,l1:1,h1:0}],22:[{l0:2,h0:0,l1:2,h1:1}],21:[{l0:1,h0:2,l1:1,h1:0}],19:[{l0:0,h0:1,l1:0,h1:2}],1:[{l0:2,h0:3,l1:1,h1:3}],2:[{l0:0,h0:2,l1:3,h1:2}],4:[{l0:3,h0:1,l1:0,h1:1}],8:[{l0:1,h0:0,l1:2,h1:0}],14:[{l0:3,h0:1,l1:3,h1:2}],13:[{l0:2,h0:3,l1:2,h1:0}],11:[{l0:1,h0:0,l1:1,h1:3}],7:[{l0:0,h0:2,l1:0,h1:1}],3:[{l0:0,h0:2,l1:1,h1:3}],10:[{l0:1,h0:0,l1:3,h1:2}],12:[{l0:3,h0:1,l1:2,h1:0}],5:[{l0:2,h0:3,l1:0,h1:1}],6:[{l0:0,h0:2,l1:0,h1:1},{l0:3,h0:1,l1:3,h1:2}],9:[{l0:1,h0:0,l1:1,h1:3},{l0:2,h0:3,l1:2,h1:0}]},l=function e(t){"use strict";if(!(this instanceof e))return new e(t);var r=n(5638),l=n(6853),u=n(5108),c=n(9757);t=t||{},i.call(this,t);var d,f,p,h,m,g=this,v=this.draw,y=this._exit,b=this._init,x=this.modified,w=this._update;return this.featureType="isoline",this.contour=g.mesh,this.isoline=g.mesh,this._createIsolines=function(){var e,t=g.style.get("value"),n=void 0!==g.style("used")?g.style.get("used"):function(e,n){return a.isNonNullFinite(t(e,n))},r=!1,i=[],o=g._createMesh({used:n,value:t});return(e=g._getValueList(o)).length?(e.forEach((function(e){var t=g._isolinesForValue(o,e);t.length&&(i=i.concat(t),r=r||!!e.label)})),{lines:i,mesh:o,values:e,hasLabels:r}):{}},this._getValueList=function(e){var t,n,r,i,o,s,l,u=g.isoline,c=u.get("values")(e),d=u.get("spacing")(e),f=u.get("count")(e),p=u.get("autofit")(e),h=u.get("levels")(e);if(!e.numVertices||!e.numElements)return[];if(t=a.getMinMaxValues(e.value,u.get("min")(e),u.get("max")(e),!0),e.minValue=t.min,e.maxValue=t.max,(n=e.maxValue-e.minValue)<=0)return[];if(Array.isArray(c))c=(c=c.map((function(e,t){return{value:void 0!==e.value?e.value:e,position:t,level:e.level}}))).filter((function(t){return t.value>=e.minValue&&t.value<=e.maxValue}));else if(d||p)for(d||(r=n/(2*f/3),o=Math.floor(Math.log10(r)),s=Math.max(0,-o),d=(r=(r/=i=Math.pow(10,o))>=5?5:r>=2?2:1)*i),c=[],l=Math.ceil(e.minValue/d);l<=Math.floor(e.maxValue/d);l+=1)c.push({value:l*d,position:l,fixedDigits:s});else for(c=Array(f),l=0;l=0;r-=1){if(a=(o=e[r])[0],s=o[o.length-1],n[0]===a[0]&&n[1]===a[1])l=u.concat(o.slice(1));else{if(t[0]!==s[0]||t[1]!==s[1])continue;l=o.concat(u.slice(1))}e.splice(c,1),e[r]=u=l,c=r,t=u[0],n=u[u.length-1];break}if(r<0)break}return e},this._chainVertex=function(e,t,n){var r=n[0],i=n[1],o=3*r,a=3*i,s=(t.value-e.value[r])/(e.value[i]-e.value[r]),l=1-s;return{x:e.pos[o]*l+e.pos[a]*s,y:e.pos[o+1]*l+e.pos[a+1]*s,z:e.pos[o+2]*l+e.pos[a+2]*s}},this._isolinesForValue=function(e,t){var n,r,i,o,a=t.value,l=Array(e.value.length),u=[];for(n=l.length-1;n>=0;n-=1)l[n]=e.value[n]<=a?0:1;var c=e.verticesPerElement,d="square"===e.shape,f=e.elements,p=f.length;for(r=0;r1})),o},this.modified=function(){var e=x();return p&&p.modified(),m&&m.modified(),e},this.labelPositions=function(){if(g.dataTime().timestamp()>=g.buildTime().timestamp()&&g._build(),f=null,!m)return g;if(!(d&&d.hasLabels&&d.lines&&d.lines.length))return m.data([]),g;var e=g.isoline,t=e.get("labelSpacing"),n=e.get("labelOffset"),r=e.get("labelViewport")(d.mesh),i=g.gcs(),o=g.layer().map(),s=o.gcs(),u=o.rotation(),c=o.size(),p=[],h=0;return d.lines.forEach((function(e,d){if(e.label){var f,m,g,v,y,b,x,w,_,C,S,A=t(e.value,e.value.position),T=n(e.value,e.value.position)||0,P=o.gcsToDisplay(e,i),O=0;if(!(A<=0||isNaN(A))&&(h=Math.max(A,h),T=T+.5-Math.floor(T+.5),f=P.map((function(t,n){if(!e.closed&&n+1===P.length)return 0;var r=Math.sqrt(a.distance2dSquared(t,P[n+1=v;)x=b+1===P.length?0:b+1,_=1-(w=(v-y)/f[b]),v+=g,r>0&&((C={x:P[b].x*_+P[x].x*w,y:P[b].y*_+P[x].y*w}).x<-r||C.x>c.width+r||C.y<-r||C.y>c.height+r)||p.push({x:S[b].x*_+S[x].x*w,y:S[b].y*_+S[x].y*w,z:S[b].z*_+S[x].z*w,line:e,rotation:Math.atan2(P[b].y-P[x].y,P[b].x-P[x].x)-u});y+=f[b]}}})),m.gcs(s),m.data(p),m.style("renderThreshold",2*h),f={zoom:o.zoom(),center:o.center(),rotation:u,size:c,labelViewport:r,maxSpacing:h,labelAutoUpdate:e.get("labelAutoUpdate")(d.mesh)},g},this.lastLabelPositions=function(){return r.extend({},f)},this._updateLabelPositions=function(){var e=f;if(!e||!e.labelAutoUpdate)return g;var t=g.layer().map(),n=t.zoom(),r=t.size(),i=!!(Math.abs(n-e.zoom)>=2);if(!i&&e.labelViewport>0){var o=Math.sqrt(a.distance2dSquared(t.gcsToDisplay(t.center()),t.gcsToDisplay(e.center)))*Math.pow(2,e.zoom-n),s=e.labelViewport/2-2*e.maxSpacing-Math.max(r.width-e.size.width,r.height-e.size.height,0);i=i||o>=s}return i&&g.labelPositions().draw(),g},this._build=function(){if((d=g._createIsolines())&&d.lines&&d.lines.length){p||(p=g.layer().createFeature("line",{selectionAPI:!1,gcs:g.gcs(),visible:g.visible(void 0,!0),style:{closed:function(e){return e.closed}}}),g.dependentFeatures([p]));var e=g.style();if(p.data(d.lines).style({antialiasing:e.antialiasing,lineCap:e.lineCap,lineJoin:e.lineJoin,miterLimit:e.miterLimit,strokeWidth:e.strokeWidth,strokeStyle:e.strokeStyle,strokeColor:e.strokeColor,strokeOffset:e.strokeOffset,strokeOpacity:e.strokeOpacity}),d.hasLabels){if(!m){if(!(o.registries.features[g.layer().rendererName()]||{}).text){var t=o.rendererForFeatures(["text"]);h=o.createLayer("feature",g.layer().map(),{renderer:t}),g.layer().addChild(h),g.layer().node().append(h.node())}m=(h||g.layer()).createFeature("text",{selectionAPI:!1,gcs:g.gcs(),visible:g.visible(void 0,!0),style:{text:function(e){return e.line.label}}}).geoOn(u.pan,g._updateLabelPositions)}c.usedStyles.forEach((function(t){"visible"!==t&&m.style(t,e[t])})),g.dependentFeatures([p,m])}}else p&&p.data([]);return g.buildTime().modified(),g.labelPositions(),g},this._update=function(){return w.call(g),(g.dataTime().timestamp()>=g.buildTime().timestamp()||g.updateTime().timestamp()<=g.timestamp())&&g._build(),g.updateTime().modified(),g},this.draw=function(){var e=v();return p&&p.draw(),m&&m.draw(),e},this._exit=function(){m&&((h||g.layer())&&(h||g.layer()).deleteFeature(m),h&&g.layer()&&g.layer().removeChild(h)),p&&g.layer()&&g.layer().deleteFeature(p),m=null,h=null,p=null,g.dependentFeatures([]),y()},this._init=function(t){t=t||{},b.call(g,t);var n=r.extend({},{opacity:1,value:function(e,t){return g.position()(e,t).z},rotateWithMap:!0,rotation:e.rotationFunction(),strokeWidth:function(e,t,n,r){return n.level+.5},strokeColor:{r:0,g:0,b:0},textStrokeColor:{r:1,g:1,b:1,a:.75},textStrokeWidth:2,fontSize:"12px"},void 0===t.style?{}:t.style);g.style(n),g.isoline(r.extend({},{count:15,autofit:!0,levels:[5,5],label:function(e){return e.level>=1},labelSpacing:200,labelViewport:1e4,labelAutoUpdate:!0},t.mesh||{},t.contour||{},t.isoline||{})),(t.mesh||t.contour||t.isoline)&&g.dataTime().modified()},this};l.rotationFunction=function(e,t){var n={higher:function(e){return e.rotation},lower:function(e){return e.rotation+Math.PI},map:function(e){var t=e.rotation,n=a.wrapAngle(t,!0);return(n>Math.PI/2||n<-Math.PI/2)&&(t+=Math.PI),t},screen:function(e){var n=e.rotation,r=a.wrapAngle(n+t.rotation(),!0);return(r>Math.PI/2||r<-Math.PI/2)&&(n+=Math.PI),n}};return n[e]||n.higher},r(l,i),e.exports=l},9105:function(e,t,n){var r=n(5699),i=n(5358),o=n(6837),a=n(4647).checkRenderer,s=n(4647).rendererForFeatures,l=n(4647).rendererForAnnotations,u=function e(t){"use strict";if(!(this instanceof e))return new e(t);t=t||{},i.call(this,t);var r,o=n(5638),u=n(6618),c=n(3234),d=n(4647).createRenderer,f=n(4647).adjustLayerForRenderer,p=n(5108),h=this,m=this._exit,g=void 0===t.id?e.newLayerId():t.id,v=void 0===t.name?"":t.name,y=void 0===t.map?null:t.map,b=null,x=void 0===t.canvas?null:t.canvas,w=t.renderer instanceof c?t.renderer:null,_=!1,C=void 0!==t.renderer?t.renderer instanceof c?t.renderer.api():t.renderer:t.annotations?l(t.annotations):s(t.features),S=void 0===t.autoshareRenderer||t.autoshareRenderer,A=u(),T=u(),P=void 0===t.sticky||t.sticky,O=void 0===t.active||t.active,M=void 0===t.opacity?1:t.opacity,E=t.attribution||null,D=void 0===t.visible||t.visible,k=void 0===t.selectionAPI||t.selectionAPI;if(C=a(C),!y)throw new Error("Layers must be initialized on a map.");function I(){return(h.parent()||h.map()).children().filter((function(t){return t instanceof e}))}if(this.rendererName=function(){return C},this.autoshareRenderer=function(){return S},this.zIndex=function(e,t){return void 0===e?r:(t||I().reverse().forEach((function(t){t!==h&&t.zIndex()===e&&t.zIndex(e+1)})),e!==r&&(r=e,b.css("z-index",r),h.geoTrigger(p.layerMove,{layer:h})),h)},this.moveUp=function(e){var t,n,r,i,o=null;for(void 0===e&&(e=1),i=1,e<0&&(i=-1,e=-e),t=I().sort((function(e,t){return i*(e.zIndex()-t.zIndex())})),n=0;n=u.dataTime().timestamp()&&d.timestamp()>=u.timestamp())return l;d.modified(),l=[];var e=u.data(),t=u.line(),n=u.style.get("strokeWidth"),r=u.position(),i=u.style.get("closed"),o=u.gcs(),s=u.layer().map().gcs();return e.forEach((function(e,u){var c,d,f,p,h,m,g,v=i(e,u),y=[];t(e,u).forEach((function(t,i){var l=r(t,i,e,u);o!==s&&(l=a.transformCoordinates(o,s,l)),void 0===m&&(m={x:l.x,y:l.y}),void 0===g&&(g={x:l.x,y:l.y}),l.xg.x&&(g.x=l.x),l.yg.y&&(g.y=l.y);var b=Math.ceil(n(t,i,e,u)/2)+2;(void 0===g.r||b>g.r)&&(g.r=b);var x=b*b;c&&y.push({u:l,v:c,r:f>b?f:b,r2:p>x?p:x,i:i,j:d}),c=l,d=i,f=b,p=x,!h&&v&&(h={p:l,r:b,r2:x,i:i})})),v&&h&&(c.x!==h.p.x||c.y!==h.p.y)&&y.push({u:c,v:h.p,r:f>h.r?f:h.r,r2:p>h.r2?p:h.r2,i:d,j:h.i}),y.min=m,y.max=g,l.push(y)})),l},this.pointSearch=function(e,t){var n=u.data(),r=[],i=[],o={};if(!n||!n.length||!u.layer())return{found:i,index:r,extra:o};u._updatePointSearchInfo();var c=u.layer().map();t=null===t?c.gcs():void 0===t?c.ingcs():t;var d,f,p,h,m=c.unitsPerPixel(c.zoom()),g=m*m,v=a.transformCoordinates(t,c.gcs(),e),y=u.style.get("strokeWidth"),b=u.style.get("strokeOpacity"),x=u.line();for(f=0;f0||b(d[h[p].j],h[p].j,n[f],f)>0)&&(y(d[h[p].i],h[p].i,n[f],f)>0||y(d[h[p].j],h[p].j,n[f],f)>0))){i.push(n[f]),r.push(f),o[f]=p;break}return{found:i,index:r,extra:o}},this.polygonSearch=function(e,t,n){var r,i,o=u.data(),c=[],d=[],f={},p=u.layer().map(),h=u.style.get("strokeWidth"),m=u.style.get("strokeOpacity"),g=u.line();if(n=null===n?p.gcs():void 0===n?p.ingcs():n,e.outer||(e={outer:e,inner:[]}),!o||!o.length||e.outer.length<3)return{found:d,index:c,extra:f};(t=t||{}).partial=t.partial||!1,(e={outer:a.transformCoordinates(n,p.gcs(),e.outer),inner:(e.inner||[]).map((function(e){return a.transformCoordinates(n,p.gcs(),e)}))}).outer.forEach((function(e){r||(r={x:e.x,y:e.y},i={x:e.x,y:e.y}),e.xi.x&&(i.x=e.x),e.yi.y&&(i.y=e.y)})),u._updatePointSearchInfo();var v,y,b,x,w,_,C=p.unitsPerPixel(p.zoom());for(v=0;vi.x+b.max.r*C||b.max.yi.y+b.max.r*C)){var S=void 0,A=void 0,T=void 0;for(y=0;yi.x+_*C&&w.x>i.x+_*C||x.yi.y+_*C&&w.y>i.y+_*C||(T||(T=g(o[v],v)),m(T[b[y].i],b[y].i,o[v],v)<=0&&m(T[b[y].j],b[y].j,o[v],v)<=0||h(T[b[y].i],b[y].i,o[v],v)<=0&&h(T[b[y].j],b[y].j,o[v],v)<=0))){var P=s.distanceToPolygon2d(x,e),O=s.distanceToPolygon2d(w,e);if(P>-_*C&&P<_*C||O>-_*C&&O<_&C||P*O<0){A=!0;break}if(s.crossedLineSegmentPolygon2d(x,w,e)){A=!0;break}for(var M=_*_*C*C,E=0;E0&&(S=!0)}(!t.partial&&S&&!A||t.partial&&(S||A))&&(c.push(v),d.push(o[v]),f[v]={partial:A,segment:y=0&&p=3?e.slice(0,3):[0,0,0]}},void 0===e.style?{}:e.style);return void 0!==e.line&&(t.line=e.line),void 0!==e.position&&(t.position=e.position),u.style(t),u.dataTime().modified(),u},this._init(t),this};l.create=function(e,t){"use strict";return(t=t||{}).type="line",i.create(e,t)},l.capabilities={feature:"line",basic:"line.basic",multicolor:"line.multicolor"},r(l,i),e.exports=l},2804:function(e,t,n){var r=n(5638),i=n(5699),o=n(5358),a=function e(t){"use strict";if(!(this instanceof e))return new e(t);if(void 0===(t=t||{}).node||null===t.node)return console.warn("map creation requires a node"),this;o.call(this,t);var i,a,s,l,u,c=n(9986),d=n(6853),f=n(4634),p=n(4647),h=n(5108),m=n(3870),g=n(6408),v=this,y=this._exit,b=r(t.node),x=t.width||b.width()||512,w=t.height||b.height()||512,_=void 0===t.gcs?"EPSG:3857":t.gcs,C=void 0===t.ingcs?"EPSG:4326":t.ingcs,S={x:0,y:0},A=void 0===t.zoom?4:t.zoom,T=t.rotation?t.rotation:0,P=null,O=null,M={min:0,max:16,origMin:0},E=null,D=null,k=!!t.discreteZoom,I="function"==typeof t.allowRotation?t.allowRotation:void 0===t.allowRotation||!!t.allowRotation,N=t.maxBounds||{},R=t.camera||c(),F=t.animationQueue||[],B=void 0===t.autoResize||t.autoResize,L=t.autoshareRenderer,V=((N.left||0)+(N.right||0))/2,j=((N.bottom||0)+(N.top||0))/2;function U(){var e;void 0!==document.hidden?e="hidden":void 0!==document.msHidden?e="msHidden":void 0!==document.webkitHidden&&(e="webkitHidden"),v.geoTrigger(document[e]?h.hidden:h.unhidden)}function z(e){var t;void 0!==document.hidden?t="visibilitychange":void 0!==document.msHidden?t="msvisibilitychange":void 0!==document.webkitHidden&&(t="webkitvisibilitychange"),document.removeEventListener(t,U),!1!==e&&document.addEventListener(t,U)}function G(e,t){var n=e.zIndex(),r=t.zIndex();if(n!==r)return n-r;var i=e.node()[0],o=t.node()[0],a=i&&i.parentNode,s=o&&o.parentNode;if(a&&s&&a===s){var l=Array.from(a.children),u=l.indexOf(i),c=l.indexOf(o);if(u>=0&&c>=0)return u-c}return a?-1:s?1:0}function W(e,t,n,r,i){e.globalAlpha=t,i&&(e.globalCompositeOperation=i);var o=n.css("transform");o&&"matrix("===o.substr(0,7)?e.setTransform.apply(e,o.substr(7,o.length-8).split(",").map(parseFloat)):e.setTransform(1,0,0,1,0,0),e.drawImage(r,0,0),e.globalCompositeOperation="source-over"}function H(){for(var e=F.splice(0,F.length),t=1;ta?(t=1,n=o/a):(n=1,t=a/o),{x:t,y:n}}(e);return n.y>n.x?-Math.log2(Math.abs(e.right-e.left)*n.x/(x*i)):-Math.log2(Math.abs(e.top-e.bottom)*n.y/(w*i))}function X(){M.min=l?Math.max(M.origMin,K(N)):M.origMin}function Z(e,t,n){if(!I)return 0;if(t||"function"!=typeof I||(e=I(e)),!n){var r=2*Math.PI;e=e%r+(e>=0?0:r),Math.min(Math.abs(e),Math.abs(e-r))<1e-5&&(e=0)}return e}function Y(e,t,n,i){if(!a&&!s)return e;var o,l,u=N;if(t){u=r.extend({},N);var c,d,f=Math.abs(e.right-e.left),p=Math.abs(e.top-e.bottom),h=Math.abs(Math.sin(t)),m=Math.abs(Math.cos(t));if(e.width&&e.height)c=e.width,d=e.height;else if(Math.abs(h-m)<5e-4)if(x&&w){var g=Math.abs(x/w),v=Math.pow(1+Math.pow(g,2),.5);d=(c=Math.max(f,p)/v)*g}else c=f*m,d=p*h;else c=(m*f-h*p)/(m*m-h*h),d=(m*p-h*f)/(m*m-h*h);var y=f-Math.max(m*c,h*d),b=p-Math.max(m*d,h*c);u.left-=y,u.right+=y,u.top+=b,u.bottom-=b}return i&&(u={left:u.left-(e.right-e.left)/2,right:u.right+(e.right-e.left)/2,top:u.top-(e.bottom-e.top)/2,bottom:u.bottom+(e.bottom-e.top)/2}),a&&(e.right-e.left>u.right-u.left?o=u.left-(e.right-e.left-(u.right-u.left))/2-e.left:e.leftu.right&&(o=u.right-e.right),o&&(!n||n.x*o>0)&&(n&&Math.abs(o)>Math.abs(n.x*n.unit)&&(o=Math.abs(n.x*n.unit)*o/Math.abs(o)),e={left:e.left+=o,right:e.right+=o,top:e.top,bottom:e.bottom})),s&&(e.top-e.bottom>u.top-u.bottom?l=u.bottom-(e.top-e.bottom-(u.top-u.bottom))/2-e.bottom:e.top>u.top?l=u.top-e.top:e.bottom0)&&(n&&Math.abs(l)>Math.abs(n.y*n.unit)&&(l=Math.abs(n.y*n.unit)*l/Math.abs(l)),e={top:e.top+=l,bottom:e.bottom+=l,left:e.left,right:e.right})),e}function J(e,t){if(R.rotation=t||0,e.width&&e.height&&t){var n=(e.left+e.right)/2,r=(e.top+e.bottom)/2;R.viewFromCenterSizeRotation({x:n,y:r},e,t)}else R.bounds=e;S={x:(R.bounds.left+R.bounds.right)/2,y:(R.bounds.top+R.bounds.bottom)/2}}function Q(){v.size({width:b.width(),height:b.height()})}return N.left=d.transformCoordinates(N.gcs||C,_,{x:void 0!==N.left?N.left:-180,y:j}).x,N.right=d.transformCoordinates(N.gcs||C,_,{x:void 0!==N.right?N.right:180,y:j}).x,N.top=void 0!==N.top?d.transformCoordinates(N.gcs||C,_,{x:V,y:N.top}).y:N.right,N.bottom=void 0!==N.bottom?d.transformCoordinates(N.gcs||C,_,{x:V,y:N.bottom}).y:N.left,i=t.unitsPerPixel||(N.right-N.left)/256,R.viewport={width:x,height:w,left:b.offset().left,top:b.offset().top},t.center=f.normalizeCoordinates(t.center),a=void 0!==t.clampBoundsX&&t.clampBoundsX,s=void 0===t.clampBoundsY||t.clampBoundsY,l=void 0===t.clampZoom||t.clampZoom,this.unitsPerPixel=function(e,t){return e=e||0,t?(i=Math.pow(2,e)*t,v.draw(),v):Math.pow(2,-e)*i},this.animationQueue=function(e){if(void 0===e)return F;if(e!==F){if(F.length){e.length&&e[0]!==F[0]&&window.cancelAnimationFrame(F[0]);for(var t=e.length?1:0;t=0;e-=1)t[e]._exit(),v.removeChild(t[e]);v.interactor()&&(v.interactor().destroy(),v.interactor(null)),F=[],v.node().data("data-geojs-map",null),v.node().off(".geo"),v.node().empty(),r(window).off("resize",Q),y()},this.interactor=function(e){return void 0===e?O:(O&&O!==e&&O.destroy(),(O=e)&&(b.attr("tabindex")||b.attr("tabindex",0),O.map(v)),v)},this.zoomRange=function(e,t){return void 0===e?r.extend({},M):(void 0!==e.max&&(M.max=e.max),void 0!==e.min&&(M.min=M.origMin=e.min),X(),t||v.zoom(A),v)},this.transition=function(e,t,n){if(void 0===e)return E;if(E){var i=r.extend(!0,{},E.end);return i.center&&_!==C&&(i.center=d.transformCoordinates(_,C,i.center)),D=r.extend({},i||{},D||{},e),v}var o=v.unitsPerPixel(0);function a(e){return Math.pow(2,-(e+1))*o*w}var s={center:void 0,zoom:v.zoom(),rotation:v.rotation(),duration:1e3,ease:function(e){return e},interp:function(e,t){return function(n){var i=[];return r.each(e,(function(r){i.push(function(e,t,n){return e+(t-e)*n}(e[r],t[r],n))})),i}},done:null,zCoord:!0};function l(t){var n=E.done,r=D;if(!0===E.cancel)return v.geoTrigger(h.transitioncancel,e),n&&n({cancel:!0,source:E.cancelSource,transition:E}),E=null,void(D&&(r=D,D=null,v.transition(r,void 0,t)));if(E.start.time||(E.start.time=t,E.end.time=t+e.duration),E.time=t-E.start.time,t>=E.end.time||r){if(!r){if(E.end.center){var i=A!==v._fix_zoom(E.end.zoom);v.center(E.end.center,null,i,i)}v.zoom(E.end.zoom,E.zoomOrigin),v.rotation(Z(E.end.rotation))}return v.geoTrigger(h.transitionend,e),n&&n({next:!!r}),E=null,void(D&&(r=D,D=null,v.transition(r,void 0,t)))}var a=E.ease((t-E.start.time)/e.duration),s=E.interp(a);E.zCoord&&(s[2]=function(e){return-Math.log2(e/o/w)-1}(s[2])),v._fix_zoom(s[2],!0)===A?v.center({x:s[0],y:s[1]},null,!0,!0):(S=v.gcsToWorld({x:s[0],y:s[1]},null),v.zoom(s[2],E.zoomOrigin,!0)),v.rotation(s[3],void 0,!0),v.scheduleAnimationFrame(l)}return e.center&&(t=null===t?_:void 0===t?C:t,(e=r.extend(!0,{},e)).center=f.normalizeCoordinates(e.center),t!==_&&(e.center=d.transformCoordinates(t,_,e.center))),e=r.extend(!0,{},s,e),(E={start:{center:v.center(void 0,null),zoom:v.zoom(),rotation:v.rotation()},end:{center:e.center,zoom:v._fix_zoom(e.zoom),rotation:Z(e.rotation,void 0,!0)},ease:e.ease,zCoord:e.zCoord,done:e.done,duration:e.duration,zoomOrigin:e.zoomOrigin}).interp=e.interp([E.start.center.x,E.start.center.y,e.zCoord?a(E.start.zoom):E.start.zoom,E.start.rotation],[E.end.center?E.end.center.x:E.start.center.x,E.end.center?E.end.center.y:E.start.center.y,e.zCoord?a(E.end.zoom):E.end.zoom,E.end.rotation]),v.geoTrigger(h.transitionstart,e),h.cancelNavigation?(E=null,v.geoTrigger(h.transitionend,e),v):(h.cancelAnimation?(e.duration=0,l(0)):n?l(n):v.scheduleAnimationFrame(l),v)},this.transitionCancel=function(e){return!(!E||!0===E.cancel&&!D)&&(E.cancel=!0,E.cancelSource=e||E.cancelSource||"",D=null,!0)},this.bounds=function(e,t){var n;if(t=null===t?_:void 0===t?C:t,void 0!==e){if(t!==_){var r=d.transformCoordinates(t,_,[{x:e.left,y:e.top},{x:e.right,y:e.bottom}]);e={left:r[0].x,top:r[0].y,right:r[1].x,bottom:r[1].y}}e=Y(e,T),n=v.zoomAndCenterFromBounds(e,T,null),v.zoom(n.zoom),v.center(n.center,null)}return v.boundsFromZoomAndCenter(A,S,T,t,!0)},this.maxBounds=function(e,t){if(t=null===t?_:void 0===t?C:t,void 0===e)return{left:d.transformCoordinates(_,t,{x:N.left,y:0}).x,right:d.transformCoordinates(_,t,{x:N.right,y:0}).x,bottom:d.transformCoordinates(_,t,{x:0,y:N.bottom}).y,top:d.transformCoordinates(_,t,{x:0,y:N.top}).y};var n=((e.left||0)+(e.right||0))/2,r=((e.bottom||0)+(e.top||0))/2;return void 0!==e.left&&(N.left=d.transformCoordinates(t,_,{x:e.left,y:r}).x),void 0!==e.right&&(N.right=d.transformCoordinates(t,_,{x:e.right,y:r}).x),void 0!==e.bottom&&(N.bottom=d.transformCoordinates(t,_,{x:n,y:e.bottom}).y),void 0!==e.top&&(N.top=d.transformCoordinates(t,_,{x:n,y:e.top}).y),X(),v.zoom(A),v.pan({x:0,y:0}),v},this.zoomAndCenterFromBounds=function(e,t,n){var r,i;if((n=null===n?_:void 0===n?C:n)!==_){var o=d.transformCoordinates(n,_,[{x:e.left,y:e.top},{x:e.right,y:e.bottom}]);e={left:o[0].x,top:o[0].y,right:o[1].x,bottom:o[1].y}}if(e.left>=e.right||e.bottom>=e.top)throw new Error("Invalid bounds provided");return i=v._fix_zoom(K(e,t)),r={x:((e=Y(e,t)).left+e.right)/2-u.x,y:(e.top+e.bottom)/2-u.y},n!==_&&(r=d.transformCoordinates(_,n,r)),{zoom:i,center:r}},this.boundsFromZoomAndCenter=function(e,t,n,r,i,o){var a,s,l,c,f,p;if(r=null===r?_:void 0===r?C:r,e=v._fix_zoom(e,i),p=v.unitsPerPixel(e),t=v.gcsToWorld(t,null),l=(a=x*p)/2,c=(s=w*p)/2,n?(t.x+=u.x,t.y+=u.y,(f=q(t,{width:a,height:s},n)).width=a,f.height=s,f=Y(f,n,void 0,o)):f=Y(f={left:t.x-l+u.x,right:t.x+l+u.x,bottom:t.y-c+u.y,top:t.y+c+u.y},0,void 0,o),r!==_){var h=d.transformCoordinates(_,r,[[f.left,f.top],[f.right,f.bottom]]);f={left:h[0][0],top:h[0][1],right:h[1][0],bottom:h[1][1]}}return f.width=a,f.height=s,f},this.discreteZoom=function(e){return void 0===e?k:(k!==(e=!!e)&&((k=e)&&v.zoom(Math.round(v.zoom())),v.interactor()&&v.interactor().options({discreteZoom:k})),v)},this.layers=this.children,this.sortedLayers=function(){return v.children().sort(G)},this.listSceneObjects=function(e){var t=[];return(e=e||v.sortedLayers()).forEach((function(e){if(t.indexOf(e)<0&&(t.push(e),e.children)){var n=e.children();n.length&&(t=t.concat(v.listSceneObjects(n)))}})),t},this.updateAttribution=function(){v.node().find(".geo-attribution").remove();var e=r("
").addClass("geo-attribution").on("mousedown",(function(e){e.stopPropagation()}));return v.children().forEach((function(t){var n=t.attribution();n&&r("").addClass("geo-attribution-layer").html(n).appendTo(e)})),r("span",e).length&&e.appendTo(v.node()),v},this.screenshot=function(e,t,n,i){var o;if(!e||Array.isArray(e)||e.renderer||(t=t||e.type,n=n||e.encoderOptions,i=i||e,e=e.layers),(i=i||{}).wait){var a=r.extend({},i,{wait:!1});o=r.Deferred();var s=function(){window.requestAnimationFrame((function(){o.resolve()}))};return"idle"===i.wait?v.onIdle(s):s(),o.then((function(){return v.screenshot(e,t,n,a)}))}o=r.when(),e?Array.isArray(e)||(e=[e]):(e=v.layers(),null!==i.attribution&&void 0!==i.attribution||(i.attribution=!0)),e=(e=e.filter((function(e){return v.layers().indexOf(e)>=0&&e.opacity()>0&&(!e.visible||e.visible())}))).sort(G);var l=document.createElement("canvas");l.width=x,l.height=w;var u=l.getContext("2d");if(!1!==i.background&&null!==i.background){var c=i.background;void 0===i.background&&(u.fillStyle="white",u.fillRect(0,0,l.width,l.height),v.node().parents().get().reverse().forEach((function(e){(c=window.getComputedStyle(e).backgroundColor)&&"transparent"!==c&&(u.fillStyle=c,u.fillRect(0,0,l.width,l.height))})),c=window.getComputedStyle(v.node()[0]).backgroundColor),c&&"transparent"!==c&&(u.fillStyle=c,u.fillRect(0,0,l.width,l.height))}return e.forEach((function(e){var t=e.opacity();e.node().children("canvas").each((function(){var n=r(this);o=o.then((function(){e.renderer()&&"webgl"===e.renderer().api()&&e.renderer()._renderFrame(),W(u,t,n,n[0],e.node().css("mix-blend-mode"))}))})),!e.node().children().not("canvas").length&&e.node().children().length||e.renderer()&&"webgl"===e.renderer().api()||(o=o.then((function(){return f.htmlToImage(e.node(),1).done((function(t){W(u,1,r([]),t,e.node().css("mix-blend-mode"))}))})))})),i.attribution&&v.node().find(".geo-attribution").each((function(){var e=r(this);o=o.then((function(){return f.htmlToImage(e,1).done((function(e){W(u,1,r([]),e)}))}))})),i.html&&r(i.html).each((function(){var e=r(this);o=o.then((function(){return f.htmlToImage(e,1).done((function(t){W(u,1,r([]),t,e.css("mix-blend-mode"))}))}))})),o=o.then((function(){var e=l;if("canvas"!==t)try{l=l.toDataURL(t,n)}catch(e){console.warn("Failed to convert screenshot to output",e);var i=r.Deferred();return i.reject(),i}return v.geoTrigger(h.screenshot.ready,{canvas:e,screenshot:l}),l}))},this.scheduleAnimationFrame=function(e,t){F.length||F.push(window.requestAnimationFrame(H));var n=F.indexOf(e,1);if(n>=0){if(!t)return;if(F.splice(n,1),"remove"===t)return}return F.push(e),F[0]},this._fix_zoom=function(e,t){return e=Math.round(1e6*e)/1e6,e=Math.max(Math.min(M.max,e),M.min),k&&!t&&(e=Math.round(e))0?(o*=i,a*=i):(o=0,a=0),{x:o-n.x*t,y:a-n.y*t})}return r=g.extend(!0,{},{throttle:30,discreteZoom:!1,actions:[{action:y.pan,input:"left",modifiers:{shift:!1,ctrl:!1},owner:"geo.mapInteractor",name:"button pan"},{action:y.zoom,input:"right",modifiers:{shift:!1,ctrl:!1},owner:"geo.mapInteractor",name:"button zoom"},{action:y.zoom,input:"wheel",modifiers:{shift:!1,ctrl:!1},owner:"geo.mapInteractor",name:"wheel zoom"},{action:y.rotate,input:"left",modifiers:{shift:!1,ctrl:!0},owner:"geo.mapInteractor",name:"button rotate"},{action:y.rotate,input:"wheel",modifiers:{shift:!1,ctrl:!0},owner:"geo.mapInteractor",name:"wheel rotate"},{action:y.select,input:"left",modifiers:{shift:!0,ctrl:!0},selectionRectangle:v.select,owner:"geo.mapInteractor",name:"drag select"},{action:y.zoomselect,input:"left",modifiers:{shift:!0,ctrl:!1},selectionRectangle:v.zoomselect,owner:"geo.mapInteractor",name:"drag zoom"},{action:y.unzoomselect,input:"right",modifiers:{shift:!0,ctrl:!1},selectionRectangle:v.unzoomselect,owner:"geo.mapInteractor",name:"drag unzoom"},{action:y.pan,input:"pan",owner:"geo.mapInteractor",name:"touch pan"},{action:y.zoomrotate,input:"rotate",owner:"geo.mapInteractor",name:"touch zoom and rotate"}],click:{enabled:!0,buttons:{left:!0,right:!0,middle:!0},duration:0,cancelOnMove:!0},keyboard:{actions:{"zoom.in":["plus","shift+plus","shift+ctrl+plus","=","shift+=","shift+ctrl+="],"zoom.out":["-","shift+-","shift+ctrl+-","_","shift+_","shift+ctrl+_"],"zoom.0":["1"],"zoom.3":["2"],"zoom.6":["3"],"zoom.9":["4"],"zoom.12":["5"],"zoom.15":["6"],"zoom.18":["7"],"pan.left":["left","shift+left","shift+ctrl+left"],"pan.right":["right","shift+right","shift+ctrl+right"],"pan.up":["up","shift+up","shift+ctrl+up"],"pan.down":["down","shift+down","shift+ctrl+down"],"rotate.ccw":["<","shift+<","shift+ctrl+<",".","shift+.","shift+ctrl+."],"rotate.cw":[">","shift+>","shift+ctrl+>",",","shift+,","shift+ctrl+,"],"rotate.0":["0"]},meta:{0:{shift:!1,ctrl:!1},1:{shift:!0,ctrl:!0},2:{shift:!0,ctrl:!1}},focusHighlight:!0},alwaysTouch:!1,wheelScaleX:1,wheelScaleY:1,zoomScale:1,rotateWheelScale:6*Math.PI/180,zoomrotateMinimumRotation:5*Math.PI/180,zoomrotateReverseRotation:4*Math.PI/180,zoomrotateMinimumZoom:.05,zoomrotateMinimumPan:5,touchPanDelay:50,momentum:{enabled:!0,maxSpeed:2.5,minSpeed:.01,stopTime:250,drag:.01,actions:[y.pan,y.zoom]},spring:{enabled:!1,springConstant:5e-5},zoomAnimation:{enabled:!0,duration:500,ease:function(e){return(2-e)*e}}},t||{}),t&&t.actions&&(r.actions=g.extend(!0,[],t.actions)),t&&t.momentum&&t.momentum.actions&&(r.momentum.actions=g.extend(!0,[],t.momentum.actions)),t&&t.keyboard&&void 0!==t.keyboard.actions&&(r.keyboard.actions=g.extend(!0,{},t.keyboard.actions)),s={page:{x:0,y:0},map:{x:0,y:0},geo:{x:0,y:0},mapgcs:{x:0,y:0},buttons:{left:!1,right:!1,middle:!1},modifiers:{alt:!1,ctrl:!1,shift:!1,meta:!1},time:new Date,deltaTime:1,velocity:{x:0,y:0}},d={},f={},this._handleKeys=function(e,t,n){n&&!0===n.simulated&&(t=n);var i,o,a=r.keyboard.meta||{0:{}},s=C.map(),l=s.size(),u=e,c="",d={};for(i in a)a.hasOwnProperty(i)&&(void 0!==a[i].shift&&t.shiftKey!==!!a[i].shift||void 0!==a[i].ctrl&&t.ctrlKey!==!!a[i].ctrl||void 0!==a[i].alt&&t.altKey!==!!a[i].alt||void 0!==a[i].meta&&t.metaKey!==!!a[i].meta||(o=i));if(void 0!==o){switch(t.stopPropagation(),t.preventDefault(),e.indexOf(".")>=0&&(u=e.substr(0,e.indexOf(".")),c=e.substr(e.indexOf(".")+1)),u){case"zoom":switch(c){case"in":d.zoomDelta=[.05,.25,1][o];break;case"out":d.zoomDelta=-[.05,.25,1][o];break;default:isNaN(parseFloat(c))||(d.zoom=parseFloat(c))}break;case"pan":switch(c){case"down":d.panY=-Math.max(1,[0,.05,.5][o]*l.height);break;case"left":d.panX=Math.max(1,[0,.05,.5][o]*l.width);break;case"right":d.panX=-Math.max(1,[0,.05,.5][o]*l.width);break;case"up":d.panY=Math.max(1,[0,.05,.5][o]*l.height)}break;case"rotate":switch(c){case"ccw":d.rotationDelta=[1,5,90][o]*Math.PI/180;break;case"cw":d.rotationDelta=-[1,5,90][o]*Math.PI/180;break;default:isNaN(parseFloat(c))||(d.rotation=parseFloat(c))}}s.geoTrigger(v.keyaction,{move:d,action:e,factor:o,event:t}),d.cancel||(void 0!==d.zoom?s.zoom(d.zoom):d.zoomDelta&&s.zoom(s.zoom()+d.zoomDelta),void 0!==d.rotation?s.rotation(d.rotation):d.rotationDelta&&s.rotation(s.rotation()+d.rotationDelta),(d.panX||d.panY)&&s.pan({x:d.panX||0,y:d.panY||0}))}},this.hasTouchSupport=function(){return"ontouchstart"in window||window.TouchEvent||window.DocumentTouch&&document instanceof window.DocumentTouch||(navigator.msMaxTouchPoints||navigator.maxTouchPoints)>1},this._handleTouch=function(e){var t=!1;if("mouse"===e.pointerType&&c.touchSupport&&(t=!0),"hammer.input"===e.type){if("pan"!==c.lastEventType||1===e.pointers.length)return;t=!0,c.lastEventType=null}var n=/^(.*)(start|end|move|tap)$/.exec(e.type);if(n&&3===n.length||(t=!0),t)d.boundDocumentHandlers&&c.lastEvent&&C._handleMouseUpDocument(c.lastEvent);else{e.which=n[1];var i=(new Date).valueOf();"pan"===e.which&&"pan"!==c.lastEventType&&i-c.lastTime0?b(r.throttle,!1,n,t):function(e){t(e),n(e)}}(),P=function(){var e,t,n,i=0,o=400;function a(o,a){var s,l=C.map();e=g.extend(!0,{},a),i+=o,void 0===n&&(t=n=l.zoom()),n+=o,l&&Math.abs(i)>=1&&r.discreteZoom&&!r.zoomAnimation.enabled&&(s=Math.round(i+l.zoom()),i=i+l.zoom()-s,l.zoom(s,e))}function s(){var o,a=C.map();a&&(r.zoomAnimation.enabled?(o=n,r.discreteZoom&&(o=Math.round(o))===t&&n!==t&&(o=t+(n>t?1:-1)),(o=Math.round(1e6*a._fix_zoom(o))/1e6)!==a.zoom()?(a.transitionCancel("debounced_zoom."+y.zoom),a.transition({zoom:o,zoomOrigin:e,duration:r.zoomAnimation.duration,ease:r.zoomAnimation.ease,done:function(e){e=e||{};var t=new RegExp("\\."+y.zoom+"$");e.next||e.cancel&&!((""+e.source).search(t)<0)||(n=void 0),r.discreteZoom&&e.cancel&&e.transition&&e.transition.end&&(""+e.source).search(t)<0&&a.zoom(e.transition.end.zoom,e.transition.end.zoomOrigin)}})):n=void 0):(o=i+a.zoom(),r.discreteZoom&&(o=Math.round(o)),a.zoom(o,e))),i=0}!0!==r.discreteZoom&&r.discreteZoom>0&&(o=r.discreteZoom);return(!0===r.discreteZoom||r.discreteZoom>0)&&!r.zoomAnimation.enabled?x(o,!1,s,a):function(e,t){(e||void 0!==n)&&(a(e,t),s())}}(),o.adjustActions(r.actions);var e={};if(["right","pan","rotate"].forEach((function(t){e[t]=r.actions.some((function(e){return e.input[t]}))})),p.on("wheel.geojs",C._handleMouseWheel),p.on("mousemove.geojs",C._handleMouseMove),p.on("mousedown.geojs",C._handleMouseDown),p.on("mouseup.geojs",C._handleMouseUp),p.on("dragstart",(function(){return!1})),e.right&&p.on("contextmenu.geojs",(function(){return!1})),r.keyboard&&r.keyboard.actions){l=a(p[0]);var t=[];for(var i in r.keyboard.actions)r.keyboard.actions.hasOwnProperty(i)&&(l.bind(r.keyboard.actions[i],function(e){return function(t,n){C._handleKeys(e,t,n)}}(i)),t=t.concat(r.keyboard.actions[i]));u=t}if(p.toggleClass("highlight-focus",!!(u&&u.length&&r.keyboard.focusHighlight)),(C.hasTouchSupport()||r.alwaysTouch)&&(e.pan||e.rotate)){var d;try{(d=n(1272))&&d.Manager||(d=void 0)}catch(e){}if(void 0!==d){var h=[],m=["hammer.input"];e.rotate&&(h.push([d.Rotate,{enable:!0}]),m=m.concat(["rotatestart","rotateend","rotatemove"])),e.pan&&(h.push([d.Pan,{direction:d.DIRECTION_ALL}]),m=m.concat(["panstart","panend","panmove"])),h.push([d.Tap,{event:"doubletap",taps:2}]),h.push([d.Tap,{event:"singletap"},void 0,["doubletap"]]),m=m.concat(["singletap"]);var _={recognizers:h,preventDefault:!0};(c={manager:new d.Manager(p[0],_),touchSupport:C.hasTouchSupport(),lastTime:0}).manager.get("doubletap").recognizeWith("singletap"),m.forEach((function(e){c.manager.on(e,C._handleTouch)}))}}return C},this._disconnectEvents=function(){return u&&(l&&l.unbind(u),u=null,l=null),c&&(c.manager.destroy(),c=null),p&&(p.off(".geojs"),p=null),C._handleMouseWheel=function(){},P=function(){},C},this.map=function(e){return void 0!==e?(r.map=e,C._connectEvents(),C):r.map},this.options=function(e){return void 0===e?g.extend({},r):(g.extend(r,e),C._connectEvents(),C)},this._getMousePosition=function(e){if(void 0!==e.pageX&&void 0!==e.pageY){var t,n,r=p.offset();t=(n=(new Date).valueOf())-s.time,s.time=n,s.deltaTime=t,s.velocity={x:(e.pageX-s.page.x)/t,y:(e.pageY-s.page.y)/t},s.page={x:e.pageX,y:e.pageY},s.map={x:e.pageX-r.left,y:e.pageY-r.top};try{s.geo=C.map().displayToGcs(s.map),s.mapgcs=C.map().displayToGcs(s.map,null)}catch(e){s.geo=s.mapgcs=null}}},this._getMouseButton=function(e){if(void 0!==e.buttons||void 0!==e.which){for(var t in s.buttons)s.buttons.hasOwnProperty(t)&&(s.buttons[t]=!1);if(void 0!==e.buttons)s.buttons.left=!!(1&e.buttons),s.buttons.right=!!(2&e.buttons),s.buttons.middle=!!(4&e.buttons);else if("mouseup"!==e.type)switch(e.which){case 1:s.buttons.left=!0;break;case 2:s.buttons.middle=!0;break;case 3:s.buttons.right=!0}!e.which||e.which>=1&&e.which<=3||(s.buttons[e.which]=!0)}},this._getMouseModifiers=function(e){s.modifiers.alt=e.altKey,s.modifiers.ctrl=e.ctrlKey,s.modifiers.meta=e.metaKey,s.modifiers.shift=e.shiftKey},this._getSelection=function(){var e=d.origin,t=C.mouse(),n=C.map(),r={},i={},a=t.map;if(d.actionRecord&&o.isFunction(d.actionRecord.selectionConstraint)){var s=d.actionRecord.selectionConstraint(t.mapgcs,e.mapgcs);a=s?n.gcsToDisplay(s.pos,null):a}else if(t.modifiers.shift){var l=Math.pow(Math.abs((a.x-e.map.x)*(a.y-e.map.y)),.5);a={x:e.map.x+Math.sign(a.x-e.map.x)*l,y:e.map.y+Math.sign(a.y-e.map.y)*l}}return r.upperLeft={x:Math.min(e.map.x,a.x),y:Math.min(e.map.y,a.y)},r.lowerRight={x:Math.max(e.map.x,a.x),y:Math.max(e.map.y,a.y)},r.upperRight={x:r.lowerRight.x,y:r.upperLeft.y},r.lowerLeft={x:r.upperLeft.x,y:r.lowerRight.y},i.upperLeft=n.displayToGcs(r.upperLeft,null),i.lowerRight=n.displayToGcs(r.lowerRight,null),i.upperRight=n.displayToGcs(r.upperRight,null),i.lowerLeft=n.displayToGcs(r.lowerLeft,null),h.data([{ul:i.upperLeft,ur:i.upperRight,ll:i.lowerLeft,lr:i.lowerRight}]),h.draw(),{display:r,gcs:i,mouse:t,origin:g.extend({},d.origin)}},this.cancel=function(e,t){var n;return(n=e?d.action===e:!!d.action)&&(t||(f={}),M()),n},this._setClickMaybe=function(e){T=e,m&&(window.clearTimeout(m),m=null)},this._handleMouseDown=function(e){var t,n;if(!(A||c&&"tap"===c.lastEventType&&(new Date).valueOf()-c.lastTime<1e3)){C._getMousePosition(e),C._getMouseButton(e),C._getMouseModifiers(e),!r.click.enabled||s.buttons.left&&!r.click.buttons.left||s.buttons.right&&!r.click.buttons.right||s.buttons.middle&&!r.click.buttons.middle||(C._setClickMaybe({x:s.page.x,y:s.page.y,buttons:g.extend({},s.buttons)}),r.click.duration>0&&(m=window.setTimeout((function(){T=!1,m=null}),r.click.duration))),t=((n=w(s.buttons,s.modifiers,r.actions))||{}).action;var i=C.map();i.transitionCancel("_handleMouseDown"+(t?"."+t:"")),C.cancel(y.momentum),s.velocity={x:0,y:0},t&&(f={kind:"move"},d={action:t,actionRecord:n,origin:g.extend(!0,{},s),initialZoom:i.zoom(),initialRotation:i.rotation(),initialEventRotation:e.rotation,delta:{x:0,y:0}},n.selectionRectangle&&(S&&(S.clear(),i.deleteLayer(S),S=null),S=i.createLayer("feature",{features:[_.capabilities.color],autoshareRenderer:!1}),(h=S.createFeature("quad",{gcs:i.gcs()})).style({opacity:.25,color:{r:.3,g:.3,b:.3}}),i.geoTrigger(v.brushstart,C._getSelection())),i.geoTrigger(v.actiondown,{state:C.state(),mouse:C.mouse(),event:e}),r.throttle>0?g(document).on("mousemove.geojs",b(r.throttle,C._handleMouseMoveDocument)):g(document).on("mousemove.geojs",C._handleMouseMoveDocument),g(document).on("mouseup.geojs",C._handleMouseUpDocument),d.boundDocumentHandlers=!0)}},this._handleMouseMove=function(e){A||d.boundDocumentHandlers||(r.click.cancelOnMove&&T&&C._setClickMaybe(!1),C._getMousePosition(e),C._getMouseButton(e),C._getMouseModifiers(e),T||C.map().geoTrigger(v.mousemove,C.mouse()))},this._handleZoomrotate=function(e){var t=Math.log2(e.scale);if(!d.zoomrotateAllowZoom&&t&&Math.abs(t)>=Math.log2(1+r.zoomrotateMinimumZoom)&&(r.zoomrotateMinimumZoom&&(d.initialZoom-=t),d.zoomrotateAllowZoom=!0),d.zoomrotateAllowZoom&&t){var n=d.initialZoom+t;C.map().zoom(n,d.origin)}var i=(e.rotation-d.initialEventRotation)*Math.PI/180;if(!d.zoomrotateAllowRotation&&i&&Math.abs(i)>=r.zoomrotateMinimumRotation&&(r.zoomrotateMinimumRotation&&(d.initialEventRotation=e.rotation,i=0),d.zoomrotateAllowRotation=!0),d.zoomrotateAllowRotation){var a=d.initialRotation+i;(i=o.wrapAngle(a-C.map().rotation()))&&(i*(d.lastRotationDelta||0)>=0||Math.abs(i)>=r.zoomrotateReverseRotation)&&(C.map().rotation(a,d.origin),d.lastRotationDelta=i)}var s=d.origin.page;if(d.initialEventGeo){var l=p.offset();(s=C.map().gcsToDisplay(d.initialEventGeo)).x+=l.left,s.y+=l.top}var u=e.pageX-s.x,c=e.pageY-s.y,f=u*u+c*c;!d.zoomrotateAllowPan&&f&&f>=r.zoomrotateMinimumPan*r.zoomrotateMinimumPan&&(r.zoomrotateMinimumPan?(u=c=0,d.initialEventGeo=C.mouse().geo):d.initialEventGeo=d.origin.geo,d.zoomrotateAllowPan=!0),d.zoomrotateAllowPan&&(u||c)&&C.map().pan({x:u,y:c})},this._handleMouseMoveDocument=function(e){var t,n,i;if(C.map()&&!A&&"move"===f.kind){if(C._getMousePosition(e),C._getMouseButton(e),C._getMouseModifiers(e),r.click.cancelOnMove)if(void 0===T.x||void 0===T.y)C._setClickMaybe(!1);else if(!0!==r.click.cancelOnMove||s.page.x===T.x&&s.page.y===T.y){Math.sqrt(Math.pow(s.page.x-T.x,2)+Math.pow(s.page.y-T.y,2))>=r.click.cancelOnMove&&C._setClickMaybe(!1)}else C._setClickMaybe(!1);if(!T)if(d.action){if(t=s.map.x-d.origin.map.x-d.delta.x,n=s.map.y-d.origin.map.y-d.delta.y,d.delta.x+=t,d.delta.y+=n,d.action===y.pan)C.map().pan({x:t,y:n},void 0,"limited");else if(d.action===y.zoom)P(-n*r.zoomScale/120,d);else if(d.action===y.rotate){var o,a;void 0===d.origin.rotation&&(o=d.origin.map.x-C.map().size().width/2,a=d.origin.map.y-C.map().size().height/2,d.origin.rotation=C.map().rotation()-Math.atan2(a,o)),o=s.map.x-C.map().size().width/2,a=s.map.y-C.map().size().height/2,C.map().rotation(d.origin.rotation+Math.atan2(a,o))}else d.action===y.zoomrotate?C._handleZoomrotate(e):d.actionRecord.selectionRectangle&&(i=C._getSelection(),C.map().geoTrigger(v.brush,i));C.map().geoTrigger(v.actionmove,{state:C.state(),mouse:C.mouse(),event:e}),e.preventDefault()}else console.log("WARNING: Invalid state in mapInteractor.")}},this._zoomFromSelection=function(e,t,n){if((e===y.zoomselect||e===y.unzoomselect)&&t.x!==n.x&&t.y!==n.y){var r,i,o=C.map(),a=o.size(),s={x:Math.abs((n.x-t.x)/a.width),y:Math.abs((n.y-t.y)/a.height)};if(e===y.zoomselect?(i=o.displayToGcs({x:(t.x+n.x)/2,y:(t.y+n.y)/2},null),r=o.zoom()-Math.log2(Math.max(s.x,s.y))):(r=o.zoom()+Math.log2(Math.max(s.x,s.y)),i=o.center(void 0,null)),o.discreteZoom()&&(r=Math.floor(r)),o.zoom(r),e===y.zoomselect)o.center(i,null);else{var l=o.gcsToDisplay(i,null);o.pan({x:(t.x+n.x)/2-l.x,y:(t.y+n.y)/2-l.y})}}},this._handleMouseUpDocument=function(e){var t,n;if(!A&&(f={},C._setClickMaybe(!1),C._getMouseButton(e),C._getMouseModifiers(e),g(document).off(".geojs"),d.boundDocumentHandlers=!1,s.buttons.right&&e.preventDefault(),d.actionRecord&&d.actionRecord.selectionRectangle&&(C._getMousePosition(e),t=C._getSelection(),S.clear(),C.map().deleteLayer(S),S=null,h=null,C.map().geoTrigger(v.brushend,t),!0!==d.actionRecord.selectionRectangle&&C.map().geoTrigger(d.actionRecord.selectionRectangle,t),C._zoomFromSelection(d.action,t.display.lowerLeft,t.display.upperRight),C.map().geoTrigger(v.actionselection,{state:C.state(),mouse:C.mouse(),event:e,lowerLeft:t.display.lowerLeft,upperRight:t.display.upperRight})),C.map().geoTrigger(v.actionup,{state:C.state(),mouse:C.mouse(),event:e}),n=d.action,M(),r.momentum.enabled&&g.inArray(n,r.momentum.actions)>=0)){var i=(new Date).valueOf(),o=i-s.time+s.deltaTime;i-s.timer.momentum.maxSpeed&&(t=r.momentum.maxSpeed/t,e.x=e.x*t,e.y=e.y*t),isFinite(e.x)&&isFinite(e.y)||(e.x=0,e.y=0),d.momentum.velocity.x=e.x,d.momentum.velocity.y=e.y,d.origAction===y.zoom){var o=d.momentum.velocity.y*i;P(-o*r.zoomScale/120,d)}else C.map().pan({x:d.momentum.velocity.x*i,y:d.momentum.velocity.y*i},void 0,"limited");d.handler&&C.map().scheduleAnimationFrame(d.handler)}else M()},d.handler&&C.map().scheduleAnimationFrame(d.handler))},this.destroy=function(){C._disconnectEvents(),C.map()&&g(C.map().node()).removeClass("highlight-focus"),C.map(null)},this.mouse=function(){return g.extend(!0,{},s)},this.keyboard=function(e){return void 0===e?g.extend(!0,{},r.keyboard||{}):C.options({keyboard:e})},this.state=function(){return g.extend(!0,{},d)},this.pause=function(e){return void 0===e?A:(A=!!e,C)},this.addAction=function(e,t){e&&e.action&&e.input&&(o.addAction(r.actions,e,t),r.map&&r.actions.some((function(e){return e.input.right}))&&(p.off("contextmenu.geojs"),p.on("contextmenu.geojs",(function(){return!1}))))},this.hasAction=function(e,t,n){return o.hasAction(r.actions,e,t,n)},this.removeAction=function(e,t,n){var i=o.removeAction(r.actions,e,t,n);return r.map&&!r.actions.some((function(e){return e.input.right}))&&p.off("contextmenu.geojs"),i},this.simulateEvent=function(e,t){var n,r,i,o,a;if(!C.map())return C;if("keyboard"===e&&l){var s={shiftKey:t.shift||t.shiftKey||!1,ctrlKey:t.ctrl||t.ctrlKey||!1,altKey:t.alt||t.altKey||!1,metaKey:t.meta||t.metaKey||!1,toString:function(){return t.keys},stopPropagation:function(){},preventDefault:function(){},simulated:!0};l.trigger(s)}else r=t.page||{},t.map&&(i=p.offset(),r.x=t.map.x+i.left,r.y=t.map.y+i.top),"left"===t.button?(o=1,a=1):"right"===t.button?(o=3,a=2):"middle"===t.button&&(o=2,a=4),t.modifiers=t.modifiers||[],t.wheelDelta=t.wheelDelta||{},n=g.Event(e,{pageX:r.x,pageY:r.y,which:o,buttons:a,altKey:t.modifiers.indexOf("alt")>=0,ctrlKey:t.modifiers.indexOf("ctrl")>=0,metaKey:t.modifiers.indexOf("meta")>=0,shiftKey:t.modifiers.indexOf("shift")>=0,center:t.center,rotation:t.touch?t.rotation||0:t.rotation,scale:t.touch?t.scale||1:t.scale,pointers:t.pointers,pointerType:t.pointerType,originalEvent:{deltaX:t.wheelDelta.x,deltaY:t.wheelDelta.y,deltaMode:t.wheelMode,preventDefault:function(){},stopPropagation:function(){},stopImmediatePropagation:function(){}}}),t.touch&&c?C._handleTouch(n):p.trigger(n),e.indexOf(".geojs")>=0&&g(document).trigger(n)},this._connectEvents(),this};r(s,i),e.exports=s},7098:function(e,t,n){var r=n(5699),i=n(6837),o=n(2557),a=function e(t){"use strict";if(!(this instanceof e))return new e(t);t=t||{},o.call(this,t);var r=n(5638),i=n(6618),a=n(4634),s=n(8173),l=this,u=this._init,c=null,d=i(),f=0,p=0,h=0;return this.featureType="marker",this._updateRangeTree=function(){if(!(d.timestamp()>=l.dataTime().timestamp()&&d.timestamp()>=l.timestamp())){var t,n,r=l.style.get("radius"),i=l.style.get("strokeWidth"),o=l.style.get("radiusIncludesStroke"),a=l.style.get("strokeOffset"),u=l.style.get("scaleWithZoom");n=l.position(),f=0,p=0,h=0,t=l.data().map((function(t,s){var l=n(t,s),c=u(t,s),d=r(t,s),m=i(t,s),g=Math.sign(a(t,s)),v=o(t,s),y=(v=void 0===v||v)?d+m*(g+1)/2:d+m,b=v?d+m*(g-1)/2:d;switch(c=e.scaleMode[c]||(c>=1&&c<=3?c:0)){case e.scaleMode.stroke:b>f&&(f=b),m>h&&(h=m);break;case e.scaleMode.fill:case e.scaleMode.all:y>p&&(p=y);break;default:y>f&&(f=y)}return[l.x,l.y]})),c=new s(t),d.modified()}},this._approximateMaxRadius=function(e){l._updateRangeTree();var t=Math.pow(2,e);return Math.max(f+h*t,p*t)},this.pointSearch=function(t,n){var r,i,o,a,s=[],u=[],d=[],f=l.gcs(),p=l.style.get("radius"),h=l.style.get("strokeWidth"),m=l.style.get("radiusIncludesStroke"),g=l.style.get("strokeOffset"),v=l.style.get("scaleWithZoom");if(!(o=l.data())||!o.length)return{found:[],index:[]};l._updateRangeTree();var y=l.layer().map();n=null===n?y.gcs():void 0===n?y.ingcs():n;var b=y.gcsToDisplay(t,n),x=y.zoom(),w=Math.pow(2,x),_=this._approximateMaxRadius(x);return a=[y.displayToGcs({x:b.x-_,y:b.y-_},f),y.displayToGcs({x:b.x+_,y:b.y-_},f),y.displayToGcs({x:b.x-_,y:b.y+_},f),y.displayToGcs({x:b.x+_,y:b.y+_},f)],r={x:Math.min(a[0].x,a[1].x,a[2].x,a[3].x),y:Math.min(a[0].y,a[1].y,a[2].y,a[3].y)},i={x:Math.max(a[0].x,a[1].x,a[2].x,a[3].x),y:Math.max(a[0].y,a[1].y,a[2].y,a[3].y)},(s=c.range(r.x,r.y,i.x,i.y)).sort((function(e,t){return e-t})),s.forEach((function(t){var n=o[t],r=p(o[t],t),i=v(o[t],t),a=g(o[t],t),s=i?h(o[t],t):0,c=m(n,t),x=(c=void 0===c||c)?r+s*(a-1)/2:r;r=x+s;var _,C,S,A=l.position()(n,t);switch(i=e.scaleMode[i]||(i>=1&&i<=3?i:0)){case e.scaleMode.fill:r=x*w+s;break;case e.scaleMode.stroke:r=x+s*w;break;case e.scaleMode.all:r*=w}r&&(S=r*r,(_=(A=y.gcsToDisplay(A,f)).x-b.x)*_+(C=A.y-b.y)*C<=S&&(u.push(n),d.push(t)))})),{found:u,index:d}},this.polygonSearch=function(t,n,r){var i,o,s,u,d=l.gcs(),f=[],p=[],h={},m=l.layer().map(),g=l.data(),v=l.style.get("radius"),y=l.style.get("strokeWidth"),b=l.style.get("radiusIncludesStroke"),x=l.style.get("strokeOffset"),w=l.style.get("scaleWithZoom"),_=m.zoom(),C=Math.pow(2,_),S=this._approximateMaxRadius(_);return r=null===r?m.gcs():void 0===r?m.ingcs():r,t.outer||(t={outer:t,inner:[]}),t.outer.length<3||!g||!g.length?{found:[],index:[],extra:{}}:((n=n||{}).partial=n.partial||!1,(t={outer:m.gcsToDisplay(t.outer,r),inner:(t.inner||[]).map((function(e){return m.gcsToDisplay(e,r)}))}).outer.forEach((function(e){o||(o={x:e.x,y:e.y},s={x:e.x,y:e.y}),e.xs.x&&(s.x=e.x),e.ys.y&&(s.y=e.y)})),l._updateRangeTree(),u=[m.displayToGcs({x:o.x-S,y:o.y-S},d),m.displayToGcs({x:s.x+S,y:o.y-S},d),m.displayToGcs({x:s.x+S,y:s.y+S},d),m.displayToGcs({x:o.x-S,y:s.y+S},d)],o={x:Math.min(u[0].x,u[1].x,u[2].x,u[3].x),y:Math.min(u[0].y,u[1].y,u[2].y,u[3].y)},s={x:Math.max(u[0].x,u[1].x,u[2].x,u[3].x),y:Math.max(u[0].y,u[1].y,u[2].y,u[3].y)},(i=c.range(o.x,o.y,s.x,s.y)).sort((function(e,t){return e-t})),i.forEach((function(r){var i=g[r],o=l.position()(i,r),s=v(g[r],r),u=w(g[r],r),c=x(g[r],r),_=u?y(g[r],r):0,S=b(i,r),A=(S=void 0===S||S)?s+_*(c-1)/2:s;switch(s=A+_,u=e.scaleMode[u]||(u>=1&&u<=3?u:0)){case e.scaleMode.fill:s=A*C+_;break;case e.scaleMode.stroke:s=A+_*C;break;case e.scaleMode.all:s*=C}if(s){o=m.gcsToDisplay(o,d);var T=a.distanceToPolygon2d(o,t);(T>=s||T>=0&&"center"===n.partial||T>=-s&&n.partial&&"center"!==n.partial)&&(f.push(i),p.push(r),h[r]={partial:Tb.length&&(S=Math.floor(b.length/C)):Object.keys(t).length&&(C-1)*(S-1)>b.length&&(S=Math.floor(b.length/(C-1))+1),A=!(void 0!==A&&!A),!(c=null==T||null==P||!O||!M)&&A&&(T<-180||T>180||T+O*(C-1)<-180||T+O*(C-1)>180)&&O>-180&&O<180&&O*(C-1)<360.0001){for(h=[],m=[],n=0;n180;)v-=360;n&&Math.abs(v-h[h.length-1])>180&&(v>h[h.length-1]?(h.push(v-360),h.push(h[h.length-2]+360),m.push(n),m.push(n+1)):(h.push(v+360),h.push(h[h.length-2]-360),m.push(n),m.push(n+1)),g=n),h.push(v),m.push(n)}if(C+=2,Math.abs(Math.abs(E*O)-360)<.01){for(C+=1,v=T+E*O;v<-180;)v+=360;for(;v>180;)v-=360;h.push(v),m.push(0)}}if(l=C*S,void 0!==g)for(D.index=new Array(l),n=0;ng?-2:0)>=E&&(y-=E),y+=i*E,D.index[n]=y;for(i=s=0;iUSGS',name:"National Map Satellite",minLevel:0,maxLevel:16},osm:{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:'Tile data © OpenStreetMap contributors',name:"OpenStreetMap",subdomains:"abc",minLevel:0,maxLevel:19},"positron-with-labels":{url:"https://{s}.basemaps.cartocdn.com/rastertiles/light_all/{z}/{x}/{y}.png",attribution:c,name:"Carto Positron With Labels",minLevel:0,maxLevel:18},"positron-without-labels":{url:"https://{s}.basemaps.cartocdn.com/rastertiles/light_nolabels/{z}/{x}/{y}.png",attribution:c,name:"Carto Positron Without Labels",minLevel:0,maxLevel:18},"stamen-terrain":{url:"https://stamen-tiles-{s}.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png",attribution:u,name:"Stamen Terrain",subdomains:"abcd",minLevel:0,maxLevel:14},"stamen-terrain-background":{url:"https://stamen-tiles-{s}.a.ssl.fastly.net/terrain-background/{z}/{x}/{y}.png",attribution:u,name:"Stamen Terrain Background",subdomains:"abcd",minLevel:0,maxLevel:14},"stamen-toner":{url:"https://stamen-tiles-{s}.a.ssl.fastly.net/toner/{z}/{x}/{y}.png",attribution:u,name:"Stamen Toner",subdomains:"abcd",minLevel:0,maxLevel:20},"stamen-toner-lite":{url:"https://stamen-tiles-{s}.a.ssl.fastly.net/toner-lite/{z}/{x}/{y}.png",attribution:u,name:"Stamen Toner Lite",subdomains:"abcd",minLevel:0,maxLevel:20},"voyager-with-labels":{url:"https://{s}.basemaps.cartocdn.com/rastertiles/voyager_labels_under/{z}/{x}/{y}.png",attribution:c,name:"Carto Voyager With Labels",minLevel:0,maxLevel:18},"voyager-without-layers":{url:"https://{s}.basemaps.cartocdn.com/rastertiles/voyager_nolabels/{z}/{x}/{y}.png",attribution:c,name:"Carto Voyager Without Layers",minLevel:0,maxLevel:18}},i(l,o),a.registerLayer("osm",l,[s.capabilities.image]),e.exports=l},6565:function(e,t,n){var r=n(5638),i=n(5699),o=n(6837),a=function e(t){"use strict";if(!(this instanceof e))return new e(t);t=t||{},o.call(this,t);var n=this,i=this._init;return this.featureType="path",this.position=function(e){return void 0===e?n.style("position"):(e!==n.style("position")&&(n.style("position",e),n.dataTime().modified(),n.modified()),n)},this._init=function(e){i.call(n,e);var t=r.extend({},{strokeWidth:1,strokeColor:{r:1,g:1,b:1},position:function(e){return Array.isArray(e)?{x:e[0],y:e[1],z:e[2]||0}:e}},void 0===e.style?{}:e.style);return void 0!==e.position&&(t.position=e.position),n.style(t),t.position&&n.position(t.position),n.dataTime().modified(),n},this._init(t),this};i(a,o),e.exports=a},6374:function(e,t,n){var r=n(5638),i=n(5699),o=n(6837),a=n(4634),s=function e(t){"use strict";if(!(this instanceof e))return new e(t);t=t||{},o.call(this,t);var n,i=this,s=this._update,l=this._init;return this.featureType="pixelmap",this.position=function(e){return void 0===e?i.style("position"):(e!==i.style("position")&&(i.style("position",e),i.dataTime().modified(),i.modified()),i)},this.url=function(e){return void 0===e?i.style("url"):(e!==i.style("url")&&(i.m_srcImage=i.m_info=void 0,i.style("url",e),i.dataTime().modified(),i.modified()),i)},this.color=function(e){return void 0===e?i.style("color"):(e!==i.style("color")&&(i.style("color",e),i.dataTime().modified(),i.modified()),i)},this.indexModified=function(e,t){if(void 0===e){var r=n;return"clear"===t&&(n=void 0),r}return i.modified(),void 0===n&&(n=[e,e]),en[1]&&(n[1]=t||e),i},this._update=function(){return s.call(i),(i.buildTime().timestamp()<=i.dataTime().timestamp()||i.updateTime().timestamp()=0&&e.indexOf("/")===e.indexOf(":")+1&&(i.m_srcImage.crossOrigin=i.style.get("crossDomain")()||"anonymous")),i.m_srcImage.onload=function(){t&&t.apply(i,arguments),i.style.get("url")()===e&&(i.m_info=void 0,i._computePixelmap()),o.resolve()},i.m_srcImage.onerror=function(){n&&n.apply(i,arguments),o.reject()},o.promise(i),i.layer().addPromise(i),e instanceof Image||(i.m_srcImage.src=e)}}return i.buildTime().modified(),i},this._init=function(e){e=e||{},l.call(i,e);var t=r.extend({},{color:function(e,t){return{r:(255&t)/255,g:(t>>8&255)/255,b:(t>>16&255)/255,a:1}},position:function(e){return e}},void 0===e.style?{}:e.style);return void 0!==e.position&&(t.position=e.position),void 0!==e.url&&(t.url=e.url),void 0!==e.color&&(t.color=e.color),i.style(t),i.dataTime().modified(),e.quadFeature&&(i.m_srcImage=!0,i._computePixelmap()),i},this};s.create=function(e,t){"use strict";return(t=t||{}).type="pixelmap",o.create(e,t)},s.capabilities={feature:"pixelmap",lookup:"pixelmap.lookup"},i(s,o),e.exports=s},809:function(e,t,n){var r=n(5638),i=n(5699),o=n(1940),a=n(4647),s=n(5017),l=n(6374),u=function e(t){var i,a=n(4665);if(!(this instanceof e))return new e(t);(t=t||{}).data&&(i=t.data,delete t.data),t=r.extend(!0,{},this.constructor.defaults,t),o.call(this,t);var s,l=this._init,u=this;return this._getTile=function(e,t){var n=t||e;return a({index:e,size:{x:u._options.tileWidth,y:u._options.tileHeight},queue:u._queue,overlap:u._options.tileOverlap,scale:u._options.tileScale,url:u._options.url.call(u,n.x,n.y,n.level||0,u._options.subdomains),crossDomain:u._options.crossDomain})},this._init=function(){l.apply(u,arguments);var e={quadFeature:u.features()[0]};t.style&&(e.style=t.style),t.color&&(e.color=t.color),s=u.createFeature("pixelmap",e),i&&s.data(i),u.style=s.style,u.data=s.data,u.indexModified=s.indexModified;var n=u.dataTime().modified;return u.dataTime().modified=function(){return s.dataTime().modified(),n()},["modified","geoOn","geoOff","geoOnce"].forEach((function(e){var t=u[e];u[e]=function(){return s[e].apply(this,arguments),t.apply(this,arguments)}})),u},u};u.defaults=r.extend({},o.defaults,{features:[s.capabilities.image,l.capabilities.lookup],tileOffset:function(e){var t=256*Math.pow(2,e-1);return{x:t,y:t}},url:""}),i(u,o),a.registerLayer("pixelmap",u,[s.capabilities.image]),e.exports=u},2557:function(e,t,n){var r=n(5699),i=n(6837),o=function e(t){"use strict";if(!(this instanceof e))return new e(t);t=t||{},i.call(this,t);var r=n(5638),o=n(6618),a=n(9808),s=n(5108),l=n(4634),u=n(8173),c=this,d=this._init,f=null,p=o(),h=this.data,m=0,g=t.clustering,v=null,y=[],b=null,x=!1;return this.featureType="point",this.clustering=function(e){return void 0===e?g:(g&&!e?(v=null,g=!1,h(y)):e&&g!==e&&(g=e,c._clusterData()),c)},this._clusterData=function(){if(g){var e=!0===g?{radius:10}:g,t=c.position(),n=c.layer().map(),i=n.gcsToDisplay(n.center(void 0,null),null),o=n.displayToGcs(i,c.gcs()),s=n.displayToGcs({x:i.x+e.radius,y:i.y},c.gcs()),u=Math.pow(Math.pow(s.y-o.y,2)+Math.pow(s.x-o.x,2),.5),d=n.zoom(),f=u*Math.pow(2,d);e=r.extend({},e,{radius:f}),v=new a(e),y.forEach((function(e,n){var r=l.normalizeCoordinates(t(e,n));r.index=n,v.addPoint(r)})),b=null,c._handleZoom(n.zoom())}},this._handleZoom=function(e){var t=Math.floor(e);if(g&&t!==b){b=t;var n=v.points(t).map((function(e){return y[e.index]}));v.clusters(t).forEach((function(e){e.__cluster=!0,e.__data=[],e.obj.each((function(t){e.__data.push(y[t.index])})),n.push(e)})),x=!0,c.data(n)}},this.position=function(e){if(void 0===e)return c.style("position");var t=l.isFunction(e);return c.style("position",(function(n,r){return null!=n&&n.__cluster?n:t?e(n,r):e})),c.dataTime().modified(),c.modified(),c},this._updateRangeTree=function(){if(!(p.timestamp()>=c.dataTime().timestamp()&&p.timestamp()>=c.timestamp())){var e,t,n=c.style.get("radius"),r=c.style.get("stroke"),i=c.style.get("strokeWidth");t=c.position(),m=0,e=c.data().map((function(e,o){var a=t(e,o);return m=Math.max(m,n(e,o)+(r(e,o)?i(e,o):0)),[a.x,a.y]})),f=new u(e),p.modified()}},this.pointSearch=function(e,t){var n,r,i,o,a,s,l=[],u=[],d=[],p=c.gcs(),h=c.style.get("fill"),g=c.style.get("stroke"),v=c.style.get("strokeWidth"),y=c.style.get("radius");return(i=c.data())&&i.length?(c._updateRangeTree(),o=c.layer().map(),a=o.gcsToDisplay(e,t),s=[o.displayToGcs({x:a.x-m,y:a.y-m},p),o.displayToGcs({x:a.x+m,y:a.y-m},p),o.displayToGcs({x:a.x-m,y:a.y+m},p),o.displayToGcs({x:a.x+m,y:a.y+m},p)],n={x:Math.min(s[0].x,s[1].x,s[2].x,s[3].x),y:Math.min(s[0].y,s[1].y,s[2].y,s[3].y)},r={x:Math.max(s[0].x,s[1].x,s[2].x,s[3].x),y:Math.max(s[0].y,s[1].y,s[2].y,s[3].y)},(l=f.range(n.x,n.y,r.x,r.y)).sort((function(e,t){return e-t})),l.forEach((function(e){var t=i[e],n=g(i[e],e);if(n||h(i[e],e)){var r,s,l,f,m=c.position()(t,e);l=y(i[e],e),(l+=n?v(i[e],e):0)&&(f=l*l,(r=(m=o.gcsToDisplay(m,p)).x-a.x)*r+(s=m.y-a.y)*s<=f&&(u.push(t),d.push(e)))}})),{found:u,index:d}):{found:[],index:[]}},this.polygonSearch=function(e,t,n){var r,i,o,a,s=c.gcs(),u=[],d=[],p={},h=c.layer().map(),g=c.data(),v=c.style.get("fill"),y=c.style.get("stroke"),b=c.style.get("strokeWidth"),x=c.style.get("radius");return e.outer||(e={outer:e,inner:[]}),e.outer.length<3||!g||!g.length?{found:[],index:[],extra:{}}:((t=t||{}).partial=t.partial||!1,(e={outer:h.gcsToDisplay(e.outer,n),inner:(e.inner||[]).map((function(e){return h.gcsToDisplay(e,n)}))}).outer.forEach((function(e){i||(i={x:e.x,y:e.y},o={x:e.x,y:e.y}),e.xo.x&&(o.x=e.x),e.yo.y&&(o.y=e.y)})),c._updateRangeTree(),a=[h.displayToGcs({x:i.x-m,y:i.y-m},s),h.displayToGcs({x:o.x+m,y:i.y-m},s),h.displayToGcs({x:o.x+m,y:o.y+m},s),h.displayToGcs({x:i.x-m,y:o.y+m},s)],i={x:Math.min(a[0].x,a[1].x,a[2].x,a[3].x),y:Math.min(a[0].y,a[1].y,a[2].y,a[3].y)},o={x:Math.max(a[0].x,a[1].x,a[2].x,a[3].x),y:Math.max(a[0].y,a[1].y,a[2].y,a[3].y)},(r=f.range(i.x,i.y,o.x,o.y)).sort((function(e,t){return e-t})),r.forEach((function(n){var r=g[n],i=y(g[n],n);if(i||v(g[n],n)){var o=c.position()(r,n),a=x(g[n],n);if(a+=i?b(g[n],n):0){o=h.gcsToDisplay(o,s);var f=l.distanceToPolygon2d(o,e);(f>=a||f>=0&&"center"===t.partial||f>=-a&&t.partial&&"center"!==t.partial)&&(u.push(r),d.push(n),p[n]={partial:f=3?e.slice(0,3):[0,0,0]}},void 0===e.style?{}:e.style);return void 0!==e.position&&(t.position=e.position),c.style(t),t.position&&c.position(t.position),c.dataTime().modified(),c.geoOn(s.zoom,(function(e){c._handleZoom(e.zoomLevel)})),c},c};o.create=function(e,t){"use strict";return(t=t||{}).type="point",i.create(e,t)},o.capabilities={feature:"point",stroke:"point.stroke"},o.primitiveShapes={auto:"auto",sprite:"sprite",triangle:"triangle",square:"square"},r(o,i),e.exports=o},4343:function(e,t,n){var r=n(5638),i=n(5699),o=n(6837),a=n(6853),s=function e(t){"use strict";if(!(this instanceof e))return new e(t);t=t||{},o.call(this,t);var i,s=n(4634),l=this,u=this._init,c=this._exit,d=this.data,f=this.draw,p=this.modified,h=this.style,m=[];function g(e,t,n){var r=l.gcs(),i=l.layer().map().gcs();return e=e||l.data(),t=t||l.style.get("position"),n=n||l.style.get("polygon"),e.map((function(e,o){var s=n(e,o);if(s){var u,c,d,f,p,h,m,g,v,y;for(f=s.outer||(Array.isArray(s)?s:[]),u=new Array(f.length),p=0;pd.max.x&&(d.max.x=h),m>d.max.y&&(d.max.y=m)):d={min:{x:h,y:m},max:{x:h,y:m}};for(c=(s.inner||[]).map((function(n){f=n||[];var r=new Array(f.length);for(p=0;py.max.x&&(y.max.x=h),m>y.max.y&&(y.max.y=m)):y={min:{x:h,y:m},max:{x:h,y:m}};return{outer:u,inner:c,range:d,mapouter:g,mapinner:v,maprange:y}}}))}function v(e){return s.isFunction(e)?function(t){return e(t[0],t[1],t[2],t[3])}:e}return this.featureType="polygon",this._subfeatureStyles={fillColor:!0,fillOpacity:!0,lineCap:!0,lineJoin:!0,strokeColor:!0,strokeOffset:!0,strokeOpacity:!0,strokeWidth:!0},this.data=function(e){var t=d(e);return void 0!==e&&(m=g(),l._checkForStroke()),t},this.polygonCoordinates=function(){return m},this.polygon=function(e){return void 0===e?l.style("polygon"):(l.style("polygon",e),l.dataTime().modified(),l.modified(),m=g(),l)},this.position=function(e){return void 0===e?l.style("position"):(l.style("position",e),l.dataTime().modified(),l.modified(),m=g(),l)},this.pointSearch=function(e,t){var n=[],r=[],o={},u=l.data(),c=l.layer().map();t=null===t?c.gcs():void 0===t?c.ingcs():t;var d=a.transformCoordinates(t,c.gcs(),e);(m.forEach((function(e,t){s.pointInPolygon(d,e.mapouter,e.mapinner,e.maprange)&&(r.push(t),o[t]=!0,n.push(u[t]))})),i)&&i.pointSearch(e).found.forEach((function(e){e.length&&4===e[0].length&&!o[e[0][3]]&&(r.push(e[0][3]),o[e[0][3]]=!0,n.push(u[e[0][3]]))}));return{index:r,found:n}},this.polygonSearch=function(e,t,n){var r,o,u=l.data(),c=[],d=[],f={},p=e,h={},g=l.layer().map();if(n=null===n?g.gcs():void 0===n?g.ingcs():n,e.outer||(e={outer:e,inner:[]}),!u||!u.length||e.outer.length<3)return{found:d,index:c,extra:f};if((t=t||{}).partial=t.partial||!1,(e={outer:a.transformCoordinates(n,g.gcs(),e.outer),inner:(e.inner||[]).map((function(e){return a.transformCoordinates(n,g.gcs(),e)}))}).outer.forEach((function(e){r||(r={x:e.x,y:e.y},o={x:e.x,y:e.y}),e.xo.x&&(o.x=e.x),e.yo.y&&(o.y=e.y)})),m.forEach((function(n,i){if(!(!n.mapouter.length||n.maprange&&(n.maprange.max.xo.x||n.maprange.max.yo.y))){for(var a,l,p=-1;p0&&(a=!0)}a||l||!s.pointInPolygon(e.outer[0],n.mapouter,n.mapinner,n.maprange)||(l=!0),(!t.partial&&a&&!l||t.partial&&(a||l))&&(c.push(i),d.push(u[i]),f[i]={partial:l},h[i]=!0)}})),i){var v=i.polygonSearch(p,t);v.found.forEach((function(e,t){e.length&&4===e[0].length&&(h[e[0][3]]||(c.push(e[0][3]),h[e[0][3]]=!0,d.push(u[e[0][3]]),f[v.index[t]]={partial:!1}),v.extra[v.index[t]].partial&&(f[e[0][3]].partial=!0))}))}return{found:d,index:c,extra:f}},this.style=function(e,t){var n=h.apply(l,arguments);return void 0===e||"string"==typeof e&&void 0===t||l._checkForStroke(),n},this.style.get=h.get,this._getLoopData=function(e,t,n){var r,i=[];for(r=0;r=2&&(f.push(l._getLoopData(o[u],u,d)),c.inner&&c.inner.forEach((function(e){e.length>=2&&f.push(l._getLoopData(o[u],u,e))})));i.position((function(e,t,n,r){return p(e[0],e[1],e[2],e[3])})),i.data(f),i._lastData=o,i._lastPosVal=a}}}else i&&l.layer()&&(l.layer().deleteFeature(i),i=null,l.dependentFeatures([]))},this.draw=function(){var e=f();return i&&i.draw(),e},this.modified=function(){var e=p();return i&&i.modified(),e},this.rdpSimplifyData=function(e,t,n,r){var i=l.layer().map(),o=i.gcs(),u=l.gcs(),c=g(e,n,r);return void 0===t&&(t=.5*i.unitsPerPixel(i.zoom())),c=c.map((function(e){return{outer:a.transformCoordinates(u,o,e.outer),inner:e.inner.map((function(e){return a.transformCoordinates(u,o,e)}))}})),e=e.map((function(e,n){var r=c[n],i={};for(var l in e)!e.hasOwnProperty(l)||Array.isArray(e)&&l>=0&&l=3)if(i.inner=r.inner.filter((function(e){return e.length>=3})),i.outer=s.rdpLineSimplify(r.outer,t,!0,i.inner),i.outer.length>=3){var d=i.inner.slice();i.inner.map((function(e,n){d[n]=i.outer;var r=s.rdpLineSimplify(e,t,!0,d);return d[n]=r,r})).filter((function(e){return e.length>=3})),i.outer=a.transformCoordinates(o,u,i.outer),i.inner=i.inner.map((function(e){return a.transformCoordinates(o,u,e)}))}else i.outer=i.inner=[];else i.outer=[];return i})),l.style("position",(function(e){return e})),l.style("polygon",(function(e){return e})),l.data(e),l},this.mouseOverOrderClosestBorder=function(e){var t=e.feature.data(),n=e.feature.layer().map(),r=a.transformCoordinates(n.ingcs(),e.feature.gcs(),e.mouse.geo),i=e.feature.polygonCoordinates(),o={};e.over.index.forEach((function(e,t){var n,a=i[e];a.outer.forEach((function(e,t){var i=a.outer[(t+1)%a.outer.length],o=s.distance2dToLineSquared(r,e,i);(void 0===n||o=3)return e[t].vertices.slice(0,3);return[0,0,0]}},void 0===e.style?{}:e.style);void 0!==e.polygon&&(t.polygon=e.polygon),void 0!==e.position&&(t.position=e.position),l.style(t),l._checkForStroke()},this};s.create=function(e,t){"use strict";return(t=t||{}).type="polygon",o.create(e,t)},s.capabilities={feature:"polygon"},i(s,o),e.exports=s},5017:function(e,t,n){var r=n(5638),i=n(5699),o=n(6837),a=function e(t){"use strict";var i=n(6853),a=n(4634);if(!(this instanceof e))return new e(t);t=t||{},o.call(this,t);var s,l,u=this,c=this._init,d=0,f=[],p=[];return this.featureType="quad",this._objectListStart=function(e){r.each(e,(function(e,t){t.used=!1}))},this._objectListGet=function(e,t){for(var n=0;n=0;t-=1)e[t].used||e.splice(t,1)},this.pointSearch=function(e,t){var n,o,s=[],c=[],d={},f=[{},{},{},{}],p=[{},{},{},{}],h=[0,1,2,0],m=[1,2,3,1],g=u.data(),v=u.layer().map();return t=null===t?v.gcs():void 0===t?v.ingcs():t,e=i.transformCoordinates(t,v.gcs(),e),l||u._generateQuads(),r.each([l.clrQuads,l.imgQuads,l.vidQuads],(function(t,r){r.forEach((function(t,r){for(n=0;n1?(o=a.pointToTriangleBasis2d(e,p[2],p[1],p[0]))&&(o.x=1-o.x):o.y=1-o.y,o&&(d[t.idx]={basis:o,_quad:t}))}))})),{index:c,found:s,extra:d}},this.position=function(e){return void 0===e?u.style("position"):(u.style("position",a.ensureFunction(e)),u.dataTime().modified(),u.modified(),u)},this._positionToQuad=function(e,t,n,o){var a=e.call(u,n,o);if(a.ll&&a.ur||a.ul&&a.lr){var s=u.gcs(),l=u.layer().map().gcs(),c={};return r.each(["ll","lr","ul","ur"],(function(e,r){void 0!==a[r]&&(c[r]={},void 0===a[r].x?c[r]=[a[r][0],a[r][1],a[r][2]]:c[r]=[a[r].x,a[r].y,a[r].z],void 0===c[r][2]&&(c[r][2]=t.call(u,n,o)),s!==l&&!1!==s&&(c[r]=i.transformCoordinates(s,l,c[r])))})),c.ll=c.ll||[c.ul[0],c.lr[1],(c.ul[2]+c.lr[2])/2],c.lr=c.lr||[c.ur[0],c.ll[1],(c.ur[2]+c.ll[2])/2],c.ur=c.ur||[c.lr[0],c.ul[1],(c.lr[2]+c.ul[2])/2],c.ul=c.ul||[c.ll[0],c.ur[1],(c.ll[2]+c.ur[2])/2],c}},this._checkQuadUpdate=function(e,t){},this._generateQuads=function(){var e,t,n=u.position(),i=u.style.get("image"),o=u.style.get("video"),c=u.style.get("delayRenderWhenSeeking"),h=u.style.get("color"),m=u.style.get("depth"),g=u.style.get("opacity"),v=u.style.get("drawOnAsyncResourceLoaded"),y=u.style.get("previewColor"),b=u.style.get("previewImage"),x=u.data(),w=[],_=[],C=[],S=[0,0,0];return u._objectListStart(f),u._objectListStart(p),r.each(x,(function(l,x){if(x._cachedQuad)return t=x._cachedQuad.diag2,(void 0===e||x._cachedQuad.diag2&&x._cachedQuad.diag2=0&&w.splice(r.inArray(A,w),1),delete B.clrquad),A.image=T,u.dataTime().modified(),u.modified(),u._update(),u.layer().draw(),E&&E.resolve(),O)return O.apply(u,arguments)},M=T.onerror,T.onerror=function(){if(E&&E.reject(),M)return M.apply(u,arguments)},E&&u.layer().addPromise(E.promise());else if(void 0===R&&!A.image)return;_.push(A),B.imgquad=A}else if(I){if(B.videoEntry=I,void 0===(P=u._objectListGet(p,I))&&(I instanceof HTMLVideoElement?P=I:(P=document.createElement("video")).src=I,u._objectListAdd(p,I,P),r(P).off(".geojsvideo").on("seeking.geojsvideo canplay.geojsvideo pause.geojsvideo playing.geojsvideo",(function(e){u._checkQuadUpdate(A,e)}))),A.delayRenderWhenSeeking=c.call(u,x,l),void 0===A.delayRenderWhenSeeking&&(A.delayRenderWhenSeeking=!0),a.isReadyVideo(P))A.video=P;else if(R=y.call(u,x,l),A.color=a.convertColor(R),A.color&&void 0!==A.color.r&&void 0!==A.color.g&&void 0!==A.color.b?(w.push(A),B.clrquad=A):R=void 0,v.call(u,x,l))E=a.isReadyVideo(P,!0)?null:r.Deferred(),O=P.onloadeddata,P.onloadeddata=function(){if(void 0!==R&&(r.inArray(A,w)>=0&&w.splice(r.inArray(A,w),1),delete B.clrquad),A.video=P,u.dataTime().modified(),u.modified(),u._update(),u.layer().draw(),E&&E.resolve(),O)return O.apply(u,arguments)},M=P.onerror,P.onerror=function(){if(E&&E.reject(),M)return M.apply(u,arguments)},E&&u.layer().addPromise(E.promise());else if(void 0===R&&!A.video)return;C.push(A),B.vidquad=A}else{if(A.color=a.convertColor(h.call(u,x,l)),!A.color||void 0===A.color.r||void 0===A.color.g||void 0===A.color.b)return;w.push(A),B.clrquad=A}B.clrquad&&(d+=1,B.clrquad.quadId=d),B.imgquad&&(d+=1,B.imgquad.quadId=d),B.vidquad&&(d+=1,B.vidquad.quadId=d),!1!==s&&(x._cachedQuad=B)}})),u._objectListEnd(f),u._objectListEnd(p),l={clrQuads:w,imgQuads:_,vidQuads:C,origin:new Float32Array(S)}},this.cacheUpdate=function(e){return null==e?r.each(u.data(),(function(e,t){t._cachedQuad&&delete t._cachedQuad})):(isFinite(e)&&(e=u.data()[e]),e._cachedQuad&&delete e._cachedQuad),u.modified(),u},this.video=function(e){var t,n;return isFinite(e)&&(e=u.data()[e]),e._cachedQuad?t=(e._cachedQuad.vidquad||{}).video:(l||u._generateQuads(),(n=u.data().indexOf(e))>=0&&(t=u._objectListGet(p,u.style.get("video")(e,n)))),t instanceof HTMLVideoElement?t:null},this._init=function(e){e=e||{},c.call(u,e),s=!1!==e.cacheQuads;var t=r.extend({},{color:{r:1,g:1,b:1},opacity:1,depth:0,drawOnAsyncResourceLoaded:!0,previewColor:null,previewImage:null,image:function(e){return e.image},video:function(e){return e.video},position:function(e){return e}},void 0===e.style?{}:e.style);void 0!==e.position&&(t.position=a.ensureFunction(e.position)),u.style(t),u.dataTime().modified()},u};a.create=function(e,t){"use strict";return(t=t||{}).type="quad",o.create(e,t)},a.capabilities={color:"quad.color",image:"quad.image",imageCrop:"quad.imageCrop",imageFixedScale:"quad.imageFixedScale",imageFull:"quad.imageFull",canvas:"quad.canvas",video:"quad.video"},i(a,o),e.exports=a},4647:function(e,t,n){var r=n(5638),i={dom:{}},o={},a={},s={},l={},u={},c={},d={},f={},p={registerFileReader:function(e,t){c[e]=t},createFileReader:function(e,t){return c.hasOwnProperty(e)?c[e](t):null},registerRenderer:function(e,t){s[e]=t},createRenderer:function(e,t,n,r){if(s.hasOwnProperty(e)){var i=s[e]({layer:t,canvas:n,options:r});return i._init(),i}return null},checkRenderer:function(e,t){if(null===e)return e;if(s.hasOwnProperty(e)){var n=s[e];if(!n.supported||n.supported())return n.apiname||e;if(!n.fallback||t)return!1;var r=p.checkRenderer(n.fallback(),!0);return!1!==r&&console.warn(e+" renderer is unavailable, using "+r+" renderer instead"),r}return!1},rendererForFeatures:function(e){var t,n,r,i,o,a,s=["webgl","canvas","svg","vtkjs",null];for(n=0;n=0&&(o=r,r=r.substr(0,r.indexOf("."))),void 0===l[t][r]){a=!1;break}if(o&&u[t][r]&&!u[t][r][o]){a=!1;break}}if(a)return t}}return console.warn('There is no renderer available for the feature list "'+(e||[]).join(", ")+'".'),!1},registerFeature:function(e,t,n,r){e in l||(l[e]={},u[e]={});var i=l[e][t];return i&&console.warn("The "+e+"."+t+" feature is already registered"),l[e][t]=n,u[e][t]=r,i},createFeature:function(e,t,n,i){var o=n.api(),a={layer:t,renderer:n};if(o in l&&e in l[o]){void 0!==i&&r.extend(!0,a,i);var s=l[o][e](a);return void 0===t.gcs&&(t.gcs=function(){return t.map().gcs()}),s}return null},registerLayerAdjustment:function(e,t,n){e in d||(d[e]={});var r=d[e][t];return r&&console.warn("The "+e+"."+t+" layer adjustment is already registered"),d[e][t]=n,r},adjustLayerForRenderer:function(e,t){var n=t.rendererName();n&&d&&d[n]&&d[n][e]&&d[n][e].apply(t)},registerLayer:function(e,t,n){o[e]=t,a[e]=n},createLayer:function(e,t,n){var i={map:t},s=null;if(e in o){if(n.renderer||n.features||!a||(i.features=a[e]),void 0!==n){var l=n.data;delete n.data,r.extend(!0,i,n),l&&(i.data=l)}return(s=o[e](i)).layerName=e,s._init(),s}return null},registerWidget:function(e,t,n){e in i||(i[e]={});var r=i[e][t];return r&&console.warn("The "+e+"."+t+" widget is already registered"),i[e][t]=n,r},createWidget:function(e,t,n){var o={layer:t};if(e in i.dom)return void 0!==n&&r.extend(!0,o,n),i.dom[e](o);throw new Error("Cannot create unknown widget "+e)},registerAnnotation:function(e,t,n){var r=f[e];return r&&console.warn("The "+e+" annotation is already registered"),f[e]={func:t,features:n||{}},r},createAnnotation:function(e,t){if(f[e])return f[e].func(t);console.warn("The "+e+" annotation is not registered")},listAnnotations:function(){return Object.keys(f)},featuresForAnnotations:function(e){var t=[];return(Array.isArray(e)?e:Object.keys(e)).forEach((function(n){f[n]&&Object.keys(f[n].features).forEach((function(i){Array.isArray(e)||!0===e[n]||!Array.isArray(f[n].features[i])?t.push(i):e[n].forEach((function(e){r.inArray(e,f[n].features[i])>=0&&t.push(i)}))}))})),t},rendererForAnnotations:function(e){return p.rendererForFeatures(p.featuresForAnnotations(e))}};p.registries={annotations:f,features:l,featureCapabilities:u,fileReaders:c,layers:o,renderers:s,widgets:i},e.exports=p},3234:function(e,t,n){var r=n(5699),i=n(3737),o=function e(t){"use strict";if(!(this instanceof e))return new e(t);i.call(this);var n=this,r=0,o=0,a=void 0===(t=t||{}).layer?null:t.layer,s=void 0===t.canvas?null:t.canvas,l=!1;return this.layer=function(){return a},this.canvas=function(e){return void 0===e?s:(s=e,n.modified(),n)},this.map=function(){return a?a.map():null},this.initialized=function(e){return void 0===e?l:(l=e,n)},this.api=function(){throw new Error("Should be implemented by derived classes")},this.width=function(){return r},this.height=function(){return o},this._setWidthHeight=function(e,t){return r=e,o=t,n},this._init=function(){return n},this._resize=function(e,t,r,i){return n._setWidthHeight(r,i),n},this._render=function(){return n},this};r(o,i),e.exports=o},5358:function(e,t,n){var r=n(5699),i=n(3737),o=function e(t){"use strict";if(!(this instanceof e))return new e;i.call(this,t);var n=this,r=null,o=[],a=this._exit,s=this.geoTrigger,l=this.addPromise,u=this.removePromise;return this.addPromise=function(e){return r&&r.addPromise(e),l(e),n},this.removePromise=function(e){return r&&r.removePromise(e),u(e),n},this.parent=function(e){return void 0===e?r:(r=e,n)},this.addChild=function(e){return Array.isArray(e)?(e.forEach(n.addChild),n):(e.parent(n),o.push(e),n)},this.removeChild=function(e){return Array.isArray(e)?(e.forEach(n.removeChild),n):(o=o.filter((function(t){return t!==e})),n)},this.children=function(){return o.slice()},this.draw=function(e){return n.children().forEach((function(t){t.draw(e)})),n},this.geoTrigger=function(e,t,i){var a;return a=(t=t||{}).geo||{},t.geo=a,a.stopPropagation?n:!i&&r&&a._triggeredBy!==r?(a._triggeredBy=n,r.geoTrigger(e,t),n):(s.call(n,e,t),a.stopPropagation||o.forEach((function(r){r.geoTrigger&&(a._triggeredBy=n,r.geoTrigger(e,t))})),n)},this._exit=function(){o=[],r=null,a()},this};r(o,i),e.exports=o},5381:function(e){e.exports="06c78d577d1a9dd6332ee47b20fe441d239225ca"},9851:function(e,t,n){var r=n(5699),i=n(4647).registerFeature,o=n(4745),a=function e(t){"use strict";var n=this;return this instanceof e?(o.call(this,t),this.select=function(){var e=n.renderer(),t={},r=n.nodeFeature(),i=n.linkFeatures();return t.nodes=e.select(r._svgid()),t.links=i.map((function(t){return e.select(t._svgid())})),t},this):new e(t)};r(a,o),i("svg","graph",a),e.exports=a},2878:function(e,t,n){n(5108).svg={rescale:n(8210)},e.exports={graphFeature:n(9851),lineFeature:n(7134),object:n(2738),pathFeature:n(5903),pointFeature:n(3365),quadFeature:n(2203),renderer:n(2531),tileLayer:n(21),trackFeature:n(1489),uniqueID:n(1946),vectorFeature:n(3398)}},7134:function(e,t,n){var r=n(5699),i=n(4647).registerFeature,o=n(4708),a=function e(t){"use strict";if(!(this instanceof e))return new e(t);var r=n(2531).d3,i=n(2738),a=n(6618),s=n(4634);t=t||{},o.call(this,t),i.call(this);var l=this,u=this._init,c=a(),d=0,f=this._update;return this._init=function(e){return u.call(l,e),l},this._build=function(){var e,t,n=l.data()||[],i=l.style(),o=l.renderer(),a=l.position();for(f.call(l),i.fill=function(){return!1},n.forEach((function(t,n){var u,c,d=l.line()(t,n),f={};function p(e){return s.isFunction(e)?function(){return e(d[0],0,t,n)}:e}for(c in i)i.hasOwnProperty(c)&&(f[c]=p(i[c]));e=r.svg.line().x((function(e){return l.featureGcsToDisplay(e).x})).y((function(e){return l.featureGcsToDisplay(e).y})).interpolate(l.style.get("closed")(t,n)&&d.length>2?"linear-closed":"linear"),u={data:[d.map((function(e,r){return a(e,r,t,n)}))],append:"path",attributes:{d:e},id:l._svgid()+n,classes:["svgLineFeature","svgSubLine-"+n],visible:l.visible,style:f},o._drawFeatures(u)})),t=n.length;t=c.timestamp()&&l._build(),l},this._init(t),this};r(a,o);var s={};s[o.capabilities.basic]=!0,s[o.capabilities.multicolor]=!1,i("svg","line",a,s),e.exports=a},2738:function(e,t,n){e.exports=function e(t){"use strict";var r=n(3737),i=n(1946);if(!(this instanceof r))return new e(t);var o="svg-"+i(),a=this._exit,s=this,l=this.draw;return this._svgid=function(){return o},this.select=function(){return s.renderer().select(s._svgid())},this.draw=function(){return s.ready&&(s._update(),l()),s},this._exit=function(){s.renderer()._removeFeature(s._svgid()),a()},this}},5903:function(e,t,n){var r=n(5699),i=n(4647).registerFeature,o=n(6565),a=function e(t){"use strict";if(!(this instanceof e))return new e(t);var r=n(5638),i=n(2531).d3,a=n(2738),s=n(6618);t=t||{},o.call(this,t),a.call(this);var l=this,u=s(),c=this._update,d={style:{}};return this._build=function(){var e,t,n=l.data()||[],o=l.style.get(),a=l.style.get("position");return c.call(l),t=function(e){var t={source:e.source,target:e.target};return i.svg.diagonal()(t)},e=[],n.forEach((function(t,r){var i,o;r=u.timestamp()&&l._build(),l},this._init(t),this};r(a,o),i("svg","path",a),e.exports=a},3365:function(e,t,n){var r=n(5699),i=n(4647).registerFeature,o=n(2557),a=function e(t){"use strict";if(!(this instanceof e))return new e(t);var r=n(2738),i=n(6618);t=t||{},o.call(this,t),r.call(this);var a=this,s=this._init,l=this._update,u=i(),c={};return this._init=function(e){return s.call(a,e),a},this._build=function(){var e=a.data(),t=a.style.get(),n=a.renderer(),r=a.position();return l.call(a),e||(e=[]),c.id=a._svgid(),c.data=e,c.append="circle",c.attributes={r:n._convertScale(t.radius),cx:function(e){return a.featureGcsToDisplay(r(e)).x},cy:function(e){return a.featureGcsToDisplay(r(e)).y}},c.style=t,c.classes=["svgPointFeature"],c.visible=a.visible,a.renderer()._drawFeatures(c),u.modified(),a.updateTime().modified(),a},this._update=function(){return l.call(a),a.timestamp()>=u.timestamp()&&a._build(),a},this._init(t),this};r(a,o);var s={};s[o.capabilities.stroke]=!0,i("svg","point",a,s),e.exports=a},2203:function(e,t,n){var r=n(5699),i=n(4647).registerFeature,o=n(5017),a=function e(t){"use strict";if(!(this instanceof e))return new e(t);var r=n(5638),i=n(2531).d3,a=n(2738);o.call(this,t),a.call(this);var s,l=this,u=this._exit,c=this._init,d=this._update;return this._build=function(){if(this.position()){var e=l.renderer(),t=e.layer().map();s=l._generateQuads();var n=[];r.each(s.clrQuads,(function(e,t){n.push({type:"clr",quad:t,zIndex:t.pos[2]})})),r.each(s.imgQuads,(function(e,t){t.image&&n.push({type:"img",quad:t,zIndex:t.pos[2]})}));var o={id:l._svgid(),data:n,dataIndex:function(e){return e.quad.quadId},append:function(e){var t=this.namespaceURI,n="clr"===e.type?"polygon":"image";return t?document.createElementNS(t,n):document.createElement(n)},attributes:{fill:function(e){if("clr"===e.type)return i.rgb(255*e.quad.color.r,255*e.quad.color.g,255*e.quad.color.b);1!==e.quad.opacity&&i.select(this).style("opacity",e.quad.opacity)},height:function(e){return"clr"===e.type?void 0:1},points:function(n){if("clr"===n.type&&!n.points){var r,i=[];for(r=0;rl&&(l=r,i=o);n.svgTransform=[3===i||2===i?s[1].x-s[0].x:s[3].x-s[2].x,3===i||2===i?s[1].y-s[0].y:s[3].y-s[2].y,0===i||2===i?s[1].x-s[3].x:s[0].x-s[2].x,0===i||2===i?s[1].y-s[3].y:s[0].y-s[2].y,2===i?s[3].x+s[0].x-s[1].x:s[2].x,2===i?s[3].y+s[0].y-s[1].y:s[2].y],Math.abs(n.svgTransform[1]/u)<1e-6&&Math.abs(n.svgTransform[2]/c)<1e-6&&(a=n.svgTransform[0]/u,n.svgTransform[4]=Math.round(n.svgTransform[4]/a)*a,a=n.svgTransform[3]/c,n.svgTransform[5]=Math.round(n.svgTransform[5]/a)*a)}return"img"===n.type&&n.quad.image?"matrix("+n.svgTransform.join(" ")+")":void 0},width:function(e){return"clr"===e.type?void 0:1},x:function(e){return"clr"===e.type?void 0:0},"xlink:href":function(e){return"clr"!==e.type&&e.quad.image?e.quad.image.src:void 0},y:function(e){return"clr"===e.type?void 0:0}},style:{fillOpacity:function(e){return"clr"===e.type?e.quad.opacity:void 0}},onlyRenderNew:!this.style("previewColor")&&!this.style("previewImage"),sortByZ:!0,visible:l.visible,classes:["svgQuadFeature"]};e._drawFeatures(o),l.buildTime().modified()}},this._update=function(){return d.call(l),(l.buildTime().timestamp()<=l.dataTime().timestamp()||l.buildTime().timestamp()=d.timestamp()?l._build():h(f.data,f.style.strokeColor,f.style.strokeOpacity,f.style.originStyle,f.style.endStyle),l},this._exit=function(){u.call(l),f={},h([],null,null,null,null)},this._init(t),this};s.markerConfigs=a,r(s,o),i("svg","vector",s),e.exports=s},9757:function(e,t,n){var r=n(5699),i=n(6837),o=function e(t){"use strict";if(!(this instanceof e))return new e(t);t=t||{},i.call(this,t);var r=n(5638),o=this,a=this._init;return this.featureType="text",this.position=function(e){return void 0===e?o.style("position"):(e!==o.style("position")&&(o.style("position",e),o.dataTime().modified(),o.modified()),o)},this.text=function(e){return void 0===e?o.style("text"):(e!==o.style("text")&&(o.style("text",e),o.dataTime().modified(),o.modified()),o)},this._init=function(e){e=e||{},a.call(o,e);var t=r.extend({},{font:"bold 16px sans-serif",textAlign:"center",textBaseline:"middle",color:{r:0,g:0,b:0},rotation:0,rotateWithMap:!1,textScaled:!1,position:function(e){return Array.isArray(e)?{x:e[0],y:e[1],z:e[2]||0}:e},text:function(e){return e.text}},void 0===e.style?{}:e.style);void 0!==e.position&&(t.position=e.position),void 0!==e.text&&(t.text=e.text),o.style(t),t.position&&o.position(t.position),t.text&&o.text(t.text),o.dataTime().modified()},this._init(t),o};o.usedStyles=["visible","font","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","lineHeight","fontFamily","textAlign","textBaseline","color","textOpacity","rotation","rotateWithMap","textScaled","offset","shadowColor","shadowOffset","shadowBlur","shadowRotate","textStrokeColor","textStrokeWidth"],o.create=function(e,t){"use strict";return(t=t||{}).type="text",i.create(e,t)},o.capabilities={feature:"text"},r(o,i),e.exports=o},8418:function(e,t,n){var r=n(5638);e.exports=function e(t){if(!(this instanceof e))return new e(t);this._index=t.index,this._size=t.size,this._overlap=t.overlap||{x:0,y:0},this._wrap=t.wrap||{x:1,y:1},this._url=t.url,this._fetched=!1,this._queue=t.queue||null,Object.defineProperty(this,"index",{get:function(){return this._index}}),Object.defineProperty(this,"size",{get:function(){return this._size}}),Object.defineProperty(this,"overlap",{get:function(){return this._overlap}}),this.fetch=function(){return this._fetched||r.get(this._url).done(function(){this._fetched=!0}.bind(this)).promise(this),this},this.fetched=function(){return this._fetched},this.then=function(e,t){return this.fetched()||!this._queue||!this._queue.add||this.state&&"pending"!==this.state()?this.fetch():this._queue.add(this,this.fetch),this.done&&this.fail?this.done(e).fail(t):this.then(e,t),this},this.catch=function(e){return this.then(void 0,e),this},this.toString=function(){return[this._index.level||0,this._index.y,this._index.x,this._index.reference||0].join("_")},this.bounds=function(e,t){var n,r,i,o;return r=(n=this.size.x*(this.index.x-e.x)-this.overlap.x-t.x)+this.size.x+2*this.overlap.x,i=(o=this.size.y*(this.index.y-e.y)-this.overlap.y-t.y)+this.size.y+2*this.overlap.y,this.overlap.x&&this.index.x===e.x&&(n+=this.overlap.x),this.overlap.y&&this.index.y===e.y&&(o+=this.overlap.y),{left:n,right:r,bottom:i,top:o}},Object.defineProperty(this,"bottom",{get:function(){return this.size.y*(this.index.y+1)+this.overlap.y}}),Object.defineProperty(this,"top",{get:function(){return this.size.y*this.index.y-(this.index.y?this.overlap.y:0)}}),Object.defineProperty(this,"left",{get:function(){return this.size.x*this.index.x-(this.index.x?this.overlap.x:0)}}),Object.defineProperty(this,"right",{get:function(){return this.size.x*(this.index.x+1)+this.overlap.x}}),this.fadeIn=function(e){return r.noop(e),this}}},6244:function(e){e.exports=function e(t){return this instanceof e?(t=t||{},this._size=t.size||64,Object.defineProperty(this,"size",{get:function(){return this._size},set:function(e){for(;this._atime.length>e;)this.remove(this._atime[this._atime.length-1]);this._size=e}}),Object.defineProperty(this,"length",{get:function(){return this._atime.length}}),this._access=function(e){return this._atime.indexOf(e)},this.remove=function(e){var t="string"==typeof e?e:e.toString();return t in this._cache&&(this._atime.splice(this._access(t),1),delete this._cache[t],!0)},this.clear=function(){return this._cache={},this._atime=[],this},this.get=function(e,t){return(e="string"==typeof e?e:e.toString())in this._cache?(t||(this._atime.splice(this._access(e),1),this._atime.unshift(e)),this._cache[e]):null},this.add=function(e,t,n){this.remove(e);var r=e.toString();this._cache[r]=e,this._atime.unshift(r),n||this.purge(t)},this.purge=function(e){for(var t;this._atime.length>this.size;){t=this._atime.pop();var n=this._cache[t];e&&e(n),delete this._cache[t]}},this.clear(),this):new e(t)}},1940:function(e,t,n){var r=n(5699),i=n(3715);function o(e,t){return(e%t+t)%t}function a(e){var t,n=/\$?\{(s|S|[sS]:[^{}]+|[^-{}]-[^-{}]|([^,{}]+,)+[^,{}]+)\}/,r=e.replace(new RegExp(n,"g"),"{s}").replace(/\$?\{[xX]\}/g,"{x}").replace(/\$?\{[yY]\}/g,"{y}").replace(/\$?\{[zZ]\}/g,"{z}"),i=e.match(n);if(i)if(i[2])t=i[1].split(",");else if(":"===i[1][1])t=i[1].substr(2).split("");else if("-"===i[1][1]){t=[];for(var a=i[1].charCodeAt(0),s=i[1].charCodeAt(2),l=Math.min(a,s);l<=Math.max(a,s);l+=1)t.push(String.fromCharCode(l))}return function(e,n,i,a){return r.replace(/\{s\}/g,function(e,t,n,r){return r[o(e+t+n,r.length)]}(e,n,i,t||a)).replace(/\{x\}/g,e).replace(/\{y\}/g,n).replace(/\{z\}/g,i)}}var s=function e(t){"use strict";if(!(this instanceof e))return new e(t);i.call(this,t);var r=n(5638),s=n(5108),l=n(6853),u=n(6244),c=n(3705),d=n(4647).adjustLayerForRenderer,f=n(8418);if((t=r.extend(!0,{},this.constructor.defaults,t||{})).cacheSize||(t.cacheSize=t.keepLower?600:200),"string"===r.type(t.subdomains)&&(t.subdomains=t.subdomains.split("")),t.baseUrl){var p=t.baseUrl;p&&"/"!==p.charAt(p.length-1)&&(p+="/"),t.url=p+"{z}/{x}/{y}."+(t.imageFormat||"png")}t.originalUrl=t.url,"string"===r.type(t.url)&&(t.url=a(t.url));var h,m,g,v=this._init,y=this._exit,b=this.visible,x=t.queueSize||6,w=t.initialQueueSize||0,_=[],C={},S=[],A=this;this._options=r.extend(!0,{},t),this.attribution(t.attribution),this._activeTiles={},this._tileTree={},this._cache=u({size:t.cacheSize}),this._queue=t.queue||c({size:x,initialSize:w,track:t.cacheSize,needed:function(e){return this._tileLayers&&this._tileLayers.length?this._tileLayers.some((function(t){return e===t.cache.get(e.toString(),!0)})):e===A.cache.get(e.toString(),!0)}}),this._queue._tileLayers=this._queue._tileLayers||[],this._queue._tileLayers.push(A);var T={};return Object.defineProperty(this,"options",{get:function(){return r.extend({},A._options)}}),Object.defineProperty(this,"cache",{get:function(){return A._cache}}),Object.defineProperty(this,"activeTiles",{get:function(){return r.extend({},A._activeTiles)}}),Object.defineProperty(this,"queue",{get:function(){return A._queue},set:function(e){A._queue!==e&&(this._queue&&this._queue._tileLayers&&this._queue._tileLayers.indexOf(A)>=0&&this._queue._tileLayers.splice(this._queue._tileLayers.indexOf(A),1),A._queue=e,A._queue._tileLayers=A._queue._tileLayers||[],A._queue._tileLayers.push(A))}}),Object.defineProperty(this,"queueSize",{get:function(){return x},set:function(e){x=e,A._queue.size=e}}),Object.defineProperty(this,"initialQueueSize",{get:function(){return w},set:function(e){w=e||0,A._queue.initialSize=e||x}}),Object.defineProperty(this,"reference",{get:function(){return A.id()+"_"+(h||0)},set:function(e){h=e},configurable:!0}),this.tilesAtZoom=function(e){if(A._options.tilesAtZoom)return A._options.tilesAtZoom.call(A,e);var t=Math.pow(2,e);return{x:t,y:t}},this.tilesMaxBounds=function(e){return A._options.tilesMaxBounds?A._options.tilesMaxBounds.call(A,e):null},this.tileCropFromBounds=function(e){if(A._options.tilesMaxBounds){var t=e.index.level,n=A._tileBounds(e);return void 0===S[t]&&(S[t]=A.tilesMaxBounds(t)||null),S[t]&&(n.right>S[t].x||n.bottom>S[t].y)?{x:Math.max(0,Math.min(S[t].x,n.right)-n.left),y:Math.max(0,Math.min(S[t].y,n.bottom)-n.top)}:void 0}},this.isValid=function(e){return A._options.minLevel<=e.level&&e.level<=A._options.maxLevel&&(!!(A._options.wrapX||0<=e.x&&e.x<=A.tilesAtZoom(e.level).x-1)&&!!(A._options.wrapY||0<=e.y&&e.y<=A.tilesAtZoom(e.level).y-1))},this._origin=function(e){var t,n=A.toLevel(A.toLocal(A.map().origin()),e),r=A._options;return{index:t={x:Math.floor(n.x/r.tileWidth),y:Math.floor(n.y/r.tileHeight)},offset:{x:n.x-r.tileWidth*t.x,y:n.y-r.tileHeight*t.y}}},this._tileBounds=function(e){var t=A._origin(e.index.level);return e.bounds(t.index,t.offset)},this.tileAtPoint=function(e,t){var n=A._origin(t),r=A.map();e=A.displayToLevel(r.gcsToDisplay(e,null),t),isNaN(e.x)&&(e.x=0),isNaN(e.y)&&(e.y=0);var i=A._tileOffset(t);return i&&(e.x+=i.x,e.y+=i.y),{x:Math.floor(n.index.x+(n.offset.x+e.x)/A._options.tileWidth),y:Math.floor(n.index.y+(n.offset.y+e.y)/A._options.tileHeight)}},this.gcsTileBounds=function(e,t){var n=e.index?e:f({index:e,size:{x:A._options.tileWidth,y:A._options.tileHeight},url:""}),r=A._tileOffset(n.index.level),i=n.bounds({x:0,y:0},r),o=A.map(),a=o.unitsPerPixel(n.index.level),s=[{x:i.left*a,y:A._topDown()*i.top*a},{x:i.right*a,y:A._topDown()*i.bottom*a}];return(t=null===t?o.gcs():void 0===t?o.ingcs():t)!==o.gcs()&&(s=l.transformCoordinates(o.gcs(),t,s)),{left:s[0].x,top:s[0].y,right:s[1].x,bottom:s[1].y}},this._getTile=function(e,t){var n=t||e;return f({index:e,size:{x:A._options.tileWidth,y:A._options.tileHeight},queue:A._queue,url:A._options.url.call(A,n.x,n.y,n.level||0,A._options.subdomains)})},this._getTileCached=function(e,t,n){var r=A.cache.get(A._tileHash(e));return null===r&&(r=A._getTile(e,t),A.cache.add(r,A.remove,n)),r},this._tileHash=function(e){return[e.level||0,e.y,e.x,e.reference||0].join("_")},this._getTileRange=function(e,t){var n=[A.tileAtPoint({x:t.left,y:t.top},e),A.tileAtPoint({x:t.right,y:t.top},e),A.tileAtPoint({x:t.left,y:t.bottom},e),A.tileAtPoint({x:t.right,y:t.bottom},e)];return{start:{x:Math.min(n[0].x,n[1].x,n[2].x,n[3].x),y:Math.min(n[0].y,n[1].y,n[2].y,n[3].y)},end:{x:Math.max(n[0].x,n[1].x,n[2].x,n[3].x),y:Math.max(n[0].y,n[1].y,n[2].y,n[3].y)}}},this._getTiles=function(e,t,n,i){var a,s,l,u,c,d,f,p,h,m,g,v=[],y=!1,b=A._options.keepLower?A._options.minLevel:Math.min(Math.max(e,A._options.minLevel),A._options.maxLevel);for(eA.map().size().width*A.map().size().height/A._options.tileWidth/A._options.tileHeight*16));g+=1)for(a=c.x;a<=d.x;a+=1)for(s=c.y;s<=d.y;s+=1)l={level:g,x:a,y:s,reference:A.reference},p={level:g,x:a,y:s,reference:A.reference},A._options.wrapX&&(p.x=o(p.x,u.x)),A._options.wrapY&&(p.y=o(p.y,u.y)),A.isValid(p)&&(i&&v.length<_.length&&(m=_[v.length],y=y||l.level!==m.level||l.x!==m.x||l.y!==m.y),v.push({index:l,source:p}));if(i){if(!y&&v.length===_.length)return;_.splice(0,_.length),r.each(v,(function(e,t){_.push(t.index)}))}if(n){h={x:(c.x+d.x)/2,y:(c.y+d.y)/2,level:e,bottomLevel:e};for(var x=Math.max(d.x-c.x,d.y-c.y)+1;x>=1;x/=2)h.bottomLevel-=1;v.sort(A._loadMetric(h)),A._queue&&A._queue.batch(!0)}for(A.cache.size=e.bottomLevel!=n.level>=e.bottomLevel?t.level>=e.bottomLevel?-1:1:t.level-n.level:(s=Math.pow(2,t.level-e.level),o=(e.x+.5)*s-.5,a=(e.y+.5)*s-.5,(r=t.x-o)*r+(i=t.y-a)*i-((r=n.x-o)*r+(i=n.y-a)*i))}},this.fromLevel=function(e,t){var n=Math.pow(2,-t);return{x:e.x*n,y:e.y*n}},this.toLevel=function(e,t){var n=Math.pow(2,t);return{x:e.x*n,y:e.y*n}},this.drawTile=function(e){var t=e.toString();A._activeTiles.hasOwnProperty(t)?A._moveToTop(e):A._drawTile(e),A._activeTiles[t]=e},this._drawTile=function(e){if(null!==A.renderer())throw new Error("This draw method is not valid on renderer managed layers.");var t,n=e.index.level,i=r(A._getSubLayer(n)),o=A._tileBounds(e),a=A._options.animationDuration,s=r('
').attr("tile-reference",e.toString());s.append(e.image),s.css({left:o.left-parseInt(i.attr("offsetx")||0,10)+"px",top:o.top-parseInt(i.attr("offsety")||0,10)+"px"}),(t=A.tileCropFromBounds(e))&&s.addClass("crop").css({width:t.x+"px",height:t.y+"px"}),a>0&&e.fadeIn(a),i.append(s),e.catch((function(){console.warn("Could not load tile at "+e.toString()),A._remove(e)}))},this.remove=function(e){var t=e.toString(),n=A._activeTiles[t];return n instanceof f&&A._remove(n),delete A._activeTiles[t],n},this._remove=function(e){e.image&&(e.image.parentElement?r(e.image.parentElement).remove():console.log("No parent element to remove "+e.toString(),e),r(e.image).remove())},this._moveToTop=function(e){r.noop(e)},this._getViewBounds=function(){var e=A.map(),t=e.zoom(),n=A._options.tileRounding(t),r=Math.pow(2,t-n),i=e.size(),o=A.displayToLevel({x:0,y:0}),a=A.displayToLevel({x:i.width,y:0}),s=A.displayToLevel({x:0,y:i.height}),l=A.displayToLevel({x:i.width,y:i.height});return{level:n,scale:r,left:Math.min(o.x,a.x,s.x,l.x),right:Math.max(o.x,a.x,s.x,l.x),top:Math.min(o.y,a.y,s.y,l.y),bottom:Math.max(o.y,a.y,s.y,l.y)}},this._purge=function(e,t,n){var r,i;if(A._updating)return A;for(i in n||(n=A._getViewBounds()),A._activeTiles)r=A._activeTiles[i],A._canPurge(r,n,e,t)&&A.remove(r);return A},this.clear=function(){var e,t=[];for(e in A._activeTiles)t.push(A.remove(e));return A._tileTree={},_=[],t},this.reset=function(){return A.clear(),A._cache.clear(),A._queue.initialSize=w,A},this.toLocal=function(e,t){var n=A.map(),r=n.unitsPerPixel(void 0===t?n.zoom():t);return{x:e.x/r,y:A._topDown()*e.y/r}},this.fromLocal=function(e,t){var n=A.map(),r=n.unitsPerPixel(void 0===t?n.zoom():t);return{x:e.x*r,y:A._topDown()*e.y*r}},this._topDown=function(){return A._options.topDown?1:-1},this._getSubLayer=function(e){if(A.canvas()){var t=A.canvas().find("div[data-tile-layer="+e.toFixed()+"]").get(0);return t||(t=r('
').get(0),A.canvas().append(t)),t}},this._updateSubLayers=function(e,t){var n=A.canvas(),i=parseInt(n.attr("lastlevel"),10),o=parseInt(n.attr("lastoffsetx")||0,10),a=parseInt(n.attr("lastoffsety")||0,10);if(i===e&&Math.abs(o-t.left)<65536&&Math.abs(a-t.top)<65536)return{x:o,y:a};var s=A.map(),l=A._tileOffset(e),u=parseInt((t.left+t.right-s.size().width)/2+l.x,10),c=parseInt((t.top+t.bottom-s.size().height)/2+l.y,10);return n.find(".geo-tile-layer").each((function(t,n){var i=r(n),o=parseInt(i.data("tileLayer"),10);i.css("transform","scale("+Math.pow(2,e-o)+")");var a=parseInt(u/Math.pow(2,e-o),10),s=parseInt(c/Math.pow(2,e-o),10),l=a-parseInt(i.attr("offsetx")||0,10),d=s-parseInt(i.attr("offsety")||0,10);i.attr({offsetx:a,offsety:s}),i.find(".geo-tile-container").each((function(e,t){r(t).css({left:parseInt(r(t).css("left"),10)-l+"px",top:parseInt(r(t).css("top"),10)-d+"px"})}))})),n.attr({lastoffsetx:u,lastoffsety:c,lastlevel:e}),{x:u,y:c}},this._update=function(e){if(e&&e.event&&(e.event.event===s.zoom||e.event.event===s.rotate))return A;if(!A.visible())return A;var t,n=A.map(),i=n.bounds(void 0,null),o=n.zoom(),a=A._options.tileRounding(o);if(A._updateSubLayers){var l=A._getViewBounds(),u=A._updateSubLayers(a,l)||{x:0,y:0},c=A._tileOffset(a);if(null===A.renderer()){var d=Math.pow(2,o-a),f=n.rotation(),p=-c.x+-(l.left+l.right)/2+u.x,h=-c.y+-(l.bottom+l.top)/2+u.y,g=p+n.size().width/2,v=h+n.size().height/2;A.canvas().css({"transform-origin":-p+"px "+-h+"px"});var y="translate("+g+"px,"+v+"px)scale("+d+")";f&&(y+="rotate("+180*f/Math.PI+"deg)"),A.canvas().css("transform",y)}A.canvas().attr({scale:Math.pow(2,o-a),dx:-c.x+-(l.left+l.right)/2,dy:-c.y+-(l.bottom+l.top)/2,offsetx:u.x,offsety:u.y,rotation:n.rotation()})}if(void 0===(t=A._getTiles(a,i,!0,!0)))return A;if(A._tileTree={},t.forEach((function(e){if(e.fetched())delete C[e.toString()],A.drawTile(e),A._setTileTree(e);else{if(e._queued)(A._queue?A._queue.get(e):-1)>=0&&A._queue.add(e);else e.then((function(){if(!m&&e===A.cache.get(e.toString())){var t=n.zoom(),r=A._options.tileRounding(t),i=A._getViewBounds();A._canPurge(e,i,r)?A.remove(e):(A.drawTile(e),A._setTileTree(e))}})),e._queued=!0;A.addPromise(e),C[e.toString()]=e}})),r.when.apply(r,t).done((function(){var e=A.map().zoom(),t=A._options.tileRounding(e);A._purge(t,!0)})),"all"!==A._options.idleAfter)for(var b in C){var x=C[b];t.indexOf(x)<0&&(A.removePromise(x),delete C[b])}return A},this._setTileTree=function(e){if(!A._options.keepLower){var t=e.index;A._tileTree[t.level]=A._tileTree[t.level]||{},A._tileTree[t.level][t.x]=A._tileTree[t.level][t.x]||{},A._tileTree[t.level][t.x][t.y]=e}},this._getTileTree=function(e){return((A._tileTree[e.level]||{})[e.x]||{})[e.y]||null},this._isCovered=function(e){var t=e.index.level,n=e.index.x,r=e.index.y,i=[];return(i=A._getTileTree({level:t-1,x:Math.floor(n/2),y:Math.floor(r/2)}))?[i]:(i=[A._getTileTree({level:t+1,x:2*n,y:2*r}),A._getTileTree({level:t+1,x:2*n+1,y:2*r}),A._getTileTree({level:t+1,x:2*n,y:2*r+1}),A._getTileTree({level:t+1,x:2*n+1,y:2*r+1})]).every((function(e){return null!==e}))?i:null},this._outOfBounds=function(e,t){var n=A._tileOffset(e.index.level),r=1;return e.index.level!==t.level&&(r=Math.pow(2,(t.level||0)-(e.index.level||0))),(e.bottom-n.y)*rt.right||(e.top-n.y)*r>t.bottom||(e.right-n.x)*r=A._options.minLevel||e.index.level!==A._options.minLevel)&&(n=0?e.split(","):e.split("")),A._options.subdomains=e,A.reset(),A.map().draw()),A)},this._tileOffset=function(e){return void 0===T[e]&&(T[e]=A._options.tileOffset(e)),T[e]},this.visible=function(e){return void 0===e?b():(A.visible()!==e&&(b(e),e&&A._update()),A)},Object.defineProperty(this,"baseQuad",{get:function(){return A._options.baseQuad},set:function(e){A._options.baseQuad=e,A._update()}}),this._addBaseQuadToTiles=function(e,t){e&&(this.baseQuad!==g&&(g&&t.splice(0,1),(g=this.baseQuad)&&(t.splice(0,0,this.baseQuad),e.cacheUpdate(0)),e.data(t)),e._update())},this._init=function(){var e;if(v.apply(A,arguments),null===A.renderer())for(e=0;e<=A._options.maxLevel;e+=1)A._getSubLayer(e);return A},this._exit=function(){return A.reset(),y.apply(A,arguments),m=!0,this._queue&&this._queue._tileLayers&&this._queue._tileLayers.indexOf(A)>=0&&this._queue._tileLayers.splice(this._queue._tileLayers.indexOf(A),1),A},d("tile",this),this};s.defaults={minLevel:0,maxLevel:18,tileOverlap:{x:0,y:0},tileWidth:256,tileHeight:256,wrapX:!0,wrapY:!1,url:null,subdomains:"abc",tileOffset:function(e){return{x:0,y:0}},tilesMaxBounds:null,topDown:!1,keepLower:!0,idleAfter:"view",tileRounding:Math.round,attribution:"",animationDuration:0},r(s,i),e.exports=s},6618:function(e){var t=0;e.exports=function e(){"use strict";if(!(this instanceof e))return new e;var n=this,r=0;return this.modified=function(){return r=t+=1,n},this.timestamp=function(){return r},this.getMTime=this.timestamp,this}},6223:function(e,t,n){var r=n(5699),i=n(6837),o=n(4647),a=n(4634),s=function e(t){"use strict";if(!(this instanceof e))return new e(t);var r=n(5638),s=n(6853);t=t||{},i.call(this,t);var l,u,c,d,f,p=this,h={},m={startTime:void 0!==t.startTime?t.startTime:null,endTime:void 0!==t.endTime?t.endTime:null,duration:void 0!==t.duration?t.duration:null,start:0,end:0},g=this.draw,v=this._exit,y=this._init,b=this.modified,x=this.style,w=this._update;return this.featureType="track",this._linePosition=function(e){return function(t,n,r,i){var o=m.timeFunc(t,n,r,i);return"past"===e&&o>=m.start||"current"===e&&om.end||"future"===e&&o=p.buildTime().timestamp()&&p._build(),t=null===t?p.layer().map().gcs():void 0===t?p.gcs():t;var r=s({source:p.gcs(),target:t}),i=p.data(),o=[],a=i.map((function(t,n){var r=m.trackFunc(t,n);if(o.push(r),!r.length)return{x:0,y:0,z:0,posidx:-1};var i,a,s,l,u=0,c=r.length-1;if(1===r.length)return{posidx:u,angidx0:u,angidx1:u};if((i=m.timeFunc(r[u],u,t,n))>=e)return{posidx:u,angidx0:u,angidx1:u+1};if((a=m.timeFunc(r[c],c,t,n))<=e)return{posidx:c,angidx0:c-1,angidx1:c};for(;c-u>1;){if(s=Math.floor((c+u)/2),(l=m.timeFunc(r[s],s,t,n))===e)return{posidx:s,angidx0:s-1,angidx1:s+1};l1&&(n=m.timeFunc(i[i.length-1],i.length-1,e,t)),(void 0===r.end||n>r.end)&&(r.end=n))})),m.timeExtents=r,p._updateTimeRange(),m.startPosition=p.calculateTimePosition(m.start,null),m.endPosition=p.calculateTimePosition(m.end,null,!0),m.text=e.map((function(e,r){var i=m.textFunc(e,r);return t|=null==i,null==i||""===i?"":(n=!0,m.startPosition[r].posidx<0&&(i=""),i)})),t&&!c){if(!(o.registries.features[p.layer().rendererName()]||{}).marker){var i=o.rendererForFeatures(["marker"]);u=o.createLayer("feature",p.layer().map(),{renderer:i}),p.layer().addChild(u),p.layer().node().append(u.node())}c=(u||p.layer()).createFeature("marker");var a=p.dependentFeatures();a.push(c),p.dependentFeatures(a)}if(n&&!f){if(!(o.registries.features[p.layer().rendererName()]||{}).text){var s=o.rendererForFeatures(["text"]);d=o.createLayer("feature",p.layer().map(),{renderer:s}),p.layer().addChild(d),p.layer().node().append(d.node())}f=(d||p.layer()).createFeature("text");var h=p.dependentFeatures();h.push(f),p.dependentFeatures(h)}if(c){c.headData=m.endPosition,c.style(p.markerStyle()).gcs(p.gcs()).data(e).position(p._headPosition);var g=c.style.get("radius");c.style("radius",(function(e,t){return m.text[t]||m.startPosition[t].posidx<0?0:g(e,t)}))}return f&&(f.headData=m.endPosition,f.style(p.textStyle()).gcs(p.gcs()).data(e).text(p._headText).position(p._headPosition)),p},this._updateTimeAndPosition=function(){l&&(p._updateTimeRange(),m.startPosition=p.calculateTimePosition(m.start,null),m.endPosition=p.calculateTimePosition(m.end,null,!0),l.past.modified(),l.current.modified(),l.future.modified(),c&&c.modified(),f&&f.modified(),p.updateTime().modified(),p.modified())},this._update=function(){return w.call(p),(p.dataTime().timestamp()>=p.buildTime().timestamp()||p.updateTime().timestamp()<=p.timestamp())&&p._build(),p.updateTime().modified(),p},this.draw=function(){var e=g();return l&&(l.past.draw(),l.current.draw(),l.future.draw()),c&&c.draw(),f&&f.draw(),e},this.modified=function(){var e=b();return l&&(l.past.modified(),l.current.modified(),l.future.modified()),c&&c.modified(),f&&f.modified(),e},this.style=function(e,t,n){return"style"===(n=n||"style")?x(e,t):void 0===e?h[n]:"string"==typeof e&&void 0===t?(h[n]||{})[e]:(void 0===h[n]&&(h[n]={}),void 0===t?h[n]=r.extend(!0,h[n],e):h[n][e]=t,p.modified(),p)},this.style.get=x.get,["markerStyle","textStyle","pastStyle","currentStyle","futureStyle"].forEach((function(e){p[e]=function(t,n){return p.style(t,n,e)}})),this.track=function(e){return void 0===e?p.style("track"):(p.style("track",e),p.dataTime().modified(),p.modified(),p)},this.position=function(e){return void 0===e?p.style("position"):(p.style("position",e),p.dataTime().modified(),p.modified(),p)},this.time=function(e){return void 0===e?p.style("time"):(p.style("time",e),p.dataTime().modified(),p.modified(),p)},this.timeRange=function(e){if(void 0===e)return{startTime:m.startTime,endTime:m.endTime,duration:m.duration,start:m.start,end:m.end,minimum:(m.timeExtents||{}).start,maximum:(m.timeExtents||{}).end};var t=!1;return void 0!==e.startTime&&e.startTime!==m.startTime&&(m.startTime=null===e.startTime?e.startTime:+e.startTime,t=!0),void 0!==e.endTime&&e.endTime!==m.endTime&&(m.endTime=null===e.endTime?e.endTime:+e.endTime,t=!0),void 0!==e.duration&&e.duration!==m.duration&&(m.duration=null===e.duration?e.duration:+e.duration,t=!0),t&&p._updateTimeAndPosition(),p},this.startTime=function(e){return void 0===e?m.startTime:(e!==m.startTime&&(m.startTime=null===e?e:+e,p._updateTimeAndPosition()),p)},this.endTime=function(e){return void 0===e?m.endTime:(e!==m.endTime&&(m.endTime=null===e?e:+e,p._updateTimeAndPosition()),p)},this.duration=function(e){return void 0===e?m.duration:(e!==m.duration&&(m.duration=null===e?e:+e,p._updateTimeAndPosition()),p)},this._mergeSearchResults=function(e,t){return e.extra=e.extra||{},t.forEach((function(t){return t.value.index.forEach((function(n,r){e.index.indexOf(n)<0&&(e.index.push(n),e.found.push(t.value.found[r]),e.where=e.where||{},t.value.extra&&t.value.extra[n]&&(e.extra[n]=t.value.extra[n]),a.isObject(e.extra[n])||(e.extra[n]={value:e.extra[n]}),e.extra[n].where=t.key)}))})),e},this.pointSearch=function(e){var t=l.current.pointSearch(e),n=l.past.pointSearch(e),r=l.future.pointSearch(e),i=c?c.pointSearch(e):{index:[]};return this._mergeSearchResults(t,[{key:"marker",value:i},{key:"past",value:n},{key:"future",value:r}])},this.polygonSearch=function(e,t){var n=l.current.polygonSearch(e,t),r=l.past.polygonSearch(e,t),i=l.future.polygonSearch(e,t),o=c?c.polygonSearch(e,t):{index:[]};return this._mergeSearchResults(n,[{key:"marker",value:o},{key:"past",value:r},{key:"future",value:i}])},this._exit=function(){l&&p.layer()&&(p.layer().deleteFeature(l.past),p.layer().deleteFeature(l.current),p.layer().deleteFeature(l.future)),l=null,(u||p.layer())&&c&&(u||p.layer()).deleteFeature(c),u&&p.layer()&&p.layer().removeChild(u),u=null,(d||p.layer())&&f&&(d||p.layer()).deleteFeature(f),d&&p.layer()&&p.layer().removeChild(d),d=null,p.dependentFeatures([]),v()},this._init=function(e){e=e||{},y.call(p,e);var t=r.extend(!0,{},{track:function(e){return e},position:function(e){return e},time:function(e,t){return void 0!==e.t?e.t:t}},void 0===e.style?{}:e.style),n=r.extend(!0,{},{rotateWithMap:!0,rotation:function(e,t){return-m.endPosition[t].angle||0}},void 0===e.markerStyle?{}:e.markerStyle),i=r.extend(!0,{},{rotateWithMap:!0,rotation:function(e,t){return void 0!==m.endPosition[t].angle?-m.endPosition[t].angle+Math.PI/2:0}},void 0===e.textStyle?{}:e.textStyle),o=r.extend(!0,{},{strokeOpacity:.25},void 0===e.pastStyle?{}:e.pastStyle),a=r.extend(!0,{},{},void 0===e.currentStyle?{}:e.currentStyle),s=r.extend(!0,{},{strokeOpacity:.25},void 0===e.futureStyle?{}:e.futureStyle);["track","position","time"].forEach((function(n){void 0!==e[n]&&(t[n]=e[n])})),p.style(t),p.markerStyle(n),p.textStyle(i),p.pastStyle(o),p.currentStyle(a),p.futureStyle(s)},this};r(s,i),e.exports=s},6853:function(e,t,n){var r=n(4252),i=n(5365),o=n(5240),a=n(4634);r=r.__esModule?r.default:r;var s=n(1103);s.keys().forEach((function(e){r.Proj.projections.add(s(e))}));var l={},u=/^(.* |)\\+axis=e(n|s)u(| .*)$/,c=/(^|\s)\+(s[1-3][1-3]|[xyz]off)=\S/,d=function e(t){"use strict";if(!(this instanceof e))return(t=t||{}).source in l||(Object.keys(l).length>=10&&(l={}),l[t.source]={}),t.target in l[t.source]||(Object.keys(l[t.source]).length>=10&&(l[t.source]={}),l[t.source][t.target]=new e(t)),l[t.source][t.target];var n,s,u,d,f,p,h,m=this,g={s11:0,s12:4,s13:8,xoff:12,s21:1,s22:5,s23:9,yoff:13,s31:2,s32:6,s33:10,zoff:14};function v(e){if(!c.exec(e))return{proj:e};var t,n,r=a.mat4AsArray(),i=[];return e.split(/(\s+)/).forEach((function(e){var t=/^\+(s[1-3][1-3]|[xyz]off)=(.*)$/.exec(e);t?r[g[t[1]]]=parseFloat(t[2]):i.push(e)})),n={proj:i.join(" "),orig:e},(t=o.invert(a.mat4AsArray(),r))?(n.matrix=r,n.inverse=t):console.warn("Affine transform is not invertable and will not be used: "+e),n}function y(){var e=v(m.source()),t=v(m.target()),i=e.proj,o=t.proj;d=e.matrix,f=e.inverse,p=t.matrix,h=t.inverse,n=new r(i,o)}this.source=function(e){return void 0===e?s||"EPSG:4326":(s=e,y(),m)},this.target=function(e){return void 0===e?u||"EPSG:3857":(u=e,y(),m)},this._forward=function(e){if(d){var t=i.transformMat4(a.vec3AsArray(),[e.x,e.y,e.z||0],f);e={x:t[0],y:t[1],z:t[2]}}var r=n.forward(e,!0);if(r.z=e.z||0,p){var o=i.transformMat4(a.vec3AsArray(),[r.x,r.y,r.z],p);r={x:o[0],y:o[1],z:o[2]}}return r},this._inverse=function(e){if(p){var t=i.transformMat4(a.vec3AsArray(),[e.x,e.y,e.z||0],h);e={x:t[0],y:t[1],z:t[2]}}var r=n.inverse(e,!0);if(r.z=e.z||0,d){var o=i.transformMat4(a.vec3AsArray(),[r.x,r.y,r.z],d);r={x:o[0],y:o[1],z:o[2]}}return r},this.forward=function(e){return Array.isArray(e)?e.map(m._forward):m._forward(e)},this.inverse=function(e){return Array.isArray(e)?e.map(m._inverse):m._inverse(e)},t=t||{};try{this.source(t.source)}catch(e){console.error("Can't use transform source: "+t.source),this.source("EPSG:4326")}try{this.target(t.target)}catch(e){console.error("Can't use transform target: "+t.target),this.target("EPSG:3857")}return this};d.defs=r.defs,d.lookup=function(e){var t,i,o=n(5638),a=o.Deferred();return r.defs.hasOwnProperty(e)?a.resolve(r.defs[e]):2!==(i=e.split(":")).length||"EPSG"!==i[0].toUpperCase()?a.reject("Invalid projection code").promise():(t=i[1],o.ajax({url:"https://epsg.io/?q="+t+"&format=json"}).done((function(t){var n=(t.results||[])[0];return n&&n.proj4?(r.defs(e,n.proj4),o.when(r.defs[e])):a.reject(t).promise()})))},d.transformCoordinates=function(e,t,n,r){"use strict";if(e===t||Array.isArray(n)&&!n.length)return n;if(Array.isArray(n)&&n.length>=3&&3===r&&!a.isObject(n[0])&&!c.test(e)&&!c.test(t))return d.transformCoordinatesFlatArray3(e,t,n);if(Array.isArray(n)&&n.length&&a.isObject(n[0])&&"x"in n[0]&&"y"in n[0]){var i=e.match(u),o=t.match(u);if(i&&o&&i[1]===o[1]&&i[3]===o[3])return"z"in n[0]?n.map((function(e){return{x:+e.x,y:-e.y,z:+e.z||0}})):n.map((function(e){return{x:+e.x,y:-e.y}}))}var s,l=d({source:e,target:t});return a.isObject(n)&&"x"in n&&"y"in n?(s=l.forward({x:+n.x,y:+n.y,z:+n.z||0},!0),"z"in n?s:{x:s.x,y:s.y}):Array.isArray(n)&&1===n.length&&a.isObject(n[0])&&"x"in n[0]&&"y"in n[0]?(s=l.forward({x:+n[0].x,y:+n[0].y,z:+n[0].z||0},!0),"z"in n[0]?[s]:[{x:s.x,y:s.y}]):d.transformCoordinatesArray(l,n,r)},d.transformCoordinatesArray=function(e,t,n){var r,i,o,s,l,u,c,d,f,p={};function h(){if(Array.isArray(t[0]))if(2===t[0].length)s=function(e){return+t[e][0]},l=function(e){return+t[e][1]},c=function(e,t,n){d[e]=[t,n]};else{if(3!==t[0].length)throw new Error("Invalid coordinates. Requires two or three components per array");s=function(e){return+t[e][0]},l=function(e){return+t[e][1]},u=function(e){return+t[e][2]},c=function(e,t,n,r){d[e]=[t,n,r]}}else if(2===t.length)o=2,s=function(e){return+t[e*o]},l=function(e){return+t[e*o+1]},c=function(e,t,n){d[e]=t,d[e+1]=n};else if(3===t.length)o=3,s=function(e){return+t[e*o]},l=function(e){return+t[e*o+1]},u=function(e){return+t[e*o+2]},c=function(e,t,n,r){d[e]=t,d[e+1]=n,d[e+2]=r};else{if(!n)throw new Error("Invalid coordinates");if(2!==n&&3!==n)throw new Error("Number of components should be two or three");o=n,s=function(e){return+t[e]},l=function(e){return+t[e+1]},2===n?c=function(e,t,n){d[e]=t,d[e+1]=n}:(u=function(e){return+t[e+2]},c=function(e,t,n,r){d[e]=t,d[e+1]=n,d[e+2]=r})}}if(u=function(){return 0},!Array.isArray(t))throw new Error("Coordinates are not valid");if((d=[]).length=t.length,i=t.length,!t.length)return d;for(Array.isArray(t[0])||a.isObject(t[0])?(o=1,Array.isArray(t[0])?h():a.isObject(t[0])&&function(){if(!(t[0]&&"x"in t[0]&&"y"in t[0]))throw new Error("Invalid coordinates");s=function(e){return+t[e].x},l=function(e){return+t[e].y},"z"in t[0]?(u=function(e){return+t[e].z},c=function(e,t,n,i){d[r]={x:t,y:n,z:i}}):c=function(e,t,n){d[e]={x:t,y:n}}}()):h(),r=0;r=0;i-=3)n[i]*=-1;return n}var s,l=r.Proj(e),c=r.Proj(t),d={},f=new r(l,c);for(i=n.length-3;i>=0;i-=3)d.x=+n[i],d.y=+n[i+1],d.z=+(n[i+2]||0),s=f.forward(d,!0),n[i]=s.x,n[i+1]=s.y,n[i+2]=void 0===s.z?d.z:s.z;return n},d.affineForward=function(e,t){"use strict";var n,r=e.origin,i=e.scale||{x:1,y:1,z:1};for(n=0;n0&&Math.abs(D-k)>1e-12;y-=1)l=Math.pow(Math.pow(E*Math.sin(D),2)+Math.pow(O*M-P*E*Math.cos(D),2),.5),u=P*M+O*E*Math.cos(D),c=Math.atan2(l,u),f=O*E*Math.sin(D)/l,k=D,D=S+(1-(m=w/16*(p=1-Math.pow(f,2))*(4+w*(4-3*p))))*w*f*(c+m*l*((h=u-(p?2*P*M/p:0))+m*u*(2*Math.pow(h,2)-1)));return y?{distance:x*(1+(g=p*(b*b-x*x)/(x*x))/16384*(4096+g*(g*(320-175*g)-768)))*(c-(v=g/1024*(256+g*(g*(74-47*g)-128)))*l*(h+v/4*(u*(2*Math.pow(h,2)-1)-v/6*h*(4*l*l-3)*(4*Math.pow(h,2)-3)))),alpha1:Math.atan2(E*Math.sin(D),O*M-P*E*Math.cos(D)),alpha2:Math.atan2(O*Math.sin(D),-P*E+O*M*Math.cos(D))}:void 0},d.proj4=r,e.exports=d},3762:function(e){e.exports={}},9219:function(e,t,n){var r=n(2531).d3,i=n(9450),o=n(5699),a=n(4647).registerWidget,s=n(4634),l=n(1946);n(2352);var u=function e(t){"use strict";if(!(this instanceof e))return new e(t);i.call(this,t);var n=this,o=[],a=t.width||300,u=t.ticks||6,d=this._init;return this._init=function(){d();var e=n.canvas();r.select(e).attr("class","color-legend-container"),n.popup=r.select(e).append("div").attr("class","color-legend-popup"),t.categories&&n.categories(t.categories)},this._draw=function(){if(r.select(n.canvas()).selectAll("div.geojs-color-legends").remove(),o.length){r.select(n.canvas()).style("display","block");var e=r.select(n.canvas()).append("div").attr("class","geojs-color-legends"),t=a;o.forEach((function(r,i){var o=e.append("div").attr("class","geojs-color-legend");o.append("div").attr("class","geojs-title").text(r.name);var a=o.append("svg").attr({class:"svg",width:t,height:"40px",viewBox:"-20 0 "+t+" 40"});"discrete"===r.type?n._drawDiscrete(a,t-40,r):"continuous"===r.type&&n._drawContinous(a,t-40,r)}))}else r.select(n.canvas()).style("display","none")},this.categories=function(e){return void 0===e?o:(o=n._prepareCategories(e),n._draw(),n)},this.addCategories=function(e){return o=o.concat(n._prepareCategories(e)),n._draw(),n},this.removeCategories=function(e){return o=o.filter((function(t){return-1===e.indexOf(t)})),n._draw(),n},this._prepareCategories=function(e){return e.forEach((function(e){e.color=e.colors.map((function(e){return s.convertColorToHex(e,!0)}))})),e},this._drawDiscrete=function(e,t,i){if(-1===["linear","log","sqrt","pow","quantile","ordinal"].indexOf(i.scale))throw new Error("unsupported scale");var o,a,l,d,f,p,h;if("ordinal"===i.scale)l=r.scale.ordinal().domain(i.domain).range(i.colors),n._renderDiscreteColors(e,i.domain,l,t,(function(e){return e})),d=r.scale.ordinal().domain(i.domain).rangeRoundBands([0,t]),f=r.svg.axis().scale(d).tickValues((function(){var e=Math.ceil(i.domain.length/u);return i.domain.filter((function(t,n){return n%e==0}))}));else if("quantile"===i.scale){o=[0,i.colors.length],p=s.range(0,i.colors.length-1),a=r.scale.quantile().domain(i.domain).range(p),l=r.scale.quantize().domain(o).range(i.colors),n._renderDiscreteColors(e,p,l,t,(function(e){return a.invertExtent(e).join(" - ")}));var m=[a.invertExtent(0)[0]];m=m.concat(p.map((function(e){return a.invertExtent(e)[1]}))),f=v(d=r.scale.ordinal().domain(m).rangePoints([0,t]))}else if(-1!==["linear","log","sqrt","pow"].indexOf(i.scale)){o=[0,i.colors.length],a=r.scale[i.scale]().domain(i.domain).range(o).nice(),l=r.scale.quantize().domain(o).range(i.colors),p=s.range(0,i.colors.length-1);var g=Math.max.apply(null,i.domain.map((function(e){return c(e)})));n._renderDiscreteColors(e,p,l,t,(function(e){return n._popupFormatter(a.invert(e),g)+" - "+n._popupFormatter(a.invert(e+1),g)})),(h=p.slice()).push(i.colors.length),f=v(d=r.scale.ordinal().domain(h.map((function(e){return a.invert(e)}))).rangePoints([0,t]))}function v(e){return r.svg.axis().scale(e).tickFormat(r.format(".2s")).tickValues((function(){var t=Math.ceil(e.domain().length/u);return e.domain().filter((function(e,n){return n%t==0}))}))}i.endAxisLabelOnly&&f.tickValues([d.domain()[0],d.domain()[d.domain().length-1]]),n._renderAxis(e,f)},this._renderDiscreteColors=function(e,t,r,i,o){e.selectAll("rect").data(t).enter().append("rect").attr("width",i/t.length).attr("height","20px").attr("fill",(function(e){return r(e)})).attr("transform",(function(e,n){return"translate("+n*i/t.length+" ,0)"})).on("mousemove",(function(e){n._showPopup(o(e))})).on("mouseout",n._hidePopup)},this._drawContinous=function(e,t,i){var o,a,s;if(-1===["linear","log","sqrt","pow"].indexOf(i.scale))throw new Error("unsupported scale");var d=[0];for(s=1;s-10?o:0)+"px",top:t[1]-22+"px"}).transition().duration(200).style("opacity",1)},this._hidePopup=function(){n.popup.transition().duration(200).style("opacity",0)},this};function c(e){if(!isFinite(e))return 0;for(var t=1,n=0;Math.round(e*t)/t!==e;){if(!isFinite(e*t))return 0;t*=10,n++}return n}o(u,i),a("dom","colorLegend",u),e.exports=u},9450:function(e,t,n){var r=n(8123),i=n(5699),o=n(4647).registerWidget,a=function e(t){"use strict";if(!(this instanceof e))return new e(t);r.call(this,t);var n=this;return this._init=function(){return t.hasOwnProperty("parent")&&t.parent.addChild(n),n._createCanvas(),n._appendCanvasToParent(),n.canvas().addEventListener("mousedown",(function(e){e.stopPropagation()})),n.reposition(),n},this._createCanvas=function(){n.canvas(document.createElement(t.el||"div"))},this};i(a,r),o("dom","dom",a),e.exports=a},253:function(e,t,n){e.exports={colorLegendWidget:n(9219),domWidget:n(9450),legendWidget:n(4364),scaleWidget:n(3362),sliderWidget:n(7093),svgWidget:n(9731),uiLayer:n(6408),widget:n(8123)}},4364:function(e,t,n){var r=n(9731),i=n(5699),o=n(4647).registerWidget,a=function e(t){"use strict";if(!(this instanceof e))return new e(t);r.call(this,t);var i=n(2531).d3,o=n(5108),a=this,s=[],l=null,u=null,c=null;this.categories=function(e){return void 0===e?s.slice():(s=e.slice().map((function(e){return"line"===e.type&&(e.style.fill=!1,e.style.stroke=!0),e})),a.draw(),a)},this.size=function(){var e,t=1,n=i.select(a.canvas()).append("text").style("opacity",1e-6);return s.forEach((function(e){n.text(e.name),t=Math.max(t,n.node().getBBox().width)})),n.remove(),e=20*(s.length+1),{width:t+50,height:e}},this.draw=function(){function e(e){e.style("fill",(function(e){return e.style.fill||void 0===e.style.fill?e.style.fillColor:"none"})).style("fill-opacity",(function(e){return void 0===e.style.fillOpacity?1:e.style.fillOpacity})).style("stroke",(function(e){return e.style.stroke||void 0===e.style.stroke?e.style.strokeColor:"none"})).style("stroke-opacity",(function(e){return void 0===e.style.strokeOpacity?1:e.style.strokeOpacity})).style("stroke-width",(function(e){return void 0===e.style.strokeWidth?1.5:e.style.strokeWidth}))}a._init(),c.attr("height",a.size().height+24).style("display",null);var t=a._scale(),n=u.selectAll("g.geo-label").data(s,(function(e){return e.name})).enter().append("g").attr("class","geo-label").attr("transform",(function(e,n){return"translate(0,"+t.y(n)+")"}));return e(n.filter((function(e){return"point"!==e.type&&"line"!==e.type})).append("rect").attr("x",0).attr("y",-6).attr("rx",5).attr("ry",5).attr("width",40).attr("height",12)),e(n.filter((function(e){return"point"===e.type})).append("circle").attr("cx",20).attr("cy",0).attr("r",6)),e(n.filter((function(e){return"line"===e.type})).append("line").attr("x1",0).attr("y1",0).attr("x2",40).attr("y2",0)),n.append("text").attr("x","50px").attr("y",0).attr("dy","0.3em").text((function(e){return e.name})),a.reposition(),a},this._scale=function(){return{x:i.scale.linear().domain([0,1]).range([0,a.size().width]),y:i.scale.linear().domain([0,s.length-1]).range([6,a.size().height-6])}},this._init=function(){l||(a._createCanvas(),a._appendCanvasToParent());var e=a.size().width+24+4,t=a.size().height+24+4;l&&l.remove(),i.select(a.canvas()).attr("width",e).attr("height",t),l=i.select(a.canvas()).append("g"),u=l.append("g").attr("transform","translate("+[14,14]+")"),c=u.append("rect").attr("x",-12).attr("y",-12).attr("width",e-4).attr("height",t-4).attr("rx",3).attr("ry",3).style({stroke:"black","stroke-width":"1.5px",fill:"white","fill-opacity":.75,display:"none"}),u.on("mousedown",(function(){i.event.stopPropagation()})),u.on("mouseover",(function(){c.transition().duration(250).style("fill-opacity",1)})),u.on("mouseout",(function(){c.transition().duration(250).style("fill-opacity",.75)})),a.reposition()},this.geoOn(o.resize,(function(){a.draw()}))};i(a,r),o("dom","legend",a),e.exports=a},3362:function(e,t,n){var r=n(5638),i=n(5699),o=n(9731),a=n(4647).registerWidget;n(4129);var s=function e(t){"use strict";if(!(this instanceof e))return new e(t);o.call(this,t);var i=n(5108),a=n(6853),s=n(4634),l=n(2531).d3,u=this,c=this._exit,d=r.extend({},{scale:1,maxWidth:200,maxHeight:"left"===t.orientation||"right"===t.orientation?200:20,orientation:"bottom",strokeWidth:2,tickLength:10,units:"si",distance:function(e,t,n){return"+proj=longlat +axis=enu"===n?Math.sqrt(s.distance2dSquared(e,t)):a.sphericalDistance(e,t,n)}},t);this._init=function(){return u._createCanvas(),u._appendCanvasToParent(),u.reposition(),l.select(u.canvas()).attr({width:d.maxWidth,height:d.maxHeight}),u.geoOn(i.pan,u._update),u._render(),u},this._exit=function(){u.geoOff(i.pan,u._update),c()},this._vertical=function(){return"left"===d.orientation||"right"===d.orientation},this._scaleValue=function(t,n,r){var i,o,a,s=[{multiple:1,digits:1},{multiple:1.5,digits:2},{multiple:2,digits:1},{multiple:3,digits:1},{multiple:5,digits:1},{multiple:8,digits:1}],l=(r=e.unitsTable[r]||r||e.unitsTable[d.units]||d.units)[0];return r.forEach((function(e){t>=e.scale*(e.minimum||1)&&(l=e)})),o=Math.floor(Math.log(t/l.scale)/Math.log(l.basis||10)),(s=l.multiples||s).forEach((function(e){var n=l.scale*e.multiple*Math.pow(10,o);n<=t&&(i=e,a=n)})),{html:(i.multiple*Math.pow(10,o)).toFixed(Math.max(0,-o+i.digits-1))+" "+l.unit,value:a,pixels:a/t*n,power:o,multiple:i,unitRecord:l,originalValue:t,originalPixels:n}},this._render=function(){var e,t,n,i,o,a,s=l.select(u.canvas()),c=u.layer().map(),f=d.maxWidth,p=d.maxHeight,h=d.strokeWidth,m=.5*h,g=d.tickLength,v=u._vertical();if(e=(v?d.maxHeight:d.maxWidth)-h,n={x:(t={x:(t=r(s[0][0]).offset()).left+("left"===d.orientation?f-m:m),y:t.top+("top"===d.orientation?p-m:m)}).x+(v?0:e),y:t.y+(v?e:0)},(i=d.distance(c.displayToGcs(t,null),c.displayToGcs(n,null),c.gcs())*d.scale)<=0||!isFinite(i))console.warn("The distance calculated for the scale is invalid: "+i);else{switch(o=u._scaleValue(i,e),v?p=o.pixels+h:f=o.pixels+h,s.attr({width:f,height:p}),s.select("polyline").empty()&&s.append("polyline").classed("geojs-scale-widget-bar",!0).attr({fill:"none","stroke-width":h}),s.select("text").empty()&&s.append("text").classed("geojs-scale-widget-text",!0),d.orientation){case"bottom":a=[[m,g],[m,m],[f-m,m],[f-m,g]],s.select("text").attr({x:f/2,y:2*h,"text-anchor":"middle","dominant-baseline":"hanging"});break;case"top":a=[[m,p-g],[m,p-m],[f-m,p-m],[f-m,p-g]],s.select("text").attr({x:f/2,y:p-2*h,"text-anchor":"middle","dominant-baseline":"alphabetic"});break;case"left":a=[[f-g,m],[f-m,m],[f-m,p-m],[f-g,p-m]],s.select("text").attr({x:f-2*h,y:p/2,"text-anchor":"end","dominant-baseline":"middle"});break;case"right":a=[[g,m],[m,m],[m,p-m],[g,p-m]],s.select("text").attr({x:2*h,y:p/2,"text-anchor":"start","dominant-baseline":"middle"})}s.select("polyline").attr("points",a.map((function(e){return e.join(",")})).join(" ")),s.select("text").html(o.html)}},this._update=function(){u._render()},this.options=function(e,t){if(void 0===e){var n=r.extend({},d);return n.position=u.position(void 0,!0),n}return"string"==typeof e&&void 0===t?"position"===e?u.position(void 0,!0):d[e]:(void 0===t?d=r.extend(!0,d,e):d[e]=t,(e.position||"position"===e)&&u.position(e.position||t),u._render(),u)}};i(s,o),s.unitsTable={si:[{unit:"nm",scale:1e-9},{unit:"μm",scale:1e-6},{unit:"mm",scale:.001},{unit:"m",scale:1},{unit:"km",scale:1e3}],miles:[{unit:"in",scale:.0254},{unit:"in",scale:.0254,basis:12,multiples:[{multiple:1,digits:1},{multiple:1.5,digits:2},{multiple:2,digits:1},{multiple:3,digits:1},{multiple:6,digits:1},{multiple:9,digits:1}]},{unit:"ft",scale:.3048},{unit:"mi",scale:1609.344}],decmiles:[{unit:"mi",scale:1609.344}]},s.areaUnitsTable={si:[{unit:"nm²",scale:1e-18},{unit:"μm²",scale:1e-12},{unit:"mm²",scale:1e-6},{unit:"m²",scale:1},{unit:"km²",scale:1e6}],hectares:[{unit:"ha",scale:1e4}],decmiles:[{unit:"mi²",scale:2589988.110336}],miles:[{unit:"in²",scale:64516e-8},{unit:"ft²",scale:.09290304},{unit:"mi²",scale:2589988.110336}],acres:[{unit:"pl",scale:25.29285264},{unit:"rd",scale:1011.7141056},{unit:"ac",scale:4046.8564224}]},s.formatUnit=function(e,t,n,r){if(null!=e){if(!Array.isArray(t)){if(!(n=n||s.unitsTable)||!n[t||"si"])return;t=n[t||"si"]}var i;for(i=0;i10)){var o=e.toFixed(r);if(r){for(;"0"===o.substr(o.length-1);)o=o.substr(0,o.length-1);"."===o.substr(o.length-1)&&(o=o.substr(0,o.length-1))}return o+" "+t.unit}}},a("dom","scale",s),e.exports=s},7093:function(e,t,n){var r=n(9731),i=n(5699),o=n(4647).registerWidget,a=function e(t){"use strict";if(!(this instanceof e))return new e(t);r.call(this,t);var i,o,a,s,l,u,c,d=n(2531).d3,f=n(5108),p=this,h=this._exit,m=t.width||20,g=t.height||160,v=t.width?.5*t.width:10;function y(e,t,n,r,i){var o=t.append("g"),a=i/1024;return o.append("g").append("g").attr("transform","translate("+n+","+r+") scale("+a+") translate(-512,-512)").append("path").attr("d",e).attr("class","geo-glyphicon"),o}c={white:"#f4f4f4",black:"#505050"},this.size=function(){return{width:m,height:g}},this._init=function(){p._createCanvas(),p._appendCanvasToParent(),p.reposition();var e=d.select(p.canvas()),t=p.layer().map();function n(n,r){var i=o.invert(d.mouse(e.node())[1]),a=t.zoomRange();i=(1-i)*(a.max-a.min)+a.min,r?t.transition({zoom:i,ease:d.ease("cubic-in-out"),duration:500,done:p._update()}):(t.zoom(i),p._update()),n.stopPropagation()}function r(){d.select(this).attr("filter",null),u.selectAll("circle,rect,path").transition().duration(100).style("fill",(function(e){return c[e.fill]||null})).style("stroke",(function(e){return c[e.stroke]||null}))}return e.attr("width",m).attr("height",g),i=d.scale.linear().domain([-4,4]).range([0,m]),o=d.scale.linear().domain([0,1]).range([1.5*m,g-1.5*m]),e=e.append("g").classed("geo-ui-slider",!0),u=e,(a=e.append("g")).append("circle").datum({fill:"white",stroke:null}).classed("geo-zoom-in",!0).attr("cx",i(0)).attr("cy",o(0)-m+2).attr("r",(m-2)/2).style({cursor:"pointer"}).on("click",(function(){var e=t.zoom();t.transition({zoom:e+1,ease:d.ease("cubic-in-out"),duration:500})})).on("mousedown",(function(){d.event.stopPropagation()})),y("M512 81.92c-237.568 0-430.080 192.614-430.080 430.080 0 237.568 192.563 430.080 430.080 430.080s430.080-192.563 430.080-430.080c0-237.517-192.563-430.080-430.080-430.080zM564.326 564.326v206.182h-104.653v-206.182h-206.234v-104.653h206.182v-206.234h104.704v206.182h206.182v104.704h-206.182z",a,i(0),o(0)-m+2,m+4).style("cursor","pointer").style("pointer-events","none").select("path").datum({fill:"black",stroke:null}),(s=e.append("g")).append("circle").datum({fill:"white",stroke:null}).classed("geo-zoom-out",!0).attr("cx",i(0)).attr("cy",o(1)+m-2).attr("r",(m-2)/2).style({cursor:"pointer"}).on("click",(function(){var e=t.zoom();t.transition({zoom:e-1,ease:d.ease("cubic-in-out"),duration:500})})).on("mousedown",(function(){d.event.stopPropagation()})),y("M512 81.92c-237.568 0-430.080 192.614-430.080 430.080 0 237.568 192.563 430.080 430.080 430.080s430.080-192.563 430.080-430.080c0-237.517-192.563-430.080-430.080-430.080zM770.56 459.674v104.704h-517.12v-104.704h517.12z",s,i(0),o(1)+m-2,m+4).style("cursor","pointer").style("pointer-events","none").select("path").datum({fill:"black",stroke:null}),e.append("rect").datum({fill:"white",stroke:"black"}).classed("geo-zoom-track",!0).attr("x",i(0)-m/6).attr("y",o(0)).attr("rx",m/10).attr("ry",m/10).attr("width",m/3).attr("height",g-3*m).style({cursor:"pointer"}).on("click",(function(){n(d.event,!0)})),l=e.append("rect").datum({fill:"black",stroke:null}).classed("geo-zoom-nub",!0).attr("x",i(-4)).attr("y",o(.5)-v/2).attr("rx",3).attr("ry",3).attr("width",m).attr("height",v).style({cursor:"pointer"}).on("mousedown",(function(){d.select(document).on("mousemove.geo.slider",(function(){n(d.event)})),d.select(document).on("mouseup.geo.slider",(function(){n(d.event),d.select(document).on(".geo.slider",null)})),d.event.stopPropagation()})),u.selectAll("*").on("mouseover",(function(){d.select(this).attr("filter","url(#geo-highlight)"),u.selectAll("rect,path,circle").transition().duration(100).style("fill",(function(e){return e.fill||null})).style("stroke",(function(e){return e.stroke||null}))})).on("mouseout",r),p.geoOn(f.zoom,p._update),r(),p._update(),p},this._exit=function(){p.geoOff(f.zoom,p._update),u.remove(),h()},this._update=function(e){var t=p.layer().map(),n=t.zoomRange(),r=t.zoom(),i=d.scale.linear();r=(e=e||{}).value||r,i.domain([n.min,n.max]).range([1,0]).clamp(!0),l.attr("y",o(i(r))-v/2)}};i(a,r),o("dom","slider",a),e.exports=a},9731:function(e,t,n){var r=n(8123),i=n(5699),o=n(4647).registerWidget,a=function e(t){"use strict";if(!(this instanceof e))return new e(t);r.call(this,t);var i=n(2531),o=this,a=this._exit,s=null;return this._init=function(){var e;return t.hasOwnProperty("parent")&&(t.parent.addChild(o),e=t.parent.canvas()),o._createCanvas(e),o.canvas().addEventListener("mousedown",(function(e){e.stopPropagation()})),o.reposition(),o},this._exit=function(){s&&s._exit(),a()},this._createCanvas=function(e){var t={layer:o.layer(),widget:!0};e&&(t.d3Parent=e),(s=i(t))._resize=function(){},o.canvas(s.canvas()[0][0])},this};i(a,r),o("dom","svg",a),e.exports=a},6408:function(e,t,n){var r=n(5699),i=n(4647).registerLayer,o=n(9105),a=function e(t){"use strict";var r=n(4647).createWidget;if(t.renderer="dom",t.sticky=!1,!(this instanceof e))return new e(t);o.call(this,t);var i=this,a=this._exit;this.createWidget=function(e,t){var n=r(e,i,t);return t&&"parent"in t||i.addChild(n),n._init(t),i.modified(),n},this.deleteWidget=function(e){return e._exit(),i.removeChild(e),i.modified(),i},this._exit=function(){i.children().forEach((function(e){i.deleteWidget(e)})),a()}};r(a,o),i("ui",a),e.exports=a},8123:function(e,t,n){var r=n(5699),i=n(5358),o=n(5638),a=function e(t){"use strict";if(!(this instanceof e))return new e(t);t=t||{},i.call(this,t);var r=n(5108),a=this,s=this._exit,l=t.layer,u=null,c=void 0===t.position?{left:0,top:0}:t.position;if(!(void 0===t.parent||t.parent instanceof e))throw new Error("Parent must be of type geo.gui.widget");t.parent&&a.parent(t.parent),this._init=function(){return a.modified(),a},this._exit=function(){if(a.children().forEach((function(e){a.removeChild(e),e._exit()})),a.layer().geoOff(r.pan,a.repositionEvent),a.parentCanvas().removeChild&&a.canvas())try{a.parentCanvas().removeChild(a.canvas())}catch(e){}s()},this.layer=function(){return l||a.parent()&&a.parent().layer()},this._createCanvas=function(){throw new Error("Must be defined in derived classes")},this.canvas=function(e){return void 0===e?u:(u=e,a)},this._appendCanvasToParent=function(){a.parentCanvas().appendChild(a.canvas())},this.parentCanvas=function(){return a.parent()?a.parent().canvas():a.layer().canvas()},this.position=function(e,t){if(void 0!==e){a.layer().geoOff(r.pan,a.repositionEvent);var n={};for(var i in c)c.hasOwnProperty(i)&&(n[i]=null);return(c=e).hasOwnProperty("x")&&c.hasOwnProperty("y")&&a.layer().geoOn(r.pan,a.repositionEvent),a.reposition(o.extend(n,a.position())),a}if(c.hasOwnProperty("x")&&c.hasOwnProperty("y")&&!t){var s=a.layer().map().gcsToDisplay(c);return{left:s.x,top:s.y,right:null,bottom:null}}return c},this.reposition=function(e){if(e=e||a.position(),a.canvas()&&a.canvas().style)for(var t in a.canvas().style.position="absolute",e)e.hasOwnProperty(t)&&(/^\s*(-|\+)?(\d+(\.\d*)?|\d*\.\d+)([eE](-|\+)?\d+)?\s*$/.test(e[t])?a.canvas().style[t]=parseFloat(parseFloat(e[t]).toFixed(3))+"px":a.canvas().style[t]=e[t]);return a},this.repositionEvent=function(){return a.reposition()},this.isInViewport=function(){var e=a.position(),t=a.layer();return e.left>=0&&e.top>=0&&e.left<=t.width()&&e.top<=t.height()},c.hasOwnProperty("x")&&c.hasOwnProperty("y")&&this.layer().geoOn(r.pan,a.repositionEvent)};r(a,i),e.exports=a},9808:function(e,t,n){var r=n(5638);function i(e,t,n){this._group=e,this._zoom=t,this._points=[],this._clusters=[],this._count=0,this._parent=null,this._coord=null;var r=this;(n||[]).forEach((function(e){r._add(e)}))}function o(e){var t,o,a=n(5844);for(this._opts=r.extend({maxZoom:18,radius:5},e),this._clusters={},this._points={},t=this._opts.maxZoom;t>=0;t-=1)o=this._opts.radius*Math.pow(2,-t),this._clusters[t]=new a(o),this._points[t]=new a(o);this._topClusterLevel=new i(this,-1)}i.prototype._add=function(e){var t=1;e instanceof i?(this._clusters.push(e),t=e._count):this._points.push(e),e._parent=this,this._increment(t)},i.prototype._increment=function(e){this._coord=null,this._count+=e,this._parent&&this._parent._increment(e)},i.prototype.count=function(){return this._count},i.prototype.each=function(e){var t;for(t=0;t=0;t-=1){if(n=this._clusters[t].getNearObject(e))return void n._add(e);if(n=this._points[t].getNearObject(e)){if(o=n._parent)for(l=o._points.length-1;l>=0;l-=1)if(o._points[l]===n){o._points.splice(l,1),o._increment(-1);break}for(o||r.noop(),a=new i(this,t,[n,e]),this._clusters[t].addObject(a,a.coords()),s=a,l=t-1;l>o._zoom;l-=1)s=new i(this,l,[s]),this._clusters[l].addObject(s,s.coords());for(o._add(s),l=t;l>=0&&this._points[l].removeObject(n,n);l-=1);return}this._points[t].addObject(e,e)}this._topClusterLevel._add(e)},o.prototype.points=function(e){return e=Math.min(Math.max(Math.floor(e),0),this._opts.maxZoom-1),this._points[Math.floor(e)].contents()},o.prototype.clusters=function(e){return e=Math.min(Math.max(Math.floor(e),0),this._opts.maxZoom-1),this._clusters[Math.floor(e)].contents()},e.exports=o},7566:function(e,t,n){var r=n(8340),i=n(9552),o={maxCount:1e3,count:0,memo:{}};function a(e,t){return o.count+=1,o.count>=o.maxCount&&(o.memo={},o.count=0),o.memo[e]=t,t}var s={convertColor:function(e){if(null==e||void 0!==e.r&&void 0!==e.g&&void 0!==e.b)return e;if(void 0!==o.memo[e])return o.memo[e];var t,n=e;if("string"==typeof e){var r=e.toLowerCase();if(i.hasOwnProperty(r))e={r:i[r][0]/255,g:i[r][1]/255,b:i[r][2]/255};else if("#"===e.charAt(0))4===e.length||5===e.length?(5===e.length&&(t=parseInt(e.slice(4),16)/15),e=4352*(3840&(e=parseInt(e.slice(1,4),16)))+272*(240&e)+17*(15&e)):7!==e.length&&9!==e.length||(9===e.length&&(t=parseInt(e.slice(7),16)/255),e=parseInt(e.slice(1,7),16));else if("transparent"===r)t=e=0;else if(r.indexOf("(")>=0)for(var l=0;l>16)/255,g:((65280&e)>>8)/255,b:(255&e)/255}),void 0!==t&&e&&void 0!==e.r&&(e.a=t),a(n,e)},convertColorAndOpacity:function(e,t,n){return(e=s.convertColor(e))&&void 0!==e.r&&void 0!==e.g&&void 0!==e.b||(e=s.convertColor(n||{r:0,g:0,b:0})),e&&void 0!==e.r&&void 0!==e.g&&void 0!==e.b||(e={r:0,g:0,b:0}),e={r:isFinite(e.r)&&e.r>=0?e.r<=1?+e.r:1:0,g:isFinite(e.g)&&e.g>=0?e.g<=1?+e.g:1:0,b:isFinite(e.b)&&e.b>=0?e.b<=1?+e.b:1:0,a:r.isNonNullFinite(e.a)&&e.a>=0&&e.a<1?+e.a:1},r.isNonNullFinite(t)&&t<1&&(e.a=t<=0?0:e.a*t),e},convertColorToHex:function(e,t){var n,r=s.convertColor(e);return n=r.r||r.g||r.b?"#"+((1<<24)+(Math.round(255*r.r)<<16)+(Math.round(255*r.g)<<8)+Math.round(255*r.b)).toString(16).slice(1):"#000000",void 0!==r.a&&t&&(r.a<1||"needed"!==t)&&(n+=(256+Math.round(255*r.a)).toString(16).slice(1)),n},convertColorToRGBA:function(e){var t=s.convertColor(e);return t||(t={r:0,g:0,b:0}),(!r.isNonNullFinite(t.a)||t.a>1)&&(t.a=1),"rgba("+Math.round(255*t.r)+", "+Math.round(255*t.g)+", "+Math.round(255*t.b)+", "+ +(+t.a).toFixed(5)+")"},cssAngleUnitsBase:{deg:360,grad:400,rad:2*Math.PI,turn:1},cssNumberRegex:"[+-]?(?:\\d+\\.?\\d*|\\.\\d+)(?:[eE][+-]?\\d+)?"};s.cssColorConversions=[{name:"rgb",regex:new RegExp("^\\s*rgba?\\(\\s*("+s.cssNumberRegex+")\\s*(%?)\\s*,?\\s*("+s.cssNumberRegex+")\\s*(%?)\\s*,?\\s*("+s.cssNumberRegex+")\\s*(%?)\\s*([/,]?\\s*("+s.cssNumberRegex+")\\s*(%?)\\s*)?\\)\\s*$"),process:function(e,t){return e={r:Math.min(1,Math.max(0,+t[1]/(t[2]?100:255))),g:Math.min(1,Math.max(0,+t[3]/(t[4]?100:255))),b:Math.min(1,Math.max(0,+t[5]/(t[6]?100:255)))},t[7]&&(e.a=Math.min(1,Math.max(0,+t[8]/(t[9]?100:1)))),e}},{name:"hsl",regex:new RegExp("^\\s*hsla?\\(\\s*("+s.cssNumberRegex+")\\s*(deg|grad|rad|turn)?\\s*,?\\s*("+s.cssNumberRegex+")\\s*%\\s*,?\\s*("+s.cssNumberRegex+")\\s*%\\s*([/,]?\\s*("+s.cssNumberRegex+")\\s*(%?)\\s*)?\\)\\s*$"),process:function(e,t){var n=function(e,t,n){return 6*(n-=Math.floor(n))<1?e+(t-e)*n*6:6*n<3?t:6*n<4?e+(t-e)*(2/3-n)*6:e},r=+t[1]/(s.cssAngleUnitsBase[t[2]]||360),i=Math.min(1,Math.max(0,+t[3]/100)),o=Math.min(1,Math.max(0,+t[4]/100)),a=o<=.5?o*(i+1):o+i-o*i,l=2*o-a;return e={r:n(l,a,r+1/3),g:n(l,a,r),b:n(l,a,r-1/3)},t[5]&&(e.a=Math.min(1,Math.max(0,+t[6]/(t[7]?100:1)))),e}}],e.exports=s},8340:function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var i=n(5638),o=n(4252);o=o.__esModule?o.default:o;var a,s,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",u='',c={},d=200,f=15;function p(){var e;for(e=0;er.max.x||e.y>r.max.y))&&h.distanceToPolygon2d(e,n?{outer:t,inner:n}:t,!0)>0)},pointToTriangleBasis2d:function(e,t,n,r){var i=n.x-t.x,o=r.x-t.x,a=n.y-t.y,s=r.y-t.y,l=e.x-t.x,u=e.y-t.y,c=i*s-o*a;if(c)return{x:(l*s-u*o)/c,y:(l*-a+u*i)/c}},isReadyImage:function(e,t){return!!(e instanceof Image&&e.complete&&e.src&&(e.naturalWidth&&e.naturalHeight||t))},isReadyVideo:function(e,t){return!!(e instanceof HTMLVideoElement&&e.src&&void 0!==e.HAVE_CURRENT_DATA&&(e.videoWidth&&e.videoHeight&&e.readyState>=e.HAVE_CURRENT_DATA||t&&e.error))},isFunction:function(e){return"function"==typeof e},ensureFunction:function(e){return h.isFunction(e)?e:function(){return e}},isNonNullFinite:function(e){return isFinite(e)&&null!==e&&!1!==e&&""!==e},randomString:function(e){var t,n,r;for(e=e||8,t="",n=0;n=n&&a.length<=s))return a;var l=n;return a instanceof Float32Array&&a.length&&n&&i>0&&(l=Math.floor((i+1)*n)),a=new Float32Array(l),o.setData(a),a},adjustActions:function(e){var t,n;for(n=0;ne.y!=d.y>e.y&&e.x<(d.x-c.x)*(e.y-c.y)/(d.y-c.y)+c.x&&(a=!a),i=n?1:h.distance2dToLineSquared(e,c,d),(void 0===r||i0&&(a=!a)})),(a?1:-1)*Math.sqrt(r)},triangleTwiceSignedArea2d:function(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)},crossedLineSegmentPolygon2d:function(e,t,n){var r,i,o=n.outer||n,a=o.length;for(r=0,i=a-1;rn.x&&e.x>r.x&&t.x>n.x&&t.x>r.x||e.xn.y&&e.y>r.y&&t.y>n.y&&t.y>r.y||e.y0||h.triangleTwiceSignedArea2d(n,r,e)*h.triangleTwiceSignedArea2d(n,r,t)>0))},segmentCrossesLineList2d:function(e,t,n){return n.some((function(n){return n.some((function(r,i){return!!i&&h.crossedLineSegments2d(e,t,n[i-1],r)}))}))},rdpLineSimplify:function(e,t,n,r){if(e.length<=2||t<0)return e;var i,o,a,s=-1,l=t*t;if(n){for(i=1;is&&(s=o,a=i);return 4*s<=l?e.slice(a,a+1):(e=e.slice(a).concat(e.slice(0,a+1)),(e=h.rdpLineSimplify(e,t,!1,r)).splice(e.length-1),e)}for(i=1;is&&(s=o,a=i);if(s<=l&&(!r||!h.segmentCrossesLineList2d(e[0],e[e.length-1],r)))return[e[0],e[e.length-1]];var u=e.slice(0,a+1),c=e.slice(a),d=h.rdpLineSimplify(u,t,!1,r?r.concat([c]):null),f=h.rdpLineSimplify(c,t,!1,r?r.concat([u]):null);return d.slice(0,d.length-1).concat(f)},getMinMaxValues:function(e,t,n,r){if(e.length&&(r||!i.isNumeric(t)||!i.isNumeric(n))){var o,a,s=e[0],l=e[0];for(a=e.length-1;a>0;a-=1)(o=e[a])l&&(l=o);(!i.isNumeric(t)||r&&s>t)&&(t=s),(!i.isNumeric(n)||r&&l=Math.PI&&(e-=2*Math.PI),e},escapeUnicodeHTML:function(e){return e.replace(/./g,(function(e){var t=e.charCodeAt(0);return t<127?e:"&#"+t.toString(10)+";"}))},dereferenceElements:function(e){var t=[];return i("img,image",e).each((function(){var e=i(this),n=e.is("image")?"href":"src";if(e.attr(n)){var r=new Image;("http"===e.attr(n).substr(0,4)||e[0].crossOrigin)&&(r.crossOrigin=e[0].crossOrigin||"anonymous");var o=i.Deferred();r.onload=function(){var t=document.createElement("canvas");t.width=r.naturalWidth,t.height=r.naturalHeight,t.getContext("2d").drawImage(r,0,0),e.attr(n,t.toDataURL("image/png")),"data:image"!==e.attr(n).substr(0,10)&&e.remove(),o.resolve()},r.onerror=function(){e.remove(),o.resolve()},r.src=e.attr(n),t.push(o)}})),t},dereferenceCssUrlsRegex:/url\(["']?(http[^)"']+|[^:)"']+)["']?\)/g,dereferenceCssUrls:function(e,t,n,r,o){var a=[],s=[];if(e=(e=e.replace(/\/\*[^\0]*?\*\//g,"")).replace(/\r/g,"\n").replace(/\s+\n/g,"\n").replace(/\n\s+/g,"\n").replace(/\n\n+/g,"\n"),o){var l=/(^[^?#]*)\/[^?#/]*([?#]|$)/g.exec(o);o=l&&l[1]?l[1]+"/":null}e.replace(h.dereferenceCssUrlsRegex,(function(e,t){var n=a.length,r=i.Deferred(),l=new XMLHttpRequest;return a.push(r),s.push(""),/^[^/:][^:]*(\/|$)/g.exec(t)&&o&&(t=o+t),l.open("GET",t,!0),l.responseType="arraybuffer",l.onload=function(){if(200===this.status){var e,t=new Uint8Array(this.response),i=new Array(t.length);for(e=0;e");var n=new Image;return n.onload=n.onerror=function(){var t=document.createElement("canvas");t.width=10,t.height=10,t.getContext("2d").drawImage(n,0,0);try{t.toDataURL(),s=!0}catch(e){console.warn("This browser does not support converting HTML to an image via SVG foreignObject. Some functionality will be limited.",e),s=!1}e.resolve(s)},n.src="data:image/svg+xml;base64,"+btoa(h.escapeUnicodeHTML((new XMLSerializer).serializeToString(t[0]))),e}return s},htmlToImage:function(e,t){var n,r=i.Deferred(),o=[h.htmlToImageSupported()],a=i(e);for(e=i(e).clone();t&&t>0;)(a=a.parent()).is("div")&&((n=i("
").attr({class:a.attr("class"),id:a.attr("id")}).css({width:"100%",height:"100%",background:"none",margin:0})).append(e),e=n),t-=1;i("canvas",e).remove(),i("*",e).addBack().each((function(){for(var e=this.style,t=0;t')).css({width:a.width()+"px",height:a.height()+"px"}),n.append(i(""));var s=i("");return n.append(s),s.css({width:a.width()+"px",height:a.height()+"px",background:"none",margin:0}),s.append(e),o=o.concat(h.dereferenceElements(e)),i('style,link[rel="stylesheet"]').each((function(){var e=i('