@mapgis/mapbox-gl-draw-radius 16.2.0 → 16.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,10 @@
1
1
  'use strict';
2
2
 
3
+ var MapboxDraw = require('@mapbox/mapbox-gl-draw');
3
4
  var turf = require('@turf/turf');
4
5
 
6
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
7
+
5
8
  function _interopNamespace(e) {
6
9
  if (e && e.__esModule) return e;
7
10
  var n = Object.create(null);
@@ -20,6 +23,7 @@ n["default"] = e;
20
23
  return Object.freeze(n);
21
24
  }
22
25
 
26
+ var MapboxDraw__default = /*#__PURE__*/_interopDefaultLegacy(MapboxDraw);
23
27
  var turf__namespace = /*#__PURE__*/_interopNamespace(turf);
24
28
 
25
29
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -29,11 +33,6 @@ function createCommonjsModule(fn) {
29
33
  return fn(module, module.exports), module.exports;
30
34
  }
31
35
 
32
- var mapboxGlDraw = createCommonjsModule(function (module, exports) {
33
- !function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=function(t,e){var n={drag:[],click:[],mousemove:[],mousedown:[],mouseup:[],mouseout:[],keydown:[],keyup:[],touchstart:[],touchmove:[],touchend:[],tap:[]},o={on:function(t,e,o){if(void 0===n[t])throw new Error("Invalid event type: "+t);n[t].push({selector:e,fn:o});},render:function(t){e.store.featureChanged(t);}},r=function(t,r){for(var i=n[t],a=i.length;a--;){var s=i[a];if(s.selector(r)){s.fn.call(o,r)||e.store.render(),e.ui.updateMapClasses();break}}};return t.start.call(o),{render:t.render,stop:function(){t.stop&&t.stop();},trash:function(){t.trash&&(t.trash(),e.store.render());},combineFeatures:function(){t.combineFeatures&&t.combineFeatures();},uncombineFeatures:function(){t.uncombineFeatures&&t.uncombineFeatures();},drag:function(t){r("drag",t);},click:function(t){r("click",t);},mousemove:function(t){r("mousemove",t);},mousedown:function(t){r("mousedown",t);},mouseup:function(t){r("mouseup",t);},mouseout:function(t){r("mouseout",t);},keydown:function(t){r("keydown",t);},keyup:function(t){r("keyup",t);},touchstart:function(t){r("touchstart",t);},touchmove:function(t){r("touchmove",t);},touchend:function(t){r("touchend",t);},tap:function(t){r("tap",t);}}},e=6378137;function n(t){var e=0;if(t&&t.length>0){e+=Math.abs(o(t[0]));for(var n=1;n<t.length;n++)e-=Math.abs(o(t[n]));}return e}function o(t){var n,o,i,a,s,u,c=0,l=t.length;if(l>2){for(u=0;u<l;u++)u===l-2?(i=l-2,a=l-1,s=0):u===l-1?(i=l-1,a=0,s=1):(i=u,a=u+1,s=u+2),n=t[i],o=t[a],c+=(r(t[s][0])-r(n[0]))*Math.sin(r(o[1]));c=c*e*e/2;}return c}function r(t){return t*Math.PI/180}var i={geometry:function t(e){var o,r=0;switch(e.type){case"Polygon":return n(e.coordinates);case"MultiPolygon":for(o=0;o<e.coordinates.length;o++)r+=n(e.coordinates[o]);return r;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(o=0;o<e.geometries.length;o++)r+=t(e.geometries[o]);return r}},ring:o},a="mapboxgl-ctrl",s="mapbox-gl-draw_ctrl-draw-btn",u="mapbox-gl-draw_line",c="mapbox-gl-draw_polygon",l="mapbox-gl-draw_point",d="mapbox-gl-draw_trash",p="mapbox-gl-draw_combine",f="mapbox-gl-draw_uncombine",h="mapboxgl-ctrl-group",g="active",y="mapbox-gl-draw_boxselect",v="mapbox-gl-draw-hot",m="mapbox-gl-draw-cold",b="add",_="move",S="drag",x="pointer",C="none",E={POLYGON:"polygon",LINE:"line_string",POINT:"point"},M="Feature",w="Polygon",I="LineString",L="Point",P="FeatureCollection",F="Multi",O="MultiPoint",k="MultiLineString",T="MultiPolygon",j={DRAW_LINE_STRING:"draw_line_string",DRAW_POLYGON:"draw_polygon",DRAW_POINT:"draw_point",SIMPLE_SELECT:"simple_select",DIRECT_SELECT:"direct_select",STATIC:"static"},A="draw.create",D="draw.delete",N="draw.update",U="draw.selectionchange",R="draw.modechange",B="draw.actionable",V="draw.render",J="draw.combine",G="draw.uncombine",z="move",$="change_coordinates",W="feature",q="midpoint",Y="vertex",Z="true",K="false",X=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate"],H={Point:0,LineString:1,Polygon:2};function Q(t,e){var n=H[t.geometry.type]-H[e.geometry.type];return 0===n&&t.geometry.type===w?t.area-e.area:n}function tt(t){if(this._items={},this._nums={},this._length=t?t.length:0,t)for(var e=0,n=t.length;e<n;e++)this.add(t[e]),void 0!==t[e]&&("string"==typeof t[e]?this._items[t[e]]=e:this._nums[t[e]]=e);}tt.prototype.add=function(t){return this.has(t)||(this._length++,"string"==typeof t?this._items[t]=this._length:this._nums[t]=this._length),this},tt.prototype.delete=function(t){return !1===this.has(t)||(this._length--,delete this._items[t],delete this._nums[t]),this},tt.prototype.has=function(t){return ("string"==typeof t||"number"==typeof t)&&(void 0!==this._items[t]||void 0!==this._nums[t])},tt.prototype.values=function(){var t=this,e=[];return Object.keys(this._items).forEach((function(n){e.push({k:n,v:t._items[n]});})),Object.keys(this._nums).forEach((function(n){e.push({k:JSON.parse(n),v:t._nums[n]});})),e.sort((function(t,e){return t.v-e.v})).map((function(t){return t.k}))},tt.prototype.clear=function(){return this._length=0,this._items={},this._nums={},this};var et=[W,q,Y],nt={click:function(t,e,n){return ot(t,e,n,n.options.clickBuffer)},touch:function(t,e,n){return ot(t,e,n,n.options.touchBuffer)}};function ot(t,e,n,o){if(null===n.map)return [];var r=t?function(t,e){return void 0===e&&(e=0),[[t.point.x-e,t.point.y-e],[t.point.x+e,t.point.y+e]]}(t,o):e,a={};n.options.styles&&(a.layers=n.options.styles.map((function(t){return t.id})));var s=n.map.queryRenderedFeatures(r,a).filter((function(t){return -1!==et.indexOf(t.properties.meta)})),u=new tt,c=[];return s.forEach((function(t){var e=t.properties.id;u.has(e)||(u.add(e),c.push(t));})),function(t){return t.map((function(t){return t.geometry.type===w&&(t.area=i.geometry({type:M,property:{},geometry:t.geometry})),t})).sort(Q).map((function(t){return delete t.area,t}))}(c)}function rt(t,e){var n=nt.click(t,null,e),o={mouse:C};return n[0]&&(o.mouse=n[0].properties.active===Z?_:x,o.feature=n[0].properties.meta),-1!==e.events.currentModeName().indexOf("draw")&&(o.mouse=b),e.ui.queueMapClasses(o),e.ui.updateMapClasses(),n[0]}function it(t,e){var n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)}function at(t,e,n){void 0===n&&(n={});var o=null!=n.fineTolerance?n.fineTolerance:4,r=null!=n.grossTolerance?n.grossTolerance:12,i=null!=n.interval?n.interval:500;t.point=t.point||e.point,t.time=t.time||e.time;var a=it(t.point,e.point);return a<o||a<r&&e.time-t.time<i}function st(t,e,n){void 0===n&&(n={});var o=null!=n.tolerance?n.tolerance:25,r=null!=n.interval?n.interval:250;return t.point=t.point||e.point,t.time=t.time||e.time,it(t.point,e.point)<o&&e.time-t.time<r}function ut(t,e){return t(e={exports:{}},e.exports),e.exports}var ct=ut((function(t){var e=t.exports=function(t,n){if(n||(n=16),void 0===t&&(t=128),t<=0)return "0";for(var o=Math.log(Math.pow(2,t))/Math.log(n),r=2;o===1/0;r*=2)o=Math.log(Math.pow(2,t/r))/Math.log(n)*r;var i=o-Math.floor(o),a="";for(r=0;r<Math.floor(o);r++){a=Math.floor(Math.random()*n).toString(n)+a;}if(i){var s=Math.pow(n,i);a=Math.floor(Math.random()*s).toString(n)+a;}var u=parseInt(a,n);return u!==1/0&&u>=Math.pow(2,t)?e(t,n):a};e.rack=function(t,n,o){var r=function(r){var a=0;do{if(a++>10){if(!o)throw new Error("too many ID collisions, use more bits");t+=o;}var s=e(t,n);}while(Object.hasOwnProperty.call(i,s));return i[s]=r,s},i=r.hats={};return r.get=function(t){return r.hats[t]},r.set=function(t,e){return r.hats[t]=e,r},r.bits=t||128,r.base=n||16,r};})),lt=function(t,e){this.ctx=t,this.properties=e.properties||{},this.coordinates=e.geometry.coordinates,this.id=e.id||ct(),this.type=e.geometry.type;};lt.prototype.changed=function(){this.ctx.store.featureChanged(this.id);},lt.prototype.incomingCoords=function(t){this.setCoordinates(t);},lt.prototype.setCoordinates=function(t){this.coordinates=t,this.changed();},lt.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.coordinates))},lt.prototype.setProperty=function(t,e){this.properties[t]=e;},lt.prototype.toGeoJSON=function(){return JSON.parse(JSON.stringify({id:this.id,type:M,properties:this.properties,geometry:{coordinates:this.getCoordinates(),type:this.type}}))},lt.prototype.internal=function(t){var e={id:this.id,meta:W,"meta:type":this.type,active:K,mode:t};if(this.ctx.options.userProperties)for(var n in this.properties)e["user_"+n]=this.properties[n];return {type:M,properties:e,geometry:{coordinates:this.getCoordinates(),type:this.type}}};var dt=function(t,e){lt.call(this,t,e);};(dt.prototype=Object.create(lt.prototype)).isValid=function(){return "number"==typeof this.coordinates[0]&&"number"==typeof this.coordinates[1]},dt.prototype.updateCoordinate=function(t,e,n){this.coordinates=3===arguments.length?[e,n]:[t,e],this.changed();},dt.prototype.getCoordinate=function(){return this.getCoordinates()};var pt=function(t,e){lt.call(this,t,e);};(pt.prototype=Object.create(lt.prototype)).isValid=function(){return this.coordinates.length>1},pt.prototype.addCoordinate=function(t,e,n){this.changed();var o=parseInt(t,10);this.coordinates.splice(o,0,[e,n]);},pt.prototype.getCoordinate=function(t){var e=parseInt(t,10);return JSON.parse(JSON.stringify(this.coordinates[e]))},pt.prototype.removeCoordinate=function(t){this.changed(),this.coordinates.splice(parseInt(t,10),1);},pt.prototype.updateCoordinate=function(t,e,n){var o=parseInt(t,10);this.coordinates[o]=[e,n],this.changed();};var ft=function(t,e){lt.call(this,t,e),this.coordinates=this.coordinates.map((function(t){return t.slice(0,-1)}));};(ft.prototype=Object.create(lt.prototype)).isValid=function(){return 0!==this.coordinates.length&&this.coordinates.every((function(t){return t.length>2}))},ft.prototype.incomingCoords=function(t){this.coordinates=t.map((function(t){return t.slice(0,-1)})),this.changed();},ft.prototype.setCoordinates=function(t){this.coordinates=t,this.changed();},ft.prototype.addCoordinate=function(t,e,n){this.changed();var o=t.split(".").map((function(t){return parseInt(t,10)}));this.coordinates[o[0]].splice(o[1],0,[e,n]);},ft.prototype.removeCoordinate=function(t){this.changed();var e=t.split(".").map((function(t){return parseInt(t,10)})),n=this.coordinates[e[0]];n&&(n.splice(e[1],1),n.length<3&&this.coordinates.splice(e[0],1));},ft.prototype.getCoordinate=function(t){var e=t.split(".").map((function(t){return parseInt(t,10)})),n=this.coordinates[e[0]];return JSON.parse(JSON.stringify(n[e[1]]))},ft.prototype.getCoordinates=function(){return this.coordinates.map((function(t){return t.concat([t[0]])}))},ft.prototype.updateCoordinate=function(t,e,n){this.changed();var o=t.split("."),r=parseInt(o[0],10),i=parseInt(o[1],10);void 0===this.coordinates[r]&&(this.coordinates[r]=[]),this.coordinates[r][i]=[e,n];};var ht={MultiPoint:dt,MultiLineString:pt,MultiPolygon:ft},gt=function(t,e,n,o,r){var i=n.split("."),a=parseInt(i[0],10),s=i[1]?i.slice(1).join("."):null;return t[a][e](s,o,r)},yt=function(t,e){if(lt.call(this,t,e),delete this.coordinates,this.model=ht[e.geometry.type],void 0===this.model)throw new TypeError(e.geometry.type+" is not a valid type");this.features=this._coordinatesToFeatures(e.geometry.coordinates);};function vt(t){this.map=t.map,this.drawConfig=JSON.parse(JSON.stringify(t.options||{})),this._ctx=t;}(yt.prototype=Object.create(lt.prototype))._coordinatesToFeatures=function(t){var e=this,n=this.model.bind(this);return t.map((function(t){return new n(e.ctx,{id:ct(),type:M,properties:{},geometry:{coordinates:t,type:e.type.replace("Multi","")}})}))},yt.prototype.isValid=function(){return this.features.every((function(t){return t.isValid()}))},yt.prototype.setCoordinates=function(t){this.features=this._coordinatesToFeatures(t),this.changed();},yt.prototype.getCoordinate=function(t){return gt(this.features,"getCoordinate",t)},yt.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.features.map((function(t){return t.type===w?t.getCoordinates():t.coordinates}))))},yt.prototype.updateCoordinate=function(t,e,n){gt(this.features,"updateCoordinate",t,e,n),this.changed();},yt.prototype.addCoordinate=function(t,e,n){gt(this.features,"addCoordinate",t,e,n),this.changed();},yt.prototype.removeCoordinate=function(t){gt(this.features,"removeCoordinate",t),this.changed();},yt.prototype.getFeatures=function(){return this.features},vt.prototype.setSelected=function(t){return this._ctx.store.setSelected(t)},vt.prototype.setSelectedCoordinates=function(t){var e=this;this._ctx.store.setSelectedCoordinates(t),t.reduce((function(t,n){return void 0===t[n.feature_id]&&(t[n.feature_id]=!0,e._ctx.store.get(n.feature_id).changed()),t}),{});},vt.prototype.getSelected=function(){return this._ctx.store.getSelected()},vt.prototype.getSelectedIds=function(){return this._ctx.store.getSelectedIds()},vt.prototype.isSelected=function(t){return this._ctx.store.isSelected(t)},vt.prototype.getFeature=function(t){return this._ctx.store.get(t)},vt.prototype.select=function(t){return this._ctx.store.select(t)},vt.prototype.deselect=function(t){return this._ctx.store.deselect(t)},vt.prototype.deleteFeature=function(t,e){return void 0===e&&(e={}),this._ctx.store.delete(t,e)},vt.prototype.addFeature=function(t){return this._ctx.store.add(t)},vt.prototype.clearSelectedFeatures=function(){return this._ctx.store.clearSelected()},vt.prototype.clearSelectedCoordinates=function(){return this._ctx.store.clearSelectedCoordinates()},vt.prototype.setActionableState=function(t){void 0===t&&(t={});var e={trash:t.trash||!1,combineFeatures:t.combineFeatures||!1,uncombineFeatures:t.uncombineFeatures||!1};return this._ctx.events.actionable(e)},vt.prototype.changeMode=function(t,e,n){return void 0===e&&(e={}),void 0===n&&(n={}),this._ctx.events.changeMode(t,e,n)},vt.prototype.updateUIClasses=function(t){return this._ctx.ui.queueMapClasses(t)},vt.prototype.activateUIButton=function(t){return this._ctx.ui.setActiveButton(t)},vt.prototype.featuresAt=function(t,e,n){if(void 0===n&&(n="click"),"click"!==n&&"touch"!==n)throw new Error("invalid buffer type");return nt[n](t,e,this._ctx)},vt.prototype.newFeature=function(t){var e=t.geometry.type;return e===L?new dt(this._ctx,t):e===I?new pt(this._ctx,t):e===w?new ft(this._ctx,t):new yt(this._ctx,t)},vt.prototype.isInstanceOf=function(t,e){if(t===L)return e instanceof dt;if(t===I)return e instanceof pt;if(t===w)return e instanceof ft;if("MultiFeature"===t)return e instanceof yt;throw new Error("Unknown feature class: "+t)},vt.prototype.doRender=function(t){return this._ctx.store.featureChanged(t)},vt.prototype.onSetup=function(){},vt.prototype.onDrag=function(){},vt.prototype.onClick=function(){},vt.prototype.onMouseMove=function(){},vt.prototype.onMouseDown=function(){},vt.prototype.onMouseUp=function(){},vt.prototype.onMouseOut=function(){},vt.prototype.onKeyUp=function(){},vt.prototype.onKeyDown=function(){},vt.prototype.onTouchStart=function(){},vt.prototype.onTouchMove=function(){},vt.prototype.onTouchEnd=function(){},vt.prototype.onTap=function(){},vt.prototype.onStop=function(){},vt.prototype.onTrash=function(){},vt.prototype.onCombineFeature=function(){},vt.prototype.onUncombineFeature=function(){},vt.prototype.toDisplayFeatures=function(){throw new Error("You must overwrite toDisplayFeatures")};var mt={drag:"onDrag",click:"onClick",mousemove:"onMouseMove",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseout:"onMouseOut",keyup:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",tap:"onTap"},bt=Object.keys(mt);function _t(t){var e=Object.keys(t);return function(n,o){void 0===o&&(o={});var r={},i=e.reduce((function(e,n){return e[n]=t[n],e}),new vt(n));return {start:function(){var e=this;r=i.onSetup(o),bt.forEach((function(n){var o,a=mt[n],s=function(){return !1};t[a]&&(s=function(){return !0}),e.on(n,s,(o=a,function(t){return i[o](r,t)}));}));},stop:function(){i.onStop(r);},trash:function(){i.onTrash(r);},combineFeatures:function(){i.onCombineFeatures(r);},uncombineFeatures:function(){i.onUncombineFeatures(r);},render:function(t,e){i.toDisplayFeatures(r,t,e);}}}}function St(t){return [].concat(t).filter((function(t){return void 0!==t}))}function xt(){var t=this;if(!(t.ctx.map&&void 0!==t.ctx.map.getSource(v)))return u();var e=t.ctx.events.currentModeName();t.ctx.ui.queueMapClasses({mode:e});var n=[],o=[];t.isDirty?o=t.getAllIds():(n=t.getChangedIds().filter((function(e){return void 0!==t.get(e)})),o=t.sources.hot.filter((function(e){return e.properties.id&&-1===n.indexOf(e.properties.id)&&void 0!==t.get(e.properties.id)})).map((function(t){return t.properties.id}))),t.sources.hot=[];var r=t.sources.cold.length;t.sources.cold=t.isDirty?[]:t.sources.cold.filter((function(t){var e=t.properties.id||t.properties.parent;return -1===n.indexOf(e)}));var i=r!==t.sources.cold.length||o.length>0;function a(n,o){var r=t.get(n).internal(e);t.ctx.events.currentModeRender(r,(function(e){t.sources[o].push(e);}));}if(n.forEach((function(t){return a(t,"hot")})),o.forEach((function(t){return a(t,"cold")})),i&&t.ctx.map.getSource(m).setData({type:P,features:t.sources.cold}),t.ctx.map.getSource(v).setData({type:P,features:t.sources.hot}),t._emitSelectionChange&&(t.ctx.map.fire(U,{features:t.getSelected().map((function(t){return t.toGeoJSON()})),points:t.getSelectedCoordinates().map((function(t){return {type:M,properties:{},geometry:{type:L,coordinates:t.coordinates}}}))}),t._emitSelectionChange=!1),t._deletedFeaturesToEmit.length){var s=t._deletedFeaturesToEmit.map((function(t){return t.toGeoJSON()}));t._deletedFeaturesToEmit=[],t.ctx.map.fire(D,{features:s});}function u(){t.isDirty=!1,t.clearChangedIds();}u(),t.ctx.map.fire(V,{});}function Ct(t){var e,n=this;this._features={},this._featureIds=new tt,this._selectedFeatureIds=new tt,this._selectedCoordinates=[],this._changedFeatureIds=new tt,this._deletedFeaturesToEmit=[],this._emitSelectionChange=!1,this._mapInitialConfig={},this.ctx=t,this.sources={hot:[],cold:[]},this.render=function(){e||(e=requestAnimationFrame((function(){e=null,xt.call(n);})));},this.isDirty=!1;}function Et(t,e){var n=t._selectedCoordinates.filter((function(e){return t._selectedFeatureIds.has(e.feature_id)}));t._selectedCoordinates.length===n.length||e.silent||(t._emitSelectionChange=!0),t._selectedCoordinates=n;}Ct.prototype.createRenderBatch=function(){var t=this,e=this.render,n=0;return this.render=function(){n++;},function(){t.render=e,n>0&&t.render();}},Ct.prototype.setDirty=function(){return this.isDirty=!0,this},Ct.prototype.featureChanged=function(t){return this._changedFeatureIds.add(t),this},Ct.prototype.getChangedIds=function(){return this._changedFeatureIds.values()},Ct.prototype.clearChangedIds=function(){return this._changedFeatureIds.clear(),this},Ct.prototype.getAllIds=function(){return this._featureIds.values()},Ct.prototype.add=function(t){return this.featureChanged(t.id),this._features[t.id]=t,this._featureIds.add(t.id),this},Ct.prototype.delete=function(t,e){var n=this;return void 0===e&&(e={}),St(t).forEach((function(t){n._featureIds.has(t)&&(n._featureIds.delete(t),n._selectedFeatureIds.delete(t),e.silent||-1===n._deletedFeaturesToEmit.indexOf(n._features[t])&&n._deletedFeaturesToEmit.push(n._features[t]),delete n._features[t],n.isDirty=!0);})),Et(this,e),this},Ct.prototype.get=function(t){return this._features[t]},Ct.prototype.getAll=function(){var t=this;return Object.keys(this._features).map((function(e){return t._features[e]}))},Ct.prototype.select=function(t,e){var n=this;return void 0===e&&(e={}),St(t).forEach((function(t){n._selectedFeatureIds.has(t)||(n._selectedFeatureIds.add(t),n._changedFeatureIds.add(t),e.silent||(n._emitSelectionChange=!0));})),this},Ct.prototype.deselect=function(t,e){var n=this;return void 0===e&&(e={}),St(t).forEach((function(t){n._selectedFeatureIds.has(t)&&(n._selectedFeatureIds.delete(t),n._changedFeatureIds.add(t),e.silent||(n._emitSelectionChange=!0));})),Et(this,e),this},Ct.prototype.clearSelected=function(t){return void 0===t&&(t={}),this.deselect(this._selectedFeatureIds.values(),{silent:t.silent}),this},Ct.prototype.setSelected=function(t,e){var n=this;return void 0===e&&(e={}),t=St(t),this.deselect(this._selectedFeatureIds.values().filter((function(e){return -1===t.indexOf(e)})),{silent:e.silent}),this.select(t.filter((function(t){return !n._selectedFeatureIds.has(t)})),{silent:e.silent}),this},Ct.prototype.setSelectedCoordinates=function(t){return this._selectedCoordinates=t,this._emitSelectionChange=!0,this},Ct.prototype.clearSelectedCoordinates=function(){return this._selectedCoordinates=[],this._emitSelectionChange=!0,this},Ct.prototype.getSelectedIds=function(){return this._selectedFeatureIds.values()},Ct.prototype.getSelected=function(){var t=this;return this._selectedFeatureIds.values().map((function(e){return t.get(e)}))},Ct.prototype.getSelectedCoordinates=function(){var t=this;return this._selectedCoordinates.map((function(e){return {coordinates:t.get(e.feature_id).getCoordinate(e.coord_path)}}))},Ct.prototype.isSelected=function(t){return this._selectedFeatureIds.has(t)},Ct.prototype.setFeatureProperty=function(t,e,n){this.get(t).setProperty(e,n),this.featureChanged(t);},Ct.prototype.storeMapConfig=function(){var t=this;X.forEach((function(e){t.ctx.map[e]&&(t._mapInitialConfig[e]=t.ctx.map[e].isEnabled());}));},Ct.prototype.restoreMapConfig=function(){var t=this;Object.keys(this._mapInitialConfig).forEach((function(e){t._mapInitialConfig[e]?t.ctx.map[e].enable():t.ctx.map[e].disable();}));},Ct.prototype.getInitialConfigValue=function(t){return void 0===this._mapInitialConfig[t]||this._mapInitialConfig[t]};var Mt=function(){for(var t=arguments,e={},n=0;n<arguments.length;n++){var o=t[n];for(var r in o)wt.call(o,r)&&(e[r]=o[r]);}return e},wt=Object.prototype.hasOwnProperty;var It=["mode","feature","mouse"];function Lt(e){var n=null,o=null,r={onRemove:function(){return e.map.off("load",r.connect),clearInterval(o),r.removeLayers(),e.store.restoreMapConfig(),e.ui.removeButtons(),e.events.removeEventListeners(),e.ui.clearMapClasses(),e.map=null,e.container=null,e.store=null,n&&n.parentNode&&n.parentNode.removeChild(n),n=null,this},connect:function(){e.map.off("load",r.connect),clearInterval(o),r.addLayers(),e.store.storeMapConfig(),e.events.addEventListeners();},onAdd:function(i){var y=i.fire;return i.fire=function(t,e){var n=arguments;return 1===y.length&&1!==arguments.length&&(n=[Mt({},{type:t},e)]),y.apply(i,n)},e.map=i,e.events=function(e){var n=Object.keys(e.options.modes).reduce((function(t,n){return t[n]=_t(e.options.modes[n]),t}),{}),o={},r={},i={},a=null,s=null;i.drag=function(t,n){n({point:t.point,time:(new Date).getTime()})?(e.ui.queueMapClasses({mouse:S}),s.drag(t)):t.originalEvent.stopPropagation();},i.mousedrag=function(t){i.drag(t,(function(t){return !at(o,t)}));},i.touchdrag=function(t){i.drag(t,(function(t){return !st(r,t)}));},i.mousemove=function(t){if(1===(void 0!==t.originalEvent.buttons?t.originalEvent.buttons:t.originalEvent.which))return i.mousedrag(t);var n=rt(t,e);t.featureTarget=n,s.mousemove(t);},i.mousedown=function(t){o={time:(new Date).getTime(),point:t.point};var n=rt(t,e);t.featureTarget=n,s.mousedown(t);},i.mouseup=function(t){var n=rt(t,e);t.featureTarget=n,at(o,{point:t.point,time:(new Date).getTime()})?s.click(t):s.mouseup(t);},i.mouseout=function(t){s.mouseout(t);},i.touchstart=function(t){if(t.originalEvent.preventDefault(),e.options.touchEnabled){r={time:(new Date).getTime(),point:t.point};var n=nt.touch(t,null,e)[0];t.featureTarget=n,s.touchstart(t);}},i.touchmove=function(t){if(t.originalEvent.preventDefault(),e.options.touchEnabled)return s.touchmove(t),i.touchdrag(t)},i.touchend=function(t){if(t.originalEvent.preventDefault(),e.options.touchEnabled){var n=nt.touch(t,null,e)[0];t.featureTarget=n,st(r,{time:(new Date).getTime(),point:t.point})?s.tap(t):s.touchend(t);}};var u=function(t){return !(8===t||46===t||t>=48&&t<=57)};function c(o,r,i){void 0===i&&(i={}),s.stop();var u=n[o];if(void 0===u)throw new Error(o+" is not valid");a=o;var c=u(e,r);s=t(c,e),i.silent||e.map.fire(R,{mode:o}),e.store.setDirty(),e.store.render();}i.keydown=function(t){"mapboxgl-canvas"===(t.srcElement||t.target).classList[0]&&(8!==t.keyCode&&46!==t.keyCode||!e.options.controls.trash?u(t.keyCode)?s.keydown(t):49===t.keyCode&&e.options.controls.point?c(j.DRAW_POINT):50===t.keyCode&&e.options.controls.line_string?c(j.DRAW_LINE_STRING):51===t.keyCode&&e.options.controls.polygon&&c(j.DRAW_POLYGON):(t.preventDefault(),s.trash()));},i.keyup=function(t){u(t.keyCode)&&s.keyup(t);},i.zoomend=function(){e.store.changeZoom();},i.data=function(t){if("style"===t.dataType){var n=e.setup,o=e.map,r=e.options,i=e.store;r.styles.some((function(t){return o.getLayer(t.id)}))||(n.addLayers(),i.setDirty(),i.render());}};var l={trash:!1,combineFeatures:!1,uncombineFeatures:!1};return {start:function(){a=e.options.defaultMode,s=t(n[a](e),e);},changeMode:c,actionable:function(t){var n=!1;Object.keys(t).forEach((function(e){if(void 0===l[e])throw new Error("Invalid action type");l[e]!==t[e]&&(n=!0),l[e]=t[e];})),n&&e.map.fire(B,{actions:l});},currentModeName:function(){return a},currentModeRender:function(t,e){return s.render(t,e)},fire:function(t,e){i[t]&&i[t](e);},addEventListeners:function(){e.map.on("mousemove",i.mousemove),e.map.on("mousedown",i.mousedown),e.map.on("mouseup",i.mouseup),e.map.on("data",i.data),e.map.on("touchmove",i.touchmove),e.map.on("touchstart",i.touchstart),e.map.on("touchend",i.touchend),e.container.addEventListener("mouseout",i.mouseout),e.options.keybindings&&(e.container.addEventListener("keydown",i.keydown),e.container.addEventListener("keyup",i.keyup));},removeEventListeners:function(){e.map.off("mousemove",i.mousemove),e.map.off("mousedown",i.mousedown),e.map.off("mouseup",i.mouseup),e.map.off("data",i.data),e.map.off("touchmove",i.touchmove),e.map.off("touchstart",i.touchstart),e.map.off("touchend",i.touchend),e.container.removeEventListener("mouseout",i.mouseout),e.options.keybindings&&(e.container.removeEventListener("keydown",i.keydown),e.container.removeEventListener("keyup",i.keyup));},trash:function(t){s.trash(t);},combineFeatures:function(){s.combineFeatures();},uncombineFeatures:function(){s.uncombineFeatures();},getMode:function(){return a}}}(e),e.ui=function(t){var e={},n=null,o={mode:null,feature:null,mouse:null},r={mode:null,feature:null,mouse:null};function i(t){r=Mt(r,t);}function y(){var e,n;if(t.container){var i=[],a=[];It.forEach((function(t){r[t]!==o[t]&&(i.push(t+"-"+o[t]),null!==r[t]&&a.push(t+"-"+r[t]));})),i.length>0&&(e=t.container.classList).remove.apply(e,i),a.length>0&&(n=t.container.classList).add.apply(n,a),o=Mt(o,r);}}function v(t,e){void 0===e&&(e={});var o=document.createElement("button");return o.className=s+" "+e.className,o.setAttribute("title",e.title),e.container.appendChild(o),o.addEventListener("click",(function(o){if(o.preventDefault(),o.stopPropagation(),o.target===n)return m(),void e.onDeactivate();b(t),e.onActivate();}),!0),o}function m(){n&&(n.classList.remove(g),n=null);}function b(t){m();var o=e[t];o&&o&&"trash"!==t&&(o.classList.add(g),n=o);}return {setActiveButton:b,queueMapClasses:i,updateMapClasses:y,clearMapClasses:function(){i({mode:null,feature:null,mouse:null}),y();},addButtons:function(){var n=t.options.controls,o=document.createElement("div");return o.className=h+" "+a,n?(n[E.LINE]&&(e[E.LINE]=v(E.LINE,{container:o,className:u,title:"LineString tool "+(t.options.keybindings?"(l)":""),onActivate:function(){return t.events.changeMode(j.DRAW_LINE_STRING)},onDeactivate:function(){return t.events.trash()}})),n[E.POLYGON]&&(e[E.POLYGON]=v(E.POLYGON,{container:o,className:c,title:"Polygon tool "+(t.options.keybindings?"(p)":""),onActivate:function(){return t.events.changeMode(j.DRAW_POLYGON)},onDeactivate:function(){return t.events.trash()}})),n[E.POINT]&&(e[E.POINT]=v(E.POINT,{container:o,className:l,title:"Marker tool "+(t.options.keybindings?"(m)":""),onActivate:function(){return t.events.changeMode(j.DRAW_POINT)},onDeactivate:function(){return t.events.trash()}})),n.trash&&(e.trash=v("trash",{container:o,className:d,title:"Delete",onActivate:function(){t.events.trash();}})),n.combine_features&&(e.combine_features=v("combineFeatures",{container:o,className:p,title:"Combine",onActivate:function(){t.events.combineFeatures();}})),n.uncombine_features&&(e.uncombine_features=v("uncombineFeatures",{container:o,className:f,title:"Uncombine",onActivate:function(){t.events.uncombineFeatures();}})),o):o},removeButtons:function(){Object.keys(e).forEach((function(t){var n=e[t];n.parentNode&&n.parentNode.removeChild(n),delete e[t];}));}}}(e),e.container=i.getContainer(),e.store=new Ct(e),n=e.ui.addButtons(),e.options.boxSelect&&(i.boxZoom.disable(),i.dragPan.disable(),i.dragPan.enable()),i.loaded()?r.connect():(i.on("load",r.connect),o=setInterval((function(){i.loaded()&&r.connect();}),16)),e.events.start(),n},addLayers:function(){e.map.addSource(m,{data:{type:P,features:[]},type:"geojson"}),e.map.addSource(v,{data:{type:P,features:[]},type:"geojson"}),e.options.styles.forEach((function(t){e.map.addLayer(t);})),e.store.setDirty(!0),e.store.render();},removeLayers:function(){e.options.styles.forEach((function(t){e.map.getLayer(t.id)&&e.map.removeLayer(t.id);})),e.map.getSource(m)&&e.map.removeSource(m),e.map.getSource(v)&&e.map.removeSource(v);}};return e.setup=r,r}function Pt(t){return function(e){var n=e.featureTarget;return !!n&&(!!n.properties&&n.properties.meta===t)}}function Ft(t){return !!t.featureTarget&&(!!t.featureTarget.properties&&(t.featureTarget.properties.active===Z&&t.featureTarget.properties.meta===W))}function Ot(t){return !!t.featureTarget&&(!!t.featureTarget.properties&&(t.featureTarget.properties.active===K&&t.featureTarget.properties.meta===W))}function kt(t){return void 0===t.featureTarget}function Tt(t){var e=t.featureTarget;return !!e&&(!!e.properties&&e.properties.meta===Y)}function jt(t){return !!t.originalEvent&&!0===t.originalEvent.shiftKey}function At(t){return 27===t.keyCode}function Dt(t){return 13===t.keyCode}var Nt=Ut;function Ut(t,e){this.x=t,this.y=e;}function Rt(t,e){var n=e.getBoundingClientRect();return new Nt(t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0))}function Bt(t,e,n,o){return {type:M,properties:{meta:Y,parent:t,coord_path:n,active:o?Z:K},geometry:{type:L,coordinates:e}}}function Vt(t,e,n){void 0===e&&(e={}),void 0===n&&(n=null);var o,r=t.geometry,i=r.type,a=r.coordinates,s=t.properties&&t.properties.id,u=[];function c(t,n){var o="",r=null;t.forEach((function(t,i){var a=null!=n?n+"."+i:String(i),c=Bt(s,t,a,l(a));if(e.midpoints&&r){var d=function(t,e,n){var o=e.geometry.coordinates,r=n.geometry.coordinates;if(o[1]>85||o[1]<-85||r[1]>85||r[1]<-85)return null;var i={lng:(o[0]+r[0])/2,lat:(o[1]+r[1])/2};return {type:M,properties:{meta:q,parent:t,lng:i.lng,lat:i.lat,coord_path:n.properties.coord_path},geometry:{type:L,coordinates:[i.lng,i.lat]}}}(s,r,c);d&&u.push(d);}r=c;var p=JSON.stringify(t);o!==p&&u.push(c),0===i&&(o=p);}));}function l(t){return !!e.selectedPaths&&-1!==e.selectedPaths.indexOf(t)}return i===L?u.push(Bt(s,a,n,l(n))):i===w?a.forEach((function(t,e){c(t,null!==n?n+"."+e:String(e));})):i===I?c(a,n):0===i.indexOf(F)&&(o=i.replace(F,""),a.forEach((function(n,r){var i={type:M,properties:t.properties,geometry:{type:o,coordinates:n}};u=u.concat(Vt(i,e,r));}))),u}Ut.prototype={clone:function(){return new Ut(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},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(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,n=t.y-this.y;return e*e+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,n=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=n,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),n=Math.sin(t),o=e*this.x-n*this.y,r=n*this.x+e*this.y;return this.x=o,this.y=r,this},_rotateAround:function(t,e){var n=Math.cos(t),o=Math.sin(t),r=e.x+n*(this.x-e.x)-o*(this.y-e.y),i=e.y+o*(this.x-e.x)+n*(this.y-e.y);return this.x=r,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Ut.convert=function(t){return t instanceof Ut?t:Array.isArray(t)?new Ut(t[0],t[1]):t};var Jt=function(t){setTimeout((function(){t.map&&t.map.doubleClickZoom&&t._ctx&&t._ctx.store&&t._ctx.store.getInitialConfigValue&&t._ctx.store.getInitialConfigValue("doubleClickZoom")&&t.map.doubleClickZoom.enable();}),0);},Gt=function(t){setTimeout((function(){t.map&&t.map.doubleClickZoom&&t.map.doubleClickZoom.disable();}),0);},zt=function(t){if(!t||!t.type)return null;var e=$t[t.type];if(!e)return null;if("geometry"===e)return {type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]};if("feature"===e)return {type:"FeatureCollection",features:[t]};if("featurecollection"===e)return t},$t={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"};function Wt(t){switch(t&&t.type||null){case"FeatureCollection":return t.features=t.features.reduce((function(t,e){return t.concat(Wt(e))}),[]),t;case"Feature":return t.geometry?Wt(t.geometry).map((function(e){var n={type:"Feature",properties:JSON.parse(JSON.stringify(t.properties)),geometry:e};return void 0!==t.id&&(n.id=t.id),n})):[t];case"MultiPoint":return t.coordinates.map((function(t){return {type:"Point",coordinates:t}}));case"MultiPolygon":return t.coordinates.map((function(t){return {type:"Polygon",coordinates:t}}));case"MultiLineString":return t.coordinates.map((function(t){return {type:"LineString",coordinates:t}}));case"GeometryCollection":return t.geometries.map(Wt).reduce((function(t,e){return t.concat(e)}),[]);case"Point":case"Polygon":case"LineString":return [t]}}var qt=function(t){if(!t)return [];var e=Wt(zt(t)),n=[];return e.features.forEach((function(t){t.geometry&&(n=n.concat(function t(e){return Array.isArray(e)&&e.length&&"number"==typeof e[0]?[e]:e.reduce((function(e,n){return Array.isArray(n)&&Array.isArray(n[0])?e.concat(t(n)):(e.push(n),e)}),[])}(t.geometry.coordinates)));})),n},Yt=ut((function(t){var e=t.exports=function(t){return new n(t)};function n(t){this.value=t;}function o(t,e,n){var o=[],a=[],l=!0;return function t(d){var p=n?r(d):d,f={},h=!0,g={node:p,node_:d,path:[].concat(o),parent:a[a.length-1],parents:a,key:o.slice(-1)[0],isRoot:0===o.length,level:o.length,circular:null,update:function(t,e){g.isRoot||(g.parent.node[g.key]=t),g.node=t,e&&(h=!1);},delete:function(t){delete g.parent.node[g.key],t&&(h=!1);},remove:function(t){s(g.parent.node)?g.parent.node.splice(g.key,1):delete g.parent.node[g.key],t&&(h=!1);},keys:null,before:function(t){f.before=t;},after:function(t){f.after=t;},pre:function(t){f.pre=t;},post:function(t){f.post=t;},stop:function(){l=!1;},block:function(){h=!1;}};if(!l)return g;function y(){if("object"==typeof g.node&&null!==g.node){g.keys&&g.node_===g.node||(g.keys=i(g.node)),g.isLeaf=0==g.keys.length;for(var t=0;t<a.length;t++)if(a[t].node_===d){g.circular=a[t];break}}else g.isLeaf=!0,g.keys=null;g.notLeaf=!g.isLeaf,g.notRoot=!g.isRoot;}y();var v=e.call(g,g.node);return void 0!==v&&g.update&&g.update(v),f.before&&f.before.call(g,g.node),h?("object"!=typeof g.node||null===g.node||g.circular||(a.push(g),y(),u(g.keys,(function(e,r){o.push(e),f.pre&&f.pre.call(g,g.node[e],e);var i=t(g.node[e]);n&&c.call(g.node,e)&&(g.node[e]=i.node),i.isLast=r==g.keys.length-1,i.isFirst=0==r,f.post&&f.post.call(g,i),o.pop();})),a.pop()),f.after&&f.after.call(g,g.node),g):g}(t).node}function r(t){if("object"==typeof t&&null!==t){var e;if(s(t))e=[];else if("[object Date]"===a(t))e=new Date(t.getTime?t.getTime():t);else if(function(t){return "[object RegExp]"===a(t)}(t))e=new RegExp(t);else if(function(t){return "[object Error]"===a(t)}(t))e={message:t.message};else if(function(t){return "[object Boolean]"===a(t)}(t))e=new Boolean(t);else if(function(t){return "[object Number]"===a(t)}(t))e=new Number(t);else if(function(t){return "[object String]"===a(t)}(t))e=new String(t);else if(Object.create&&Object.getPrototypeOf)e=Object.create(Object.getPrototypeOf(t));else if(t.constructor===Object)e={};else {var n=t.constructor&&t.constructor.prototype||t.__proto__||{},o=function(){};o.prototype=n,e=new o;}return u(i(t),(function(n){e[n]=t[n];})),e}return t}n.prototype.get=function(t){for(var e=this.value,n=0;n<t.length;n++){var o=t[n];if(!e||!c.call(e,o)){e=void 0;break}e=e[o];}return e},n.prototype.has=function(t){for(var e=this.value,n=0;n<t.length;n++){var o=t[n];if(!e||!c.call(e,o))return !1;e=e[o];}return !0},n.prototype.set=function(t,e){for(var n=this.value,o=0;o<t.length-1;o++){var r=t[o];c.call(n,r)||(n[r]={}),n=n[r];}return n[t[o]]=e,e},n.prototype.map=function(t){return o(this.value,t,!0)},n.prototype.forEach=function(t){return this.value=o(this.value,t,!1),this.value},n.prototype.reduce=function(t,e){var n=1===arguments.length,o=n?this.value:e;return this.forEach((function(e){this.isRoot&&n||(o=t.call(this,o,e));})),o},n.prototype.paths=function(){var t=[];return this.forEach((function(e){t.push(this.path);})),t},n.prototype.nodes=function(){var t=[];return this.forEach((function(e){t.push(this.node);})),t},n.prototype.clone=function(){var t=[],e=[];return function n(o){for(var a=0;a<t.length;a++)if(t[a]===o)return e[a];if("object"==typeof o&&null!==o){var s=r(o);return t.push(o),e.push(s),u(i(o),(function(t){s[t]=n(o[t]);})),t.pop(),e.pop(),s}return o}(this.value)};var i=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};function a(t){return Object.prototype.toString.call(t)}var s=Array.isArray||function(t){return "[object Array]"===Object.prototype.toString.call(t)},u=function(t,e){if(t.forEach)return t.forEach(e);for(var n=0;n<t.length;n++)e(t[n],n,t);};u(i(n.prototype),(function(t){e[t]=function(e){var o=[].slice.call(arguments,1),r=new n(e);return r[t].apply(r,o)};}));var c=Object.hasOwnProperty||function(t,e){return e in t};})),Zt=Kt;function Kt(t){if(!(this instanceof Kt))return new Kt(t);this._bbox=t||[1/0,1/0,-1/0,-1/0],this._valid=!!t;}Kt.prototype.include=function(t){return this._valid=!0,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[0]),this._bbox[3]=Math.max(this._bbox[3],t[1]),this},Kt.prototype.equals=function(t){var e;return e=t instanceof Kt?t.bbox():t,this._bbox[0]==e[0]&&this._bbox[1]==e[1]&&this._bbox[2]==e[2]&&this._bbox[3]==e[3]},Kt.prototype.center=function(t){return this._valid?[(this._bbox[0]+this._bbox[2])/2,(this._bbox[1]+this._bbox[3])/2]:null},Kt.prototype.union=function(t){var e;return this._valid=!0,e=t instanceof Kt?t.bbox():t,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[2]),this._bbox[3]=Math.max(this._bbox[3],e[3]),this},Kt.prototype.bbox=function(){return this._valid?this._bbox:null},Kt.prototype.contains=function(t){if(!t)return this._fastContains();if(!this._valid)return null;var e=t[0],n=t[1];return this._bbox[0]<=e&&this._bbox[1]<=n&&this._bbox[2]>=e&&this._bbox[3]>=n},Kt.prototype.intersect=function(t){return this._valid?(e=t instanceof Kt?t.bbox():t,!(this._bbox[0]>e[2]||this._bbox[2]<e[0]||this._bbox[3]<e[1]||this._bbox[1]>e[3])):null;var e;},Kt.prototype._fastContains=function(){if(!this._valid)return new Function("return null;");var t="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",t)},Kt.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 Xt={features:["FeatureCollection"],coordinates:["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],geometry:["Feature"],geometries:["GeometryCollection"]},Ht=Object.keys(Xt),Qt=function(t){return te(t).bbox()};function te(t){for(var e=Zt(),n=qt(t),o=0;o<n.length;o++)e.include(n[o]);return e}Qt.polygon=function(t){return te(t).polygon()},Qt.bboxify=function(t){return Yt(t).map((function(t){t&&(Ht.some((function(e){return !!t[e]&&-1!==Xt[e].indexOf(t.type)}))&&(t.bbox=te(t).bbox(),this.update(t)));}))};function ee(t,e){var n=-90,o=90,r=-90,i=90,a=270,s=-270;t.forEach((function(t){var e=Qt(t),u=e[1],c=e[3],l=e[0],d=e[2];u>n&&(n=u),c<o&&(o=c),c>r&&(r=c),u<i&&(i=u),l<a&&(a=l),d>s&&(s=d);}));var u=e;return n+u.lat>85&&(u.lat=85-n),r+u.lat>90&&(u.lat=90-r),o+u.lat<-85&&(u.lat=-85-o),i+u.lat<-90&&(u.lat=-90-i),a+u.lng<=-270&&(u.lng+=360*Math.ceil(Math.abs(u.lng)/360)),s+u.lng>=270&&(u.lng-=360*Math.ceil(Math.abs(u.lng)/360)),u}function ne(t,e){var n=ee(t.map((function(t){return t.toGeoJSON()})),e);t.forEach((function(t){var e,o=t.getCoordinates(),r=function(t){var e={lng:t[0]+n.lng,lat:t[1]+n.lat};return [e.lng,e.lat]},i=function(t){return t.map((function(t){return r(t)}))};t.type===L?e=r(o):t.type===I||t.type===O?e=o.map(r):t.type===w||t.type===k?e=o.map(i):t.type===T&&(e=o.map((function(t){return t.map((function(t){return i(t)}))}))),t.incomingCoords(e);}));}var oe={onSetup:function(t){var e=this,n={dragMoveLocation:null,boxSelectStartLocation:null,boxSelectElement:void 0,boxSelecting:!1,canBoxSelect:!1,dragMoving:!1,canDragMove:!1,initiallySelectedFeatureIds:t.featureIds||[]};return this.setSelected(n.initiallySelectedFeatureIds.filter((function(t){return void 0!==e.getFeature(t)}))),this.fireActionable(),this.setActionableState({combineFeatures:!0,uncombineFeatures:!0,trash:!0}),n},fireUpdate:function(){this.map.fire(N,{action:z,features:this.getSelected().map((function(t){return t.toGeoJSON()}))});},fireActionable:function(){var t=this,e=this.getSelected(),n=e.filter((function(e){return t.isInstanceOf("MultiFeature",e)})),o=!1;if(e.length>1){o=!0;var r=e[0].type.replace("Multi","");e.forEach((function(t){t.type.replace("Multi","")!==r&&(o=!1);}));}var i=n.length>0,a=e.length>0;this.setActionableState({combineFeatures:o,uncombineFeatures:i,trash:a});},getUniqueIds:function(t){return t.length?t.map((function(t){return t.properties.id})).filter((function(t){return void 0!==t})).reduce((function(t,e){return t.add(e),t}),new tt).values():[]},stopExtendedInteractions:function(t){t.boxSelectElement&&(t.boxSelectElement.parentNode&&t.boxSelectElement.parentNode.removeChild(t.boxSelectElement),t.boxSelectElement=null),this.map.dragPan.enable(),t.boxSelecting=!1,t.canBoxSelect=!1,t.dragMoving=!1,t.canDragMove=!1;},onStop:function(){Jt(this);},onMouseMove:function(t){return this.stopExtendedInteractions(t),!0},onMouseOut:function(t){return !t.dragMoving||this.fireUpdate()}};oe.onTap=oe.onClick=function(t,e){return kt(e)?this.clickAnywhere(t,e):Pt(Y)(e)?this.clickOnVertex(t,e):function(t){return !!t.featureTarget&&(!!t.featureTarget.properties&&t.featureTarget.properties.meta===W)}(e)?this.clickOnFeature(t,e):void 0},oe.clickAnywhere=function(t){var e=this,n=this.getSelectedIds();n.length&&(this.clearSelectedFeatures(),n.forEach((function(t){return e.doRender(t)}))),Jt(this),this.stopExtendedInteractions(t);},oe.clickOnVertex=function(t,e){this.changeMode(j.DIRECT_SELECT,{featureId:e.featureTarget.properties.parent,coordPath:e.featureTarget.properties.coord_path,startPos:e.lngLat}),this.updateUIClasses({mouse:_});},oe.startOnActiveFeature=function(t,e){this.stopExtendedInteractions(t),this.map.dragPan.disable(),this.doRender(e.featureTarget.properties.id),t.canDragMove=!0,t.dragMoveLocation=e.lngLat;},oe.clickOnFeature=function(t,e){var n=this;Gt(this),this.stopExtendedInteractions(t);var o=jt(e),r=this.getSelectedIds(),i=e.featureTarget.properties.id,a=this.isSelected(i);if(!o&&a&&this.getFeature(i).type!==L)return this.changeMode(j.DIRECT_SELECT,{featureId:i});a&&o?(this.deselect(i),this.updateUIClasses({mouse:x}),1===r.length&&Jt(this)):!a&&o?(this.select(i),this.updateUIClasses({mouse:_})):a||o||(r.forEach((function(t){return n.doRender(t)})),this.setSelected(i),this.updateUIClasses({mouse:_})),this.doRender(i);},oe.onMouseDown=function(t,e){return Ft(e)?this.startOnActiveFeature(t,e):this.drawConfig.boxSelect&&function(t){return !!t.originalEvent&&(!!t.originalEvent.shiftKey&&0===t.originalEvent.button)}(e)?this.startBoxSelect(t,e):void 0},oe.startBoxSelect=function(t,e){this.stopExtendedInteractions(t),this.map.dragPan.disable(),t.boxSelectStartLocation=Rt(e.originalEvent,this.map.getContainer()),t.canBoxSelect=!0;},oe.onTouchStart=function(t,e){if(Ft(e))return this.startOnActiveFeature(t,e)},oe.onDrag=function(t,e){return t.canDragMove?this.dragMove(t,e):this.drawConfig.boxSelect&&t.canBoxSelect?this.whileBoxSelect(t,e):void 0},oe.whileBoxSelect=function(t,e){t.boxSelecting=!0,this.updateUIClasses({mouse:b}),t.boxSelectElement||(t.boxSelectElement=document.createElement("div"),t.boxSelectElement.classList.add(y),this.map.getContainer().appendChild(t.boxSelectElement));var n=Rt(e.originalEvent,this.map.getContainer()),o=Math.min(t.boxSelectStartLocation.x,n.x),r=Math.max(t.boxSelectStartLocation.x,n.x),i=Math.min(t.boxSelectStartLocation.y,n.y),a=Math.max(t.boxSelectStartLocation.y,n.y),s="translate("+o+"px, "+i+"px)";t.boxSelectElement.style.transform=s,t.boxSelectElement.style.WebkitTransform=s,t.boxSelectElement.style.width=r-o+"px",t.boxSelectElement.style.height=a-i+"px";},oe.dragMove=function(t,e){t.dragMoving=!0,e.originalEvent.stopPropagation();var n={lng:e.lngLat.lng-t.dragMoveLocation.lng,lat:e.lngLat.lat-t.dragMoveLocation.lat};ne(this.getSelected(),n),t.dragMoveLocation=e.lngLat;},oe.onMouseUp=function(t,e){var n=this;if(t.dragMoving)this.fireUpdate();else if(t.boxSelecting){var o=[t.boxSelectStartLocation,Rt(e.originalEvent,this.map.getContainer())],r=this.featuresAt(null,o,"click"),i=this.getUniqueIds(r).filter((function(t){return !n.isSelected(t)}));i.length&&(this.select(i),i.forEach((function(t){return n.doRender(t)})),this.updateUIClasses({mouse:_}));}this.stopExtendedInteractions(t);},oe.toDisplayFeatures=function(t,e,n){e.properties.active=this.isSelected(e.properties.id)?Z:K,n(e),this.fireActionable(),e.properties.active===Z&&e.geometry.type!==L&&Vt(e).forEach(n);},oe.onTrash=function(){this.deleteFeature(this.getSelectedIds()),this.fireActionable();},oe.onCombineFeatures=function(){var t=this.getSelected();if(!(0===t.length||t.length<2)){for(var e=[],n=[],o=t[0].type.replace("Multi",""),r=0;r<t.length;r++){var i=t[r];if(i.type.replace("Multi","")!==o)return;i.type.includes("Multi")?i.getCoordinates().forEach((function(t){e.push(t);})):e.push(i.getCoordinates()),n.push(i.toGeoJSON());}if(n.length>1){var a=this.newFeature({type:M,properties:n[0].properties,geometry:{type:"Multi"+o,coordinates:e}});this.addFeature(a),this.deleteFeature(this.getSelectedIds(),{silent:!0}),this.setSelected([a.id]),this.map.fire(J,{createdFeatures:[a.toGeoJSON()],deletedFeatures:n});}this.fireActionable();}},oe.onUncombineFeatures=function(){var t=this,e=this.getSelected();if(0!==e.length){for(var n=[],o=[],r=function(r){var i=e[r];t.isInstanceOf("MultiFeature",i)&&(i.getFeatures().forEach((function(e){t.addFeature(e),e.properties=i.properties,n.push(e.toGeoJSON()),t.select([e.id]);})),t.deleteFeature(i.id,{silent:!0}),o.push(i.toGeoJSON()));},i=0;i<e.length;i++)r(i);n.length>1&&this.map.fire(G,{createdFeatures:n,deletedFeatures:o}),this.fireActionable();}};var re=Pt(Y),ie=Pt(q),ae={fireUpdate:function(){this.map.fire(N,{action:$,features:this.getSelected().map((function(t){return t.toGeoJSON()}))});},fireActionable:function(t){this.setActionableState({combineFeatures:!1,uncombineFeatures:!1,trash:t.selectedCoordPaths.length>0});},startDragging:function(t,e){this.map.dragPan.disable(),t.canDragMove=!0,t.dragMoveLocation=e.lngLat;},stopDragging:function(t){this.map.dragPan.enable(),t.dragMoving=!1,t.canDragMove=!1,t.dragMoveLocation=null;},onVertex:function(t,e){this.startDragging(t,e);var n=e.featureTarget.properties,o=t.selectedCoordPaths.indexOf(n.coord_path);jt(e)||-1!==o?jt(e)&&-1===o&&t.selectedCoordPaths.push(n.coord_path):t.selectedCoordPaths=[n.coord_path];var r=this.pathsToCoordinates(t.featureId,t.selectedCoordPaths);this.setSelectedCoordinates(r);},onMidpoint:function(t,e){this.startDragging(t,e);var n=e.featureTarget.properties;t.feature.addCoordinate(n.coord_path,n.lng,n.lat),this.fireUpdate(),t.selectedCoordPaths=[n.coord_path];},pathsToCoordinates:function(t,e){return e.map((function(e){return {feature_id:t,coord_path:e}}))},onFeature:function(t,e){0===t.selectedCoordPaths.length?this.startDragging(t,e):this.stopDragging(t);},dragFeature:function(t,e,n){ne(this.getSelected(),n),t.dragMoveLocation=e.lngLat;},dragVertex:function(t,e,n){for(var o=t.selectedCoordPaths.map((function(e){return t.feature.getCoordinate(e)})),r=ee(o.map((function(t){return {type:M,properties:{},geometry:{type:L,coordinates:t}}})),n),i=0;i<o.length;i++){var a=o[i];t.feature.updateCoordinate(t.selectedCoordPaths[i],a[0]+r.lng,a[1]+r.lat);}},clickNoTarget:function(){this.changeMode(j.SIMPLE_SELECT);},clickInactive:function(){this.changeMode(j.SIMPLE_SELECT);},clickActiveFeature:function(t){t.selectedCoordPaths=[],this.clearSelectedCoordinates(),t.feature.changed();},onSetup:function(t){var e=t.featureId,n=this.getFeature(e);if(!n)throw new Error("You must provide a featureId to enter direct_select mode");if(n.type===L)throw new TypeError("direct_select mode doesn't handle point features");var o={featureId:e,feature:n,dragMoveLocation:t.startPos||null,dragMoving:!1,canDragMove:!1,selectedCoordPaths:t.coordPath?[t.coordPath]:[]};return this.setSelectedCoordinates(this.pathsToCoordinates(e,o.selectedCoordPaths)),this.setSelected(e),Gt(this),this.setActionableState({trash:!0}),o},onStop:function(){Jt(this),this.clearSelectedCoordinates();},toDisplayFeatures:function(t,e,n){t.featureId===e.properties.id?(e.properties.active=Z,n(e),Vt(e,{map:this.map,midpoints:!0,selectedPaths:t.selectedCoordPaths}).forEach(n)):(e.properties.active=K,n(e)),this.fireActionable(t);},onTrash:function(t){t.selectedCoordPaths.sort((function(t,e){return e.localeCompare(t,"en",{numeric:!0})})).forEach((function(e){return t.feature.removeCoordinate(e)})),this.fireUpdate(),t.selectedCoordPaths=[],this.clearSelectedCoordinates(),this.fireActionable(t),!1===t.feature.isValid()&&(this.deleteFeature([t.featureId]),this.changeMode(j.SIMPLE_SELECT,{}));},onMouseMove:function(t,e){var n=Ft(e),o=re(e),r=0===t.selectedCoordPaths.length;return n&&r||o&&!r?this.updateUIClasses({mouse:_}):this.updateUIClasses({mouse:C}),this.stopDragging(t),!0},onMouseOut:function(t){return t.dragMoving&&this.fireUpdate(),!0}};ae.onTouchStart=ae.onMouseDown=function(t,e){return re(e)?this.onVertex(t,e):Ft(e)?this.onFeature(t,e):ie(e)?this.onMidpoint(t,e):void 0},ae.onDrag=function(t,e){if(!0===t.canDragMove){t.dragMoving=!0,e.originalEvent.stopPropagation();var n={lng:e.lngLat.lng-t.dragMoveLocation.lng,lat:e.lngLat.lat-t.dragMoveLocation.lat};t.selectedCoordPaths.length>0?this.dragVertex(t,e,n):this.dragFeature(t,e,n),t.dragMoveLocation=e.lngLat;}},ae.onClick=function(t,e){return kt(e)?this.clickNoTarget(t,e):Ft(e)?this.clickActiveFeature(t,e):Ot(e)?this.clickInactive(t,e):void this.stopDragging(t)},ae.onTap=function(t,e){return kt(e)?this.clickNoTarget(t,e):Ft(e)?this.clickActiveFeature(t,e):Ot(e)?this.clickInactive(t,e):void 0},ae.onTouchEnd=ae.onMouseUp=function(t){t.dragMoving&&this.fireUpdate(),this.stopDragging(t);};var se={};function ue(t,e){return !!t.lngLat&&(t.lngLat.lng===e[0]&&t.lngLat.lat===e[1])}se.onSetup=function(){var t=this.newFeature({type:M,properties:{},geometry:{type:L,coordinates:[]}});return this.addFeature(t),this.clearSelectedFeatures(),this.updateUIClasses({mouse:b}),this.activateUIButton(E.POINT),this.setActionableState({trash:!0}),{point:t}},se.stopDrawingAndRemove=function(t){this.deleteFeature([t.point.id],{silent:!0}),this.changeMode(j.SIMPLE_SELECT);},se.onTap=se.onClick=function(t,e){this.updateUIClasses({mouse:_}),t.point.updateCoordinate("",e.lngLat.lng,e.lngLat.lat),this.map.fire(A,{features:[t.point.toGeoJSON()]}),this.changeMode(j.SIMPLE_SELECT,{featureIds:[t.point.id]});},se.onStop=function(t){this.activateUIButton(),t.point.getCoordinate().length||this.deleteFeature([t.point.id],{silent:!0});},se.toDisplayFeatures=function(t,e,n){var o=e.properties.id===t.point.id;if(e.properties.active=o?Z:K,!o)return n(e)},se.onTrash=se.stopDrawingAndRemove,se.onKeyUp=function(t,e){if(At(e)||Dt(e))return this.stopDrawingAndRemove(t,e)};var ce={onSetup:function(){var t=this.newFeature({type:M,properties:{},geometry:{type:w,coordinates:[[]]}});return this.addFeature(t),this.clearSelectedFeatures(),Gt(this),this.updateUIClasses({mouse:b}),this.activateUIButton(E.POLYGON),this.setActionableState({trash:!0}),{polygon:t,currentVertexPosition:0}},clickAnywhere:function(t,e){if(t.currentVertexPosition>0&&ue(e,t.polygon.coordinates[0][t.currentVertexPosition-1]))return this.changeMode(j.SIMPLE_SELECT,{featureIds:[t.polygon.id]});this.updateUIClasses({mouse:b}),t.polygon.updateCoordinate("0."+t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat),t.currentVertexPosition++,t.polygon.updateCoordinate("0."+t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat);},clickOnVertex:function(t){return this.changeMode(j.SIMPLE_SELECT,{featureIds:[t.polygon.id]})},onMouseMove:function(t,e){t.polygon.updateCoordinate("0."+t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat),Tt(e)&&this.updateUIClasses({mouse:x});}};ce.onTap=ce.onClick=function(t,e){return Tt(e)?this.clickOnVertex(t,e):this.clickAnywhere(t,e)},ce.onKeyUp=function(t,e){At(e)?(this.deleteFeature([t.polygon.id],{silent:!0}),this.changeMode(j.SIMPLE_SELECT)):Dt(e)&&this.changeMode(j.SIMPLE_SELECT,{featureIds:[t.polygon.id]});},ce.onStop=function(t){this.updateUIClasses({mouse:C}),Jt(this),this.activateUIButton(),void 0!==this.getFeature(t.polygon.id)&&(t.polygon.removeCoordinate("0."+t.currentVertexPosition),t.polygon.isValid()?this.map.fire(A,{features:[t.polygon.toGeoJSON()]}):(this.deleteFeature([t.polygon.id],{silent:!0}),this.changeMode(j.SIMPLE_SELECT,{},{silent:!0})));},ce.toDisplayFeatures=function(t,e,n){var o=e.properties.id===t.polygon.id;if(e.properties.active=o?Z:K,!o)return n(e);if(0!==e.geometry.coordinates.length){var r=e.geometry.coordinates[0].length;if(!(r<3)){if(e.properties.meta=W,n(Bt(t.polygon.id,e.geometry.coordinates[0][0],"0.0",!1)),r>3){var i=e.geometry.coordinates[0].length-3;n(Bt(t.polygon.id,e.geometry.coordinates[0][i],"0."+i,!1));}if(r<=4){var a=[[e.geometry.coordinates[0][0][0],e.geometry.coordinates[0][0][1]],[e.geometry.coordinates[0][1][0],e.geometry.coordinates[0][1][1]]];if(n({type:M,properties:e.properties,geometry:{coordinates:a,type:I}}),3===r)return}return n(e)}}},ce.onTrash=function(t){this.deleteFeature([t.polygon.id],{silent:!0}),this.changeMode(j.SIMPLE_SELECT);};var le={onSetup:function(t){var e,n,o=(t=t||{}).featureId,r="forward";if(o){if(!(e=this.getFeature(o)))throw new Error("Could not find a feature with the provided featureId");var i=t.from;if(i&&"Feature"===i.type&&i.geometry&&"Point"===i.geometry.type&&(i=i.geometry),i&&"Point"===i.type&&i.coordinates&&2===i.coordinates.length&&(i=i.coordinates),!i||!Array.isArray(i))throw new Error("Please use the `from` property to indicate which point to continue the line from");var a=e.coordinates.length-1;if(e.coordinates[a][0]===i[0]&&e.coordinates[a][1]===i[1])n=a+1,e.addCoordinate.apply(e,[n].concat(e.coordinates[a]));else {if(e.coordinates[0][0]!==i[0]||e.coordinates[0][1]!==i[1])throw new Error("`from` should match the point at either the start or the end of the provided LineString");r="backwards",n=0,e.addCoordinate.apply(e,[n].concat(e.coordinates[0]));}}else e=this.newFeature({type:M,properties:{},geometry:{type:I,coordinates:[]}}),n=0,this.addFeature(e);return this.clearSelectedFeatures(),Gt(this),this.updateUIClasses({mouse:b}),this.activateUIButton(E.LINE),this.setActionableState({trash:!0}),{line:e,currentVertexPosition:n,direction:r}},clickAnywhere:function(t,e){if(t.currentVertexPosition>0&&ue(e,t.line.coordinates[t.currentVertexPosition-1])||"backwards"===t.direction&&ue(e,t.line.coordinates[t.currentVertexPosition+1]))return this.changeMode(j.SIMPLE_SELECT,{featureIds:[t.line.id]});this.updateUIClasses({mouse:b}),t.line.updateCoordinate(t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat),"forward"===t.direction?(t.currentVertexPosition++,t.line.updateCoordinate(t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat)):t.line.addCoordinate(0,e.lngLat.lng,e.lngLat.lat);},clickOnVertex:function(t){return this.changeMode(j.SIMPLE_SELECT,{featureIds:[t.line.id]})},onMouseMove:function(t,e){t.line.updateCoordinate(t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat),Tt(e)&&this.updateUIClasses({mouse:x});}};le.onTap=le.onClick=function(t,e){if(Tt(e))return this.clickOnVertex(t,e);this.clickAnywhere(t,e);},le.onKeyUp=function(t,e){Dt(e)?this.changeMode(j.SIMPLE_SELECT,{featureIds:[t.line.id]}):At(e)&&(this.deleteFeature([t.line.id],{silent:!0}),this.changeMode(j.SIMPLE_SELECT));},le.onStop=function(t){Jt(this),this.activateUIButton(),void 0!==this.getFeature(t.line.id)&&(t.line.removeCoordinate(""+t.currentVertexPosition),t.line.isValid()?this.map.fire(A,{features:[t.line.toGeoJSON()]}):(this.deleteFeature([t.line.id],{silent:!0}),this.changeMode(j.SIMPLE_SELECT,{},{silent:!0})));},le.onTrash=function(t){this.deleteFeature([t.line.id],{silent:!0}),this.changeMode(j.SIMPLE_SELECT);},le.toDisplayFeatures=function(t,e,n){var o=e.properties.id===t.line.id;if(e.properties.active=o?Z:K,!o)return n(e);e.geometry.coordinates.length<2||(e.properties.meta=W,n(Bt(t.line.id,e.geometry.coordinates["forward"===t.direction?e.geometry.coordinates.length-2:1],""+("forward"===t.direction?e.geometry.coordinates.length-2:1),!1)),n(e));};var de={simple_select:oe,direct_select:ae,draw_point:se,draw_polygon:ce,draw_line_string:le},pe={defaultMode:j.SIMPLE_SELECT,keybindings:!0,touchEnabled:!0,clickBuffer:2,touchBuffer:25,boxSelect:!0,displayControlsDefault:!0,styles:[{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"}}],modes:de,controls:{},userProperties:!1},fe={point:!0,line_string:!0,polygon:!0,trash:!0,combine_features:!0,uncombine_features:!0},he={point:!1,line_string:!1,polygon:!1,trash:!1,combine_features:!1,uncombine_features:!1};function ge(t,e){return t.map((function(t){return t.source?t:Mt(t,{id:t.id+"."+e,source:"hot"===e?v:m})}))}var ye=ut((function(t,e){var n="[object Arguments]",o="[object Map]",r="[object Object]",i="[object Set]",a=/^\[object .+?Constructor\]$/,s=/^(?:0|[1-9]\d*)$/,u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u[n]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u["[object Function]"]=u[o]=u["[object Number]"]=u[r]=u["[object RegExp]"]=u[i]=u["[object String]"]=u["[object WeakMap]"]=!1;var c="object"==typeof commonjsGlobal&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,l="object"==typeof self&&self&&self.Object===Object&&self,d=c||l||Function("return this")(),p=e&&!e.nodeType&&e,f=p&&t&&!t.nodeType&&t,h=f&&f.exports===p,g=h&&c.process,y=function(){try{return g&&g.binding&&g.binding("util")}catch(t){}}(),v=y&&y.isTypedArray;function m(t,e){for(var n=-1,o=null==t?0:t.length;++n<o;)if(e(t[n],n,t))return !0;return !1}function b(t){var e=-1,n=Array(t.size);return t.forEach((function(t,o){n[++e]=[o,t];})),n}function _(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t;})),n}var S,x,C,E=Array.prototype,M=Function.prototype,w=Object.prototype,I=d["__core-js_shared__"],L=M.toString,P=w.hasOwnProperty,F=(S=/[^.]+$/.exec(I&&I.keys&&I.keys.IE_PROTO||""))?"Symbol(src)_1."+S:"",O=w.toString,k=RegExp("^"+L.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),T=h?d.Buffer:void 0,j=d.Symbol,A=d.Uint8Array,D=w.propertyIsEnumerable,N=E.splice,U=j?j.toStringTag:void 0,R=Object.getOwnPropertySymbols,B=T?T.isBuffer:void 0,V=(x=Object.keys,C=Object,function(t){return x(C(t))}),J=yt(d,"DataView"),G=yt(d,"Map"),z=yt(d,"Promise"),$=yt(d,"Set"),W=yt(d,"WeakMap"),q=yt(Object,"create"),Y=_t(J),Z=_t(G),K=_t(z),X=_t($),H=_t(W),Q=j?j.prototype:void 0,tt=Q?Q.valueOf:void 0;function et(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1]);}}function nt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1]);}}function ot(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1]);}}function rt(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new ot;++e<n;)this.add(t[e]);}function it(t){var e=this.__data__=new nt(t);this.size=e.size;}function at(t,e){var n=Ct(t),o=!n&&xt(t),r=!n&&!o&&Et(t),i=!n&&!o&&!r&&Pt(t),a=n||o||r||i,s=a?function(t,e){for(var n=-1,o=Array(t);++n<t;)o[n]=e(n);return o}(t.length,String):[],u=s.length;for(var c in t)!e&&!P.call(t,c)||a&&("length"==c||r&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||bt(c,u))||s.push(c);return s}function st(t,e){for(var n=t.length;n--;)if(St(t[n][0],e))return n;return -1}function ut(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":U&&U in Object(t)?function(t){var e=P.call(t,U),n=t[U];try{t[U]=void 0;var o=!0;}catch(t){}var r=O.call(t);o&&(e?t[U]=n:delete t[U]);return r}(t):function(t){return O.call(t)}(t)}function ct(t){return Lt(t)&&ut(t)==n}function lt(t,e,a,s,u){return t===e||(null==t||null==e||!Lt(t)&&!Lt(e)?t!=t&&e!=e:function(t,e,a,s,u,c){var l=Ct(t),d=Ct(e),p=l?"[object Array]":mt(t),f=d?"[object Array]":mt(e),h=(p=p==n?r:p)==r,g=(f=f==n?r:f)==r,y=p==f;if(y&&Et(t)){if(!Et(e))return !1;l=!0,h=!1;}if(y&&!h)return c||(c=new it),l||Pt(t)?ft(t,e,a,s,u,c):function(t,e,n,r,a,s,u){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return !1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return !(t.byteLength!=e.byteLength||!s(new A(t),new A(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return St(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case o:var c=b;case i:var l=1&r;if(c||(c=_),t.size!=e.size&&!l)return !1;var d=u.get(t);if(d)return d==e;r|=2,u.set(t,e);var p=ft(c(t),c(e),r,a,s,u);return u.delete(t),p;case"[object Symbol]":if(tt)return tt.call(t)==tt.call(e)}return !1}(t,e,p,a,s,u,c);if(!(1&a)){var v=h&&P.call(t,"__wrapped__"),m=g&&P.call(e,"__wrapped__");if(v||m){var S=v?t.value():t,x=m?e.value():e;return c||(c=new it),u(S,x,a,s,c)}}if(!y)return !1;return c||(c=new it),function(t,e,n,o,r,i){var a=1&n,s=ht(t),u=s.length,c=ht(e).length;if(u!=c&&!a)return !1;var l=u;for(;l--;){var d=s[l];if(!(a?d in e:P.call(e,d)))return !1}var p=i.get(t);if(p&&i.get(e))return p==e;var f=!0;i.set(t,e),i.set(e,t);var h=a;for(;++l<u;){d=s[l];var g=t[d],y=e[d];if(o)var v=a?o(y,g,d,e,t,i):o(g,y,d,t,e,i);if(!(void 0===v?g===y||r(g,y,n,o,i):v)){f=!1;break}h||(h="constructor"==d);}if(f&&!h){var m=t.constructor,b=e.constructor;m==b||!("constructor"in t)||!("constructor"in e)||"function"==typeof m&&m instanceof m&&"function"==typeof b&&b instanceof b||(f=!1);}return i.delete(t),i.delete(e),f}(t,e,a,s,u,c)}(t,e,a,s,lt,u))}function dt(t){return !(!It(t)||function(t){return !!F&&F in t}(t))&&(Mt(t)?k:a).test(_t(t))}function pt(t){if(n=(e=t)&&e.constructor,o="function"==typeof n&&n.prototype||w,e!==o)return V(t);var e,n,o,r=[];for(var i in Object(t))P.call(t,i)&&"constructor"!=i&&r.push(i);return r}function ft(t,e,n,o,r,i){var a=1&n,s=t.length,u=e.length;if(s!=u&&!(a&&u>s))return !1;var c=i.get(t);if(c&&i.get(e))return c==e;var l=-1,d=!0,p=2&n?new rt:void 0;for(i.set(t,e),i.set(e,t);++l<s;){var f=t[l],h=e[l];if(o)var g=a?o(h,f,l,e,t,i):o(f,h,l,t,e,i);if(void 0!==g){if(g)continue;d=!1;break}if(p){if(!m(e,(function(t,e){if(a=e,!p.has(a)&&(f===t||r(f,t,n,o,i)))return p.push(e);var a;}))){d=!1;break}}else if(f!==h&&!r(f,h,n,o,i)){d=!1;break}}return i.delete(t),i.delete(e),d}function ht(t){return function(t,e,n){var o=e(t);return Ct(t)?o:function(t,e){for(var n=-1,o=e.length,r=t.length;++n<o;)t[r+n]=e[n];return t}(o,n(t))}(t,Ft,vt)}function gt(t,e){var n,o,r=t.__data__;return ("string"==(o=typeof(n=e))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?r["string"==typeof e?"string":"hash"]:r.map}function yt(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return dt(n)?n:void 0}et.prototype.clear=function(){this.__data__=q?q(null):{},this.size=0;},et.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},et.prototype.get=function(t){var e=this.__data__;if(q){var n=e[t];return "__lodash_hash_undefined__"===n?void 0:n}return P.call(e,t)?e[t]:void 0},et.prototype.has=function(t){var e=this.__data__;return q?void 0!==e[t]:P.call(e,t)},et.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=q&&void 0===e?"__lodash_hash_undefined__":e,this},nt.prototype.clear=function(){this.__data__=[],this.size=0;},nt.prototype.delete=function(t){var e=this.__data__,n=st(e,t);return !(n<0)&&(n==e.length-1?e.pop():N.call(e,n,1),--this.size,!0)},nt.prototype.get=function(t){var e=this.__data__,n=st(e,t);return n<0?void 0:e[n][1]},nt.prototype.has=function(t){return st(this.__data__,t)>-1},nt.prototype.set=function(t,e){var n=this.__data__,o=st(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this},ot.prototype.clear=function(){this.size=0,this.__data__={hash:new et,map:new(G||nt),string:new et};},ot.prototype.delete=function(t){var e=gt(this,t).delete(t);return this.size-=e?1:0,e},ot.prototype.get=function(t){return gt(this,t).get(t)},ot.prototype.has=function(t){return gt(this,t).has(t)},ot.prototype.set=function(t,e){var n=gt(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this},rt.prototype.add=rt.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},rt.prototype.has=function(t){return this.__data__.has(t)},it.prototype.clear=function(){this.__data__=new nt,this.size=0;},it.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},it.prototype.get=function(t){return this.__data__.get(t)},it.prototype.has=function(t){return this.__data__.has(t)},it.prototype.set=function(t,e){var n=this.__data__;if(n instanceof nt){var o=n.__data__;if(!G||o.length<199)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new ot(o);}return n.set(t,e),this.size=n.size,this};var vt=R?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,o=null==t?0:t.length,r=0,i=[];++n<o;){var a=t[n];e(a,n,t)&&(i[r++]=a);}return i}(R(t),(function(e){return D.call(t,e)})))}:function(){return []},mt=ut;function bt(t,e){return !!(e=null==e?9007199254740991:e)&&("number"==typeof t||s.test(t))&&t>-1&&t%1==0&&t<e}function _t(t){if(null!=t){try{return L.call(t)}catch(t){}try{return t+""}catch(t){}}return ""}function St(t,e){return t===e||t!=t&&e!=e}(J&&"[object DataView]"!=mt(new J(new ArrayBuffer(1)))||G&&mt(new G)!=o||z&&"[object Promise]"!=mt(z.resolve())||$&&mt(new $)!=i||W&&"[object WeakMap]"!=mt(new W))&&(mt=function(t){var e=ut(t),n=e==r?t.constructor:void 0,a=n?_t(n):"";if(a)switch(a){case Y:return "[object DataView]";case Z:return o;case K:return "[object Promise]";case X:return i;case H:return "[object WeakMap]"}return e});var xt=ct(function(){return arguments}())?ct:function(t){return Lt(t)&&P.call(t,"callee")&&!D.call(t,"callee")},Ct=Array.isArray;var Et=B||function(){return !1};function Mt(t){if(!It(t))return !1;var e=ut(t);return "[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function wt(t){return "number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function It(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Lt(t){return null!=t&&"object"==typeof t}var Pt=v?function(t){return function(e){return t(e)}}(v):function(t){return Lt(t)&&wt(t.length)&&!!u[ut(t)]};function Ft(t){return null!=(e=t)&&wt(e.length)&&!Mt(e)?at(t):pt(t);var e;}t.exports=function(t,e){return lt(t,e)};}));var ve={Polygon:ft,LineString:pt,Point:dt,MultiPolygon:yt,MultiLineString:yt,MultiPoint:yt};function me(t,e){return e.modes=j,e.getFeatureIdsAt=function(e){return nt.click({point:e},null,t).map((function(t){return t.properties.id}))},e.getSelectedIds=function(){return t.store.getSelectedIds()},e.getSelected=function(){return {type:P,features:t.store.getSelectedIds().map((function(e){return t.store.get(e)})).map((function(t){return t.toGeoJSON()}))}},e.getSelectedPoints=function(){return {type:P,features:t.store.getSelectedCoordinates().map((function(t){return {type:M,properties:{},geometry:{type:L,coordinates:t.coordinates}}}))}},e.set=function(n){if(void 0===n.type||n.type!==P||!Array.isArray(n.features))throw new Error("Invalid FeatureCollection");var o=t.store.createRenderBatch(),r=t.store.getAllIds().slice(),i=e.add(n),a=new tt(i);return (r=r.filter((function(t){return !a.has(t)}))).length&&e.delete(r),o(),i},e.add=function(e){var n=JSON.parse(JSON.stringify(zt(e))).features.map((function(e){if(e.id=e.id||ct(),null===e.geometry)throw new Error("Invalid geometry: null");if(void 0===t.store.get(e.id)||t.store.get(e.id).type!==e.geometry.type){var n=ve[e.geometry.type];if(void 0===n)throw new Error("Invalid geometry type: "+e.geometry.type+".");var o=new n(t,e);t.store.add(o);}else {var r=t.store.get(e.id);r.properties=e.properties,ye(r.getCoordinates(),e.geometry.coordinates)||r.incomingCoords(e.geometry.coordinates);}return e.id}));return t.store.render(),n},e.get=function(e){var n=t.store.get(e);if(n)return n.toGeoJSON()},e.getAll=function(){return {type:P,features:t.store.getAll().map((function(t){return t.toGeoJSON()}))}},e.delete=function(n){return t.store.delete(n,{silent:!0}),e.getMode()!==j.DIRECT_SELECT||t.store.getSelectedIds().length?t.store.render():t.events.changeMode(j.SIMPLE_SELECT,void 0,{silent:!0}),e},e.deleteAll=function(){return t.store.delete(t.store.getAllIds(),{silent:!0}),e.getMode()===j.DIRECT_SELECT?t.events.changeMode(j.SIMPLE_SELECT,void 0,{silent:!0}):t.store.render(),e},e.changeMode=function(n,o){return void 0===o&&(o={}),n===j.SIMPLE_SELECT&&e.getMode()===j.SIMPLE_SELECT?(r=o.featureIds||[],i=t.store.getSelectedIds(),r.length===i.length&&JSON.stringify(r.map((function(t){return t})).sort())===JSON.stringify(i.map((function(t){return t})).sort())||(t.store.setSelected(o.featureIds,{silent:!0}),t.store.render()),e):(n===j.DIRECT_SELECT&&e.getMode()===j.DIRECT_SELECT&&o.featureId===t.store.getSelectedIds()[0]||t.events.changeMode(n,o,{silent:!0}),e);var r,i;},e.getMode=function(){return t.events.getMode()},e.trash=function(){return t.events.trash({silent:!0}),e},e.combineFeatures=function(){return t.events.combineFeatures({silent:!0}),e},e.uncombineFeatures=function(){return t.events.uncombineFeatures({silent:!0}),e},e.setFeatureProperty=function(n,o,r){return t.store.setFeatureProperty(n,o,r),e},e}var be=function(t,e){var n={options:t=function(t){void 0===t&&(t={});var e=Mt(t);return t.controls||(e.controls={}),!1===t.displayControlsDefault?e.controls=Mt(he,t.controls):e.controls=Mt(fe,t.controls),(e=Mt(pe,e)).styles=ge(e.styles,"cold").concat(ge(e.styles,"hot")),e}(t)};e=me(n,e),n.api=e;var o=Lt(n);return e.onAdd=o.onAdd,e.onRemove=o.onRemove,e.types=E,e.options=t,e};function _e(t){be(t,this);}return _e.modes=de,_e}));
34
-
35
- });
36
-
37
36
  /*! @preserve
38
37
  * numeral.js
39
38
  * version : 2.0.6
@@ -19066,7 +19065,7 @@ function length(geojson, options) {
19066
19065
 
19067
19066
  // Radius mode
19068
19067
 
19069
- const RadiusMode = lodash.extend({}, mapboxGlDraw.modes.draw_line_string);
19068
+ const RadiusMode = lodash.extend({}, MapboxDraw__default["default"].modes.draw_line_string);
19070
19069
 
19071
19070
  function createVertex(parentId, coordinates, path, selected) {
19072
19071
  return {
@@ -19103,10 +19102,10 @@ function createGeoJSONCircle(
19103
19102
  const km = radiusInKm;
19104
19103
 
19105
19104
  const ret = [];
19106
- // const distanceX = km / 111.32;
19105
+ const distanceX = km / 111.32;
19107
19106
  // const distanceY = km / 110.574;
19108
- const distanceX =
19109
- km / (111.32 * Math.cos((coords.latitude * Math.PI) / 180));
19107
+ // const distanceX =
19108
+ // km / (111.32 * Math.cos((coords.latitude * Math.PI) / 180));
19110
19109
  const distanceY = km / 110.574;
19111
19110
 
19112
19111
  let theta;
@@ -19202,7 +19201,7 @@ const doubleClickZoom = {
19202
19201
  },
19203
19202
  };
19204
19203
  RadiusMode.onSetup = function (opts) {
19205
- const props = mapboxGlDraw.modes.draw_line_string.onSetup.call(this, opts);
19204
+ const props = MapboxDraw__default["default"].modes.draw_line_string.onSetup.call(this, opts);
19206
19205
  const circle = this.newFeature({
19207
19206
  type: "Feature",
19208
19207
  properties: {
@@ -19248,7 +19247,7 @@ RadiusMode.clickAnywhere = function (state, e) {
19248
19247
  };
19249
19248
 
19250
19249
  RadiusMode.onMouseMove = function (state, e) {
19251
- mapboxGlDraw.modes.draw_line_string.onMouseMove.call(this, state, e);
19250
+ MapboxDraw__default["default"].modes.draw_line_string.onMouseMove.call(this, state, e);
19252
19251
  const geojson = state.line.toGeoJSON();
19253
19252
  const center = geojson.geometry.coordinates[0];
19254
19253
  const radiusInKm = length(geojson, "kilometers");
@@ -19276,17 +19275,14 @@ RadiusMode.onStop = function (state) {
19276
19275
 
19277
19276
  // remove last added coordinate
19278
19277
  state.line.removeCoordinate("0");
19279
- if (state.line.isValid()) {
19280
- state.line.toGeoJSON();
19281
- this.deleteFeature([state.line.id], { silent: true });
19282
-
19278
+ if (state.circle.isValid()) {
19283
19279
  this.map.fire("draw.create", {
19284
19280
  features: [state.circle.toGeoJSON()],
19285
19281
  });
19286
19282
  } else {
19287
- this.deleteFeature([state.line.id], { silent: true });
19288
19283
  this.changeMode("simple_select", {}, { silent: true });
19289
19284
  }
19285
+ this.deleteFeature([state.line.id], { silent: true });
19290
19286
  };
19291
19287
 
19292
19288
  RadiusMode.toDisplayFeatures = function (state, geojson, display) {
@@ -1,8 +1,16 @@
1
- "use strict";function t(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var e=t(require("@turf/turf")),n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(t){var e={exports:{}};return t(e,e.exports),e.exports}var o=r((function(t,e){t.exports=function(){var t=function(t,e){var n={drag:[],click:[],mousemove:[],mousedown:[],mouseup:[],mouseout:[],keydown:[],keyup:[],touchstart:[],touchmove:[],touchend:[],tap:[]},r={on:function(t,e,r){if(void 0===n[t])throw new Error("Invalid event type: "+t);n[t].push({selector:e,fn:r})},render:function(t){e.store.featureChanged(t)}},o=function(t,o){for(var i=n[t],u=i.length;u--;){var a=i[u];if(a.selector(o)){a.fn.call(r,o)||e.store.render(),e.ui.updateMapClasses();break}}};return t.start.call(r),{render:t.render,stop:function(){t.stop&&t.stop()},trash:function(){t.trash&&(t.trash(),e.store.render())},combineFeatures:function(){t.combineFeatures&&t.combineFeatures()},uncombineFeatures:function(){t.uncombineFeatures&&t.uncombineFeatures()},drag:function(t){o("drag",t)},click:function(t){o("click",t)},mousemove:function(t){o("mousemove",t)},mousedown:function(t){o("mousedown",t)},mouseup:function(t){o("mouseup",t)},mouseout:function(t){o("mouseout",t)},keydown:function(t){o("keydown",t)},keyup:function(t){o("keyup",t)},touchstart:function(t){o("touchstart",t)},touchmove:function(t){o("touchmove",t)},touchend:function(t){o("touchend",t)},tap:function(t){o("tap",t)}}},e=6378137;function r(t){var e=0;if(t&&t.length>0){e+=Math.abs(o(t[0]));for(var n=1;n<t.length;n++)e-=Math.abs(o(t[n]))}return e}function o(t){var n,r,o,u,a,c,s=0,l=t.length;if(l>2){for(c=0;c<l;c++)c===l-2?(o=l-2,u=l-1,a=0):c===l-1?(o=l-1,u=0,a=1):(o=c,u=c+1,a=c+2),n=t[o],r=t[u],s+=(i(t[a][0])-i(n[0]))*Math.sin(i(r[1]));s=s*e*e/2}return s}function i(t){return t*Math.PI/180}var u={geometry:function t(e){var n,o=0;switch(e.type){case"Polygon":return r(e.coordinates);case"MultiPolygon":for(n=0;n<e.coordinates.length;n++)o+=r(e.coordinates[n]);return o;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(n=0;n<e.geometries.length;n++)o+=t(e.geometries[n]);return o}},ring:o},a="mapboxgl-ctrl",c="mapbox-gl-draw_ctrl-draw-btn",s="mapbox-gl-draw_line",l="mapbox-gl-draw_polygon",f="mapbox-gl-draw_point",p="mapbox-gl-draw_trash",h="mapbox-gl-draw_combine",d="mapbox-gl-draw_uncombine",g="mapboxgl-ctrl-group",v="active",y="mapbox-gl-draw_boxselect",_="mapbox-gl-draw-hot",m="mapbox-gl-draw-cold",b="add",w="move",x="drag",S="pointer",M="none",C={POLYGON:"polygon",LINE:"line_string",POINT:"point"},E="Feature",I="Polygon",F="LineString",L="Point",P="FeatureCollection",k="Multi",O="MultiPoint",j="MultiLineString",A="MultiPolygon",T={DRAW_LINE_STRING:"draw_line_string",DRAW_POLYGON:"draw_polygon",DRAW_POINT:"draw_point",SIMPLE_SELECT:"simple_select",DIRECT_SELECT:"direct_select",STATIC:"static"},N="draw.create",D="draw.delete",R="draw.update",B="draw.selectionchange",U="draw.modechange",z="draw.actionable",$="draw.render",V="draw.combine",W="draw.uncombine",G="move",J="change_coordinates",q="feature",Z="midpoint",K="vertex",Y="true",H="false",X=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate"],Q={Point:0,LineString:1,Polygon:2};function tt(t,e){var n=Q[t.geometry.type]-Q[e.geometry.type];return 0===n&&t.geometry.type===I?t.area-e.area:n}function et(t){if(this._items={},this._nums={},this._length=t?t.length:0,t)for(var e=0,n=t.length;e<n;e++)this.add(t[e]),void 0!==t[e]&&("string"==typeof t[e]?this._items[t[e]]=e:this._nums[t[e]]=e)}et.prototype.add=function(t){return this.has(t)||(this._length++,"string"==typeof t?this._items[t]=this._length:this._nums[t]=this._length),this},et.prototype.delete=function(t){return!1===this.has(t)||(this._length--,delete this._items[t],delete this._nums[t]),this},et.prototype.has=function(t){return!("string"!=typeof t&&"number"!=typeof t||void 0===this._items[t]&&void 0===this._nums[t])},et.prototype.values=function(){var t=this,e=[];return Object.keys(this._items).forEach((function(n){e.push({k:n,v:t._items[n]})})),Object.keys(this._nums).forEach((function(n){e.push({k:JSON.parse(n),v:t._nums[n]})})),e.sort((function(t,e){return t.v-e.v})).map((function(t){return t.k}))},et.prototype.clear=function(){return this._length=0,this._items={},this._nums={},this};var nt=[q,Z,K],rt={click:function(t,e,n){return ot(t,e,n,n.options.clickBuffer)},touch:function(t,e,n){return ot(t,e,n,n.options.touchBuffer)}};function ot(t,e,n,r){if(null===n.map)return[];var o=t?function(t,e){return void 0===e&&(e=0),[[t.point.x-e,t.point.y-e],[t.point.x+e,t.point.y+e]]}(t,r):e,i={};n.options.styles&&(i.layers=n.options.styles.map((function(t){return t.id})));var a=n.map.queryRenderedFeatures(o,i).filter((function(t){return-1!==nt.indexOf(t.properties.meta)})),c=new et,s=[];return a.forEach((function(t){var e=t.properties.id;c.has(e)||(c.add(e),s.push(t))})),function(t){return t.map((function(t){return t.geometry.type===I&&(t.area=u.geometry({type:E,property:{},geometry:t.geometry})),t})).sort(tt).map((function(t){return delete t.area,t}))}(s)}function it(t,e){var n=rt.click(t,null,e),r={mouse:M};return n[0]&&(r.mouse=n[0].properties.active===Y?w:S,r.feature=n[0].properties.meta),-1!==e.events.currentModeName().indexOf("draw")&&(r.mouse=b),e.ui.queueMapClasses(r),e.ui.updateMapClasses(),n[0]}function ut(t,e){var n=t.x-e.x,r=t.y-e.y;return Math.sqrt(n*n+r*r)}function at(t,e,n){void 0===n&&(n={});var r=null!=n.fineTolerance?n.fineTolerance:4,o=null!=n.grossTolerance?n.grossTolerance:12,i=null!=n.interval?n.interval:500;t.point=t.point||e.point,t.time=t.time||e.time;var u=ut(t.point,e.point);return u<r||u<o&&e.time-t.time<i}function ct(t,e,n){void 0===n&&(n={});var r=null!=n.tolerance?n.tolerance:25,o=null!=n.interval?n.interval:250;return t.point=t.point||e.point,t.time=t.time||e.time,ut(t.point,e.point)<r&&e.time-t.time<o}function st(t,e){return t(e={exports:{}},e.exports),e.exports}var lt=st((function(t){var e=t.exports=function(t,n){if(n||(n=16),void 0===t&&(t=128),t<=0)return"0";for(var r=Math.log(Math.pow(2,t))/Math.log(n),o=2;r===1/0;o*=2)r=Math.log(Math.pow(2,t/o))/Math.log(n)*o;var i=r-Math.floor(r),u="";for(o=0;o<Math.floor(r);o++)u=Math.floor(Math.random()*n).toString(n)+u;if(i){var a=Math.pow(n,i);u=Math.floor(Math.random()*a).toString(n)+u}var c=parseInt(u,n);return c!==1/0&&c>=Math.pow(2,t)?e(t,n):u};e.rack=function(t,n,r){var o=function(o){var u=0;do{if(u++>10){if(!r)throw new Error("too many ID collisions, use more bits");t+=r}var a=e(t,n)}while(Object.hasOwnProperty.call(i,a));return i[a]=o,a},i=o.hats={};return o.get=function(t){return o.hats[t]},o.set=function(t,e){return o.hats[t]=e,o},o.bits=t||128,o.base=n||16,o}})),ft=function(t,e){this.ctx=t,this.properties=e.properties||{},this.coordinates=e.geometry.coordinates,this.id=e.id||lt(),this.type=e.geometry.type};ft.prototype.changed=function(){this.ctx.store.featureChanged(this.id)},ft.prototype.incomingCoords=function(t){this.setCoordinates(t)},ft.prototype.setCoordinates=function(t){this.coordinates=t,this.changed()},ft.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.coordinates))},ft.prototype.setProperty=function(t,e){this.properties[t]=e},ft.prototype.toGeoJSON=function(){return JSON.parse(JSON.stringify({id:this.id,type:E,properties:this.properties,geometry:{coordinates:this.getCoordinates(),type:this.type}}))},ft.prototype.internal=function(t){var e={id:this.id,meta:q,"meta:type":this.type,active:H,mode:t};if(this.ctx.options.userProperties)for(var n in this.properties)e["user_"+n]=this.properties[n];return{type:E,properties:e,geometry:{coordinates:this.getCoordinates(),type:this.type}}};var pt=function(t,e){ft.call(this,t,e)};(pt.prototype=Object.create(ft.prototype)).isValid=function(){return"number"==typeof this.coordinates[0]&&"number"==typeof this.coordinates[1]},pt.prototype.updateCoordinate=function(t,e,n){this.coordinates=3===arguments.length?[e,n]:[t,e],this.changed()},pt.prototype.getCoordinate=function(){return this.getCoordinates()};var ht=function(t,e){ft.call(this,t,e)};(ht.prototype=Object.create(ft.prototype)).isValid=function(){return this.coordinates.length>1},ht.prototype.addCoordinate=function(t,e,n){this.changed();var r=parseInt(t,10);this.coordinates.splice(r,0,[e,n])},ht.prototype.getCoordinate=function(t){var e=parseInt(t,10);return JSON.parse(JSON.stringify(this.coordinates[e]))},ht.prototype.removeCoordinate=function(t){this.changed(),this.coordinates.splice(parseInt(t,10),1)},ht.prototype.updateCoordinate=function(t,e,n){var r=parseInt(t,10);this.coordinates[r]=[e,n],this.changed()};var dt=function(t,e){ft.call(this,t,e),this.coordinates=this.coordinates.map((function(t){return t.slice(0,-1)}))};(dt.prototype=Object.create(ft.prototype)).isValid=function(){return 0!==this.coordinates.length&&this.coordinates.every((function(t){return t.length>2}))},dt.prototype.incomingCoords=function(t){this.coordinates=t.map((function(t){return t.slice(0,-1)})),this.changed()},dt.prototype.setCoordinates=function(t){this.coordinates=t,this.changed()},dt.prototype.addCoordinate=function(t,e,n){this.changed();var r=t.split(".").map((function(t){return parseInt(t,10)}));this.coordinates[r[0]].splice(r[1],0,[e,n])},dt.prototype.removeCoordinate=function(t){this.changed();var e=t.split(".").map((function(t){return parseInt(t,10)})),n=this.coordinates[e[0]];n&&(n.splice(e[1],1),n.length<3&&this.coordinates.splice(e[0],1))},dt.prototype.getCoordinate=function(t){var e=t.split(".").map((function(t){return parseInt(t,10)})),n=this.coordinates[e[0]];return JSON.parse(JSON.stringify(n[e[1]]))},dt.prototype.getCoordinates=function(){return this.coordinates.map((function(t){return t.concat([t[0]])}))},dt.prototype.updateCoordinate=function(t,e,n){this.changed();var r=t.split("."),o=parseInt(r[0],10),i=parseInt(r[1],10);void 0===this.coordinates[o]&&(this.coordinates[o]=[]),this.coordinates[o][i]=[e,n]};var gt={MultiPoint:pt,MultiLineString:ht,MultiPolygon:dt},vt=function(t,e,n,r,o){var i=n.split("."),u=parseInt(i[0],10),a=i[1]?i.slice(1).join("."):null;return t[u][e](a,r,o)},yt=function(t,e){if(ft.call(this,t,e),delete this.coordinates,this.model=gt[e.geometry.type],void 0===this.model)throw new TypeError(e.geometry.type+" is not a valid type");this.features=this._coordinatesToFeatures(e.geometry.coordinates)};function _t(t){this.map=t.map,this.drawConfig=JSON.parse(JSON.stringify(t.options||{})),this._ctx=t}(yt.prototype=Object.create(ft.prototype))._coordinatesToFeatures=function(t){var e=this,n=this.model.bind(this);return t.map((function(t){return new n(e.ctx,{id:lt(),type:E,properties:{},geometry:{coordinates:t,type:e.type.replace("Multi","")}})}))},yt.prototype.isValid=function(){return this.features.every((function(t){return t.isValid()}))},yt.prototype.setCoordinates=function(t){this.features=this._coordinatesToFeatures(t),this.changed()},yt.prototype.getCoordinate=function(t){return vt(this.features,"getCoordinate",t)},yt.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.features.map((function(t){return t.type===I?t.getCoordinates():t.coordinates}))))},yt.prototype.updateCoordinate=function(t,e,n){vt(this.features,"updateCoordinate",t,e,n),this.changed()},yt.prototype.addCoordinate=function(t,e,n){vt(this.features,"addCoordinate",t,e,n),this.changed()},yt.prototype.removeCoordinate=function(t){vt(this.features,"removeCoordinate",t),this.changed()},yt.prototype.getFeatures=function(){return this.features},_t.prototype.setSelected=function(t){return this._ctx.store.setSelected(t)},_t.prototype.setSelectedCoordinates=function(t){var e=this;this._ctx.store.setSelectedCoordinates(t),t.reduce((function(t,n){return void 0===t[n.feature_id]&&(t[n.feature_id]=!0,e._ctx.store.get(n.feature_id).changed()),t}),{})},_t.prototype.getSelected=function(){return this._ctx.store.getSelected()},_t.prototype.getSelectedIds=function(){return this._ctx.store.getSelectedIds()},_t.prototype.isSelected=function(t){return this._ctx.store.isSelected(t)},_t.prototype.getFeature=function(t){return this._ctx.store.get(t)},_t.prototype.select=function(t){return this._ctx.store.select(t)},_t.prototype.deselect=function(t){return this._ctx.store.deselect(t)},_t.prototype.deleteFeature=function(t,e){return void 0===e&&(e={}),this._ctx.store.delete(t,e)},_t.prototype.addFeature=function(t){return this._ctx.store.add(t)},_t.prototype.clearSelectedFeatures=function(){return this._ctx.store.clearSelected()},_t.prototype.clearSelectedCoordinates=function(){return this._ctx.store.clearSelectedCoordinates()},_t.prototype.setActionableState=function(t){void 0===t&&(t={});var e={trash:t.trash||!1,combineFeatures:t.combineFeatures||!1,uncombineFeatures:t.uncombineFeatures||!1};return this._ctx.events.actionable(e)},_t.prototype.changeMode=function(t,e,n){return void 0===e&&(e={}),void 0===n&&(n={}),this._ctx.events.changeMode(t,e,n)},_t.prototype.updateUIClasses=function(t){return this._ctx.ui.queueMapClasses(t)},_t.prototype.activateUIButton=function(t){return this._ctx.ui.setActiveButton(t)},_t.prototype.featuresAt=function(t,e,n){if(void 0===n&&(n="click"),"click"!==n&&"touch"!==n)throw new Error("invalid buffer type");return rt[n](t,e,this._ctx)},_t.prototype.newFeature=function(t){var e=t.geometry.type;return e===L?new pt(this._ctx,t):e===F?new ht(this._ctx,t):e===I?new dt(this._ctx,t):new yt(this._ctx,t)},_t.prototype.isInstanceOf=function(t,e){if(t===L)return e instanceof pt;if(t===F)return e instanceof ht;if(t===I)return e instanceof dt;if("MultiFeature"===t)return e instanceof yt;throw new Error("Unknown feature class: "+t)},_t.prototype.doRender=function(t){return this._ctx.store.featureChanged(t)},_t.prototype.onSetup=function(){},_t.prototype.onDrag=function(){},_t.prototype.onClick=function(){},_t.prototype.onMouseMove=function(){},_t.prototype.onMouseDown=function(){},_t.prototype.onMouseUp=function(){},_t.prototype.onMouseOut=function(){},_t.prototype.onKeyUp=function(){},_t.prototype.onKeyDown=function(){},_t.prototype.onTouchStart=function(){},_t.prototype.onTouchMove=function(){},_t.prototype.onTouchEnd=function(){},_t.prototype.onTap=function(){},_t.prototype.onStop=function(){},_t.prototype.onTrash=function(){},_t.prototype.onCombineFeature=function(){},_t.prototype.onUncombineFeature=function(){},_t.prototype.toDisplayFeatures=function(){throw new Error("You must overwrite toDisplayFeatures")};var mt={drag:"onDrag",click:"onClick",mousemove:"onMouseMove",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseout:"onMouseOut",keyup:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",tap:"onTap"},bt=Object.keys(mt);function wt(t){var e=Object.keys(t);return function(n,r){void 0===r&&(r={});var o={},i=e.reduce((function(e,n){return e[n]=t[n],e}),new _t(n));return{start:function(){var e=this;o=i.onSetup(r),bt.forEach((function(n){var r,u=mt[n],a=function(){return!1};t[u]&&(a=function(){return!0}),e.on(n,a,(r=u,function(t){return i[r](o,t)}))}))},stop:function(){i.onStop(o)},trash:function(){i.onTrash(o)},combineFeatures:function(){i.onCombineFeatures(o)},uncombineFeatures:function(){i.onUncombineFeatures(o)},render:function(t,e){i.toDisplayFeatures(o,t,e)}}}}function xt(t){return[].concat(t).filter((function(t){return void 0!==t}))}function St(){var t=this;if(!t.ctx.map||void 0===t.ctx.map.getSource(_))return c();var e=t.ctx.events.currentModeName();t.ctx.ui.queueMapClasses({mode:e});var n=[],r=[];t.isDirty?r=t.getAllIds():(n=t.getChangedIds().filter((function(e){return void 0!==t.get(e)})),r=t.sources.hot.filter((function(e){return e.properties.id&&-1===n.indexOf(e.properties.id)&&void 0!==t.get(e.properties.id)})).map((function(t){return t.properties.id}))),t.sources.hot=[];var o=t.sources.cold.length;t.sources.cold=t.isDirty?[]:t.sources.cold.filter((function(t){var e=t.properties.id||t.properties.parent;return-1===n.indexOf(e)}));var i=o!==t.sources.cold.length||r.length>0;function u(n,r){var o=t.get(n).internal(e);t.ctx.events.currentModeRender(o,(function(e){t.sources[r].push(e)}))}if(n.forEach((function(t){return u(t,"hot")})),r.forEach((function(t){return u(t,"cold")})),i&&t.ctx.map.getSource(m).setData({type:P,features:t.sources.cold}),t.ctx.map.getSource(_).setData({type:P,features:t.sources.hot}),t._emitSelectionChange&&(t.ctx.map.fire(B,{features:t.getSelected().map((function(t){return t.toGeoJSON()})),points:t.getSelectedCoordinates().map((function(t){return{type:E,properties:{},geometry:{type:L,coordinates:t.coordinates}}}))}),t._emitSelectionChange=!1),t._deletedFeaturesToEmit.length){var a=t._deletedFeaturesToEmit.map((function(t){return t.toGeoJSON()}));t._deletedFeaturesToEmit=[],t.ctx.map.fire(D,{features:a})}function c(){t.isDirty=!1,t.clearChangedIds()}c(),t.ctx.map.fire($,{})}function Mt(t){var e,n=this;this._features={},this._featureIds=new et,this._selectedFeatureIds=new et,this._selectedCoordinates=[],this._changedFeatureIds=new et,this._deletedFeaturesToEmit=[],this._emitSelectionChange=!1,this._mapInitialConfig={},this.ctx=t,this.sources={hot:[],cold:[]},this.render=function(){e||(e=requestAnimationFrame((function(){e=null,St.call(n)})))},this.isDirty=!1}function Ct(t,e){var n=t._selectedCoordinates.filter((function(e){return t._selectedFeatureIds.has(e.feature_id)}));t._selectedCoordinates.length===n.length||e.silent||(t._emitSelectionChange=!0),t._selectedCoordinates=n}Mt.prototype.createRenderBatch=function(){var t=this,e=this.render,n=0;return this.render=function(){n++},function(){t.render=e,n>0&&t.render()}},Mt.prototype.setDirty=function(){return this.isDirty=!0,this},Mt.prototype.featureChanged=function(t){return this._changedFeatureIds.add(t),this},Mt.prototype.getChangedIds=function(){return this._changedFeatureIds.values()},Mt.prototype.clearChangedIds=function(){return this._changedFeatureIds.clear(),this},Mt.prototype.getAllIds=function(){return this._featureIds.values()},Mt.prototype.add=function(t){return this.featureChanged(t.id),this._features[t.id]=t,this._featureIds.add(t.id),this},Mt.prototype.delete=function(t,e){var n=this;return void 0===e&&(e={}),xt(t).forEach((function(t){n._featureIds.has(t)&&(n._featureIds.delete(t),n._selectedFeatureIds.delete(t),e.silent||-1===n._deletedFeaturesToEmit.indexOf(n._features[t])&&n._deletedFeaturesToEmit.push(n._features[t]),delete n._features[t],n.isDirty=!0)})),Ct(this,e),this},Mt.prototype.get=function(t){return this._features[t]},Mt.prototype.getAll=function(){var t=this;return Object.keys(this._features).map((function(e){return t._features[e]}))},Mt.prototype.select=function(t,e){var n=this;return void 0===e&&(e={}),xt(t).forEach((function(t){n._selectedFeatureIds.has(t)||(n._selectedFeatureIds.add(t),n._changedFeatureIds.add(t),e.silent||(n._emitSelectionChange=!0))})),this},Mt.prototype.deselect=function(t,e){var n=this;return void 0===e&&(e={}),xt(t).forEach((function(t){n._selectedFeatureIds.has(t)&&(n._selectedFeatureIds.delete(t),n._changedFeatureIds.add(t),e.silent||(n._emitSelectionChange=!0))})),Ct(this,e),this},Mt.prototype.clearSelected=function(t){return void 0===t&&(t={}),this.deselect(this._selectedFeatureIds.values(),{silent:t.silent}),this},Mt.prototype.setSelected=function(t,e){var n=this;return void 0===e&&(e={}),t=xt(t),this.deselect(this._selectedFeatureIds.values().filter((function(e){return-1===t.indexOf(e)})),{silent:e.silent}),this.select(t.filter((function(t){return!n._selectedFeatureIds.has(t)})),{silent:e.silent}),this},Mt.prototype.setSelectedCoordinates=function(t){return this._selectedCoordinates=t,this._emitSelectionChange=!0,this},Mt.prototype.clearSelectedCoordinates=function(){return this._selectedCoordinates=[],this._emitSelectionChange=!0,this},Mt.prototype.getSelectedIds=function(){return this._selectedFeatureIds.values()},Mt.prototype.getSelected=function(){var t=this;return this._selectedFeatureIds.values().map((function(e){return t.get(e)}))},Mt.prototype.getSelectedCoordinates=function(){var t=this;return this._selectedCoordinates.map((function(e){return{coordinates:t.get(e.feature_id).getCoordinate(e.coord_path)}}))},Mt.prototype.isSelected=function(t){return this._selectedFeatureIds.has(t)},Mt.prototype.setFeatureProperty=function(t,e,n){this.get(t).setProperty(e,n),this.featureChanged(t)},Mt.prototype.storeMapConfig=function(){var t=this;X.forEach((function(e){t.ctx.map[e]&&(t._mapInitialConfig[e]=t.ctx.map[e].isEnabled())}))},Mt.prototype.restoreMapConfig=function(){var t=this;Object.keys(this._mapInitialConfig).forEach((function(e){t._mapInitialConfig[e]?t.ctx.map[e].enable():t.ctx.map[e].disable()}))},Mt.prototype.getInitialConfigValue=function(t){return void 0===this._mapInitialConfig[t]||this._mapInitialConfig[t]};var Et=function(){for(var t=arguments,e={},n=0;n<arguments.length;n++){var r=t[n];for(var o in r)It.call(r,o)&&(e[o]=r[o])}return e},It=Object.prototype.hasOwnProperty,Ft=["mode","feature","mouse"];function Lt(e){var n=null,r=null,o={onRemove:function(){return e.map.off("load",o.connect),clearInterval(r),o.removeLayers(),e.store.restoreMapConfig(),e.ui.removeButtons(),e.events.removeEventListeners(),e.ui.clearMapClasses(),e.map=null,e.container=null,e.store=null,n&&n.parentNode&&n.parentNode.removeChild(n),n=null,this},connect:function(){e.map.off("load",o.connect),clearInterval(r),o.addLayers(),e.store.storeMapConfig(),e.events.addEventListeners()},onAdd:function(i){var u=i.fire;return i.fire=function(t,e){var n=arguments;return 1===u.length&&1!==arguments.length&&(n=[Et({},{type:t},e)]),u.apply(i,n)},e.map=i,e.events=function(e){var n=Object.keys(e.options.modes).reduce((function(t,n){return t[n]=wt(e.options.modes[n]),t}),{}),r={},o={},i={},u=null,a=null;i.drag=function(t,n){n({point:t.point,time:(new Date).getTime()})?(e.ui.queueMapClasses({mouse:x}),a.drag(t)):t.originalEvent.stopPropagation()},i.mousedrag=function(t){i.drag(t,(function(t){return!at(r,t)}))},i.touchdrag=function(t){i.drag(t,(function(t){return!ct(o,t)}))},i.mousemove=function(t){if(1===(void 0!==t.originalEvent.buttons?t.originalEvent.buttons:t.originalEvent.which))return i.mousedrag(t);var n=it(t,e);t.featureTarget=n,a.mousemove(t)},i.mousedown=function(t){r={time:(new Date).getTime(),point:t.point};var n=it(t,e);t.featureTarget=n,a.mousedown(t)},i.mouseup=function(t){var n=it(t,e);t.featureTarget=n,at(r,{point:t.point,time:(new Date).getTime()})?a.click(t):a.mouseup(t)},i.mouseout=function(t){a.mouseout(t)},i.touchstart=function(t){if(t.originalEvent.preventDefault(),e.options.touchEnabled){o={time:(new Date).getTime(),point:t.point};var n=rt.touch(t,null,e)[0];t.featureTarget=n,a.touchstart(t)}},i.touchmove=function(t){if(t.originalEvent.preventDefault(),e.options.touchEnabled)return a.touchmove(t),i.touchdrag(t)},i.touchend=function(t){if(t.originalEvent.preventDefault(),e.options.touchEnabled){var n=rt.touch(t,null,e)[0];t.featureTarget=n,ct(o,{time:(new Date).getTime(),point:t.point})?a.tap(t):a.touchend(t)}};var c=function(t){return!(8===t||46===t||t>=48&&t<=57)};function s(r,o,i){void 0===i&&(i={}),a.stop();var c=n[r];if(void 0===c)throw new Error(r+" is not valid");u=r;var s=c(e,o);a=t(s,e),i.silent||e.map.fire(U,{mode:r}),e.store.setDirty(),e.store.render()}i.keydown=function(t){"mapboxgl-canvas"===(t.srcElement||t.target).classList[0]&&(8!==t.keyCode&&46!==t.keyCode||!e.options.controls.trash?c(t.keyCode)?a.keydown(t):49===t.keyCode&&e.options.controls.point?s(T.DRAW_POINT):50===t.keyCode&&e.options.controls.line_string?s(T.DRAW_LINE_STRING):51===t.keyCode&&e.options.controls.polygon&&s(T.DRAW_POLYGON):(t.preventDefault(),a.trash()))},i.keyup=function(t){c(t.keyCode)&&a.keyup(t)},i.zoomend=function(){e.store.changeZoom()},i.data=function(t){if("style"===t.dataType){var n=e.setup,r=e.map,o=e.options,i=e.store;o.styles.some((function(t){return r.getLayer(t.id)}))||(n.addLayers(),i.setDirty(),i.render())}};var l={trash:!1,combineFeatures:!1,uncombineFeatures:!1};return{start:function(){u=e.options.defaultMode,a=t(n[u](e),e)},changeMode:s,actionable:function(t){var n=!1;Object.keys(t).forEach((function(e){if(void 0===l[e])throw new Error("Invalid action type");l[e]!==t[e]&&(n=!0),l[e]=t[e]})),n&&e.map.fire(z,{actions:l})},currentModeName:function(){return u},currentModeRender:function(t,e){return a.render(t,e)},fire:function(t,e){i[t]&&i[t](e)},addEventListeners:function(){e.map.on("mousemove",i.mousemove),e.map.on("mousedown",i.mousedown),e.map.on("mouseup",i.mouseup),e.map.on("data",i.data),e.map.on("touchmove",i.touchmove),e.map.on("touchstart",i.touchstart),e.map.on("touchend",i.touchend),e.container.addEventListener("mouseout",i.mouseout),e.options.keybindings&&(e.container.addEventListener("keydown",i.keydown),e.container.addEventListener("keyup",i.keyup))},removeEventListeners:function(){e.map.off("mousemove",i.mousemove),e.map.off("mousedown",i.mousedown),e.map.off("mouseup",i.mouseup),e.map.off("data",i.data),e.map.off("touchmove",i.touchmove),e.map.off("touchstart",i.touchstart),e.map.off("touchend",i.touchend),e.container.removeEventListener("mouseout",i.mouseout),e.options.keybindings&&(e.container.removeEventListener("keydown",i.keydown),e.container.removeEventListener("keyup",i.keyup))},trash:function(t){a.trash(t)},combineFeatures:function(){a.combineFeatures()},uncombineFeatures:function(){a.uncombineFeatures()},getMode:function(){return u}}}(e),e.ui=function(t){var e={},n=null,r={mode:null,feature:null,mouse:null},o={mode:null,feature:null,mouse:null};function i(t){o=Et(o,t)}function u(){var e,n;if(t.container){var i=[],u=[];Ft.forEach((function(t){o[t]!==r[t]&&(i.push(t+"-"+r[t]),null!==o[t]&&u.push(t+"-"+o[t]))})),i.length>0&&(e=t.container.classList).remove.apply(e,i),u.length>0&&(n=t.container.classList).add.apply(n,u),r=Et(r,o)}}function y(t,e){void 0===e&&(e={});var r=document.createElement("button");return r.className=c+" "+e.className,r.setAttribute("title",e.title),e.container.appendChild(r),r.addEventListener("click",(function(r){if(r.preventDefault(),r.stopPropagation(),r.target===n)return _(),void e.onDeactivate();m(t),e.onActivate()}),!0),r}function _(){n&&(n.classList.remove(v),n=null)}function m(t){_();var r=e[t];r&&r&&"trash"!==t&&(r.classList.add(v),n=r)}return{setActiveButton:m,queueMapClasses:i,updateMapClasses:u,clearMapClasses:function(){i({mode:null,feature:null,mouse:null}),u()},addButtons:function(){var n=t.options.controls,r=document.createElement("div");return r.className=g+" "+a,n?(n[C.LINE]&&(e[C.LINE]=y(C.LINE,{container:r,className:s,title:"LineString tool "+(t.options.keybindings?"(l)":""),onActivate:function(){return t.events.changeMode(T.DRAW_LINE_STRING)},onDeactivate:function(){return t.events.trash()}})),n[C.POLYGON]&&(e[C.POLYGON]=y(C.POLYGON,{container:r,className:l,title:"Polygon tool "+(t.options.keybindings?"(p)":""),onActivate:function(){return t.events.changeMode(T.DRAW_POLYGON)},onDeactivate:function(){return t.events.trash()}})),n[C.POINT]&&(e[C.POINT]=y(C.POINT,{container:r,className:f,title:"Marker tool "+(t.options.keybindings?"(m)":""),onActivate:function(){return t.events.changeMode(T.DRAW_POINT)},onDeactivate:function(){return t.events.trash()}})),n.trash&&(e.trash=y("trash",{container:r,className:p,title:"Delete",onActivate:function(){t.events.trash()}})),n.combine_features&&(e.combine_features=y("combineFeatures",{container:r,className:h,title:"Combine",onActivate:function(){t.events.combineFeatures()}})),n.uncombine_features&&(e.uncombine_features=y("uncombineFeatures",{container:r,className:d,title:"Uncombine",onActivate:function(){t.events.uncombineFeatures()}})),r):r},removeButtons:function(){Object.keys(e).forEach((function(t){var n=e[t];n.parentNode&&n.parentNode.removeChild(n),delete e[t]}))}}}(e),e.container=i.getContainer(),e.store=new Mt(e),n=e.ui.addButtons(),e.options.boxSelect&&(i.boxZoom.disable(),i.dragPan.disable(),i.dragPan.enable()),i.loaded()?o.connect():(i.on("load",o.connect),r=setInterval((function(){i.loaded()&&o.connect()}),16)),e.events.start(),n},addLayers:function(){e.map.addSource(m,{data:{type:P,features:[]},type:"geojson"}),e.map.addSource(_,{data:{type:P,features:[]},type:"geojson"}),e.options.styles.forEach((function(t){e.map.addLayer(t)})),e.store.setDirty(!0),e.store.render()},removeLayers:function(){e.options.styles.forEach((function(t){e.map.getLayer(t.id)&&e.map.removeLayer(t.id)})),e.map.getSource(m)&&e.map.removeSource(m),e.map.getSource(_)&&e.map.removeSource(_)}};return e.setup=o,o}function Pt(t){return function(e){var n=e.featureTarget;return!!n&&!!n.properties&&n.properties.meta===t}}function kt(t){return!!t.featureTarget&&!!t.featureTarget.properties&&t.featureTarget.properties.active===Y&&t.featureTarget.properties.meta===q}function Ot(t){return!!t.featureTarget&&!!t.featureTarget.properties&&t.featureTarget.properties.active===H&&t.featureTarget.properties.meta===q}function jt(t){return void 0===t.featureTarget}function At(t){var e=t.featureTarget;return!!e&&!!e.properties&&e.properties.meta===K}function Tt(t){return!!t.originalEvent&&!0===t.originalEvent.shiftKey}function Nt(t){return 27===t.keyCode}function Dt(t){return 13===t.keyCode}var Rt=Bt;function Bt(t,e){this.x=t,this.y=e}function Ut(t,e){var n=e.getBoundingClientRect();return new Rt(t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0))}function zt(t,e,n,r){return{type:E,properties:{meta:K,parent:t,coord_path:n,active:r?Y:H},geometry:{type:L,coordinates:e}}}function $t(t,e,n){void 0===e&&(e={}),void 0===n&&(n=null);var r,o=t.geometry,i=o.type,u=o.coordinates,a=t.properties&&t.properties.id,c=[];function s(t,n){var r="",o=null;t.forEach((function(t,i){var u=null!=n?n+"."+i:String(i),s=zt(a,t,u,l(u));if(e.midpoints&&o){var f=function(t,e,n){var r=e.geometry.coordinates,o=n.geometry.coordinates;if(r[1]>85||r[1]<-85||o[1]>85||o[1]<-85)return null;var i={lng:(r[0]+o[0])/2,lat:(r[1]+o[1])/2};return{type:E,properties:{meta:Z,parent:t,lng:i.lng,lat:i.lat,coord_path:n.properties.coord_path},geometry:{type:L,coordinates:[i.lng,i.lat]}}}(a,o,s);f&&c.push(f)}o=s;var p=JSON.stringify(t);r!==p&&c.push(s),0===i&&(r=p)}))}function l(t){return!!e.selectedPaths&&-1!==e.selectedPaths.indexOf(t)}return i===L?c.push(zt(a,u,n,l(n))):i===I?u.forEach((function(t,e){s(t,null!==n?n+"."+e:String(e))})):i===F?s(u,n):0===i.indexOf(k)&&(r=i.replace(k,""),u.forEach((function(n,o){var i={type:E,properties:t.properties,geometry:{type:r,coordinates:n}};c=c.concat($t(i,e,o))}))),c}Bt.prototype={clone:function(){return new Bt(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},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(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,n=t.y-this.y;return e*e+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,n=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=n,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),n=Math.sin(t),r=e*this.x-n*this.y,o=n*this.x+e*this.y;return this.x=r,this.y=o,this},_rotateAround:function(t,e){var n=Math.cos(t),r=Math.sin(t),o=e.x+n*(this.x-e.x)-r*(this.y-e.y),i=e.y+r*(this.x-e.x)+n*(this.y-e.y);return this.x=o,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Bt.convert=function(t){return t instanceof Bt?t:Array.isArray(t)?new Bt(t[0],t[1]):t};var Vt=function(t){setTimeout((function(){t.map&&t.map.doubleClickZoom&&t._ctx&&t._ctx.store&&t._ctx.store.getInitialConfigValue&&t._ctx.store.getInitialConfigValue("doubleClickZoom")&&t.map.doubleClickZoom.enable()}),0)},Wt=function(t){setTimeout((function(){t.map&&t.map.doubleClickZoom&&t.map.doubleClickZoom.disable()}),0)},Gt=function(t){if(!t||!t.type)return null;var e=Jt[t.type];return e?"geometry"===e?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]}:"feature"===e?{type:"FeatureCollection",features:[t]}:"featurecollection"===e?t:void 0:null},Jt={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"};function qt(t){switch(t&&t.type||null){case"FeatureCollection":return t.features=t.features.reduce((function(t,e){return t.concat(qt(e))}),[]),t;case"Feature":return t.geometry?qt(t.geometry).map((function(e){var n={type:"Feature",properties:JSON.parse(JSON.stringify(t.properties)),geometry:e};return void 0!==t.id&&(n.id=t.id),n})):[t];case"MultiPoint":return t.coordinates.map((function(t){return{type:"Point",coordinates:t}}));case"MultiPolygon":return t.coordinates.map((function(t){return{type:"Polygon",coordinates:t}}));case"MultiLineString":return t.coordinates.map((function(t){return{type:"LineString",coordinates:t}}));case"GeometryCollection":return t.geometries.map(qt).reduce((function(t,e){return t.concat(e)}),[]);case"Point":case"Polygon":case"LineString":return[t]}}var Zt=function(t){if(!t)return[];var e=qt(Gt(t)),n=[];return e.features.forEach((function(t){t.geometry&&(n=n.concat(function t(e){return Array.isArray(e)&&e.length&&"number"==typeof e[0]?[e]:e.reduce((function(e,n){return Array.isArray(n)&&Array.isArray(n[0])?e.concat(t(n)):(e.push(n),e)}),[])}(t.geometry.coordinates)))})),n},Kt=st((function(t){var e=t.exports=function(t){return new n(t)};function n(t){this.value=t}function r(t,e,n){var r=[],u=[],l=!0;return function t(f){var p=n?o(f):f,h={},d=!0,g={node:p,node_:f,path:[].concat(r),parent:u[u.length-1],parents:u,key:r.slice(-1)[0],isRoot:0===r.length,level:r.length,circular:null,update:function(t,e){g.isRoot||(g.parent.node[g.key]=t),g.node=t,e&&(d=!1)},delete:function(t){delete g.parent.node[g.key],t&&(d=!1)},remove:function(t){a(g.parent.node)?g.parent.node.splice(g.key,1):delete g.parent.node[g.key],t&&(d=!1)},keys:null,before:function(t){h.before=t},after:function(t){h.after=t},pre:function(t){h.pre=t},post:function(t){h.post=t},stop:function(){l=!1},block:function(){d=!1}};if(!l)return g;function v(){if("object"==typeof g.node&&null!==g.node){g.keys&&g.node_===g.node||(g.keys=i(g.node)),g.isLeaf=0==g.keys.length;for(var t=0;t<u.length;t++)if(u[t].node_===f){g.circular=u[t];break}}else g.isLeaf=!0,g.keys=null;g.notLeaf=!g.isLeaf,g.notRoot=!g.isRoot}v();var y=e.call(g,g.node);return void 0!==y&&g.update&&g.update(y),h.before&&h.before.call(g,g.node),d?("object"!=typeof g.node||null===g.node||g.circular||(u.push(g),v(),c(g.keys,(function(e,o){r.push(e),h.pre&&h.pre.call(g,g.node[e],e);var i=t(g.node[e]);n&&s.call(g.node,e)&&(g.node[e]=i.node),i.isLast=o==g.keys.length-1,i.isFirst=0==o,h.post&&h.post.call(g,i),r.pop()})),u.pop()),h.after&&h.after.call(g,g.node),g):g}(t).node}function o(t){if("object"==typeof t&&null!==t){var e;if(a(t))e=[];else if("[object Date]"===u(t))e=new Date(t.getTime?t.getTime():t);else if(function(t){return"[object RegExp]"===u(t)}(t))e=new RegExp(t);else if(function(t){return"[object Error]"===u(t)}(t))e={message:t.message};else if(function(t){return"[object Boolean]"===u(t)}(t))e=new Boolean(t);else if(function(t){return"[object Number]"===u(t)}(t))e=new Number(t);else if(function(t){return"[object String]"===u(t)}(t))e=new String(t);else if(Object.create&&Object.getPrototypeOf)e=Object.create(Object.getPrototypeOf(t));else if(t.constructor===Object)e={};else{var n=t.constructor&&t.constructor.prototype||t.__proto__||{},r=function(){};r.prototype=n,e=new r}return c(i(t),(function(n){e[n]=t[n]})),e}return t}n.prototype.get=function(t){for(var e=this.value,n=0;n<t.length;n++){var r=t[n];if(!e||!s.call(e,r)){e=void 0;break}e=e[r]}return e},n.prototype.has=function(t){for(var e=this.value,n=0;n<t.length;n++){var r=t[n];if(!e||!s.call(e,r))return!1;e=e[r]}return!0},n.prototype.set=function(t,e){for(var n=this.value,r=0;r<t.length-1;r++){var o=t[r];s.call(n,o)||(n[o]={}),n=n[o]}return n[t[r]]=e,e},n.prototype.map=function(t){return r(this.value,t,!0)},n.prototype.forEach=function(t){return this.value=r(this.value,t,!1),this.value},n.prototype.reduce=function(t,e){var n=1===arguments.length,r=n?this.value:e;return this.forEach((function(e){this.isRoot&&n||(r=t.call(this,r,e))})),r},n.prototype.paths=function(){var t=[];return this.forEach((function(e){t.push(this.path)})),t},n.prototype.nodes=function(){var t=[];return this.forEach((function(e){t.push(this.node)})),t},n.prototype.clone=function(){var t=[],e=[];return function n(r){for(var u=0;u<t.length;u++)if(t[u]===r)return e[u];if("object"==typeof r&&null!==r){var a=o(r);return t.push(r),e.push(a),c(i(r),(function(t){a[t]=n(r[t])})),t.pop(),e.pop(),a}return r}(this.value)};var i=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};function u(t){return Object.prototype.toString.call(t)}var a=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},c=function(t,e){if(t.forEach)return t.forEach(e);for(var n=0;n<t.length;n++)e(t[n],n,t)};c(i(n.prototype),(function(t){e[t]=function(e){var r=[].slice.call(arguments,1),o=new n(e);return o[t].apply(o,r)}}));var s=Object.hasOwnProperty||function(t,e){return e in t}})),Yt=Ht;function Ht(t){if(!(this instanceof Ht))return new Ht(t);this._bbox=t||[1/0,1/0,-1/0,-1/0],this._valid=!!t}Ht.prototype.include=function(t){return this._valid=!0,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[0]),this._bbox[3]=Math.max(this._bbox[3],t[1]),this},Ht.prototype.equals=function(t){var e;return e=t instanceof Ht?t.bbox():t,this._bbox[0]==e[0]&&this._bbox[1]==e[1]&&this._bbox[2]==e[2]&&this._bbox[3]==e[3]},Ht.prototype.center=function(t){return this._valid?[(this._bbox[0]+this._bbox[2])/2,(this._bbox[1]+this._bbox[3])/2]:null},Ht.prototype.union=function(t){var e;return this._valid=!0,e=t instanceof Ht?t.bbox():t,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[2]),this._bbox[3]=Math.max(this._bbox[3],e[3]),this},Ht.prototype.bbox=function(){return this._valid?this._bbox:null},Ht.prototype.contains=function(t){if(!t)return this._fastContains();if(!this._valid)return null;var e=t[0],n=t[1];return this._bbox[0]<=e&&this._bbox[1]<=n&&this._bbox[2]>=e&&this._bbox[3]>=n},Ht.prototype.intersect=function(t){return this._valid?(e=t instanceof Ht?t.bbox():t,!(this._bbox[0]>e[2]||this._bbox[2]<e[0]||this._bbox[3]<e[1]||this._bbox[1]>e[3])):null;var e},Ht.prototype._fastContains=function(){if(!this._valid)return new Function("return null;");var t="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",t)},Ht.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 Xt={features:["FeatureCollection"],coordinates:["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],geometry:["Feature"],geometries:["GeometryCollection"]},Qt=Object.keys(Xt),te=function(t){return ee(t).bbox()};function ee(t){for(var e=Yt(),n=Zt(t),r=0;r<n.length;r++)e.include(n[r]);return e}function ne(t,e){var n=-90,r=90,o=-90,i=90,u=270,a=-270;t.forEach((function(t){var e=te(t),c=e[1],s=e[3],l=e[0],f=e[2];c>n&&(n=c),s<r&&(r=s),s>o&&(o=s),c<i&&(i=c),l<u&&(u=l),f>a&&(a=f)}));var c=e;return n+c.lat>85&&(c.lat=85-n),o+c.lat>90&&(c.lat=90-o),r+c.lat<-85&&(c.lat=-85-r),i+c.lat<-90&&(c.lat=-90-i),u+c.lng<=-270&&(c.lng+=360*Math.ceil(Math.abs(c.lng)/360)),a+c.lng>=270&&(c.lng-=360*Math.ceil(Math.abs(c.lng)/360)),c}function re(t,e){var n=ne(t.map((function(t){return t.toGeoJSON()})),e);t.forEach((function(t){var e,r=t.getCoordinates(),o=function(t){var e={lng:t[0]+n.lng,lat:t[1]+n.lat};return[e.lng,e.lat]},i=function(t){return t.map((function(t){return o(t)}))};t.type===L?e=o(r):t.type===F||t.type===O?e=r.map(o):t.type===I||t.type===j?e=r.map(i):t.type===A&&(e=r.map((function(t){return t.map((function(t){return i(t)}))}))),t.incomingCoords(e)}))}te.polygon=function(t){return ee(t).polygon()},te.bboxify=function(t){return Kt(t).map((function(t){t&&Qt.some((function(e){return!!t[e]&&-1!==Xt[e].indexOf(t.type)}))&&(t.bbox=ee(t).bbox(),this.update(t))}))};var oe={onSetup:function(t){var e=this,n={dragMoveLocation:null,boxSelectStartLocation:null,boxSelectElement:void 0,boxSelecting:!1,canBoxSelect:!1,dragMoving:!1,canDragMove:!1,initiallySelectedFeatureIds:t.featureIds||[]};return this.setSelected(n.initiallySelectedFeatureIds.filter((function(t){return void 0!==e.getFeature(t)}))),this.fireActionable(),this.setActionableState({combineFeatures:!0,uncombineFeatures:!0,trash:!0}),n},fireUpdate:function(){this.map.fire(R,{action:G,features:this.getSelected().map((function(t){return t.toGeoJSON()}))})},fireActionable:function(){var t=this,e=this.getSelected(),n=e.filter((function(e){return t.isInstanceOf("MultiFeature",e)})),r=!1;if(e.length>1){r=!0;var o=e[0].type.replace("Multi","");e.forEach((function(t){t.type.replace("Multi","")!==o&&(r=!1)}))}var i=n.length>0,u=e.length>0;this.setActionableState({combineFeatures:r,uncombineFeatures:i,trash:u})},getUniqueIds:function(t){return t.length?t.map((function(t){return t.properties.id})).filter((function(t){return void 0!==t})).reduce((function(t,e){return t.add(e),t}),new et).values():[]},stopExtendedInteractions:function(t){t.boxSelectElement&&(t.boxSelectElement.parentNode&&t.boxSelectElement.parentNode.removeChild(t.boxSelectElement),t.boxSelectElement=null),this.map.dragPan.enable(),t.boxSelecting=!1,t.canBoxSelect=!1,t.dragMoving=!1,t.canDragMove=!1},onStop:function(){Vt(this)},onMouseMove:function(t){return this.stopExtendedInteractions(t),!0},onMouseOut:function(t){return!t.dragMoving||this.fireUpdate()}};oe.onTap=oe.onClick=function(t,e){return jt(e)?this.clickAnywhere(t,e):Pt(K)(e)?this.clickOnVertex(t,e):function(t){return!!t.featureTarget&&!!t.featureTarget.properties&&t.featureTarget.properties.meta===q}(e)?this.clickOnFeature(t,e):void 0},oe.clickAnywhere=function(t){var e=this,n=this.getSelectedIds();n.length&&(this.clearSelectedFeatures(),n.forEach((function(t){return e.doRender(t)}))),Vt(this),this.stopExtendedInteractions(t)},oe.clickOnVertex=function(t,e){this.changeMode(T.DIRECT_SELECT,{featureId:e.featureTarget.properties.parent,coordPath:e.featureTarget.properties.coord_path,startPos:e.lngLat}),this.updateUIClasses({mouse:w})},oe.startOnActiveFeature=function(t,e){this.stopExtendedInteractions(t),this.map.dragPan.disable(),this.doRender(e.featureTarget.properties.id),t.canDragMove=!0,t.dragMoveLocation=e.lngLat},oe.clickOnFeature=function(t,e){var n=this;Wt(this),this.stopExtendedInteractions(t);var r=Tt(e),o=this.getSelectedIds(),i=e.featureTarget.properties.id,u=this.isSelected(i);if(!r&&u&&this.getFeature(i).type!==L)return this.changeMode(T.DIRECT_SELECT,{featureId:i});u&&r?(this.deselect(i),this.updateUIClasses({mouse:S}),1===o.length&&Vt(this)):!u&&r?(this.select(i),this.updateUIClasses({mouse:w})):u||r||(o.forEach((function(t){return n.doRender(t)})),this.setSelected(i),this.updateUIClasses({mouse:w})),this.doRender(i)},oe.onMouseDown=function(t,e){return kt(e)?this.startOnActiveFeature(t,e):this.drawConfig.boxSelect&&function(t){return!!t.originalEvent&&!!t.originalEvent.shiftKey&&0===t.originalEvent.button}(e)?this.startBoxSelect(t,e):void 0},oe.startBoxSelect=function(t,e){this.stopExtendedInteractions(t),this.map.dragPan.disable(),t.boxSelectStartLocation=Ut(e.originalEvent,this.map.getContainer()),t.canBoxSelect=!0},oe.onTouchStart=function(t,e){if(kt(e))return this.startOnActiveFeature(t,e)},oe.onDrag=function(t,e){return t.canDragMove?this.dragMove(t,e):this.drawConfig.boxSelect&&t.canBoxSelect?this.whileBoxSelect(t,e):void 0},oe.whileBoxSelect=function(t,e){t.boxSelecting=!0,this.updateUIClasses({mouse:b}),t.boxSelectElement||(t.boxSelectElement=document.createElement("div"),t.boxSelectElement.classList.add(y),this.map.getContainer().appendChild(t.boxSelectElement));var n=Ut(e.originalEvent,this.map.getContainer()),r=Math.min(t.boxSelectStartLocation.x,n.x),o=Math.max(t.boxSelectStartLocation.x,n.x),i=Math.min(t.boxSelectStartLocation.y,n.y),u=Math.max(t.boxSelectStartLocation.y,n.y),a="translate("+r+"px, "+i+"px)";t.boxSelectElement.style.transform=a,t.boxSelectElement.style.WebkitTransform=a,t.boxSelectElement.style.width=o-r+"px",t.boxSelectElement.style.height=u-i+"px"},oe.dragMove=function(t,e){t.dragMoving=!0,e.originalEvent.stopPropagation();var n={lng:e.lngLat.lng-t.dragMoveLocation.lng,lat:e.lngLat.lat-t.dragMoveLocation.lat};re(this.getSelected(),n),t.dragMoveLocation=e.lngLat},oe.onMouseUp=function(t,e){var n=this;if(t.dragMoving)this.fireUpdate();else if(t.boxSelecting){var r=[t.boxSelectStartLocation,Ut(e.originalEvent,this.map.getContainer())],o=this.featuresAt(null,r,"click"),i=this.getUniqueIds(o).filter((function(t){return!n.isSelected(t)}));i.length&&(this.select(i),i.forEach((function(t){return n.doRender(t)})),this.updateUIClasses({mouse:w}))}this.stopExtendedInteractions(t)},oe.toDisplayFeatures=function(t,e,n){e.properties.active=this.isSelected(e.properties.id)?Y:H,n(e),this.fireActionable(),e.properties.active===Y&&e.geometry.type!==L&&$t(e).forEach(n)},oe.onTrash=function(){this.deleteFeature(this.getSelectedIds()),this.fireActionable()},oe.onCombineFeatures=function(){var t=this.getSelected();if(!(0===t.length||t.length<2)){for(var e=[],n=[],r=t[0].type.replace("Multi",""),o=0;o<t.length;o++){var i=t[o];if(i.type.replace("Multi","")!==r)return;i.type.includes("Multi")?i.getCoordinates().forEach((function(t){e.push(t)})):e.push(i.getCoordinates()),n.push(i.toGeoJSON())}if(n.length>1){var u=this.newFeature({type:E,properties:n[0].properties,geometry:{type:"Multi"+r,coordinates:e}});this.addFeature(u),this.deleteFeature(this.getSelectedIds(),{silent:!0}),this.setSelected([u.id]),this.map.fire(V,{createdFeatures:[u.toGeoJSON()],deletedFeatures:n})}this.fireActionable()}},oe.onUncombineFeatures=function(){var t=this,e=this.getSelected();if(0!==e.length){for(var n=[],r=[],o=function(o){var i=e[o];t.isInstanceOf("MultiFeature",i)&&(i.getFeatures().forEach((function(e){t.addFeature(e),e.properties=i.properties,n.push(e.toGeoJSON()),t.select([e.id])})),t.deleteFeature(i.id,{silent:!0}),r.push(i.toGeoJSON()))},i=0;i<e.length;i++)o(i);n.length>1&&this.map.fire(W,{createdFeatures:n,deletedFeatures:r}),this.fireActionable()}};var ie=Pt(K),ue=Pt(Z),ae={fireUpdate:function(){this.map.fire(R,{action:J,features:this.getSelected().map((function(t){return t.toGeoJSON()}))})},fireActionable:function(t){this.setActionableState({combineFeatures:!1,uncombineFeatures:!1,trash:t.selectedCoordPaths.length>0})},startDragging:function(t,e){this.map.dragPan.disable(),t.canDragMove=!0,t.dragMoveLocation=e.lngLat},stopDragging:function(t){this.map.dragPan.enable(),t.dragMoving=!1,t.canDragMove=!1,t.dragMoveLocation=null},onVertex:function(t,e){this.startDragging(t,e);var n=e.featureTarget.properties,r=t.selectedCoordPaths.indexOf(n.coord_path);Tt(e)||-1!==r?Tt(e)&&-1===r&&t.selectedCoordPaths.push(n.coord_path):t.selectedCoordPaths=[n.coord_path];var o=this.pathsToCoordinates(t.featureId,t.selectedCoordPaths);this.setSelectedCoordinates(o)},onMidpoint:function(t,e){this.startDragging(t,e);var n=e.featureTarget.properties;t.feature.addCoordinate(n.coord_path,n.lng,n.lat),this.fireUpdate(),t.selectedCoordPaths=[n.coord_path]},pathsToCoordinates:function(t,e){return e.map((function(e){return{feature_id:t,coord_path:e}}))},onFeature:function(t,e){0===t.selectedCoordPaths.length?this.startDragging(t,e):this.stopDragging(t)},dragFeature:function(t,e,n){re(this.getSelected(),n),t.dragMoveLocation=e.lngLat},dragVertex:function(t,e,n){for(var r=t.selectedCoordPaths.map((function(e){return t.feature.getCoordinate(e)})),o=ne(r.map((function(t){return{type:E,properties:{},geometry:{type:L,coordinates:t}}})),n),i=0;i<r.length;i++){var u=r[i];t.feature.updateCoordinate(t.selectedCoordPaths[i],u[0]+o.lng,u[1]+o.lat)}},clickNoTarget:function(){this.changeMode(T.SIMPLE_SELECT)},clickInactive:function(){this.changeMode(T.SIMPLE_SELECT)},clickActiveFeature:function(t){t.selectedCoordPaths=[],this.clearSelectedCoordinates(),t.feature.changed()},onSetup:function(t){var e=t.featureId,n=this.getFeature(e);if(!n)throw new Error("You must provide a featureId to enter direct_select mode");if(n.type===L)throw new TypeError("direct_select mode doesn't handle point features");var r={featureId:e,feature:n,dragMoveLocation:t.startPos||null,dragMoving:!1,canDragMove:!1,selectedCoordPaths:t.coordPath?[t.coordPath]:[]};return this.setSelectedCoordinates(this.pathsToCoordinates(e,r.selectedCoordPaths)),this.setSelected(e),Wt(this),this.setActionableState({trash:!0}),r},onStop:function(){Vt(this),this.clearSelectedCoordinates()},toDisplayFeatures:function(t,e,n){t.featureId===e.properties.id?(e.properties.active=Y,n(e),$t(e,{map:this.map,midpoints:!0,selectedPaths:t.selectedCoordPaths}).forEach(n)):(e.properties.active=H,n(e)),this.fireActionable(t)},onTrash:function(t){t.selectedCoordPaths.sort((function(t,e){return e.localeCompare(t,"en",{numeric:!0})})).forEach((function(e){return t.feature.removeCoordinate(e)})),this.fireUpdate(),t.selectedCoordPaths=[],this.clearSelectedCoordinates(),this.fireActionable(t),!1===t.feature.isValid()&&(this.deleteFeature([t.featureId]),this.changeMode(T.SIMPLE_SELECT,{}))},onMouseMove:function(t,e){var n=kt(e),r=ie(e),o=0===t.selectedCoordPaths.length;return n&&o||r&&!o?this.updateUIClasses({mouse:w}):this.updateUIClasses({mouse:M}),this.stopDragging(t),!0},onMouseOut:function(t){return t.dragMoving&&this.fireUpdate(),!0}};ae.onTouchStart=ae.onMouseDown=function(t,e){return ie(e)?this.onVertex(t,e):kt(e)?this.onFeature(t,e):ue(e)?this.onMidpoint(t,e):void 0},ae.onDrag=function(t,e){if(!0===t.canDragMove){t.dragMoving=!0,e.originalEvent.stopPropagation();var n={lng:e.lngLat.lng-t.dragMoveLocation.lng,lat:e.lngLat.lat-t.dragMoveLocation.lat};t.selectedCoordPaths.length>0?this.dragVertex(t,e,n):this.dragFeature(t,e,n),t.dragMoveLocation=e.lngLat}},ae.onClick=function(t,e){return jt(e)?this.clickNoTarget(t,e):kt(e)?this.clickActiveFeature(t,e):Ot(e)?this.clickInactive(t,e):void this.stopDragging(t)},ae.onTap=function(t,e){return jt(e)?this.clickNoTarget(t,e):kt(e)?this.clickActiveFeature(t,e):Ot(e)?this.clickInactive(t,e):void 0},ae.onTouchEnd=ae.onMouseUp=function(t){t.dragMoving&&this.fireUpdate(),this.stopDragging(t)};var ce={};function se(t,e){return!!t.lngLat&&t.lngLat.lng===e[0]&&t.lngLat.lat===e[1]}ce.onSetup=function(){var t=this.newFeature({type:E,properties:{},geometry:{type:L,coordinates:[]}});return this.addFeature(t),this.clearSelectedFeatures(),this.updateUIClasses({mouse:b}),this.activateUIButton(C.POINT),this.setActionableState({trash:!0}),{point:t}},ce.stopDrawingAndRemove=function(t){this.deleteFeature([t.point.id],{silent:!0}),this.changeMode(T.SIMPLE_SELECT)},ce.onTap=ce.onClick=function(t,e){this.updateUIClasses({mouse:w}),t.point.updateCoordinate("",e.lngLat.lng,e.lngLat.lat),this.map.fire(N,{features:[t.point.toGeoJSON()]}),this.changeMode(T.SIMPLE_SELECT,{featureIds:[t.point.id]})},ce.onStop=function(t){this.activateUIButton(),t.point.getCoordinate().length||this.deleteFeature([t.point.id],{silent:!0})},ce.toDisplayFeatures=function(t,e,n){var r=e.properties.id===t.point.id;if(e.properties.active=r?Y:H,!r)return n(e)},ce.onTrash=ce.stopDrawingAndRemove,ce.onKeyUp=function(t,e){if(Nt(e)||Dt(e))return this.stopDrawingAndRemove(t,e)};var le={onSetup:function(){var t=this.newFeature({type:E,properties:{},geometry:{type:I,coordinates:[[]]}});return this.addFeature(t),this.clearSelectedFeatures(),Wt(this),this.updateUIClasses({mouse:b}),this.activateUIButton(C.POLYGON),this.setActionableState({trash:!0}),{polygon:t,currentVertexPosition:0}},clickAnywhere:function(t,e){if(t.currentVertexPosition>0&&se(e,t.polygon.coordinates[0][t.currentVertexPosition-1]))return this.changeMode(T.SIMPLE_SELECT,{featureIds:[t.polygon.id]});this.updateUIClasses({mouse:b}),t.polygon.updateCoordinate("0."+t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat),t.currentVertexPosition++,t.polygon.updateCoordinate("0."+t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat)},clickOnVertex:function(t){return this.changeMode(T.SIMPLE_SELECT,{featureIds:[t.polygon.id]})},onMouseMove:function(t,e){t.polygon.updateCoordinate("0."+t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat),At(e)&&this.updateUIClasses({mouse:S})}};le.onTap=le.onClick=function(t,e){return At(e)?this.clickOnVertex(t,e):this.clickAnywhere(t,e)},le.onKeyUp=function(t,e){Nt(e)?(this.deleteFeature([t.polygon.id],{silent:!0}),this.changeMode(T.SIMPLE_SELECT)):Dt(e)&&this.changeMode(T.SIMPLE_SELECT,{featureIds:[t.polygon.id]})},le.onStop=function(t){this.updateUIClasses({mouse:M}),Vt(this),this.activateUIButton(),void 0!==this.getFeature(t.polygon.id)&&(t.polygon.removeCoordinate("0."+t.currentVertexPosition),t.polygon.isValid()?this.map.fire(N,{features:[t.polygon.toGeoJSON()]}):(this.deleteFeature([t.polygon.id],{silent:!0}),this.changeMode(T.SIMPLE_SELECT,{},{silent:!0})))},le.toDisplayFeatures=function(t,e,n){var r=e.properties.id===t.polygon.id;if(e.properties.active=r?Y:H,!r)return n(e);if(0!==e.geometry.coordinates.length){var o=e.geometry.coordinates[0].length;if(!(o<3)){if(e.properties.meta=q,n(zt(t.polygon.id,e.geometry.coordinates[0][0],"0.0",!1)),o>3){var i=e.geometry.coordinates[0].length-3;n(zt(t.polygon.id,e.geometry.coordinates[0][i],"0."+i,!1))}if(o<=4){var u=[[e.geometry.coordinates[0][0][0],e.geometry.coordinates[0][0][1]],[e.geometry.coordinates[0][1][0],e.geometry.coordinates[0][1][1]]];if(n({type:E,properties:e.properties,geometry:{coordinates:u,type:F}}),3===o)return}return n(e)}}},le.onTrash=function(t){this.deleteFeature([t.polygon.id],{silent:!0}),this.changeMode(T.SIMPLE_SELECT)};var fe={onSetup:function(t){var e,n,r=(t=t||{}).featureId,o="forward";if(r){if(!(e=this.getFeature(r)))throw new Error("Could not find a feature with the provided featureId");var i=t.from;if(i&&"Feature"===i.type&&i.geometry&&"Point"===i.geometry.type&&(i=i.geometry),i&&"Point"===i.type&&i.coordinates&&2===i.coordinates.length&&(i=i.coordinates),!i||!Array.isArray(i))throw new Error("Please use the `from` property to indicate which point to continue the line from");var u=e.coordinates.length-1;if(e.coordinates[u][0]===i[0]&&e.coordinates[u][1]===i[1])n=u+1,e.addCoordinate.apply(e,[n].concat(e.coordinates[u]));else{if(e.coordinates[0][0]!==i[0]||e.coordinates[0][1]!==i[1])throw new Error("`from` should match the point at either the start or the end of the provided LineString");o="backwards",n=0,e.addCoordinate.apply(e,[n].concat(e.coordinates[0]))}}else e=this.newFeature({type:E,properties:{},geometry:{type:F,coordinates:[]}}),n=0,this.addFeature(e);return this.clearSelectedFeatures(),Wt(this),this.updateUIClasses({mouse:b}),this.activateUIButton(C.LINE),this.setActionableState({trash:!0}),{line:e,currentVertexPosition:n,direction:o}},clickAnywhere:function(t,e){if(t.currentVertexPosition>0&&se(e,t.line.coordinates[t.currentVertexPosition-1])||"backwards"===t.direction&&se(e,t.line.coordinates[t.currentVertexPosition+1]))return this.changeMode(T.SIMPLE_SELECT,{featureIds:[t.line.id]});this.updateUIClasses({mouse:b}),t.line.updateCoordinate(t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat),"forward"===t.direction?(t.currentVertexPosition++,t.line.updateCoordinate(t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat)):t.line.addCoordinate(0,e.lngLat.lng,e.lngLat.lat)},clickOnVertex:function(t){return this.changeMode(T.SIMPLE_SELECT,{featureIds:[t.line.id]})},onMouseMove:function(t,e){t.line.updateCoordinate(t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat),At(e)&&this.updateUIClasses({mouse:S})}};fe.onTap=fe.onClick=function(t,e){if(At(e))return this.clickOnVertex(t,e);this.clickAnywhere(t,e)},fe.onKeyUp=function(t,e){Dt(e)?this.changeMode(T.SIMPLE_SELECT,{featureIds:[t.line.id]}):Nt(e)&&(this.deleteFeature([t.line.id],{silent:!0}),this.changeMode(T.SIMPLE_SELECT))},fe.onStop=function(t){Vt(this),this.activateUIButton(),void 0!==this.getFeature(t.line.id)&&(t.line.removeCoordinate(""+t.currentVertexPosition),t.line.isValid()?this.map.fire(N,{features:[t.line.toGeoJSON()]}):(this.deleteFeature([t.line.id],{silent:!0}),this.changeMode(T.SIMPLE_SELECT,{},{silent:!0})))},fe.onTrash=function(t){this.deleteFeature([t.line.id],{silent:!0}),this.changeMode(T.SIMPLE_SELECT)},fe.toDisplayFeatures=function(t,e,n){var r=e.properties.id===t.line.id;if(e.properties.active=r?Y:H,!r)return n(e);e.geometry.coordinates.length<2||(e.properties.meta=q,n(zt(t.line.id,e.geometry.coordinates["forward"===t.direction?e.geometry.coordinates.length-2:1],""+("forward"===t.direction?e.geometry.coordinates.length-2:1),!1)),n(e))};var pe={simple_select:oe,direct_select:ae,draw_point:ce,draw_polygon:le,draw_line_string:fe},he={defaultMode:T.SIMPLE_SELECT,keybindings:!0,touchEnabled:!0,clickBuffer:2,touchBuffer:25,boxSelect:!0,displayControlsDefault:!0,styles:[{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"}}],modes:pe,controls:{},userProperties:!1},de={point:!0,line_string:!0,polygon:!0,trash:!0,combine_features:!0,uncombine_features:!0},ge={point:!1,line_string:!1,polygon:!1,trash:!1,combine_features:!1,uncombine_features:!1};function ve(t,e){return t.map((function(t){return t.source?t:Et(t,{id:t.id+"."+e,source:"hot"===e?_:m})}))}var ye=st((function(t,e){var r="[object Arguments]",o="[object Map]",i="[object Object]",u="[object Set]",a=/^\[object .+?Constructor\]$/,c=/^(?:0|[1-9]\d*)$/,s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s[r]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s[o]=s["[object Number]"]=s[i]=s["[object RegExp]"]=s[u]=s["[object String]"]=s["[object WeakMap]"]=!1;var l="object"==typeof n&&n&&n.Object===Object&&n,f="object"==typeof self&&self&&self.Object===Object&&self,p=l||f||Function("return this")(),h=e&&!e.nodeType&&e,d=h&&t&&!t.nodeType&&t,g=d&&d.exports===h,v=g&&l.process,y=function(){try{return v&&v.binding&&v.binding("util")}catch(t){}}(),_=y&&y.isTypedArray;function m(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function b(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function w(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var x,S,M,C=Array.prototype,E=Function.prototype,I=Object.prototype,F=p["__core-js_shared__"],L=E.toString,P=I.hasOwnProperty,k=(x=/[^.]+$/.exec(F&&F.keys&&F.keys.IE_PROTO||""))?"Symbol(src)_1."+x:"",O=I.toString,j=RegExp("^"+L.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),A=g?p.Buffer:void 0,T=p.Symbol,N=p.Uint8Array,D=I.propertyIsEnumerable,R=C.splice,B=T?T.toStringTag:void 0,U=Object.getOwnPropertySymbols,z=A?A.isBuffer:void 0,$=(S=Object.keys,M=Object,function(t){return S(M(t))}),V=yt(p,"DataView"),W=yt(p,"Map"),G=yt(p,"Promise"),J=yt(p,"Set"),q=yt(p,"WeakMap"),Z=yt(Object,"create"),K=wt(V),Y=wt(W),H=wt(G),X=wt(J),Q=wt(q),tt=T?T.prototype:void 0,et=tt?tt.valueOf:void 0;function nt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function rt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function ot(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function it(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new ot;++e<n;)this.add(t[e])}function ut(t){var e=this.__data__=new rt(t);this.size=e.size}function at(t,e){var n=Mt(t),r=!n&&St(t),o=!n&&!r&&Ct(t),i=!n&&!r&&!o&&Pt(t),u=n||r||o||i,a=u?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],c=a.length;for(var s in t)!e&&!P.call(t,s)||u&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||bt(s,c))||a.push(s);return a}function ct(t,e){for(var n=t.length;n--;)if(xt(t[n][0],e))return n;return-1}function st(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":B&&B in Object(t)?function(t){var e=P.call(t,B),n=t[B];try{t[B]=void 0;var r=!0}catch(t){}var o=O.call(t);return r&&(e?t[B]=n:delete t[B]),o}(t):function(t){return O.call(t)}(t)}function lt(t){return Lt(t)&&st(t)==r}function ft(t,e,n,a,c){return t===e||(null==t||null==e||!Lt(t)&&!Lt(e)?t!=t&&e!=e:function(t,e,n,a,c,s){var l=Mt(t),f=Mt(e),p=l?"[object Array]":mt(t),h=f?"[object Array]":mt(e),d=(p=p==r?i:p)==i,g=(h=h==r?i:h)==i,v=p==h;if(v&&Ct(t)){if(!Ct(e))return!1;l=!0,d=!1}if(v&&!d)return s||(s=new ut),l||Pt(t)?dt(t,e,n,a,c,s):function(t,e,n,r,i,a,c){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!a(new N(t),new N(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return xt(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case o:var s=b;case u:var l=1&r;if(s||(s=w),t.size!=e.size&&!l)return!1;var f=c.get(t);if(f)return f==e;r|=2,c.set(t,e);var p=dt(s(t),s(e),r,i,a,c);return c.delete(t),p;case"[object Symbol]":if(et)return et.call(t)==et.call(e)}return!1}(t,e,p,n,a,c,s);if(!(1&n)){var y=d&&P.call(t,"__wrapped__"),_=g&&P.call(e,"__wrapped__");if(y||_){var m=y?t.value():t,x=_?e.value():e;return s||(s=new ut),c(m,x,n,a,s)}}return!!v&&(s||(s=new ut),function(t,e,n,r,o,i){var u=1&n,a=gt(t),c=a.length;if(c!=gt(e).length&&!u)return!1;for(var s=c;s--;){var l=a[s];if(!(u?l in e:P.call(e,l)))return!1}var f=i.get(t);if(f&&i.get(e))return f==e;var p=!0;i.set(t,e),i.set(e,t);for(var h=u;++s<c;){var d=t[l=a[s]],g=e[l];if(r)var v=u?r(g,d,l,e,t,i):r(d,g,l,t,e,i);if(!(void 0===v?d===g||o(d,g,n,r,i):v)){p=!1;break}h||(h="constructor"==l)}if(p&&!h){var y=t.constructor,_=e.constructor;y==_||!("constructor"in t)||!("constructor"in e)||"function"==typeof y&&y instanceof y&&"function"==typeof _&&_ instanceof _||(p=!1)}return i.delete(t),i.delete(e),p}(t,e,n,a,c,s))}(t,e,n,a,ft,c))}function pt(t){return!(!Ft(t)||function(t){return!!k&&k in t}(t))&&(Et(t)?j:a).test(wt(t))}function ht(t){if(n=(e=t)&&e.constructor,e!==("function"==typeof n&&n.prototype||I))return $(t);var e,n,r=[];for(var o in Object(t))P.call(t,o)&&"constructor"!=o&&r.push(o);return r}function dt(t,e,n,r,o,i){var u=1&n,a=t.length,c=e.length;if(a!=c&&!(u&&c>a))return!1;var s=i.get(t);if(s&&i.get(e))return s==e;var l=-1,f=!0,p=2&n?new it:void 0;for(i.set(t,e),i.set(e,t);++l<a;){var h=t[l],d=e[l];if(r)var g=u?r(d,h,l,e,t,i):r(h,d,l,t,e,i);if(void 0!==g){if(g)continue;f=!1;break}if(p){if(!m(e,(function(t,e){if(u=e,!p.has(u)&&(h===t||o(h,t,n,r,i)))return p.push(e);var u}))){f=!1;break}}else if(h!==d&&!o(h,d,n,r,i)){f=!1;break}}return i.delete(t),i.delete(e),f}function gt(t){return function(t,e,n){var r=e(t);return Mt(t)?r:function(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}(r,n(t))}(t,kt,_t)}function vt(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function yt(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return pt(n)?n:void 0}nt.prototype.clear=function(){this.__data__=Z?Z(null):{},this.size=0},nt.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},nt.prototype.get=function(t){var e=this.__data__;if(Z){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return P.call(e,t)?e[t]:void 0},nt.prototype.has=function(t){var e=this.__data__;return Z?void 0!==e[t]:P.call(e,t)},nt.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Z&&void 0===e?"__lodash_hash_undefined__":e,this},rt.prototype.clear=function(){this.__data__=[],this.size=0},rt.prototype.delete=function(t){var e=this.__data__,n=ct(e,t);return!(n<0||(n==e.length-1?e.pop():R.call(e,n,1),--this.size,0))},rt.prototype.get=function(t){var e=this.__data__,n=ct(e,t);return n<0?void 0:e[n][1]},rt.prototype.has=function(t){return ct(this.__data__,t)>-1},rt.prototype.set=function(t,e){var n=this.__data__,r=ct(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},ot.prototype.clear=function(){this.size=0,this.__data__={hash:new nt,map:new(W||rt),string:new nt}},ot.prototype.delete=function(t){var e=vt(this,t).delete(t);return this.size-=e?1:0,e},ot.prototype.get=function(t){return vt(this,t).get(t)},ot.prototype.has=function(t){return vt(this,t).has(t)},ot.prototype.set=function(t,e){var n=vt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},it.prototype.add=it.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},it.prototype.has=function(t){return this.__data__.has(t)},ut.prototype.clear=function(){this.__data__=new rt,this.size=0},ut.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},ut.prototype.get=function(t){return this.__data__.get(t)},ut.prototype.has=function(t){return this.__data__.has(t)},ut.prototype.set=function(t,e){var n=this.__data__;if(n instanceof rt){var r=n.__data__;if(!W||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new ot(r)}return n.set(t,e),this.size=n.size,this};var _t=U?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var u=t[n];e(u,n,t)&&(i[o++]=u)}return i}(U(t),(function(e){return D.call(t,e)})))}:function(){return[]},mt=st;function bt(t,e){return!!(e=null==e?9007199254740991:e)&&("number"==typeof t||c.test(t))&&t>-1&&t%1==0&&t<e}function wt(t){if(null!=t){try{return L.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function xt(t,e){return t===e||t!=t&&e!=e}(V&&"[object DataView]"!=mt(new V(new ArrayBuffer(1)))||W&&mt(new W)!=o||G&&"[object Promise]"!=mt(G.resolve())||J&&mt(new J)!=u||q&&"[object WeakMap]"!=mt(new q))&&(mt=function(t){var e=st(t),n=e==i?t.constructor:void 0,r=n?wt(n):"";if(r)switch(r){case K:return"[object DataView]";case Y:return o;case H:return"[object Promise]";case X:return u;case Q:return"[object WeakMap]"}return e});var St=lt(function(){return arguments}())?lt:function(t){return Lt(t)&&P.call(t,"callee")&&!D.call(t,"callee")},Mt=Array.isArray,Ct=z||function(){return!1};function Et(t){if(!Ft(t))return!1;var e=st(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function It(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function Ft(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Lt(t){return null!=t&&"object"==typeof t}var Pt=_?function(t){return function(e){return t(e)}}(_):function(t){return Lt(t)&&It(t.length)&&!!s[st(t)]};function kt(t){return null!=(e=t)&&It(e.length)&&!Et(e)?at(t):ht(t);var e}t.exports=function(t,e){return ft(t,e)}})),_e={Polygon:dt,LineString:ht,Point:pt,MultiPolygon:yt,MultiLineString:yt,MultiPoint:yt};function me(t,e){return e.modes=T,e.getFeatureIdsAt=function(e){return rt.click({point:e},null,t).map((function(t){return t.properties.id}))},e.getSelectedIds=function(){return t.store.getSelectedIds()},e.getSelected=function(){return{type:P,features:t.store.getSelectedIds().map((function(e){return t.store.get(e)})).map((function(t){return t.toGeoJSON()}))}},e.getSelectedPoints=function(){return{type:P,features:t.store.getSelectedCoordinates().map((function(t){return{type:E,properties:{},geometry:{type:L,coordinates:t.coordinates}}}))}},e.set=function(n){if(void 0===n.type||n.type!==P||!Array.isArray(n.features))throw new Error("Invalid FeatureCollection");var r=t.store.createRenderBatch(),o=t.store.getAllIds().slice(),i=e.add(n),u=new et(i);return(o=o.filter((function(t){return!u.has(t)}))).length&&e.delete(o),r(),i},e.add=function(e){var n=JSON.parse(JSON.stringify(Gt(e))).features.map((function(e){if(e.id=e.id||lt(),null===e.geometry)throw new Error("Invalid geometry: null");if(void 0===t.store.get(e.id)||t.store.get(e.id).type!==e.geometry.type){var n=_e[e.geometry.type];if(void 0===n)throw new Error("Invalid geometry type: "+e.geometry.type+".");var r=new n(t,e);t.store.add(r)}else{var o=t.store.get(e.id);o.properties=e.properties,ye(o.getCoordinates(),e.geometry.coordinates)||o.incomingCoords(e.geometry.coordinates)}return e.id}));return t.store.render(),n},e.get=function(e){var n=t.store.get(e);if(n)return n.toGeoJSON()},e.getAll=function(){return{type:P,features:t.store.getAll().map((function(t){return t.toGeoJSON()}))}},e.delete=function(n){return t.store.delete(n,{silent:!0}),e.getMode()!==T.DIRECT_SELECT||t.store.getSelectedIds().length?t.store.render():t.events.changeMode(T.SIMPLE_SELECT,void 0,{silent:!0}),e},e.deleteAll=function(){return t.store.delete(t.store.getAllIds(),{silent:!0}),e.getMode()===T.DIRECT_SELECT?t.events.changeMode(T.SIMPLE_SELECT,void 0,{silent:!0}):t.store.render(),e},e.changeMode=function(n,r){return void 0===r&&(r={}),n===T.SIMPLE_SELECT&&e.getMode()===T.SIMPLE_SELECT?(o=r.featureIds||[],i=t.store.getSelectedIds(),o.length===i.length&&JSON.stringify(o.map((function(t){return t})).sort())===JSON.stringify(i.map((function(t){return t})).sort())||(t.store.setSelected(r.featureIds,{silent:!0}),t.store.render()),e):(n===T.DIRECT_SELECT&&e.getMode()===T.DIRECT_SELECT&&r.featureId===t.store.getSelectedIds()[0]||t.events.changeMode(n,r,{silent:!0}),e);var o,i},e.getMode=function(){return t.events.getMode()},e.trash=function(){return t.events.trash({silent:!0}),e},e.combineFeatures=function(){return t.events.combineFeatures({silent:!0}),e},e.uncombineFeatures=function(){return t.events.uncombineFeatures({silent:!0}),e},e.setFeatureProperty=function(n,r,o){return t.store.setFeatureProperty(n,r,o),e},e}var be=function(t,e){var n={options:t=function(t){void 0===t&&(t={});var e=Et(t);return t.controls||(e.controls={}),!1===t.displayControlsDefault?e.controls=Et(ge,t.controls):e.controls=Et(de,t.controls),(e=Et(he,e)).styles=ve(e.styles,"cold").concat(ve(e.styles,"hot")),e}(t)};e=me(n,e),n.api=e;var r=Lt(n);return e.onAdd=r.onAdd,e.onRemove=r.onRemove,e.types=C,e.options=t,e};function we(t){be(t,this)}return we.modes=pe,we}()})),i=r((function(t){!function(e,n){t.exports?t.exports=n():e.numeral=n()}(n,(function(){var t,e,n,r,o,i={},u={},a={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},c={currentLocale:a.currentLocale,zeroFormat:a.zeroFormat,nullFormat:a.nullFormat,defaultFormat:a.defaultFormat,scalePercentBy100:a.scalePercentBy100};function s(t,e){this._input=t,this._value=e}return(t=function(n){var r,o,u,a;if(t.isNumeral(n))r=n.value();else if(0===n||void 0===n)r=0;else if(null===n||e.isNaN(n))r=null;else if("string"==typeof n)if(c.zeroFormat&&n===c.zeroFormat)r=0;else if(c.nullFormat&&n===c.nullFormat||!n.replace(/[^0-9]+/g,"").length)r=null;else{for(o in i)if((a="function"==typeof i[o].regexps.unformat?i[o].regexps.unformat():i[o].regexps.unformat)&&n.match(a)){u=i[o].unformat;break}r=(u=u||t._.stringToNumber)(n)}else r=Number(n)||null;return new s(n,r)}).version="2.0.6",t.isNumeral=function(t){return t instanceof s},t._=e={numberToFormat:function(e,n,r){var o,i,a,c,s,l,f,p,h=u[t.options.currentLocale],d=!1,g=!1,v="",y=1e12,_=1e9,m=1e6,b="",w=!1;if(e=e||0,a=Math.abs(e),t._.includes(n,"(")?(d=!0,n=n.replace(/[\(|\)]/g,"")):(t._.includes(n,"+")||t._.includes(n,"-"))&&(l=t._.includes(n,"+")?n.indexOf("+"):e<0?n.indexOf("-"):-1,n=n.replace(/[\+|\-]/g,"")),t._.includes(n,"a")&&(i=!!(i=n.match(/a(k|m|b|t)?/))&&i[1],t._.includes(n," a")&&(v=" "),n=n.replace(new RegExp(v+"a[kmbt]?"),""),a>=y&&!i||"t"===i?(v+=h.abbreviations.trillion,e/=y):a<y&&a>=_&&!i||"b"===i?(v+=h.abbreviations.billion,e/=_):a<_&&a>=m&&!i||"m"===i?(v+=h.abbreviations.million,e/=m):(a<m&&a>=1e3&&!i||"k"===i)&&(v+=h.abbreviations.thousand,e/=1e3)),t._.includes(n,"[.]")&&(g=!0,n=n.replace("[.]",".")),c=e.toString().split(".")[0],s=n.split(".")[1],f=n.indexOf(","),o=(n.split(".")[0].split(",")[0].match(/0/g)||[]).length,s?(t._.includes(s,"[")?(s=(s=s.replace("]","")).split("["),b=t._.toFixed(e,s[0].length+s[1].length,r,s[1].length)):b=t._.toFixed(e,s.length,r),c=b.split(".")[0],b=t._.includes(b,".")?h.delimiters.decimal+b.split(".")[1]:"",g&&0===Number(b.slice(1))&&(b="")):c=t._.toFixed(e,0,r),v&&!i&&Number(c)>=1e3&&v!==h.abbreviations.trillion)switch(c=String(Number(c)/1e3),v){case h.abbreviations.thousand:v=h.abbreviations.million;break;case h.abbreviations.million:v=h.abbreviations.billion;break;case h.abbreviations.billion:v=h.abbreviations.trillion}if(t._.includes(c,"-")&&(c=c.slice(1),w=!0),c.length<o)for(var x=o-c.length;x>0;x--)c="0"+c;return f>-1&&(c=c.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+h.delimiters.thousands)),0===n.indexOf(".")&&(c=""),p=c+b+(v||""),d?p=(d&&w?"(":"")+p+(d&&w?")":""):l>=0?p=0===l?(w?"-":"+")+p:p+(w?"-":"+"):w&&(p="-"+p),p},stringToNumber:function(t){var e,n,r,o=u[c.currentLocale],i=t,a={thousand:3,million:6,billion:9,trillion:12};if(c.zeroFormat&&t===c.zeroFormat)n=0;else if(c.nullFormat&&t===c.nullFormat||!t.replace(/[^0-9]+/g,"").length)n=null;else{for(e in n=1,"."!==o.delimiters.decimal&&(t=t.replace(/\./g,"").replace(o.delimiters.decimal,".")),a)if(r=new RegExp("[^a-zA-Z]"+o.abbreviations[e]+"(?:\\)|(\\"+o.currency.symbol+")?(?:\\))?)?$"),i.match(r)){n*=Math.pow(10,a[e]);break}n*=(t.split("-").length+Math.min(t.split("(").length-1,t.split(")").length-1))%2?1:-1,t=t.replace(/[^0-9\.]+/g,""),n*=Number(t)}return n},isNaN:function(t){return"number"==typeof t&&isNaN(t)},includes:function(t,e){return-1!==t.indexOf(e)},insert:function(t,e,n){return t.slice(0,n)+e+t.slice(n)},reduce:function(t,e){if(null===this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof e)throw new TypeError(e+" is not a function");var n,r=Object(t),o=r.length>>>0,i=0;if(3===arguments.length)n=arguments[2];else{for(;i<o&&!(i in r);)i++;if(i>=o)throw new TypeError("Reduce of empty array with no initial value");n=r[i++]}for(;i<o;i++)i in r&&(n=e(n,r[i],i,r));return n},multiplier:function(t){var e=t.toString().split(".");return e.length<2?1:Math.pow(10,e[1].length)},correctionFactor:function(){var t=Array.prototype.slice.call(arguments);return t.reduce((function(t,n){var r=e.multiplier(n);return t>r?t:r}),1)},toFixed:function(t,e,n,r){var o,i,u,a,c=t.toString().split("."),s=e-(r||0);return o=2===c.length?Math.min(Math.max(c[1].length,s),e):s,u=Math.pow(10,o),a=(n(t+"e+"+o)/u).toFixed(o),r>e-o&&(i=new RegExp("\\.?0{1,"+(r-(e-o))+"}$"),a=a.replace(i,"")),a}},t.options=c,t.formats=i,t.locales=u,t.locale=function(t){return t&&(c.currentLocale=t.toLowerCase()),c.currentLocale},t.localeData=function(t){if(!t)return u[c.currentLocale];if(t=t.toLowerCase(),!u[t])throw new Error("Unknown locale : "+t);return u[t]},t.reset=function(){for(var t in a)c[t]=a[t]},t.zeroFormat=function(t){c.zeroFormat="string"==typeof t?t:null},t.nullFormat=function(t){c.nullFormat="string"==typeof t?t:null},t.defaultFormat=function(t){c.defaultFormat="string"==typeof t?t:"0.0"},t.register=function(t,e,n){if(e=e.toLowerCase(),this[t+"s"][e])throw new TypeError(e+" "+t+" already registered.");return this[t+"s"][e]=n,n},t.validate=function(e,n){var r,o,i,u,a,c,s,l;if("string"!=typeof e&&(e+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",e)),(e=e.trim()).match(/^\d+$/))return!0;if(""===e)return!1;try{s=t.localeData(n)}catch(e){s=t.localeData(t.locale())}return i=s.currency.symbol,a=s.abbreviations,r=s.delimiters.decimal,o="."===s.delimiters.thousands?"\\.":s.delimiters.thousands,(null===(l=e.match(/^[^\d]+/))||(e=e.substr(1),l[0]===i))&&((null===(l=e.match(/[^\d]+$/))||(e=e.slice(0,-1),l[0]===a.thousand||l[0]===a.million||l[0]===a.billion||l[0]===a.trillion))&&(c=new RegExp(o+"{2}"),!e.match(/[^\d.,]/g)&&(!((u=e.split(r)).length>2)&&(u.length<2?!!u[0].match(/^\d+.*\d$/)&&!u[0].match(c):1===u[0].length?!!u[0].match(/^\d+$/)&&!u[0].match(c)&&!!u[1].match(/^\d+$/):!!u[0].match(/^\d+.*\d$/)&&!u[0].match(c)&&!!u[1].match(/^\d+$/)))))},t.fn=s.prototype={clone:function(){return t(this)},format:function(e,n){var r,o,u,a=this._value,s=e||c.defaultFormat;if(n=n||Math.round,0===a&&null!==c.zeroFormat)o=c.zeroFormat;else if(null===a&&null!==c.nullFormat)o=c.nullFormat;else{for(r in i)if(s.match(i[r].regexps.format)){u=i[r].format;break}o=(u=u||t._.numberToFormat)(a,s,n)}return o},value:function(){return this._value},input:function(){return this._input},set:function(t){return this._value=Number(t),this},add:function(t){var n=e.correctionFactor.call(null,this._value,t);return this._value=e.reduce([this._value,t],(function(t,e,r,o){return t+Math.round(n*e)}),0)/n,this},subtract:function(t){var n=e.correctionFactor.call(null,this._value,t);return this._value=e.reduce([t],(function(t,e,r,o){return t-Math.round(n*e)}),Math.round(this._value*n))/n,this},multiply:function(t){return this._value=e.reduce([this._value,t],(function(t,n,r,o){var i=e.correctionFactor(t,n);return Math.round(t*i)*Math.round(n*i)/Math.round(i*i)}),1),this},divide:function(t){return this._value=e.reduce([this._value,t],(function(t,n,r,o){var i=e.correctionFactor(t,n);return Math.round(t*i)/Math.round(n*i)})),this},difference:function(e){return Math.abs(t(this._value).subtract(e).value())}},t.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(t){var e=t%10;return 1==~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th"},currency:{symbol:"$"}}),t.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(e,n,r){var o,i=t._.includes(n," BPS")?" ":"";return e*=1e4,n=n.replace(/\s?BPS/,""),o=t._.numberToFormat(e,n,r),t._.includes(o,")")?((o=o.split("")).splice(-1,0,i+"BPS"),o=o.join("")):o=o+i+"BPS",o},unformat:function(e){return+(1e-4*t._.stringToNumber(e)).toFixed(15)}}),r={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},o="("+(o=(n={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}).suffixes.concat(r.suffixes.filter((function(t){return n.suffixes.indexOf(t)<0}))).join("|")).replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(o)},format:function(e,o,i){var u,a,c,s=t._.includes(o,"ib")?r:n,l=t._.includes(o," b")||t._.includes(o," ib")?" ":"";for(o=o.replace(/\s?i?b/,""),u=0;u<=s.suffixes.length;u++)if(a=Math.pow(s.base,u),c=Math.pow(s.base,u+1),null===e||0===e||e>=a&&e<c){l+=s.suffixes[u],a>0&&(e/=a);break}return t._.numberToFormat(e,o,i)+l},unformat:function(e){var o,i,u=t._.stringToNumber(e);if(u){for(o=n.suffixes.length-1;o>=0;o--){if(t._.includes(e,n.suffixes[o])){i=Math.pow(n.base,o);break}if(t._.includes(e,r.suffixes[o])){i=Math.pow(r.base,o);break}}u*=i||1}return u}}),t.register("format","currency",{regexps:{format:/(\$)/},format:function(e,n,r){var o,i,u=t.locales[t.options.currentLocale],a={before:n.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:n.match(/([\+|\-|\)|\s|\$]*)$/)[0]};for(n=n.replace(/\s?\$\s?/,""),o=t._.numberToFormat(e,n,r),e>=0?(a.before=a.before.replace(/[\-\(]/,""),a.after=a.after.replace(/[\-\)]/,"")):e<0&&!t._.includes(a.before,"-")&&!t._.includes(a.before,"(")&&(a.before="-"+a.before),i=0;i<a.before.length;i++)switch(a.before[i]){case"$":o=t._.insert(o,u.currency.symbol,i);break;case" ":o=t._.insert(o," ",i+u.currency.symbol.length-1)}for(i=a.after.length-1;i>=0;i--)switch(a.after[i]){case"$":o=i===a.after.length-1?o+u.currency.symbol:t._.insert(o,u.currency.symbol,-(a.after.length-(1+i)));break;case" ":o=i===a.after.length-1?o+" ":t._.insert(o," ",-(a.after.length-(1+i)+u.currency.symbol.length-1))}return o}}),t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(e,n,r){var o=("number"!=typeof e||t._.isNaN(e)?"0e+0":e.toExponential()).split("e");return n=n.replace(/e[\+|\-]{1}0/,""),t._.numberToFormat(Number(o[0]),n,r)+"e"+o[1]},unformat:function(e){var n=t._.includes(e,"e+")?e.split("e+"):e.split("e-"),r=Number(n[0]),o=Number(n[1]);return o=t._.includes(e,"e-")?o*=-1:o,t._.reduce([r,Math.pow(10,o)],(function(e,n,r,o){var i=t._.correctionFactor(e,n);return e*i*(n*i)/(i*i)}),1)}}),t.register("format","ordinal",{regexps:{format:/(o)/},format:function(e,n,r){var o=t.locales[t.options.currentLocale],i=t._.includes(n," o")?" ":"";return n=n.replace(/\s?o/,""),i+=o.ordinal(e),t._.numberToFormat(e,n,r)+i}}),t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(e,n,r){var o,i=t._.includes(n," %")?" ":"";return t.options.scalePercentBy100&&(e*=100),n=n.replace(/\s?\%/,""),o=t._.numberToFormat(e,n,r),t._.includes(o,")")?((o=o.split("")).splice(-1,0,i+"%"),o=o.join("")):o=o+i+"%",o},unformat:function(e){var n=t._.stringToNumber(e);return t.options.scalePercentBy100?.01*n:n}}),t.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(t,e,n){var r=Math.floor(t/60/60),o=Math.floor((t-60*r*60)/60),i=Math.round(t-60*r*60-60*o);return r+":"+(o<10?"0"+o:o)+":"+(i<10?"0"+i:i)},unformat:function(t){var e=t.split(":"),n=0;return 3===e.length?(n+=60*Number(e[0])*60,n+=60*Number(e[1]),n+=Number(e[2])):2===e.length&&(n+=60*Number(e[0]),n+=Number(e[1])),Number(n)}}),t}))})),u=r((function(t,e){(function(){var r,o="Expected a function",i="__lodash_hash_undefined__",u="__lodash_placeholder__",a=16,c=32,s=64,l=128,f=256,p=1/0,h=9007199254740991,d=NaN,g=4294967295,v=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",a],["flip",512],["partial",c],["partialRight",s],["rearg",f]],y="[object Arguments]",_="[object Array]",m="[object Boolean]",b="[object Date]",w="[object Error]",x="[object Function]",S="[object GeneratorFunction]",M="[object Map]",C="[object Number]",E="[object Object]",I="[object Promise]",F="[object RegExp]",L="[object Set]",P="[object String]",k="[object Symbol]",O="[object WeakMap]",j="[object ArrayBuffer]",A="[object DataView]",T="[object Float32Array]",N="[object Float64Array]",D="[object Int8Array]",R="[object Int16Array]",B="[object Int32Array]",U="[object Uint8Array]",z="[object Uint8ClampedArray]",$="[object Uint16Array]",V="[object Uint32Array]",W=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,J=/(__e\(.*?\)|\b__t\)) \+\n'';/g,q=/&(?:amp|lt|gt|quot|#39);/g,Z=/[&<>"']/g,K=RegExp(q.source),Y=RegExp(Z.source),H=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,Q=/<%=([\s\S]+?)%>/g,tt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,et=/^\w*$/,nt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rt=/[\\^$.*+?()[\]{}|]/g,ot=RegExp(rt.source),it=/^\s+/,ut=/\s/,at=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ct=/\{\n\/\* \[wrapped with (.+)\] \*/,st=/,? & /,lt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ft=/[()=,{}\[\]\/\s]/,pt=/\\(\\)?/g,ht=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,dt=/\w*$/,gt=/^[-+]0x[0-9a-f]+$/i,vt=/^0b[01]+$/i,yt=/^\[object .+?Constructor\]$/,_t=/^0o[0-7]+$/i,mt=/^(?:0|[1-9]\d*)$/,bt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,wt=/($^)/,xt=/['\n\r\u2028\u2029\\]/g,St="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Mt="\\u2700-\\u27bf",Ct="a-z\\xdf-\\xf6\\xf8-\\xff",Et="A-Z\\xc0-\\xd6\\xd8-\\xde",It="\\ufe0e\\ufe0f",Ft="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Lt="['’]",Pt="[\\ud800-\\udfff]",kt="["+Ft+"]",Ot="["+St+"]",jt="\\d+",At="[\\u2700-\\u27bf]",Tt="["+Ct+"]",Nt="[^\\ud800-\\udfff"+Ft+jt+Mt+Ct+Et+"]",Dt="\\ud83c[\\udffb-\\udfff]",Rt="[^\\ud800-\\udfff]",Bt="(?:\\ud83c[\\udde6-\\uddff]){2}",Ut="[\\ud800-\\udbff][\\udc00-\\udfff]",zt="["+Et+"]",$t="(?:"+Tt+"|"+Nt+")",Vt="(?:"+zt+"|"+Nt+")",Wt="(?:['’](?:d|ll|m|re|s|t|ve))?",Gt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Jt="(?:"+Ot+"|"+Dt+")"+"?",qt="[\\ufe0e\\ufe0f]?",Zt=qt+Jt+("(?:\\u200d(?:"+[Rt,Bt,Ut].join("|")+")"+qt+Jt+")*"),Kt="(?:"+[At,Bt,Ut].join("|")+")"+Zt,Yt="(?:"+[Rt+Ot+"?",Ot,Bt,Ut,Pt].join("|")+")",Ht=RegExp(Lt,"g"),Xt=RegExp(Ot,"g"),Qt=RegExp(Dt+"(?="+Dt+")|"+Yt+Zt,"g"),te=RegExp([zt+"?"+Tt+"+"+Wt+"(?="+[kt,zt,"$"].join("|")+")",Vt+"+"+Gt+"(?="+[kt,zt+$t,"$"].join("|")+")",zt+"?"+$t+"+"+Wt,zt+"+"+Gt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",jt,Kt].join("|"),"g"),ee=RegExp("[\\u200d\\ud800-\\udfff"+St+It+"]"),ne=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,re=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],oe=-1,ie={};ie[T]=ie[N]=ie[D]=ie[R]=ie[B]=ie[U]=ie[z]=ie[$]=ie[V]=!0,ie[y]=ie[_]=ie[j]=ie[m]=ie[A]=ie[b]=ie[w]=ie[x]=ie[M]=ie[C]=ie[E]=ie[F]=ie[L]=ie[P]=ie[O]=!1;var ue={};ue[y]=ue[_]=ue[j]=ue[A]=ue[m]=ue[b]=ue[T]=ue[N]=ue[D]=ue[R]=ue[B]=ue[M]=ue[C]=ue[E]=ue[F]=ue[L]=ue[P]=ue[k]=ue[U]=ue[z]=ue[$]=ue[V]=!0,ue[w]=ue[x]=ue[O]=!1;var ae={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ce=parseFloat,se=parseInt,le="object"==typeof n&&n&&n.Object===Object&&n,fe="object"==typeof self&&self&&self.Object===Object&&self,pe=le||fe||Function("return this")(),he=e&&!e.nodeType&&e,de=he&&t&&!t.nodeType&&t,ge=de&&de.exports===he,ve=ge&&le.process,ye=function(){try{var t=de&&de.require&&de.require("util").types;return t||ve&&ve.binding&&ve.binding("util")}catch(t){}}(),_e=ye&&ye.isArrayBuffer,me=ye&&ye.isDate,be=ye&&ye.isMap,we=ye&&ye.isRegExp,xe=ye&&ye.isSet,Se=ye&&ye.isTypedArray;function Me(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ce(t,e,n,r){for(var o=-1,i=null==t?0:t.length;++o<i;){var u=t[o];e(r,u,n(u),t)}return r}function Ee(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Ie(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function Fe(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Le(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var u=t[n];e(u,n,t)&&(i[o++]=u)}return i}function Pe(t,e){return!!(null==t?0:t.length)&&Ue(t,e,0)>-1}function ke(t,e,n){for(var r=-1,o=null==t?0:t.length;++r<o;)if(n(e,t[r]))return!0;return!1}function Oe(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}function je(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}function Ae(t,e,n,r){var o=-1,i=null==t?0:t.length;for(r&&i&&(n=t[++o]);++o<i;)n=e(n,t[o],o,t);return n}function Te(t,e,n,r){var o=null==t?0:t.length;for(r&&o&&(n=t[--o]);o--;)n=e(n,t[o],o,t);return n}function Ne(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var De=We("length");function Re(t,e,n){var r;return n(t,(function(t,n,o){if(e(t,n,o))return r=n,!1})),r}function Be(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i<o;)if(e(t[i],i,t))return i;return-1}function Ue(t,e,n){return e==e?function(t,e,n){var r=n-1,o=t.length;for(;++r<o;)if(t[r]===e)return r;return-1}(t,e,n):Be(t,$e,n)}function ze(t,e,n,r){for(var o=n-1,i=t.length;++o<i;)if(r(t[o],e))return o;return-1}function $e(t){return t!=t}function Ve(t,e){var n=null==t?0:t.length;return n?qe(t,e)/n:d}function We(t){return function(e){return null==e?r:e[t]}}function Ge(t){return function(e){return null==t?r:t[e]}}function Je(t,e,n,r,o){return o(t,(function(t,o,i){n=r?(r=!1,t):e(n,t,o,i)})),n}function qe(t,e){for(var n,o=-1,i=t.length;++o<i;){var u=e(t[o]);u!==r&&(n=n===r?u:n+u)}return n}function Ze(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Ke(t){return t?t.slice(0,dn(t)+1).replace(it,""):t}function Ye(t){return function(e){return t(e)}}function He(t,e){return Oe(e,(function(e){return t[e]}))}function Xe(t,e){return t.has(e)}function Qe(t,e){for(var n=-1,r=t.length;++n<r&&Ue(e,t[n],0)>-1;);return n}function tn(t,e){for(var n=t.length;n--&&Ue(e,t[n],0)>-1;);return n}function en(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}var nn=Ge({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),rn=Ge({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function on(t){return"\\"+ae[t]}function un(t){return ee.test(t)}function an(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function cn(t,e){return function(n){return t(e(n))}}function sn(t,e){for(var n=-1,r=t.length,o=0,i=[];++n<r;){var a=t[n];a!==e&&a!==u||(t[n]=u,i[o++]=n)}return i}function ln(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function fn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function pn(t){return un(t)?function(t){var e=Qt.lastIndex=0;for(;Qt.test(t);)++e;return e}(t):De(t)}function hn(t){return un(t)?function(t){return t.match(Qt)||[]}(t):function(t){return t.split("")}(t)}function dn(t){for(var e=t.length;e--&&ut.test(t.charAt(e)););return e}var gn=Ge({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var vn=function t(e){var n,ut=(e=null==e?pe:vn.defaults(pe.Object(),e,vn.pick(pe,re))).Array,St=e.Date,Mt=e.Error,Ct=e.Function,Et=e.Math,It=e.Object,Ft=e.RegExp,Lt=e.String,Pt=e.TypeError,kt=ut.prototype,Ot=Ct.prototype,jt=It.prototype,At=e["__core-js_shared__"],Tt=Ot.toString,Nt=jt.hasOwnProperty,Dt=0,Rt=(n=/[^.]+$/.exec(At&&At.keys&&At.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Bt=jt.toString,Ut=Tt.call(It),zt=pe._,$t=Ft("^"+Tt.call(Nt).replace(rt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Vt=ge?e.Buffer:r,Wt=e.Symbol,Gt=e.Uint8Array,Jt=Vt?Vt.allocUnsafe:r,qt=cn(It.getPrototypeOf,It),Zt=It.create,Kt=jt.propertyIsEnumerable,Yt=kt.splice,Qt=Wt?Wt.isConcatSpreadable:r,ee=Wt?Wt.iterator:r,ae=Wt?Wt.toStringTag:r,le=function(){try{var t=di(It,"defineProperty");return t({},"",{}),t}catch(t){}}(),fe=e.clearTimeout!==pe.clearTimeout&&e.clearTimeout,he=St&&St.now!==pe.Date.now&&St.now,de=e.setTimeout!==pe.setTimeout&&e.setTimeout,ve=Et.ceil,ye=Et.floor,De=It.getOwnPropertySymbols,Ge=Vt?Vt.isBuffer:r,yn=e.isFinite,_n=kt.join,mn=cn(It.keys,It),bn=Et.max,wn=Et.min,xn=St.now,Sn=e.parseInt,Mn=Et.random,Cn=kt.reverse,En=di(e,"DataView"),In=di(e,"Map"),Fn=di(e,"Promise"),Ln=di(e,"Set"),Pn=di(e,"WeakMap"),kn=di(It,"create"),On=Pn&&new Pn,jn={},An=zi(En),Tn=zi(In),Nn=zi(Fn),Dn=zi(Ln),Rn=zi(Pn),Bn=Wt?Wt.prototype:r,Un=Bn?Bn.valueOf:r,zn=Bn?Bn.toString:r;function $n(t){if(oa(t)&&!qu(t)&&!(t instanceof Jn)){if(t instanceof Gn)return t;if(Nt.call(t,"__wrapped__"))return $i(t)}return new Gn(t)}var Vn=function(){function t(){}return function(e){if(!ra(e))return{};if(Zt)return Zt(e);t.prototype=e;var n=new t;return t.prototype=r,n}}();function Wn(){}function Gn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=r}function Jn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function qn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Zn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Kn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Yn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Kn;++e<n;)this.add(t[e])}function Hn(t){var e=this.__data__=new Zn(t);this.size=e.size}function Xn(t,e){var n=qu(t),r=!n&&Ju(t),o=!n&&!r&&Hu(t),i=!n&&!r&&!o&&pa(t),u=n||r||o||i,a=u?Ze(t.length,Lt):[],c=a.length;for(var s in t)!e&&!Nt.call(t,s)||u&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||wi(s,c))||a.push(s);return a}function Qn(t){var e=t.length;return e?t[Yr(0,e-1)]:r}function tr(t,e){return Ri(Oo(t),sr(e,0,t.length))}function er(t){return Ri(Oo(t))}function nr(t,e,n){(n!==r&&!Vu(t[e],n)||n===r&&!(e in t))&&ar(t,e,n)}function rr(t,e,n){var o=t[e];Nt.call(t,e)&&Vu(o,n)&&(n!==r||e in t)||ar(t,e,n)}function or(t,e){for(var n=t.length;n--;)if(Vu(t[n][0],e))return n;return-1}function ir(t,e,n,r){return dr(t,(function(t,o,i){e(r,t,n(t),i)})),r}function ur(t,e){return t&&jo(e,Aa(e),t)}function ar(t,e,n){"__proto__"==e&&le?le(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function cr(t,e){for(var n=-1,o=e.length,i=ut(o),u=null==t;++n<o;)i[n]=u?r:La(t,e[n]);return i}function sr(t,e,n){return t==t&&(n!==r&&(t=t<=n?t:n),e!==r&&(t=t>=e?t:e)),t}function lr(t,e,n,o,i,u){var a,c=1&e,s=2&e,l=4&e;if(n&&(a=i?n(t,o,i,u):n(t)),a!==r)return a;if(!ra(t))return t;var f=qu(t);if(f){if(a=function(t){var e=t.length,n=new t.constructor(e);e&&"string"==typeof t[0]&&Nt.call(t,"index")&&(n.index=t.index,n.input=t.input);return n}(t),!c)return Oo(t,a)}else{var p=yi(t),h=p==x||p==S;if(Hu(t))return Eo(t,c);if(p==E||p==y||h&&!i){if(a=s||h?{}:mi(t),!c)return s?function(t,e){return jo(t,vi(t),e)}(t,function(t,e){return t&&jo(e,Ta(e),t)}(a,t)):function(t,e){return jo(t,gi(t),e)}(t,ur(a,t))}else{if(!ue[p])return i?t:{};a=function(t,e,n){var r=t.constructor;switch(e){case j:return Io(t);case m:case b:return new r(+t);case A:return function(t,e){var n=e?Io(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case T:case N:case D:case R:case B:case U:case z:case $:case V:return Fo(t,n);case M:return new r;case C:case P:return new r(t);case F:return function(t){var e=new t.constructor(t.source,dt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case L:return new r;case k:return o=t,Un?It(Un.call(o)):{}}var o}(t,p,c)}}u||(u=new Hn);var d=u.get(t);if(d)return d;u.set(t,a),sa(t)?t.forEach((function(r){a.add(lr(r,e,n,r,t,u))})):ia(t)&&t.forEach((function(r,o){a.set(o,lr(r,e,n,o,t,u))}));var g=f?r:(l?s?ai:ui:s?Ta:Aa)(t);return Ee(g||t,(function(r,o){g&&(r=t[o=r]),rr(a,o,lr(r,e,n,o,t,u))})),a}function fr(t,e,n){var o=n.length;if(null==t)return!o;for(t=It(t);o--;){var i=n[o],u=e[i],a=t[i];if(a===r&&!(i in t)||!u(a))return!1}return!0}function pr(t,e,n){if("function"!=typeof t)throw new Pt(o);return Ai((function(){t.apply(r,n)}),e)}function hr(t,e,n,r){var o=-1,i=Pe,u=!0,a=t.length,c=[],s=e.length;if(!a)return c;n&&(e=Oe(e,Ye(n))),r?(i=ke,u=!1):e.length>=200&&(i=Xe,u=!1,e=new Yn(e));t:for(;++o<a;){var l=t[o],f=null==n?l:n(l);if(l=r||0!==l?l:0,u&&f==f){for(var p=s;p--;)if(e[p]===f)continue t;c.push(l)}else i(e,f,r)||c.push(l)}return c}$n.templateSettings={escape:H,evaluate:X,interpolate:Q,variable:"",imports:{_:$n}},$n.prototype=Wn.prototype,$n.prototype.constructor=$n,Gn.prototype=Vn(Wn.prototype),Gn.prototype.constructor=Gn,Jn.prototype=Vn(Wn.prototype),Jn.prototype.constructor=Jn,qn.prototype.clear=function(){this.__data__=kn?kn(null):{},this.size=0},qn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},qn.prototype.get=function(t){var e=this.__data__;if(kn){var n=e[t];return n===i?r:n}return Nt.call(e,t)?e[t]:r},qn.prototype.has=function(t){var e=this.__data__;return kn?e[t]!==r:Nt.call(e,t)},qn.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=kn&&e===r?i:e,this},Zn.prototype.clear=function(){this.__data__=[],this.size=0},Zn.prototype.delete=function(t){var e=this.__data__,n=or(e,t);return!(n<0)&&(n==e.length-1?e.pop():Yt.call(e,n,1),--this.size,!0)},Zn.prototype.get=function(t){var e=this.__data__,n=or(e,t);return n<0?r:e[n][1]},Zn.prototype.has=function(t){return or(this.__data__,t)>-1},Zn.prototype.set=function(t,e){var n=this.__data__,r=or(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Kn.prototype.clear=function(){this.size=0,this.__data__={hash:new qn,map:new(In||Zn),string:new qn}},Kn.prototype.delete=function(t){var e=pi(this,t).delete(t);return this.size-=e?1:0,e},Kn.prototype.get=function(t){return pi(this,t).get(t)},Kn.prototype.has=function(t){return pi(this,t).has(t)},Kn.prototype.set=function(t,e){var n=pi(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Yn.prototype.add=Yn.prototype.push=function(t){return this.__data__.set(t,i),this},Yn.prototype.has=function(t){return this.__data__.has(t)},Hn.prototype.clear=function(){this.__data__=new Zn,this.size=0},Hn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Hn.prototype.get=function(t){return this.__data__.get(t)},Hn.prototype.has=function(t){return this.__data__.has(t)},Hn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Zn){var r=n.__data__;if(!In||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Kn(r)}return n.set(t,e),this.size=n.size,this};var dr=No(xr),gr=No(Sr,!0);function vr(t,e){var n=!0;return dr(t,(function(t,r,o){return n=!!e(t,r,o)})),n}function yr(t,e,n){for(var o=-1,i=t.length;++o<i;){var u=t[o],a=e(u);if(null!=a&&(c===r?a==a&&!fa(a):n(a,c)))var c=a,s=u}return s}function _r(t,e){var n=[];return dr(t,(function(t,r,o){e(t,r,o)&&n.push(t)})),n}function mr(t,e,n,r,o){var i=-1,u=t.length;for(n||(n=bi),o||(o=[]);++i<u;){var a=t[i];e>0&&n(a)?e>1?mr(a,e-1,n,r,o):je(o,a):r||(o[o.length]=a)}return o}var br=Do(),wr=Do(!0);function xr(t,e){return t&&br(t,e,Aa)}function Sr(t,e){return t&&wr(t,e,Aa)}function Mr(t,e){return Le(e,(function(e){return ta(t[e])}))}function Cr(t,e){for(var n=0,o=(e=xo(e,t)).length;null!=t&&n<o;)t=t[Ui(e[n++])];return n&&n==o?t:r}function Er(t,e,n){var r=e(t);return qu(t)?r:je(r,n(t))}function Ir(t){return null==t?t===r?"[object Undefined]":"[object Null]":ae&&ae in It(t)?function(t){var e=Nt.call(t,ae),n=t[ae];try{t[ae]=r;var o=!0}catch(t){}var i=Bt.call(t);o&&(e?t[ae]=n:delete t[ae]);return i}(t):function(t){return Bt.call(t)}(t)}function Fr(t,e){return t>e}function Lr(t,e){return null!=t&&Nt.call(t,e)}function Pr(t,e){return null!=t&&e in It(t)}function kr(t,e,n){for(var o=n?ke:Pe,i=t[0].length,u=t.length,a=u,c=ut(u),s=1/0,l=[];a--;){var f=t[a];a&&e&&(f=Oe(f,Ye(e))),s=wn(f.length,s),c[a]=!n&&(e||i>=120&&f.length>=120)?new Yn(a&&f):r}f=t[0];var p=-1,h=c[0];t:for(;++p<i&&l.length<s;){var d=f[p],g=e?e(d):d;if(d=n||0!==d?d:0,!(h?Xe(h,g):o(l,g,n))){for(a=u;--a;){var v=c[a];if(!(v?Xe(v,g):o(t[a],g,n)))continue t}h&&h.push(g),l.push(d)}}return l}function Or(t,e,n){var o=null==(t=Pi(t,e=xo(e,t)))?t:t[Ui(Qi(e))];return null==o?r:Me(o,t,n)}function jr(t){return oa(t)&&Ir(t)==y}function Ar(t,e,n,o,i){return t===e||(null==t||null==e||!oa(t)&&!oa(e)?t!=t&&e!=e:function(t,e,n,o,i,u){var a=qu(t),c=qu(e),s=a?_:yi(t),l=c?_:yi(e),f=(s=s==y?E:s)==E,p=(l=l==y?E:l)==E,h=s==l;if(h&&Hu(t)){if(!Hu(e))return!1;a=!0,f=!1}if(h&&!f)return u||(u=new Hn),a||pa(t)?oi(t,e,n,o,i,u):function(t,e,n,r,o,i,u){switch(n){case A:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case j:return!(t.byteLength!=e.byteLength||!i(new Gt(t),new Gt(e)));case m:case b:case C:return Vu(+t,+e);case w:return t.name==e.name&&t.message==e.message;case F:case P:return t==e+"";case M:var a=an;case L:var c=1&r;if(a||(a=ln),t.size!=e.size&&!c)return!1;var s=u.get(t);if(s)return s==e;r|=2,u.set(t,e);var l=oi(a(t),a(e),r,o,i,u);return u.delete(t),l;case k:if(Un)return Un.call(t)==Un.call(e)}return!1}(t,e,s,n,o,i,u);if(!(1&n)){var d=f&&Nt.call(t,"__wrapped__"),g=p&&Nt.call(e,"__wrapped__");if(d||g){var v=d?t.value():t,x=g?e.value():e;return u||(u=new Hn),i(v,x,n,o,u)}}if(!h)return!1;return u||(u=new Hn),function(t,e,n,o,i,u){var a=1&n,c=ui(t),s=c.length,l=ui(e).length;if(s!=l&&!a)return!1;var f=s;for(;f--;){var p=c[f];if(!(a?p in e:Nt.call(e,p)))return!1}var h=u.get(t),d=u.get(e);if(h&&d)return h==e&&d==t;var g=!0;u.set(t,e),u.set(e,t);var v=a;for(;++f<s;){var y=t[p=c[f]],_=e[p];if(o)var m=a?o(_,y,p,e,t,u):o(y,_,p,t,e,u);if(!(m===r?y===_||i(y,_,n,o,u):m)){g=!1;break}v||(v="constructor"==p)}if(g&&!v){var b=t.constructor,w=e.constructor;b==w||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w||(g=!1)}return u.delete(t),u.delete(e),g}(t,e,n,o,i,u)}(t,e,n,o,Ar,i))}function Tr(t,e,n,o){var i=n.length,u=i,a=!o;if(null==t)return!u;for(t=It(t);i--;){var c=n[i];if(a&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++i<u;){var s=(c=n[i])[0],l=t[s],f=c[1];if(a&&c[2]){if(l===r&&!(s in t))return!1}else{var p=new Hn;if(o)var h=o(l,f,s,t,e,p);if(!(h===r?Ar(f,l,3,o,p):h))return!1}}return!0}function Nr(t){return!(!ra(t)||(e=t,Rt&&Rt in e))&&(ta(t)?$t:yt).test(zi(t));var e}function Dr(t){return"function"==typeof t?t:null==t?uc:"object"==typeof t?qu(t)?Vr(t[0],t[1]):$r(t):gc(t)}function Rr(t){if(!Ei(t))return mn(t);var e=[];for(var n in It(t))Nt.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Br(t){if(!ra(t))return function(t){var e=[];if(null!=t)for(var n in It(t))e.push(n);return e}(t);var e=Ei(t),n=[];for(var r in t)("constructor"!=r||!e&&Nt.call(t,r))&&n.push(r);return n}function Ur(t,e){return t<e}function zr(t,e){var n=-1,r=Ku(t)?ut(t.length):[];return dr(t,(function(t,o,i){r[++n]=e(t,o,i)})),r}function $r(t){var e=hi(t);return 1==e.length&&e[0][2]?Fi(e[0][0],e[0][1]):function(n){return n===t||Tr(n,t,e)}}function Vr(t,e){return Si(t)&&Ii(e)?Fi(Ui(t),e):function(n){var o=La(n,t);return o===r&&o===e?Pa(n,t):Ar(e,o,3)}}function Wr(t,e,n,o,i){t!==e&&br(e,(function(u,a){if(i||(i=new Hn),ra(u))!function(t,e,n,o,i,u,a){var c=Oi(t,n),s=Oi(e,n),l=a.get(s);if(l)return void nr(t,n,l);var f=u?u(c,s,n+"",t,e,a):r,p=f===r;if(p){var h=qu(s),d=!h&&Hu(s),g=!h&&!d&&pa(s);f=s,h||d||g?qu(c)?f=c:Yu(c)?f=Oo(c):d?(p=!1,f=Eo(s,!0)):g?(p=!1,f=Fo(s,!0)):f=[]:aa(s)||Ju(s)?(f=c,Ju(c)?f=ba(c):ra(c)&&!ta(c)||(f=mi(s))):p=!1}p&&(a.set(s,f),i(f,s,o,u,a),a.delete(s));nr(t,n,f)}(t,e,a,n,Wr,o,i);else{var c=o?o(Oi(t,a),u,a+"",t,e,i):r;c===r&&(c=u),nr(t,a,c)}}),Ta)}function Gr(t,e){var n=t.length;if(n)return wi(e+=e<0?n:0,n)?t[e]:r}function Jr(t,e,n){e=e.length?Oe(e,(function(t){return qu(t)?function(e){return Cr(e,1===t.length?t[0]:t)}:t})):[uc];var r=-1;e=Oe(e,Ye(fi()));var o=zr(t,(function(t,n,o){var i=Oe(e,(function(e){return e(t)}));return{criteria:i,index:++r,value:t}}));return function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(o,(function(t,e){return function(t,e,n){var r=-1,o=t.criteria,i=e.criteria,u=o.length,a=n.length;for(;++r<u;){var c=Lo(o[r],i[r]);if(c)return r>=a?c:c*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}function qr(t,e,n){for(var r=-1,o=e.length,i={};++r<o;){var u=e[r],a=Cr(t,u);n(a,u)&&eo(i,xo(u,t),a)}return i}function Zr(t,e,n,r){var o=r?ze:Ue,i=-1,u=e.length,a=t;for(t===e&&(e=Oo(e)),n&&(a=Oe(t,Ye(n)));++i<u;)for(var c=0,s=e[i],l=n?n(s):s;(c=o(a,l,c,r))>-1;)a!==t&&Yt.call(a,c,1),Yt.call(t,c,1);return t}function Kr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var o=e[n];if(n==r||o!==i){var i=o;wi(o)?Yt.call(t,o,1):ho(t,o)}}return t}function Yr(t,e){return t+ye(Mn()*(e-t+1))}function Hr(t,e){var n="";if(!t||e<1||e>h)return n;do{e%2&&(n+=t),(e=ye(e/2))&&(t+=t)}while(e);return n}function Xr(t,e){return Ti(Li(t,e,uc),t+"")}function Qr(t){return Qn(Va(t))}function to(t,e){var n=Va(t);return Ri(n,sr(e,0,n.length))}function eo(t,e,n,o){if(!ra(t))return t;for(var i=-1,u=(e=xo(e,t)).length,a=u-1,c=t;null!=c&&++i<u;){var s=Ui(e[i]),l=n;if("__proto__"===s||"constructor"===s||"prototype"===s)return t;if(i!=a){var f=c[s];(l=o?o(f,s,c):r)===r&&(l=ra(f)?f:wi(e[i+1])?[]:{})}rr(c,s,l),c=c[s]}return t}var no=On?function(t,e){return On.set(t,e),t}:uc,ro=le?function(t,e){return le(t,"toString",{configurable:!0,enumerable:!1,value:rc(e),writable:!0})}:uc;function oo(t){return Ri(Va(t))}function io(t,e,n){var r=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=ut(o);++r<o;)i[r]=t[r+e];return i}function uo(t,e){var n;return dr(t,(function(t,r,o){return!(n=e(t,r,o))})),!!n}function ao(t,e,n){var r=0,o=null==t?r:t.length;if("number"==typeof e&&e==e&&o<=2147483647){for(;r<o;){var i=r+o>>>1,u=t[i];null!==u&&!fa(u)&&(n?u<=e:u<e)?r=i+1:o=i}return o}return co(t,e,uc,n)}function co(t,e,n,o){var i=0,u=null==t?0:t.length;if(0===u)return 0;for(var a=(e=n(e))!=e,c=null===e,s=fa(e),l=e===r;i<u;){var f=ye((i+u)/2),p=n(t[f]),h=p!==r,d=null===p,g=p==p,v=fa(p);if(a)var y=o||g;else y=l?g&&(o||h):c?g&&h&&(o||!d):s?g&&h&&!d&&(o||!v):!d&&!v&&(o?p<=e:p<e);y?i=f+1:u=f}return wn(u,4294967294)}function so(t,e){for(var n=-1,r=t.length,o=0,i=[];++n<r;){var u=t[n],a=e?e(u):u;if(!n||!Vu(a,c)){var c=a;i[o++]=0===u?0:u}}return i}function lo(t){return"number"==typeof t?t:fa(t)?d:+t}function fo(t){if("string"==typeof t)return t;if(qu(t))return Oe(t,fo)+"";if(fa(t))return zn?zn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function po(t,e,n){var r=-1,o=Pe,i=t.length,u=!0,a=[],c=a;if(n)u=!1,o=ke;else if(i>=200){var s=e?null:Xo(t);if(s)return ln(s);u=!1,o=Xe,c=new Yn}else c=e?[]:a;t:for(;++r<i;){var l=t[r],f=e?e(l):l;if(l=n||0!==l?l:0,u&&f==f){for(var p=c.length;p--;)if(c[p]===f)continue t;e&&c.push(f),a.push(l)}else o(c,f,n)||(c!==a&&c.push(f),a.push(l))}return a}function ho(t,e){return null==(t=Pi(t,e=xo(e,t)))||delete t[Ui(Qi(e))]}function go(t,e,n,r){return eo(t,e,n(Cr(t,e)),r)}function vo(t,e,n,r){for(var o=t.length,i=r?o:-1;(r?i--:++i<o)&&e(t[i],i,t););return n?io(t,r?0:i,r?i+1:o):io(t,r?i+1:0,r?o:i)}function yo(t,e){var n=t;return n instanceof Jn&&(n=n.value()),Ae(e,(function(t,e){return e.func.apply(e.thisArg,je([t],e.args))}),n)}function _o(t,e,n){var r=t.length;if(r<2)return r?po(t[0]):[];for(var o=-1,i=ut(r);++o<r;)for(var u=t[o],a=-1;++a<r;)a!=o&&(i[o]=hr(i[o]||u,t[a],e,n));return po(mr(i,1),e,n)}function mo(t,e,n){for(var o=-1,i=t.length,u=e.length,a={};++o<i;){var c=o<u?e[o]:r;n(a,t[o],c)}return a}function bo(t){return Yu(t)?t:[]}function wo(t){return"function"==typeof t?t:uc}function xo(t,e){return qu(t)?t:Si(t,e)?[t]:Bi(wa(t))}var So=Xr;function Mo(t,e,n){var o=t.length;return n=n===r?o:n,!e&&n>=o?t:io(t,e,n)}var Co=fe||function(t){return pe.clearTimeout(t)};function Eo(t,e){if(e)return t.slice();var n=t.length,r=Jt?Jt(n):new t.constructor(n);return t.copy(r),r}function Io(t){var e=new t.constructor(t.byteLength);return new Gt(e).set(new Gt(t)),e}function Fo(t,e){var n=e?Io(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Lo(t,e){if(t!==e){var n=t!==r,o=null===t,i=t==t,u=fa(t),a=e!==r,c=null===e,s=e==e,l=fa(e);if(!c&&!l&&!u&&t>e||u&&a&&s&&!c&&!l||o&&a&&s||!n&&s||!i)return 1;if(!o&&!u&&!l&&t<e||l&&n&&i&&!o&&!u||c&&n&&i||!a&&i||!s)return-1}return 0}function Po(t,e,n,r){for(var o=-1,i=t.length,u=n.length,a=-1,c=e.length,s=bn(i-u,0),l=ut(c+s),f=!r;++a<c;)l[a]=e[a];for(;++o<u;)(f||o<i)&&(l[n[o]]=t[o]);for(;s--;)l[a++]=t[o++];return l}function ko(t,e,n,r){for(var o=-1,i=t.length,u=-1,a=n.length,c=-1,s=e.length,l=bn(i-a,0),f=ut(l+s),p=!r;++o<l;)f[o]=t[o];for(var h=o;++c<s;)f[h+c]=e[c];for(;++u<a;)(p||o<i)&&(f[h+n[u]]=t[o++]);return f}function Oo(t,e){var n=-1,r=t.length;for(e||(e=ut(r));++n<r;)e[n]=t[n];return e}function jo(t,e,n,o){var i=!n;n||(n={});for(var u=-1,a=e.length;++u<a;){var c=e[u],s=o?o(n[c],t[c],c,n,t):r;s===r&&(s=t[c]),i?ar(n,c,s):rr(n,c,s)}return n}function Ao(t,e){return function(n,r){var o=qu(n)?Ce:ir,i=e?e():{};return o(n,t,fi(r,2),i)}}function To(t){return Xr((function(e,n){var o=-1,i=n.length,u=i>1?n[i-1]:r,a=i>2?n[2]:r;for(u=t.length>3&&"function"==typeof u?(i--,u):r,a&&xi(n[0],n[1],a)&&(u=i<3?r:u,i=1),e=It(e);++o<i;){var c=n[o];c&&t(e,c,o,u)}return e}))}function No(t,e){return function(n,r){if(null==n)return n;if(!Ku(n))return t(n,r);for(var o=n.length,i=e?o:-1,u=It(n);(e?i--:++i<o)&&!1!==r(u[i],i,u););return n}}function Do(t){return function(e,n,r){for(var o=-1,i=It(e),u=r(e),a=u.length;a--;){var c=u[t?a:++o];if(!1===n(i[c],c,i))break}return e}}function Ro(t){return function(e){var n=un(e=wa(e))?hn(e):r,o=n?n[0]:e.charAt(0),i=n?Mo(n,1).join(""):e.slice(1);return o[t]()+i}}function Bo(t){return function(e){return Ae(tc(Ja(e).replace(Ht,"")),t,"")}}function Uo(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Vn(t.prototype),r=t.apply(n,e);return ra(r)?r:n}}function zo(t){return function(e,n,o){var i=It(e);if(!Ku(e)){var u=fi(n,3);e=Aa(e),n=function(t){return u(i[t],t,i)}}var a=t(e,n,o);return a>-1?i[u?e[a]:a]:r}}function $o(t){return ii((function(e){var n=e.length,i=n,u=Gn.prototype.thru;for(t&&e.reverse();i--;){var a=e[i];if("function"!=typeof a)throw new Pt(o);if(u&&!c&&"wrapper"==si(a))var c=new Gn([],!0)}for(i=c?i:n;++i<n;){var s=si(a=e[i]),l="wrapper"==s?ci(a):r;c=l&&Mi(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?c[si(l[0])].apply(c,l[3]):1==a.length&&Mi(a)?c[s]():c.thru(a)}return function(){var t=arguments,r=t[0];if(c&&1==t.length&&qu(r))return c.plant(r).value();for(var o=0,i=n?e[o].apply(this,t):r;++o<n;)i=e[o].call(this,i);return i}}))}function Vo(t,e,n,o,i,u,a,c,s,f){var p=e&l,h=1&e,d=2&e,g=24&e,v=512&e,y=d?r:Uo(t);return function r(){for(var l=arguments.length,_=ut(l),m=l;m--;)_[m]=arguments[m];if(g)var b=li(r),w=en(_,b);if(o&&(_=Po(_,o,i,g)),u&&(_=ko(_,u,a,g)),l-=w,g&&l<f){var x=sn(_,b);return Yo(t,e,Vo,r.placeholder,n,_,x,c,s,f-l)}var S=h?n:this,M=d?S[t]:t;return l=_.length,c?_=ki(_,c):v&&l>1&&_.reverse(),p&&s<l&&(_.length=s),this&&this!==pe&&this instanceof r&&(M=y||Uo(M)),M.apply(S,_)}}function Wo(t,e){return function(n,r){return function(t,e,n,r){return xr(t,(function(t,o,i){e(r,n(t),o,i)})),r}(n,t,e(r),{})}}function Go(t,e){return function(n,o){var i;if(n===r&&o===r)return e;if(n!==r&&(i=n),o!==r){if(i===r)return o;"string"==typeof n||"string"==typeof o?(n=fo(n),o=fo(o)):(n=lo(n),o=lo(o)),i=t(n,o)}return i}}function Jo(t){return ii((function(e){return e=Oe(e,Ye(fi())),Xr((function(n){var r=this;return t(e,(function(t){return Me(t,r,n)}))}))}))}function qo(t,e){var n=(e=e===r?" ":fo(e)).length;if(n<2)return n?Hr(e,t):e;var o=Hr(e,ve(t/pn(e)));return un(e)?Mo(hn(o),0,t).join(""):o.slice(0,t)}function Zo(t){return function(e,n,o){return o&&"number"!=typeof o&&xi(e,n,o)&&(n=o=r),e=va(e),n===r?(n=e,e=0):n=va(n),function(t,e,n,r){for(var o=-1,i=bn(ve((e-t)/(n||1)),0),u=ut(i);i--;)u[r?i:++o]=t,t+=n;return u}(e,n,o=o===r?e<n?1:-1:va(o),t)}}function Ko(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=ma(e),n=ma(n)),t(e,n)}}function Yo(t,e,n,o,i,u,a,l,f,p){var h=8&e;e|=h?c:s,4&(e&=~(h?s:c))||(e&=-4);var d=[t,e,i,h?u:r,h?a:r,h?r:u,h?r:a,l,f,p],g=n.apply(r,d);return Mi(t)&&ji(g,d),g.placeholder=o,Ni(g,t,e)}function Ho(t){var e=Et[t];return function(t,n){if(t=ma(t),(n=null==n?0:wn(ya(n),292))&&yn(t)){var r=(wa(t)+"e").split("e");return+((r=(wa(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Xo=Ln&&1/ln(new Ln([,-0]))[1]==p?function(t){return new Ln(t)}:fc;function Qo(t){return function(e){var n=yi(e);return n==M?an(e):n==L?fn(e):function(t,e){return Oe(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function ti(t,e,n,i,p,h,d,g){var v=2&e;if(!v&&"function"!=typeof t)throw new Pt(o);var y=i?i.length:0;if(y||(e&=-97,i=p=r),d=d===r?d:bn(ya(d),0),g=g===r?g:ya(g),y-=p?p.length:0,e&s){var _=i,m=p;i=p=r}var b=v?r:ci(t),w=[t,e,n,i,p,_,m,h,d,g];if(b&&function(t,e){var n=t[1],r=e[1],o=n|r,i=o<131,a=r==l&&8==n||r==l&&n==f&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!i&&!a)return t;1&r&&(t[2]=e[2],o|=1&n?0:4);var c=e[3];if(c){var s=t[3];t[3]=s?Po(s,c,e[4]):c,t[4]=s?sn(t[3],u):e[4]}(c=e[5])&&(s=t[5],t[5]=s?ko(s,c,e[6]):c,t[6]=s?sn(t[5],u):e[6]);(c=e[7])&&(t[7]=c);r&l&&(t[8]=null==t[8]?e[8]:wn(t[8],e[8]));null==t[9]&&(t[9]=e[9]);t[0]=e[0],t[1]=o}(w,b),t=w[0],e=w[1],n=w[2],i=w[3],p=w[4],!(g=w[9]=w[9]===r?v?0:t.length:bn(w[9]-y,0))&&24&e&&(e&=-25),e&&1!=e)x=8==e||e==a?function(t,e,n){var o=Uo(t);return function i(){for(var u=arguments.length,a=ut(u),c=u,s=li(i);c--;)a[c]=arguments[c];var l=u<3&&a[0]!==s&&a[u-1]!==s?[]:sn(a,s);return(u-=l.length)<n?Yo(t,e,Vo,i.placeholder,r,a,l,r,r,n-u):Me(this&&this!==pe&&this instanceof i?o:t,this,a)}}(t,e,g):e!=c&&33!=e||p.length?Vo.apply(r,w):function(t,e,n,r){var o=1&e,i=Uo(t);return function e(){for(var u=-1,a=arguments.length,c=-1,s=r.length,l=ut(s+a),f=this&&this!==pe&&this instanceof e?i:t;++c<s;)l[c]=r[c];for(;a--;)l[c++]=arguments[++u];return Me(f,o?n:this,l)}}(t,e,n,i);else var x=function(t,e,n){var r=1&e,o=Uo(t);return function e(){return(this&&this!==pe&&this instanceof e?o:t).apply(r?n:this,arguments)}}(t,e,n);return Ni((b?no:ji)(x,w),t,e)}function ei(t,e,n,o){return t===r||Vu(t,jt[n])&&!Nt.call(o,n)?e:t}function ni(t,e,n,o,i,u){return ra(t)&&ra(e)&&(u.set(e,t),Wr(t,e,r,ni,u),u.delete(e)),t}function ri(t){return aa(t)?r:t}function oi(t,e,n,o,i,u){var a=1&n,c=t.length,s=e.length;if(c!=s&&!(a&&s>c))return!1;var l=u.get(t),f=u.get(e);if(l&&f)return l==e&&f==t;var p=-1,h=!0,d=2&n?new Yn:r;for(u.set(t,e),u.set(e,t);++p<c;){var g=t[p],v=e[p];if(o)var y=a?o(v,g,p,e,t,u):o(g,v,p,t,e,u);if(y!==r){if(y)continue;h=!1;break}if(d){if(!Ne(e,(function(t,e){if(!Xe(d,e)&&(g===t||i(g,t,n,o,u)))return d.push(e)}))){h=!1;break}}else if(g!==v&&!i(g,v,n,o,u)){h=!1;break}}return u.delete(t),u.delete(e),h}function ii(t){return Ti(Li(t,r,Zi),t+"")}function ui(t){return Er(t,Aa,gi)}function ai(t){return Er(t,Ta,vi)}var ci=On?function(t){return On.get(t)}:fc;function si(t){for(var e=t.name+"",n=jn[e],r=Nt.call(jn,e)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==t)return o.name}return e}function li(t){return(Nt.call($n,"placeholder")?$n:t).placeholder}function fi(){var t=$n.iteratee||ac;return t=t===ac?Dr:t,arguments.length?t(arguments[0],arguments[1]):t}function pi(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function hi(t){for(var e=Aa(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,Ii(o)]}return e}function di(t,e){var n=function(t,e){return null==t?r:t[e]}(t,e);return Nr(n)?n:r}var gi=De?function(t){return null==t?[]:(t=It(t),Le(De(t),(function(e){return Kt.call(t,e)})))}:_c,vi=De?function(t){for(var e=[];t;)je(e,gi(t)),t=qt(t);return e}:_c,yi=Ir;function _i(t,e,n){for(var r=-1,o=(e=xo(e,t)).length,i=!1;++r<o;){var u=Ui(e[r]);if(!(i=null!=t&&n(t,u)))break;t=t[u]}return i||++r!=o?i:!!(o=null==t?0:t.length)&&na(o)&&wi(u,o)&&(qu(t)||Ju(t))}function mi(t){return"function"!=typeof t.constructor||Ei(t)?{}:Vn(qt(t))}function bi(t){return qu(t)||Ju(t)||!!(Qt&&t&&t[Qt])}function wi(t,e){var n=typeof t;return!!(e=null==e?h:e)&&("number"==n||"symbol"!=n&&mt.test(t))&&t>-1&&t%1==0&&t<e}function xi(t,e,n){if(!ra(n))return!1;var r=typeof e;return!!("number"==r?Ku(n)&&wi(e,n.length):"string"==r&&e in n)&&Vu(n[e],t)}function Si(t,e){if(qu(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!fa(t))||(et.test(t)||!tt.test(t)||null!=e&&t in It(e))}function Mi(t){var e=si(t),n=$n[e];if("function"!=typeof n||!(e in Jn.prototype))return!1;if(t===n)return!0;var r=ci(n);return!!r&&t===r[0]}(En&&yi(new En(new ArrayBuffer(1)))!=A||In&&yi(new In)!=M||Fn&&yi(Fn.resolve())!=I||Ln&&yi(new Ln)!=L||Pn&&yi(new Pn)!=O)&&(yi=function(t){var e=Ir(t),n=e==E?t.constructor:r,o=n?zi(n):"";if(o)switch(o){case An:return A;case Tn:return M;case Nn:return I;case Dn:return L;case Rn:return O}return e});var Ci=At?ta:mc;function Ei(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||jt)}function Ii(t){return t==t&&!ra(t)}function Fi(t,e){return function(n){return null!=n&&(n[t]===e&&(e!==r||t in It(n)))}}function Li(t,e,n){return e=bn(e===r?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=bn(r.length-e,0),u=ut(i);++o<i;)u[o]=r[e+o];o=-1;for(var a=ut(e+1);++o<e;)a[o]=r[o];return a[e]=n(u),Me(t,this,a)}}function Pi(t,e){return e.length<2?t:Cr(t,io(e,0,-1))}function ki(t,e){for(var n=t.length,o=wn(e.length,n),i=Oo(t);o--;){var u=e[o];t[o]=wi(u,n)?i[u]:r}return t}function Oi(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var ji=Di(no),Ai=de||function(t,e){return pe.setTimeout(t,e)},Ti=Di(ro);function Ni(t,e,n){var r=e+"";return Ti(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(at,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Ee(v,(function(n){var r="_."+n[0];e&n[1]&&!Pe(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(ct);return e?e[1].split(st):[]}(r),n)))}function Di(t){var e=0,n=0;return function(){var o=xn(),i=16-(o-n);if(n=o,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(r,arguments)}}function Ri(t,e){var n=-1,o=t.length,i=o-1;for(e=e===r?o:e;++n<e;){var u=Yr(n,i),a=t[u];t[u]=t[n],t[n]=a}return t.length=e,t}var Bi=function(t){var e=Du(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(nt,(function(t,n,r,o){e.push(r?o.replace(pt,"$1"):n||t)})),e}));function Ui(t){if("string"==typeof t||fa(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function zi(t){if(null!=t){try{return Tt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function $i(t){if(t instanceof Jn)return t.clone();var e=new Gn(t.__wrapped__,t.__chain__);return e.__actions__=Oo(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Vi=Xr((function(t,e){return Yu(t)?hr(t,mr(e,1,Yu,!0)):[]})),Wi=Xr((function(t,e){var n=Qi(e);return Yu(n)&&(n=r),Yu(t)?hr(t,mr(e,1,Yu,!0),fi(n,2)):[]})),Gi=Xr((function(t,e){var n=Qi(e);return Yu(n)&&(n=r),Yu(t)?hr(t,mr(e,1,Yu,!0),r,n):[]}));function Ji(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:ya(n);return o<0&&(o=bn(r+o,0)),Be(t,fi(e,3),o)}function qi(t,e,n){var o=null==t?0:t.length;if(!o)return-1;var i=o-1;return n!==r&&(i=ya(n),i=n<0?bn(o+i,0):wn(i,o-1)),Be(t,fi(e,3),i,!0)}function Zi(t){return(null==t?0:t.length)?mr(t,1):[]}function Ki(t){return t&&t.length?t[0]:r}var Yi=Xr((function(t){var e=Oe(t,bo);return e.length&&e[0]===t[0]?kr(e):[]})),Hi=Xr((function(t){var e=Qi(t),n=Oe(t,bo);return e===Qi(n)?e=r:n.pop(),n.length&&n[0]===t[0]?kr(n,fi(e,2)):[]})),Xi=Xr((function(t){var e=Qi(t),n=Oe(t,bo);return(e="function"==typeof e?e:r)&&n.pop(),n.length&&n[0]===t[0]?kr(n,r,e):[]}));function Qi(t){var e=null==t?0:t.length;return e?t[e-1]:r}var tu=Xr(eu);function eu(t,e){return t&&t.length&&e&&e.length?Zr(t,e):t}var nu=ii((function(t,e){var n=null==t?0:t.length,r=cr(t,e);return Kr(t,Oe(e,(function(t){return wi(t,n)?+t:t})).sort(Lo)),r}));function ru(t){return null==t?t:Cn.call(t)}var ou=Xr((function(t){return po(mr(t,1,Yu,!0))})),iu=Xr((function(t){var e=Qi(t);return Yu(e)&&(e=r),po(mr(t,1,Yu,!0),fi(e,2))})),uu=Xr((function(t){var e=Qi(t);return e="function"==typeof e?e:r,po(mr(t,1,Yu,!0),r,e)}));function au(t){if(!t||!t.length)return[];var e=0;return t=Le(t,(function(t){if(Yu(t))return e=bn(t.length,e),!0})),Ze(e,(function(e){return Oe(t,We(e))}))}function cu(t,e){if(!t||!t.length)return[];var n=au(t);return null==e?n:Oe(n,(function(t){return Me(e,r,t)}))}var su=Xr((function(t,e){return Yu(t)?hr(t,e):[]})),lu=Xr((function(t){return _o(Le(t,Yu))})),fu=Xr((function(t){var e=Qi(t);return Yu(e)&&(e=r),_o(Le(t,Yu),fi(e,2))})),pu=Xr((function(t){var e=Qi(t);return e="function"==typeof e?e:r,_o(Le(t,Yu),r,e)})),hu=Xr(au);var du=Xr((function(t){var e=t.length,n=e>1?t[e-1]:r;return n="function"==typeof n?(t.pop(),n):r,cu(t,n)}));function gu(t){var e=$n(t);return e.__chain__=!0,e}function vu(t,e){return e(t)}var yu=ii((function(t){var e=t.length,n=e?t[0]:0,o=this.__wrapped__,i=function(e){return cr(e,t)};return!(e>1||this.__actions__.length)&&o instanceof Jn&&wi(n)?((o=o.slice(n,+n+(e?1:0))).__actions__.push({func:vu,args:[i],thisArg:r}),new Gn(o,this.__chain__).thru((function(t){return e&&!t.length&&t.push(r),t}))):this.thru(i)}));var _u=Ao((function(t,e,n){Nt.call(t,n)?++t[n]:ar(t,n,1)}));var mu=zo(Ji),bu=zo(qi);function wu(t,e){return(qu(t)?Ee:dr)(t,fi(e,3))}function xu(t,e){return(qu(t)?Ie:gr)(t,fi(e,3))}var Su=Ao((function(t,e,n){Nt.call(t,n)?t[n].push(e):ar(t,n,[e])}));var Mu=Xr((function(t,e,n){var r=-1,o="function"==typeof e,i=Ku(t)?ut(t.length):[];return dr(t,(function(t){i[++r]=o?Me(e,t,n):Or(t,e,n)})),i})),Cu=Ao((function(t,e,n){ar(t,n,e)}));function Eu(t,e){return(qu(t)?Oe:zr)(t,fi(e,3))}var Iu=Ao((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var Fu=Xr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&xi(t,e[0],e[1])?e=[]:n>2&&xi(e[0],e[1],e[2])&&(e=[e[0]]),Jr(t,mr(e,1),[])})),Lu=he||function(){return pe.Date.now()};function Pu(t,e,n){return e=n?r:e,e=t&&null==e?t.length:e,ti(t,l,r,r,r,r,e)}function ku(t,e){var n;if("function"!=typeof e)throw new Pt(o);return t=ya(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=r),n}}var Ou=Xr((function(t,e,n){var r=1;if(n.length){var o=sn(n,li(Ou));r|=c}return ti(t,r,e,n,o)})),ju=Xr((function(t,e,n){var r=3;if(n.length){var o=sn(n,li(ju));r|=c}return ti(e,r,t,n,o)}));function Au(t,e,n){var i,u,a,c,s,l,f=0,p=!1,h=!1,d=!0;if("function"!=typeof t)throw new Pt(o);function g(e){var n=i,o=u;return i=u=r,f=e,c=t.apply(o,n)}function v(t){return f=t,s=Ai(_,e),p?g(t):c}function y(t){var n=t-l;return l===r||n>=e||n<0||h&&t-f>=a}function _(){var t=Lu();if(y(t))return m(t);s=Ai(_,function(t){var n=e-(t-l);return h?wn(n,a-(t-f)):n}(t))}function m(t){return s=r,d&&i?g(t):(i=u=r,c)}function b(){var t=Lu(),n=y(t);if(i=arguments,u=this,l=t,n){if(s===r)return v(l);if(h)return Co(s),s=Ai(_,e),g(l)}return s===r&&(s=Ai(_,e)),c}return e=ma(e)||0,ra(n)&&(p=!!n.leading,a=(h="maxWait"in n)?bn(ma(n.maxWait)||0,e):a,d="trailing"in n?!!n.trailing:d),b.cancel=function(){s!==r&&Co(s),f=0,i=l=u=s=r},b.flush=function(){return s===r?c:m(Lu())},b}var Tu=Xr((function(t,e){return pr(t,1,e)})),Nu=Xr((function(t,e,n){return pr(t,ma(e)||0,n)}));function Du(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Pt(o);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var u=t.apply(this,r);return n.cache=i.set(o,u)||i,u};return n.cache=new(Du.Cache||Kn),n}function Ru(t){if("function"!=typeof t)throw new Pt(o);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Du.Cache=Kn;var Bu=So((function(t,e){var n=(e=1==e.length&&qu(e[0])?Oe(e[0],Ye(fi())):Oe(mr(e,1),Ye(fi()))).length;return Xr((function(r){for(var o=-1,i=wn(r.length,n);++o<i;)r[o]=e[o].call(this,r[o]);return Me(t,this,r)}))})),Uu=Xr((function(t,e){var n=sn(e,li(Uu));return ti(t,c,r,e,n)})),zu=Xr((function(t,e){var n=sn(e,li(zu));return ti(t,s,r,e,n)})),$u=ii((function(t,e){return ti(t,f,r,r,r,e)}));function Vu(t,e){return t===e||t!=t&&e!=e}var Wu=Ko(Fr),Gu=Ko((function(t,e){return t>=e})),Ju=jr(function(){return arguments}())?jr:function(t){return oa(t)&&Nt.call(t,"callee")&&!Kt.call(t,"callee")},qu=ut.isArray,Zu=_e?Ye(_e):function(t){return oa(t)&&Ir(t)==j};function Ku(t){return null!=t&&na(t.length)&&!ta(t)}function Yu(t){return oa(t)&&Ku(t)}var Hu=Ge||mc,Xu=me?Ye(me):function(t){return oa(t)&&Ir(t)==b};function Qu(t){if(!oa(t))return!1;var e=Ir(t);return e==w||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!aa(t)}function ta(t){if(!ra(t))return!1;var e=Ir(t);return e==x||e==S||"[object AsyncFunction]"==e||"[object Proxy]"==e}function ea(t){return"number"==typeof t&&t==ya(t)}function na(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=h}function ra(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function oa(t){return null!=t&&"object"==typeof t}var ia=be?Ye(be):function(t){return oa(t)&&yi(t)==M};function ua(t){return"number"==typeof t||oa(t)&&Ir(t)==C}function aa(t){if(!oa(t)||Ir(t)!=E)return!1;var e=qt(t);if(null===e)return!0;var n=Nt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Tt.call(n)==Ut}var ca=we?Ye(we):function(t){return oa(t)&&Ir(t)==F};var sa=xe?Ye(xe):function(t){return oa(t)&&yi(t)==L};function la(t){return"string"==typeof t||!qu(t)&&oa(t)&&Ir(t)==P}function fa(t){return"symbol"==typeof t||oa(t)&&Ir(t)==k}var pa=Se?Ye(Se):function(t){return oa(t)&&na(t.length)&&!!ie[Ir(t)]};var ha=Ko(Ur),da=Ko((function(t,e){return t<=e}));function ga(t){if(!t)return[];if(Ku(t))return la(t)?hn(t):Oo(t);if(ee&&t[ee])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[ee]());var e=yi(t);return(e==M?an:e==L?ln:Va)(t)}function va(t){return t?(t=ma(t))===p||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ya(t){var e=va(t),n=e%1;return e==e?n?e-n:e:0}function _a(t){return t?sr(ya(t),0,g):0}function ma(t){if("number"==typeof t)return t;if(fa(t))return d;if(ra(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ra(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ke(t);var n=vt.test(t);return n||_t.test(t)?se(t.slice(2),n?2:8):gt.test(t)?d:+t}function ba(t){return jo(t,Ta(t))}function wa(t){return null==t?"":fo(t)}var xa=To((function(t,e){if(Ei(e)||Ku(e))jo(e,Aa(e),t);else for(var n in e)Nt.call(e,n)&&rr(t,n,e[n])})),Sa=To((function(t,e){jo(e,Ta(e),t)})),Ma=To((function(t,e,n,r){jo(e,Ta(e),t,r)})),Ca=To((function(t,e,n,r){jo(e,Aa(e),t,r)})),Ea=ii(cr);var Ia=Xr((function(t,e){t=It(t);var n=-1,o=e.length,i=o>2?e[2]:r;for(i&&xi(e[0],e[1],i)&&(o=1);++n<o;)for(var u=e[n],a=Ta(u),c=-1,s=a.length;++c<s;){var l=a[c],f=t[l];(f===r||Vu(f,jt[l])&&!Nt.call(t,l))&&(t[l]=u[l])}return t})),Fa=Xr((function(t){return t.push(r,ni),Me(Da,r,t)}));function La(t,e,n){var o=null==t?r:Cr(t,e);return o===r?n:o}function Pa(t,e){return null!=t&&_i(t,e,Pr)}var ka=Wo((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Bt.call(e)),t[e]=n}),rc(uc)),Oa=Wo((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Bt.call(e)),Nt.call(t,e)?t[e].push(n):t[e]=[n]}),fi),ja=Xr(Or);function Aa(t){return Ku(t)?Xn(t):Rr(t)}function Ta(t){return Ku(t)?Xn(t,!0):Br(t)}var Na=To((function(t,e,n){Wr(t,e,n)})),Da=To((function(t,e,n,r){Wr(t,e,n,r)})),Ra=ii((function(t,e){var n={};if(null==t)return n;var r=!1;e=Oe(e,(function(e){return e=xo(e,t),r||(r=e.length>1),e})),jo(t,ai(t),n),r&&(n=lr(n,7,ri));for(var o=e.length;o--;)ho(n,e[o]);return n}));var Ba=ii((function(t,e){return null==t?{}:function(t,e){return qr(t,e,(function(e,n){return Pa(t,n)}))}(t,e)}));function Ua(t,e){if(null==t)return{};var n=Oe(ai(t),(function(t){return[t]}));return e=fi(e),qr(t,n,(function(t,n){return e(t,n[0])}))}var za=Qo(Aa),$a=Qo(Ta);function Va(t){return null==t?[]:He(t,Aa(t))}var Wa=Bo((function(t,e,n){return e=e.toLowerCase(),t+(n?Ga(e):e)}));function Ga(t){return Qa(wa(t).toLowerCase())}function Ja(t){return(t=wa(t))&&t.replace(bt,nn).replace(Xt,"")}var qa=Bo((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Za=Bo((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Ka=Ro("toLowerCase");var Ya=Bo((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));var Ha=Bo((function(t,e,n){return t+(n?" ":"")+Qa(e)}));var Xa=Bo((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Qa=Ro("toUpperCase");function tc(t,e,n){return t=wa(t),(e=n?r:e)===r?function(t){return ne.test(t)}(t)?function(t){return t.match(te)||[]}(t):function(t){return t.match(lt)||[]}(t):t.match(e)||[]}var ec=Xr((function(t,e){try{return Me(t,r,e)}catch(t){return Qu(t)?t:new Mt(t)}})),nc=ii((function(t,e){return Ee(e,(function(e){e=Ui(e),ar(t,e,Ou(t[e],t))})),t}));function rc(t){return function(){return t}}var oc=$o(),ic=$o(!0);function uc(t){return t}function ac(t){return Dr("function"==typeof t?t:lr(t,1))}var cc=Xr((function(t,e){return function(n){return Or(n,t,e)}})),sc=Xr((function(t,e){return function(n){return Or(t,n,e)}}));function lc(t,e,n){var r=Aa(e),o=Mr(e,r);null!=n||ra(e)&&(o.length||!r.length)||(n=e,e=t,t=this,o=Mr(e,Aa(e)));var i=!(ra(n)&&"chain"in n&&!n.chain),u=ta(t);return Ee(o,(function(n){var r=e[n];t[n]=r,u&&(t.prototype[n]=function(){var e=this.__chain__;if(i||e){var n=t(this.__wrapped__),o=n.__actions__=Oo(this.__actions__);return o.push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,je([this.value()],arguments))})})),t}function fc(){}var pc=Jo(Oe),hc=Jo(Fe),dc=Jo(Ne);function gc(t){return Si(t)?We(Ui(t)):function(t){return function(e){return Cr(e,t)}}(t)}var vc=Zo(),yc=Zo(!0);function _c(){return[]}function mc(){return!1}var bc=Go((function(t,e){return t+e}),0),wc=Ho("ceil"),xc=Go((function(t,e){return t/e}),1),Sc=Ho("floor");var Mc,Cc=Go((function(t,e){return t*e}),1),Ec=Ho("round"),Ic=Go((function(t,e){return t-e}),0);return $n.after=function(t,e){if("function"!=typeof e)throw new Pt(o);return t=ya(t),function(){if(--t<1)return e.apply(this,arguments)}},$n.ary=Pu,$n.assign=xa,$n.assignIn=Sa,$n.assignInWith=Ma,$n.assignWith=Ca,$n.at=Ea,$n.before=ku,$n.bind=Ou,$n.bindAll=nc,$n.bindKey=ju,$n.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return qu(t)?t:[t]},$n.chain=gu,$n.chunk=function(t,e,n){e=(n?xi(t,e,n):e===r)?1:bn(ya(e),0);var o=null==t?0:t.length;if(!o||e<1)return[];for(var i=0,u=0,a=ut(ve(o/e));i<o;)a[u++]=io(t,i,i+=e);return a},$n.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,o=[];++e<n;){var i=t[e];i&&(o[r++]=i)}return o},$n.concat=function(){var t=arguments.length;if(!t)return[];for(var e=ut(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return je(qu(n)?Oo(n):[n],mr(e,1))},$n.cond=function(t){var e=null==t?0:t.length,n=fi();return t=e?Oe(t,(function(t){if("function"!=typeof t[1])throw new Pt(o);return[n(t[0]),t[1]]})):[],Xr((function(n){for(var r=-1;++r<e;){var o=t[r];if(Me(o[0],this,n))return Me(o[1],this,n)}}))},$n.conforms=function(t){return function(t){var e=Aa(t);return function(n){return fr(n,t,e)}}(lr(t,1))},$n.constant=rc,$n.countBy=_u,$n.create=function(t,e){var n=Vn(t);return null==e?n:ur(n,e)},$n.curry=function t(e,n,o){var i=ti(e,8,r,r,r,r,r,n=o?r:n);return i.placeholder=t.placeholder,i},$n.curryRight=function t(e,n,o){var i=ti(e,a,r,r,r,r,r,n=o?r:n);return i.placeholder=t.placeholder,i},$n.debounce=Au,$n.defaults=Ia,$n.defaultsDeep=Fa,$n.defer=Tu,$n.delay=Nu,$n.difference=Vi,$n.differenceBy=Wi,$n.differenceWith=Gi,$n.drop=function(t,e,n){var o=null==t?0:t.length;return o?io(t,(e=n||e===r?1:ya(e))<0?0:e,o):[]},$n.dropRight=function(t,e,n){var o=null==t?0:t.length;return o?io(t,0,(e=o-(e=n||e===r?1:ya(e)))<0?0:e):[]},$n.dropRightWhile=function(t,e){return t&&t.length?vo(t,fi(e,3),!0,!0):[]},$n.dropWhile=function(t,e){return t&&t.length?vo(t,fi(e,3),!0):[]},$n.fill=function(t,e,n,o){var i=null==t?0:t.length;return i?(n&&"number"!=typeof n&&xi(t,e,n)&&(n=0,o=i),function(t,e,n,o){var i=t.length;for((n=ya(n))<0&&(n=-n>i?0:i+n),(o=o===r||o>i?i:ya(o))<0&&(o+=i),o=n>o?0:_a(o);n<o;)t[n++]=e;return t}(t,e,n,o)):[]},$n.filter=function(t,e){return(qu(t)?Le:_r)(t,fi(e,3))},$n.flatMap=function(t,e){return mr(Eu(t,e),1)},$n.flatMapDeep=function(t,e){return mr(Eu(t,e),p)},$n.flatMapDepth=function(t,e,n){return n=n===r?1:ya(n),mr(Eu(t,e),n)},$n.flatten=Zi,$n.flattenDeep=function(t){return(null==t?0:t.length)?mr(t,p):[]},$n.flattenDepth=function(t,e){return(null==t?0:t.length)?mr(t,e=e===r?1:ya(e)):[]},$n.flip=function(t){return ti(t,512)},$n.flow=oc,$n.flowRight=ic,$n.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var o=t[e];r[o[0]]=o[1]}return r},$n.functions=function(t){return null==t?[]:Mr(t,Aa(t))},$n.functionsIn=function(t){return null==t?[]:Mr(t,Ta(t))},$n.groupBy=Su,$n.initial=function(t){return(null==t?0:t.length)?io(t,0,-1):[]},$n.intersection=Yi,$n.intersectionBy=Hi,$n.intersectionWith=Xi,$n.invert=ka,$n.invertBy=Oa,$n.invokeMap=Mu,$n.iteratee=ac,$n.keyBy=Cu,$n.keys=Aa,$n.keysIn=Ta,$n.map=Eu,$n.mapKeys=function(t,e){var n={};return e=fi(e,3),xr(t,(function(t,r,o){ar(n,e(t,r,o),t)})),n},$n.mapValues=function(t,e){var n={};return e=fi(e,3),xr(t,(function(t,r,o){ar(n,r,e(t,r,o))})),n},$n.matches=function(t){return $r(lr(t,1))},$n.matchesProperty=function(t,e){return Vr(t,lr(e,1))},$n.memoize=Du,$n.merge=Na,$n.mergeWith=Da,$n.method=cc,$n.methodOf=sc,$n.mixin=lc,$n.negate=Ru,$n.nthArg=function(t){return t=ya(t),Xr((function(e){return Gr(e,t)}))},$n.omit=Ra,$n.omitBy=function(t,e){return Ua(t,Ru(fi(e)))},$n.once=function(t){return ku(2,t)},$n.orderBy=function(t,e,n,o){return null==t?[]:(qu(e)||(e=null==e?[]:[e]),qu(n=o?r:n)||(n=null==n?[]:[n]),Jr(t,e,n))},$n.over=pc,$n.overArgs=Bu,$n.overEvery=hc,$n.overSome=dc,$n.partial=Uu,$n.partialRight=zu,$n.partition=Iu,$n.pick=Ba,$n.pickBy=Ua,$n.property=gc,$n.propertyOf=function(t){return function(e){return null==t?r:Cr(t,e)}},$n.pull=tu,$n.pullAll=eu,$n.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Zr(t,e,fi(n,2)):t},$n.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?Zr(t,e,r,n):t},$n.pullAt=nu,$n.range=vc,$n.rangeRight=yc,$n.rearg=$u,$n.reject=function(t,e){return(qu(t)?Le:_r)(t,Ru(fi(e,3)))},$n.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,o=[],i=t.length;for(e=fi(e,3);++r<i;){var u=t[r];e(u,r,t)&&(n.push(u),o.push(r))}return Kr(t,o),n},$n.rest=function(t,e){if("function"!=typeof t)throw new Pt(o);return Xr(t,e=e===r?e:ya(e))},$n.reverse=ru,$n.sampleSize=function(t,e,n){return e=(n?xi(t,e,n):e===r)?1:ya(e),(qu(t)?tr:to)(t,e)},$n.set=function(t,e,n){return null==t?t:eo(t,e,n)},$n.setWith=function(t,e,n,o){return o="function"==typeof o?o:r,null==t?t:eo(t,e,n,o)},$n.shuffle=function(t){return(qu(t)?er:oo)(t)},$n.slice=function(t,e,n){var o=null==t?0:t.length;return o?(n&&"number"!=typeof n&&xi(t,e,n)?(e=0,n=o):(e=null==e?0:ya(e),n=n===r?o:ya(n)),io(t,e,n)):[]},$n.sortBy=Fu,$n.sortedUniq=function(t){return t&&t.length?so(t):[]},$n.sortedUniqBy=function(t,e){return t&&t.length?so(t,fi(e,2)):[]},$n.split=function(t,e,n){return n&&"number"!=typeof n&&xi(t,e,n)&&(e=n=r),(n=n===r?g:n>>>0)?(t=wa(t))&&("string"==typeof e||null!=e&&!ca(e))&&!(e=fo(e))&&un(t)?Mo(hn(t),0,n):t.split(e,n):[]},$n.spread=function(t,e){if("function"!=typeof t)throw new Pt(o);return e=null==e?0:bn(ya(e),0),Xr((function(n){var r=n[e],o=Mo(n,0,e);return r&&je(o,r),Me(t,this,o)}))},$n.tail=function(t){var e=null==t?0:t.length;return e?io(t,1,e):[]},$n.take=function(t,e,n){return t&&t.length?io(t,0,(e=n||e===r?1:ya(e))<0?0:e):[]},$n.takeRight=function(t,e,n){var o=null==t?0:t.length;return o?io(t,(e=o-(e=n||e===r?1:ya(e)))<0?0:e,o):[]},$n.takeRightWhile=function(t,e){return t&&t.length?vo(t,fi(e,3),!1,!0):[]},$n.takeWhile=function(t,e){return t&&t.length?vo(t,fi(e,3)):[]},$n.tap=function(t,e){return e(t),t},$n.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new Pt(o);return ra(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Au(t,e,{leading:r,maxWait:e,trailing:i})},$n.thru=vu,$n.toArray=ga,$n.toPairs=za,$n.toPairsIn=$a,$n.toPath=function(t){return qu(t)?Oe(t,Ui):fa(t)?[t]:Oo(Bi(wa(t)))},$n.toPlainObject=ba,$n.transform=function(t,e,n){var r=qu(t),o=r||Hu(t)||pa(t);if(e=fi(e,4),null==n){var i=t&&t.constructor;n=o?r?new i:[]:ra(t)&&ta(i)?Vn(qt(t)):{}}return(o?Ee:xr)(t,(function(t,r,o){return e(n,t,r,o)})),n},$n.unary=function(t){return Pu(t,1)},$n.union=ou,$n.unionBy=iu,$n.unionWith=uu,$n.uniq=function(t){return t&&t.length?po(t):[]},$n.uniqBy=function(t,e){return t&&t.length?po(t,fi(e,2)):[]},$n.uniqWith=function(t,e){return e="function"==typeof e?e:r,t&&t.length?po(t,r,e):[]},$n.unset=function(t,e){return null==t||ho(t,e)},$n.unzip=au,$n.unzipWith=cu,$n.update=function(t,e,n){return null==t?t:go(t,e,wo(n))},$n.updateWith=function(t,e,n,o){return o="function"==typeof o?o:r,null==t?t:go(t,e,wo(n),o)},$n.values=Va,$n.valuesIn=function(t){return null==t?[]:He(t,Ta(t))},$n.without=su,$n.words=tc,$n.wrap=function(t,e){return Uu(wo(e),t)},$n.xor=lu,$n.xorBy=fu,$n.xorWith=pu,$n.zip=hu,$n.zipObject=function(t,e){return mo(t||[],e||[],rr)},$n.zipObjectDeep=function(t,e){return mo(t||[],e||[],eo)},$n.zipWith=du,$n.entries=za,$n.entriesIn=$a,$n.extend=Sa,$n.extendWith=Ma,lc($n,$n),$n.add=bc,$n.attempt=ec,$n.camelCase=Wa,$n.capitalize=Ga,$n.ceil=wc,$n.clamp=function(t,e,n){return n===r&&(n=e,e=r),n!==r&&(n=(n=ma(n))==n?n:0),e!==r&&(e=(e=ma(e))==e?e:0),sr(ma(t),e,n)},$n.clone=function(t){return lr(t,4)},$n.cloneDeep=function(t){return lr(t,5)},$n.cloneDeepWith=function(t,e){return lr(t,5,e="function"==typeof e?e:r)},$n.cloneWith=function(t,e){return lr(t,4,e="function"==typeof e?e:r)},$n.conformsTo=function(t,e){return null==e||fr(t,e,Aa(e))},$n.deburr=Ja,$n.defaultTo=function(t,e){return null==t||t!=t?e:t},$n.divide=xc,$n.endsWith=function(t,e,n){t=wa(t),e=fo(e);var o=t.length,i=n=n===r?o:sr(ya(n),0,o);return(n-=e.length)>=0&&t.slice(n,i)==e},$n.eq=Vu,$n.escape=function(t){return(t=wa(t))&&Y.test(t)?t.replace(Z,rn):t},$n.escapeRegExp=function(t){return(t=wa(t))&&ot.test(t)?t.replace(rt,"\\$&"):t},$n.every=function(t,e,n){var o=qu(t)?Fe:vr;return n&&xi(t,e,n)&&(e=r),o(t,fi(e,3))},$n.find=mu,$n.findIndex=Ji,$n.findKey=function(t,e){return Re(t,fi(e,3),xr)},$n.findLast=bu,$n.findLastIndex=qi,$n.findLastKey=function(t,e){return Re(t,fi(e,3),Sr)},$n.floor=Sc,$n.forEach=wu,$n.forEachRight=xu,$n.forIn=function(t,e){return null==t?t:br(t,fi(e,3),Ta)},$n.forInRight=function(t,e){return null==t?t:wr(t,fi(e,3),Ta)},$n.forOwn=function(t,e){return t&&xr(t,fi(e,3))},$n.forOwnRight=function(t,e){return t&&Sr(t,fi(e,3))},$n.get=La,$n.gt=Wu,$n.gte=Gu,$n.has=function(t,e){return null!=t&&_i(t,e,Lr)},$n.hasIn=Pa,$n.head=Ki,$n.identity=uc,$n.includes=function(t,e,n,r){t=Ku(t)?t:Va(t),n=n&&!r?ya(n):0;var o=t.length;return n<0&&(n=bn(o+n,0)),la(t)?n<=o&&t.indexOf(e,n)>-1:!!o&&Ue(t,e,n)>-1},$n.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:ya(n);return o<0&&(o=bn(r+o,0)),Ue(t,e,o)},$n.inRange=function(t,e,n){return e=va(e),n===r?(n=e,e=0):n=va(n),function(t,e,n){return t>=wn(e,n)&&t<bn(e,n)}(t=ma(t),e,n)},$n.invoke=ja,$n.isArguments=Ju,$n.isArray=qu,$n.isArrayBuffer=Zu,$n.isArrayLike=Ku,$n.isArrayLikeObject=Yu,$n.isBoolean=function(t){return!0===t||!1===t||oa(t)&&Ir(t)==m},$n.isBuffer=Hu,$n.isDate=Xu,$n.isElement=function(t){return oa(t)&&1===t.nodeType&&!aa(t)},$n.isEmpty=function(t){if(null==t)return!0;if(Ku(t)&&(qu(t)||"string"==typeof t||"function"==typeof t.splice||Hu(t)||pa(t)||Ju(t)))return!t.length;var e=yi(t);if(e==M||e==L)return!t.size;if(Ei(t))return!Rr(t).length;for(var n in t)if(Nt.call(t,n))return!1;return!0},$n.isEqual=function(t,e){return Ar(t,e)},$n.isEqualWith=function(t,e,n){var o=(n="function"==typeof n?n:r)?n(t,e):r;return o===r?Ar(t,e,r,n):!!o},$n.isError=Qu,$n.isFinite=function(t){return"number"==typeof t&&yn(t)},$n.isFunction=ta,$n.isInteger=ea,$n.isLength=na,$n.isMap=ia,$n.isMatch=function(t,e){return t===e||Tr(t,e,hi(e))},$n.isMatchWith=function(t,e,n){return n="function"==typeof n?n:r,Tr(t,e,hi(e),n)},$n.isNaN=function(t){return ua(t)&&t!=+t},$n.isNative=function(t){if(Ci(t))throw new Mt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Nr(t)},$n.isNil=function(t){return null==t},$n.isNull=function(t){return null===t},$n.isNumber=ua,$n.isObject=ra,$n.isObjectLike=oa,$n.isPlainObject=aa,$n.isRegExp=ca,$n.isSafeInteger=function(t){return ea(t)&&t>=-9007199254740991&&t<=h},$n.isSet=sa,$n.isString=la,$n.isSymbol=fa,$n.isTypedArray=pa,$n.isUndefined=function(t){return t===r},$n.isWeakMap=function(t){return oa(t)&&yi(t)==O},$n.isWeakSet=function(t){return oa(t)&&"[object WeakSet]"==Ir(t)},$n.join=function(t,e){return null==t?"":_n.call(t,e)},$n.kebabCase=qa,$n.last=Qi,$n.lastIndexOf=function(t,e,n){var o=null==t?0:t.length;if(!o)return-1;var i=o;return n!==r&&(i=(i=ya(n))<0?bn(o+i,0):wn(i,o-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):Be(t,$e,i,!0)},$n.lowerCase=Za,$n.lowerFirst=Ka,$n.lt=ha,$n.lte=da,$n.max=function(t){return t&&t.length?yr(t,uc,Fr):r},$n.maxBy=function(t,e){return t&&t.length?yr(t,fi(e,2),Fr):r},$n.mean=function(t){return Ve(t,uc)},$n.meanBy=function(t,e){return Ve(t,fi(e,2))},$n.min=function(t){return t&&t.length?yr(t,uc,Ur):r},$n.minBy=function(t,e){return t&&t.length?yr(t,fi(e,2),Ur):r},$n.stubArray=_c,$n.stubFalse=mc,$n.stubObject=function(){return{}},$n.stubString=function(){return""},$n.stubTrue=function(){return!0},$n.multiply=Cc,$n.nth=function(t,e){return t&&t.length?Gr(t,ya(e)):r},$n.noConflict=function(){return pe._===this&&(pe._=zt),this},$n.noop=fc,$n.now=Lu,$n.pad=function(t,e,n){t=wa(t);var r=(e=ya(e))?pn(t):0;if(!e||r>=e)return t;var o=(e-r)/2;return qo(ye(o),n)+t+qo(ve(o),n)},$n.padEnd=function(t,e,n){t=wa(t);var r=(e=ya(e))?pn(t):0;return e&&r<e?t+qo(e-r,n):t},$n.padStart=function(t,e,n){t=wa(t);var r=(e=ya(e))?pn(t):0;return e&&r<e?qo(e-r,n)+t:t},$n.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),Sn(wa(t).replace(it,""),e||0)},$n.random=function(t,e,n){if(n&&"boolean"!=typeof n&&xi(t,e,n)&&(e=n=r),n===r&&("boolean"==typeof e?(n=e,e=r):"boolean"==typeof t&&(n=t,t=r)),t===r&&e===r?(t=0,e=1):(t=va(t),e===r?(e=t,t=0):e=va(e)),t>e){var o=t;t=e,e=o}if(n||t%1||e%1){var i=Mn();return wn(t+i*(e-t+ce("1e-"+((i+"").length-1))),e)}return Yr(t,e)},$n.reduce=function(t,e,n){var r=qu(t)?Ae:Je,o=arguments.length<3;return r(t,fi(e,4),n,o,dr)},$n.reduceRight=function(t,e,n){var r=qu(t)?Te:Je,o=arguments.length<3;return r(t,fi(e,4),n,o,gr)},$n.repeat=function(t,e,n){return e=(n?xi(t,e,n):e===r)?1:ya(e),Hr(wa(t),e)},$n.replace=function(){var t=arguments,e=wa(t[0]);return t.length<3?e:e.replace(t[1],t[2])},$n.result=function(t,e,n){var o=-1,i=(e=xo(e,t)).length;for(i||(i=1,t=r);++o<i;){var u=null==t?r:t[Ui(e[o])];u===r&&(o=i,u=n),t=ta(u)?u.call(t):u}return t},$n.round=Ec,$n.runInContext=t,$n.sample=function(t){return(qu(t)?Qn:Qr)(t)},$n.size=function(t){if(null==t)return 0;if(Ku(t))return la(t)?pn(t):t.length;var e=yi(t);return e==M||e==L?t.size:Rr(t).length},$n.snakeCase=Ya,$n.some=function(t,e,n){var o=qu(t)?Ne:uo;return n&&xi(t,e,n)&&(e=r),o(t,fi(e,3))},$n.sortedIndex=function(t,e){return ao(t,e)},$n.sortedIndexBy=function(t,e,n){return co(t,e,fi(n,2))},$n.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=ao(t,e);if(r<n&&Vu(t[r],e))return r}return-1},$n.sortedLastIndex=function(t,e){return ao(t,e,!0)},$n.sortedLastIndexBy=function(t,e,n){return co(t,e,fi(n,2),!0)},$n.sortedLastIndexOf=function(t,e){if(null==t?0:t.length){var n=ao(t,e,!0)-1;if(Vu(t[n],e))return n}return-1},$n.startCase=Ha,$n.startsWith=function(t,e,n){return t=wa(t),n=null==n?0:sr(ya(n),0,t.length),e=fo(e),t.slice(n,n+e.length)==e},$n.subtract=Ic,$n.sum=function(t){return t&&t.length?qe(t,uc):0},$n.sumBy=function(t,e){return t&&t.length?qe(t,fi(e,2)):0},$n.template=function(t,e,n){var o=$n.templateSettings;n&&xi(t,e,n)&&(e=r),t=wa(t),e=Ma({},e,o,ei);var i,u,a=Ma({},e.imports,o.imports,ei),c=Aa(a),s=He(a,c),l=0,f=e.interpolate||wt,p="__p += '",h=Ft((e.escape||wt).source+"|"+f.source+"|"+(f===Q?ht:wt).source+"|"+(e.evaluate||wt).source+"|$","g"),d="//# sourceURL="+(Nt.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++oe+"]")+"\n";t.replace(h,(function(e,n,r,o,a,c){return r||(r=o),p+=t.slice(l,c).replace(xt,on),n&&(i=!0,p+="' +\n__e("+n+") +\n'"),a&&(u=!0,p+="';\n"+a+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=c+e.length,e})),p+="';\n";var g=Nt.call(e,"variable")&&e.variable;if(g){if(ft.test(g))throw new Mt("Invalid `variable` option passed into `_.template`")}else p="with (obj) {\n"+p+"\n}\n";p=(u?p.replace(W,""):p).replace(G,"$1").replace(J,"$1;"),p="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(u?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var v=ec((function(){return Ct(c,d+"return "+p).apply(r,s)}));if(v.source=p,Qu(v))throw v;return v},$n.times=function(t,e){if((t=ya(t))<1||t>h)return[];var n=g,r=wn(t,g);e=fi(e),t-=g;for(var o=Ze(r,e);++n<t;)e(n);return o},$n.toFinite=va,$n.toInteger=ya,$n.toLength=_a,$n.toLower=function(t){return wa(t).toLowerCase()},$n.toNumber=ma,$n.toSafeInteger=function(t){return t?sr(ya(t),-9007199254740991,h):0===t?t:0},$n.toString=wa,$n.toUpper=function(t){return wa(t).toUpperCase()},$n.trim=function(t,e,n){if((t=wa(t))&&(n||e===r))return Ke(t);if(!t||!(e=fo(e)))return t;var o=hn(t),i=hn(e);return Mo(o,Qe(o,i),tn(o,i)+1).join("")},$n.trimEnd=function(t,e,n){if((t=wa(t))&&(n||e===r))return t.slice(0,dn(t)+1);if(!t||!(e=fo(e)))return t;var o=hn(t);return Mo(o,0,tn(o,hn(e))+1).join("")},$n.trimStart=function(t,e,n){if((t=wa(t))&&(n||e===r))return t.replace(it,"");if(!t||!(e=fo(e)))return t;var o=hn(t);return Mo(o,Qe(o,hn(e))).join("")},$n.truncate=function(t,e){var n=30,o="...";if(ra(e)){var i="separator"in e?e.separator:i;n="length"in e?ya(e.length):n,o="omission"in e?fo(e.omission):o}var u=(t=wa(t)).length;if(un(t)){var a=hn(t);u=a.length}if(n>=u)return t;var c=n-pn(o);if(c<1)return o;var s=a?Mo(a,0,c).join(""):t.slice(0,c);if(i===r)return s+o;if(a&&(c+=s.length-c),ca(i)){if(t.slice(c).search(i)){var l,f=s;for(i.global||(i=Ft(i.source,wa(dt.exec(i))+"g")),i.lastIndex=0;l=i.exec(f);)var p=l.index;s=s.slice(0,p===r?c:p)}}else if(t.indexOf(fo(i),c)!=c){var h=s.lastIndexOf(i);h>-1&&(s=s.slice(0,h))}return s+o},$n.unescape=function(t){return(t=wa(t))&&K.test(t)?t.replace(q,gn):t},$n.uniqueId=function(t){var e=++Dt;return wa(t)+e},$n.upperCase=Xa,$n.upperFirst=Qa,$n.each=wu,$n.eachRight=xu,$n.first=Ki,lc($n,(Mc={},xr($n,(function(t,e){Nt.call($n.prototype,e)||(Mc[e]=t)})),Mc),{chain:!1}),$n.VERSION="4.17.21",Ee(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){$n[t].placeholder=$n})),Ee(["drop","take"],(function(t,e){Jn.prototype[t]=function(n){n=n===r?1:bn(ya(n),0);var o=this.__filtered__&&!e?new Jn(this):this.clone();return o.__filtered__?o.__takeCount__=wn(n,o.__takeCount__):o.__views__.push({size:wn(n,g),type:t+(o.__dir__<0?"Right":"")}),o},Jn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Ee(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Jn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:fi(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),Ee(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Jn.prototype[t]=function(){return this[n](1).value()[0]}})),Ee(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Jn.prototype[t]=function(){return this.__filtered__?new Jn(this):this[n](1)}})),Jn.prototype.compact=function(){return this.filter(uc)},Jn.prototype.find=function(t){return this.filter(t).head()},Jn.prototype.findLast=function(t){return this.reverse().find(t)},Jn.prototype.invokeMap=Xr((function(t,e){return"function"==typeof t?new Jn(this):this.map((function(n){return Or(n,t,e)}))})),Jn.prototype.reject=function(t){return this.filter(Ru(fi(t)))},Jn.prototype.slice=function(t,e){t=ya(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Jn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==r&&(n=(e=ya(e))<0?n.dropRight(-e):n.take(e-t)),n)},Jn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Jn.prototype.toArray=function(){return this.take(g)},xr(Jn.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),o=/^(?:head|last)$/.test(e),i=$n[o?"take"+("last"==e?"Right":""):e],u=o||/^find/.test(e);i&&($n.prototype[e]=function(){var e=this.__wrapped__,a=o?[1]:arguments,c=e instanceof Jn,s=a[0],l=c||qu(e),f=function(t){var e=i.apply($n,je([t],a));return o&&p?e[0]:e};l&&n&&"function"==typeof s&&1!=s.length&&(c=l=!1);var p=this.__chain__,h=!!this.__actions__.length,d=u&&!p,g=c&&!h;if(!u&&l){e=g?e:new Jn(this);var v=t.apply(e,a);return v.__actions__.push({func:vu,args:[f],thisArg:r}),new Gn(v,p)}return d&&g?t.apply(this,a):(v=this.thru(f),d?o?v.value()[0]:v.value():v)})})),Ee(["pop","push","shift","sort","splice","unshift"],(function(t){var e=kt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);$n.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var o=this.value();return e.apply(qu(o)?o:[],t)}return this[n]((function(n){return e.apply(qu(n)?n:[],t)}))}})),xr(Jn.prototype,(function(t,e){var n=$n[e];if(n){var r=n.name+"";Nt.call(jn,r)||(jn[r]=[]),jn[r].push({name:e,func:n})}})),jn[Vo(r,2).name]=[{name:"wrapper",func:r}],Jn.prototype.clone=function(){var t=new Jn(this.__wrapped__);return t.__actions__=Oo(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Oo(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Oo(this.__views__),t},Jn.prototype.reverse=function(){if(this.__filtered__){var t=new Jn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Jn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=qu(t),r=e<0,o=n?t.length:0,i=function(t,e,n){var r=-1,o=n.length;for(;++r<o;){var i=n[r],u=i.size;switch(i.type){case"drop":t+=u;break;case"dropRight":e-=u;break;case"take":e=wn(e,t+u);break;case"takeRight":t=bn(t,e-u)}}return{start:t,end:e}}(0,o,this.__views__),u=i.start,a=i.end,c=a-u,s=r?a:u-1,l=this.__iteratees__,f=l.length,p=0,h=wn(c,this.__takeCount__);if(!n||!r&&o==c&&h==c)return yo(t,this.__actions__);var d=[];t:for(;c--&&p<h;){for(var g=-1,v=t[s+=e];++g<f;){var y=l[g],_=y.iteratee,m=y.type,b=_(v);if(2==m)v=b;else if(!b){if(1==m)continue t;break t}}d[p++]=v}return d},$n.prototype.at=yu,$n.prototype.chain=function(){return gu(this)},$n.prototype.commit=function(){return new Gn(this.value(),this.__chain__)},$n.prototype.next=function(){this.__values__===r&&(this.__values__=ga(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?r:this.__values__[this.__index__++]}},$n.prototype.plant=function(t){for(var e,n=this;n instanceof Wn;){var o=$i(n);o.__index__=0,o.__values__=r,e?i.__wrapped__=o:e=o;var i=o;n=n.__wrapped__}return i.__wrapped__=t,e},$n.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Jn){var e=t;return this.__actions__.length&&(e=new Jn(this)),(e=e.reverse()).__actions__.push({func:vu,args:[ru],thisArg:r}),new Gn(e,this.__chain__)}return this.thru(ru)},$n.prototype.toJSON=$n.prototype.valueOf=$n.prototype.value=function(){return yo(this.__wrapped__,this.__actions__)},$n.prototype.first=$n.prototype.head,ee&&($n.prototype[ee]=function(){return this}),$n}();de?((de.exports=vn)._=vn,he._=vn):pe._=vn}).call(n)})),a={centimeters:637100880,centimetres:637100880,degrees:6371008.8/111325,feet:20902260.511392,inches:6371008.8*39.37,kilometers:6371.0088,kilometres:6371.0088,meters:6371008.8,metres:6371008.8,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:6371008.8/1852,radians:1,yards:6371008.8*1.0936};
1
+ "use strict";var n=require("@mapbox/mapbox-gl-draw"),t=require("@turf/turf");function r(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}function e(n){if(n&&n.__esModule)return n;var t=Object.create(null);return n&&Object.keys(n).forEach((function(r){if("default"!==r){var e=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,e.get?e:{enumerable:!0,get:function(){return n[r]}})}})),t.default=n,Object.freeze(t)}var u=r(n),i=e(t),o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function a(n){var t={exports:{}};return n(t,t.exports),t.exports
2
2
  /*! @preserve
3
3
  * numeral.js
4
4
  * version : 2.0.6
5
5
  * author : Adam Draper
6
6
  * license : MIT
7
7
  * http://adamwdraper.github.com/Numeral-js/
8
- */function c(t,e,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r}function s(t,e,n){if(void 0===n&&(n={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return c({type:"LineString",coordinates:t},e,n)}function l(t){return t%360*Math.PI/180}function f(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function p(t,e,n){void 0===n&&(n={});var r=f(t),o=f(e),i=l(o[1]-r[1]),u=l(o[0]-r[0]),c=l(r[1]),s=l(o[1]),p=Math.pow(Math.sin(i/2),2)+Math.pow(Math.sin(u/2),2)*Math.cos(c)*Math.cos(s);return function(t,e){void 0===e&&(e="kilometers");var n=a[e];if(!n)throw new Error(e+" units is invalid");return t*n}(2*Math.atan2(Math.sqrt(p),Math.sqrt(1-p)),n.units)}function h(t,e,n){if(null!==t)for(var r,o,i,u,a,c,s,l,f=0,p=0,d=t.type,g="FeatureCollection"===d,v="Feature"===d,y=g?t.features.length:1,_=0;_<y;_++){a=(l=!!(s=g?t.features[_].geometry:v?t.geometry:t)&&"GeometryCollection"===s.type)?s.geometries.length:1;for(var m=0;m<a;m++){var b=0,w=0;if(null!==(u=l?s.geometries[m]:s)){c=u.coordinates;var x=u.type;switch(f=!n||"Polygon"!==x&&"MultiPolygon"!==x?0:1,x){case null:break;case"Point":if(!1===e(c,p,_,b,w))return!1;p++,b++;break;case"LineString":case"MultiPoint":for(r=0;r<c.length;r++){if(!1===e(c[r],p,_,b,w))return!1;p++,"MultiPoint"===x&&b++}"LineString"===x&&b++;break;case"Polygon":case"MultiLineString":for(r=0;r<c.length;r++){for(o=0;o<c[r].length-f;o++){if(!1===e(c[r][o],p,_,b,w))return!1;p++}"MultiLineString"===x&&b++,"Polygon"===x&&w++}"Polygon"===x&&b++;break;case"MultiPolygon":for(r=0;r<c.length;r++){for(w=0,o=0;o<c[r].length;o++){for(i=0;i<c[r][o].length-f;i++){if(!1===e(c[r][o][i],p,_,b,w))return!1;p++}w++}b++}break;case"GeometryCollection":for(r=0;r<u.geometries.length;r++)if(!1===h(u.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function d(t,e){!function(t,e){var n,r,o,i,u,a,c,s,l,f,p=0,h="FeatureCollection"===t.type,d="Feature"===t.type,g=h?t.features.length:1;for(n=0;n<g;n++){for(a=h?t.features[n].geometry:d?t.geometry:t,s=h?t.features[n].properties:d?t.properties:{},l=h?t.features[n].bbox:d?t.bbox:void 0,f=h?t.features[n].id:d?t.id:void 0,u=(c=!!a&&"GeometryCollection"===a.type)?a.geometries.length:1,o=0;o<u;o++)if(null!==(i=c?a.geometries[o]:a))switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(i,p,s,l,f))return!1;break;case"GeometryCollection":for(r=0;r<i.geometries.length;r++)if(!1===e(i.geometries[r],p,s,l,f))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,p,s,l,f))return!1;p++}}(t,(function(t,n,r,o,i){var u,a=null===t?null:t.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return!1!==e(c(t,r,{bbox:o,id:i}),n,0)&&void 0}switch(a){case"MultiPoint":u="Point";break;case"MultiLineString":u="LineString";break;case"MultiPolygon":u="Polygon"}for(var s=0;s<t.coordinates.length;s++){var l=t.coordinates[s];if(!1===e(c({type:u,coordinates:l},r),n,s))return!1}}))}function g(t,e){d(t,(function(t,n,r){var o=0;if(t.geometry){var i=t.geometry.type;if("Point"!==i&&"MultiPoint"!==i){var u,a=0,c=0,l=0;return!1!==h(t,(function(i,f,p,h,d){if(void 0===u||n>a||h>c||d>l)return u=i,a=n,c=h,l=d,void(o=0);var g=s([u,i],t.properties);if(!1===e(g,n,r,d,o))return!1;o++,u=i}))&&void 0}}}))}function v(t,e){return void 0===e&&(e={}),function(t,e,n){var r=n,o=!1;return g(t,(function(t,i,u,a,c){r=!1===o&&void 0===n?t:e(r,t,i,u,a,c),o=!0})),r}(t,(function(t,n){var r=n.geometry.coordinates;return t+p(r[0],r[1],e)}),0)}const y=u.extend({},o.modes.draw_line_string);const _=t=>{setTimeout((()=>{t.map&&t.map.doubleClickZoom&&t._ctx&&t._ctx.store&&t._ctx.store.getInitialConfigValue&&t._ctx.store.getInitialConfigValue("doubleClickZoom")&&t.map.doubleClickZoom.enable()}),0)};y.onSetup=function(t){const e=o.modes.draw_line_string.onSetup.call(this,t),n=this.newFeature({type:"Feature",properties:{meta:"radius"},geometry:{type:"Polygon",coordinates:[[]]}});return this.addFeature(n),{...e,circle:n}},y.clickAnywhere=function(t,e){return 1===t.currentVertexPosition?(t.line.addCoordinate(0,e.lngLat.lng,e.lngLat.lat),this.changeMode("simple_select",{featureIds:[t.line.id]})):(this.updateUIClasses({mouse:"add"}),t.line.updateCoordinate(t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat),"forward"===t.direction?(t.currentVertexPosition+=1,t.line.updateCoordinate(t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat)):t.line.addCoordinate(0,e.lngLat.lng,e.lngLat.lat),null)},y.onMouseMove=function(t,n){o.modes.draw_line_string.onMouseMove.call(this,t,n);const r=t.line.toGeoJSON(),i=r.geometry.coordinates[0],u=v(r,"kilometers"),a=this.map&&this.map.crs?this.map.crs.epsgCode:"EPSG:4326",c=function(t,n,r,o,i=64){if(o.includes("4326")){const e={latitude:t[1],longitude:t[0]},o=n,u=[],a=o/(111.32*Math.cos(e.latitude*Math.PI/180)),c=o/110.574;let s,l,f;for(let t=0;t<i;t+=1)s=t/i*(2*Math.PI),l=a*Math.cos(s),f=c*Math.sin(s),u.push([e.longitude+l,e.latitude+f]);return u.push(u[0]),{type:"Feature",geometry:{type:"Polygon",coordinates:[u]},properties:{parent:r}}}{const o={steps:64,units:"kilometers",properties:{parent:r}};return e.circle(t,n,o)}}(i,u,t.line.id,a);c.properties.meta="radius",t.circle.setCoordinates(c.geometry.coordinates)},y.onStop=function(t){_(this),this.activateUIButton(),void 0!==this.getFeature(t.line.id)&&(t.line.removeCoordinate("0"),t.line.isValid()?(t.line.toGeoJSON(),this.deleteFeature([t.line.id],{silent:!0}),this.map.fire("draw.create",{features:[t.circle.toGeoJSON()]})):(this.deleteFeature([t.line.id],{silent:!0}),this.changeMode("simple_select",{},{silent:!0})))},y.toDisplayFeatures=function(t,e,n){const r=e.properties.id===t.line.id;if(e.properties.active=r?"true":"false",!r)return n(e);if(e.geometry.coordinates.length<2)return null;var o,u,a;e.properties.meta="feature",n((o=t.line.id,u=e.geometry.coordinates["forward"===t.direction?e.geometry.coordinates.length-2:1],a=""+("forward"===t.direction?e.geometry.coordinates.length-2:1),{type:"Feature",properties:{meta:"vertex",parent:o,coord_path:a,active:!1?"true":"false"},geometry:{type:"Point",coordinates:u}})),n(e);const c=function(t){const e=1e3*v(t);let n,r,o="m",u="0,0",a="feet",c="0,0";return n=e,e>=1e3&&(n=e/1e3,o="km",u="0.00"),r=3.28084*e,r>=5280&&(r/=5280,a="mi",c="0.00"),{metric:`${i(n).format(u)} ${o}`,standard:`${i(r).format(c)} ${a}`}}(e);return n({type:"Feature",properties:{meta:"currentPosition",radiusMetric:c.metric,radiusStandard:c.standard,parent:t.line.id},geometry:{type:"Point",coordinates:e.geometry.coordinates[1]}}),null},module.exports=y;
8
+ */}var f=a((function(n){!function(t,r){n.exports?n.exports=r():t.numeral=r()}(o,(function(){var n,t,r,e,u,i={},o={},a={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},f={currentLocale:a.currentLocale,zeroFormat:a.zeroFormat,nullFormat:a.nullFormat,defaultFormat:a.defaultFormat,scalePercentBy100:a.scalePercentBy100};function c(n,t){this._input=n,this._value=t}return(n=function(r){var e,u,o,a;if(n.isNumeral(r))e=r.value();else if(0===r||void 0===r)e=0;else if(null===r||t.isNaN(r))e=null;else if("string"==typeof r)if(f.zeroFormat&&r===f.zeroFormat)e=0;else if(f.nullFormat&&r===f.nullFormat||!r.replace(/[^0-9]+/g,"").length)e=null;else{for(u in i)if((a="function"==typeof i[u].regexps.unformat?i[u].regexps.unformat():i[u].regexps.unformat)&&r.match(a)){o=i[u].unformat;break}e=(o=o||n._.stringToNumber)(r)}else e=Number(r)||null;return new c(r,e)}).version="2.0.6",n.isNumeral=function(n){return n instanceof c},n._=t={numberToFormat:function(t,r,e){var u,i,a,f,c,l,s,h,p=o[n.options.currentLocale],v=!1,_=!1,g="",d=1e12,y=1e9,m=1e6,b="",w=!1;if(t=t||0,a=Math.abs(t),n._.includes(r,"(")?(v=!0,r=r.replace(/[\(|\)]/g,"")):(n._.includes(r,"+")||n._.includes(r,"-"))&&(l=n._.includes(r,"+")?r.indexOf("+"):t<0?r.indexOf("-"):-1,r=r.replace(/[\+|\-]/g,"")),n._.includes(r,"a")&&(i=!!(i=r.match(/a(k|m|b|t)?/))&&i[1],n._.includes(r," a")&&(g=" "),r=r.replace(new RegExp(g+"a[kmbt]?"),""),a>=d&&!i||"t"===i?(g+=p.abbreviations.trillion,t/=d):a<d&&a>=y&&!i||"b"===i?(g+=p.abbreviations.billion,t/=y):a<y&&a>=m&&!i||"m"===i?(g+=p.abbreviations.million,t/=m):(a<m&&a>=1e3&&!i||"k"===i)&&(g+=p.abbreviations.thousand,t/=1e3)),n._.includes(r,"[.]")&&(_=!0,r=r.replace("[.]",".")),f=t.toString().split(".")[0],c=r.split(".")[1],s=r.indexOf(","),u=(r.split(".")[0].split(",")[0].match(/0/g)||[]).length,c?(n._.includes(c,"[")?(c=(c=c.replace("]","")).split("["),b=n._.toFixed(t,c[0].length+c[1].length,e,c[1].length)):b=n._.toFixed(t,c.length,e),f=b.split(".")[0],b=n._.includes(b,".")?p.delimiters.decimal+b.split(".")[1]:"",_&&0===Number(b.slice(1))&&(b="")):f=n._.toFixed(t,0,e),g&&!i&&Number(f)>=1e3&&g!==p.abbreviations.trillion)switch(f=String(Number(f)/1e3),g){case p.abbreviations.thousand:g=p.abbreviations.million;break;case p.abbreviations.million:g=p.abbreviations.billion;break;case p.abbreviations.billion:g=p.abbreviations.trillion}if(n._.includes(f,"-")&&(f=f.slice(1),w=!0),f.length<u)for(var x=u-f.length;x>0;x--)f="0"+f;return s>-1&&(f=f.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+p.delimiters.thousands)),0===r.indexOf(".")&&(f=""),h=f+b+(g||""),v?h=(v&&w?"(":"")+h+(v&&w?")":""):l>=0?h=0===l?(w?"-":"+")+h:h+(w?"-":"+"):w&&(h="-"+h),h},stringToNumber:function(n){var t,r,e,u=o[f.currentLocale],i=n,a={thousand:3,million:6,billion:9,trillion:12};if(f.zeroFormat&&n===f.zeroFormat)r=0;else if(f.nullFormat&&n===f.nullFormat||!n.replace(/[^0-9]+/g,"").length)r=null;else{for(t in r=1,"."!==u.delimiters.decimal&&(n=n.replace(/\./g,"").replace(u.delimiters.decimal,".")),a)if(e=new RegExp("[^a-zA-Z]"+u.abbreviations[t]+"(?:\\)|(\\"+u.currency.symbol+")?(?:\\))?)?$"),i.match(e)){r*=Math.pow(10,a[t]);break}r*=(n.split("-").length+Math.min(n.split("(").length-1,n.split(")").length-1))%2?1:-1,n=n.replace(/[^0-9\.]+/g,""),r*=Number(n)}return r},isNaN:function(n){return"number"==typeof n&&isNaN(n)},includes:function(n,t){return-1!==n.indexOf(t)},insert:function(n,t,r){return n.slice(0,r)+t+n.slice(r)},reduce:function(n,t){if(null===this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof t)throw new TypeError(t+" is not a function");var r,e=Object(n),u=e.length>>>0,i=0;if(3===arguments.length)r=arguments[2];else{for(;i<u&&!(i in e);)i++;if(i>=u)throw new TypeError("Reduce of empty array with no initial value");r=e[i++]}for(;i<u;i++)i in e&&(r=t(r,e[i],i,e));return r},multiplier:function(n){var t=n.toString().split(".");return t.length<2?1:Math.pow(10,t[1].length)},correctionFactor:function(){return Array.prototype.slice.call(arguments).reduce((function(n,r){var e=t.multiplier(r);return n>e?n:e}),1)},toFixed:function(n,t,r,e){var u,i,o,a,f=n.toString().split("."),c=t-(e||0);return u=2===f.length?Math.min(Math.max(f[1].length,c),t):c,o=Math.pow(10,u),a=(r(n+"e+"+u)/o).toFixed(u),e>t-u&&(i=new RegExp("\\.?0{1,"+(e-(t-u))+"}$"),a=a.replace(i,"")),a}},n.options=f,n.formats=i,n.locales=o,n.locale=function(n){return n&&(f.currentLocale=n.toLowerCase()),f.currentLocale},n.localeData=function(n){if(!n)return o[f.currentLocale];if(n=n.toLowerCase(),!o[n])throw new Error("Unknown locale : "+n);return o[n]},n.reset=function(){for(var n in a)f[n]=a[n]},n.zeroFormat=function(n){f.zeroFormat="string"==typeof n?n:null},n.nullFormat=function(n){f.nullFormat="string"==typeof n?n:null},n.defaultFormat=function(n){f.defaultFormat="string"==typeof n?n:"0.0"},n.register=function(n,t,r){if(t=t.toLowerCase(),this[n+"s"][t])throw new TypeError(t+" "+n+" already registered.");return this[n+"s"][t]=r,r},n.validate=function(t,r){var e,u,i,o,a,f,c,l;if("string"!=typeof t&&(t+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",t)),(t=t.trim()).match(/^\d+$/))return!0;if(""===t)return!1;try{c=n.localeData(r)}catch(t){c=n.localeData(n.locale())}return i=c.currency.symbol,a=c.abbreviations,e=c.delimiters.decimal,u="."===c.delimiters.thousands?"\\.":c.delimiters.thousands,(null===(l=t.match(/^[^\d]+/))||(t=t.substr(1),l[0]===i))&&((null===(l=t.match(/[^\d]+$/))||(t=t.slice(0,-1),l[0]===a.thousand||l[0]===a.million||l[0]===a.billion||l[0]===a.trillion))&&(f=new RegExp(u+"{2}"),!t.match(/[^\d.,]/g)&&(!((o=t.split(e)).length>2)&&(o.length<2?!!o[0].match(/^\d+.*\d$/)&&!o[0].match(f):1===o[0].length?!!o[0].match(/^\d+$/)&&!o[0].match(f)&&!!o[1].match(/^\d+$/):!!o[0].match(/^\d+.*\d$/)&&!o[0].match(f)&&!!o[1].match(/^\d+$/)))))},n.fn=c.prototype={clone:function(){return n(this)},format:function(t,r){var e,u,o,a=this._value,c=t||f.defaultFormat;if(r=r||Math.round,0===a&&null!==f.zeroFormat)u=f.zeroFormat;else if(null===a&&null!==f.nullFormat)u=f.nullFormat;else{for(e in i)if(c.match(i[e].regexps.format)){o=i[e].format;break}u=(o=o||n._.numberToFormat)(a,c,r)}return u},value:function(){return this._value},input:function(){return this._input},set:function(n){return this._value=Number(n),this},add:function(n){var r=t.correctionFactor.call(null,this._value,n);return this._value=t.reduce([this._value,n],(function(n,t,e,u){return n+Math.round(r*t)}),0)/r,this},subtract:function(n){var r=t.correctionFactor.call(null,this._value,n);return this._value=t.reduce([n],(function(n,t,e,u){return n-Math.round(r*t)}),Math.round(this._value*r))/r,this},multiply:function(n){return this._value=t.reduce([this._value,n],(function(n,r,e,u){var i=t.correctionFactor(n,r);return Math.round(n*i)*Math.round(r*i)/Math.round(i*i)}),1),this},divide:function(n){return this._value=t.reduce([this._value,n],(function(n,r,e,u){var i=t.correctionFactor(n,r);return Math.round(n*i)/Math.round(r*i)})),this},difference:function(t){return Math.abs(n(this._value).subtract(t).value())}},n.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(n){var t=n%10;return 1==~~(n%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},currency:{symbol:"$"}}),n.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(t,r,e){var u,i=n._.includes(r," BPS")?" ":"";return t*=1e4,r=r.replace(/\s?BPS/,""),u=n._.numberToFormat(t,r,e),n._.includes(u,")")?((u=u.split("")).splice(-1,0,i+"BPS"),u=u.join("")):u=u+i+"BPS",u},unformat:function(t){return+(1e-4*n._.stringToNumber(t)).toFixed(15)}}),e={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},u="("+(u=(r={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}).suffixes.concat(e.suffixes.filter((function(n){return r.suffixes.indexOf(n)<0}))).join("|")).replace("B","B(?!PS)")+")",n.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(u)},format:function(t,u,i){var o,a,f,c=n._.includes(u,"ib")?e:r,l=n._.includes(u," b")||n._.includes(u," ib")?" ":"";for(u=u.replace(/\s?i?b/,""),o=0;o<=c.suffixes.length;o++)if(a=Math.pow(c.base,o),f=Math.pow(c.base,o+1),null===t||0===t||t>=a&&t<f){l+=c.suffixes[o],a>0&&(t/=a);break}return n._.numberToFormat(t,u,i)+l},unformat:function(t){var u,i,o=n._.stringToNumber(t);if(o){for(u=r.suffixes.length-1;u>=0;u--){if(n._.includes(t,r.suffixes[u])){i=Math.pow(r.base,u);break}if(n._.includes(t,e.suffixes[u])){i=Math.pow(e.base,u);break}}o*=i||1}return o}}),n.register("format","currency",{regexps:{format:/(\$)/},format:function(t,r,e){var u,i,o=n.locales[n.options.currentLocale],a={before:r.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:r.match(/([\+|\-|\)|\s|\$]*)$/)[0]};for(r=r.replace(/\s?\$\s?/,""),u=n._.numberToFormat(t,r,e),t>=0?(a.before=a.before.replace(/[\-\(]/,""),a.after=a.after.replace(/[\-\)]/,"")):t<0&&!n._.includes(a.before,"-")&&!n._.includes(a.before,"(")&&(a.before="-"+a.before),i=0;i<a.before.length;i++)switch(a.before[i]){case"$":u=n._.insert(u,o.currency.symbol,i);break;case" ":u=n._.insert(u," ",i+o.currency.symbol.length-1)}for(i=a.after.length-1;i>=0;i--)switch(a.after[i]){case"$":u=i===a.after.length-1?u+o.currency.symbol:n._.insert(u,o.currency.symbol,-(a.after.length-(1+i)));break;case" ":u=i===a.after.length-1?u+" ":n._.insert(u," ",-(a.after.length-(1+i)+o.currency.symbol.length-1))}return u}}),n.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(t,r,e){var u=("number"!=typeof t||n._.isNaN(t)?"0e+0":t.toExponential()).split("e");return r=r.replace(/e[\+|\-]{1}0/,""),n._.numberToFormat(Number(u[0]),r,e)+"e"+u[1]},unformat:function(t){var r=n._.includes(t,"e+")?t.split("e+"):t.split("e-"),e=Number(r[0]),u=Number(r[1]);return u=n._.includes(t,"e-")?u*=-1:u,n._.reduce([e,Math.pow(10,u)],(function(t,r,e,u){var i=n._.correctionFactor(t,r);return t*i*(r*i)/(i*i)}),1)}}),n.register("format","ordinal",{regexps:{format:/(o)/},format:function(t,r,e){var u=n.locales[n.options.currentLocale],i=n._.includes(r," o")?" ":"";return r=r.replace(/\s?o/,""),i+=u.ordinal(t),n._.numberToFormat(t,r,e)+i}}),n.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(t,r,e){var u,i=n._.includes(r," %")?" ":"";return n.options.scalePercentBy100&&(t*=100),r=r.replace(/\s?\%/,""),u=n._.numberToFormat(t,r,e),n._.includes(u,")")?((u=u.split("")).splice(-1,0,i+"%"),u=u.join("")):u=u+i+"%",u},unformat:function(t){var r=n._.stringToNumber(t);return n.options.scalePercentBy100?.01*r:r}}),n.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(n,t,r){var e=Math.floor(n/60/60),u=Math.floor((n-60*e*60)/60),i=Math.round(n-60*e*60-60*u);return e+":"+(u<10?"0"+u:u)+":"+(i<10?"0"+i:i)},unformat:function(n){var t=n.split(":"),r=0;return 3===t.length?(r+=60*Number(t[0])*60,r+=60*Number(t[1]),r+=Number(t[2])):2===t.length&&(r+=60*Number(t[0]),r+=Number(t[1])),Number(r)}}),n}))})),c=a((function(n,t){(function(){var r,e="Expected a function",u="__lodash_hash_undefined__",i="__lodash_placeholder__",a=16,f=32,c=64,l=128,s=256,h=1/0,p=9007199254740991,v=NaN,_=4294967295,g=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",a],["flip",512],["partial",f],["partialRight",c],["rearg",s]],d="[object Arguments]",y="[object Array]",m="[object Boolean]",b="[object Date]",w="[object Error]",x="[object Function]",j="[object GeneratorFunction]",k="[object Map]",A="[object Number]",F="[object Object]",M="[object Promise]",S="[object RegExp]",E="[object Set]",O="[object String]",P="[object Symbol]",L="[object WeakMap]",z="[object ArrayBuffer]",B="[object DataView]",I="[object Float32Array]",C="[object Float64Array]",R="[object Int8Array]",T="[object Int16Array]",N="[object Int32Array]",$="[object Uint8Array]",W="[object Uint8ClampedArray]",U="[object Uint16Array]",D="[object Uint32Array]",q=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,Z=/(__e\(.*?\)|\b__t\)) \+\n'';/g,V=/&(?:amp|lt|gt|quot|#39);/g,K=/[&<>"']/g,J=RegExp(V.source),Y=RegExp(K.source),H=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,nn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tn=/^\w*$/,rn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,en=/[\\^$.*+?()[\]{}|]/g,un=RegExp(en.source),on=/^\s+/,an=/\s/,fn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,cn=/\{\n\/\* \[wrapped with (.+)\] \*/,ln=/,? & /,sn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,hn=/[()=,{}\[\]\/\s]/,pn=/\\(\\)?/g,vn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,_n=/\w*$/,gn=/^[-+]0x[0-9a-f]+$/i,dn=/^0b[01]+$/i,yn=/^\[object .+?Constructor\]$/,mn=/^0o[0-7]+$/i,bn=/^(?:0|[1-9]\d*)$/,wn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,xn=/($^)/,jn=/['\n\r\u2028\u2029\\]/g,kn="\\ud800-\\udfff",An="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Fn="\\u2700-\\u27bf",Mn="a-z\\xdf-\\xf6\\xf8-\\xff",Sn="A-Z\\xc0-\\xd6\\xd8-\\xde",En="\\ufe0e\\ufe0f",On="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Pn="['’]",Ln="["+kn+"]",zn="["+On+"]",Bn="["+An+"]",In="\\d+",Cn="["+Fn+"]",Rn="["+Mn+"]",Tn="[^"+kn+On+In+Fn+Mn+Sn+"]",Nn="\\ud83c[\\udffb-\\udfff]",$n="[^"+kn+"]",Wn="(?:\\ud83c[\\udde6-\\uddff]){2}",Un="[\\ud800-\\udbff][\\udc00-\\udfff]",Dn="["+Sn+"]",qn="\\u200d",Gn="(?:"+Rn+"|"+Tn+")",Zn="(?:"+Dn+"|"+Tn+")",Vn="(?:['’](?:d|ll|m|re|s|t|ve))?",Kn="(?:['’](?:D|LL|M|RE|S|T|VE))?",Jn="(?:"+Bn+"|"+Nn+")"+"?",Yn="["+En+"]?",Hn=Yn+Jn+("(?:"+qn+"(?:"+[$n,Wn,Un].join("|")+")"+Yn+Jn+")*"),Qn="(?:"+[Cn,Wn,Un].join("|")+")"+Hn,Xn="(?:"+[$n+Bn+"?",Bn,Wn,Un,Ln].join("|")+")",nt=RegExp(Pn,"g"),tt=RegExp(Bn,"g"),rt=RegExp(Nn+"(?="+Nn+")|"+Xn+Hn,"g"),et=RegExp([Dn+"?"+Rn+"+"+Vn+"(?="+[zn,Dn,"$"].join("|")+")",Zn+"+"+Kn+"(?="+[zn,Dn+Gn,"$"].join("|")+")",Dn+"?"+Gn+"+"+Vn,Dn+"+"+Kn,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",In,Qn].join("|"),"g"),ut=RegExp("["+qn+kn+An+En+"]"),it=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ot=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],at=-1,ft={};ft[I]=ft[C]=ft[R]=ft[T]=ft[N]=ft[$]=ft[W]=ft[U]=ft[D]=!0,ft[d]=ft[y]=ft[z]=ft[m]=ft[B]=ft[b]=ft[w]=ft[x]=ft[k]=ft[A]=ft[F]=ft[S]=ft[E]=ft[O]=ft[L]=!1;var ct={};ct[d]=ct[y]=ct[z]=ct[B]=ct[m]=ct[b]=ct[I]=ct[C]=ct[R]=ct[T]=ct[N]=ct[k]=ct[A]=ct[F]=ct[S]=ct[E]=ct[O]=ct[P]=ct[$]=ct[W]=ct[U]=ct[D]=!0,ct[w]=ct[x]=ct[L]=!1;var lt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},st=parseFloat,ht=parseInt,pt="object"==typeof o&&o&&o.Object===Object&&o,vt="object"==typeof self&&self&&self.Object===Object&&self,_t=pt||vt||Function("return this")(),gt=t&&!t.nodeType&&t,dt=gt&&n&&!n.nodeType&&n,yt=dt&&dt.exports===gt,mt=yt&&pt.process,bt=function(){try{var n=dt&&dt.require&&dt.require("util").types;return n||mt&&mt.binding&&mt.binding("util")}catch(n){}}(),wt=bt&&bt.isArrayBuffer,xt=bt&&bt.isDate,jt=bt&&bt.isMap,kt=bt&&bt.isRegExp,At=bt&&bt.isSet,Ft=bt&&bt.isTypedArray;function Mt(n,t,r){switch(r.length){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function St(n,t,r,e){for(var u=-1,i=null==n?0:n.length;++u<i;){var o=n[u];t(e,o,r(o),n)}return e}function Et(n,t){for(var r=-1,e=null==n?0:n.length;++r<e&&!1!==t(n[r],r,n););return n}function Ot(n,t){for(var r=null==n?0:n.length;r--&&!1!==t(n[r],r,n););return n}function Pt(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(!t(n[r],r,n))return!1;return!0}function Lt(n,t){for(var r=-1,e=null==n?0:n.length,u=0,i=[];++r<e;){var o=n[r];t(o,r,n)&&(i[u++]=o)}return i}function zt(n,t){return!!(null==n?0:n.length)&&Dt(n,t,0)>-1}function Bt(n,t,r){for(var e=-1,u=null==n?0:n.length;++e<u;)if(r(t,n[e]))return!0;return!1}function It(n,t){for(var r=-1,e=null==n?0:n.length,u=Array(e);++r<e;)u[r]=t(n[r],r,n);return u}function Ct(n,t){for(var r=-1,e=t.length,u=n.length;++r<e;)n[u+r]=t[r];return n}function Rt(n,t,r,e){var u=-1,i=null==n?0:n.length;for(e&&i&&(r=n[++u]);++u<i;)r=t(r,n[u],u,n);return r}function Tt(n,t,r,e){var u=null==n?0:n.length;for(e&&u&&(r=n[--u]);u--;)r=t(r,n[u],u,n);return r}function Nt(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(t(n[r],r,n))return!0;return!1}var $t=Vt("length");function Wt(n,t,r){var e;return r(n,(function(n,r,u){if(t(n,r,u))return e=r,!1})),e}function Ut(n,t,r,e){for(var u=n.length,i=r+(e?1:-1);e?i--:++i<u;)if(t(n[i],i,n))return i;return-1}function Dt(n,t,r){return t==t?function(n,t,r){var e=r-1,u=n.length;for(;++e<u;)if(n[e]===t)return e;return-1}(n,t,r):Ut(n,Gt,r)}function qt(n,t,r,e){for(var u=r-1,i=n.length;++u<i;)if(e(n[u],t))return u;return-1}function Gt(n){return n!=n}function Zt(n,t){var r=null==n?0:n.length;return r?Yt(n,t)/r:v}function Vt(n){return function(t){return null==t?r:t[n]}}function Kt(n){return function(t){return null==n?r:n[t]}}function Jt(n,t,r,e,u){return u(n,(function(n,u,i){r=e?(e=!1,n):t(r,n,u,i)})),r}function Yt(n,t){for(var e,u=-1,i=n.length;++u<i;){var o=t(n[u]);o!==r&&(e=e===r?o:e+o)}return e}function Ht(n,t){for(var r=-1,e=Array(n);++r<n;)e[r]=t(r);return e}function Qt(n){return n?n.slice(0,_r(n)+1).replace(on,""):n}function Xt(n){return function(t){return n(t)}}function nr(n,t){return It(t,(function(t){return n[t]}))}function tr(n,t){return n.has(t)}function rr(n,t){for(var r=-1,e=n.length;++r<e&&Dt(t,n[r],0)>-1;);return r}function er(n,t){for(var r=n.length;r--&&Dt(t,n[r],0)>-1;);return r}var ur=Kt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),ir=Kt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function or(n){return"\\"+lt[n]}function ar(n){return ut.test(n)}function fr(n){var t=-1,r=Array(n.size);return n.forEach((function(n,e){r[++t]=[e,n]})),r}function cr(n,t){return function(r){return n(t(r))}}function lr(n,t){for(var r=-1,e=n.length,u=0,o=[];++r<e;){var a=n[r];a!==t&&a!==i||(n[r]=i,o[u++]=r)}return o}function sr(n){var t=-1,r=Array(n.size);return n.forEach((function(n){r[++t]=n})),r}function hr(n){var t=-1,r=Array(n.size);return n.forEach((function(n){r[++t]=[n,n]})),r}function pr(n){return ar(n)?function(n){var t=rt.lastIndex=0;for(;rt.test(n);)++t;return t}(n):$t(n)}function vr(n){return ar(n)?function(n){return n.match(rt)||[]}(n):function(n){return n.split("")}(n)}function _r(n){for(var t=n.length;t--&&an.test(n.charAt(t)););return t}var gr=Kt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var dr=function n(t){var o,an=(t=null==t?_t:dr.defaults(_t.Object(),t,dr.pick(_t,ot))).Array,kn=t.Date,An=t.Error,Fn=t.Function,Mn=t.Math,Sn=t.Object,En=t.RegExp,On=t.String,Pn=t.TypeError,Ln=an.prototype,zn=Fn.prototype,Bn=Sn.prototype,In=t["__core-js_shared__"],Cn=zn.toString,Rn=Bn.hasOwnProperty,Tn=0,Nn=(o=/[^.]+$/.exec(In&&In.keys&&In.keys.IE_PROTO||""))?"Symbol(src)_1."+o:"",$n=Bn.toString,Wn=Cn.call(Sn),Un=_t._,Dn=En("^"+Cn.call(Rn).replace(en,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qn=yt?t.Buffer:r,Gn=t.Symbol,Zn=t.Uint8Array,Vn=qn?qn.allocUnsafe:r,Kn=cr(Sn.getPrototypeOf,Sn),Jn=Sn.create,Yn=Bn.propertyIsEnumerable,Hn=Ln.splice,Qn=Gn?Gn.isConcatSpreadable:r,Xn=Gn?Gn.iterator:r,rt=Gn?Gn.toStringTag:r,ut=function(){try{var n=hi(Sn,"defineProperty");return n({},"",{}),n}catch(n){}}(),lt=t.clearTimeout!==_t.clearTimeout&&t.clearTimeout,pt=kn&&kn.now!==_t.Date.now&&kn.now,vt=t.setTimeout!==_t.setTimeout&&t.setTimeout,gt=Mn.ceil,dt=Mn.floor,mt=Sn.getOwnPropertySymbols,bt=qn?qn.isBuffer:r,$t=t.isFinite,Kt=Ln.join,yr=cr(Sn.keys,Sn),mr=Mn.max,br=Mn.min,wr=kn.now,xr=t.parseInt,jr=Mn.random,kr=Ln.reverse,Ar=hi(t,"DataView"),Fr=hi(t,"Map"),Mr=hi(t,"Promise"),Sr=hi(t,"Set"),Er=hi(t,"WeakMap"),Or=hi(Sn,"create"),Pr=Er&&new Er,Lr={},zr=Ti(Ar),Br=Ti(Fr),Ir=Ti(Mr),Cr=Ti(Sr),Rr=Ti(Er),Tr=Gn?Gn.prototype:r,Nr=Tr?Tr.valueOf:r,$r=Tr?Tr.toString:r;function Wr(n){if(ra(n)&&!Go(n)&&!(n instanceof Gr)){if(n instanceof qr)return n;if(Rn.call(n,"__wrapped__"))return Ni(n)}return new qr(n)}var Ur=function(){function n(){}return function(t){if(!ta(t))return{};if(Jn)return Jn(t);n.prototype=t;var e=new n;return n.prototype=r,e}}();function Dr(){}function qr(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function Gr(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=_,this.__views__=[]}function Zr(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function Vr(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function Kr(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function Jr(n){var t=-1,r=null==n?0:n.length;for(this.__data__=new Kr;++t<r;)this.add(n[t])}function Yr(n){var t=this.__data__=new Vr(n);this.size=t.size}function Hr(n,t){var r=Go(n),e=!r&&qo(n),u=!r&&!e&&Jo(n),i=!r&&!e&&!u&&la(n),o=r||e||u||i,a=o?Ht(n.length,On):[],f=a.length;for(var c in n)!t&&!Rn.call(n,c)||o&&("length"==c||u&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||mi(c,f))||a.push(c);return a}function Qr(n){var t=n.length;return t?n[Je(0,t-1)]:r}function Xr(n,t){return Ii(Ou(n),fe(t,0,n.length))}function ne(n){return Ii(Ou(n))}function te(n,t,e){(e!==r&&!Wo(n[t],e)||e===r&&!(t in n))&&oe(n,t,e)}function re(n,t,e){var u=n[t];Rn.call(n,t)&&Wo(u,e)&&(e!==r||t in n)||oe(n,t,e)}function ee(n,t){for(var r=n.length;r--;)if(Wo(n[r][0],t))return r;return-1}function ue(n,t,r,e){return pe(n,(function(n,u,i){t(e,n,r(n),i)})),e}function ie(n,t){return n&&Pu(t,La(t),n)}function oe(n,t,r){"__proto__"==t&&ut?ut(n,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):n[t]=r}function ae(n,t){for(var e=-1,u=t.length,i=an(u),o=null==n;++e<u;)i[e]=o?r:Ma(n,t[e]);return i}function fe(n,t,e){return n==n&&(e!==r&&(n=n<=e?n:e),t!==r&&(n=n>=t?n:t)),n}function ce(n,t,e,u,i,o){var a,f=1&t,c=2&t,l=4&t;if(e&&(a=i?e(n,u,i,o):e(n)),a!==r)return a;if(!ta(n))return n;var s=Go(n);if(s){if(a=function(n){var t=n.length,r=new n.constructor(t);t&&"string"==typeof n[0]&&Rn.call(n,"index")&&(r.index=n.index,r.input=n.input);return r}(n),!f)return Ou(n,a)}else{var h=_i(n),p=h==x||h==j;if(Jo(n))return ku(n,f);if(h==F||h==d||p&&!i){if(a=c||p?{}:di(n),!f)return c?function(n,t){return Pu(n,vi(n),t)}(n,function(n,t){return n&&Pu(t,za(t),n)}(a,n)):function(n,t){return Pu(n,pi(n),t)}(n,ie(a,n))}else{if(!ct[h])return i?n:{};a=function(n,t,r){var e=n.constructor;switch(t){case z:return Au(n);case m:case b:return new e(+n);case B:return function(n,t){var r=t?Au(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.byteLength)}(n,r);case I:case C:case R:case T:case N:case $:case W:case U:case D:return Fu(n,r);case k:return new e;case A:case O:return new e(n);case S:return function(n){var t=new n.constructor(n.source,_n.exec(n));return t.lastIndex=n.lastIndex,t}(n);case E:return new e;case P:return u=n,Nr?Sn(Nr.call(u)):{}}var u}(n,h,f)}}o||(o=new Yr);var v=o.get(n);if(v)return v;o.set(n,a),aa(n)?n.forEach((function(r){a.add(ce(r,t,e,r,n,o))})):ea(n)&&n.forEach((function(r,u){a.set(u,ce(r,t,e,u,n,o))}));var _=s?r:(l?c?ii:ui:c?za:La)(n);return Et(_||n,(function(r,u){_&&(r=n[u=r]),re(a,u,ce(r,t,e,u,n,o))})),a}function le(n,t,e){var u=e.length;if(null==n)return!u;for(n=Sn(n);u--;){var i=e[u],o=t[i],a=n[i];if(a===r&&!(i in n)||!o(a))return!1}return!0}function se(n,t,u){if("function"!=typeof n)throw new Pn(e);return Pi((function(){n.apply(r,u)}),t)}function he(n,t,r,e){var u=-1,i=zt,o=!0,a=n.length,f=[],c=t.length;if(!a)return f;r&&(t=It(t,Xt(r))),e?(i=Bt,o=!1):t.length>=200&&(i=tr,o=!1,t=new Jr(t));n:for(;++u<a;){var l=n[u],s=null==r?l:r(l);if(l=e||0!==l?l:0,o&&s==s){for(var h=c;h--;)if(t[h]===s)continue n;f.push(l)}else i(t,s,e)||f.push(l)}return f}Wr.templateSettings={escape:H,evaluate:Q,interpolate:X,variable:"",imports:{_:Wr}},Wr.prototype=Dr.prototype,Wr.prototype.constructor=Wr,qr.prototype=Ur(Dr.prototype),qr.prototype.constructor=qr,Gr.prototype=Ur(Dr.prototype),Gr.prototype.constructor=Gr,Zr.prototype.clear=function(){this.__data__=Or?Or(null):{},this.size=0},Zr.prototype.delete=function(n){var t=this.has(n)&&delete this.__data__[n];return this.size-=t?1:0,t},Zr.prototype.get=function(n){var t=this.__data__;if(Or){var e=t[n];return e===u?r:e}return Rn.call(t,n)?t[n]:r},Zr.prototype.has=function(n){var t=this.__data__;return Or?t[n]!==r:Rn.call(t,n)},Zr.prototype.set=function(n,t){var e=this.__data__;return this.size+=this.has(n)?0:1,e[n]=Or&&t===r?u:t,this},Vr.prototype.clear=function(){this.__data__=[],this.size=0},Vr.prototype.delete=function(n){var t=this.__data__,r=ee(t,n);return!(r<0)&&(r==t.length-1?t.pop():Hn.call(t,r,1),--this.size,!0)},Vr.prototype.get=function(n){var t=this.__data__,e=ee(t,n);return e<0?r:t[e][1]},Vr.prototype.has=function(n){return ee(this.__data__,n)>-1},Vr.prototype.set=function(n,t){var r=this.__data__,e=ee(r,n);return e<0?(++this.size,r.push([n,t])):r[e][1]=t,this},Kr.prototype.clear=function(){this.size=0,this.__data__={hash:new Zr,map:new(Fr||Vr),string:new Zr}},Kr.prototype.delete=function(n){var t=li(this,n).delete(n);return this.size-=t?1:0,t},Kr.prototype.get=function(n){return li(this,n).get(n)},Kr.prototype.has=function(n){return li(this,n).has(n)},Kr.prototype.set=function(n,t){var r=li(this,n),e=r.size;return r.set(n,t),this.size+=r.size==e?0:1,this},Jr.prototype.add=Jr.prototype.push=function(n){return this.__data__.set(n,u),this},Jr.prototype.has=function(n){return this.__data__.has(n)},Yr.prototype.clear=function(){this.__data__=new Vr,this.size=0},Yr.prototype.delete=function(n){var t=this.__data__,r=t.delete(n);return this.size=t.size,r},Yr.prototype.get=function(n){return this.__data__.get(n)},Yr.prototype.has=function(n){return this.__data__.has(n)},Yr.prototype.set=function(n,t){var r=this.__data__;if(r instanceof Vr){var e=r.__data__;if(!Fr||e.length<199)return e.push([n,t]),this.size=++r.size,this;r=this.__data__=new Kr(e)}return r.set(n,t),this.size=r.size,this};var pe=Bu(we),ve=Bu(xe,!0);function _e(n,t){var r=!0;return pe(n,(function(n,e,u){return r=!!t(n,e,u)})),r}function ge(n,t,e){for(var u=-1,i=n.length;++u<i;){var o=n[u],a=t(o);if(null!=a&&(f===r?a==a&&!ca(a):e(a,f)))var f=a,c=o}return c}function de(n,t){var r=[];return pe(n,(function(n,e,u){t(n,e,u)&&r.push(n)})),r}function ye(n,t,r,e,u){var i=-1,o=n.length;for(r||(r=yi),u||(u=[]);++i<o;){var a=n[i];t>0&&r(a)?t>1?ye(a,t-1,r,e,u):Ct(u,a):e||(u[u.length]=a)}return u}var me=Iu(),be=Iu(!0);function we(n,t){return n&&me(n,t,La)}function xe(n,t){return n&&be(n,t,La)}function je(n,t){return Lt(t,(function(t){return Qo(n[t])}))}function ke(n,t){for(var e=0,u=(t=bu(t,n)).length;null!=n&&e<u;)n=n[Ri(t[e++])];return e&&e==u?n:r}function Ae(n,t,r){var e=t(n);return Go(n)?e:Ct(e,r(n))}function Fe(n){return null==n?n===r?"[object Undefined]":"[object Null]":rt&&rt in Sn(n)?function(n){var t=Rn.call(n,rt),e=n[rt];try{n[rt]=r;var u=!0}catch(n){}var i=$n.call(n);u&&(t?n[rt]=e:delete n[rt]);return i}(n):function(n){return $n.call(n)}(n)}function Me(n,t){return n>t}function Se(n,t){return null!=n&&Rn.call(n,t)}function Ee(n,t){return null!=n&&t in Sn(n)}function Oe(n,t,e){for(var u=e?Bt:zt,i=n[0].length,o=n.length,a=o,f=an(o),c=1/0,l=[];a--;){var s=n[a];a&&t&&(s=It(s,Xt(t))),c=br(s.length,c),f[a]=!e&&(t||i>=120&&s.length>=120)?new Jr(a&&s):r}s=n[0];var h=-1,p=f[0];n:for(;++h<i&&l.length<c;){var v=s[h],_=t?t(v):v;if(v=e||0!==v?v:0,!(p?tr(p,_):u(l,_,e))){for(a=o;--a;){var g=f[a];if(!(g?tr(g,_):u(n[a],_,e)))continue n}p&&p.push(_),l.push(v)}}return l}function Pe(n,t,e){var u=null==(n=Si(n,t=bu(t,n)))?n:n[Ri(Yi(t))];return null==u?r:Mt(u,n,e)}function Le(n){return ra(n)&&Fe(n)==d}function ze(n,t,e,u,i){return n===t||(null==n||null==t||!ra(n)&&!ra(t)?n!=n&&t!=t:function(n,t,e,u,i,o){var a=Go(n),f=Go(t),c=a?y:_i(n),l=f?y:_i(t),s=(c=c==d?F:c)==F,h=(l=l==d?F:l)==F,p=c==l;if(p&&Jo(n)){if(!Jo(t))return!1;a=!0,s=!1}if(p&&!s)return o||(o=new Yr),a||la(n)?ri(n,t,e,u,i,o):function(n,t,r,e,u,i,o){switch(r){case B:if(n.byteLength!=t.byteLength||n.byteOffset!=t.byteOffset)return!1;n=n.buffer,t=t.buffer;case z:return!(n.byteLength!=t.byteLength||!i(new Zn(n),new Zn(t)));case m:case b:case A:return Wo(+n,+t);case w:return n.name==t.name&&n.message==t.message;case S:case O:return n==t+"";case k:var a=fr;case E:var f=1&e;if(a||(a=sr),n.size!=t.size&&!f)return!1;var c=o.get(n);if(c)return c==t;e|=2,o.set(n,t);var l=ri(a(n),a(t),e,u,i,o);return o.delete(n),l;case P:if(Nr)return Nr.call(n)==Nr.call(t)}return!1}(n,t,c,e,u,i,o);if(!(1&e)){var v=s&&Rn.call(n,"__wrapped__"),_=h&&Rn.call(t,"__wrapped__");if(v||_){var g=v?n.value():n,x=_?t.value():t;return o||(o=new Yr),i(g,x,e,u,o)}}if(!p)return!1;return o||(o=new Yr),function(n,t,e,u,i,o){var a=1&e,f=ui(n),c=f.length,l=ui(t),s=l.length;if(c!=s&&!a)return!1;var h=c;for(;h--;){var p=f[h];if(!(a?p in t:Rn.call(t,p)))return!1}var v=o.get(n),_=o.get(t);if(v&&_)return v==t&&_==n;var g=!0;o.set(n,t),o.set(t,n);var d=a;for(;++h<c;){var y=n[p=f[h]],m=t[p];if(u)var b=a?u(m,y,p,t,n,o):u(y,m,p,n,t,o);if(!(b===r?y===m||i(y,m,e,u,o):b)){g=!1;break}d||(d="constructor"==p)}if(g&&!d){var w=n.constructor,x=t.constructor;w==x||!("constructor"in n)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof x&&x instanceof x||(g=!1)}return o.delete(n),o.delete(t),g}(n,t,e,u,i,o)}(n,t,e,u,ze,i))}function Be(n,t,e,u){var i=e.length,o=i,a=!u;if(null==n)return!o;for(n=Sn(n);i--;){var f=e[i];if(a&&f[2]?f[1]!==n[f[0]]:!(f[0]in n))return!1}for(;++i<o;){var c=(f=e[i])[0],l=n[c],s=f[1];if(a&&f[2]){if(l===r&&!(c in n))return!1}else{var h=new Yr;if(u)var p=u(l,s,c,n,t,h);if(!(p===r?ze(s,l,3,u,h):p))return!1}}return!0}function Ie(n){return!(!ta(n)||(t=n,Nn&&Nn in t))&&(Qo(n)?Dn:yn).test(Ti(n));var t}function Ce(n){return"function"==typeof n?n:null==n?uf:"object"==typeof n?Go(n)?Ue(n[0],n[1]):We(n):vf(n)}function Re(n){if(!ki(n))return yr(n);var t=[];for(var r in Sn(n))Rn.call(n,r)&&"constructor"!=r&&t.push(r);return t}function Te(n){if(!ta(n))return function(n){var t=[];if(null!=n)for(var r in Sn(n))t.push(r);return t}(n);var t=ki(n),r=[];for(var e in n)("constructor"!=e||!t&&Rn.call(n,e))&&r.push(e);return r}function Ne(n,t){return n<t}function $e(n,t){var r=-1,e=Vo(n)?an(n.length):[];return pe(n,(function(n,u,i){e[++r]=t(n,u,i)})),e}function We(n){var t=si(n);return 1==t.length&&t[0][2]?Fi(t[0][0],t[0][1]):function(r){return r===n||Be(r,n,t)}}function Ue(n,t){return wi(n)&&Ai(t)?Fi(Ri(n),t):function(e){var u=Ma(e,n);return u===r&&u===t?Sa(e,n):ze(t,u,3)}}function De(n,t,e,u,i){n!==t&&me(t,(function(o,a){if(i||(i=new Yr),ta(o))!function(n,t,e,u,i,o,a){var f=Ei(n,e),c=Ei(t,e),l=a.get(c);if(l)return void te(n,e,l);var s=o?o(f,c,e+"",n,t,a):r,h=s===r;if(h){var p=Go(c),v=!p&&Jo(c),_=!p&&!v&&la(c);s=c,p||v||_?Go(f)?s=f:Ko(f)?s=Ou(f):v?(h=!1,s=ku(c,!0)):_?(h=!1,s=Fu(c,!0)):s=[]:ia(c)||qo(c)?(s=f,qo(f)?s=ya(f):ta(f)&&!Qo(f)||(s=di(c))):h=!1}h&&(a.set(c,s),i(s,c,u,o,a),a.delete(c));te(n,e,s)}(n,t,a,e,De,u,i);else{var f=u?u(Ei(n,a),o,a+"",n,t,i):r;f===r&&(f=o),te(n,a,f)}}),za)}function qe(n,t){var e=n.length;if(e)return mi(t+=t<0?e:0,e)?n[t]:r}function Ge(n,t,r){t=t.length?It(t,(function(n){return Go(n)?function(t){return ke(t,1===n.length?n[0]:n)}:n})):[uf];var e=-1;t=It(t,Xt(ci()));var u=$e(n,(function(n,r,u){var i=It(t,(function(t){return t(n)}));return{criteria:i,index:++e,value:n}}));return function(n,t){var r=n.length;for(n.sort(t);r--;)n[r]=n[r].value;return n}(u,(function(n,t){return function(n,t,r){var e=-1,u=n.criteria,i=t.criteria,o=u.length,a=r.length;for(;++e<o;){var f=Mu(u[e],i[e]);if(f)return e>=a?f:f*("desc"==r[e]?-1:1)}return n.index-t.index}(n,t,r)}))}function Ze(n,t,r){for(var e=-1,u=t.length,i={};++e<u;){var o=t[e],a=ke(n,o);r(a,o)&&nu(i,bu(o,n),a)}return i}function Ve(n,t,r,e){var u=e?qt:Dt,i=-1,o=t.length,a=n;for(n===t&&(t=Ou(t)),r&&(a=It(n,Xt(r)));++i<o;)for(var f=0,c=t[i],l=r?r(c):c;(f=u(a,l,f,e))>-1;)a!==n&&Hn.call(a,f,1),Hn.call(n,f,1);return n}function Ke(n,t){for(var r=n?t.length:0,e=r-1;r--;){var u=t[r];if(r==e||u!==i){var i=u;mi(u)?Hn.call(n,u,1):hu(n,u)}}return n}function Je(n,t){return n+dt(jr()*(t-n+1))}function Ye(n,t){var r="";if(!n||t<1||t>p)return r;do{t%2&&(r+=n),(t=dt(t/2))&&(n+=n)}while(t);return r}function He(n,t){return Li(Mi(n,t,uf),n+"")}function Qe(n){return Qr(Wa(n))}function Xe(n,t){var r=Wa(n);return Ii(r,fe(t,0,r.length))}function nu(n,t,e,u){if(!ta(n))return n;for(var i=-1,o=(t=bu(t,n)).length,a=o-1,f=n;null!=f&&++i<o;){var c=Ri(t[i]),l=e;if("__proto__"===c||"constructor"===c||"prototype"===c)return n;if(i!=a){var s=f[c];(l=u?u(s,c,f):r)===r&&(l=ta(s)?s:mi(t[i+1])?[]:{})}re(f,c,l),f=f[c]}return n}var tu=Pr?function(n,t){return Pr.set(n,t),n}:uf,ru=ut?function(n,t){return ut(n,"toString",{configurable:!0,enumerable:!1,value:tf(t),writable:!0})}:uf;function eu(n){return Ii(Wa(n))}function uu(n,t,r){var e=-1,u=n.length;t<0&&(t=-t>u?0:u+t),(r=r>u?u:r)<0&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0;for(var i=an(u);++e<u;)i[e]=n[e+t];return i}function iu(n,t){var r;return pe(n,(function(n,e,u){return!(r=t(n,e,u))})),!!r}function ou(n,t,r){var e=0,u=null==n?e:n.length;if("number"==typeof t&&t==t&&u<=2147483647){for(;e<u;){var i=e+u>>>1,o=n[i];null!==o&&!ca(o)&&(r?o<=t:o<t)?e=i+1:u=i}return u}return au(n,t,uf,r)}function au(n,t,e,u){var i=0,o=null==n?0:n.length;if(0===o)return 0;for(var a=(t=e(t))!=t,f=null===t,c=ca(t),l=t===r;i<o;){var s=dt((i+o)/2),h=e(n[s]),p=h!==r,v=null===h,_=h==h,g=ca(h);if(a)var d=u||_;else d=l?_&&(u||p):f?_&&p&&(u||!v):c?_&&p&&!v&&(u||!g):!v&&!g&&(u?h<=t:h<t);d?i=s+1:o=s}return br(o,4294967294)}function fu(n,t){for(var r=-1,e=n.length,u=0,i=[];++r<e;){var o=n[r],a=t?t(o):o;if(!r||!Wo(a,f)){var f=a;i[u++]=0===o?0:o}}return i}function cu(n){return"number"==typeof n?n:ca(n)?v:+n}function lu(n){if("string"==typeof n)return n;if(Go(n))return It(n,lu)+"";if(ca(n))return $r?$r.call(n):"";var t=n+"";return"0"==t&&1/n==-1/0?"-0":t}function su(n,t,r){var e=-1,u=zt,i=n.length,o=!0,a=[],f=a;if(r)o=!1,u=Bt;else if(i>=200){var c=t?null:Yu(n);if(c)return sr(c);o=!1,u=tr,f=new Jr}else f=t?[]:a;n:for(;++e<i;){var l=n[e],s=t?t(l):l;if(l=r||0!==l?l:0,o&&s==s){for(var h=f.length;h--;)if(f[h]===s)continue n;t&&f.push(s),a.push(l)}else u(f,s,r)||(f!==a&&f.push(s),a.push(l))}return a}function hu(n,t){return null==(n=Si(n,t=bu(t,n)))||delete n[Ri(Yi(t))]}function pu(n,t,r,e){return nu(n,t,r(ke(n,t)),e)}function vu(n,t,r,e){for(var u=n.length,i=e?u:-1;(e?i--:++i<u)&&t(n[i],i,n););return r?uu(n,e?0:i,e?i+1:u):uu(n,e?i+1:0,e?u:i)}function _u(n,t){var r=n;return r instanceof Gr&&(r=r.value()),Rt(t,(function(n,t){return t.func.apply(t.thisArg,Ct([n],t.args))}),r)}function gu(n,t,r){var e=n.length;if(e<2)return e?su(n[0]):[];for(var u=-1,i=an(e);++u<e;)for(var o=n[u],a=-1;++a<e;)a!=u&&(i[u]=he(i[u]||o,n[a],t,r));return su(ye(i,1),t,r)}function du(n,t,e){for(var u=-1,i=n.length,o=t.length,a={};++u<i;){var f=u<o?t[u]:r;e(a,n[u],f)}return a}function yu(n){return Ko(n)?n:[]}function mu(n){return"function"==typeof n?n:uf}function bu(n,t){return Go(n)?n:wi(n,t)?[n]:Ci(ma(n))}var wu=He;function xu(n,t,e){var u=n.length;return e=e===r?u:e,!t&&e>=u?n:uu(n,t,e)}var ju=lt||function(n){return _t.clearTimeout(n)};function ku(n,t){if(t)return n.slice();var r=n.length,e=Vn?Vn(r):new n.constructor(r);return n.copy(e),e}function Au(n){var t=new n.constructor(n.byteLength);return new Zn(t).set(new Zn(n)),t}function Fu(n,t){var r=t?Au(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.length)}function Mu(n,t){if(n!==t){var e=n!==r,u=null===n,i=n==n,o=ca(n),a=t!==r,f=null===t,c=t==t,l=ca(t);if(!f&&!l&&!o&&n>t||o&&a&&c&&!f&&!l||u&&a&&c||!e&&c||!i)return 1;if(!u&&!o&&!l&&n<t||l&&e&&i&&!u&&!o||f&&e&&i||!a&&i||!c)return-1}return 0}function Su(n,t,r,e){for(var u=-1,i=n.length,o=r.length,a=-1,f=t.length,c=mr(i-o,0),l=an(f+c),s=!e;++a<f;)l[a]=t[a];for(;++u<o;)(s||u<i)&&(l[r[u]]=n[u]);for(;c--;)l[a++]=n[u++];return l}function Eu(n,t,r,e){for(var u=-1,i=n.length,o=-1,a=r.length,f=-1,c=t.length,l=mr(i-a,0),s=an(l+c),h=!e;++u<l;)s[u]=n[u];for(var p=u;++f<c;)s[p+f]=t[f];for(;++o<a;)(h||u<i)&&(s[p+r[o]]=n[u++]);return s}function Ou(n,t){var r=-1,e=n.length;for(t||(t=an(e));++r<e;)t[r]=n[r];return t}function Pu(n,t,e,u){var i=!e;e||(e={});for(var o=-1,a=t.length;++o<a;){var f=t[o],c=u?u(e[f],n[f],f,e,n):r;c===r&&(c=n[f]),i?oe(e,f,c):re(e,f,c)}return e}function Lu(n,t){return function(r,e){var u=Go(r)?St:ue,i=t?t():{};return u(r,n,ci(e,2),i)}}function zu(n){return He((function(t,e){var u=-1,i=e.length,o=i>1?e[i-1]:r,a=i>2?e[2]:r;for(o=n.length>3&&"function"==typeof o?(i--,o):r,a&&bi(e[0],e[1],a)&&(o=i<3?r:o,i=1),t=Sn(t);++u<i;){var f=e[u];f&&n(t,f,u,o)}return t}))}function Bu(n,t){return function(r,e){if(null==r)return r;if(!Vo(r))return n(r,e);for(var u=r.length,i=t?u:-1,o=Sn(r);(t?i--:++i<u)&&!1!==e(o[i],i,o););return r}}function Iu(n){return function(t,r,e){for(var u=-1,i=Sn(t),o=e(t),a=o.length;a--;){var f=o[n?a:++u];if(!1===r(i[f],f,i))break}return t}}function Cu(n){return function(t){var e=ar(t=ma(t))?vr(t):r,u=e?e[0]:t.charAt(0),i=e?xu(e,1).join(""):t.slice(1);return u[n]()+i}}function Ru(n){return function(t){return Rt(Qa(qa(t).replace(nt,"")),n,"")}}function Tu(n){return function(){var t=arguments;switch(t.length){case 0:return new n;case 1:return new n(t[0]);case 2:return new n(t[0],t[1]);case 3:return new n(t[0],t[1],t[2]);case 4:return new n(t[0],t[1],t[2],t[3]);case 5:return new n(t[0],t[1],t[2],t[3],t[4]);case 6:return new n(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new n(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Ur(n.prototype),e=n.apply(r,t);return ta(e)?e:r}}function Nu(n){return function(t,e,u){var i=Sn(t);if(!Vo(t)){var o=ci(e,3);t=La(t),e=function(n){return o(i[n],n,i)}}var a=n(t,e,u);return a>-1?i[o?t[a]:a]:r}}function $u(n){return ei((function(t){var u=t.length,i=u,o=qr.prototype.thru;for(n&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new Pn(e);if(o&&!f&&"wrapper"==ai(a))var f=new qr([],!0)}for(i=f?i:u;++i<u;){var c=ai(a=t[i]),l="wrapper"==c?oi(a):r;f=l&&xi(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?f[ai(l[0])].apply(f,l[3]):1==a.length&&xi(a)?f[c]():f.thru(a)}return function(){var n=arguments,r=n[0];if(f&&1==n.length&&Go(r))return f.plant(r).value();for(var e=0,i=u?t[e].apply(this,n):r;++e<u;)i=t[e].call(this,i);return i}}))}function Wu(n,t,e,u,i,o,a,f,c,s){var h=t&l,p=1&t,v=2&t,_=24&t,g=512&t,d=v?r:Tu(n);return function l(){for(var y=arguments.length,m=an(y),b=y;b--;)m[b]=arguments[b];if(_)var w=fi(l),x=function(n,t){for(var r=n.length,e=0;r--;)n[r]===t&&++e;return e}(m,w);if(u&&(m=Su(m,u,i,_)),o&&(m=Eu(m,o,a,_)),y-=x,_&&y<s){var j=lr(m,w);return Ku(n,t,Wu,l.placeholder,e,m,j,f,c,s-y)}var k=p?e:this,A=v?k[n]:n;return y=m.length,f?m=function(n,t){var e=n.length,u=br(t.length,e),i=Ou(n);for(;u--;){var o=t[u];n[u]=mi(o,e)?i[o]:r}return n}(m,f):g&&y>1&&m.reverse(),h&&c<y&&(m.length=c),this&&this!==_t&&this instanceof l&&(A=d||Tu(A)),A.apply(k,m)}}function Uu(n,t){return function(r,e){return function(n,t,r,e){return we(n,(function(n,u,i){t(e,r(n),u,i)})),e}(r,n,t(e),{})}}function Du(n,t){return function(e,u){var i;if(e===r&&u===r)return t;if(e!==r&&(i=e),u!==r){if(i===r)return u;"string"==typeof e||"string"==typeof u?(e=lu(e),u=lu(u)):(e=cu(e),u=cu(u)),i=n(e,u)}return i}}function qu(n){return ei((function(t){return t=It(t,Xt(ci())),He((function(r){var e=this;return n(t,(function(n){return Mt(n,e,r)}))}))}))}function Gu(n,t){var e=(t=t===r?" ":lu(t)).length;if(e<2)return e?Ye(t,n):t;var u=Ye(t,gt(n/pr(t)));return ar(t)?xu(vr(u),0,n).join(""):u.slice(0,n)}function Zu(n){return function(t,e,u){return u&&"number"!=typeof u&&bi(t,e,u)&&(e=u=r),t=va(t),e===r?(e=t,t=0):e=va(e),function(n,t,r,e){for(var u=-1,i=mr(gt((t-n)/(r||1)),0),o=an(i);i--;)o[e?i:++u]=n,n+=r;return o}(t,e,u=u===r?t<e?1:-1:va(u),n)}}function Vu(n){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=da(t),r=da(r)),n(t,r)}}function Ku(n,t,e,u,i,o,a,l,s,h){var p=8&t;t|=p?f:c,4&(t&=~(p?c:f))||(t&=-4);var v=[n,t,i,p?o:r,p?a:r,p?r:o,p?r:a,l,s,h],_=e.apply(r,v);return xi(n)&&Oi(_,v),_.placeholder=u,zi(_,n,t)}function Ju(n){var t=Mn[n];return function(n,r){if(n=da(n),(r=null==r?0:br(_a(r),292))&&$t(n)){var e=(ma(n)+"e").split("e");return+((e=(ma(t(e[0]+"e"+(+e[1]+r)))+"e").split("e"))[0]+"e"+(+e[1]-r))}return t(n)}}var Yu=Sr&&1/sr(new Sr([,-0]))[1]==h?function(n){return new Sr(n)}:lf;function Hu(n){return function(t){var r=_i(t);return r==k?fr(t):r==E?hr(t):function(n,t){return It(t,(function(t){return[t,n[t]]}))}(t,n(t))}}function Qu(n,t,u,o,h,p,v,_){var g=2&t;if(!g&&"function"!=typeof n)throw new Pn(e);var d=o?o.length:0;if(d||(t&=-97,o=h=r),v=v===r?v:mr(_a(v),0),_=_===r?_:_a(_),d-=h?h.length:0,t&c){var y=o,m=h;o=h=r}var b=g?r:oi(n),w=[n,t,u,o,h,y,m,p,v,_];if(b&&function(n,t){var r=n[1],e=t[1],u=r|e,o=u<131,a=e==l&&8==r||e==l&&r==s&&n[7].length<=t[8]||384==e&&t[7].length<=t[8]&&8==r;if(!o&&!a)return n;1&e&&(n[2]=t[2],u|=1&r?0:4);var f=t[3];if(f){var c=n[3];n[3]=c?Su(c,f,t[4]):f,n[4]=c?lr(n[3],i):t[4]}(f=t[5])&&(c=n[5],n[5]=c?Eu(c,f,t[6]):f,n[6]=c?lr(n[5],i):t[6]);(f=t[7])&&(n[7]=f);e&l&&(n[8]=null==n[8]?t[8]:br(n[8],t[8]));null==n[9]&&(n[9]=t[9]);n[0]=t[0],n[1]=u}(w,b),n=w[0],t=w[1],u=w[2],o=w[3],h=w[4],!(_=w[9]=w[9]===r?g?0:n.length:mr(w[9]-d,0))&&24&t&&(t&=-25),t&&1!=t)x=8==t||t==a?function(n,t,e){var u=Tu(n);return function i(){for(var o=arguments.length,a=an(o),f=o,c=fi(i);f--;)a[f]=arguments[f];var l=o<3&&a[0]!==c&&a[o-1]!==c?[]:lr(a,c);return(o-=l.length)<e?Ku(n,t,Wu,i.placeholder,r,a,l,r,r,e-o):Mt(this&&this!==_t&&this instanceof i?u:n,this,a)}}(n,t,_):t!=f&&33!=t||h.length?Wu.apply(r,w):function(n,t,r,e){var u=1&t,i=Tu(n);return function t(){for(var o=-1,a=arguments.length,f=-1,c=e.length,l=an(c+a),s=this&&this!==_t&&this instanceof t?i:n;++f<c;)l[f]=e[f];for(;a--;)l[f++]=arguments[++o];return Mt(s,u?r:this,l)}}(n,t,u,o);else var x=function(n,t,r){var e=1&t,u=Tu(n);return function t(){return(this&&this!==_t&&this instanceof t?u:n).apply(e?r:this,arguments)}}(n,t,u);return zi((b?tu:Oi)(x,w),n,t)}function Xu(n,t,e,u){return n===r||Wo(n,Bn[e])&&!Rn.call(u,e)?t:n}function ni(n,t,e,u,i,o){return ta(n)&&ta(t)&&(o.set(t,n),De(n,t,r,ni,o),o.delete(t)),n}function ti(n){return ia(n)?r:n}function ri(n,t,e,u,i,o){var a=1&e,f=n.length,c=t.length;if(f!=c&&!(a&&c>f))return!1;var l=o.get(n),s=o.get(t);if(l&&s)return l==t&&s==n;var h=-1,p=!0,v=2&e?new Jr:r;for(o.set(n,t),o.set(t,n);++h<f;){var _=n[h],g=t[h];if(u)var d=a?u(g,_,h,t,n,o):u(_,g,h,n,t,o);if(d!==r){if(d)continue;p=!1;break}if(v){if(!Nt(t,(function(n,t){if(!tr(v,t)&&(_===n||i(_,n,e,u,o)))return v.push(t)}))){p=!1;break}}else if(_!==g&&!i(_,g,e,u,o)){p=!1;break}}return o.delete(n),o.delete(t),p}function ei(n){return Li(Mi(n,r,Gi),n+"")}function ui(n){return Ae(n,La,pi)}function ii(n){return Ae(n,za,vi)}var oi=Pr?function(n){return Pr.get(n)}:lf;function ai(n){for(var t=n.name+"",r=Lr[t],e=Rn.call(Lr,t)?r.length:0;e--;){var u=r[e],i=u.func;if(null==i||i==n)return u.name}return t}function fi(n){return(Rn.call(Wr,"placeholder")?Wr:n).placeholder}function ci(){var n=Wr.iteratee||of;return n=n===of?Ce:n,arguments.length?n(arguments[0],arguments[1]):n}function li(n,t){var r,e,u=n.__data__;return("string"==(e=typeof(r=t))||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==r:null===r)?u["string"==typeof t?"string":"hash"]:u.map}function si(n){for(var t=La(n),r=t.length;r--;){var e=t[r],u=n[e];t[r]=[e,u,Ai(u)]}return t}function hi(n,t){var e=function(n,t){return null==n?r:n[t]}(n,t);return Ie(e)?e:r}var pi=mt?function(n){return null==n?[]:(n=Sn(n),Lt(mt(n),(function(t){return Yn.call(n,t)})))}:df,vi=mt?function(n){for(var t=[];n;)Ct(t,pi(n)),n=Kn(n);return t}:df,_i=Fe;function gi(n,t,r){for(var e=-1,u=(t=bu(t,n)).length,i=!1;++e<u;){var o=Ri(t[e]);if(!(i=null!=n&&r(n,o)))break;n=n[o]}return i||++e!=u?i:!!(u=null==n?0:n.length)&&na(u)&&mi(o,u)&&(Go(n)||qo(n))}function di(n){return"function"!=typeof n.constructor||ki(n)?{}:Ur(Kn(n))}function yi(n){return Go(n)||qo(n)||!!(Qn&&n&&n[Qn])}function mi(n,t){var r=typeof n;return!!(t=null==t?p:t)&&("number"==r||"symbol"!=r&&bn.test(n))&&n>-1&&n%1==0&&n<t}function bi(n,t,r){if(!ta(r))return!1;var e=typeof t;return!!("number"==e?Vo(r)&&mi(t,r.length):"string"==e&&t in r)&&Wo(r[t],n)}function wi(n,t){if(Go(n))return!1;var r=typeof n;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=n&&!ca(n))||(tn.test(n)||!nn.test(n)||null!=t&&n in Sn(t))}function xi(n){var t=ai(n),r=Wr[t];if("function"!=typeof r||!(t in Gr.prototype))return!1;if(n===r)return!0;var e=oi(r);return!!e&&n===e[0]}(Ar&&_i(new Ar(new ArrayBuffer(1)))!=B||Fr&&_i(new Fr)!=k||Mr&&_i(Mr.resolve())!=M||Sr&&_i(new Sr)!=E||Er&&_i(new Er)!=L)&&(_i=function(n){var t=Fe(n),e=t==F?n.constructor:r,u=e?Ti(e):"";if(u)switch(u){case zr:return B;case Br:return k;case Ir:return M;case Cr:return E;case Rr:return L}return t});var ji=In?Qo:yf;function ki(n){var t=n&&n.constructor;return n===("function"==typeof t&&t.prototype||Bn)}function Ai(n){return n==n&&!ta(n)}function Fi(n,t){return function(e){return null!=e&&(e[n]===t&&(t!==r||n in Sn(e)))}}function Mi(n,t,e){return t=mr(t===r?n.length-1:t,0),function(){for(var r=arguments,u=-1,i=mr(r.length-t,0),o=an(i);++u<i;)o[u]=r[t+u];u=-1;for(var a=an(t+1);++u<t;)a[u]=r[u];return a[t]=e(o),Mt(n,this,a)}}function Si(n,t){return t.length<2?n:ke(n,uu(t,0,-1))}function Ei(n,t){if(("constructor"!==t||"function"!=typeof n[t])&&"__proto__"!=t)return n[t]}var Oi=Bi(tu),Pi=vt||function(n,t){return _t.setTimeout(n,t)},Li=Bi(ru);function zi(n,t,r){var e=t+"";return Li(n,function(n,t){var r=t.length;if(!r)return n;var e=r-1;return t[e]=(r>1?"& ":"")+t[e],t=t.join(r>2?", ":" "),n.replace(fn,"{\n/* [wrapped with "+t+"] */\n")}(e,function(n,t){return Et(g,(function(r){var e="_."+r[0];t&r[1]&&!zt(n,e)&&n.push(e)})),n.sort()}(function(n){var t=n.match(cn);return t?t[1].split(ln):[]}(e),r)))}function Bi(n){var t=0,e=0;return function(){var u=wr(),i=16-(u-e);if(e=u,i>0){if(++t>=800)return arguments[0]}else t=0;return n.apply(r,arguments)}}function Ii(n,t){var e=-1,u=n.length,i=u-1;for(t=t===r?u:t;++e<t;){var o=Je(e,i),a=n[o];n[o]=n[e],n[e]=a}return n.length=t,n}var Ci=function(n){var t=Io(n,(function(n){return 500===r.size&&r.clear(),n})),r=t.cache;return t}((function(n){var t=[];return 46===n.charCodeAt(0)&&t.push(""),n.replace(rn,(function(n,r,e,u){t.push(e?u.replace(pn,"$1"):r||n)})),t}));function Ri(n){if("string"==typeof n||ca(n))return n;var t=n+"";return"0"==t&&1/n==-1/0?"-0":t}function Ti(n){if(null!=n){try{return Cn.call(n)}catch(n){}try{return n+""}catch(n){}}return""}function Ni(n){if(n instanceof Gr)return n.clone();var t=new qr(n.__wrapped__,n.__chain__);return t.__actions__=Ou(n.__actions__),t.__index__=n.__index__,t.__values__=n.__values__,t}var $i=He((function(n,t){return Ko(n)?he(n,ye(t,1,Ko,!0)):[]})),Wi=He((function(n,t){var e=Yi(t);return Ko(e)&&(e=r),Ko(n)?he(n,ye(t,1,Ko,!0),ci(e,2)):[]})),Ui=He((function(n,t){var e=Yi(t);return Ko(e)&&(e=r),Ko(n)?he(n,ye(t,1,Ko,!0),r,e):[]}));function Di(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=null==r?0:_a(r);return u<0&&(u=mr(e+u,0)),Ut(n,ci(t,3),u)}function qi(n,t,e){var u=null==n?0:n.length;if(!u)return-1;var i=u-1;return e!==r&&(i=_a(e),i=e<0?mr(u+i,0):br(i,u-1)),Ut(n,ci(t,3),i,!0)}function Gi(n){return(null==n?0:n.length)?ye(n,1):[]}function Zi(n){return n&&n.length?n[0]:r}var Vi=He((function(n){var t=It(n,yu);return t.length&&t[0]===n[0]?Oe(t):[]})),Ki=He((function(n){var t=Yi(n),e=It(n,yu);return t===Yi(e)?t=r:e.pop(),e.length&&e[0]===n[0]?Oe(e,ci(t,2)):[]})),Ji=He((function(n){var t=Yi(n),e=It(n,yu);return(t="function"==typeof t?t:r)&&e.pop(),e.length&&e[0]===n[0]?Oe(e,r,t):[]}));function Yi(n){var t=null==n?0:n.length;return t?n[t-1]:r}var Hi=He(Qi);function Qi(n,t){return n&&n.length&&t&&t.length?Ve(n,t):n}var Xi=ei((function(n,t){var r=null==n?0:n.length,e=ae(n,t);return Ke(n,It(t,(function(n){return mi(n,r)?+n:n})).sort(Mu)),e}));function no(n){return null==n?n:kr.call(n)}var to=He((function(n){return su(ye(n,1,Ko,!0))})),ro=He((function(n){var t=Yi(n);return Ko(t)&&(t=r),su(ye(n,1,Ko,!0),ci(t,2))})),eo=He((function(n){var t=Yi(n);return t="function"==typeof t?t:r,su(ye(n,1,Ko,!0),r,t)}));function uo(n){if(!n||!n.length)return[];var t=0;return n=Lt(n,(function(n){if(Ko(n))return t=mr(n.length,t),!0})),Ht(t,(function(t){return It(n,Vt(t))}))}function io(n,t){if(!n||!n.length)return[];var e=uo(n);return null==t?e:It(e,(function(n){return Mt(t,r,n)}))}var oo=He((function(n,t){return Ko(n)?he(n,t):[]})),ao=He((function(n){return gu(Lt(n,Ko))})),fo=He((function(n){var t=Yi(n);return Ko(t)&&(t=r),gu(Lt(n,Ko),ci(t,2))})),co=He((function(n){var t=Yi(n);return t="function"==typeof t?t:r,gu(Lt(n,Ko),r,t)})),lo=He(uo);var so=He((function(n){var t=n.length,e=t>1?n[t-1]:r;return e="function"==typeof e?(n.pop(),e):r,io(n,e)}));function ho(n){var t=Wr(n);return t.__chain__=!0,t}function po(n,t){return t(n)}var vo=ei((function(n){var t=n.length,e=t?n[0]:0,u=this.__wrapped__,i=function(t){return ae(t,n)};return!(t>1||this.__actions__.length)&&u instanceof Gr&&mi(e)?((u=u.slice(e,+e+(t?1:0))).__actions__.push({func:po,args:[i],thisArg:r}),new qr(u,this.__chain__).thru((function(n){return t&&!n.length&&n.push(r),n}))):this.thru(i)}));var _o=Lu((function(n,t,r){Rn.call(n,r)?++n[r]:oe(n,r,1)}));var go=Nu(Di),yo=Nu(qi);function mo(n,t){return(Go(n)?Et:pe)(n,ci(t,3))}function bo(n,t){return(Go(n)?Ot:ve)(n,ci(t,3))}var wo=Lu((function(n,t,r){Rn.call(n,r)?n[r].push(t):oe(n,r,[t])}));var xo=He((function(n,t,r){var e=-1,u="function"==typeof t,i=Vo(n)?an(n.length):[];return pe(n,(function(n){i[++e]=u?Mt(t,n,r):Pe(n,t,r)})),i})),jo=Lu((function(n,t,r){oe(n,r,t)}));function ko(n,t){return(Go(n)?It:$e)(n,ci(t,3))}var Ao=Lu((function(n,t,r){n[r?0:1].push(t)}),(function(){return[[],[]]}));var Fo=He((function(n,t){if(null==n)return[];var r=t.length;return r>1&&bi(n,t[0],t[1])?t=[]:r>2&&bi(t[0],t[1],t[2])&&(t=[t[0]]),Ge(n,ye(t,1),[])})),Mo=pt||function(){return _t.Date.now()};function So(n,t,e){return t=e?r:t,t=n&&null==t?n.length:t,Qu(n,l,r,r,r,r,t)}function Eo(n,t){var u;if("function"!=typeof t)throw new Pn(e);return n=_a(n),function(){return--n>0&&(u=t.apply(this,arguments)),n<=1&&(t=r),u}}var Oo=He((function(n,t,r){var e=1;if(r.length){var u=lr(r,fi(Oo));e|=f}return Qu(n,e,t,r,u)})),Po=He((function(n,t,r){var e=3;if(r.length){var u=lr(r,fi(Po));e|=f}return Qu(t,e,n,r,u)}));function Lo(n,t,u){var i,o,a,f,c,l,s=0,h=!1,p=!1,v=!0;if("function"!=typeof n)throw new Pn(e);function _(t){var e=i,u=o;return i=o=r,s=t,f=n.apply(u,e)}function g(n){var e=n-l;return l===r||e>=t||e<0||p&&n-s>=a}function d(){var n=Mo();if(g(n))return y(n);c=Pi(d,function(n){var r=t-(n-l);return p?br(r,a-(n-s)):r}(n))}function y(n){return c=r,v&&i?_(n):(i=o=r,f)}function m(){var n=Mo(),e=g(n);if(i=arguments,o=this,l=n,e){if(c===r)return function(n){return s=n,c=Pi(d,t),h?_(n):f}(l);if(p)return ju(c),c=Pi(d,t),_(l)}return c===r&&(c=Pi(d,t)),f}return t=da(t)||0,ta(u)&&(h=!!u.leading,a=(p="maxWait"in u)?mr(da(u.maxWait)||0,t):a,v="trailing"in u?!!u.trailing:v),m.cancel=function(){c!==r&&ju(c),s=0,i=l=o=c=r},m.flush=function(){return c===r?f:y(Mo())},m}var zo=He((function(n,t){return se(n,1,t)})),Bo=He((function(n,t,r){return se(n,da(t)||0,r)}));function Io(n,t){if("function"!=typeof n||null!=t&&"function"!=typeof t)throw new Pn(e);var r=function(){var e=arguments,u=t?t.apply(this,e):e[0],i=r.cache;if(i.has(u))return i.get(u);var o=n.apply(this,e);return r.cache=i.set(u,o)||i,o};return r.cache=new(Io.Cache||Kr),r}function Co(n){if("function"!=typeof n)throw new Pn(e);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}Io.Cache=Kr;var Ro=wu((function(n,t){var r=(t=1==t.length&&Go(t[0])?It(t[0],Xt(ci())):It(ye(t,1),Xt(ci()))).length;return He((function(e){for(var u=-1,i=br(e.length,r);++u<i;)e[u]=t[u].call(this,e[u]);return Mt(n,this,e)}))})),To=He((function(n,t){var e=lr(t,fi(To));return Qu(n,f,r,t,e)})),No=He((function(n,t){var e=lr(t,fi(No));return Qu(n,c,r,t,e)})),$o=ei((function(n,t){return Qu(n,s,r,r,r,t)}));function Wo(n,t){return n===t||n!=n&&t!=t}var Uo=Vu(Me),Do=Vu((function(n,t){return n>=t})),qo=Le(function(){return arguments}())?Le:function(n){return ra(n)&&Rn.call(n,"callee")&&!Yn.call(n,"callee")},Go=an.isArray,Zo=wt?Xt(wt):function(n){return ra(n)&&Fe(n)==z};function Vo(n){return null!=n&&na(n.length)&&!Qo(n)}function Ko(n){return ra(n)&&Vo(n)}var Jo=bt||yf,Yo=xt?Xt(xt):function(n){return ra(n)&&Fe(n)==b};function Ho(n){if(!ra(n))return!1;var t=Fe(n);return t==w||"[object DOMException]"==t||"string"==typeof n.message&&"string"==typeof n.name&&!ia(n)}function Qo(n){if(!ta(n))return!1;var t=Fe(n);return t==x||t==j||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Xo(n){return"number"==typeof n&&n==_a(n)}function na(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=p}function ta(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function ra(n){return null!=n&&"object"==typeof n}var ea=jt?Xt(jt):function(n){return ra(n)&&_i(n)==k};function ua(n){return"number"==typeof n||ra(n)&&Fe(n)==A}function ia(n){if(!ra(n)||Fe(n)!=F)return!1;var t=Kn(n);if(null===t)return!0;var r=Rn.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Cn.call(r)==Wn}var oa=kt?Xt(kt):function(n){return ra(n)&&Fe(n)==S};var aa=At?Xt(At):function(n){return ra(n)&&_i(n)==E};function fa(n){return"string"==typeof n||!Go(n)&&ra(n)&&Fe(n)==O}function ca(n){return"symbol"==typeof n||ra(n)&&Fe(n)==P}var la=Ft?Xt(Ft):function(n){return ra(n)&&na(n.length)&&!!ft[Fe(n)]};var sa=Vu(Ne),ha=Vu((function(n,t){return n<=t}));function pa(n){if(!n)return[];if(Vo(n))return fa(n)?vr(n):Ou(n);if(Xn&&n[Xn])return function(n){for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r}(n[Xn]());var t=_i(n);return(t==k?fr:t==E?sr:Wa)(n)}function va(n){return n?(n=da(n))===h||n===-1/0?17976931348623157e292*(n<0?-1:1):n==n?n:0:0===n?n:0}function _a(n){var t=va(n),r=t%1;return t==t?r?t-r:t:0}function ga(n){return n?fe(_a(n),0,_):0}function da(n){if("number"==typeof n)return n;if(ca(n))return v;if(ta(n)){var t="function"==typeof n.valueOf?n.valueOf():n;n=ta(t)?t+"":t}if("string"!=typeof n)return 0===n?n:+n;n=Qt(n);var r=dn.test(n);return r||mn.test(n)?ht(n.slice(2),r?2:8):gn.test(n)?v:+n}function ya(n){return Pu(n,za(n))}function ma(n){return null==n?"":lu(n)}var ba=zu((function(n,t){if(ki(t)||Vo(t))Pu(t,La(t),n);else for(var r in t)Rn.call(t,r)&&re(n,r,t[r])})),wa=zu((function(n,t){Pu(t,za(t),n)})),xa=zu((function(n,t,r,e){Pu(t,za(t),n,e)})),ja=zu((function(n,t,r,e){Pu(t,La(t),n,e)})),ka=ei(ae);var Aa=He((function(n,t){n=Sn(n);var e=-1,u=t.length,i=u>2?t[2]:r;for(i&&bi(t[0],t[1],i)&&(u=1);++e<u;)for(var o=t[e],a=za(o),f=-1,c=a.length;++f<c;){var l=a[f],s=n[l];(s===r||Wo(s,Bn[l])&&!Rn.call(n,l))&&(n[l]=o[l])}return n})),Fa=He((function(n){return n.push(r,ni),Mt(Ia,r,n)}));function Ma(n,t,e){var u=null==n?r:ke(n,t);return u===r?e:u}function Sa(n,t){return null!=n&&gi(n,t,Ee)}var Ea=Uu((function(n,t,r){null!=t&&"function"!=typeof t.toString&&(t=$n.call(t)),n[t]=r}),tf(uf)),Oa=Uu((function(n,t,r){null!=t&&"function"!=typeof t.toString&&(t=$n.call(t)),Rn.call(n,t)?n[t].push(r):n[t]=[r]}),ci),Pa=He(Pe);function La(n){return Vo(n)?Hr(n):Re(n)}function za(n){return Vo(n)?Hr(n,!0):Te(n)}var Ba=zu((function(n,t,r){De(n,t,r)})),Ia=zu((function(n,t,r,e){De(n,t,r,e)})),Ca=ei((function(n,t){var r={};if(null==n)return r;var e=!1;t=It(t,(function(t){return t=bu(t,n),e||(e=t.length>1),t})),Pu(n,ii(n),r),e&&(r=ce(r,7,ti));for(var u=t.length;u--;)hu(r,t[u]);return r}));var Ra=ei((function(n,t){return null==n?{}:function(n,t){return Ze(n,t,(function(t,r){return Sa(n,r)}))}(n,t)}));function Ta(n,t){if(null==n)return{};var r=It(ii(n),(function(n){return[n]}));return t=ci(t),Ze(n,r,(function(n,r){return t(n,r[0])}))}var Na=Hu(La),$a=Hu(za);function Wa(n){return null==n?[]:nr(n,La(n))}var Ua=Ru((function(n,t,r){return t=t.toLowerCase(),n+(r?Da(t):t)}));function Da(n){return Ha(ma(n).toLowerCase())}function qa(n){return(n=ma(n))&&n.replace(wn,ur).replace(tt,"")}var Ga=Ru((function(n,t,r){return n+(r?"-":"")+t.toLowerCase()})),Za=Ru((function(n,t,r){return n+(r?" ":"")+t.toLowerCase()})),Va=Cu("toLowerCase");var Ka=Ru((function(n,t,r){return n+(r?"_":"")+t.toLowerCase()}));var Ja=Ru((function(n,t,r){return n+(r?" ":"")+Ha(t)}));var Ya=Ru((function(n,t,r){return n+(r?" ":"")+t.toUpperCase()})),Ha=Cu("toUpperCase");function Qa(n,t,e){return n=ma(n),(t=e?r:t)===r?function(n){return it.test(n)}(n)?function(n){return n.match(et)||[]}(n):function(n){return n.match(sn)||[]}(n):n.match(t)||[]}var Xa=He((function(n,t){try{return Mt(n,r,t)}catch(n){return Ho(n)?n:new An(n)}})),nf=ei((function(n,t){return Et(t,(function(t){t=Ri(t),oe(n,t,Oo(n[t],n))})),n}));function tf(n){return function(){return n}}var rf=$u(),ef=$u(!0);function uf(n){return n}function of(n){return Ce("function"==typeof n?n:ce(n,1))}var af=He((function(n,t){return function(r){return Pe(r,n,t)}})),ff=He((function(n,t){return function(r){return Pe(n,r,t)}}));function cf(n,t,r){var e=La(t),u=je(t,e);null!=r||ta(t)&&(u.length||!e.length)||(r=t,t=n,n=this,u=je(t,La(t)));var i=!(ta(r)&&"chain"in r&&!r.chain),o=Qo(n);return Et(u,(function(r){var e=t[r];n[r]=e,o&&(n.prototype[r]=function(){var t=this.__chain__;if(i||t){var r=n(this.__wrapped__);return(r.__actions__=Ou(this.__actions__)).push({func:e,args:arguments,thisArg:n}),r.__chain__=t,r}return e.apply(n,Ct([this.value()],arguments))})})),n}function lf(){}var sf=qu(It),hf=qu(Pt),pf=qu(Nt);function vf(n){return wi(n)?Vt(Ri(n)):function(n){return function(t){return ke(t,n)}}(n)}var _f=Zu(),gf=Zu(!0);function df(){return[]}function yf(){return!1}var mf=Du((function(n,t){return n+t}),0),bf=Ju("ceil"),wf=Du((function(n,t){return n/t}),1),xf=Ju("floor");var jf,kf=Du((function(n,t){return n*t}),1),Af=Ju("round"),Ff=Du((function(n,t){return n-t}),0);return Wr.after=function(n,t){if("function"!=typeof t)throw new Pn(e);return n=_a(n),function(){if(--n<1)return t.apply(this,arguments)}},Wr.ary=So,Wr.assign=ba,Wr.assignIn=wa,Wr.assignInWith=xa,Wr.assignWith=ja,Wr.at=ka,Wr.before=Eo,Wr.bind=Oo,Wr.bindAll=nf,Wr.bindKey=Po,Wr.castArray=function(){if(!arguments.length)return[];var n=arguments[0];return Go(n)?n:[n]},Wr.chain=ho,Wr.chunk=function(n,t,e){t=(e?bi(n,t,e):t===r)?1:mr(_a(t),0);var u=null==n?0:n.length;if(!u||t<1)return[];for(var i=0,o=0,a=an(gt(u/t));i<u;)a[o++]=uu(n,i,i+=t);return a},Wr.compact=function(n){for(var t=-1,r=null==n?0:n.length,e=0,u=[];++t<r;){var i=n[t];i&&(u[e++]=i)}return u},Wr.concat=function(){var n=arguments.length;if(!n)return[];for(var t=an(n-1),r=arguments[0],e=n;e--;)t[e-1]=arguments[e];return Ct(Go(r)?Ou(r):[r],ye(t,1))},Wr.cond=function(n){var t=null==n?0:n.length,r=ci();return n=t?It(n,(function(n){if("function"!=typeof n[1])throw new Pn(e);return[r(n[0]),n[1]]})):[],He((function(r){for(var e=-1;++e<t;){var u=n[e];if(Mt(u[0],this,r))return Mt(u[1],this,r)}}))},Wr.conforms=function(n){return function(n){var t=La(n);return function(r){return le(r,n,t)}}(ce(n,1))},Wr.constant=tf,Wr.countBy=_o,Wr.create=function(n,t){var r=Ur(n);return null==t?r:ie(r,t)},Wr.curry=function n(t,e,u){var i=Qu(t,8,r,r,r,r,r,e=u?r:e);return i.placeholder=n.placeholder,i},Wr.curryRight=function n(t,e,u){var i=Qu(t,a,r,r,r,r,r,e=u?r:e);return i.placeholder=n.placeholder,i},Wr.debounce=Lo,Wr.defaults=Aa,Wr.defaultsDeep=Fa,Wr.defer=zo,Wr.delay=Bo,Wr.difference=$i,Wr.differenceBy=Wi,Wr.differenceWith=Ui,Wr.drop=function(n,t,e){var u=null==n?0:n.length;return u?uu(n,(t=e||t===r?1:_a(t))<0?0:t,u):[]},Wr.dropRight=function(n,t,e){var u=null==n?0:n.length;return u?uu(n,0,(t=u-(t=e||t===r?1:_a(t)))<0?0:t):[]},Wr.dropRightWhile=function(n,t){return n&&n.length?vu(n,ci(t,3),!0,!0):[]},Wr.dropWhile=function(n,t){return n&&n.length?vu(n,ci(t,3),!0):[]},Wr.fill=function(n,t,e,u){var i=null==n?0:n.length;return i?(e&&"number"!=typeof e&&bi(n,t,e)&&(e=0,u=i),function(n,t,e,u){var i=n.length;for((e=_a(e))<0&&(e=-e>i?0:i+e),(u=u===r||u>i?i:_a(u))<0&&(u+=i),u=e>u?0:ga(u);e<u;)n[e++]=t;return n}(n,t,e,u)):[]},Wr.filter=function(n,t){return(Go(n)?Lt:de)(n,ci(t,3))},Wr.flatMap=function(n,t){return ye(ko(n,t),1)},Wr.flatMapDeep=function(n,t){return ye(ko(n,t),h)},Wr.flatMapDepth=function(n,t,e){return e=e===r?1:_a(e),ye(ko(n,t),e)},Wr.flatten=Gi,Wr.flattenDeep=function(n){return(null==n?0:n.length)?ye(n,h):[]},Wr.flattenDepth=function(n,t){return(null==n?0:n.length)?ye(n,t=t===r?1:_a(t)):[]},Wr.flip=function(n){return Qu(n,512)},Wr.flow=rf,Wr.flowRight=ef,Wr.fromPairs=function(n){for(var t=-1,r=null==n?0:n.length,e={};++t<r;){var u=n[t];e[u[0]]=u[1]}return e},Wr.functions=function(n){return null==n?[]:je(n,La(n))},Wr.functionsIn=function(n){return null==n?[]:je(n,za(n))},Wr.groupBy=wo,Wr.initial=function(n){return(null==n?0:n.length)?uu(n,0,-1):[]},Wr.intersection=Vi,Wr.intersectionBy=Ki,Wr.intersectionWith=Ji,Wr.invert=Ea,Wr.invertBy=Oa,Wr.invokeMap=xo,Wr.iteratee=of,Wr.keyBy=jo,Wr.keys=La,Wr.keysIn=za,Wr.map=ko,Wr.mapKeys=function(n,t){var r={};return t=ci(t,3),we(n,(function(n,e,u){oe(r,t(n,e,u),n)})),r},Wr.mapValues=function(n,t){var r={};return t=ci(t,3),we(n,(function(n,e,u){oe(r,e,t(n,e,u))})),r},Wr.matches=function(n){return We(ce(n,1))},Wr.matchesProperty=function(n,t){return Ue(n,ce(t,1))},Wr.memoize=Io,Wr.merge=Ba,Wr.mergeWith=Ia,Wr.method=af,Wr.methodOf=ff,Wr.mixin=cf,Wr.negate=Co,Wr.nthArg=function(n){return n=_a(n),He((function(t){return qe(t,n)}))},Wr.omit=Ca,Wr.omitBy=function(n,t){return Ta(n,Co(ci(t)))},Wr.once=function(n){return Eo(2,n)},Wr.orderBy=function(n,t,e,u){return null==n?[]:(Go(t)||(t=null==t?[]:[t]),Go(e=u?r:e)||(e=null==e?[]:[e]),Ge(n,t,e))},Wr.over=sf,Wr.overArgs=Ro,Wr.overEvery=hf,Wr.overSome=pf,Wr.partial=To,Wr.partialRight=No,Wr.partition=Ao,Wr.pick=Ra,Wr.pickBy=Ta,Wr.property=vf,Wr.propertyOf=function(n){return function(t){return null==n?r:ke(n,t)}},Wr.pull=Hi,Wr.pullAll=Qi,Wr.pullAllBy=function(n,t,r){return n&&n.length&&t&&t.length?Ve(n,t,ci(r,2)):n},Wr.pullAllWith=function(n,t,e){return n&&n.length&&t&&t.length?Ve(n,t,r,e):n},Wr.pullAt=Xi,Wr.range=_f,Wr.rangeRight=gf,Wr.rearg=$o,Wr.reject=function(n,t){return(Go(n)?Lt:de)(n,Co(ci(t,3)))},Wr.remove=function(n,t){var r=[];if(!n||!n.length)return r;var e=-1,u=[],i=n.length;for(t=ci(t,3);++e<i;){var o=n[e];t(o,e,n)&&(r.push(o),u.push(e))}return Ke(n,u),r},Wr.rest=function(n,t){if("function"!=typeof n)throw new Pn(e);return He(n,t=t===r?t:_a(t))},Wr.reverse=no,Wr.sampleSize=function(n,t,e){return t=(e?bi(n,t,e):t===r)?1:_a(t),(Go(n)?Xr:Xe)(n,t)},Wr.set=function(n,t,r){return null==n?n:nu(n,t,r)},Wr.setWith=function(n,t,e,u){return u="function"==typeof u?u:r,null==n?n:nu(n,t,e,u)},Wr.shuffle=function(n){return(Go(n)?ne:eu)(n)},Wr.slice=function(n,t,e){var u=null==n?0:n.length;return u?(e&&"number"!=typeof e&&bi(n,t,e)?(t=0,e=u):(t=null==t?0:_a(t),e=e===r?u:_a(e)),uu(n,t,e)):[]},Wr.sortBy=Fo,Wr.sortedUniq=function(n){return n&&n.length?fu(n):[]},Wr.sortedUniqBy=function(n,t){return n&&n.length?fu(n,ci(t,2)):[]},Wr.split=function(n,t,e){return e&&"number"!=typeof e&&bi(n,t,e)&&(t=e=r),(e=e===r?_:e>>>0)?(n=ma(n))&&("string"==typeof t||null!=t&&!oa(t))&&!(t=lu(t))&&ar(n)?xu(vr(n),0,e):n.split(t,e):[]},Wr.spread=function(n,t){if("function"!=typeof n)throw new Pn(e);return t=null==t?0:mr(_a(t),0),He((function(r){var e=r[t],u=xu(r,0,t);return e&&Ct(u,e),Mt(n,this,u)}))},Wr.tail=function(n){var t=null==n?0:n.length;return t?uu(n,1,t):[]},Wr.take=function(n,t,e){return n&&n.length?uu(n,0,(t=e||t===r?1:_a(t))<0?0:t):[]},Wr.takeRight=function(n,t,e){var u=null==n?0:n.length;return u?uu(n,(t=u-(t=e||t===r?1:_a(t)))<0?0:t,u):[]},Wr.takeRightWhile=function(n,t){return n&&n.length?vu(n,ci(t,3),!1,!0):[]},Wr.takeWhile=function(n,t){return n&&n.length?vu(n,ci(t,3)):[]},Wr.tap=function(n,t){return t(n),n},Wr.throttle=function(n,t,r){var u=!0,i=!0;if("function"!=typeof n)throw new Pn(e);return ta(r)&&(u="leading"in r?!!r.leading:u,i="trailing"in r?!!r.trailing:i),Lo(n,t,{leading:u,maxWait:t,trailing:i})},Wr.thru=po,Wr.toArray=pa,Wr.toPairs=Na,Wr.toPairsIn=$a,Wr.toPath=function(n){return Go(n)?It(n,Ri):ca(n)?[n]:Ou(Ci(ma(n)))},Wr.toPlainObject=ya,Wr.transform=function(n,t,r){var e=Go(n),u=e||Jo(n)||la(n);if(t=ci(t,4),null==r){var i=n&&n.constructor;r=u?e?new i:[]:ta(n)&&Qo(i)?Ur(Kn(n)):{}}return(u?Et:we)(n,(function(n,e,u){return t(r,n,e,u)})),r},Wr.unary=function(n){return So(n,1)},Wr.union=to,Wr.unionBy=ro,Wr.unionWith=eo,Wr.uniq=function(n){return n&&n.length?su(n):[]},Wr.uniqBy=function(n,t){return n&&n.length?su(n,ci(t,2)):[]},Wr.uniqWith=function(n,t){return t="function"==typeof t?t:r,n&&n.length?su(n,r,t):[]},Wr.unset=function(n,t){return null==n||hu(n,t)},Wr.unzip=uo,Wr.unzipWith=io,Wr.update=function(n,t,r){return null==n?n:pu(n,t,mu(r))},Wr.updateWith=function(n,t,e,u){return u="function"==typeof u?u:r,null==n?n:pu(n,t,mu(e),u)},Wr.values=Wa,Wr.valuesIn=function(n){return null==n?[]:nr(n,za(n))},Wr.without=oo,Wr.words=Qa,Wr.wrap=function(n,t){return To(mu(t),n)},Wr.xor=ao,Wr.xorBy=fo,Wr.xorWith=co,Wr.zip=lo,Wr.zipObject=function(n,t){return du(n||[],t||[],re)},Wr.zipObjectDeep=function(n,t){return du(n||[],t||[],nu)},Wr.zipWith=so,Wr.entries=Na,Wr.entriesIn=$a,Wr.extend=wa,Wr.extendWith=xa,cf(Wr,Wr),Wr.add=mf,Wr.attempt=Xa,Wr.camelCase=Ua,Wr.capitalize=Da,Wr.ceil=bf,Wr.clamp=function(n,t,e){return e===r&&(e=t,t=r),e!==r&&(e=(e=da(e))==e?e:0),t!==r&&(t=(t=da(t))==t?t:0),fe(da(n),t,e)},Wr.clone=function(n){return ce(n,4)},Wr.cloneDeep=function(n){return ce(n,5)},Wr.cloneDeepWith=function(n,t){return ce(n,5,t="function"==typeof t?t:r)},Wr.cloneWith=function(n,t){return ce(n,4,t="function"==typeof t?t:r)},Wr.conformsTo=function(n,t){return null==t||le(n,t,La(t))},Wr.deburr=qa,Wr.defaultTo=function(n,t){return null==n||n!=n?t:n},Wr.divide=wf,Wr.endsWith=function(n,t,e){n=ma(n),t=lu(t);var u=n.length,i=e=e===r?u:fe(_a(e),0,u);return(e-=t.length)>=0&&n.slice(e,i)==t},Wr.eq=Wo,Wr.escape=function(n){return(n=ma(n))&&Y.test(n)?n.replace(K,ir):n},Wr.escapeRegExp=function(n){return(n=ma(n))&&un.test(n)?n.replace(en,"\\$&"):n},Wr.every=function(n,t,e){var u=Go(n)?Pt:_e;return e&&bi(n,t,e)&&(t=r),u(n,ci(t,3))},Wr.find=go,Wr.findIndex=Di,Wr.findKey=function(n,t){return Wt(n,ci(t,3),we)},Wr.findLast=yo,Wr.findLastIndex=qi,Wr.findLastKey=function(n,t){return Wt(n,ci(t,3),xe)},Wr.floor=xf,Wr.forEach=mo,Wr.forEachRight=bo,Wr.forIn=function(n,t){return null==n?n:me(n,ci(t,3),za)},Wr.forInRight=function(n,t){return null==n?n:be(n,ci(t,3),za)},Wr.forOwn=function(n,t){return n&&we(n,ci(t,3))},Wr.forOwnRight=function(n,t){return n&&xe(n,ci(t,3))},Wr.get=Ma,Wr.gt=Uo,Wr.gte=Do,Wr.has=function(n,t){return null!=n&&gi(n,t,Se)},Wr.hasIn=Sa,Wr.head=Zi,Wr.identity=uf,Wr.includes=function(n,t,r,e){n=Vo(n)?n:Wa(n),r=r&&!e?_a(r):0;var u=n.length;return r<0&&(r=mr(u+r,0)),fa(n)?r<=u&&n.indexOf(t,r)>-1:!!u&&Dt(n,t,r)>-1},Wr.indexOf=function(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=null==r?0:_a(r);return u<0&&(u=mr(e+u,0)),Dt(n,t,u)},Wr.inRange=function(n,t,e){return t=va(t),e===r?(e=t,t=0):e=va(e),function(n,t,r){return n>=br(t,r)&&n<mr(t,r)}(n=da(n),t,e)},Wr.invoke=Pa,Wr.isArguments=qo,Wr.isArray=Go,Wr.isArrayBuffer=Zo,Wr.isArrayLike=Vo,Wr.isArrayLikeObject=Ko,Wr.isBoolean=function(n){return!0===n||!1===n||ra(n)&&Fe(n)==m},Wr.isBuffer=Jo,Wr.isDate=Yo,Wr.isElement=function(n){return ra(n)&&1===n.nodeType&&!ia(n)},Wr.isEmpty=function(n){if(null==n)return!0;if(Vo(n)&&(Go(n)||"string"==typeof n||"function"==typeof n.splice||Jo(n)||la(n)||qo(n)))return!n.length;var t=_i(n);if(t==k||t==E)return!n.size;if(ki(n))return!Re(n).length;for(var r in n)if(Rn.call(n,r))return!1;return!0},Wr.isEqual=function(n,t){return ze(n,t)},Wr.isEqualWith=function(n,t,e){var u=(e="function"==typeof e?e:r)?e(n,t):r;return u===r?ze(n,t,r,e):!!u},Wr.isError=Ho,Wr.isFinite=function(n){return"number"==typeof n&&$t(n)},Wr.isFunction=Qo,Wr.isInteger=Xo,Wr.isLength=na,Wr.isMap=ea,Wr.isMatch=function(n,t){return n===t||Be(n,t,si(t))},Wr.isMatchWith=function(n,t,e){return e="function"==typeof e?e:r,Be(n,t,si(t),e)},Wr.isNaN=function(n){return ua(n)&&n!=+n},Wr.isNative=function(n){if(ji(n))throw new An("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Ie(n)},Wr.isNil=function(n){return null==n},Wr.isNull=function(n){return null===n},Wr.isNumber=ua,Wr.isObject=ta,Wr.isObjectLike=ra,Wr.isPlainObject=ia,Wr.isRegExp=oa,Wr.isSafeInteger=function(n){return Xo(n)&&n>=-9007199254740991&&n<=p},Wr.isSet=aa,Wr.isString=fa,Wr.isSymbol=ca,Wr.isTypedArray=la,Wr.isUndefined=function(n){return n===r},Wr.isWeakMap=function(n){return ra(n)&&_i(n)==L},Wr.isWeakSet=function(n){return ra(n)&&"[object WeakSet]"==Fe(n)},Wr.join=function(n,t){return null==n?"":Kt.call(n,t)},Wr.kebabCase=Ga,Wr.last=Yi,Wr.lastIndexOf=function(n,t,e){var u=null==n?0:n.length;if(!u)return-1;var i=u;return e!==r&&(i=(i=_a(e))<0?mr(u+i,0):br(i,u-1)),t==t?function(n,t,r){for(var e=r+1;e--;)if(n[e]===t)return e;return e}(n,t,i):Ut(n,Gt,i,!0)},Wr.lowerCase=Za,Wr.lowerFirst=Va,Wr.lt=sa,Wr.lte=ha,Wr.max=function(n){return n&&n.length?ge(n,uf,Me):r},Wr.maxBy=function(n,t){return n&&n.length?ge(n,ci(t,2),Me):r},Wr.mean=function(n){return Zt(n,uf)},Wr.meanBy=function(n,t){return Zt(n,ci(t,2))},Wr.min=function(n){return n&&n.length?ge(n,uf,Ne):r},Wr.minBy=function(n,t){return n&&n.length?ge(n,ci(t,2),Ne):r},Wr.stubArray=df,Wr.stubFalse=yf,Wr.stubObject=function(){return{}},Wr.stubString=function(){return""},Wr.stubTrue=function(){return!0},Wr.multiply=kf,Wr.nth=function(n,t){return n&&n.length?qe(n,_a(t)):r},Wr.noConflict=function(){return _t._===this&&(_t._=Un),this},Wr.noop=lf,Wr.now=Mo,Wr.pad=function(n,t,r){n=ma(n);var e=(t=_a(t))?pr(n):0;if(!t||e>=t)return n;var u=(t-e)/2;return Gu(dt(u),r)+n+Gu(gt(u),r)},Wr.padEnd=function(n,t,r){n=ma(n);var e=(t=_a(t))?pr(n):0;return t&&e<t?n+Gu(t-e,r):n},Wr.padStart=function(n,t,r){n=ma(n);var e=(t=_a(t))?pr(n):0;return t&&e<t?Gu(t-e,r)+n:n},Wr.parseInt=function(n,t,r){return r||null==t?t=0:t&&(t=+t),xr(ma(n).replace(on,""),t||0)},Wr.random=function(n,t,e){if(e&&"boolean"!=typeof e&&bi(n,t,e)&&(t=e=r),e===r&&("boolean"==typeof t?(e=t,t=r):"boolean"==typeof n&&(e=n,n=r)),n===r&&t===r?(n=0,t=1):(n=va(n),t===r?(t=n,n=0):t=va(t)),n>t){var u=n;n=t,t=u}if(e||n%1||t%1){var i=jr();return br(n+i*(t-n+st("1e-"+((i+"").length-1))),t)}return Je(n,t)},Wr.reduce=function(n,t,r){var e=Go(n)?Rt:Jt,u=arguments.length<3;return e(n,ci(t,4),r,u,pe)},Wr.reduceRight=function(n,t,r){var e=Go(n)?Tt:Jt,u=arguments.length<3;return e(n,ci(t,4),r,u,ve)},Wr.repeat=function(n,t,e){return t=(e?bi(n,t,e):t===r)?1:_a(t),Ye(ma(n),t)},Wr.replace=function(){var n=arguments,t=ma(n[0]);return n.length<3?t:t.replace(n[1],n[2])},Wr.result=function(n,t,e){var u=-1,i=(t=bu(t,n)).length;for(i||(i=1,n=r);++u<i;){var o=null==n?r:n[Ri(t[u])];o===r&&(u=i,o=e),n=Qo(o)?o.call(n):o}return n},Wr.round=Af,Wr.runInContext=n,Wr.sample=function(n){return(Go(n)?Qr:Qe)(n)},Wr.size=function(n){if(null==n)return 0;if(Vo(n))return fa(n)?pr(n):n.length;var t=_i(n);return t==k||t==E?n.size:Re(n).length},Wr.snakeCase=Ka,Wr.some=function(n,t,e){var u=Go(n)?Nt:iu;return e&&bi(n,t,e)&&(t=r),u(n,ci(t,3))},Wr.sortedIndex=function(n,t){return ou(n,t)},Wr.sortedIndexBy=function(n,t,r){return au(n,t,ci(r,2))},Wr.sortedIndexOf=function(n,t){var r=null==n?0:n.length;if(r){var e=ou(n,t);if(e<r&&Wo(n[e],t))return e}return-1},Wr.sortedLastIndex=function(n,t){return ou(n,t,!0)},Wr.sortedLastIndexBy=function(n,t,r){return au(n,t,ci(r,2),!0)},Wr.sortedLastIndexOf=function(n,t){if(null==n?0:n.length){var r=ou(n,t,!0)-1;if(Wo(n[r],t))return r}return-1},Wr.startCase=Ja,Wr.startsWith=function(n,t,r){return n=ma(n),r=null==r?0:fe(_a(r),0,n.length),t=lu(t),n.slice(r,r+t.length)==t},Wr.subtract=Ff,Wr.sum=function(n){return n&&n.length?Yt(n,uf):0},Wr.sumBy=function(n,t){return n&&n.length?Yt(n,ci(t,2)):0},Wr.template=function(n,t,e){var u=Wr.templateSettings;e&&bi(n,t,e)&&(t=r),n=ma(n),t=xa({},t,u,Xu);var i,o,a=xa({},t.imports,u.imports,Xu),f=La(a),c=nr(a,f),l=0,s=t.interpolate||xn,h="__p += '",p=En((t.escape||xn).source+"|"+s.source+"|"+(s===X?vn:xn).source+"|"+(t.evaluate||xn).source+"|$","g"),v="//# sourceURL="+(Rn.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++at+"]")+"\n";n.replace(p,(function(t,r,e,u,a,f){return e||(e=u),h+=n.slice(l,f).replace(jn,or),r&&(i=!0,h+="' +\n__e("+r+") +\n'"),a&&(o=!0,h+="';\n"+a+";\n__p += '"),e&&(h+="' +\n((__t = ("+e+")) == null ? '' : __t) +\n'"),l=f+t.length,t})),h+="';\n";var _=Rn.call(t,"variable")&&t.variable;if(_){if(hn.test(_))throw new An("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(o?h.replace(q,""):h).replace(G,"$1").replace(Z,"$1;"),h="function("+(_||"obj")+") {\n"+(_?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var g=Xa((function(){return Fn(f,v+"return "+h).apply(r,c)}));if(g.source=h,Ho(g))throw g;return g},Wr.times=function(n,t){if((n=_a(n))<1||n>p)return[];var r=_,e=br(n,_);t=ci(t),n-=_;for(var u=Ht(e,t);++r<n;)t(r);return u},Wr.toFinite=va,Wr.toInteger=_a,Wr.toLength=ga,Wr.toLower=function(n){return ma(n).toLowerCase()},Wr.toNumber=da,Wr.toSafeInteger=function(n){return n?fe(_a(n),-9007199254740991,p):0===n?n:0},Wr.toString=ma,Wr.toUpper=function(n){return ma(n).toUpperCase()},Wr.trim=function(n,t,e){if((n=ma(n))&&(e||t===r))return Qt(n);if(!n||!(t=lu(t)))return n;var u=vr(n),i=vr(t);return xu(u,rr(u,i),er(u,i)+1).join("")},Wr.trimEnd=function(n,t,e){if((n=ma(n))&&(e||t===r))return n.slice(0,_r(n)+1);if(!n||!(t=lu(t)))return n;var u=vr(n);return xu(u,0,er(u,vr(t))+1).join("")},Wr.trimStart=function(n,t,e){if((n=ma(n))&&(e||t===r))return n.replace(on,"");if(!n||!(t=lu(t)))return n;var u=vr(n);return xu(u,rr(u,vr(t))).join("")},Wr.truncate=function(n,t){var e=30,u="...";if(ta(t)){var i="separator"in t?t.separator:i;e="length"in t?_a(t.length):e,u="omission"in t?lu(t.omission):u}var o=(n=ma(n)).length;if(ar(n)){var a=vr(n);o=a.length}if(e>=o)return n;var f=e-pr(u);if(f<1)return u;var c=a?xu(a,0,f).join(""):n.slice(0,f);if(i===r)return c+u;if(a&&(f+=c.length-f),oa(i)){if(n.slice(f).search(i)){var l,s=c;for(i.global||(i=En(i.source,ma(_n.exec(i))+"g")),i.lastIndex=0;l=i.exec(s);)var h=l.index;c=c.slice(0,h===r?f:h)}}else if(n.indexOf(lu(i),f)!=f){var p=c.lastIndexOf(i);p>-1&&(c=c.slice(0,p))}return c+u},Wr.unescape=function(n){return(n=ma(n))&&J.test(n)?n.replace(V,gr):n},Wr.uniqueId=function(n){var t=++Tn;return ma(n)+t},Wr.upperCase=Ya,Wr.upperFirst=Ha,Wr.each=mo,Wr.eachRight=bo,Wr.first=Zi,cf(Wr,(jf={},we(Wr,(function(n,t){Rn.call(Wr.prototype,t)||(jf[t]=n)})),jf),{chain:!1}),Wr.VERSION="4.17.21",Et(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(n){Wr[n].placeholder=Wr})),Et(["drop","take"],(function(n,t){Gr.prototype[n]=function(e){e=e===r?1:mr(_a(e),0);var u=this.__filtered__&&!t?new Gr(this):this.clone();return u.__filtered__?u.__takeCount__=br(e,u.__takeCount__):u.__views__.push({size:br(e,_),type:n+(u.__dir__<0?"Right":"")}),u},Gr.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}})),Et(["filter","map","takeWhile"],(function(n,t){var r=t+1,e=1==r||3==r;Gr.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:ci(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}})),Et(["head","last"],(function(n,t){var r="take"+(t?"Right":"");Gr.prototype[n]=function(){return this[r](1).value()[0]}})),Et(["initial","tail"],(function(n,t){var r="drop"+(t?"":"Right");Gr.prototype[n]=function(){return this.__filtered__?new Gr(this):this[r](1)}})),Gr.prototype.compact=function(){return this.filter(uf)},Gr.prototype.find=function(n){return this.filter(n).head()},Gr.prototype.findLast=function(n){return this.reverse().find(n)},Gr.prototype.invokeMap=He((function(n,t){return"function"==typeof n?new Gr(this):this.map((function(r){return Pe(r,n,t)}))})),Gr.prototype.reject=function(n){return this.filter(Co(ci(n)))},Gr.prototype.slice=function(n,t){n=_a(n);var e=this;return e.__filtered__&&(n>0||t<0)?new Gr(e):(n<0?e=e.takeRight(-n):n&&(e=e.drop(n)),t!==r&&(e=(t=_a(t))<0?e.dropRight(-t):e.take(t-n)),e)},Gr.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Gr.prototype.toArray=function(){return this.take(_)},we(Gr.prototype,(function(n,t){var e=/^(?:filter|find|map|reject)|While$/.test(t),u=/^(?:head|last)$/.test(t),i=Wr[u?"take"+("last"==t?"Right":""):t],o=u||/^find/.test(t);i&&(Wr.prototype[t]=function(){var t=this.__wrapped__,a=u?[1]:arguments,f=t instanceof Gr,c=a[0],l=f||Go(t),s=function(n){var t=i.apply(Wr,Ct([n],a));return u&&h?t[0]:t};l&&e&&"function"==typeof c&&1!=c.length&&(f=l=!1);var h=this.__chain__,p=!!this.__actions__.length,v=o&&!h,_=f&&!p;if(!o&&l){t=_?t:new Gr(this);var g=n.apply(t,a);return g.__actions__.push({func:po,args:[s],thisArg:r}),new qr(g,h)}return v&&_?n.apply(this,a):(g=this.thru(s),v?u?g.value()[0]:g.value():g)})})),Et(["pop","push","shift","sort","splice","unshift"],(function(n){var t=Ln[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);Wr.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(Go(u)?u:[],n)}return this[r]((function(r){return t.apply(Go(r)?r:[],n)}))}})),we(Gr.prototype,(function(n,t){var r=Wr[t];if(r){var e=r.name+"";Rn.call(Lr,e)||(Lr[e]=[]),Lr[e].push({name:t,func:r})}})),Lr[Wu(r,2).name]=[{name:"wrapper",func:r}],Gr.prototype.clone=function(){var n=new Gr(this.__wrapped__);return n.__actions__=Ou(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Ou(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Ou(this.__views__),n},Gr.prototype.reverse=function(){if(this.__filtered__){var n=new Gr(this);n.__dir__=-1,n.__filtered__=!0}else(n=this.clone()).__dir__*=-1;return n},Gr.prototype.value=function(){var n=this.__wrapped__.value(),t=this.__dir__,r=Go(n),e=t<0,u=r?n.length:0,i=function(n,t,r){var e=-1,u=r.length;for(;++e<u;){var i=r[e],o=i.size;switch(i.type){case"drop":n+=o;break;case"dropRight":t-=o;break;case"take":t=br(t,n+o);break;case"takeRight":n=mr(n,t-o)}}return{start:n,end:t}}(0,u,this.__views__),o=i.start,a=i.end,f=a-o,c=e?a:o-1,l=this.__iteratees__,s=l.length,h=0,p=br(f,this.__takeCount__);if(!r||!e&&u==f&&p==f)return _u(n,this.__actions__);var v=[];n:for(;f--&&h<p;){for(var _=-1,g=n[c+=t];++_<s;){var d=l[_],y=d.iteratee,m=d.type,b=y(g);if(2==m)g=b;else if(!b){if(1==m)continue n;break n}}v[h++]=g}return v},Wr.prototype.at=vo,Wr.prototype.chain=function(){return ho(this)},Wr.prototype.commit=function(){return new qr(this.value(),this.__chain__)},Wr.prototype.next=function(){this.__values__===r&&(this.__values__=pa(this.value()));var n=this.__index__>=this.__values__.length;return{done:n,value:n?r:this.__values__[this.__index__++]}},Wr.prototype.plant=function(n){for(var t,e=this;e instanceof Dr;){var u=Ni(e);u.__index__=0,u.__values__=r,t?i.__wrapped__=u:t=u;var i=u;e=e.__wrapped__}return i.__wrapped__=n,t},Wr.prototype.reverse=function(){var n=this.__wrapped__;if(n instanceof Gr){var t=n;return this.__actions__.length&&(t=new Gr(this)),(t=t.reverse()).__actions__.push({func:po,args:[no],thisArg:r}),new qr(t,this.__chain__)}return this.thru(no)},Wr.prototype.toJSON=Wr.prototype.valueOf=Wr.prototype.value=function(){return _u(this.__wrapped__,this.__actions__)},Wr.prototype.first=Wr.prototype.head,Xn&&(Wr.prototype[Xn]=function(){return this}),Wr}();dt?((dt.exports=dr)._=dr,gt._=dr):_t._=dr}).call(o)})),l=6371008.8,s={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:39.37*l,kilometers:6371.0088,kilometres:6371.0088,meters:l,metres:l,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:l/1852,radians:1,yards:6967335.223679999};
9
+ /**
10
+ * @license
11
+ * Lodash <https://lodash.com/>
12
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
13
+ * Released under MIT license <https://lodash.com/license>
14
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
15
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
16
+ */function h(n,t,r){void 0===r&&(r={});var e={type:"Feature"};return(0===r.id||r.id)&&(e.id=r.id),r.bbox&&(e.bbox=r.bbox),e.properties=t||{},e.geometry=n,e}function p(n,t,r){if(void 0===r&&(r={}),n.length<2)throw new Error("coordinates must be an array of two or more positions");return h({type:"LineString",coordinates:n},t,r)}function v(n){return n%360*Math.PI/180}function _(n){if(!n)throw new Error("coord is required");if(!Array.isArray(n)){if("Feature"===n.type&&null!==n.geometry&&"Point"===n.geometry.type)return n.geometry.coordinates;if("Point"===n.type)return n.coordinates}if(Array.isArray(n)&&n.length>=2&&!Array.isArray(n[0])&&!Array.isArray(n[1]))return n;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function g(n,t,r){void 0===r&&(r={});var e=_(n),u=_(t),i=v(u[1]-e[1]),o=v(u[0]-e[0]),a=v(e[1]),f=v(u[1]),c=Math.pow(Math.sin(i/2),2)+Math.pow(Math.sin(o/2),2)*Math.cos(a)*Math.cos(f);return function(n,t){void 0===t&&(t="kilometers");var r=s[t];if(!r)throw new Error(t+" units is invalid");return n*r}(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)),r.units)}function d(n,t,r){if(null!==n)for(var e,u,i,o,a,f,c,l,s=0,h=0,p=n.type,v="FeatureCollection"===p,_="Feature"===p,g=v?n.features.length:1,y=0;y<g;y++){a=(l=!!(c=v?n.features[y].geometry:_?n.geometry:n)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var m=0;m<a;m++){var b=0,w=0;if(null!==(o=l?c.geometries[m]:c)){f=o.coordinates;var x=o.type;switch(s=!r||"Polygon"!==x&&"MultiPolygon"!==x?0:1,x){case null:break;case"Point":if(!1===t(f,h,y,b,w))return!1;h++,b++;break;case"LineString":case"MultiPoint":for(e=0;e<f.length;e++){if(!1===t(f[e],h,y,b,w))return!1;h++,"MultiPoint"===x&&b++}"LineString"===x&&b++;break;case"Polygon":case"MultiLineString":for(e=0;e<f.length;e++){for(u=0;u<f[e].length-s;u++){if(!1===t(f[e][u],h,y,b,w))return!1;h++}"MultiLineString"===x&&b++,"Polygon"===x&&w++}"Polygon"===x&&b++;break;case"MultiPolygon":for(e=0;e<f.length;e++){for(w=0,u=0;u<f[e].length;u++){for(i=0;i<f[e][u].length-s;i++){if(!1===t(f[e][u][i],h,y,b,w))return!1;h++}w++}b++}break;case"GeometryCollection":for(e=0;e<o.geometries.length;e++)if(!1===d(o.geometries[e],t,r))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function y(n,t){!function(n,t){var r,e,u,i,o,a,f,c,l,s,h=0,p="FeatureCollection"===n.type,v="Feature"===n.type,_=p?n.features.length:1;for(r=0;r<_;r++){for(a=p?n.features[r].geometry:v?n.geometry:n,c=p?n.features[r].properties:v?n.properties:{},l=p?n.features[r].bbox:v?n.bbox:void 0,s=p?n.features[r].id:v?n.id:void 0,o=(f=!!a&&"GeometryCollection"===a.type)?a.geometries.length:1,u=0;u<o;u++)if(null!==(i=f?a.geometries[u]:a))switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===t(i,h,c,l,s))return!1;break;case"GeometryCollection":for(e=0;e<i.geometries.length;e++)if(!1===t(i.geometries[e],h,c,l,s))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===t(null,h,c,l,s))return!1;h++}}(n,(function(n,r,e,u,i){var o,a=null===n?null:n.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return!1!==t(h(n,e,{bbox:u,id:i}),r,0)&&void 0}switch(a){case"MultiPoint":o="Point";break;case"MultiLineString":o="LineString";break;case"MultiPolygon":o="Polygon"}for(var f=0;f<n.coordinates.length;f++){var c=n.coordinates[f];if(!1===t(h({type:o,coordinates:c},e),r,f))return!1}}))}function m(n,t){y(n,(function(n,r,e){var u=0;if(n.geometry){var i=n.geometry.type;if("Point"!==i&&"MultiPoint"!==i){var o,a=0,f=0,c=0;return!1!==d(n,(function(i,l,s,h,v){if(void 0===o||r>a||h>f||v>c)return o=i,a=r,f=h,c=v,void(u=0);var _=p([o,i],n.properties);if(!1===t(_,r,e,v,u))return!1;u++,o=i}))&&void 0}}}))}function b(n,t){return void 0===t&&(t={}),function(n,t,r){var e=r,u=!1;return m(n,(function(n,i,o,a,f){e=!1===u&&void 0===r?n:t(e,n,i,o,a,f),u=!0})),e}(n,(function(n,r){var e=r.geometry.coordinates;return n+g(e[0],e[1],t)}),0)}const w=c.extend({},u.default.modes.draw_line_string);const x=n=>{setTimeout((()=>{n.map&&n.map.doubleClickZoom&&n._ctx&&n._ctx.store&&n._ctx.store.getInitialConfigValue&&n._ctx.store.getInitialConfigValue("doubleClickZoom")&&n.map.doubleClickZoom.enable()}),0)};w.onSetup=function(n){const t=u.default.modes.draw_line_string.onSetup.call(this,n),r=this.newFeature({type:"Feature",properties:{meta:"radius"},geometry:{type:"Polygon",coordinates:[[]]}});return this.addFeature(r),{...t,circle:r}},w.clickAnywhere=function(n,t){return 1===n.currentVertexPosition?(n.line.addCoordinate(0,t.lngLat.lng,t.lngLat.lat),this.changeMode("simple_select",{featureIds:[n.line.id]})):(this.updateUIClasses({mouse:"add"}),n.line.updateCoordinate(n.currentVertexPosition,t.lngLat.lng,t.lngLat.lat),"forward"===n.direction?(n.currentVertexPosition+=1,n.line.updateCoordinate(n.currentVertexPosition,t.lngLat.lng,t.lngLat.lat)):n.line.addCoordinate(0,t.lngLat.lng,t.lngLat.lat),null)},w.onMouseMove=function(n,t){u.default.modes.draw_line_string.onMouseMove.call(this,n,t);const r=n.line.toGeoJSON(),e=r.geometry.coordinates[0],o=b(r,"kilometers"),a=this.map&&this.map.crs?this.map.crs.epsgCode:"EPSG:4326",f=function(n,t,r,e,u=64){if(e.includes("4326")){const e={latitude:n[1],longitude:n[0]},i=[],o=t/111.32,a=t/110.574;let f,c,l;for(let n=0;n<u;n+=1)f=n/u*(2*Math.PI),c=o*Math.cos(f),l=a*Math.sin(f),i.push([e.longitude+c,e.latitude+l]);return i.push(i[0]),{type:"Feature",geometry:{type:"Polygon",coordinates:[i]},properties:{parent:r}}}{const e={steps:64,units:"kilometers",properties:{parent:r}};return i.circle(n,t,e)}}(e,o,n.line.id,a);f.properties.meta="radius",n.circle.setCoordinates(f.geometry.coordinates)},w.onStop=function(n){x(this),this.activateUIButton(),void 0!==this.getFeature(n.line.id)&&(n.line.removeCoordinate("0"),n.circle.isValid()?this.map.fire("draw.create",{features:[n.circle.toGeoJSON()]}):this.changeMode("simple_select",{},{silent:!0}),this.deleteFeature([n.line.id],{silent:!0}))},w.toDisplayFeatures=function(n,t,r){const e=t.properties.id===n.line.id;if(t.properties.active=e?"true":"false",!e)return r(t);if(t.geometry.coordinates.length<2)return null;var u,i,o;t.properties.meta="feature",r((u=n.line.id,i=t.geometry.coordinates["forward"===n.direction?t.geometry.coordinates.length-2:1],o=""+("forward"===n.direction?t.geometry.coordinates.length-2:1),{type:"Feature",properties:{meta:"vertex",parent:u,coord_path:o,active:!1?"true":"false"},geometry:{type:"Point",coordinates:i}})),r(t);const a=function(n){const t=1e3*b(n);let r,e,u="m",i="0,0",o="feet",a="0,0";return r=t,t>=1e3&&(r=t/1e3,u="km",i="0.00"),e=3.28084*t,e>=5280&&(e/=5280,o="mi",a="0.00"),{metric:`${f(r).format(i)} ${u}`,standard:`${f(e).format(a)} ${o}`}}(t);return r({type:"Feature",properties:{meta:"currentPosition",radiusMetric:a.metric,radiusStandard:a.standard,parent:n.line.id},geometry:{type:"Point",coordinates:t.geometry.coordinates[1]}}),null},module.exports=w;
package/package.json CHANGED
@@ -1,24 +1,24 @@
1
- {
2
- "name": "@mapgis/mapbox-gl-draw-radius",
3
- "version": "16.2.0",
4
- "description": "",
5
- "main": "dist/radius-mode.min.js",
6
- "module": "src/radius-mode.js",
7
- "scripts": {
8
- "build": "rollup --config rollup.config.js"
9
- },
10
- "author": "",
11
- "license": "ISC",
12
- "dependencies": {
13
- "@mapgis/mapbox-gl-draw": "^16.1.0",
14
- "@turf/length": "^6.3.0",
15
- "lodash": "^4.17.21",
16
- "numeral": "^2.0.6"
17
- },
18
- "devDependencies": {
19
- "@rollup/plugin-commonjs": "^18.0.0",
20
- "rollup": "^2.46.0",
21
- "rollup-plugin-node-resolve": "^5.2.0",
22
- "rollup-plugin-terser": "^7.0.2"
23
- }
24
- }
1
+ {
2
+ "name": "@mapgis/mapbox-gl-draw-radius",
3
+ "version":"16.6.0",
4
+ "description": "",
5
+ "main": "dist/radius-mode.min.js",
6
+ "module": "src/radius-mode.js",
7
+ "scripts": {
8
+ "build": "rollup --config rollup.config.js"
9
+ },
10
+ "author": "",
11
+ "license": "ISC",
12
+ "dependencies": {
13
+ "@mapgis/mapbox-gl-draw": "^16.6.0",
14
+ "@turf/length": "^6.3.0",
15
+ "lodash": "^4.17.21",
16
+ "numeral": "^2.0.6"
17
+ },
18
+ "devDependencies": {
19
+ "@rollup/plugin-commonjs": "^18.0.0",
20
+ "rollup": "^2.46.0",
21
+ "rollup-plugin-node-resolve": "^5.2.0",
22
+ "rollup-plugin-terser": "^7.0.2"
23
+ }
24
+ }
@@ -50,10 +50,10 @@ function createGeoJSONCircle(
50
50
  const km = radiusInKm;
51
51
 
52
52
  const ret = [];
53
- // const distanceX = km / 111.32;
53
+ const distanceX = km / 111.32;
54
54
  // const distanceY = km / 110.574;
55
- const distanceX =
56
- km / (111.32 * Math.cos((coords.latitude * Math.PI) / 180));
55
+ // const distanceX =
56
+ // km / (111.32 * Math.cos((coords.latitude * Math.PI) / 180));
57
57
  const distanceY = km / 110.574;
58
58
 
59
59
  let theta;
@@ -223,17 +223,14 @@ RadiusMode.onStop = function (state) {
223
223
 
224
224
  // remove last added coordinate
225
225
  state.line.removeCoordinate("0");
226
- if (state.line.isValid()) {
227
- const geojson = state.line.toGeoJSON();
228
- this.deleteFeature([state.line.id], { silent: true });
229
-
226
+ if (state.circle.isValid()) {
230
227
  this.map.fire("draw.create", {
231
228
  features: [state.circle.toGeoJSON()],
232
229
  });
233
230
  } else {
234
- this.deleteFeature([state.line.id], { silent: true });
235
231
  this.changeMode("simple_select", {}, { silent: true });
236
232
  }
233
+ this.deleteFeature([state.line.id], { silent: true });
237
234
  };
238
235
 
239
236
  RadiusMode.toDisplayFeatures = function (state, geojson, display) {