@ulb-darmstadt/shacl-form
Version:
SHACL form generator
2 lines • 1.53 MB
JavaScript
/*! For license information please see mapbox.js.LICENSE.txt */
var e={3188:function(e,t,i){e.exports=function(){var e=function(e,t){var i={drag:[],click:[],mousemove:[],mousedown:[],mouseup:[],mouseout:[],keydown:[],keyup:[],touchstart:[],touchmove:[],touchend:[],tap:[]},r={on:function(e,t,r){if(void 0===i[e])throw new Error("Invalid event type: "+e);i[e].push({selector:t,fn:r})},render:function(e){t.store.featureChanged(e)}},n=function(e,n){for(var o=i[e],s=o.length;s--;){var a=o[s];if(a.selector(n)){a.fn.call(r,n)||t.store.render(),t.ui.updateMapClasses();break}}};return e.start.call(r),{render:e.render,stop:function(){e.stop&&e.stop()},trash:function(){e.trash&&(e.trash(),t.store.render())},combineFeatures:function(){e.combineFeatures&&e.combineFeatures()},uncombineFeatures:function(){e.uncombineFeatures&&e.uncombineFeatures()},drag:function(e){n("drag",e)},click:function(e){n("click",e)},mousemove:function(e){n("mousemove",e)},mousedown:function(e){n("mousedown",e)},mouseup:function(e){n("mouseup",e)},mouseout:function(e){n("mouseout",e)},keydown:function(e){n("keydown",e)},keyup:function(e){n("keyup",e)},touchstart:function(e){n("touchstart",e)},touchmove:function(e){n("touchmove",e)},touchend:function(e){n("touchend",e)},tap:function(e){n("tap",e)}}};function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var r={},n=6378137;function o(e){var t=0;if(e&&e.length>0){t+=Math.abs(s(e[0]));for(var i=1;i<e.length;i++)t-=Math.abs(s(e[i]))}return t}function s(e){var t,i,r,o,s,l,c=0,u=e.length;if(u>2){for(l=0;l<u;l++)l===u-2?(r=u-2,o=u-1,s=0):l===u-1?(r=u-1,o=0,s=1):(r=l,o=l+1,s=l+2),t=e[r],i=e[o],c+=(a(e[s][0])-a(t[0]))*Math.sin(a(i[1]));c=c*n*n/2}return c}function a(e){return e*Math.PI/180}r.geometry=function e(t){var i,r=0;switch(t.type){case"Polygon":return o(t.coordinates);case"MultiPolygon":for(i=0;i<t.coordinates.length;i++)r+=o(t.coordinates[i]);return r;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(i=0;i<t.geometries.length;i++)r+=e(t.geometries[i]);return r}},r.ring=s;var l={CONTROL_BASE:"mapboxgl-ctrl",CONTROL_PREFIX:"mapboxgl-ctrl-",CONTROL_BUTTON:"mapbox-gl-draw_ctrl-draw-btn",CONTROL_BUTTON_LINE:"mapbox-gl-draw_line",CONTROL_BUTTON_POLYGON:"mapbox-gl-draw_polygon",CONTROL_BUTTON_POINT:"mapbox-gl-draw_point",CONTROL_BUTTON_TRASH:"mapbox-gl-draw_trash",CONTROL_BUTTON_COMBINE_FEATURES:"mapbox-gl-draw_combine",CONTROL_BUTTON_UNCOMBINE_FEATURES:"mapbox-gl-draw_uncombine",CONTROL_GROUP:"mapboxgl-ctrl-group",ATTRIBUTION:"mapboxgl-ctrl-attrib",ACTIVE_BUTTON:"active",BOX_SELECT:"mapbox-gl-draw_boxselect"},c={HOT:"mapbox-gl-draw-hot",COLD:"mapbox-gl-draw-cold"},u={ADD:"add",MOVE:"move",DRAG:"drag",POINTER:"pointer",NONE:"none"},h={POLYGON:"polygon",LINE:"line_string",POINT:"point"},d={FEATURE:"Feature",POLYGON:"Polygon",LINE_STRING:"LineString",POINT:"Point",FEATURE_COLLECTION:"FeatureCollection",MULTI_PREFIX:"Multi",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon"},p={DRAW_LINE_STRING:"draw_line_string",DRAW_POLYGON:"draw_polygon",DRAW_POINT:"draw_point",SIMPLE_SELECT:"simple_select",DIRECT_SELECT:"direct_select",STATIC:"static"},f={CREATE:"draw.create",DELETE:"draw.delete",UPDATE:"draw.update",SELECTION_CHANGE:"draw.selectionchange",MODE_CHANGE:"draw.modechange",ACTIONABLE:"draw.actionable",RENDER:"draw.render",COMBINE_FEATURES:"draw.combine",UNCOMBINE_FEATURES:"draw.uncombine"},m={MOVE:"move",CHANGE_COORDINATES:"change_coordinates"},_={FEATURE:"feature",MIDPOINT:"midpoint",VERTEX:"vertex"},g={ACTIVE:"true",INACTIVE:"false"},y=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate"],x=Object.freeze({__proto__:null,classes:l,sources:c,cursors:u,types:h,geojsonTypes:d,modes:p,events:f,updateActions:m,meta:_,activeStates:g,interactions:y,LAT_MIN:-90,LAT_RENDERED_MIN:-85,LAT_MAX:90,LAT_RENDERED_MAX:85,LNG_MIN:-270,LNG_MAX:270}),v={Point:0,LineString:1,MultiLineString:1,Polygon:2};function b(e,t){var i=v[e.geometry.type]-v[t.geometry.type];return 0===i&&e.geometry.type===d.POLYGON?e.area-t.area:i}function w(e){return e.map((function(e){return e.geometry.type===d.POLYGON&&(e.area=r.geometry({type:d.FEATURE,property:{},geometry:e.geometry})),e})).sort(b).map((function(e){return delete e.area,e}))}function T(e,t){return void 0===t&&(t=0),[[e.point.x-t,e.point.y-t],[e.point.x+t,e.point.y+t]]}function E(e){if(this._items={},this._nums={},this._length=e?e.length:0,e)for(var t=0,i=e.length;t<i;t++)this.add(e[t]),void 0!==e[t]&&("string"==typeof e[t]?this._items[e[t]]=t:this._nums[e[t]]=t)}E.prototype.add=function(e){return this.has(e)||(this._length++,"string"==typeof e?this._items[e]=this._length:this._nums[e]=this._length),this},E.prototype.delete=function(e){return!1===this.has(e)||(this._length--,delete this._items[e],delete this._nums[e]),this},E.prototype.has=function(e){return!("string"!=typeof e&&"number"!=typeof e||void 0===this._items[e]&&void 0===this._nums[e])},E.prototype.values=function(){var e=this,t=[];return Object.keys(this._items).forEach((function(i){t.push({k:i,v:e._items[i]})})),Object.keys(this._nums).forEach((function(i){t.push({k:JSON.parse(i),v:e._nums[i]})})),t.sort((function(e,t){return e.v-t.v})).map((function(e){return e.k}))},E.prototype.clear=function(){return this._length=0,this._items={},this._nums={},this};var M=[_.FEATURE,_.MIDPOINT,_.VERTEX],S={click:function(e,t,i){return I(e,t,i,i.options.clickBuffer)},touch:function(e,t,i){return I(e,t,i,i.options.touchBuffer)}};function I(e,t,i,r){if(null===i.map)return[];var n=e?T(e,r):t,o={};i.options.styles&&(o.layers=i.options.styles.map((function(e){return e.id})).filter((function(e){return null!=i.map.getLayer(e)})));var s=i.map.queryRenderedFeatures(n,o).filter((function(e){return-1!==M.indexOf(e.properties.meta)})),a=new E,l=[];return s.forEach((function(e){var t=e.properties.id;a.has(t)||(a.add(t),l.push(e))})),w(l)}function A(e,t){var i=S.click(e,null,t),r={mouse:u.NONE};return i[0]&&(r.mouse=i[0].properties.active===g.ACTIVE?u.MOVE:u.POINTER,r.feature=i[0].properties.meta),-1!==t.events.currentModeName().indexOf("draw")&&(r.mouse=u.ADD),t.ui.queueMapClasses(r),t.ui.updateMapClasses(),i[0]}function C(e,t){var i=e.x-t.x,r=e.y-t.y;return Math.sqrt(i*i+r*r)}function P(e,t,i){void 0===i&&(i={});var r=null!=i.fineTolerance?i.fineTolerance:4,n=null!=i.grossTolerance?i.grossTolerance:12,o=null!=i.interval?i.interval:500;e.point=e.point||t.point,e.time=e.time||t.time;var s=C(e.point,t.point);return s<r||s<n&&t.time-e.time<o}function z(e,t,i){void 0===i&&(i={});var r=null!=i.tolerance?i.tolerance:25,n=null!=i.interval?i.interval:250;return e.point=e.point||t.point,e.time=e.time||t.time,C(e.point,t.point)<r&&t.time-e.time<n}var L={exports:{}},D=L.exports=function(e,t){if(t||(t=16),void 0===e&&(e=128),e<=0)return"0";for(var i=Math.log(Math.pow(2,e))/Math.log(t),r=2;i===1/0;r*=2)i=Math.log(Math.pow(2,e/r))/Math.log(t)*r;var n=i-Math.floor(i),o="";for(r=0;r<Math.floor(i);r++)o=Math.floor(Math.random()*t).toString(t)+o;if(n){var s=Math.pow(t,n);o=Math.floor(Math.random()*s).toString(t)+o}var a=parseInt(o,t);return a!==1/0&&a>=Math.pow(2,e)?D(e,t):o};D.rack=function(e,t,i){var r=function(r){var o=0;do{if(o++>10){if(!i)throw new Error("too many ID collisions, use more bits");e+=i}var s=D(e,t)}while(Object.hasOwnProperty.call(n,s));return n[s]=r,s},n=r.hats={};return r.get=function(e){return r.hats[e]},r.set=function(e,t){return r.hats[e]=t,r},r.bits=e||128,r.base=t||16,r};var R=t(L.exports),k=function(e,t){this.ctx=e,this.properties=t.properties||{},this.coordinates=t.geometry.coordinates,this.id=t.id||R(),this.type=t.geometry.type};k.prototype.changed=function(){this.ctx.store.featureChanged(this.id)},k.prototype.incomingCoords=function(e){this.setCoordinates(e)},k.prototype.setCoordinates=function(e){this.coordinates=e,this.changed()},k.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.coordinates))},k.prototype.setProperty=function(e,t){this.properties[e]=t},k.prototype.toGeoJSON=function(){return JSON.parse(JSON.stringify({id:this.id,type:d.FEATURE,properties:this.properties,geometry:{coordinates:this.getCoordinates(),type:this.type}}))},k.prototype.internal=function(e){var t={id:this.id,meta:_.FEATURE,"meta:type":this.type,active:g.INACTIVE,mode:e};if(this.ctx.options.userProperties)for(var i in this.properties)t["user_"+i]=this.properties[i];return{type:d.FEATURE,properties:t,geometry:{coordinates:this.getCoordinates(),type:this.type}}};var O=function(e,t){k.call(this,e,t)};(O.prototype=Object.create(k.prototype)).isValid=function(){return"number"==typeof this.coordinates[0]&&"number"==typeof this.coordinates[1]},O.prototype.updateCoordinate=function(e,t,i){this.coordinates=3===arguments.length?[t,i]:[e,t],this.changed()},O.prototype.getCoordinate=function(){return this.getCoordinates()};var F=function(e,t){k.call(this,e,t)};(F.prototype=Object.create(k.prototype)).isValid=function(){return this.coordinates.length>1},F.prototype.addCoordinate=function(e,t,i){this.changed();var r=parseInt(e,10);this.coordinates.splice(r,0,[t,i])},F.prototype.getCoordinate=function(e){var t=parseInt(e,10);return JSON.parse(JSON.stringify(this.coordinates[t]))},F.prototype.removeCoordinate=function(e){this.changed(),this.coordinates.splice(parseInt(e,10),1)},F.prototype.updateCoordinate=function(e,t,i){var r=parseInt(e,10);this.coordinates[r]=[t,i],this.changed()};var B=function(e,t){k.call(this,e,t),this.coordinates=this.coordinates.map((function(e){return e.slice(0,-1)}))};(B.prototype=Object.create(k.prototype)).isValid=function(){return 0!==this.coordinates.length&&this.coordinates.every((function(e){return e.length>2}))},B.prototype.incomingCoords=function(e){this.coordinates=e.map((function(e){return e.slice(0,-1)})),this.changed()},B.prototype.setCoordinates=function(e){this.coordinates=e,this.changed()},B.prototype.addCoordinate=function(e,t,i){this.changed();var r=e.split(".").map((function(e){return parseInt(e,10)}));this.coordinates[r[0]].splice(r[1],0,[t,i])},B.prototype.removeCoordinate=function(e){this.changed();var t=e.split(".").map((function(e){return parseInt(e,10)})),i=this.coordinates[t[0]];i&&(i.splice(t[1],1),i.length<3&&this.coordinates.splice(t[0],1))},B.prototype.getCoordinate=function(e){var t=e.split(".").map((function(e){return parseInt(e,10)})),i=this.coordinates[t[0]];return JSON.parse(JSON.stringify(i[t[1]]))},B.prototype.getCoordinates=function(){return this.coordinates.map((function(e){return e.concat([e[0]])}))},B.prototype.updateCoordinate=function(e,t,i){this.changed();var r=e.split("."),n=parseInt(r[0],10),o=parseInt(r[1],10);void 0===this.coordinates[n]&&(this.coordinates[n]=[]),this.coordinates[n][o]=[t,i]};var N={MultiPoint:O,MultiLineString:F,MultiPolygon:B},V=function(e,t,i,r,n){var o=i.split("."),s=parseInt(o[0],10),a=o[1]?o.slice(1).join("."):null;return e[s][t](a,r,n)},U=function(e,t){if(k.call(this,e,t),delete this.coordinates,this.model=N[t.geometry.type],void 0===this.model)throw new TypeError(t.geometry.type+" is not a valid type");this.features=this._coordinatesToFeatures(t.geometry.coordinates)};function j(e){this.map=e.map,this.drawConfig=JSON.parse(JSON.stringify(e.options||{})),this._ctx=e}(U.prototype=Object.create(k.prototype))._coordinatesToFeatures=function(e){var t=this,i=this.model.bind(this);return e.map((function(e){return new i(t.ctx,{id:R(),type:d.FEATURE,properties:{},geometry:{coordinates:e,type:t.type.replace("Multi","")}})}))},U.prototype.isValid=function(){return this.features.every((function(e){return e.isValid()}))},U.prototype.setCoordinates=function(e){this.features=this._coordinatesToFeatures(e),this.changed()},U.prototype.getCoordinate=function(e){return V(this.features,"getCoordinate",e)},U.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.features.map((function(e){return e.type===d.POLYGON?e.getCoordinates():e.coordinates}))))},U.prototype.updateCoordinate=function(e,t,i){V(this.features,"updateCoordinate",e,t,i),this.changed()},U.prototype.addCoordinate=function(e,t,i){V(this.features,"addCoordinate",e,t,i),this.changed()},U.prototype.removeCoordinate=function(e){V(this.features,"removeCoordinate",e),this.changed()},U.prototype.getFeatures=function(){return this.features},j.prototype.setSelected=function(e){return this._ctx.store.setSelected(e)},j.prototype.setSelectedCoordinates=function(e){var t=this;this._ctx.store.setSelectedCoordinates(e),e.reduce((function(e,i){return void 0===e[i.feature_id]&&(e[i.feature_id]=!0,t._ctx.store.get(i.feature_id).changed()),e}),{})},j.prototype.getSelected=function(){return this._ctx.store.getSelected()},j.prototype.getSelectedIds=function(){return this._ctx.store.getSelectedIds()},j.prototype.isSelected=function(e){return this._ctx.store.isSelected(e)},j.prototype.getFeature=function(e){return this._ctx.store.get(e)},j.prototype.select=function(e){return this._ctx.store.select(e)},j.prototype.deselect=function(e){return this._ctx.store.deselect(e)},j.prototype.deleteFeature=function(e,t){return void 0===t&&(t={}),this._ctx.store.delete(e,t)},j.prototype.addFeature=function(e){return this._ctx.store.add(e)},j.prototype.clearSelectedFeatures=function(){return this._ctx.store.clearSelected()},j.prototype.clearSelectedCoordinates=function(){return this._ctx.store.clearSelectedCoordinates()},j.prototype.setActionableState=function(e){void 0===e&&(e={});var t={trash:e.trash||!1,combineFeatures:e.combineFeatures||!1,uncombineFeatures:e.uncombineFeatures||!1};return this._ctx.events.actionable(t)},j.prototype.changeMode=function(e,t,i){return void 0===t&&(t={}),void 0===i&&(i={}),this._ctx.events.changeMode(e,t,i)},j.prototype.updateUIClasses=function(e){return this._ctx.ui.queueMapClasses(e)},j.prototype.activateUIButton=function(e){return this._ctx.ui.setActiveButton(e)},j.prototype.featuresAt=function(e,t,i){if(void 0===i&&(i="click"),"click"!==i&&"touch"!==i)throw new Error("invalid buffer type");return S[i](e,t,this._ctx)},j.prototype.newFeature=function(e){var t=e.geometry.type;return t===d.POINT?new O(this._ctx,e):t===d.LINE_STRING?new F(this._ctx,e):t===d.POLYGON?new B(this._ctx,e):new U(this._ctx,e)},j.prototype.isInstanceOf=function(e,t){if(e===d.POINT)return t instanceof O;if(e===d.LINE_STRING)return t instanceof F;if(e===d.POLYGON)return t instanceof B;if("MultiFeature"===e)return t instanceof U;throw new Error("Unknown feature class: "+e)},j.prototype.doRender=function(e){return this._ctx.store.featureChanged(e)},j.prototype.onSetup=function(){},j.prototype.onDrag=function(){},j.prototype.onClick=function(){},j.prototype.onMouseMove=function(){},j.prototype.onMouseDown=function(){},j.prototype.onMouseUp=function(){},j.prototype.onMouseOut=function(){},j.prototype.onKeyUp=function(){},j.prototype.onKeyDown=function(){},j.prototype.onTouchStart=function(){},j.prototype.onTouchMove=function(){},j.prototype.onTouchEnd=function(){},j.prototype.onTap=function(){},j.prototype.onStop=function(){},j.prototype.onTrash=function(){},j.prototype.onCombineFeature=function(){},j.prototype.onUncombineFeature=function(){},j.prototype.toDisplayFeatures=function(){throw new Error("You must overwrite toDisplayFeatures")};var G={drag:"onDrag",click:"onClick",mousemove:"onMouseMove",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseout:"onMouseOut",keyup:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",tap:"onTap"},$=Object.keys(G);function q(e){return[].concat(e).filter((function(e){return void 0!==e}))}function Z(){var e=this;if(!e.ctx.map||void 0===e.ctx.map.getSource(c.HOT))return l();var t=e.ctx.events.currentModeName();e.ctx.ui.queueMapClasses({mode:t});var i=[],r=[];e.isDirty?r=e.getAllIds():(i=e.getChangedIds().filter((function(t){return void 0!==e.get(t)})),r=e.sources.hot.filter((function(t){return t.properties.id&&-1===i.indexOf(t.properties.id)&&void 0!==e.get(t.properties.id)})).map((function(e){return e.properties.id}))),e.sources.hot=[];var n=e.sources.cold.length;e.sources.cold=e.isDirty?[]:e.sources.cold.filter((function(e){var t=e.properties.id||e.properties.parent;return-1===i.indexOf(t)}));var o=n!==e.sources.cold.length||r.length>0;function s(i,r){var n=e.get(i).internal(t);e.ctx.events.currentModeRender(n,(function(t){e.sources[r].push(t)}))}if(i.forEach((function(e){return s(e,"hot")})),r.forEach((function(e){return s(e,"cold")})),o&&e.ctx.map.getSource(c.COLD).setData({type:d.FEATURE_COLLECTION,features:e.sources.cold}),e.ctx.map.getSource(c.HOT).setData({type:d.FEATURE_COLLECTION,features:e.sources.hot}),e._emitSelectionChange&&(e.ctx.map.fire(f.SELECTION_CHANGE,{features:e.getSelected().map((function(e){return e.toGeoJSON()})),points:e.getSelectedCoordinates().map((function(e){return{type:d.FEATURE,properties:{},geometry:{type:d.POINT,coordinates:e.coordinates}}}))}),e._emitSelectionChange=!1),e._deletedFeaturesToEmit.length){var a=e._deletedFeaturesToEmit.map((function(e){return e.toGeoJSON()}));e._deletedFeaturesToEmit=[],e.ctx.map.fire(f.DELETE,{features:a})}function l(){e.isDirty=!1,e.clearChangedIds()}l(),e.ctx.map.fire(f.RENDER,{})}function W(e){var t,i=this;this._features={},this._featureIds=new E,this._selectedFeatureIds=new E,this._selectedCoordinates=[],this._changedFeatureIds=new E,this._deletedFeaturesToEmit=[],this._emitSelectionChange=!1,this._mapInitialConfig={},this.ctx=e,this.sources={hot:[],cold:[]},this.render=function(){t||(t=requestAnimationFrame((function(){t=null,Z.call(i)})))},this.isDirty=!1}function H(e,t){var i=e._selectedCoordinates.filter((function(t){return e._selectedFeatureIds.has(t.feature_id)}));e._selectedCoordinates.length===i.length||t.silent||(e._emitSelectionChange=!0),e._selectedCoordinates=i}W.prototype.createRenderBatch=function(){var e=this,t=this.render,i=0;return this.render=function(){i++},function(){e.render=t,i>0&&e.render()}},W.prototype.setDirty=function(){return this.isDirty=!0,this},W.prototype.featureChanged=function(e){return this._changedFeatureIds.add(e),this},W.prototype.getChangedIds=function(){return this._changedFeatureIds.values()},W.prototype.clearChangedIds=function(){return this._changedFeatureIds.clear(),this},W.prototype.getAllIds=function(){return this._featureIds.values()},W.prototype.add=function(e){return this.featureChanged(e.id),this._features[e.id]=e,this._featureIds.add(e.id),this},W.prototype.delete=function(e,t){var i=this;return void 0===t&&(t={}),q(e).forEach((function(e){i._featureIds.has(e)&&(i._featureIds.delete(e),i._selectedFeatureIds.delete(e),t.silent||-1===i._deletedFeaturesToEmit.indexOf(i._features[e])&&i._deletedFeaturesToEmit.push(i._features[e]),delete i._features[e],i.isDirty=!0)})),H(this,t),this},W.prototype.get=function(e){return this._features[e]},W.prototype.getAll=function(){var e=this;return Object.keys(this._features).map((function(t){return e._features[t]}))},W.prototype.select=function(e,t){var i=this;return void 0===t&&(t={}),q(e).forEach((function(e){i._selectedFeatureIds.has(e)||(i._selectedFeatureIds.add(e),i._changedFeatureIds.add(e),t.silent||(i._emitSelectionChange=!0))})),this},W.prototype.deselect=function(e,t){var i=this;return void 0===t&&(t={}),q(e).forEach((function(e){i._selectedFeatureIds.has(e)&&(i._selectedFeatureIds.delete(e),i._changedFeatureIds.add(e),t.silent||(i._emitSelectionChange=!0))})),H(this,t),this},W.prototype.clearSelected=function(e){return void 0===e&&(e={}),this.deselect(this._selectedFeatureIds.values(),{silent:e.silent}),this},W.prototype.setSelected=function(e,t){var i=this;return void 0===t&&(t={}),e=q(e),this.deselect(this._selectedFeatureIds.values().filter((function(t){return-1===e.indexOf(t)})),{silent:t.silent}),this.select(e.filter((function(e){return!i._selectedFeatureIds.has(e)})),{silent:t.silent}),this},W.prototype.setSelectedCoordinates=function(e){return this._selectedCoordinates=e,this._emitSelectionChange=!0,this},W.prototype.clearSelectedCoordinates=function(){return this._selectedCoordinates=[],this._emitSelectionChange=!0,this},W.prototype.getSelectedIds=function(){return this._selectedFeatureIds.values()},W.prototype.getSelected=function(){var e=this;return this._selectedFeatureIds.values().map((function(t){return e.get(t)}))},W.prototype.getSelectedCoordinates=function(){var e=this;return this._selectedCoordinates.map((function(t){return{coordinates:e.get(t.feature_id).getCoordinate(t.coord_path)}}))},W.prototype.isSelected=function(e){return this._selectedFeatureIds.has(e)},W.prototype.setFeatureProperty=function(e,t,i){this.get(e).setProperty(t,i),this.featureChanged(e)},W.prototype.storeMapConfig=function(){var e=this;y.forEach((function(t){e.ctx.map[t]&&(e._mapInitialConfig[t]=e.ctx.map[t].isEnabled())}))},W.prototype.restoreMapConfig=function(){var e=this;Object.keys(this._mapInitialConfig).forEach((function(t){e._mapInitialConfig[t]?e.ctx.map[t].enable():e.ctx.map[t].disable()}))},W.prototype.getInitialConfigValue=function(e){return void 0===this._mapInitialConfig[e]||this._mapInitialConfig[e]};var X=Object.prototype.hasOwnProperty,Y=t((function(){for(var e=arguments,t={},i=0;i<arguments.length;i++){var r=e[i];for(var n in r)X.call(r,n)&&(t[n]=r[n])}return t})),J=["mode","feature","mouse"];function Q(t){var i=null,r=null,n={onRemove:function(){return t.map.off("load",n.connect),clearInterval(r),n.removeLayers(),t.store.restoreMapConfig(),t.ui.removeButtons(),t.events.removeEventListeners(),t.ui.clearMapClasses(),t.boxZoomInitial&&t.map.boxZoom.enable(),t.map=null,t.container=null,t.store=null,i&&i.parentNode&&i.parentNode.removeChild(i),i=null,this},connect:function(){t.map.off("load",n.connect),clearInterval(r),n.addLayers(),t.store.storeMapConfig(),t.events.addEventListeners()},onAdd:function(o){var s=o.fire;return o.fire=function(e,t){var i=arguments;return 1===s.length&&1!==arguments.length&&(i=[Y({},{type:e},t)]),s.apply(o,i)},t.map=o,t.events=function(t){var i=Object.keys(t.options.modes).reduce((function(e,i){return e[i]=function(e){var t=Object.keys(e);return function(i,r){void 0===r&&(r={});var n={},o=t.reduce((function(t,i){return t[i]=e[i],t}),new j(i));return{start:function(){var t=this;n=o.onSetup(r),$.forEach((function(i){var r,s=G[i],a=function(){return!1};e[s]&&(a=function(){return!0}),t.on(i,a,(r=s,function(e){return o[r](n,e)}))}))},stop:function(){o.onStop(n)},trash:function(){o.onTrash(n)},combineFeatures:function(){o.onCombineFeatures(n)},uncombineFeatures:function(){o.onUncombineFeatures(n)},render:function(e,t){o.toDisplayFeatures(n,e,t)}}}}(t.options.modes[i]),e}),{}),r={},n={},o={},s=null,a=null;o.drag=function(e,i){i({point:e.point,time:(new Date).getTime()})?(t.ui.queueMapClasses({mouse:u.DRAG}),a.drag(e)):e.originalEvent.stopPropagation()},o.mousedrag=function(e){o.drag(e,(function(e){return!P(r,e)}))},o.touchdrag=function(e){o.drag(e,(function(e){return!z(n,e)}))},o.mousemove=function(e){if(1===(void 0!==e.originalEvent.buttons?e.originalEvent.buttons:e.originalEvent.which))return o.mousedrag(e);var i=A(e,t);e.featureTarget=i,a.mousemove(e)},o.mousedown=function(e){r={time:(new Date).getTime(),point:e.point};var i=A(e,t);e.featureTarget=i,a.mousedown(e)},o.mouseup=function(e){var i=A(e,t);e.featureTarget=i,P(r,{point:e.point,time:(new Date).getTime()})?a.click(e):a.mouseup(e)},o.mouseout=function(e){a.mouseout(e)},o.touchstart=function(e){if(t.options.touchEnabled){n={time:(new Date).getTime(),point:e.point};var i=S.touch(e,null,t)[0];e.featureTarget=i,a.touchstart(e)}},o.touchmove=function(e){if(t.options.touchEnabled)return a.touchmove(e),o.touchdrag(e)},o.touchend=function(e){if(e.originalEvent.preventDefault(),t.options.touchEnabled){var i=S.touch(e,null,t)[0];e.featureTarget=i,z(n,{time:(new Date).getTime(),point:e.point})?a.tap(e):a.touchend(e)}};var l=function(e){return!(8===e||46===e||e>=48&&e<=57)};function c(r,n,o){void 0===o&&(o={}),a.stop();var l=i[r];if(void 0===l)throw new Error(r+" is not valid");s=r;var c=l(t,n);a=e(c,t),o.silent||t.map.fire(f.MODE_CHANGE,{mode:r}),t.store.setDirty(),t.store.render()}o.keydown=function(e){(e.srcElement||e.target).classList.contains("mapboxgl-canvas")&&(8!==e.keyCode&&46!==e.keyCode||!t.options.controls.trash?l(e.keyCode)?a.keydown(e):49===e.keyCode&&t.options.controls.point?c(p.DRAW_POINT):50===e.keyCode&&t.options.controls.line_string?c(p.DRAW_LINE_STRING):51===e.keyCode&&t.options.controls.polygon&&c(p.DRAW_POLYGON):(e.preventDefault(),a.trash()))},o.keyup=function(e){l(e.keyCode)&&a.keyup(e)},o.zoomend=function(){t.store.changeZoom()},o.data=function(e){if("style"===e.dataType){var i=t.setup,r=t.map,n=t.options,o=t.store;n.styles.some((function(e){return r.getLayer(e.id)}))||(i.addLayers(),o.setDirty(),o.render())}};var h={trash:!1,combineFeatures:!1,uncombineFeatures:!1};return{start:function(){s=t.options.defaultMode,a=e(i[s](t),t)},changeMode:c,actionable:function(e){var i=!1;Object.keys(e).forEach((function(t){if(void 0===h[t])throw new Error("Invalid action type");h[t]!==e[t]&&(i=!0),h[t]=e[t]})),i&&t.map.fire(f.ACTIONABLE,{actions:h})},currentModeName:function(){return s},currentModeRender:function(e,t){return a.render(e,t)},fire:function(e,t){o[e]&&o[e](t)},addEventListeners:function(){t.map.on("mousemove",o.mousemove),t.map.on("mousedown",o.mousedown),t.map.on("mouseup",o.mouseup),t.map.on("data",o.data),t.map.on("touchmove",o.touchmove),t.map.on("touchstart",o.touchstart),t.map.on("touchend",o.touchend),t.container.addEventListener("mouseout",o.mouseout),t.options.keybindings&&(t.container.addEventListener("keydown",o.keydown),t.container.addEventListener("keyup",o.keyup))},removeEventListeners:function(){t.map.off("mousemove",o.mousemove),t.map.off("mousedown",o.mousedown),t.map.off("mouseup",o.mouseup),t.map.off("data",o.data),t.map.off("touchmove",o.touchmove),t.map.off("touchstart",o.touchstart),t.map.off("touchend",o.touchend),t.container.removeEventListener("mouseout",o.mouseout),t.options.keybindings&&(t.container.removeEventListener("keydown",o.keydown),t.container.removeEventListener("keyup",o.keyup))},trash:function(e){a.trash(e)},combineFeatures:function(){a.combineFeatures()},uncombineFeatures:function(){a.uncombineFeatures()},getMode:function(){return s}}}(t),t.ui=function(e){var t={},i=null,r={mode:null,feature:null,mouse:null},n={mode:null,feature:null,mouse:null};function o(e){n=Y(n,e)}function s(){var t,i;if(e.container){var o=[],s=[];J.forEach((function(e){n[e]!==r[e]&&(o.push(e+"-"+r[e]),null!==n[e]&&s.push(e+"-"+n[e]))})),o.length>0&&(t=e.container.classList).remove.apply(t,o),s.length>0&&(i=e.container.classList).add.apply(i,s),r=Y(r,n)}}function a(e,t){void 0===t&&(t={});var r=document.createElement("button");return r.className=l.CONTROL_BUTTON+" "+t.className,r.setAttribute("title",t.title),t.container.appendChild(r),r.addEventListener("click",(function(r){if(r.preventDefault(),r.stopPropagation(),r.target===i)return c(),void t.onDeactivate();u(e),t.onActivate()}),!0),r}function c(){i&&(i.classList.remove(l.ACTIVE_BUTTON),i=null)}function u(e){c();var r=t[e];r&&r&&"trash"!==e&&(r.classList.add(l.ACTIVE_BUTTON),i=r)}return{setActiveButton:u,queueMapClasses:o,updateMapClasses:s,clearMapClasses:function(){o({mode:null,feature:null,mouse:null}),s()},addButtons:function(){var i=e.options.controls,r=document.createElement("div");return r.className=l.CONTROL_GROUP+" "+l.CONTROL_BASE,i?(i[h.LINE]&&(t[h.LINE]=a(h.LINE,{container:r,className:l.CONTROL_BUTTON_LINE,title:"LineString tool "+(e.options.keybindings?"(l)":""),onActivate:function(){return e.events.changeMode(p.DRAW_LINE_STRING)},onDeactivate:function(){return e.events.trash()}})),i[h.POLYGON]&&(t[h.POLYGON]=a(h.POLYGON,{container:r,className:l.CONTROL_BUTTON_POLYGON,title:"Polygon tool "+(e.options.keybindings?"(p)":""),onActivate:function(){return e.events.changeMode(p.DRAW_POLYGON)},onDeactivate:function(){return e.events.trash()}})),i[h.POINT]&&(t[h.POINT]=a(h.POINT,{container:r,className:l.CONTROL_BUTTON_POINT,title:"Marker tool "+(e.options.keybindings?"(m)":""),onActivate:function(){return e.events.changeMode(p.DRAW_POINT)},onDeactivate:function(){return e.events.trash()}})),i.trash&&(t.trash=a("trash",{container:r,className:l.CONTROL_BUTTON_TRASH,title:"Delete",onActivate:function(){e.events.trash()}})),i.combine_features&&(t.combine_features=a("combineFeatures",{container:r,className:l.CONTROL_BUTTON_COMBINE_FEATURES,title:"Combine",onActivate:function(){e.events.combineFeatures()}})),i.uncombine_features&&(t.uncombine_features=a("uncombineFeatures",{container:r,className:l.CONTROL_BUTTON_UNCOMBINE_FEATURES,title:"Uncombine",onActivate:function(){e.events.uncombineFeatures()}})),r):r},removeButtons:function(){Object.keys(t).forEach((function(e){var i=t[e];i.parentNode&&i.parentNode.removeChild(i),delete t[e]}))}}}(t),t.container=o.getContainer(),t.store=new W(t),i=t.ui.addButtons(),t.options.boxSelect&&(t.boxZoomInitial=o.boxZoom.isEnabled(),o.boxZoom.disable(),o.dragPan.disable(),o.dragPan.enable()),o.loaded()?n.connect():(o.on("load",n.connect),r=setInterval((function(){o.loaded()&&n.connect()}),16)),t.events.start(),i},addLayers:function(){t.map.addSource(c.COLD,{data:{type:d.FEATURE_COLLECTION,features:[]},type:"geojson"}),t.map.addSource(c.HOT,{data:{type:d.FEATURE_COLLECTION,features:[]},type:"geojson"}),t.options.styles.forEach((function(e){t.map.addLayer(e)})),t.store.setDirty(!0),t.store.render()},removeLayers:function(){t.options.styles.forEach((function(e){t.map.getLayer(e.id)&&t.map.removeLayer(e.id)})),t.map.getSource(c.COLD)&&t.map.removeSource(c.COLD),t.map.getSource(c.HOT)&&t.map.removeSource(c.HOT)}};return t.setup=n,n}var K=[{id:"gl-draw-polygon-fill-inactive",type:"fill",filter:["all",["==","active","false"],["==","$type","Polygon"],["!=","mode","static"]],paint:{"fill-color":"#3bb2d0","fill-outline-color":"#3bb2d0","fill-opacity":.1}},{id:"gl-draw-polygon-fill-active",type:"fill",filter:["all",["==","active","true"],["==","$type","Polygon"]],paint:{"fill-color":"#fbb03b","fill-outline-color":"#fbb03b","fill-opacity":.1}},{id:"gl-draw-polygon-midpoint",type:"circle",filter:["all",["==","$type","Point"],["==","meta","midpoint"]],paint:{"circle-radius":3,"circle-color":"#fbb03b"}},{id:"gl-draw-polygon-stroke-inactive",type:"line",filter:["all",["==","active","false"],["==","$type","Polygon"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#3bb2d0","line-width":2}},{id:"gl-draw-polygon-stroke-active",type:"line",filter:["all",["==","active","true"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fbb03b","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-line-inactive",type:"line",filter:["all",["==","active","false"],["==","$type","LineString"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#3bb2d0","line-width":2}},{id:"gl-draw-line-active",type:"line",filter:["all",["==","$type","LineString"],["==","active","true"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fbb03b","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-polygon-and-line-vertex-stroke-inactive",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":5,"circle-color":"#fff"}},{id:"gl-draw-polygon-and-line-vertex-inactive",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":3,"circle-color":"#fbb03b"}},{id:"gl-draw-point-point-stroke-inactive",type:"circle",filter:["all",["==","active","false"],["==","$type","Point"],["==","meta","feature"],["!=","mode","static"]],paint:{"circle-radius":5,"circle-opacity":1,"circle-color":"#fff"}},{id:"gl-draw-point-inactive",type:"circle",filter:["all",["==","active","false"],["==","$type","Point"],["==","meta","feature"],["!=","mode","static"]],paint:{"circle-radius":3,"circle-color":"#3bb2d0"}},{id:"gl-draw-point-stroke-active",type:"circle",filter:["all",["==","$type","Point"],["==","active","true"],["!=","meta","midpoint"]],paint:{"circle-radius":7,"circle-color":"#fff"}},{id:"gl-draw-point-active",type:"circle",filter:["all",["==","$type","Point"],["!=","meta","midpoint"],["==","active","true"]],paint:{"circle-radius":5,"circle-color":"#fbb03b"}},{id:"gl-draw-polygon-fill-static",type:"fill",filter:["all",["==","mode","static"],["==","$type","Polygon"]],paint:{"fill-color":"#404040","fill-outline-color":"#404040","fill-opacity":.1}},{id:"gl-draw-polygon-stroke-static",type:"line",filter:["all",["==","mode","static"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#404040","line-width":2}},{id:"gl-draw-line-static",type:"line",filter:["all",["==","mode","static"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#404040","line-width":2}},{id:"gl-draw-point-static",type:"circle",filter:["all",["==","mode","static"],["==","$type","Point"]],paint:{"circle-radius":5,"circle-color":"#404040"}}];function ee(e){return function(t){var i=t.featureTarget;return!!i&&!!i.properties&&i.properties.meta===e}}function te(e){return!!e.originalEvent&&!!e.originalEvent.shiftKey&&0===e.originalEvent.button}function ie(e){return!!e.featureTarget&&!!e.featureTarget.properties&&e.featureTarget.properties.active===g.ACTIVE&&e.featureTarget.properties.meta===_.FEATURE}function re(e){return!!e.featureTarget&&!!e.featureTarget.properties&&e.featureTarget.properties.active===g.INACTIVE&&e.featureTarget.properties.meta===_.FEATURE}function ne(e){return void 0===e.featureTarget}function oe(e){return!!e.featureTarget&&!!e.featureTarget.properties&&e.featureTarget.properties.meta===_.FEATURE}function se(e){var t=e.featureTarget;return!!t&&!!t.properties&&t.properties.meta===_.VERTEX}function ae(e){return!!e.originalEvent&&!0===e.originalEvent.shiftKey}function le(e){return 27===e.keyCode}function ce(e){return 13===e.keyCode}var ue=Object.freeze({__proto__:null,isOfMetaType:ee,isShiftMousedown:te,isActiveFeature:ie,isInactiveFeature:re,noTarget:ne,isFeature:oe,isVertex:se,isShiftDown:ae,isEscapeKey:le,isEnterKey:ce,isTrue:function(){return!0}}),he=de;function de(e,t){this.x=e,this.y=t}de.prototype={clone:function(){return new de(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,i=e.y-this.y;return t*t+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[0]*this.x+e[1]*this.y,i=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=i,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),i=Math.sin(e),r=t*this.x-i*this.y,n=i*this.x+t*this.y;return this.x=r,this.y=n,this},_rotateAround:function(e,t){var i=Math.cos(e),r=Math.sin(e),n=t.x+i*(this.x-t.x)-r*(this.y-t.y),o=t.y+r*(this.x-t.x)+i*(this.y-t.y);return this.x=n,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},de.convert=function(e){return e instanceof de?e:Array.isArray(e)?new de(e[0],e[1]):e};var pe=t(he);function fe(e,t){var i=t.getBoundingClientRect();return new pe(e.clientX-i.left-(t.clientLeft||0),e.clientY-i.top-(t.clientTop||0))}function me(e,t,i,r){return{type:d.FEATURE,properties:{meta:_.VERTEX,parent:e,coord_path:i,active:r?g.ACTIVE:g.INACTIVE},geometry:{type:d.POINT,coordinates:t}}}function _e(e,t,i){var r=t.geometry.coordinates,n=i.geometry.coordinates;if(r[1]>85||r[1]<-85||n[1]>85||n[1]<-85)return null;var o={lng:(r[0]+n[0])/2,lat:(r[1]+n[1])/2};return{type:d.FEATURE,properties:{meta:_.MIDPOINT,parent:e,lng:o.lng,lat:o.lat,coord_path:i.properties.coord_path},geometry:{type:d.POINT,coordinates:[o.lng,o.lat]}}}function ge(e,t,i){void 0===t&&(t={}),void 0===i&&(i=null);var r,n=e.geometry,o=n.type,s=n.coordinates,a=e.properties&&e.properties.id,l=[];function c(e,i){var r="",n=null;e.forEach((function(e,o){var s=null!=i?i+"."+o:String(o),c=me(a,e,s,u(s));if(t.midpoints&&n){var h=_e(a,n,c);h&&l.push(h)}n=c;var d=JSON.stringify(e);r!==d&&l.push(c),0===o&&(r=d)}))}function u(e){return!!t.selectedPaths&&-1!==t.selectedPaths.indexOf(e)}return o===d.POINT?l.push(me(a,s,i,u(i))):o===d.POLYGON?s.forEach((function(e,t){c(e,null!==i?i+"."+t:String(t))})):o===d.LINE_STRING?c(s,i):0===o.indexOf(d.MULTI_PREFIX)&&(r=o.replace(d.MULTI_PREFIX,""),s.forEach((function(i,n){var o={type:d.FEATURE,properties:e.properties,geometry:{type:r,coordinates:i}};l=l.concat(ge(o,t,n))}))),l}var ye={enable:function(e){setTimeout((function(){e.map&&e.map.doubleClickZoom&&e._ctx&&e._ctx.store&&e._ctx.store.getInitialConfigValue&&e._ctx.store.getInitialConfigValue("doubleClickZoom")&&e.map.doubleClickZoom.enable()}),0)},disable:function(e){setTimeout((function(){e.map&&e.map.doubleClickZoom&&e.map.doubleClickZoom.disable()}),0)}},xe={exports:{}},ve=function(e){if(!e||!e.type)return null;var t=be[e.type];return t?"geometry"===t?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:e}]}:"feature"===t?{type:"FeatureCollection",features:[e]}:"featurecollection"===t?e:void 0:null},be={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"},we=t(ve),Te=Object.freeze({__proto__:null,default:function e(t){switch(t&&t.type||null){case"FeatureCollection":return t.features=t.features.reduce((function(t,i){return t.concat(e(i))}),[]),t;case"Feature":return t.geometry?e(t.geometry).map((function(e){var i={type:"Feature",properties:JSON.parse(JSON.stringify(t.properties)),geometry:e};return void 0!==t.id&&(i.id=t.id),i})):[t];case"MultiPoint":return t.coordinates.map((function(e){return{type:"Point",coordinates:e}}));case"MultiPolygon":return t.coordinates.map((function(e){return{type:"Polygon",coordinates:e}}));case"MultiLineString":return t.coordinates.map((function(e){return{type:"LineString",coordinates:e}}));case"GeometryCollection":return t.geometries.map(e).reduce((function(e,t){return e.concat(t)}),[]);case"Point":case"Polygon":case"LineString":return[t]}}}),Ee=ve,Me=function(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var i=function e(){if(this instanceof e){var i=[null];return i.push.apply(i,arguments),new(Function.bind.apply(t,i))}return t.apply(this,arguments)};i.prototype=t.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(i,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),i}(Te);Me instanceof Function||(Me=Me.default);var Se={exports:{}},Ie=Se.exports=function(e){return new Ae(e)};function Ae(e){this.value=e}function Ce(e,t,i){var r=[],n=[],o=!0;return function e(s){var a=i?Pe(s):s,l={},c=!0,u={node:a,node_:s,path:[].concat(r),parent:n[n.length-1],parents:n,key:r.slice(-1)[0],isRoot:0===r.length,level:r.length,circular:null,update:function(e,t){u.isRoot||(u.parent.node[u.key]=e),u.node=e,t&&(c=!1)},delete:function(e){delete u.parent.node[u.key],e&&(c=!1)},remove:function(e){De(u.parent.node)?u.parent.node.splice(u.key,1):delete u.parent.node[u.key],e&&(c=!1)},keys:null,before:function(e){l.before=e},after:function(e){l.after=e},pre:function(e){l.pre=e},post:function(e){l.post=e},stop:function(){o=!1},block:function(){c=!1}};if(!o)return u;function h(){if("object"==typeof u.node&&null!==u.node){u.keys&&u.node_===u.node||(u.keys=ze(u.node)),u.isLeaf=0==u.keys.length;for(var e=0;e<n.length;e++)if(n[e].node_===s){u.circular=n[e];break}}else u.isLeaf=!0,u.keys=null;u.notLeaf=!u.isLeaf,u.notRoot=!u.isRoot}h();var d=t.call(u,u.node);return void 0!==d&&u.update&&u.update(d),l.before&&l.before.call(u,u.node),c?("object"!=typeof u.node||null===u.node||u.circular||(n.push(u),h(),Re(u.keys,(function(t,n){r.push(t),l.pre&&l.pre.call(u,u.node[t],t);var o=e(u.node[t]);i&&ke.call(u.node,t)&&(u.node[t]=o.node),o.isLast=n==u.keys.length-1,o.isFirst=0==n,l.post&&l.post.call(u,o),r.pop()})),n.pop()),l.after&&l.after.call(u,u.node),u):u}(e).node}function Pe(e){if("object"==typeof e&&null!==e){var t;if(De(e))t=[];else if("[object Date]"===Le(e))t=new Date(e.getTime?e.getTime():e);else if(function(e){return"[object RegExp]"===Le(e)}(e))t=new RegExp(e);else if(function(e){return"[object Error]"===Le(e)}(e))t={message:e.message};else if(function(e){return"[object Boolean]"===Le(e)}(e))t=new Boolean(e);else if(function(e){return"[object Number]"===Le(e)}(e))t=new Number(e);else if(function(e){return"[object String]"===Le(e)}(e))t=new String(e);else if(Object.create&&Object.getPrototypeOf)t=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)t={};else{var i=e.constructor&&e.constructor.prototype||e.__proto__||{},r=function(){};r.prototype=i,t=new r}return Re(ze(e),(function(i){t[i]=e[i]})),t}return e}Ae.prototype.get=function(e){for(var t=this.value,i=0;i<e.length;i++){var r=e[i];if(!t||!ke.call(t,r)){t=void 0;break}t=t[r]}return t},Ae.prototype.has=function(e){for(var t=this.value,i=0;i<e.length;i++){var r=e[i];if(!t||!ke.call(t,r))return!1;t=t[r]}return!0},Ae.prototype.set=function(e,t){for(var i=this.value,r=0;r<e.length-1;r++){var n=e[r];ke.call(i,n)||(i[n]={}),i=i[n]}return i[e[r]]=t,t},Ae.prototype.map=function(e){return Ce(this.value,e,!0)},Ae.prototype.forEach=function(e){return this.value=Ce(this.value,e,!1),this.value},Ae.prototype.reduce=function(e,t){var i=1===arguments.length,r=i?this.value:t;return this.forEach((function(t){this.isRoot&&i||(r=e.call(this,r,t))})),r},Ae.prototype.paths=function(){var e=[];return this.forEach((function(t){e.push(this.path)})),e},Ae.prototype.nodes=function(){var e=[];return this.forEach((function(t){e.push(this.node)})),e},Ae.prototype.clone=function(){var e=[],t=[];return function i(r){for(var n=0;n<e.length;n++)if(e[n]===r)return t[n];if("object"==typeof r&&null!==r){var o=Pe(r);return e.push(r),t.push(o),Re(ze(r),(function(e){o[e]=i(r[e])})),e.pop(),t.pop(),o}return r}(this.value)};var ze=Object.keys||function(e){var t=[];for(var i in e)t.push(i);return t};function Le(e){return Object.prototype.toString.call(e)}var De=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},Re=function(e,t){if(e.forEach)return e.forEach(t);for(var i=0;i<e.length;i++)t(e[i],i,e)};Re(ze(Ae.prototype),(function(e){Ie[e]=function(t){var i=[].slice.call(arguments,1),r=new Ae(t);return r[e].apply(r,i)}}));var ke=Object.hasOwnProperty||function(e,t){return t in e},Oe=Se.exports,Fe=Be;function Be(e){if(!(this instanceof Be))return new Be(e);this._bbox=e||[1/0,1/0,-1/0,-1/0],this._valid=!!e}Be.prototype.include=function(e){return this._valid=!0,this._bbox[0]=Math.min(this._bbox[0],e[0]),this._bbox[1]=Math.min(this._bbox[1],e[1]),this._bbox[2]=Math.max(this._bbox[2],e[0]),this._bbox[3]=Math.max(this._bbox[3],e[1]),this},Be.prototype.equals=function(e){var t;return t=e instanceof Be?e.bbox():e,this._bbox[0]==t[0]&&this._bbox[1]==t[1]&&this._bbox[2]==t[2]&&this._bbox[3]==t[3]},Be.prototype.center=function(e){return this._valid?[(this._bbox[0]+this._bbox[2])/2,(this._bbox[1]+this._bbox[3])/2]:null},Be.prototype.union=function(e){var t;return this._valid=!0,t=e instanceof Be?e.bbox():e,this._bbox[0]=Math.min(this._bbox[0],t[0]),this._bbox[1]=Math.min(this._bbox[1],t[1]),this._bbox[2]=Math.max(this._bbox[2],t[2]),this._bbox[3]=Math.max(this._bbox[3],t[3]),this},Be.prototype.bbox=function(){return this._valid?this._bbox:null},Be.prototype.contains=function(e){if(!e)return this._fastContains();if(!this._valid)return null;var t=e[0],i=e[1];return this._bbox[0]<=t&&this._bbox[1]<=i&&this._bbox[2]>=t&&this._bbox[3]>=i},Be.prototype.intersect=function(e){return this._valid?(t=e instanceof Be?e.bbox():e,!(this._bbox[0]>t[2]||this._bbox[2]<t[0]||this._bbox[3]<t[1]||this._bbox[1]>t[3])):null;var t},Be.prototype._fastContains=function(){if(!this._valid)return new Function("return null;");var e="return "+this._bbox[0]+"<= ll[0] &&"+this._bbox[1]+"<= ll[1] &&"+this._bbox[2]+">= ll[0] &&"+this._bbox[3]+">= ll[1]";return new Function("ll",e)},Be.prototype.polygon=function(){return this._valid?{type:"Polygon",coordinates:[[[this._bbox[0],this._bbox[1]],[this._bbox[2],this._bbox[1]],[this._bbox[2],this._bbox[3]],[this._bbox[0],this._bbox[3]],[this._bbox[0],this._bbox[1]]]]}:null};var Ne=function(e){if(!e)return[];var t=Me(Ee(e)),i=[];return t.features.forEach((function(e){e.geometry&&(i=i.concat(function(e){return function e(t){return Array.isArray(t)&&t.length&&"number"==typeof t[0]?[t]:t.reduce((function(t,i){return Array.isArray(i)&&Array.isArray(i[0])?t.concat(e(i)):(t.push(i),t)}),[])}(e)}(e.geometry.coordinates)))})),i},Ve=Oe,Ue=Fe,je={features:["FeatureCollection"],coordinates:["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],geometry:["Feature"],geometries:["GeometryCollection"]},Ge=Object.keys(je);function $e(e){for(var t=Ue(),i=Ne(e),r=0;r<i.length;r++)t.include(i[r]);return t}xe.exports=function(e){return $e(e).bbox()},xe.exports.polygon=function(e){return $e(e).polygon()},xe.exports.bboxify=function(e){return Ve(e).map((function(e){e&&Ge.some((function(t){return!!e[t]&&-1!==je[t].indexOf(e.type)}))&&(e.bbox=$e(e).bbox(),this.update(e))}))};var qe=t(xe.exports),Ze=-90;function We(e,t){var i=Ze,r=90,n=Ze,o=90,s=270,a=-270;e.forEach((function(e){var t=qe(e),l=t[1],c=t[3],u=t[0],h=t[2];l>i&&(i=l),c<r&&(r=c),c>n&&(n=c),l<o&&(o=l),u<s&&(s=u),h>a&&(a=h)}));var l=t;return i+l.lat>85&&(l.lat=85-i),n+l.lat>90&&(l.lat=90-n),r+l.lat<-85&&(l.lat=-85-r),o+l.lat<Ze&&(l.lat=Ze-o),s+l.lng<=-270&&(l.lng+=360*Math.ceil(Math.abs(l.lng)/360)),a+l.lng>=270&&(l.lng-=360*Math.ceil(Math.abs(l.lng)/360)),l}function He(e,t){var i=We(e.map((function(e){return e.toGeoJSON()})),t);e.forEach((function(e){var t,r=e.getCoordinates(),n=function(e){var t={lng:e[0]+i.lng,lat:e[1]+i.lat};return[t.lng,t.lat]},o=function(e){return e.map((function(e){return n(e)}))};e.type===d.POINT?t=n(r):e.type===d.LINE_STRING||e.type===d.MULTI_POINT?t=r.map(n):e.type===d.POLYGON||e.type===d.MULTI_LINE_STRING?t=r.map(o):e.type===d.MULTI_POLYGON&&(t=r.map((function(e){return e.map((function(e){return o(e)}))}))),e.incomingCoords(t)}))}var Xe={onSetup:function(e){var t=this,i={dragMoveLocation:null,boxSelectStartLocation:null,boxSelectElement:void 0,boxSelecting:!1,canBoxSelect:!1,dragMoving:!1,canDragMove:!1,initiallySelectedFeatureIds:e.featureIds||[]};return this.setSelected(i.initiallySelectedFeatureIds.filter((function(e){return void 0!==t.getFeature(e)}))),this.fireActionable(),this.setActionableState({combineFeatures:!0,uncombineFeatures:!0,trash:!0}),i},fireUpdate:function(){this.map.fire(f.UPDATE,{action:m.MOVE,features:this.getSelected().map((function(e){return e.toGeoJSON()}))})},fireActionable:function(){var e=this,t=this.getSelected(),i=t.filter((function(t){return e.isInstanceOf("MultiFeature",t)})),r=!1;if(t.length>1){r=!0;var n=t[0].type.replace("Multi","");t.forEach((function(e){e.type.replace("Multi","")!==n&&(r=!1)}))}var o=i.length>0,s=t.length>0;this.setActionableState({combineFeatures:r,uncombineFeatures:o,trash:s})},getUniqueIds:function(e){return e.length?e.map((function(e){return e.properties.id})).filter((function(e){return void 0!==e})).reduce((function(e,t){return e.add(t),e}),new E).values():[]},stopExtendedInteractions:function(e){e.boxSelectElement&&(e.boxSelectElement.parentNode&&e.boxSelectElement.parentNode.removeChild(e.boxSelectElement),e.boxSelectElement=null),this.map.dragPan.enable(),e.boxSelecting=!1,e.canBoxSelect=!1,e.dragMoving=!1,e.canDragMove=!1},onStop:function(){ye.enable(this)},onMouseMove:function(e,t){return oe(t)&&e.dragMoving&&this.fireUpdate(),this.stopExtendedInteractions(e),!0},onMouseOut:function(e){return!e.dragMoving||this.fireUpdate()}};Xe.onTap=Xe.onClick=function(e,t){return ne(t)?this.clickAnywhere(e,t):ee(_.VERTEX)(t)?this.clickOnVertex(e,t):oe(t)?this.clickOnFeature(e,t):void 0},Xe.clickAnywhere=function(e){var t=this,i=this.getSelectedIds();i.length&&(this.clearSelectedFeatures(),i.forEach((function(e){return t.doRender(e)}))),ye.enable(this),this.stopExtendedInteractions(e)},Xe.clickOnVertex=function(e,t){this.changeMode(p.DIRECT_SELECT,{featureId:t.featureTarget.properties.parent,coordPath:t.featureTarget.properties.coord_path,startPos:t.lngLat}),this.updateUIClasses({mouse:u.MOVE})},Xe.startOnActiveFeature=function(e,t){this.stopExtendedInteractions(e),this.map.dragPan.disable(),this.doRender(t.featureTarget.properties.id),e.canDragMove=!0,e.dragMoveLocation=t.lngLa