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Km1B,MAAM,IAGR9P,EAGXiQ,OACI,OAAOt1B,KAAKQ,KAAK,GAGrB60B,IAAIE,GACA,MAAM,KAAC/0B,EAAI,QAAEy0B,GAAWj1B,KAClBo1B,EAAO50B,EAAK+0B,GAElB,KAAOA,EAAM,GAAG,CACZ,MAAMC,EAAUD,EAAM,GAAM,EACtBxjB,EAAUvR,EAAKg1B,GACrB,GAAIP,EAAQG,EAAMrjB,IAAY,EAAG,MACjCvR,EAAK+0B,GAAOxjB,EACZwjB,EAAMC,EAGVh1B,EAAK+0B,GAAOH,EAGhBD,MAAMI,GACF,MAAM,KAAC/0B,EAAI,QAAEy0B,GAAWj1B,KAClBy1B,EAAaz1B,KAAKqB,QAAU,EAC5B+zB,EAAO50B,EAAK+0B,GAElB,KAAOA,EAAME,GAAY,CACrB,IAAItQ,EAAoB,GAAZoQ,GAAO,GACfG,EAAOl1B,EAAK2kB,GAChB,MAAMC,EAAQD,EAAO,EAMrB,GAJIC,EAAQplB,KAAKqB,QAAU4zB,EAAQz0B,EAAK4kB,GAAQsQ,GAAQ,IACpDvQ,EAAOC,EACPsQ,EAAOl1B,EAAK4kB,IAEZ6P,EAAQS,EAAMN,IAAS,EAAG,MAE9B50B,EAAK+0B,GAAOG,EACZH,EAAMpQ,EAGV3kB,EAAK+0B,GAAOH,GAIpB,SAASF,EAAe/rB,EAAGC,GACvB,OAAOD,EAAIC,GAAK,EAAID,EAAIC,EAAI,EAAI,I,iEC5E7B,MAAMusB,E","sources":["webpack://@amcharts/amcharts5/./src/.internal/charts/map/MapSeries.ts","webpack://@amcharts/amcharts5/./node_modules/d3-array/src/fsum.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/math.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/noop.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/stream.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/length.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/distance.js","webpack://@amcharts/amcharts5/./src/.internal/charts/map/MapLine.ts","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/interpolate.js","webpack://@amcharts/amcharts5/./src/.internal/charts/map/MapLineSeries.ts","webpack://@amcharts/amcharts5/./node_modules/d3-array/src/range.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/graticule.js","webpack://@amcharts/amcharts5/./src/.internal/charts/map/GraticuleSeries.ts","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/compose.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/rotation.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/clip/buffer.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/pointEqual.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/clip/rejoin.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/cartesian.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/polygonContains.js","webpack://@amcharts/amcharts5/./node_modules/d3-array/src/merge.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/clip/index.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/clip/antimeridian.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/constant.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/circle.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/clip/circle.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/clip/rectangle.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/clip/line.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/identity.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/transform.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/path/bounds.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/projection/fit.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/projection/resample.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/projection/index.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/projection/mercator.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/path/area.js","webpack://@amcharts/amcharts5/./src/.internal/charts/map/MapChartDefaultTheme.ts","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/path/centroid.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/path/context.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/path/measure.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/path/string.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/centroid.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/area.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/bounds.js","webpack://@amcharts/amcharts5/./src/.internal/charts/map/MapUtils.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/map/MapChart.ts","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/path/index.js","webpack://@amcharts/amcharts5/./src/.internal/charts/map/MapPointSeries.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/map/MapPolygon.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/map/MapPolygonSeries.ts","webpack://@amcharts/amcharts5/./src/.internal/charts/map/ZoomControl.ts","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/projection/orthographic.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/projection/equirectangular.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/projection/conicEqualArea.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/projection/cylindricalEqualArea.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/projection/conic.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/projection/albersUsa.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/projection/albers.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/projection/azimuthal.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/projection/equalEarth.js","webpack://@amcharts/amcharts5/./node_modules/d3-geo/src/projection/naturalEarth1.js","webpack://@amcharts/amcharts5/./node_modules/polylabel/polylabel.js","webpack://@amcharts/amcharts5/./node_modules/tinyqueue/index.js","webpack://@amcharts/amcharts5/./tmp/webpack/map.js"],"sourcesContent":["import type { MapChart } from \"./MapChart\";\nimport type { GeoProjection, GeoPath } from \"d3-geo\";\n\nimport { Series, ISeriesSettings, ISeriesDataItem, ISeriesPrivate, ISeriesEvents } from \"../../core/render/Series\";\n\nimport * as $array from \"../../core/util/Array\";\nimport * as $object from \"../../core/util/Object\";\n\nexport interface IMapSeriesDataItem extends ISeriesDataItem {\n\tgeometry?: GeoJSON.Geometry;\n\tgeometryType?: GeoJSON.GeoJsonGeometryTypes;\n\tvalue?: number;\n}\n\nexport interface IMapSeriesSettings extends ISeriesSettings {\n\n\t/**\n\t * Map data in GeoJSON format.\n\t */\n\tgeoJSON?: GeoJSON.GeoJSON;\n\n\t/**\n\t * An array of map object ids from geodata to include in the map.\n\t *\n\t * If set, only those objects listed in `include` will be shown.\n\t */\n\tinclude?: Array;\n\n\t/**\n\t * An array of map object ids from geodata to omit when showing the map.\n\t */\n\texclude?: Array;\n\n\t/**\n\t * A field in series `data` that will hold map object's numeric value.\n\t *\n\t * It can be used in a number of places, e.g. tooltips, heat rules, etc.\n\t */\n\tvalueField?: string;\n\n\t/**\n\t * @ignore\n\t */\n\tgeometryField?: string;\n\n\t/**\n\t * @ignore\n\t */\n\tgeometryTypeField?: string;\n\n\t/**\n\t * Names of geodata items, such as countries, to replace by from loaded\n\t * geodata.\n\t *\n\t * Can be used to override built-in English names for countries.\n\t *\n\t * ```TypeScript\n\t * import am5geodata_lang_ES from '@amcharts5-geodata/lang/es';\n\t * // ...\n\t * map.geodataNames = am5geodata_lang_ES;\n\t * ```\n\t * ```JavaScript\n\t * map.geodataNames = am5geodata_lang_ES;\n\t * ```\n\t *\n\t * @since 5.1.13\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-translations/} for more info\n\t */\n\tgeodataNames?: { [index: string]: string };\n\n}\n\nexport interface IMapSeriesPrivate extends ISeriesPrivate {\n}\n\nexport interface IMapSeriesEvents extends ISeriesEvents {\n\n\t/**\n\t * Invoked when geodata is finished loading and processed.\n\t */\n\tgeodataprocessed: {};\n\n}\n\n/**\n * Base class for map series.\n */\nexport abstract class MapSeries extends Series {\n\tpublic static className: string = \"MapSeries\";\n\tpublic static classNames: Array = Series.classNames.concat([MapSeries.className]);\n\n\tdeclare public chart: MapChart | undefined;\n\tdeclare public _settings: IMapSeriesSettings;\n\tdeclare public _privateSettings: IMapSeriesPrivate;\n\tdeclare public _dataItemSettings: IMapSeriesDataItem;\n\tdeclare public _events: IMapSeriesEvents;\n\n\tprotected _types: Array = [];\n\n\tpublic _geometries: Array = [];\n\tprotected _geoJSONparsed: boolean = false;\n\n\tprotected _afterNew() {\n\t\tthis.fields.push(\"geometry\", \"geometryType\");\n\t\tthis._setRawDefault(\"geometryField\", \"geometry\");\n\t\tthis._setRawDefault(\"geometryTypeField\", \"geometryType\");\n\t\tthis._setRawDefault(\"idField\", \"id\");\n\n\t\tthis.on(\"geoJSON\", (geoJSON) => {\n\t\t\tlet previous = this._prevSettings.geoJSON;\n\t\t\tif (previous && previous != geoJSON) {\n\t\t\t\tthis.data.clear();\n\t\t\t}\n\t\t})\n\n\t\tsuper._afterNew();\n\t}\n\n\tpublic _prepareChildren() {\n\t\tsuper._prepareChildren();\n\n\t\tif (this._valuesDirty || this.isDirty(\"geoJSON\") || this.isDirty(\"include\") || this.isDirty(\"exclude\")) {\n\t\t\tconst geoJSON = this.get(\"geoJSON\");\n\t\t\tlet previous = this._prevSettings.geoJSON;\n\n\t\t\tif (previous && previous != geoJSON) {\n\t\t\t\tthis._prevSettings.geoJSON = undefined;\n\t\t\t\tthis._geoJSONparsed = false;\n\t\t\t}\n\n\t\t\tif (!this._geoJSONparsed) {\n\t\t\t\tthis._parseGeoJSON();\n\t\t\t\tthis._geoJSONparsed = true;\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected checkInclude(id: string, includes: string[] | undefined, excludes?: string[] | undefined): boolean {\n\t\tif (includes) {\n\t\t\tif (includes.length == 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (includes.indexOf(id) == -1) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (excludes && excludes.length > 0) {\n\t\t\tif (excludes.indexOf(id) != -1) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tprotected _parseGeoJSON() {\n\n\t\tconst geoJSON = this.get(\"geoJSON\");\n\t\tif (geoJSON) {\n\n\t\t\tlet features!: any[];\n\n\t\t\tif (geoJSON.type == \"FeatureCollection\") {\n\t\t\t\tfeatures = geoJSON.features;\n\t\t\t}\n\t\t\telse if (geoJSON.type == \"Feature\") {\n\t\t\t\tfeatures = [geoJSON];\n\t\t\t}\n\t\t\telse if ([\"Point\", \"LineString\", \"Polygon\", \"MultiPoint\", \"MultiLineString\", \"MultiPolygon\"].indexOf(geoJSON.type) != -1) {\n\t\t\t\tfeatures = [{ geometry: geoJSON }];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconsole.log(\"nothing found in geoJSON\");\n\t\t\t}\n\n\t\t\tconst geodataNames = this.get(\"geodataNames\");\n\t\t\tif (features) {\n\n\t\t\t\tfor (let i = 0, len = features.length; i < len; i++) {\n\t\t\t\t\tlet feature: any = features[i];\n\t\t\t\t\tlet geometry: any = feature.geometry;\n\n\t\t\t\t\tif (geometry) {\n\t\t\t\t\t\tlet type = geometry.type;\n\t\t\t\t\t\tlet id: string = feature.id;\n\n\t\t\t\t\t\tif (geodataNames && geodataNames[id]) {\n\t\t\t\t\t\t\tfeature.properties.name = geodataNames[id];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (this._types.indexOf(type) != -1) {\n\t\t\t\t\t\t\tif (!this.checkInclude(id, this.get(\"include\"), this.get(\"exclude\"))) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tlet dataItem: any;\n\n\t\t\t\t\t\t\tif (id != null) {\n\t\t\t\t\t\t\t\t// find data object in user-provided data\n\t\t\t\t\t\t\t\tdataItem = $array.find(this.dataItems, (value: any) => {\n\t\t\t\t\t\t\t\t\treturn value.get(\"id\") == id;\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tlet dataObject: any;\n\n\t\t\t\t\t\t\tif (dataItem) {\n\t\t\t\t\t\t\t\tdataObject = dataItem.dataContext;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// create one if not found\n\t\t\t\t\t\t\tif (!dataItem) {\n\t\t\t\t\t\t\t\tdataObject = { geometry: geometry, geometryType: type, id: id, madeFromGeoData: true };\n\t\t\t\t\t\t\t\tthis.data.push(dataObject);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// in case found\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t// if user-provided object doesn't have points data provided in any way:\n\t\t\t\t\t\t\t\tif (!dataObject.geometry) {\n\t\t\t\t\t\t\t\t\tdataObject.geometry = geometry;\n\t\t\t\t\t\t\t\t\tdataObject.geometryType = type;\n\t\t\t\t\t\t\t\t\tdataItem.set(\"geometry\", geometry);\n\t\t\t\t\t\t\t\t\tdataItem.set(\"geometryType\", type);\n\t\t\t\t\t\t\t\t\tthis.processDataItem(dataItem);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// copy properties data to datacontext\n\t\t\t\t\t\t\t$object.softCopyProperties(feature.properties, dataObject);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst type = \"geodataprocessed\";\n\t\t\tif (this.events.isEnabled(type)) {\n\t\t\t\tthis.events.dispatch(type, { type: type, target: this });\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic abstract markDirtyProjection(): void\n\n\tpublic _placeBulletsContainer(_chart: MapChart) {\n\t\tthis.children.moveValue(this.bulletsContainer);\n\t}\n\n\tpublic _removeBulletsContainer() {\n\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic projection(): GeoProjection | undefined {\n\t\tconst chart = this.chart;\n\t\tif (chart) {\n\t\t\treturn chart.get(\"projection\");\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic geoPath(): GeoPath | undefined {\n\t\tconst chart = this.chart;\n\t\tif (chart) {\n\t\t\treturn chart.getPrivate(\"geoPath\");\n\t\t}\n\t}\n\n\tprotected _addGeometry(geometry: any) {\n\t\tif (geometry) {\n\t\t\tthis._geometries.push(geometry);\n\n\t\t\tconst chart = this.chart;\n\t\t\tif (chart) {\n\t\t\t\tchart.markDirtyGeometries();\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _removeGeometry(geometry: any) {\n\t\tif (geometry) {\n\t\t\t$array.remove(this._geometries, geometry);\n\n\t\t\tconst chart = this.chart;\n\t\t\tif (chart) {\n\t\t\t\tchart.markDirtyGeometries();\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _dispose() {\n\t\tsuper._dispose();\n\n\t\tconst chart = this.chart;\n\t\tif (chart) {\n\t\t\tchart.series.removeValue(this);\n\t\t}\n\t}\n\n\tprotected _onDataClear() {\n\t\tsuper._onDataClear();\n\t\tthis._geoJSONparsed = false;\n\t}\t\t\n}\n","// https://github.com/python/cpython/blob/a74eea238f5baba15797e2e8b570d153bc8690a7/Modules/mathmodule.c#L1423\nexport class Adder {\n constructor() {\n this._partials = new Float64Array(32);\n this._n = 0;\n }\n add(x) {\n const p = this._partials;\n let i = 0;\n for (let j = 0; j < this._n && j < 32; j++) {\n const y = p[j],\n hi = x + y,\n lo = Math.abs(x) < Math.abs(y) ? x - (hi - y) : y - (hi - x);\n if (lo) p[i++] = lo;\n x = hi;\n }\n p[i] = x;\n this._n = i + 1;\n return this;\n }\n valueOf() {\n const p = this._partials;\n let n = this._n, x, y, lo, hi = 0;\n if (n > 0) {\n hi = p[--n];\n while (n > 0) {\n x = hi;\n y = p[--n];\n hi = x + y;\n lo = y - (hi - x);\n if (lo) break;\n }\n if (n > 0 && ((lo < 0 && p[n - 1] < 0) || (lo > 0 && p[n - 1] > 0))) {\n y = lo * 2;\n x = hi + y;\n if (y == x - hi) hi = x;\n }\n }\n return hi;\n }\n}\n\nexport function fsum(values, valueof) {\n const adder = new Adder();\n if (valueof === undefined) {\n for (let value of values) {\n if (value = +value) {\n adder.add(value);\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if (value = +valueof(value, ++index, values)) {\n adder.add(value);\n }\n }\n }\n return +adder;\n}\n\nexport function fcumsum(values, valueof) {\n const adder = new Adder();\n let index = -1;\n return Float64Array.from(values, valueof === undefined\n ? v => adder.add(+v || 0)\n : v => adder.add(+valueof(v, ++index, values) || 0)\n );\n}\n","export var epsilon = 1e-6;\nexport var epsilon2 = 1e-12;\nexport var pi = Math.PI;\nexport var halfPi = pi / 2;\nexport var quarterPi = pi / 4;\nexport var tau = pi * 2;\n\nexport var degrees = 180 / pi;\nexport var radians = pi / 180;\n\nexport var abs = Math.abs;\nexport var atan = Math.atan;\nexport var atan2 = Math.atan2;\nexport var cos = Math.cos;\nexport var ceil = Math.ceil;\nexport var exp = Math.exp;\nexport var floor = Math.floor;\nexport var hypot = Math.hypot;\nexport var log = Math.log;\nexport var pow = Math.pow;\nexport var sin = Math.sin;\nexport var sign = Math.sign || function(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; };\nexport var sqrt = Math.sqrt;\nexport var tan = Math.tan;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x > 1 ? halfPi : x < -1 ? -halfPi : Math.asin(x);\n}\n\nexport function haversin(x) {\n return (x = sin(x / 2)) * x;\n}\n","export default function noop() {}\n","function streamGeometry(geometry, stream) {\n if (geometry && streamGeometryType.hasOwnProperty(geometry.type)) {\n streamGeometryType[geometry.type](geometry, stream);\n }\n}\n\nvar streamObjectType = {\n Feature: function(object, stream) {\n streamGeometry(object.geometry, stream);\n },\n FeatureCollection: function(object, stream) {\n var features = object.features, i = -1, n = features.length;\n while (++i < n) streamGeometry(features[i].geometry, stream);\n }\n};\n\nvar streamGeometryType = {\n Sphere: function(object, stream) {\n stream.sphere();\n },\n Point: function(object, stream) {\n object = object.coordinates;\n stream.point(object[0], object[1], object[2]);\n },\n MultiPoint: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) object = coordinates[i], stream.point(object[0], object[1], object[2]);\n },\n LineString: function(object, stream) {\n streamLine(object.coordinates, stream, 0);\n },\n MultiLineString: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) streamLine(coordinates[i], stream, 0);\n },\n Polygon: function(object, stream) {\n streamPolygon(object.coordinates, stream);\n },\n MultiPolygon: function(object, stream) {\n var coordinates = object.coordinates, i = -1, n = coordinates.length;\n while (++i < n) streamPolygon(coordinates[i], stream);\n },\n GeometryCollection: function(object, stream) {\n var geometries = object.geometries, i = -1, n = geometries.length;\n while (++i < n) streamGeometry(geometries[i], stream);\n }\n};\n\nfunction streamLine(coordinates, stream, closed) {\n var i = -1, n = coordinates.length - closed, coordinate;\n stream.lineStart();\n while (++i < n) coordinate = coordinates[i], stream.point(coordinate[0], coordinate[1], coordinate[2]);\n stream.lineEnd();\n}\n\nfunction streamPolygon(coordinates, stream) {\n var i = -1, n = coordinates.length;\n stream.polygonStart();\n while (++i < n) streamLine(coordinates[i], stream, 1);\n stream.polygonEnd();\n}\n\nexport default function(object, stream) {\n if (object && streamObjectType.hasOwnProperty(object.type)) {\n streamObjectType[object.type](object, stream);\n } else {\n streamGeometry(object, stream);\n }\n}\n","import {Adder} from \"d3-array\";\nimport {abs, atan2, cos, radians, sin, sqrt} from \"./math.js\";\nimport noop from \"./noop.js\";\nimport stream from \"./stream.js\";\n\nvar lengthSum,\n lambda0,\n sinPhi0,\n cosPhi0;\n\nvar lengthStream = {\n sphere: noop,\n point: noop,\n lineStart: lengthLineStart,\n lineEnd: noop,\n polygonStart: noop,\n polygonEnd: noop\n};\n\nfunction lengthLineStart() {\n lengthStream.point = lengthPointFirst;\n lengthStream.lineEnd = lengthLineEnd;\n}\n\nfunction lengthLineEnd() {\n lengthStream.point = lengthStream.lineEnd = noop;\n}\n\nfunction lengthPointFirst(lambda, phi) {\n lambda *= radians, phi *= radians;\n lambda0 = lambda, sinPhi0 = sin(phi), cosPhi0 = cos(phi);\n lengthStream.point = lengthPoint;\n}\n\nfunction lengthPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var sinPhi = sin(phi),\n cosPhi = cos(phi),\n delta = abs(lambda - lambda0),\n cosDelta = cos(delta),\n sinDelta = sin(delta),\n x = cosPhi * sinDelta,\n y = cosPhi0 * sinPhi - sinPhi0 * cosPhi * cosDelta,\n z = sinPhi0 * sinPhi + cosPhi0 * cosPhi * cosDelta;\n lengthSum.add(atan2(sqrt(x * x + y * y), z));\n lambda0 = lambda, sinPhi0 = sinPhi, cosPhi0 = cosPhi;\n}\n\nexport default function(object) {\n lengthSum = new Adder();\n stream(object, lengthStream);\n return +lengthSum;\n}\n","import length from \"./length.js\";\n\nvar coordinates = [null, null],\n object = {type: \"LineString\", coordinates: coordinates};\n\nexport default function(a, b) {\n coordinates[0] = a;\n coordinates[1] = b;\n return length(object);\n}\n","import type { MapLineSeries } from \"./MapLineSeries\";\nimport type { IGeoPoint } from \"../../core/util/IGeoPoint\";\n\nimport { Graphics, IGraphicsSettings, IGraphicsPrivate } from \"../../core/render/Graphics\";\nimport { geoLength, geoInterpolate, geoDistance } from \"d3-geo\";\n\nexport interface IMapLineSettings extends IGraphicsSettings {\n\n\t/**\n\t * A GeoJSON representation of the polygons geometry.\n\t */\n\tgeometry?: GeoJSON.LineString | GeoJSON.MultiLineString;\n\n\t/**\n\t * @todo needs description\n\t * @default 0.5\n\t */\n\tprecision?: number;\n\n}\n\nexport interface IMapLinePrivate extends IGraphicsPrivate {\n\n\t/**\n\t * @ignore\n\t */\n\tseries: MapLineSeries;\n\n}\n\n/**\n * A line object in a [[MapLineSeries]].\n */\nexport class MapLine extends Graphics {\n\n\tdeclare public _settings: IMapLineSettings;\n\tdeclare public _privateSettings: IMapLinePrivate;\n\n\tpublic static className: string = \"MapLine\";\n\tpublic static classNames: Array = Graphics.classNames.concat([MapLine.className]);\n\tprotected _projectionDirty: boolean = false;\n\n\tpublic _beforeChanged() {\n\t\tsuper._beforeChanged();\n\n\t\tif (this._projectionDirty || this.isDirty(\"geometry\") || this.isDirty(\"precision\")) {\n\t\t\tconst geometry = this.get(\"geometry\")!;\n\t\t\tif (geometry) {\n\t\t\t\tconst series = this.getPrivate(\"series\");\n\t\t\t\tif (series) {\n\t\t\t\t\tconst chart = series.chart;\n\t\t\t\t\tif (chart) {\n\t\t\t\t\t\tconst projection = chart.get(\"projection\");\n\t\t\t\t\t\tlet clipAngle: number | null = null;\n\n\t\t\t\t\t\tif (projection) {\n\t\t\t\t\t\t\tclipAngle = projection.clipAngle();\n\t\t\t\t\t\t\tprojection.precision(this.get(\"precision\", 0.5));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst geoPath = chart.getPrivate(\"geoPath\");\n\t\t\t\t\t\tif (geoPath) {\n\t\t\t\t\t\t\tthis._clear = true;\n\n\t\t\t\t\t\t\tthis.set(\"draw\", (_display) => {\n\t\t\t\t\t\t\t\tif (projection && series.get(\"clipBack\") === false) {\n\t\t\t\t\t\t\t\t\tprojection.clipAngle(180);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tgeoPath.context(this._display as any);\n\t\t\t\t\t\t\t\tgeoPath(geometry);\n\t\t\t\t\t\t\t\tgeoPath.context(null);\n\n\t\t\t\t\t\t\t\tif (projection) {\n\t\t\t\t\t\t\t\t\tprojection.clipAngle(clipAngle as any);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic markDirtyProjection() {\n\t\tthis.markDirty();\n\t\tthis._projectionDirty = true;\n\t}\n\n\tpublic _clearDirty() {\n\t\tsuper._clearDirty();\n\t\tthis._projectionDirty = false;\n\t}\n\n\t/**\n\t * Converts relative position along the line (0-1) into pixel coordinates.\n\t *\n\t * @param position Position (0-1)\n\t * @return Coordinates\n\t */\n\tpublic positionToGeoPoint(position: number): IGeoPoint {\n\n\t\tconst geometry = this.get(\"geometry\")!;\n\n\t\tif (geometry) {\n\t\t\tlet totalDistance: number = geoLength(geometry);\n\t\t\tlet currentDistance: number = 0;\n\n\t\t\tlet distanceAB: number;\n\t\t\tlet positionA: number = 0;\n\t\t\tlet positionB: number = 0;\n\t\t\tlet pointA!: [number, number];\n\t\t\tlet pointB!: [number, number];\n\n\t\t\tlet coordinates = geometry.coordinates;\n\t\t\tif (coordinates) {\n\n\t\t\t\tlet segments!: number[][][];\n\n\t\t\t\tif (geometry.type == \"LineString\") {\n\t\t\t\t\tsegments = [coordinates] as number[][][];\n\t\t\t\t}\n\t\t\t\telse if (geometry.type == \"MultiLineString\") {\n\t\t\t\t\tsegments = coordinates as number[][][];\n\t\t\t\t}\n\n\t\t\t\tfor (let s = 0; s < segments.length; s++) {\n\t\t\t\t\tlet segment = segments[s];\n\t\t\t\t\tif (segment.length > 1) {\n\t\t\t\t\t\tfor (let p = 1; p < segment.length; p++) {\n\t\t\t\t\t\t\tpointA = segment[p - 1] as [number, number];\n\t\t\t\t\t\t\tpointB = segment[p] as [number, number];\n\n\t\t\t\t\t\t\tpositionA = currentDistance / totalDistance;\n\t\t\t\t\t\t\tdistanceAB = geoDistance(pointA, pointB);\n\t\t\t\t\t\t\tcurrentDistance += distanceAB;\n\t\t\t\t\t\t\tpositionB = currentDistance / totalDistance;\n\n\t\t\t\t\t\t\tif (positionA <= position && positionB > position) {\n\t\t\t\t\t\t\t\ts = segments.length;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (segment.length == 1) {\n\t\t\t\t\t\tpointA = segment[0] as [number, number];;\n\t\t\t\t\t\tpointB = segment[0] as [number, number];;\n\t\t\t\t\t\tpositionA = 0;\n\t\t\t\t\t\tpositionB = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (pointA && pointB) {\n\t\t\t\t\tlet positionAB: number = (position - positionA) / (positionB - positionA);\n\t\t\t\t\tlet location = geoInterpolate(pointA, pointB)(positionAB);\n\t\t\t\t\treturn { longitude: location[0], latitude: location[1] }\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn { longitude: 0, latitude: 0 };\n\t}\n}\n","import {asin, atan2, cos, degrees, haversin, radians, sin, sqrt} from \"./math.js\";\n\nexport default function(a, b) {\n var x0 = a[0] * radians,\n y0 = a[1] * radians,\n x1 = b[0] * radians,\n y1 = b[1] * radians,\n cy0 = cos(y0),\n sy0 = sin(y0),\n cy1 = cos(y1),\n sy1 = sin(y1),\n kx0 = cy0 * cos(x0),\n ky0 = cy0 * sin(x0),\n kx1 = cy1 * cos(x1),\n ky1 = cy1 * sin(x1),\n d = 2 * asin(sqrt(haversin(y1 - y0) + cy0 * cy1 * haversin(x1 - x0))),\n k = sin(d);\n\n var interpolate = d ? function(t) {\n var B = sin(t *= d) / k,\n A = sin(d - t) / k,\n x = A * kx0 + B * kx1,\n y = A * ky0 + B * ky1,\n z = A * sy0 + B * sy1;\n return [\n atan2(y, x) * degrees,\n atan2(z, sqrt(x * x + y * y)) * degrees\n ];\n } : function() {\n return [x0 * degrees, y0 * degrees];\n };\n\n interpolate.distance = d;\n\n return interpolate;\n}\n","import type { IMapPointSeriesDataItem } from \"./MapPointSeries\";\nimport type { DataItem } from \"../../core/render/Component\";\n\nimport { MapSeries, IMapSeriesSettings, IMapSeriesDataItem, IMapSeriesPrivate } from \"./MapSeries\";\nimport { MapLine } from \"./MapLine\";\nimport { ListTemplate } from \"../../core/util/List\";\nimport { Template } from \"../../core/util/Template\";\n\nimport * as $array from \"../../core/util/Array\";\n\n/**\n * @ignore\n */\nexport interface IMapLineSeriesPrivate extends IMapSeriesPrivate {\n}\n\nexport interface IMapLineSeriesDataItem extends IMapSeriesDataItem {\n\n\t/**\n\t * Related [[MapLine]] object.\n\t */\n\tmapLine?: MapLine;\n\n\t/**\n\t * GeoJSON geometry of the line.\n\t */\n\tgeometry?: GeoJSON.LineString | GeoJSON.MultiLineString;\n\n\t/**\n\t * An array of data items from [[MapPointSeries]] to use as line end-points.\n\t */\n\tpointsToConnect?: Array>;\n\n}\n\nexport interface IMapLineSeriesSettings extends IMapSeriesSettings {\n\n\t/**\n\t * If set to `true` will hide line segments that are in the invisible range\n\t * of the map.\n\t *\n\t * For example on the side of the globe facing away from the viewer when\n\t * used with Orthographic projection.\n\t *\n\t * NOTE: not all projections have invisible side.\n\t */\n\tclipBack?: boolean;\n\n}\n\n/**\n * Creates a map series for displaying lines on the map.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-line-series/} for more info\n * @important\n */\nexport class MapLineSeries extends MapSeries {\n\n\t/**\n\t * @ignore\n\t */\n\tpublic makeMapLine(dataItem: DataItem): MapLine {\n\t\tconst mapLine = this.children.push(this.mapLines.make());\n\t\tmapLine._setDataItem(dataItem);\n\t\tthis.mapLines.push(mapLine);\n\t\treturn mapLine;\n\t}\n\n\t/**\n\t * A [[ListTemplate]] of all lines in series.\n\t *\n\t * `mapLines.template` can also be used to configure lines.\n\t *\n\t * @default new ListTemplate\n\t */\n\tpublic readonly mapLines: ListTemplate = new ListTemplate(\n\t\tTemplate.new({}),\n\t\t() => MapLine._new(this._root, {}, [this.mapLines.template])\n\t);\n\n\tpublic static className: string = \"MapLineSeries\";\n\tpublic static classNames: Array = MapSeries.classNames.concat([MapLineSeries.className]);\n\n\tdeclare public _settings: IMapLineSeriesSettings;\n\tdeclare public _privateSettings: IMapLineSeriesPrivate;\n\tdeclare public _dataItemSettings: IMapLineSeriesDataItem;\n\n\tprotected _types: Array = [\"LineString\", \"MultiLineString\"];\n\n\t/**\n\t * @ignore\n\t */\n\tpublic markDirtyProjection() {\n\t\t$array.each(this.dataItems, (dataItem) => {\n\t\t\tlet mapLine = dataItem.get(\"mapLine\");\n\t\t\tif (mapLine) {\n\t\t\t\tmapLine.markDirtyProjection();\n\t\t\t}\n\t\t})\n\t}\n\n\tpublic _prepareChildren() {\n\t\tsuper._prepareChildren();\n\n\t\tif (this.isDirty(\"stroke\")) {\n\t\t\tthis.mapLines.template.set(\"stroke\", this.get(\"stroke\"));\n\t\t}\n\t}\n\n\tprotected processDataItem(dataItem: DataItem) {\n\t\tsuper.processDataItem(dataItem);\n\n\t\tlet mapLine = dataItem.get(\"mapLine\");\n\t\tif (!mapLine) {\n\t\t\tmapLine = this.makeMapLine(dataItem);\n\t\t}\n\n\t\tdataItem.set(\"mapLine\", mapLine);\n\t\tconst pointsToConnect = dataItem.get(\"pointsToConnect\");\n\t\tif (pointsToConnect) {\n\t\t\t$array.each(pointsToConnect, (point) => {\n\n\t\t\t\tpoint.on(\"geometry\", () => {\n\t\t\t\t\tthis.markDirtyValues(dataItem);\n\t\t\t\t})\n\n\t\t\t\tpoint.on(\"longitude\", () => {\n\t\t\t\t\tthis.markDirtyValues(dataItem);\n\t\t\t\t})\n\n\t\t\t\tpoint.on(\"latitude\", () => {\n\t\t\t\t\tthis.markDirtyValues(dataItem);\n\t\t\t\t})\n\t\t\t})\n\n\t\t\tthis.markDirtyValues(dataItem);\n\t\t}\n\n\t\tmapLine.setPrivate(\"series\", this);\n\t}\n\n\t/**\n\t * Forces a repaint of the element which relies on data.\n\t *\n\t * @since 5.0.21\n\t */\n\tpublic markDirtyValues(dataItem: DataItem) {\n\t\tsuper.markDirtyValues();\n\t\tif (dataItem) {\n\t\t\tconst mapLine = dataItem.get(\"mapLine\");\n\t\t\tif (mapLine) {\n\t\t\t\tconst pointsToConnect = dataItem.get(\"pointsToConnect\");\n\t\t\t\tif (pointsToConnect) {\n\t\t\t\t\tlet coordinates: Array> = [];\n\t\t\t\t\t$array.each(pointsToConnect, (point) => {\n\t\t\t\t\t\tconst longitude = point.get(\"longitude\");\n\t\t\t\t\t\tconst latitude = point.get(\"latitude\");\n\t\t\t\t\t\tif (longitude != null && latitude != null) {\n\t\t\t\t\t\t\tcoordinates.push([longitude, latitude]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tconst geometry = point.get(\"geometry\");\n\t\t\t\t\t\t\tif (geometry) {\n\t\t\t\t\t\t\t\tconst coords = geometry.coordinates;\n\t\t\t\t\t\t\t\tif (coords) {\n\t\t\t\t\t\t\t\t\tcoordinates.push([coords[0] as any, coords[1] as any]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\n\t\t\t\t\tlet geometry: any = { type: \"LineString\", coordinates: coordinates };\n\n\t\t\t\t\tdataItem.setRaw(\"geometry\", geometry);\n\t\t\t\t\tmapLine.set(\"geometry\", geometry);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmapLine.set(\"geometry\", dataItem.get(\"geometry\"));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic disposeDataItem(dataItem: DataItem) {\n\t\tsuper.disposeDataItem(dataItem);\n\t\tconst mapLine = dataItem.get(\"mapLine\");\n\t\tif (mapLine) {\n\t\t\tthis.mapLines.removeValue(mapLine);\n\t\t\tmapLine.dispose();\n\t\t}\n\t}\n}\n","export default function range(start, stop, step) {\n start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;\n\n var i = -1,\n n = Math.max(0, Math.ceil((stop - start) / step)) | 0,\n range = new Array(n);\n\n while (++i < n) {\n range[i] = start + i * step;\n }\n\n return range;\n}\n","import {range} from \"d3-array\";\nimport {abs, ceil, epsilon} from \"./math.js\";\n\nfunction graticuleX(y0, y1, dy) {\n var y = range(y0, y1 - epsilon, dy).concat(y1);\n return function(x) { return y.map(function(y) { return [x, y]; }); };\n}\n\nfunction graticuleY(x0, x1, dx) {\n var x = range(x0, x1 - epsilon, dx).concat(x1);\n return function(y) { return x.map(function(x) { return [x, y]; }); };\n}\n\nexport default function graticule() {\n var x1, x0, X1, X0,\n y1, y0, Y1, Y0,\n dx = 10, dy = dx, DX = 90, DY = 360,\n x, y, X, Y,\n precision = 2.5;\n\n function graticule() {\n return {type: \"MultiLineString\", coordinates: lines()};\n }\n\n function lines() {\n return range(ceil(X0 / DX) * DX, X1, DX).map(X)\n .concat(range(ceil(Y0 / DY) * DY, Y1, DY).map(Y))\n .concat(range(ceil(x0 / dx) * dx, x1, dx).filter(function(x) { return abs(x % DX) > epsilon; }).map(x))\n .concat(range(ceil(y0 / dy) * dy, y1, dy).filter(function(y) { return abs(y % DY) > epsilon; }).map(y));\n }\n\n graticule.lines = function() {\n return lines().map(function(coordinates) { return {type: \"LineString\", coordinates: coordinates}; });\n };\n\n graticule.outline = function() {\n return {\n type: \"Polygon\",\n coordinates: [\n X(X0).concat(\n Y(Y1).slice(1),\n X(X1).reverse().slice(1),\n Y(Y0).reverse().slice(1))\n ]\n };\n };\n\n graticule.extent = function(_) {\n if (!arguments.length) return graticule.extentMinor();\n return graticule.extentMajor(_).extentMinor(_);\n };\n\n graticule.extentMajor = function(_) {\n if (!arguments.length) return [[X0, Y0], [X1, Y1]];\n X0 = +_[0][0], X1 = +_[1][0];\n Y0 = +_[0][1], Y1 = +_[1][1];\n if (X0 > X1) _ = X0, X0 = X1, X1 = _;\n if (Y0 > Y1) _ = Y0, Y0 = Y1, Y1 = _;\n return graticule.precision(precision);\n };\n\n graticule.extentMinor = function(_) {\n if (!arguments.length) return [[x0, y0], [x1, y1]];\n x0 = +_[0][0], x1 = +_[1][0];\n y0 = +_[0][1], y1 = +_[1][1];\n if (x0 > x1) _ = x0, x0 = x1, x1 = _;\n if (y0 > y1) _ = y0, y0 = y1, y1 = _;\n return graticule.precision(precision);\n };\n\n graticule.step = function(_) {\n if (!arguments.length) return graticule.stepMinor();\n return graticule.stepMajor(_).stepMinor(_);\n };\n\n graticule.stepMajor = function(_) {\n if (!arguments.length) return [DX, DY];\n DX = +_[0], DY = +_[1];\n return graticule;\n };\n\n graticule.stepMinor = function(_) {\n if (!arguments.length) return [dx, dy];\n dx = +_[0], dy = +_[1];\n return graticule;\n };\n\n graticule.precision = function(_) {\n if (!arguments.length) return precision;\n precision = +_;\n x = graticuleX(y0, y1, 90);\n y = graticuleY(x0, x1, precision);\n X = graticuleX(Y0, Y1, 90);\n Y = graticuleY(X0, X1, precision);\n return graticule;\n };\n\n return graticule\n .extentMajor([[-180, -90 + epsilon], [180, 90 - epsilon]])\n .extentMinor([[-180, -80 - epsilon], [180, 80 + epsilon]]);\n}\n\nexport function graticule10() {\n return graticule()();\n}\n","import { MapLineSeries, IMapLineSeriesSettings, IMapLineSeriesPrivate, IMapLineSeriesDataItem } from \"./MapLineSeries\";\nimport type { DataItem } from \"../../core/render/Component\";\nimport { geoGraticule } from \"d3-geo\";\n\n\nexport interface IGraticuleSeriesDataItem extends IMapLineSeriesDataItem {\n}\n\nexport interface IGraticuleSeriesPrivate extends IMapLineSeriesPrivate {\n}\n\nexport interface IGraticuleSeriesSettings extends IMapLineSeriesSettings {\n\n\t/**\n\t * Place a grid line every Xth latitude/longitude.\n\t *\n\t * @default 10\n\t */\n\tstep?: number;\n}\n\n/**\n * A [[MapChart]] series to draw a map grid.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/graticule-series/} for more info\n * @important\n */\nexport class GraticuleSeries extends MapLineSeries {\n\n\tpublic static className: string = \"GraticuleSeries\";\n\tpublic static classNames: Array = MapLineSeries.classNames.concat([GraticuleSeries.className]);\n\n\tdeclare public _settings: IGraticuleSeriesSettings;\n\tdeclare public _privateSettings: IGraticuleSeriesPrivate;\n\n\tprotected _dataItem: DataItem = this.makeDataItem({});\n\n\tprotected _afterNew() {\n\t\tsuper._afterNew();\n\t\tthis.dataItems.push(this._dataItem);\n\t\tthis._generate();\n\t}\n\n\tpublic _updateChildren() {\n\t\tsuper._updateChildren();\n\n\t\tif (this.isDirty(\"step\")) {\n\t\t\tthis._generate();\n\t\t}\n\t}\n\n\tprotected _generate() {\n\t\tlet graticule = geoGraticule();\n\n\t\tif (graticule) {\n\t\t\tconst step = this.get(\"step\", 10);\n\n\t\t\tgraticule.stepMinor([360, 360]);\n\t\t\tgraticule.stepMajor([step, step]);\n\t\t\tthis._dataItem.set(\"geometry\", graticule());\n\t\t}\n\t}\n}\n","export default function(a, b) {\n\n function compose(x, y) {\n return x = a(x, y), b(x[0], x[1]);\n }\n\n if (a.invert && b.invert) compose.invert = function(x, y) {\n return x = b.invert(x, y), x && a.invert(x[0], x[1]);\n };\n\n return compose;\n}\n","import compose from \"./compose.js\";\nimport {abs, asin, atan2, cos, degrees, pi, radians, sin, tau} from \"./math.js\";\n\nfunction rotationIdentity(lambda, phi) {\n return [abs(lambda) > pi ? lambda + Math.round(-lambda / tau) * tau : lambda, phi];\n}\n\nrotationIdentity.invert = rotationIdentity;\n\nexport function rotateRadians(deltaLambda, deltaPhi, deltaGamma) {\n return (deltaLambda %= tau) ? (deltaPhi || deltaGamma ? compose(rotationLambda(deltaLambda), rotationPhiGamma(deltaPhi, deltaGamma))\n : rotationLambda(deltaLambda))\n : (deltaPhi || deltaGamma ? rotationPhiGamma(deltaPhi, deltaGamma)\n : rotationIdentity);\n}\n\nfunction forwardRotationLambda(deltaLambda) {\n return function(lambda, phi) {\n return lambda += deltaLambda, [lambda > pi ? lambda - tau : lambda < -pi ? lambda + tau : lambda, phi];\n };\n}\n\nfunction rotationLambda(deltaLambda) {\n var rotation = forwardRotationLambda(deltaLambda);\n rotation.invert = forwardRotationLambda(-deltaLambda);\n return rotation;\n}\n\nfunction rotationPhiGamma(deltaPhi, deltaGamma) {\n var cosDeltaPhi = cos(deltaPhi),\n sinDeltaPhi = sin(deltaPhi),\n cosDeltaGamma = cos(deltaGamma),\n sinDeltaGamma = sin(deltaGamma);\n\n function rotation(lambda, phi) {\n var cosPhi = cos(phi),\n x = cos(lambda) * cosPhi,\n y = sin(lambda) * cosPhi,\n z = sin(phi),\n k = z * cosDeltaPhi + x * sinDeltaPhi;\n return [\n atan2(y * cosDeltaGamma - k * sinDeltaGamma, x * cosDeltaPhi - z * sinDeltaPhi),\n asin(k * cosDeltaGamma + y * sinDeltaGamma)\n ];\n }\n\n rotation.invert = function(lambda, phi) {\n var cosPhi = cos(phi),\n x = cos(lambda) * cosPhi,\n y = sin(lambda) * cosPhi,\n z = sin(phi),\n k = z * cosDeltaGamma - y * sinDeltaGamma;\n return [\n atan2(y * cosDeltaGamma + z * sinDeltaGamma, x * cosDeltaPhi + k * sinDeltaPhi),\n asin(k * cosDeltaPhi - x * sinDeltaPhi)\n ];\n };\n\n return rotation;\n}\n\nexport default function(rotate) {\n rotate = rotateRadians(rotate[0] * radians, rotate[1] * radians, rotate.length > 2 ? rotate[2] * radians : 0);\n\n function forward(coordinates) {\n coordinates = rotate(coordinates[0] * radians, coordinates[1] * radians);\n return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;\n }\n\n forward.invert = function(coordinates) {\n coordinates = rotate.invert(coordinates[0] * radians, coordinates[1] * radians);\n return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;\n };\n\n return forward;\n}\n","import noop from \"../noop.js\";\n\nexport default function() {\n var lines = [],\n line;\n return {\n point: function(x, y, m) {\n line.push([x, y, m]);\n },\n lineStart: function() {\n lines.push(line = []);\n },\n lineEnd: noop,\n rejoin: function() {\n if (lines.length > 1) lines.push(lines.pop().concat(lines.shift()));\n },\n result: function() {\n var result = lines;\n lines = [];\n line = null;\n return result;\n }\n };\n}\n","import {abs, epsilon} from \"./math.js\";\n\nexport default function(a, b) {\n return abs(a[0] - b[0]) < epsilon && abs(a[1] - b[1]) < epsilon;\n}\n","import pointEqual from \"../pointEqual.js\";\nimport {epsilon} from \"../math.js\";\n\nfunction Intersection(point, points, other, entry) {\n this.x = point;\n this.z = points;\n this.o = other; // another intersection\n this.e = entry; // is an entry?\n this.v = false; // visited\n this.n = this.p = null; // next & previous\n}\n\n// A generalized polygon clipping algorithm: given a polygon that has been cut\n// into its visible line segments, and rejoins the segments by interpolating\n// along the clip edge.\nexport default function(segments, compareIntersection, startInside, interpolate, stream) {\n var subject = [],\n clip = [],\n i,\n n;\n\n segments.forEach(function(segment) {\n if ((n = segment.length - 1) <= 0) return;\n var n, p0 = segment[0], p1 = segment[n], x;\n\n if (pointEqual(p0, p1)) {\n if (!p0[2] && !p1[2]) {\n stream.lineStart();\n for (i = 0; i < n; ++i) stream.point((p0 = segment[i])[0], p0[1]);\n stream.lineEnd();\n return;\n }\n // handle degenerate cases by moving the point\n p1[0] += 2 * epsilon;\n }\n\n subject.push(x = new Intersection(p0, segment, null, true));\n clip.push(x.o = new Intersection(p0, null, x, false));\n subject.push(x = new Intersection(p1, segment, null, false));\n clip.push(x.o = new Intersection(p1, null, x, true));\n });\n\n if (!subject.length) return;\n\n clip.sort(compareIntersection);\n link(subject);\n link(clip);\n\n for (i = 0, n = clip.length; i < n; ++i) {\n clip[i].e = startInside = !startInside;\n }\n\n var start = subject[0],\n points,\n point;\n\n while (1) {\n // Find first unvisited intersection.\n var current = start,\n isSubject = true;\n while (current.v) if ((current = current.n) === start) return;\n points = current.z;\n stream.lineStart();\n do {\n current.v = current.o.v = true;\n if (current.e) {\n if (isSubject) {\n for (i = 0, n = points.length; i < n; ++i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.n.x, 1, stream);\n }\n current = current.n;\n } else {\n if (isSubject) {\n points = current.p.z;\n for (i = points.length - 1; i >= 0; --i) stream.point((point = points[i])[0], point[1]);\n } else {\n interpolate(current.x, current.p.x, -1, stream);\n }\n current = current.p;\n }\n current = current.o;\n points = current.z;\n isSubject = !isSubject;\n } while (!current.v);\n stream.lineEnd();\n }\n}\n\nfunction link(array) {\n if (!(n = array.length)) return;\n var n,\n i = 0,\n a = array[0],\n b;\n while (++i < n) {\n a.n = b = array[i];\n b.p = a;\n a = b;\n }\n a.n = b = array[0];\n b.p = a;\n}\n","import {asin, atan2, cos, sin, sqrt} from \"./math.js\";\n\nexport function spherical(cartesian) {\n return [atan2(cartesian[1], cartesian[0]), asin(cartesian[2])];\n}\n\nexport function cartesian(spherical) {\n var lambda = spherical[0], phi = spherical[1], cosPhi = cos(phi);\n return [cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi)];\n}\n\nexport function cartesianDot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n\nexport function cartesianCross(a, b) {\n return [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]];\n}\n\n// TODO return a\nexport function cartesianAddInPlace(a, b) {\n a[0] += b[0], a[1] += b[1], a[2] += b[2];\n}\n\nexport function cartesianScale(vector, k) {\n return [vector[0] * k, vector[1] * k, vector[2] * k];\n}\n\n// TODO return d\nexport function cartesianNormalizeInPlace(d) {\n var l = sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);\n d[0] /= l, d[1] /= l, d[2] /= l;\n}\n","import {Adder} from \"d3-array\";\nimport {cartesian, cartesianCross, cartesianNormalizeInPlace} from \"./cartesian.js\";\nimport {abs, asin, atan2, cos, epsilon, epsilon2, halfPi, pi, quarterPi, sign, sin, tau} from \"./math.js\";\n\nfunction longitude(point) {\n return abs(point[0]) <= pi ? point[0] : sign(point[0]) * ((abs(point[0]) + pi) % tau - pi);\n}\n\nexport default function(polygon, point) {\n var lambda = longitude(point),\n phi = point[1],\n sinPhi = sin(phi),\n normal = [sin(lambda), -cos(lambda), 0],\n angle = 0,\n winding = 0;\n\n var sum = new Adder();\n\n if (sinPhi === 1) phi = halfPi + epsilon;\n else if (sinPhi === -1) phi = -halfPi - epsilon;\n\n for (var i = 0, n = polygon.length; i < n; ++i) {\n if (!(m = (ring = polygon[i]).length)) continue;\n var ring,\n m,\n point0 = ring[m - 1],\n lambda0 = longitude(point0),\n phi0 = point0[1] / 2 + quarterPi,\n sinPhi0 = sin(phi0),\n cosPhi0 = cos(phi0);\n\n for (var j = 0; j < m; ++j, lambda0 = lambda1, sinPhi0 = sinPhi1, cosPhi0 = cosPhi1, point0 = point1) {\n var point1 = ring[j],\n lambda1 = longitude(point1),\n phi1 = point1[1] / 2 + quarterPi,\n sinPhi1 = sin(phi1),\n cosPhi1 = cos(phi1),\n delta = lambda1 - lambda0,\n sign = delta >= 0 ? 1 : -1,\n absDelta = sign * delta,\n antimeridian = absDelta > pi,\n k = sinPhi0 * sinPhi1;\n\n sum.add(atan2(k * sign * sin(absDelta), cosPhi0 * cosPhi1 + k * cos(absDelta)));\n angle += antimeridian ? delta + sign * tau : delta;\n\n // Are the longitudes either side of the point’s meridian (lambda),\n // and are the latitudes smaller than the parallel (phi)?\n if (antimeridian ^ lambda0 >= lambda ^ lambda1 >= lambda) {\n var arc = cartesianCross(cartesian(point0), cartesian(point1));\n cartesianNormalizeInPlace(arc);\n var intersection = cartesianCross(normal, arc);\n cartesianNormalizeInPlace(intersection);\n var phiArc = (antimeridian ^ delta >= 0 ? -1 : 1) * asin(intersection[2]);\n if (phi > phiArc || phi === phiArc && (arc[0] || arc[1])) {\n winding += antimeridian ^ delta >= 0 ? 1 : -1;\n }\n }\n }\n }\n\n // First, determine whether the South pole is inside or outside:\n //\n // It is inside if:\n // * the polygon winds around it in a clockwise direction.\n // * the polygon does not (cumulatively) wind around it, but has a negative\n // (counter-clockwise) area.\n //\n // Second, count the (signed) number of times a segment crosses a lambda\n // from the point to the South pole. If it is zero, then the point is the\n // same side as the South pole.\n\n return (angle < -epsilon || angle < epsilon && sum < -epsilon2) ^ (winding & 1);\n}\n","function* flatten(arrays) {\n for (const array of arrays) {\n yield* array;\n }\n}\n\nexport default function merge(arrays) {\n return Array.from(flatten(arrays));\n}\n","import clipBuffer from \"./buffer.js\";\nimport clipRejoin from \"./rejoin.js\";\nimport {epsilon, halfPi} from \"../math.js\";\nimport polygonContains from \"../polygonContains.js\";\nimport {merge} from \"d3-array\";\n\nexport default function(pointVisible, clipLine, interpolate, start) {\n return function(sink) {\n var line = clipLine(sink),\n ringBuffer = clipBuffer(),\n ringSink = clipLine(ringBuffer),\n polygonStarted = false,\n polygon,\n segments,\n ring;\n\n var clip = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: function() {\n clip.point = pointRing;\n clip.lineStart = ringStart;\n clip.lineEnd = ringEnd;\n segments = [];\n polygon = [];\n },\n polygonEnd: function() {\n clip.point = point;\n clip.lineStart = lineStart;\n clip.lineEnd = lineEnd;\n segments = merge(segments);\n var startInside = polygonContains(polygon, start);\n if (segments.length) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n clipRejoin(segments, compareIntersection, startInside, interpolate, sink);\n } else if (startInside) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n sink.lineStart();\n interpolate(null, null, 1, sink);\n sink.lineEnd();\n }\n if (polygonStarted) sink.polygonEnd(), polygonStarted = false;\n segments = polygon = null;\n },\n sphere: function() {\n sink.polygonStart();\n sink.lineStart();\n interpolate(null, null, 1, sink);\n sink.lineEnd();\n sink.polygonEnd();\n }\n };\n\n function point(lambda, phi) {\n if (pointVisible(lambda, phi)) sink.point(lambda, phi);\n }\n\n function pointLine(lambda, phi) {\n line.point(lambda, phi);\n }\n\n function lineStart() {\n clip.point = pointLine;\n line.lineStart();\n }\n\n function lineEnd() {\n clip.point = point;\n line.lineEnd();\n }\n\n function pointRing(lambda, phi) {\n ring.push([lambda, phi]);\n ringSink.point(lambda, phi);\n }\n\n function ringStart() {\n ringSink.lineStart();\n ring = [];\n }\n\n function ringEnd() {\n pointRing(ring[0][0], ring[0][1]);\n ringSink.lineEnd();\n\n var clean = ringSink.clean(),\n ringSegments = ringBuffer.result(),\n i, n = ringSegments.length, m,\n segment,\n point;\n\n ring.pop();\n polygon.push(ring);\n ring = null;\n\n if (!n) return;\n\n // No intersections.\n if (clean & 1) {\n segment = ringSegments[0];\n if ((m = segment.length - 1) > 0) {\n if (!polygonStarted) sink.polygonStart(), polygonStarted = true;\n sink.lineStart();\n for (i = 0; i < m; ++i) sink.point((point = segment[i])[0], point[1]);\n sink.lineEnd();\n }\n return;\n }\n\n // Rejoin connected segments.\n // TODO reuse ringBuffer.rejoin()?\n if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));\n\n segments.push(ringSegments.filter(validSegment));\n }\n\n return clip;\n };\n}\n\nfunction validSegment(segment) {\n return segment.length > 1;\n}\n\n// Intersections are sorted along the clip edge. For both antimeridian cutting\n// and circle clipping, the same comparison is used.\nfunction compareIntersection(a, b) {\n return ((a = a.x)[0] < 0 ? a[1] - halfPi - epsilon : halfPi - a[1])\n - ((b = b.x)[0] < 0 ? b[1] - halfPi - epsilon : halfPi - b[1]);\n}\n","import clip from \"./index.js\";\nimport {abs, atan, cos, epsilon, halfPi, pi, sin} from \"../math.js\";\n\nexport default clip(\n function() { return true; },\n clipAntimeridianLine,\n clipAntimeridianInterpolate,\n [-pi, -halfPi]\n);\n\n// Takes a line and cuts into visible segments. Return values: 0 - there were\n// intersections or the line was empty; 1 - no intersections; 2 - there were\n// intersections, and the first and last segments should be rejoined.\nfunction clipAntimeridianLine(stream) {\n var lambda0 = NaN,\n phi0 = NaN,\n sign0 = NaN,\n clean; // no intersections\n\n return {\n lineStart: function() {\n stream.lineStart();\n clean = 1;\n },\n point: function(lambda1, phi1) {\n var sign1 = lambda1 > 0 ? pi : -pi,\n delta = abs(lambda1 - lambda0);\n if (abs(delta - pi) < epsilon) { // line crosses a pole\n stream.point(lambda0, phi0 = (phi0 + phi1) / 2 > 0 ? halfPi : -halfPi);\n stream.point(sign0, phi0);\n stream.lineEnd();\n stream.lineStart();\n stream.point(sign1, phi0);\n stream.point(lambda1, phi0);\n clean = 0;\n } else if (sign0 !== sign1 && delta >= pi) { // line crosses antimeridian\n if (abs(lambda0 - sign0) < epsilon) lambda0 -= sign0 * epsilon; // handle degeneracies\n if (abs(lambda1 - sign1) < epsilon) lambda1 -= sign1 * epsilon;\n phi0 = clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1);\n stream.point(sign0, phi0);\n stream.lineEnd();\n stream.lineStart();\n stream.point(sign1, phi0);\n clean = 0;\n }\n stream.point(lambda0 = lambda1, phi0 = phi1);\n sign0 = sign1;\n },\n lineEnd: function() {\n stream.lineEnd();\n lambda0 = phi0 = NaN;\n },\n clean: function() {\n return 2 - clean; // if intersections, rejoin first and last segments\n }\n };\n}\n\nfunction clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1) {\n var cosPhi0,\n cosPhi1,\n sinLambda0Lambda1 = sin(lambda0 - lambda1);\n return abs(sinLambda0Lambda1) > epsilon\n ? atan((sin(phi0) * (cosPhi1 = cos(phi1)) * sin(lambda1)\n - sin(phi1) * (cosPhi0 = cos(phi0)) * sin(lambda0))\n / (cosPhi0 * cosPhi1 * sinLambda0Lambda1))\n : (phi0 + phi1) / 2;\n}\n\nfunction clipAntimeridianInterpolate(from, to, direction, stream) {\n var phi;\n if (from == null) {\n phi = direction * halfPi;\n stream.point(-pi, phi);\n stream.point(0, phi);\n stream.point(pi, phi);\n stream.point(pi, 0);\n stream.point(pi, -phi);\n stream.point(0, -phi);\n stream.point(-pi, -phi);\n stream.point(-pi, 0);\n stream.point(-pi, phi);\n } else if (abs(from[0] - to[0]) > epsilon) {\n var lambda = from[0] < to[0] ? pi : -pi;\n phi = direction * lambda / 2;\n stream.point(-lambda, phi);\n stream.point(0, phi);\n stream.point(lambda, phi);\n } else {\n stream.point(to[0], to[1]);\n }\n}\n","export default function(x) {\n return function() {\n return x;\n };\n}\n","import {cartesian, cartesianNormalizeInPlace, spherical} from \"./cartesian.js\";\nimport constant from \"./constant.js\";\nimport {acos, cos, degrees, epsilon, radians, sin, tau} from \"./math.js\";\nimport {rotateRadians} from \"./rotation.js\";\n\n// Generates a circle centered at [0°, 0°], with a given radius and precision.\nexport function circleStream(stream, radius, delta, direction, t0, t1) {\n if (!delta) return;\n var cosRadius = cos(radius),\n sinRadius = sin(radius),\n step = direction * delta;\n if (t0 == null) {\n t0 = radius + direction * tau;\n t1 = radius - step / 2;\n } else {\n t0 = circleRadius(cosRadius, t0);\n t1 = circleRadius(cosRadius, t1);\n if (direction > 0 ? t0 < t1 : t0 > t1) t0 += direction * tau;\n }\n for (var point, t = t0; direction > 0 ? t > t1 : t < t1; t -= step) {\n point = spherical([cosRadius, -sinRadius * cos(t), -sinRadius * sin(t)]);\n stream.point(point[0], point[1]);\n }\n}\n\n// Returns the signed angle of a cartesian point relative to [cosRadius, 0, 0].\nfunction circleRadius(cosRadius, point) {\n point = cartesian(point), point[0] -= cosRadius;\n cartesianNormalizeInPlace(point);\n var radius = acos(-point[1]);\n return ((-point[2] < 0 ? -radius : radius) + tau - epsilon) % tau;\n}\n\nexport default function() {\n var center = constant([0, 0]),\n radius = constant(90),\n precision = constant(6),\n ring,\n rotate,\n stream = {point: point};\n\n function point(x, y) {\n ring.push(x = rotate(x, y));\n x[0] *= degrees, x[1] *= degrees;\n }\n\n function circle() {\n var c = center.apply(this, arguments),\n r = radius.apply(this, arguments) * radians,\n p = precision.apply(this, arguments) * radians;\n ring = [];\n rotate = rotateRadians(-c[0] * radians, -c[1] * radians, 0).invert;\n circleStream(stream, r, p, 1);\n c = {type: \"Polygon\", coordinates: [ring]};\n ring = rotate = null;\n return c;\n }\n\n circle.center = function(_) {\n return arguments.length ? (center = typeof _ === \"function\" ? _ : constant([+_[0], +_[1]]), circle) : center;\n };\n\n circle.radius = function(_) {\n return arguments.length ? (radius = typeof _ === \"function\" ? _ : constant(+_), circle) : radius;\n };\n\n circle.precision = function(_) {\n return arguments.length ? (precision = typeof _ === \"function\" ? _ : constant(+_), circle) : precision;\n };\n\n return circle;\n}\n","import {cartesian, cartesianAddInPlace, cartesianCross, cartesianDot, cartesianScale, spherical} from \"../cartesian.js\";\nimport {circleStream} from \"../circle.js\";\nimport {abs, cos, epsilon, pi, radians, sqrt} from \"../math.js\";\nimport pointEqual from \"../pointEqual.js\";\nimport clip from \"./index.js\";\n\nexport default function(radius) {\n var cr = cos(radius),\n delta = 6 * radians,\n smallRadius = cr > 0,\n notHemisphere = abs(cr) > epsilon; // TODO optimise for this common case\n\n function interpolate(from, to, direction, stream) {\n circleStream(stream, radius, delta, direction, from, to);\n }\n\n function visible(lambda, phi) {\n return cos(lambda) * cos(phi) > cr;\n }\n\n // Takes a line and cuts into visible segments. Return values used for polygon\n // clipping: 0 - there were intersections or the line was empty; 1 - no\n // intersections 2 - there were intersections, and the first and last segments\n // should be rejoined.\n function clipLine(stream) {\n var point0, // previous point\n c0, // code for previous point\n v0, // visibility of previous point\n v00, // visibility of first point\n clean; // no intersections\n return {\n lineStart: function() {\n v00 = v0 = false;\n clean = 1;\n },\n point: function(lambda, phi) {\n var point1 = [lambda, phi],\n point2,\n v = visible(lambda, phi),\n c = smallRadius\n ? v ? 0 : code(lambda, phi)\n : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n if (!point0 && (v00 = v0 = v)) stream.lineStart();\n if (v !== v0) {\n point2 = intersect(point0, point1);\n if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2))\n point1[2] = 1;\n }\n if (v !== v0) {\n clean = 0;\n if (v) {\n // outside going in\n stream.lineStart();\n point2 = intersect(point1, point0);\n stream.point(point2[0], point2[1]);\n } else {\n // inside going out\n point2 = intersect(point0, point1);\n stream.point(point2[0], point2[1], 2);\n stream.lineEnd();\n }\n point0 = point2;\n } else if (notHemisphere && point0 && smallRadius ^ v) {\n var t;\n // If the codes for two points are different, or are both zero,\n // and there this segment intersects with the small circle.\n if (!(c & c0) && (t = intersect(point1, point0, true))) {\n clean = 0;\n if (smallRadius) {\n stream.lineStart();\n stream.point(t[0][0], t[0][1]);\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n } else {\n stream.point(t[1][0], t[1][1]);\n stream.lineEnd();\n stream.lineStart();\n stream.point(t[0][0], t[0][1], 3);\n }\n }\n }\n if (v && (!point0 || !pointEqual(point0, point1))) {\n stream.point(point1[0], point1[1]);\n }\n point0 = point1, v0 = v, c0 = c;\n },\n lineEnd: function() {\n if (v0) stream.lineEnd();\n point0 = null;\n },\n // Rejoin first and last segments if there were intersections and the first\n // and last points were visible.\n clean: function() {\n return clean | ((v00 && v0) << 1);\n }\n };\n }\n\n // Intersects the great circle between a and b with the clip circle.\n function intersect(a, b, two) {\n var pa = cartesian(a),\n pb = cartesian(b);\n\n // We have two planes, n1.p = d1 and n2.p = d2.\n // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).\n var n1 = [1, 0, 0], // normal\n n2 = cartesianCross(pa, pb),\n n2n2 = cartesianDot(n2, n2),\n n1n2 = n2[0], // cartesianDot(n1, n2),\n determinant = n2n2 - n1n2 * n1n2;\n\n // Two polar points.\n if (!determinant) return !two && a;\n\n var c1 = cr * n2n2 / determinant,\n c2 = -cr * n1n2 / determinant,\n n1xn2 = cartesianCross(n1, n2),\n A = cartesianScale(n1, c1),\n B = cartesianScale(n2, c2);\n cartesianAddInPlace(A, B);\n\n // Solve |p(t)|^2 = 1.\n var u = n1xn2,\n w = cartesianDot(A, u),\n uu = cartesianDot(u, u),\n t2 = w * w - uu * (cartesianDot(A, A) - 1);\n\n if (t2 < 0) return;\n\n var t = sqrt(t2),\n q = cartesianScale(u, (-w - t) / uu);\n cartesianAddInPlace(q, A);\n q = spherical(q);\n\n if (!two) return q;\n\n // Two intersection points.\n var lambda0 = a[0],\n lambda1 = b[0],\n phi0 = a[1],\n phi1 = b[1],\n z;\n\n if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;\n\n var delta = lambda1 - lambda0,\n polar = abs(delta - pi) < epsilon,\n meridian = polar || delta < epsilon;\n\n if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;\n\n // Check that the first point is between a and b.\n if (meridian\n ? polar\n ? phi0 + phi1 > 0 ^ q[1] < (abs(q[0] - lambda0) < epsilon ? phi0 : phi1)\n : phi0 <= q[1] && q[1] <= phi1\n : delta > pi ^ (lambda0 <= q[0] && q[0] <= lambda1)) {\n var q1 = cartesianScale(u, (-w + t) / uu);\n cartesianAddInPlace(q1, A);\n return [q, spherical(q1)];\n }\n }\n\n // Generates a 4-bit vector representing the location of a point relative to\n // the small circle's bounding box.\n function code(lambda, phi) {\n var r = smallRadius ? radius : pi - radius,\n code = 0;\n if (lambda < -r) code |= 1; // left\n else if (lambda > r) code |= 2; // right\n if (phi < -r) code |= 4; // below\n else if (phi > r) code |= 8; // above\n return code;\n }\n\n return clip(visible, clipLine, interpolate, smallRadius ? [0, -radius] : [-pi, radius - pi]);\n}\n","import {abs, epsilon} from \"../math.js\";\nimport clipBuffer from \"./buffer.js\";\nimport clipLine from \"./line.js\";\nimport clipRejoin from \"./rejoin.js\";\nimport {merge} from \"d3-array\";\n\nvar clipMax = 1e9, clipMin = -clipMax;\n\n// TODO Use d3-polygon’s polygonContains here for the ring check?\n// TODO Eliminate duplicate buffering in clipBuffer and polygon.push?\n\nexport default function clipRectangle(x0, y0, x1, y1) {\n\n function visible(x, y) {\n return x0 <= x && x <= x1 && y0 <= y && y <= y1;\n }\n\n function interpolate(from, to, direction, stream) {\n var a = 0, a1 = 0;\n if (from == null\n || (a = corner(from, direction)) !== (a1 = corner(to, direction))\n || comparePoint(from, to) < 0 ^ direction > 0) {\n do stream.point(a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0);\n while ((a = (a + direction + 4) % 4) !== a1);\n } else {\n stream.point(to[0], to[1]);\n }\n }\n\n function corner(p, direction) {\n return abs(p[0] - x0) < epsilon ? direction > 0 ? 0 : 3\n : abs(p[0] - x1) < epsilon ? direction > 0 ? 2 : 1\n : abs(p[1] - y0) < epsilon ? direction > 0 ? 1 : 0\n : direction > 0 ? 3 : 2; // abs(p[1] - y1) < epsilon\n }\n\n function compareIntersection(a, b) {\n return comparePoint(a.x, b.x);\n }\n\n function comparePoint(a, b) {\n var ca = corner(a, 1),\n cb = corner(b, 1);\n return ca !== cb ? ca - cb\n : ca === 0 ? b[1] - a[1]\n : ca === 1 ? a[0] - b[0]\n : ca === 2 ? a[1] - b[1]\n : b[0] - a[0];\n }\n\n return function(stream) {\n var activeStream = stream,\n bufferStream = clipBuffer(),\n segments,\n polygon,\n ring,\n x__, y__, v__, // first point\n x_, y_, v_, // previous point\n first,\n clean;\n\n var clipStream = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: polygonStart,\n polygonEnd: polygonEnd\n };\n\n function point(x, y) {\n if (visible(x, y)) activeStream.point(x, y);\n }\n\n function polygonInside() {\n var winding = 0;\n\n for (var i = 0, n = polygon.length; i < n; ++i) {\n for (var ring = polygon[i], j = 1, m = ring.length, point = ring[0], a0, a1, b0 = point[0], b1 = point[1]; j < m; ++j) {\n a0 = b0, a1 = b1, point = ring[j], b0 = point[0], b1 = point[1];\n if (a1 <= y1) { if (b1 > y1 && (b0 - a0) * (y1 - a1) > (b1 - a1) * (x0 - a0)) ++winding; }\n else { if (b1 <= y1 && (b0 - a0) * (y1 - a1) < (b1 - a1) * (x0 - a0)) --winding; }\n }\n }\n\n return winding;\n }\n\n // Buffer geometry within a polygon and then clip it en masse.\n function polygonStart() {\n activeStream = bufferStream, segments = [], polygon = [], clean = true;\n }\n\n function polygonEnd() {\n var startInside = polygonInside(),\n cleanInside = clean && startInside,\n visible = (segments = merge(segments)).length;\n if (cleanInside || visible) {\n stream.polygonStart();\n if (cleanInside) {\n stream.lineStart();\n interpolate(null, null, 1, stream);\n stream.lineEnd();\n }\n if (visible) {\n clipRejoin(segments, compareIntersection, startInside, interpolate, stream);\n }\n stream.polygonEnd();\n }\n activeStream = stream, segments = polygon = ring = null;\n }\n\n function lineStart() {\n clipStream.point = linePoint;\n if (polygon) polygon.push(ring = []);\n first = true;\n v_ = false;\n x_ = y_ = NaN;\n }\n\n // TODO rather than special-case polygons, simply handle them separately.\n // Ideally, coincident intersection points should be jittered to avoid\n // clipping issues.\n function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }\n\n function linePoint(x, y) {\n var v = visible(x, y);\n if (polygon) ring.push([x, y]);\n if (first) {\n x__ = x, y__ = y, v__ = v;\n first = false;\n if (v) {\n activeStream.lineStart();\n activeStream.point(x, y);\n }\n } else {\n if (v && v_) activeStream.point(x, y);\n else {\n var a = [x_ = Math.max(clipMin, Math.min(clipMax, x_)), y_ = Math.max(clipMin, Math.min(clipMax, y_))],\n b = [x = Math.max(clipMin, Math.min(clipMax, x)), y = Math.max(clipMin, Math.min(clipMax, y))];\n if (clipLine(a, b, x0, y0, x1, y1)) {\n if (!v_) {\n activeStream.lineStart();\n activeStream.point(a[0], a[1]);\n }\n activeStream.point(b[0], b[1]);\n if (!v) activeStream.lineEnd();\n clean = false;\n } else if (v) {\n activeStream.lineStart();\n activeStream.point(x, y);\n clean = false;\n }\n }\n }\n x_ = x, y_ = y, v_ = v;\n }\n\n return clipStream;\n };\n}\n","export default function(a, b, x0, y0, x1, y1) {\n var ax = a[0],\n ay = a[1],\n bx = b[0],\n by = b[1],\n t0 = 0,\n t1 = 1,\n dx = bx - ax,\n dy = by - ay,\n r;\n\n r = x0 - ax;\n if (!dx && r > 0) return;\n r /= dx;\n if (dx < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dx > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = x1 - ax;\n if (!dx && r < 0) return;\n r /= dx;\n if (dx < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dx > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n r = y0 - ay;\n if (!dy && r > 0) return;\n r /= dy;\n if (dy < 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n } else if (dy > 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n }\n\n r = y1 - ay;\n if (!dy && r < 0) return;\n r /= dy;\n if (dy < 0) {\n if (r > t1) return;\n if (r > t0) t0 = r;\n } else if (dy > 0) {\n if (r < t0) return;\n if (r < t1) t1 = r;\n }\n\n if (t0 > 0) a[0] = ax + t0 * dx, a[1] = ay + t0 * dy;\n if (t1 < 1) b[0] = ax + t1 * dx, b[1] = ay + t1 * dy;\n return true;\n}\n","export default x => x;\n","export default function(methods) {\n return {\n stream: transformer(methods)\n };\n}\n\nexport function transformer(methods) {\n return function(stream) {\n var s = new TransformStream;\n for (var key in methods) s[key] = methods[key];\n s.stream = stream;\n return s;\n };\n}\n\nfunction TransformStream() {}\n\nTransformStream.prototype = {\n constructor: TransformStream,\n point: function(x, y) { this.stream.point(x, y); },\n sphere: function() { this.stream.sphere(); },\n lineStart: function() { this.stream.lineStart(); },\n lineEnd: function() { this.stream.lineEnd(); },\n polygonStart: function() { this.stream.polygonStart(); },\n polygonEnd: function() { this.stream.polygonEnd(); }\n};\n","import noop from \"../noop.js\";\n\nvar x0 = Infinity,\n y0 = x0,\n x1 = -x0,\n y1 = x1;\n\nvar boundsStream = {\n point: boundsPoint,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: noop,\n polygonEnd: noop,\n result: function() {\n var bounds = [[x0, y0], [x1, y1]];\n x1 = y1 = -(y0 = x0 = Infinity);\n return bounds;\n }\n};\n\nfunction boundsPoint(x, y) {\n if (x < x0) x0 = x;\n if (x > x1) x1 = x;\n if (y < y0) y0 = y;\n if (y > y1) y1 = y;\n}\n\nexport default boundsStream;\n","import {default as geoStream} from \"../stream.js\";\nimport boundsStream from \"../path/bounds.js\";\n\nfunction fit(projection, fitBounds, object) {\n var clip = projection.clipExtent && projection.clipExtent();\n projection.scale(150).translate([0, 0]);\n if (clip != null) projection.clipExtent(null);\n geoStream(object, projection.stream(boundsStream));\n fitBounds(boundsStream.result());\n if (clip != null) projection.clipExtent(clip);\n return projection;\n}\n\nexport function fitExtent(projection, extent, object) {\n return fit(projection, function(b) {\n var w = extent[1][0] - extent[0][0],\n h = extent[1][1] - extent[0][1],\n k = Math.min(w / (b[1][0] - b[0][0]), h / (b[1][1] - b[0][1])),\n x = +extent[0][0] + (w - k * (b[1][0] + b[0][0])) / 2,\n y = +extent[0][1] + (h - k * (b[1][1] + b[0][1])) / 2;\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n\nexport function fitSize(projection, size, object) {\n return fitExtent(projection, [[0, 0], size], object);\n}\n\nexport function fitWidth(projection, width, object) {\n return fit(projection, function(b) {\n var w = +width,\n k = w / (b[1][0] - b[0][0]),\n x = (w - k * (b[1][0] + b[0][0])) / 2,\n y = -k * b[0][1];\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n\nexport function fitHeight(projection, height, object) {\n return fit(projection, function(b) {\n var h = +height,\n k = h / (b[1][1] - b[0][1]),\n x = -k * b[0][0],\n y = (h - k * (b[1][1] + b[0][1])) / 2;\n projection.scale(150 * k).translate([x, y]);\n }, object);\n}\n","import {cartesian} from \"../cartesian.js\";\nimport {abs, asin, atan2, cos, epsilon, radians, sqrt} from \"../math.js\";\nimport {transformer} from \"../transform.js\";\n\nvar maxDepth = 16, // maximum depth of subdivision\n cosMinDistance = cos(30 * radians); // cos(minimum angular distance)\n\nexport default function(project, delta2) {\n return +delta2 ? resample(project, delta2) : resampleNone(project);\n}\n\nfunction resampleNone(project) {\n return transformer({\n point: function(x, y) {\n x = project(x, y);\n this.stream.point(x[0], x[1]);\n }\n });\n}\n\nfunction resample(project, delta2) {\n\n function resampleLineTo(x0, y0, lambda0, a0, b0, c0, x1, y1, lambda1, a1, b1, c1, depth, stream) {\n var dx = x1 - x0,\n dy = y1 - y0,\n d2 = dx * dx + dy * dy;\n if (d2 > 4 * delta2 && depth--) {\n var a = a0 + a1,\n b = b0 + b1,\n c = c0 + c1,\n m = sqrt(a * a + b * b + c * c),\n phi2 = asin(c /= m),\n lambda2 = abs(abs(c) - 1) < epsilon || abs(lambda0 - lambda1) < epsilon ? (lambda0 + lambda1) / 2 : atan2(b, a),\n p = project(lambda2, phi2),\n x2 = p[0],\n y2 = p[1],\n dx2 = x2 - x0,\n dy2 = y2 - y0,\n dz = dy * dx2 - dx * dy2;\n if (dz * dz / d2 > delta2 // perpendicular projected distance\n || abs((dx * dx2 + dy * dy2) / d2 - 0.5) > 0.3 // midpoint close to an end\n || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) { // angular distance\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x2, y2, lambda2, a /= m, b /= m, c, depth, stream);\n stream.point(x2, y2);\n resampleLineTo(x2, y2, lambda2, a, b, c, x1, y1, lambda1, a1, b1, c1, depth, stream);\n }\n }\n }\n return function(stream) {\n var lambda00, x00, y00, a00, b00, c00, // first point\n lambda0, x0, y0, a0, b0, c0; // previous point\n\n var resampleStream = {\n point: point,\n lineStart: lineStart,\n lineEnd: lineEnd,\n polygonStart: function() { stream.polygonStart(); resampleStream.lineStart = ringStart; },\n polygonEnd: function() { stream.polygonEnd(); resampleStream.lineStart = lineStart; }\n };\n\n function point(x, y) {\n x = project(x, y);\n stream.point(x[0], x[1]);\n }\n\n function lineStart() {\n x0 = NaN;\n resampleStream.point = linePoint;\n stream.lineStart();\n }\n\n function linePoint(lambda, phi) {\n var c = cartesian([lambda, phi]), p = project(lambda, phi);\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x0 = p[0], y0 = p[1], lambda0 = lambda, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream);\n stream.point(x0, y0);\n }\n\n function lineEnd() {\n resampleStream.point = point;\n stream.lineEnd();\n }\n\n function ringStart() {\n lineStart();\n resampleStream.point = ringPoint;\n resampleStream.lineEnd = ringEnd;\n }\n\n function ringPoint(lambda, phi) {\n linePoint(lambda00 = lambda, phi), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0;\n resampleStream.point = linePoint;\n }\n\n function ringEnd() {\n resampleLineTo(x0, y0, lambda0, a0, b0, c0, x00, y00, lambda00, a00, b00, c00, maxDepth, stream);\n resampleStream.lineEnd = lineEnd;\n lineEnd();\n }\n\n return resampleStream;\n };\n}\n","import clipAntimeridian from \"../clip/antimeridian.js\";\nimport clipCircle from \"../clip/circle.js\";\nimport clipRectangle from \"../clip/rectangle.js\";\nimport compose from \"../compose.js\";\nimport identity from \"../identity.js\";\nimport {cos, degrees, radians, sin, sqrt} from \"../math.js\";\nimport {rotateRadians} from \"../rotation.js\";\nimport {transformer} from \"../transform.js\";\nimport {fitExtent, fitSize, fitWidth, fitHeight} from \"./fit.js\";\nimport resample from \"./resample.js\";\n\nvar transformRadians = transformer({\n point: function(x, y) {\n this.stream.point(x * radians, y * radians);\n }\n});\n\nfunction transformRotate(rotate) {\n return transformer({\n point: function(x, y) {\n var r = rotate(x, y);\n return this.stream.point(r[0], r[1]);\n }\n });\n}\n\nfunction scaleTranslate(k, dx, dy, sx, sy) {\n function transform(x, y) {\n x *= sx; y *= sy;\n return [dx + k * x, dy - k * y];\n }\n transform.invert = function(x, y) {\n return [(x - dx) / k * sx, (dy - y) / k * sy];\n };\n return transform;\n}\n\nfunction scaleTranslateRotate(k, dx, dy, sx, sy, alpha) {\n if (!alpha) return scaleTranslate(k, dx, dy, sx, sy);\n var cosAlpha = cos(alpha),\n sinAlpha = sin(alpha),\n a = cosAlpha * k,\n b = sinAlpha * k,\n ai = cosAlpha / k,\n bi = sinAlpha / k,\n ci = (sinAlpha * dy - cosAlpha * dx) / k,\n fi = (sinAlpha * dx + cosAlpha * dy) / k;\n function transform(x, y) {\n x *= sx; y *= sy;\n return [a * x - b * y + dx, dy - b * x - a * y];\n }\n transform.invert = function(x, y) {\n return [sx * (ai * x - bi * y + ci), sy * (fi - bi * x - ai * y)];\n };\n return transform;\n}\n\nexport default function projection(project) {\n return projectionMutator(function() { return project; })();\n}\n\nexport function projectionMutator(projectAt) {\n var project,\n k = 150, // scale\n x = 480, y = 250, // translate\n lambda = 0, phi = 0, // center\n deltaLambda = 0, deltaPhi = 0, deltaGamma = 0, rotate, // pre-rotate\n alpha = 0, // post-rotate angle\n sx = 1, // reflectX\n sy = 1, // reflectX\n theta = null, preclip = clipAntimeridian, // pre-clip angle\n x0 = null, y0, x1, y1, postclip = identity, // post-clip extent\n delta2 = 0.5, // precision\n projectResample,\n projectTransform,\n projectRotateTransform,\n cache,\n cacheStream;\n\n function projection(point) {\n return projectRotateTransform(point[0] * radians, point[1] * radians);\n }\n\n function invert(point) {\n point = projectRotateTransform.invert(point[0], point[1]);\n return point && [point[0] * degrees, point[1] * degrees];\n }\n\n projection.stream = function(stream) {\n return cache && cacheStream === stream ? cache : cache = transformRadians(transformRotate(rotate)(preclip(projectResample(postclip(cacheStream = stream)))));\n };\n\n projection.preclip = function(_) {\n return arguments.length ? (preclip = _, theta = undefined, reset()) : preclip;\n };\n\n projection.postclip = function(_) {\n return arguments.length ? (postclip = _, x0 = y0 = x1 = y1 = null, reset()) : postclip;\n };\n\n projection.clipAngle = function(_) {\n return arguments.length ? (preclip = +_ ? clipCircle(theta = _ * radians) : (theta = null, clipAntimeridian), reset()) : theta * degrees;\n };\n\n projection.clipExtent = function(_) {\n return arguments.length ? (postclip = _ == null ? (x0 = y0 = x1 = y1 = null, identity) : clipRectangle(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]];\n };\n\n projection.scale = function(_) {\n return arguments.length ? (k = +_, recenter()) : k;\n };\n\n projection.translate = function(_) {\n return arguments.length ? (x = +_[0], y = +_[1], recenter()) : [x, y];\n };\n\n projection.center = function(_) {\n return arguments.length ? (lambda = _[0] % 360 * radians, phi = _[1] % 360 * radians, recenter()) : [lambda * degrees, phi * degrees];\n };\n\n projection.rotate = function(_) {\n return arguments.length ? (deltaLambda = _[0] % 360 * radians, deltaPhi = _[1] % 360 * radians, deltaGamma = _.length > 2 ? _[2] % 360 * radians : 0, recenter()) : [deltaLambda * degrees, deltaPhi * degrees, deltaGamma * degrees];\n };\n\n projection.angle = function(_) {\n return arguments.length ? (alpha = _ % 360 * radians, recenter()) : alpha * degrees;\n };\n\n projection.reflectX = function(_) {\n return arguments.length ? (sx = _ ? -1 : 1, recenter()) : sx < 0;\n };\n\n projection.reflectY = function(_) {\n return arguments.length ? (sy = _ ? -1 : 1, recenter()) : sy < 0;\n };\n\n projection.precision = function(_) {\n return arguments.length ? (projectResample = resample(projectTransform, delta2 = _ * _), reset()) : sqrt(delta2);\n };\n\n projection.fitExtent = function(extent, object) {\n return fitExtent(projection, extent, object);\n };\n\n projection.fitSize = function(size, object) {\n return fitSize(projection, size, object);\n };\n\n projection.fitWidth = function(width, object) {\n return fitWidth(projection, width, object);\n };\n\n projection.fitHeight = function(height, object) {\n return fitHeight(projection, height, object);\n };\n\n function recenter() {\n var center = scaleTranslateRotate(k, 0, 0, sx, sy, alpha).apply(null, project(lambda, phi)),\n transform = scaleTranslateRotate(k, x - center[0], y - center[1], sx, sy, alpha);\n rotate = rotateRadians(deltaLambda, deltaPhi, deltaGamma);\n projectTransform = compose(project, transform);\n projectRotateTransform = compose(rotate, projectTransform);\n projectResample = resample(projectTransform, delta2);\n return reset();\n }\n\n function reset() {\n cache = cacheStream = null;\n return projection;\n }\n\n return function() {\n project = projectAt.apply(this, arguments);\n projection.invert = project.invert && invert;\n return recenter();\n };\n}\n","import {atan, exp, halfPi, log, pi, tan, tau} from \"../math.js\";\nimport rotation from \"../rotation.js\";\nimport projection from \"./index.js\";\n\nexport function mercatorRaw(lambda, phi) {\n return [lambda, log(tan((halfPi + phi) / 2))];\n}\n\nmercatorRaw.invert = function(x, y) {\n return [x, 2 * atan(exp(y)) - halfPi];\n};\n\nexport default function() {\n return mercatorProjection(mercatorRaw)\n .scale(961 / tau);\n}\n\nexport function mercatorProjection(project) {\n var m = projection(project),\n center = m.center,\n scale = m.scale,\n translate = m.translate,\n clipExtent = m.clipExtent,\n x0 = null, y0, x1, y1; // clip extent\n\n m.scale = function(_) {\n return arguments.length ? (scale(_), reclip()) : scale();\n };\n\n m.translate = function(_) {\n return arguments.length ? (translate(_), reclip()) : translate();\n };\n\n m.center = function(_) {\n return arguments.length ? (center(_), reclip()) : center();\n };\n\n m.clipExtent = function(_) {\n return arguments.length ? ((_ == null ? x0 = y0 = x1 = y1 = null : (x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1])), reclip()) : x0 == null ? null : [[x0, y0], [x1, y1]];\n };\n\n function reclip() {\n var k = pi * scale(),\n t = m(rotation(m.rotate()).invert([0, 0]));\n return clipExtent(x0 == null\n ? [[t[0] - k, t[1] - k], [t[0] + k, t[1] + k]] : project === mercatorRaw\n ? [[Math.max(t[0] - k, x0), y0], [Math.min(t[0] + k, x1), y1]]\n : [[x0, Math.max(t[1] - k, y0)], [x1, Math.min(t[1] + k, y1)]]);\n }\n\n return reclip();\n}\n","import {Adder} from \"d3-array\";\nimport {abs} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nvar areaSum = new Adder(),\n areaRingSum = new Adder(),\n x00,\n y00,\n x0,\n y0;\n\nvar areaStream = {\n point: noop,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: function() {\n areaStream.lineStart = areaRingStart;\n areaStream.lineEnd = areaRingEnd;\n },\n polygonEnd: function() {\n areaStream.lineStart = areaStream.lineEnd = areaStream.point = noop;\n areaSum.add(abs(areaRingSum));\n areaRingSum = new Adder();\n },\n result: function() {\n var area = areaSum / 2;\n areaSum = new Adder();\n return area;\n }\n};\n\nfunction areaRingStart() {\n areaStream.point = areaPointFirst;\n}\n\nfunction areaPointFirst(x, y) {\n areaStream.point = areaPoint;\n x00 = x0 = x, y00 = y0 = y;\n}\n\nfunction areaPoint(x, y) {\n areaRingSum.add(y0 * x - x0 * y);\n x0 = x, y0 = y;\n}\n\nfunction areaRingEnd() {\n areaPoint(x00, y00);\n}\n\nexport default areaStream;\n","import { Theme } from \"../../core/Theme\";\r\nimport { p50 } from \"../../core/util/Percent\";\r\nimport { setColor } from \"../../themes/DefaultTheme\";\r\n\r\nimport { geoMercator } from \"d3-geo\";\r\n\r\nimport * as $ease from \"../../core/util/Ease\";\r\n\r\n\r\n/**\r\n * @ignore\r\n */\r\nexport class MapChartDefaultTheme extends Theme {\r\n\tprotected setupDefaultRules() {\r\n\t\tsuper.setupDefaultRules();\r\n\r\n\t\tconst ic = this._root.interfaceColors;\r\n\t\tconst r = this.rule.bind(this);\r\n\r\n\t\t/**\r\n\t\t * ========================================================================\r\n\t\t * charts/map\r\n\t\t * ========================================================================\r\n\t\t */\r\n\r\n\t\tr(\"MapChart\").setAll({\r\n\t\t\tprojection: geoMercator(),\r\n\t\t\tpanX: \"translateX\",\r\n\t\t\tpanY: \"translateY\",\r\n\t\t\tpinchZoom: true,\r\n\t\t\tzoomStep: 2,\r\n\t\t\tzoomLevel: 1,\r\n\t\t\trotationX: 0,\r\n\t\t\trotationY: 0,\r\n\t\t\trotationZ: 0,\r\n\t\t\tmaxZoomLevel: 32,\r\n\t\t\tminZoomLevel: 1,\r\n\t\t\twheelY: \"zoom\",\r\n\t\t\twheelX: \"none\",\r\n\t\t\tanimationEasing: $ease.out($ease.cubic),\r\n\t\t\twheelEasing: $ease.out($ease.cubic),\r\n\t\t\twheelDuration: 0,\r\n\t\t\twheelSensitivity: 1,\r\n\t\t\tmaxPanOut: 0.4,\r\n\t\t\tcenterMapOnZoomOut: true\r\n\t\t});\r\n\r\n\t\t{\r\n\t\t\tconst rule = r(\"MapLine\");\r\n\r\n\t\t\trule.setAll({\r\n\t\t\t\tprecision: 0.5,\r\n\t\t\t\trole: \"figure\",\r\n\t\t\t});\r\n\r\n\t\t\tsetColor(rule, \"stroke\", ic, \"grid\");\r\n\t\t}\r\n\r\n\t\tr(\"MapPointSeries\").setAll({\r\n\t\t\tclipFront: false,\r\n\t\t\tclipBack: true,\r\n\t\t\tautoScale: false\r\n\t\t})\r\n\r\n\t\t{\r\n\t\t\tconst rule = r(\"MapPolygon\");\r\n\r\n\t\t\trule.setAll({\r\n\t\t\t\tprecision: 0.5,\r\n\t\t\t\tisMeasured: false,\r\n\t\t\t\trole: \"figure\",\r\n\t\t\t\tfillOpacity: 1,\r\n\t\t\t\tposition: \"absolute\",\r\n\t\t\t\tstrokeWidth: 0.2,\r\n\t\t\t\tstrokeOpacity: 1,\r\n\t\t\t});\r\n\r\n\t\t\tsetColor(rule, \"fill\", ic, \"primaryButton\");\r\n\t\t\tsetColor(rule, \"stroke\", ic, \"background\");\r\n\t\t}\r\n\r\n\t\tr(\"Graphics\", [\"map\", \"button\", \"plus\", \"icon\"]).setAll({\r\n\t\t\tx: p50,\r\n\t\t\ty: p50,\r\n\t\t\tdraw: (display) => {\r\n\t\t\t\tdisplay.moveTo(-4, 0);\r\n\t\t\t\tdisplay.lineTo(4, 0);\r\n\t\t\t\tdisplay.moveTo(0, -4);\r\n\t\t\t\tdisplay.lineTo(0, 4);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tr(\"Graphics\", [\"map\", \"button\", \"minus\", \"icon\"]).setAll({\r\n\t\t\tx: p50,\r\n\t\t\ty: p50,\r\n\t\t\tdraw: (display) => {\r\n\t\t\t\tdisplay.moveTo(-4, 0);\r\n\t\t\t\tdisplay.lineTo(4, 0);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\t/**\r\n\t\t * ------------------------------------------------------------------------\r\n\t\t * charts/map: Series\r\n\t\t * ------------------------------------------------------------------------\r\n\t\t */\r\n\r\n\t\tr(\"GraticuleSeries\").setAll({\r\n\t\t\tstep: 10\r\n\t\t});\r\n\r\n\r\n\t}\r\n}\r\n","import {sqrt} from \"../math.js\";\n\n// TODO Enforce positive area for exterior, negative area for interior?\n\nvar X0 = 0,\n Y0 = 0,\n Z0 = 0,\n X1 = 0,\n Y1 = 0,\n Z1 = 0,\n X2 = 0,\n Y2 = 0,\n Z2 = 0,\n x00,\n y00,\n x0,\n y0;\n\nvar centroidStream = {\n point: centroidPoint,\n lineStart: centroidLineStart,\n lineEnd: centroidLineEnd,\n polygonStart: function() {\n centroidStream.lineStart = centroidRingStart;\n centroidStream.lineEnd = centroidRingEnd;\n },\n polygonEnd: function() {\n centroidStream.point = centroidPoint;\n centroidStream.lineStart = centroidLineStart;\n centroidStream.lineEnd = centroidLineEnd;\n },\n result: function() {\n var centroid = Z2 ? [X2 / Z2, Y2 / Z2]\n : Z1 ? [X1 / Z1, Y1 / Z1]\n : Z0 ? [X0 / Z0, Y0 / Z0]\n : [NaN, NaN];\n X0 = Y0 = Z0 =\n X1 = Y1 = Z1 =\n X2 = Y2 = Z2 = 0;\n return centroid;\n }\n};\n\nfunction centroidPoint(x, y) {\n X0 += x;\n Y0 += y;\n ++Z0;\n}\n\nfunction centroidLineStart() {\n centroidStream.point = centroidPointFirstLine;\n}\n\nfunction centroidPointFirstLine(x, y) {\n centroidStream.point = centroidPointLine;\n centroidPoint(x0 = x, y0 = y);\n}\n\nfunction centroidPointLine(x, y) {\n var dx = x - x0, dy = y - y0, z = sqrt(dx * dx + dy * dy);\n X1 += z * (x0 + x) / 2;\n Y1 += z * (y0 + y) / 2;\n Z1 += z;\n centroidPoint(x0 = x, y0 = y);\n}\n\nfunction centroidLineEnd() {\n centroidStream.point = centroidPoint;\n}\n\nfunction centroidRingStart() {\n centroidStream.point = centroidPointFirstRing;\n}\n\nfunction centroidRingEnd() {\n centroidPointRing(x00, y00);\n}\n\nfunction centroidPointFirstRing(x, y) {\n centroidStream.point = centroidPointRing;\n centroidPoint(x00 = x0 = x, y00 = y0 = y);\n}\n\nfunction centroidPointRing(x, y) {\n var dx = x - x0,\n dy = y - y0,\n z = sqrt(dx * dx + dy * dy);\n\n X1 += z * (x0 + x) / 2;\n Y1 += z * (y0 + y) / 2;\n Z1 += z;\n\n z = y0 * x - x0 * y;\n X2 += z * (x0 + x);\n Y2 += z * (y0 + y);\n Z2 += z * 3;\n centroidPoint(x0 = x, y0 = y);\n}\n\nexport default centroidStream;\n","import {tau} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nexport default function PathContext(context) {\n this._context = context;\n}\n\nPathContext.prototype = {\n _radius: 4.5,\n pointRadius: function(_) {\n return this._radius = _, this;\n },\n polygonStart: function() {\n this._line = 0;\n },\n polygonEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line === 0) this._context.closePath();\n this._point = NaN;\n },\n point: function(x, y) {\n switch (this._point) {\n case 0: {\n this._context.moveTo(x, y);\n this._point = 1;\n break;\n }\n case 1: {\n this._context.lineTo(x, y);\n break;\n }\n default: {\n this._context.moveTo(x + this._radius, y);\n this._context.arc(x, y, this._radius, 0, tau);\n break;\n }\n }\n },\n result: noop\n};\n","import {Adder} from \"d3-array\";\nimport {sqrt} from \"../math.js\";\nimport noop from \"../noop.js\";\n\nvar lengthSum = new Adder(),\n lengthRing,\n x00,\n y00,\n x0,\n y0;\n\nvar lengthStream = {\n point: noop,\n lineStart: function() {\n lengthStream.point = lengthPointFirst;\n },\n lineEnd: function() {\n if (lengthRing) lengthPoint(x00, y00);\n lengthStream.point = noop;\n },\n polygonStart: function() {\n lengthRing = true;\n },\n polygonEnd: function() {\n lengthRing = null;\n },\n result: function() {\n var length = +lengthSum;\n lengthSum = new Adder();\n return length;\n }\n};\n\nfunction lengthPointFirst(x, y) {\n lengthStream.point = lengthPoint;\n x00 = x0 = x, y00 = y0 = y;\n}\n\nfunction lengthPoint(x, y) {\n x0 -= x, y0 -= y;\n lengthSum.add(sqrt(x0 * x0 + y0 * y0));\n x0 = x, y0 = y;\n}\n\nexport default lengthStream;\n","export default function PathString() {\n this._string = [];\n}\n\nPathString.prototype = {\n _radius: 4.5,\n _circle: circle(4.5),\n pointRadius: function(_) {\n if ((_ = +_) !== this._radius) this._radius = _, this._circle = null;\n return this;\n },\n polygonStart: function() {\n this._line = 0;\n },\n polygonEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line === 0) this._string.push(\"Z\");\n this._point = NaN;\n },\n point: function(x, y) {\n switch (this._point) {\n case 0: {\n this._string.push(\"M\", x, \",\", y);\n this._point = 1;\n break;\n }\n case 1: {\n this._string.push(\"L\", x, \",\", y);\n break;\n }\n default: {\n if (this._circle == null) this._circle = circle(this._radius);\n this._string.push(\"M\", x, \",\", y, this._circle);\n break;\n }\n }\n },\n result: function() {\n if (this._string.length) {\n var result = this._string.join(\"\");\n this._string = [];\n return result;\n } else {\n return null;\n }\n }\n};\n\nfunction circle(radius) {\n return \"m0,\" + radius\n + \"a\" + radius + \",\" + radius + \" 0 1,1 0,\" + -2 * radius\n + \"a\" + radius + \",\" + radius + \" 0 1,1 0,\" + 2 * radius\n + \"z\";\n}\n","import {Adder} from \"d3-array\";\nimport {asin, atan2, cos, degrees, epsilon, epsilon2, hypot, radians, sin, sqrt} from \"./math.js\";\nimport noop from \"./noop.js\";\nimport stream from \"./stream.js\";\n\nvar W0, W1,\n X0, Y0, Z0,\n X1, Y1, Z1,\n X2, Y2, Z2,\n lambda00, phi00, // first point\n x0, y0, z0; // previous point\n\nvar centroidStream = {\n sphere: noop,\n point: centroidPoint,\n lineStart: centroidLineStart,\n lineEnd: centroidLineEnd,\n polygonStart: function() {\n centroidStream.lineStart = centroidRingStart;\n centroidStream.lineEnd = centroidRingEnd;\n },\n polygonEnd: function() {\n centroidStream.lineStart = centroidLineStart;\n centroidStream.lineEnd = centroidLineEnd;\n }\n};\n\n// Arithmetic mean of Cartesian vectors.\nfunction centroidPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi);\n centroidPointCartesian(cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi));\n}\n\nfunction centroidPointCartesian(x, y, z) {\n ++W0;\n X0 += (x - X0) / W0;\n Y0 += (y - Y0) / W0;\n Z0 += (z - Z0) / W0;\n}\n\nfunction centroidLineStart() {\n centroidStream.point = centroidLinePointFirst;\n}\n\nfunction centroidLinePointFirst(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi);\n x0 = cosPhi * cos(lambda);\n y0 = cosPhi * sin(lambda);\n z0 = sin(phi);\n centroidStream.point = centroidLinePoint;\n centroidPointCartesian(x0, y0, z0);\n}\n\nfunction centroidLinePoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi),\n x = cosPhi * cos(lambda),\n y = cosPhi * sin(lambda),\n z = sin(phi),\n w = atan2(sqrt((w = y0 * z - z0 * y) * w + (w = z0 * x - x0 * z) * w + (w = x0 * y - y0 * x) * w), x0 * x + y0 * y + z0 * z);\n W1 += w;\n X1 += w * (x0 + (x0 = x));\n Y1 += w * (y0 + (y0 = y));\n Z1 += w * (z0 + (z0 = z));\n centroidPointCartesian(x0, y0, z0);\n}\n\nfunction centroidLineEnd() {\n centroidStream.point = centroidPoint;\n}\n\n// See J. E. Brock, The Inertia Tensor for a Spherical Triangle,\n// J. Applied Mechanics 42, 239 (1975).\nfunction centroidRingStart() {\n centroidStream.point = centroidRingPointFirst;\n}\n\nfunction centroidRingEnd() {\n centroidRingPoint(lambda00, phi00);\n centroidStream.point = centroidPoint;\n}\n\nfunction centroidRingPointFirst(lambda, phi) {\n lambda00 = lambda, phi00 = phi;\n lambda *= radians, phi *= radians;\n centroidStream.point = centroidRingPoint;\n var cosPhi = cos(phi);\n x0 = cosPhi * cos(lambda);\n y0 = cosPhi * sin(lambda);\n z0 = sin(phi);\n centroidPointCartesian(x0, y0, z0);\n}\n\nfunction centroidRingPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n var cosPhi = cos(phi),\n x = cosPhi * cos(lambda),\n y = cosPhi * sin(lambda),\n z = sin(phi),\n cx = y0 * z - z0 * y,\n cy = z0 * x - x0 * z,\n cz = x0 * y - y0 * x,\n m = hypot(cx, cy, cz),\n w = asin(m), // line weight = angle\n v = m && -w / m; // area weight multiplier\n X2.add(v * cx);\n Y2.add(v * cy);\n Z2.add(v * cz);\n W1 += w;\n X1 += w * (x0 + (x0 = x));\n Y1 += w * (y0 + (y0 = y));\n Z1 += w * (z0 + (z0 = z));\n centroidPointCartesian(x0, y0, z0);\n}\n\nexport default function(object) {\n W0 = W1 =\n X0 = Y0 = Z0 =\n X1 = Y1 = Z1 = 0;\n X2 = new Adder();\n Y2 = new Adder();\n Z2 = new Adder();\n stream(object, centroidStream);\n\n var x = +X2,\n y = +Y2,\n z = +Z2,\n m = hypot(x, y, z);\n\n // If the area-weighted ccentroid is undefined, fall back to length-weighted ccentroid.\n if (m < epsilon2) {\n x = X1, y = Y1, z = Z1;\n // If the feature has zero length, fall back to arithmetic mean of point vectors.\n if (W1 < epsilon) x = X0, y = Y0, z = Z0;\n m = hypot(x, y, z);\n // If the feature still has an undefined ccentroid, then return.\n if (m < epsilon2) return [NaN, NaN];\n }\n\n return [atan2(y, x) * degrees, asin(z / m) * degrees];\n}\n","import {Adder} from \"d3-array\";\nimport {atan2, cos, quarterPi, radians, sin, tau} from \"./math.js\";\nimport noop from \"./noop.js\";\nimport stream from \"./stream.js\";\n\nexport var areaRingSum = new Adder();\n\n// hello?\n\nvar areaSum = new Adder(),\n lambda00,\n phi00,\n lambda0,\n cosPhi0,\n sinPhi0;\n\nexport var areaStream = {\n point: noop,\n lineStart: noop,\n lineEnd: noop,\n polygonStart: function() {\n areaRingSum = new Adder();\n areaStream.lineStart = areaRingStart;\n areaStream.lineEnd = areaRingEnd;\n },\n polygonEnd: function() {\n var areaRing = +areaRingSum;\n areaSum.add(areaRing < 0 ? tau + areaRing : areaRing);\n this.lineStart = this.lineEnd = this.point = noop;\n },\n sphere: function() {\n areaSum.add(tau);\n }\n};\n\nfunction areaRingStart() {\n areaStream.point = areaPointFirst;\n}\n\nfunction areaRingEnd() {\n areaPoint(lambda00, phi00);\n}\n\nfunction areaPointFirst(lambda, phi) {\n areaStream.point = areaPoint;\n lambda00 = lambda, phi00 = phi;\n lambda *= radians, phi *= radians;\n lambda0 = lambda, cosPhi0 = cos(phi = phi / 2 + quarterPi), sinPhi0 = sin(phi);\n}\n\nfunction areaPoint(lambda, phi) {\n lambda *= radians, phi *= radians;\n phi = phi / 2 + quarterPi; // half the angular distance from south pole\n\n // Spherical excess E for a spherical triangle with vertices: south pole,\n // previous point, current point. Uses a formula derived from Cagnoli’s\n // theorem. See Todhunter, Spherical Trig. (1871), Sec. 103, Eq. (2).\n var dLambda = lambda - lambda0,\n sdLambda = dLambda >= 0 ? 1 : -1,\n adLambda = sdLambda * dLambda,\n cosPhi = cos(phi),\n sinPhi = sin(phi),\n k = sinPhi0 * sinPhi,\n u = cosPhi0 * cosPhi + k * cos(adLambda),\n v = k * sdLambda * sin(adLambda);\n areaRingSum.add(atan2(v, u));\n\n // Advance the previous points.\n lambda0 = lambda, cosPhi0 = cosPhi, sinPhi0 = sinPhi;\n}\n\nexport default function(object) {\n areaSum = new Adder();\n stream(object, areaStream);\n return areaSum * 2;\n}\n","import {Adder} from \"d3-array\";\nimport {areaStream, areaRingSum} from \"./area.js\";\nimport {cartesian, cartesianCross, cartesianNormalizeInPlace, spherical} from \"./cartesian.js\";\nimport {abs, degrees, epsilon, radians} from \"./math.js\";\nimport stream from \"./stream.js\";\n\nvar lambda0, phi0, lambda1, phi1, // bounds\n lambda2, // previous lambda-coordinate\n lambda00, phi00, // first point\n p0, // previous 3D point\n deltaSum,\n ranges,\n range;\n\nvar boundsStream = {\n point: boundsPoint,\n lineStart: boundsLineStart,\n lineEnd: boundsLineEnd,\n polygonStart: function() {\n boundsStream.point = boundsRingPoint;\n boundsStream.lineStart = boundsRingStart;\n boundsStream.lineEnd = boundsRingEnd;\n deltaSum = new Adder();\n areaStream.polygonStart();\n },\n polygonEnd: function() {\n areaStream.polygonEnd();\n boundsStream.point = boundsPoint;\n boundsStream.lineStart = boundsLineStart;\n boundsStream.lineEnd = boundsLineEnd;\n if (areaRingSum < 0) lambda0 = -(lambda1 = 180), phi0 = -(phi1 = 90);\n else if (deltaSum > epsilon) phi1 = 90;\n else if (deltaSum < -epsilon) phi0 = -90;\n range[0] = lambda0, range[1] = lambda1;\n },\n sphere: function() {\n lambda0 = -(lambda1 = 180), phi0 = -(phi1 = 90);\n }\n};\n\nfunction boundsPoint(lambda, phi) {\n ranges.push(range = [lambda0 = lambda, lambda1 = lambda]);\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n}\n\nfunction linePoint(lambda, phi) {\n var p = cartesian([lambda * radians, phi * radians]);\n if (p0) {\n var normal = cartesianCross(p0, p),\n equatorial = [normal[1], -normal[0], 0],\n inflection = cartesianCross(equatorial, normal);\n cartesianNormalizeInPlace(inflection);\n inflection = spherical(inflection);\n var delta = lambda - lambda2,\n sign = delta > 0 ? 1 : -1,\n lambdai = inflection[0] * degrees * sign,\n phii,\n antimeridian = abs(delta) > 180;\n if (antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) {\n phii = inflection[1] * degrees;\n if (phii > phi1) phi1 = phii;\n } else if (lambdai = (lambdai + 360) % 360 - 180, antimeridian ^ (sign * lambda2 < lambdai && lambdai < sign * lambda)) {\n phii = -inflection[1] * degrees;\n if (phii < phi0) phi0 = phii;\n } else {\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n }\n if (antimeridian) {\n if (lambda < lambda2) {\n if (angle(lambda0, lambda) > angle(lambda0, lambda1)) lambda1 = lambda;\n } else {\n if (angle(lambda, lambda1) > angle(lambda0, lambda1)) lambda0 = lambda;\n }\n } else {\n if (lambda1 >= lambda0) {\n if (lambda < lambda0) lambda0 = lambda;\n if (lambda > lambda1) lambda1 = lambda;\n } else {\n if (lambda > lambda2) {\n if (angle(lambda0, lambda) > angle(lambda0, lambda1)) lambda1 = lambda;\n } else {\n if (angle(lambda, lambda1) > angle(lambda0, lambda1)) lambda0 = lambda;\n }\n }\n }\n } else {\n ranges.push(range = [lambda0 = lambda, lambda1 = lambda]);\n }\n if (phi < phi0) phi0 = phi;\n if (phi > phi1) phi1 = phi;\n p0 = p, lambda2 = lambda;\n}\n\nfunction boundsLineStart() {\n boundsStream.point = linePoint;\n}\n\nfunction boundsLineEnd() {\n range[0] = lambda0, range[1] = lambda1;\n boundsStream.point = boundsPoint;\n p0 = null;\n}\n\nfunction boundsRingPoint(lambda, phi) {\n if (p0) {\n var delta = lambda - lambda2;\n deltaSum.add(abs(delta) > 180 ? delta + (delta > 0 ? 360 : -360) : delta);\n } else {\n lambda00 = lambda, phi00 = phi;\n }\n areaStream.point(lambda, phi);\n linePoint(lambda, phi);\n}\n\nfunction boundsRingStart() {\n areaStream.lineStart();\n}\n\nfunction boundsRingEnd() {\n boundsRingPoint(lambda00, phi00);\n areaStream.lineEnd();\n if (abs(deltaSum) > epsilon) lambda0 = -(lambda1 = 180);\n range[0] = lambda0, range[1] = lambda1;\n p0 = null;\n}\n\n// Finds the left-right distance between two longitudes.\n// This is almost the same as (lambda1 - lambda0 + 360°) % 360°, except that we want\n// the distance between ±180° to be 360°.\nfunction angle(lambda0, lambda1) {\n return (lambda1 -= lambda0) < 0 ? lambda1 + 360 : lambda1;\n}\n\nfunction rangeCompare(a, b) {\n return a[0] - b[0];\n}\n\nfunction rangeContains(range, x) {\n return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x;\n}\n\nexport default function(feature) {\n var i, n, a, b, merged, deltaMax, delta;\n\n phi1 = lambda1 = -(lambda0 = phi0 = Infinity);\n ranges = [];\n stream(feature, boundsStream);\n\n // First, sort ranges by their minimum longitudes.\n if (n = ranges.length) {\n ranges.sort(rangeCompare);\n\n // Then, merge any ranges that overlap.\n for (i = 1, a = ranges[0], merged = [a]; i < n; ++i) {\n b = ranges[i];\n if (rangeContains(a, b[0]) || rangeContains(a, b[1])) {\n if (angle(a[0], b[1]) > angle(a[0], a[1])) a[1] = b[1];\n if (angle(b[0], a[1]) > angle(a[0], a[1])) a[0] = b[0];\n } else {\n merged.push(a = b);\n }\n }\n\n // Finally, find the largest gap between the merged ranges.\n // The final bounding box will be the inverse of this gap.\n for (deltaMax = -Infinity, n = merged.length - 1, i = 0, a = merged[n]; i <= n; a = b, ++i) {\n b = merged[i];\n if ((delta = angle(a[1], b[0])) > deltaMax) deltaMax = delta, lambda0 = b[0], lambda1 = a[1];\n }\n }\n\n ranges = range = null;\n\n return lambda0 === Infinity || phi0 === Infinity\n ? [[NaN, NaN], [NaN, NaN]]\n : [[lambda0, phi0], [lambda1, phi1]];\n}\n","import type { IGeoPoint } from \"../../core/util/IGeoPoint\";\nimport * as $math from \"../../core/util/Math\";\nimport { geoCircle, geoCentroid, geoBounds } from \"d3-geo\";\n\n/**\n * Returns a GeoJSON representation of a circle, suitable for use as `geometry` value\n * in a [[MapPolygon]] in a [[MapPolygonSeries]].\n * \n * @param geoPoint Coordinates\n * @param radius Circle radius in degrees\n * @return Polygon geometry\n */\nexport function getGeoCircle(geoPoint: IGeoPoint, radius: number): GeoJSON.Polygon {\n\treturn geoCircle().center([geoPoint.longitude, geoPoint.latitude]).radius(radius)();\n}\n\n/**\n * @ignore\n */\nexport function getGeoCentroid(geometry: GeoJSON.GeometryObject): IGeoPoint {\n\tconst centroid = geoCentroid(geometry);\n\treturn { longitude: centroid[0], latitude: centroid[1] };\n}\n\n/**\n * @ignore\n */\nexport function getGeoBounds(geometry: GeoJSON.GeometryObject): { left: number, right: number, top: number, bottom: number } {\n\tconst bounds = geoBounds(geometry);\n\n\tif (bounds) {\n\t\tconst geoBounds = { left: bounds[0][0], right: bounds[1][0], top: bounds[1][1], bottom: bounds[0][1] };\n\t\tif(geoBounds.right < geoBounds.left){\n\t\t\tgeoBounds.right = 180;\n\t\t\tgeoBounds.left = -180;\n\t\t}\n\t\treturn geoBounds;\n\t}\n\treturn { left: 0, right: 0, top: 0, bottom: 0 };\n}\n\n/**\n * Returns a GeoJSON representation of a rectangle, suitable for use\n * as `geometry` value in a [[MapPolygon]] in a [[MapPolygonSeries]].\n * \n * @param north North latitude\n * @param east East longitude\n * @param south South latitude\n * @param west West longitude\n * @return polygon geometry\n */\nexport function getGeoRectangle(north: number, east: number, south: number, west: number): GeoJSON.MultiPolygon {\n\n\tlet multiPolygon: Array>> = [];\n\n\tif (west <= -180) {\n\t\twest = -179.9999;\n\t}\n\tif (south <= -90) {\n\t\tsouth = -89.9999;\n\t}\n\tif (north >= 90) {\n\t\tnorth = 89.9999;\n\t}\n\tif (east >= 180) {\n\t\teast = 179.9999;\n\t}\n\n\n\tlet stepLong = Math.min(90, (east - west) / Math.ceil((east - west) / 90));\n\tlet stepLat = (north - south) / Math.ceil((north - south) / 90);\n\n\tfor (let ln = west; ln < east; ln = ln + stepLong) {\n\t\tlet surface: Array<[number, number]> = [];\n\t\tmultiPolygon.push([surface]);\n\n\t\tif (ln + stepLong > east) {\n\t\t\tstepLong = east - ln;\n\t\t}\n\n\t\tfor (let ll = ln; ll <= ln + stepLong; ll = ll + 5) {\n\t\t\tsurface.push([ll, north]);\n\t\t}\n\n\t\tfor (let lt = north; lt >= south; lt = lt - stepLat) {\n\t\t\tsurface.push([ln + stepLong, lt]);\n\t\t}\n\n\t\tfor (let ll = ln + stepLong; ll >= ln; ll = ll - 5) {\n\t\t\tsurface.push([ll, south]);\n\t\t}\n\n\t\tfor (let lt = south; lt <= north; lt = lt + stepLat) {\n\t\t\tsurface.push([ln, lt]);\n\t\t}\n\t}\n\n\treturn { type: \"MultiPolygon\", coordinates: multiPolygon };\n}\n\n/**\n * Update longitudes and latitudes that wrap around -180/180 and -90/90 values.\n * \n * @param geoPoint Input coordinates\n * @return Updated coordinates\n */\nexport function normalizeGeoPoint(geoPoint: IGeoPoint): IGeoPoint {\n\tlet longitude = wrapAngleTo180(geoPoint.longitude);\n\tlet latitude = Math.asin(Math.sin((geoPoint.latitude * $math.RADIANS))) * $math.DEGREES;\n\n\tlet latitude180 = wrapAngleTo180(geoPoint.latitude);\n\n\tif (Math.abs(latitude180) > 90) {\n\t\tlongitude = wrapAngleTo180(longitude + 180);\n\t}\n\n\tgeoPoint.longitude = longitude;\n\tgeoPoint.latitude = latitude;\n\n\treturn geoPoint;\n}\n\n/**\n * @ignore\n */\nexport function wrapAngleTo180(angle: number): number {\n\tangle = angle % 360;\n\n\tif (angle > 180) {\n\t\tangle -= 360;\n\t}\n\tif (angle < -180) {\n\t\tangle += 360;\n\t}\n\n\treturn angle;\n}","import type { MapSeries } from \"./MapSeries\";\nimport type { MapPointSeries } from \"./MapPointSeries\";\nimport type { GeoProjection, GeoPath } from \"d3-geo\";\nimport type { IPoint } from \"../../core/util/IPoint\";\nimport type { IGeoPoint } from \"../../core/util/IGeoPoint\";\nimport type { Time } from \"../../core/util/Animation\";\nimport type { ZoomControl } from \"./ZoomControl\";\nimport type { Animation } from \"../../core/util/Entity\";\n\nimport { MapChartDefaultTheme } from \"./MapChartDefaultTheme\";\nimport { SerialChart, ISerialChartPrivate, ISerialChartSettings, ISerialChartEvents } from \"../../core/render/SerialChart\";\nimport { Rectangle } from \"../../core/render/Rectangle\";\nimport { geoPath } from \"d3-geo\";\nimport { Color } from \"../../core/util/Color\";\nimport { registry } from \"../../core/Registry\";\n\nimport * as $math from \"../../core/util/Math\";\nimport * as $array from \"../../core/util/Array\";\nimport * as $type from \"../../core/util/Type\";\nimport * as $mapUtils from \"./MapUtils\";\nimport * as $object from \"../../core/util/Object\";\nimport * as $utils from \"../../core/util/Utils\";\n\nimport type { IDisposer } from \"../../core/util/Disposer\";\nimport type { ISpritePointerEvent } from \"../../core/render/Sprite\";\n\nexport interface IMapChartSettings extends ISerialChartSettings {\n\n\t/**\n\t * A projection to use when plotting the map.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/#Projections} for more info\n\t */\n\tprojection?: GeoProjection;\n\n\t/**\n\t * Current zoom level.\n\t */\n\tzoomLevel?: number;\n\n\t/**\n\t * @ignore\n\t */\n\ttranslateX?: number;\n\n\t/**\n\t * @ignore\n\t */\n\ttranslateY?: number;\n\n\t/**\n\t * Vertical centering of the map.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/#Centering_the_map} for more info\n\t */\n\trotationY?: number;\n\n\t/**\n\t * Horizontal centering of the map.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/#Centering_the_map} for more info\n\t */\n\trotationX?: number;\n\n\t/**\n\t * Depth centering of the map.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/#Centering_the_map} for more info\n\t */\n\trotationZ?: number;\n\n\t/**\n\t * Highest zoom level map is allowed to zoom in to.\n\t *\n\t * @deault 32\n\t */\n\tmaxZoomLevel?: number;\n\n\t/**\n\t * Lowest zoom level map is allowed to zoom in to.\n\t *\n\t * @deault 1\n\t */\n\tminZoomLevel?: number;\n\n\t/**\n\t * Increment zoom level by `zoomStep` when user zooms in via [[ZoomControl]] or\n\t * API.\n\t *\n\t * @default 2\n\t */\n\tzoomStep?: number;\n\n\t/**\n\t * Defines what happens when map is being dragged horizontally.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-pan-zoom/#Panning} for more info\n\t * @default \"translateX\"\n\t */\n\tpanX?: \"none\" | \"rotateX\" | \"translateX\";\n\n\t/**\n\t * Defines what happens when map is being dragged vertically.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-pan-zoom/#Panning} for more info\n\t * @default \"translateY\"\n\t */\n\tpanY?: \"none\" | \"rotateY\" | \"translateY\";\n\n\t/**\n\t * Enables pinch-zooming of the map on multi-touch devices.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-pan-zoom/#Pinch_zoom} for more info\n\t * @default true\n\t */\n\tpinchZoom?: boolean;\n\n\t/**\n\t * Defines what happens when mouse wheel is turned horizontally.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-pan-zoom/#Mouse_wheel_behavior} for more info\n\t * @default \"none\"\n\t */\n\twheelX?: \"none\" | \"zoom\" | \"rotateX\" | \"rotateY\";\n\n\t/**\n\t * Defines what happens when mouse wheel is turned vertically.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-pan-zoom/#Mouse_wheel_behavior} for more info\n\t * @default \"zoom\"\n\t */\n\twheelY?: \"none\" | \"zoom\" | \"rotateX\" | \"rotateY\";\n\n\t/**\n\t * Sensitivity of a mouse wheel.\n\t *\n\t * @default 1\n\t */\n\twheelSensitivity?: number;\n\n\t/**\n\t * Duration of mouse-wheel action animation, in milliseconds.\n\t */\n\twheelDuration?: number;\n\n\t/**\n\t * An easing function to use for mouse wheel action animations.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/animations/#Easing_functions} for more info\n\t * @default am5.ease.out($ease.cubic)\n\t */\n\twheelEasing?: (t: Time) => Time;\n\n\t/**\n\t * Duration of zoom/pan animations, in milliseconds.\n\t */\n\tanimationDuration?: number;\n\n\t/**\n\t * An easing function to use for zoom/pan animations.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/animations/#Easing_functions} for more info\n\t * @default am5.ease.out($ease.cubic)\n\t */\n\tanimationEasing?: (t: Time) => Time;\n\n\n\t/**\n\t * A [[ZoomControl]] instance.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/#Zoom_control} for more info\n\t */\n\tzoomControl?: ZoomControl;\n\n\t/**\n\t * Initial/home zoom level.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-pan-zoom/#Initial_position_and_zoom} for more info\n\t */\n\thomeZoomLevel?: number;\n\n\t/**\n\t * Initial coordinates to center map on load or `goHome()` call.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-pan-zoom/#Initial_position_and_zoom} for more info\n\t */\n\thomeGeoPoint?: IGeoPoint;\n\n\t/**\n\t * How much of a map can go outside the viewport.\n\t *\n\t * @default 0.4\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-pan-zoom/#Panning_outside_viewport} for more info\n\t */\n\tmaxPanOut?: number;\n\n\t/**\n\t * Setting `true` means that the map will automatically center itself (or go\n\t * to `homeGeoPoint` if set) when fully zoomed out.\n\t *\n\t * `false` would mean that zoom out will be centered around the mouse\n\t * cursor (when zooming using wheel), or current map position.\n\t * \n\t * @default true\n\t * @since 5.2.1\n\t */\n\tcenterMapOnZoomOut?: boolean;\n\n}\n\nexport interface IMapChartPrivate extends ISerialChartPrivate {\n\n\t/**\n\t * @ignore\n\t */\n\tgeoPath: GeoPath;\n\n\t/**\n\t * @ignore\n\t */\n\tmapScale: number;\n\n}\n\n\nexport interface IMapChartEvents extends ISerialChartEvents {\n\n\t/**\n\t * Invoked when geo bounds of the map change, usually after map is\n\t * initialized.\n\t */\n\tgeoboundschanged: {};\n\n}\n\n\nexport class MapChart extends SerialChart {\n\tpublic static className: string = \"MapChart\";\n\tpublic static classNames: Array = SerialChart.classNames.concat([MapChart.className]);\n\n\tdeclare public _settings: IMapChartSettings;\n\tdeclare public _privateSettings: IMapChartPrivate;\n\tdeclare public _seriesType: MapSeries;\n\tdeclare public _events: IMapChartEvents;\n\n\tprotected _downTranslateX: number | undefined;\n\tprotected _downTranslateY: number | undefined;\n\tprotected _downRotationX: number | undefined;\n\tprotected _downRotationY: number | undefined;\n\tprotected _downRotationZ: number | undefined;\n\tprotected _pLat: number = 0;\n\tprotected _pLon: number = 0;\n\n\tprotected _movePoints: { [index: number]: IPoint } = {};\n\tprotected _downZoomLevel: number = 1;\n\tprotected _doubleDownDistance: number = 0;\n\n\tprotected _dirtyGeometries: boolean = false;\n\tprotected _geometryColection: GeoJSON.GeometryCollection = { type: \"GeometryCollection\", geometries: [] };\n\n\tprotected _centerLocation: [number, number] | null = null;\n\n\tprotected _za?: Animation;\n\tprotected _rxa?: Animation;\n\tprotected _rya?: Animation;\n\tprotected _txa?: Animation;\n\tprotected _tya?: Animation;\n\n\tprotected _mapBounds = [[0, 0], [0, 0]];\n\n\tprotected _geoCentroid: IGeoPoint = { longitude: 0, latitude: 0 };\n\tprotected _geoBounds: { left: number, right: number, top: number, bottom: number } = { left: 0, right: 0, top: 0, bottom: 0 };\n\tprotected _prevGeoBounds: { left: number, right: number, top: number, bottom: number } = { left: 0, right: 0, top: 0, bottom: 0 };\n\n\tprotected _dispatchBounds: boolean = false;\n\n\tprotected _wheelDp: IDisposer | undefined;\n\n\tprotected _pw?: number;\n\tprotected _ph?: number;\n\n\tprotected _mapFitted: boolean = false;\n\n\tprotected _centerX: number = 0;\n\tprotected _centerY: number = 0;\n\n\tprotected _makeGeoPath() {\n\t\tconst projection = this.get(\"projection\")!;\n\t\tconst path = geoPath();\n\t\tpath.projection(projection);\n\t\tthis.setPrivateRaw(\"geoPath\", path);\n\t}\n\n\t/**\n\t * Returns coordinates to geographical center of the map.\n\t */\n\tpublic geoCentroid() {\n\t\treturn this._geoCentroid;\n\t}\n\n\t/**\n\t * Returns geographical bounds of the map.\n\t */\n\tpublic geoBounds() {\n\t\treturn this._geoBounds;\n\t}\n\n\tprotected _handleSetWheel() {\n\n\t\tconst wheelX = this.get(\"wheelX\");\n\t\tconst wheelY = this.get(\"wheelY\");\n\t\tconst chartContainer = this.chartContainer;\n\n\t\tif (wheelX != \"none\" || wheelY != \"none\") {\n\n\t\t\tthis._wheelDp = chartContainer.events.on(\"wheel\", (event) => {\n\t\t\t\tconst wheelEasing = this.get(\"wheelEasing\")!;\n\t\t\t\tconst wheelSensitivity = this.get(\"wheelSensitivity\", 1);\n\t\t\t\tconst wheelDuration = this.get(\"wheelDuration\", 0);\n\n\t\t\t\tconst wheelEvent = event.originalEvent;\n\n\t\t\t\t// Ignore wheel event if it is happening on a non-chart element, e.g. if\n\t\t\t\t// some page element is over the chart.\n\t\t\t\tif ($utils.isLocalEvent(wheelEvent, this)) {\n\t\t\t\t\twheelEvent.preventDefault();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst chartContainer = this.chartContainer;\n\t\t\t\tconst point = chartContainer._display.toLocal(event.point);\n\n\t\t\t\tif ((wheelY == \"zoom\")) {\n\t\t\t\t\tthis._handleWheelZoom(wheelEvent.deltaY, point);\n\t\t\t\t}\n\t\t\t\telse if (wheelY == \"rotateY\") {\n\t\t\t\t\tthis._handleWheelRotateY(wheelEvent.deltaY / 5 * wheelSensitivity, wheelDuration, wheelEasing);\n\t\t\t\t}\n\t\t\t\telse if (wheelY == \"rotateX\") {\n\t\t\t\t\tthis._handleWheelRotateX(wheelEvent.deltaY / 5 * wheelSensitivity, wheelDuration, wheelEasing);\n\t\t\t\t}\n\n\t\t\t\tif ((wheelX == \"zoom\")) {\n\t\t\t\t\tthis._handleWheelZoom(wheelEvent.deltaX, point);\n\t\t\t\t}\n\t\t\t\telse if (wheelX == \"rotateY\") {\n\t\t\t\t\tthis._handleWheelRotateY(wheelEvent.deltaX / 5 * wheelSensitivity, wheelDuration, wheelEasing);\n\t\t\t\t}\n\t\t\t\telse if (wheelX == \"rotateX\") {\n\t\t\t\t\tthis._handleWheelRotateX(wheelEvent.deltaX / 5 * wheelSensitivity, wheelDuration, wheelEasing);\n\t\t\t\t}\n\n\t\t\t});\n\n\t\t\tthis._disposers.push(this._wheelDp);\n\t\t}\n\t\telse {\n\t\t\tif (this._wheelDp) {\n\t\t\t\tthis._wheelDp.dispose();\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic _prepareChildren() {\n\t\tsuper._prepareChildren();\n\n\t\tconst projection = this.get(\"projection\")!;\n\t\tconst w = this.innerWidth();\n\t\tconst h = this.innerHeight();\n\n\t\tif (this.isDirty(\"projection\")) {\n\t\t\tthis._makeGeoPath();\n\t\t\tthis.markDirtyProjection();\n\t\t\tthis._fitMap();\n\n\t\t\tprojection.scale(this.getPrivate(\"mapScale\") * this.get(\"zoomLevel\", 1));\n\t\t\tif (projection.rotate) {\n\t\t\t\tprojection.rotate([this.get(\"rotationX\", 0), this.get(\"rotationY\", 0), this.get(\"rotationZ\", 0)])\n\t\t\t}\n\n\t\t\tlet prev = this._prevSettings.projection;\n\t\t\tif (prev && prev != projection) {\n\t\t\t\tlet hw = w / 2;\n\t\t\t\tlet hh = h / 2;\n\t\t\t\tif (prev.invert) {\n\t\t\t\t\tlet centerLocation = prev.invert([hw, hh]);\n\n\t\t\t\t\tif (centerLocation) {\n\n\t\t\t\t\t\tlet xy = projection(centerLocation);\n\t\t\t\t\t\tif (xy) {\n\t\t\t\t\t\t\tlet translate = projection.translate();\n\n\t\t\t\t\t\t\tlet xx = hw - ((xy[0] - translate[0]));\n\t\t\t\t\t\t\tlet yy = hh - ((xy[1] - translate[1]));\n\n\t\t\t\t\t\t\tprojection.translate([xx, yy])\n\n\t\t\t\t\t\t\tthis.setRaw(\"translateX\", xx);\n\t\t\t\t\t\t\tthis.setRaw(\"translateY\", yy);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.isDirty(\"wheelX\") || this.isDirty(\"wheelY\")) {\n\t\t\tthis._handleSetWheel();\n\t\t}\n\t\tvar previousGeometries = this._geometryColection.geometries;\n\t\tif (this._dirtyGeometries) {\n\t\t\tthis._geometryColection.geometries = [];\n\n\t\t\tthis.series.each((series) => {\n\t\t\t\t$array.pushAll(this._geometryColection.geometries, series._geometries);\n\t\t\t})\n\n\t\t\tthis._fitMap();\n\t\t}\n\n\t\tif (previousGeometries.length != 0 && (w != this._pw || h != this._ph || this._dirtyGeometries)) {\n\t\t\tif (w > 0 && h > 0) {\n\t\t\t\tlet hw = w / 2;\n\t\t\t\tlet hh = h / 2;\n\n\t\t\t\tprojection.fitSize([w, h], this._geometryColection);\n\t\t\t\tconst newScale = projection.scale();\n\n\t\t\t\tthis.setPrivateRaw(\"mapScale\", newScale);\n\t\t\t\tprojection.scale(newScale * this.get(\"zoomLevel\", 1));\n\n\t\t\t\tif (this._centerLocation) {\n\t\t\t\t\tlet xy = projection(this._centerLocation);\n\t\t\t\t\tif (xy) {\n\t\t\t\t\t\tlet translate = projection.translate();\n\n\t\t\t\t\t\tlet xx = hw - ((xy[0] - translate[0]));\n\t\t\t\t\t\tlet yy = hh - ((xy[1] - translate[1]));\n\n\t\t\t\t\t\tprojection.translate([xx, yy])\n\n\t\t\t\t\t\tthis.setRaw(\"translateX\", xx);\n\t\t\t\t\t\tthis.setRaw(\"translateY\", yy);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.markDirtyProjection();\n\t\t\t}\n\t\t}\n\n\t\tthis._pw = w;\n\t\tthis._ph = h;\n\n\t\tif (this.isDirty(\"zoomControl\")) {\n\t\t\tconst previous = this._prevSettings.zoomControl;\n\t\t\tconst zoomControl = this.get(\"zoomControl\")!;\n\t\t\tif (zoomControl !== previous) {\n\t\t\t\tthis._disposeProperty(\"zoomControl\");\n\t\t\t\tif (previous) {\n\t\t\t\t\tprevious.dispose();\n\t\t\t\t}\n\t\t\t\tif (zoomControl) {\n\t\t\t\t\tzoomControl.setPrivate(\"chart\", this);\n\t\t\t\t\tthis.children.push(zoomControl);\n\t\t\t\t}\n\n\t\t\t\tthis.setRaw(\"zoomControl\", zoomControl);\n\t\t\t}\n\t\t}\n\n\t\tif (this.isDirty(\"zoomLevel\")) {\n\t\t\tprojection.scale(this.getPrivate(\"mapScale\") * this.get(\"zoomLevel\", 1));\n\t\t\tthis.markDirtyProjection();\n\n\t\t\tthis.series.each((series) => {\n\t\t\t\tif (series.isType(\"MapPointSeries\")) {\n\t\t\t\t\tif (series.get(\"autoScale\")) {\n\t\t\t\t\t\t$array.each(series.dataItems, (dataItem) => {\n\t\t\t\t\t\t\tconst bullets = dataItem.bullets;\n\t\t\t\t\t\t\tif (bullets) {\n\t\t\t\t\t\t\t\t$array.each(bullets, (bullet) => {\n\t\t\t\t\t\t\t\t\tconst sprite = bullet.get(\"sprite\");\n\t\t\t\t\t\t\t\t\tif (sprite) {\n\t\t\t\t\t\t\t\t\t\tsprite.set(\"scale\", this.get(\"zoomLevel\"));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\tif (this.isDirty(\"translateX\") || this.isDirty(\"translateY\")) {\n\t\t\tprojection.translate([this.get(\"translateX\", this.width() / 2), this.get(\"translateY\", this.height() / 2)])\n\t\t\tthis.markDirtyProjection();\n\t\t}\n\n\t\tif (projection.rotate) {\n\t\t\tif (this.isDirty(\"rotationX\") || this.isDirty(\"rotationY\") || this.isDirty(\"rotationZ\")) {\n\t\t\t\tprojection.rotate([this.get(\"rotationX\", 0), this.get(\"rotationY\", 0), this.get(\"rotationZ\", 0)])\n\t\t\t\tthis.markDirtyProjection();\n\t\t\t}\n\t\t}\n\n\t\tif (this.isDirty(\"pinchZoom\") || this.get(\"panX\") || this.get(\"panY\")) {\n\t\t\tthis._setUpTouch();\n\t\t}\n\t}\n\n\n\tprotected _fitMap() {\n\t\tconst projection = this.get(\"projection\")!;\n\n\t\tlet w = this.innerWidth();\n\t\tlet h = this.innerHeight();\n\n\t\tif (w > 0 && h > 0) {\n\t\t\tprojection.fitSize([w, h], this._geometryColection);\n\t\t\tthis.setPrivateRaw(\"mapScale\", projection.scale());\n\n\t\t\tconst translate = projection.translate();\n\n\t\t\tthis.setRaw(\"translateX\", translate[0]);\n\t\t\tthis.setRaw(\"translateY\", translate[1]);\n\n\t\t\tthis._centerX = translate[0];\n\t\t\tthis._centerY = translate[1];\n\n\t\t\tconst geoPath = this.getPrivate(\"geoPath\");\n\t\t\tthis._mapBounds = geoPath.bounds(this._geometryColection);\n\n\t\t\tthis._geoCentroid = $mapUtils.getGeoCentroid(this._geometryColection);\n\n\t\t\tconst bounds = $mapUtils.getGeoBounds(this._geometryColection);\n\t\t\tthis._geoBounds = bounds;\n\n\t\t\tif (this._geometryColection.geometries.length > 0) {\n\n\t\t\t\tbounds.left = $math.round(this._geoBounds.left, 3);\n\t\t\t\tbounds.right = $math.round(this._geoBounds.right, 3);\n\t\t\t\tbounds.top = $math.round(this._geoBounds.top, 3);\n\t\t\t\tbounds.bottom = $math.round(this._geoBounds.bottom, 3);\n\n\t\t\t\tconst prevGeoBounds = this._prevGeoBounds;\n\n\t\t\t\tif (prevGeoBounds && !$utils.sameBounds(bounds, prevGeoBounds)) {\n\t\t\t\t\tthis._dispatchBounds = true;\n\t\t\t\t\tthis._prevGeoBounds = bounds;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._mapFitted = true;\n\t\t}\n\t}\n\n\t/**\n\t * Returns geographical coordinates for calculated or manual center of the\n\t * map.\n\t */\n\tpublic homeGeoPoint(): IGeoPoint {\n\t\tlet homeGeoPoint = this.get(\"homeGeoPoint\");\n\t\tif (!homeGeoPoint) {\n\t\t\tconst geoPath = this.getPrivate(\"geoPath\");\n\t\t\tconst bounds = geoPath.bounds(this._geometryColection);\n\n\t\t\tconst left = bounds[0][0];\n\t\t\tconst top = bounds[0][1];\n\n\t\t\tconst right = bounds[1][0];\n\t\t\tconst bottom = bounds[1][1];\n\n\t\t\thomeGeoPoint = this.invert({ x: left + (right - left) / 2, y: top + (bottom - top) / 2 });\n\t\t}\n\t\treturn homeGeoPoint;\n\t}\n\n\t/**\n\t * Repositions the map to the \"home\" zoom level and center coordinates.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-pan-zoom/#Resetting_position_level} for more info\n\t * @param duration Animation duration in milliseconds\n\t */\n\tpublic goHome(duration?: number) {\n\t\tthis.zoomToGeoPoint(this.homeGeoPoint(), this.get(\"homeZoomLevel\", 1), true, duration);\n\t}\n\n\tpublic _updateChildren() {\n\t\tconst projection = this.get(\"projection\")!;\n\t\tif (projection.invert) {\n\t\t\tlet w = this.innerWidth();\n\t\t\tlet h = this.innerHeight();\n\t\t\tif (w > 0 && h > 0) {\n\t\t\t\tthis._centerLocation = projection.invert([this.innerWidth() / 2, this.innerHeight() / 2]);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic _afterChanged() {\n\t\tsuper._afterChanged();\n\t\tif (this._dispatchBounds) {\n\t\t\tthis._dispatchBounds = false;\n\t\t\tconst type = \"geoboundschanged\";\n\t\t\tif (this.events.isEnabled(type)) {\n\t\t\t\tthis.events.dispatch(type, { type: type, target: this });\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _setUpTouch(): void {\n\t\tif (!this.chartContainer._display.cancelTouch) {\n\t\t\tthis.chartContainer._display.cancelTouch = (this.get(\"pinchZoom\") || this.get(\"panX\") || this.get(\"panY\")) ? true : false;\n\t\t}\n\t}\n\n\n\t/**\n\t * @ignore\n\t */\n\tpublic markDirtyGeometries() {\n\t\tthis._dirtyGeometries = true;\n\t\tthis.markDirty();\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic markDirtyProjection() {\n\t\tthis.series.each((series) => {\n\t\t\tseries.markDirtyProjection();\n\t\t})\n\t}\n\n\tprotected _afterNew() {\n\t\tthis._defaultThemes.push(MapChartDefaultTheme.new(this._root));\n\t\tthis._settings.themeTags = $utils.mergeTags(this._settings.themeTags, [\"map\"]);\n\n\t\tsuper._afterNew();\n\n\t\tthis._makeGeoPath();\n\n\t\tthis.chartContainer.children.push(this.seriesContainer);\n\n\t\tif (this.get(\"translateX\") == null) {\n\t\t\tthis.set(\"translateX\", this.width() / 2);\n\t\t}\n\t\tif (this.get(\"translateY\") == null) {\n\t\t\tthis.set(\"translateY\", this.height() / 2);\n\t\t}\n\n\t\t// Setting trasnparent background so that full body of the plot container\n\t\t// is interactive\n\t\tthis.chartContainer.set(\"interactive\", true);\n\t\tthis.chartContainer.set(\"interactiveChildren\", false);\n\t\tthis.chartContainer.set(\"background\", Rectangle.new(this._root, {\n\t\t\tthemeTags: [\"map\", \"background\"],\n\t\t\tfill: Color.fromHex(0x000000),\n\t\t\tfillOpacity: 0\n\t\t}));\n\n\t\tthis._disposers.push(this.chartContainer.events.on(\"pointerdown\", (event) => {\n\t\t\tthis._handleChartDown(event);\n\t\t}));\n\n\t\tthis._disposers.push(this.chartContainer.events.on(\"globalpointerup\", (event) => {\n\t\t\tthis._handleChartUp(event);\n\t\t}));\n\n\t\tthis._disposers.push(this.chartContainer.events.on(\"globalpointermove\", (event) => {\n\t\t\tthis._handleChartMove(event);\n\t\t}));\n\n\t\tlet license = false;\n\t\tfor (let i = 0; i < registry.licenses.length; i++) {\n\t\t\tif (registry.licenses[i].match(/^AM5M.{5,}/i)) {\n\t\t\t\tlicense = true;\n\t\t\t}\n\t\t}\n\t\tif (!license) {\n\t\t\tthis._root._showBranding();\n\t\t}\n\n\t\tthis._setUpTouch();\n\n\t}\n\n\tprotected _handleChartDown(event: ISpritePointerEvent) {\n\n\t\tthis._downZoomLevel = this.get(\"zoomLevel\", 1);\n\n\n\t\tlet count = $object.keys(this.chartContainer._downPoints).length;\n\t\tif (count > 0) {\n\t\t\tthis._downTranslateX = this.get(\"translateX\");\n\t\t\tthis._downTranslateY = this.get(\"translateY\");\n\t\t\tthis._downRotationX = this.get(\"rotationX\");\n\t\t\tthis._downRotationY = this.get(\"rotationY\");\n\t\t\tthis._downRotationZ = this.get(\"rotationZ\");\n\n\t\t\tconst downId = this.chartContainer._getDownPointId();\n\t\t\tif (downId) {\n\t\t\t\tlet movePoint = this._movePoints[downId];\n\t\t\t\tif (movePoint) {\n\t\t\t\t\tthis.chartContainer._downPoints[downId] = movePoint;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if (count == 0) {\n\n\t\t\tlet bg = this.chartContainer.get(\"background\");\n\t\t\tif (bg) {\n\t\t\t\tbg.events.enableType(\"click\");\n\t\t\t}\n\n\t\t\tif (this.get(\"panX\") || this.get(\"panY\")) {\n\n\t\t\t\tif (this._za) {\n\t\t\t\t\tthis._za.stop();\n\t\t\t\t}\n\t\t\t\tif (this._txa) {\n\t\t\t\t\tthis._txa.stop();\n\t\t\t\t}\n\t\t\t\tif (this._tya) {\n\t\t\t\t\tthis._tya.stop();\n\t\t\t\t}\n\t\t\t\tif (this._rxa) {\n\t\t\t\t\tthis._rxa.stop();\n\t\t\t\t}\n\t\t\t\tif (this._rya) {\n\t\t\t\t\tthis._rya.stop();\n\t\t\t\t}\n\n\t\t\t\tconst downPoint = this.chartContainer._display.toLocal(event.point);\n\t\t\t\tthis._downTranslateX = this.get(\"translateX\");\n\t\t\t\tthis._downTranslateY = this.get(\"translateY\");\n\t\t\t\tthis._downRotationX = this.get(\"rotationX\");\n\t\t\t\tthis._downRotationY = this.get(\"rotationY\");\n\t\t\t\tthis._downRotationZ = this.get(\"rotationZ\");\n\n\t\t\t\tlet projection = this.get(\"projection\")!;\n\n\t\t\t\tif (projection.invert) {\n\t\t\t\t\tlet l0 = projection.invert([downPoint.x, downPoint.y]);\n\t\t\t\t\tlet l1 = projection.invert([downPoint.x + 1, downPoint.y + 1]);\n\t\t\t\t\tif (l0 && l1) {\n\t\t\t\t\t\tthis._pLon = Math.abs(l1[0] - l0[0]);\n\t\t\t\t\t\tthis._pLat = Math.abs(l1[1] - l0[1]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Converts screen coordinates (X and Y) within chart to latitude and\n\t * longitude.\n\t * \n\t * @param point Screen coordinates\n\t * @return Geographical coordinates\n\t */\n\tpublic invert(point: IPoint): IGeoPoint {\n\t\tlet projection = this.get(\"projection\")!;\n\n\t\tif (projection.invert) {\n\t\t\tconst ll = projection.invert([point.x, point.y]);\n\t\t\tif (ll) {\n\t\t\t\treturn { longitude: ll[0], latitude: ll[1] };\n\t\t\t}\n\t\t}\n\n\t\treturn { longitude: 0, latitude: 0 };\n\t}\n\n\t/**\n\t * Converts latitude/longitude to screen coordinates (X and Y).\n\t * \n\t * @param point Geographical coordinates\n\t * @return Screen coordinates\n\t */\n\tpublic convert(point: IGeoPoint): IPoint {\n\t\tlet projection = this.get(\"projection\")!;\n\n\t\tconst xy = projection([point.longitude, point.latitude]);\n\n\t\tif (xy) {\n\t\t\treturn { x: xy[0], y: xy[1] };\n\t\t}\n\n\t\treturn { x: 0, y: 0 };\n\t}\n\n\tprotected _handleChartUp(_event: ISpritePointerEvent) {\n\t\tthis.chartContainer._downPoints = {}\n\t}\n\n\tprotected _handlePinch() {\n\t\tconst chartContainer = this.chartContainer;\n\t\tlet i = 0;\n\t\tlet downPoints: Array = [];\n\t\tlet movePoints: Array = [];\n\n\t\t$object.each(chartContainer._downPoints, (k, point) => {\n\t\t\tdownPoints[i] = point;\n\t\t\tlet movePoint = this._movePoints[k];\n\t\t\tif (movePoint) {\n\t\t\t\tmovePoints[i] = movePoint;\n\t\t\t}\n\t\t\ti++;\n\t\t});\n\n\t\tif (downPoints.length > 1 && movePoints.length > 1) {\n\t\t\tconst display = chartContainer._display;\n\n\t\t\tlet downPoint0 = downPoints[0];\n\t\t\tlet downPoint1 = downPoints[1];\n\n\t\t\tlet movePoint0 = movePoints[0];\n\t\t\tlet movePoint1 = movePoints[1];\n\n\t\t\tif (downPoint0 && downPoint1 && movePoint0 && movePoint1) {\n\n\t\t\t\tdownPoint0 = display.toLocal(downPoint0);\n\t\t\t\tdownPoint1 = display.toLocal(downPoint1);\n\n\t\t\t\tmovePoint0 = display.toLocal(movePoint0);\n\t\t\t\tmovePoint1 = display.toLocal(movePoint1);\n\n\t\t\t\tlet initialDistance = Math.hypot(downPoint1.x - downPoint0.x, downPoint1.y - downPoint0.y);\n\t\t\t\tlet currentDistance = Math.hypot(movePoint1.x - movePoint0.x, movePoint1.y - movePoint0.y);\n\n\t\t\t\tlet level = currentDistance / initialDistance * this._downZoomLevel;\n\t\t\t\tlevel = $math.fitToRange(level, this.get(\"minZoomLevel\", 1), this.get(\"maxZoomLevel\", 32));\n\n\t\t\t\tlet moveCenter = { x: movePoint0.x + (movePoint1.x - movePoint0.x) / 2, y: movePoint0.y + (movePoint1.y - movePoint0.y) / 2 };\n\t\t\t\tlet downCenter = { x: downPoint0.x + (downPoint1.x - downPoint0.x) / 2, y: downPoint0.y + (downPoint1.y - downPoint0.y) / 2 };\n\n\t\t\t\tlet tx = this._downTranslateX || 0;\n\t\t\t\tlet ty = this._downTranslateY || 0;\n\n\t\t\t\tlet zoomLevel = this._downZoomLevel;\n\n\t\t\t\tlet xx = moveCenter.x - (- tx + downCenter.x) / zoomLevel * level;\n\t\t\t\tlet yy = moveCenter.y - (- ty + downCenter.y) / zoomLevel * level;\n\n\t\t\t\tthis.set(\"zoomLevel\", level);\n\t\t\t\tthis.set(\"translateX\", xx);\n\t\t\t\tthis.set(\"translateY\", yy);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _handleChartMove(event: ISpritePointerEvent) {\n\t\tconst chartContainer = this.chartContainer;\n\t\tlet downPoint = chartContainer._getDownPoint();\n\t\tconst downPointId = chartContainer._getDownPointId();\n\t\tconst originalEvent = event.originalEvent as any;\n\n\t\tconst pointerId = originalEvent.pointerId;\n\n\t\tif (this.get(\"pinchZoom\")) {\n\t\t\tif (pointerId) {\n\t\t\t\tthis._movePoints[pointerId] = event.point;\n\n\t\t\t\tif ($object.keys(chartContainer._downPoints).length > 1) {\n\t\t\t\t\tthis._handlePinch();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (downPointId && pointerId && pointerId != downPointId) {\n\t\t\treturn;\n\t\t}\n\t\telse {\n\t\t\tif (downPoint) {\n\t\t\t\tconst panX = this.get(\"panX\");\n\t\t\t\tconst panY = this.get(\"panY\");\n\t\t\t\tif (panX != \"none\" || panY != \"none\") {\n\t\t\t\t\tconst display = chartContainer._display;\n\t\t\t\t\tlet local = display.toLocal(event.point);\n\t\t\t\t\tdownPoint = display.toLocal(downPoint);\n\n\t\t\t\t\tlet x = this._downTranslateX;\n\t\t\t\t\tlet y = this._downTranslateY;\n\n\t\t\t\t\tif (Math.hypot(downPoint.x - local.x, downPoint.y - local.y) > 5) {\n\t\t\t\t\t\tlet bg = chartContainer.get(\"background\");\n\t\t\t\t\t\tif (bg) {\n\t\t\t\t\t\t\tbg.events.disableType(\"click\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($type.isNumber(x) && $type.isNumber(y)) {\n\t\t\t\t\t\t\tlet projection = this.get(\"projection\")!;\n\t\t\t\t\t\t\tconst zoomLevel = this.get(\"zoomLevel\", 1);\n\n\t\t\t\t\t\t\tconst maxPanOut = this.get(\"maxPanOut\", 0.4);\n\t\t\t\t\t\t\tconst bounds = this._mapBounds;\n\t\t\t\t\t\t\tconst w = this.width();\n\t\t\t\t\t\t\tconst h = this.height();\n\n\t\t\t\t\t\t\tconst ww = bounds[1][0] - bounds[0][0];\n\t\t\t\t\t\t\tconst hh = bounds[1][1] - bounds[0][1];\n\n\t\t\t\t\t\t\tif (panX == \"translateX\") {\n\t\t\t\t\t\t\t\tx += local.x - downPoint.x;\n\n\t\t\t\t\t\t\t\tconst cx = w / 2 - (w / 2 - this._centerX) * zoomLevel;\n\t\t\t\t\t\t\t\tx = Math.min(x, cx + ww * maxPanOut * zoomLevel);\n\t\t\t\t\t\t\t\tx = Math.max(x, cx - ww * maxPanOut * zoomLevel);\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (panY == \"translateY\") {\n\t\t\t\t\t\t\t\ty += local.y - downPoint.y;\n\t\t\t\t\t\t\t\tconst cy = h / 2 - (h / 2 - this._centerY) * zoomLevel;\n\t\t\t\t\t\t\t\ty = Math.min(y, cy + hh * maxPanOut * zoomLevel);\n\t\t\t\t\t\t\t\ty = Math.max(y, cy - hh * maxPanOut * zoomLevel);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tthis.set(\"translateX\", x);\n\t\t\t\t\t\t\tthis.set(\"translateY\", y);\n\n\t\t\t\t\t\t\tif (projection.invert) {\n\t\t\t\t\t\t\t\tlet downLocation = projection.invert([downPoint.x, downPoint.y]);\n\t\t\t\t\t\t\t\tif (location && downLocation) {\n\t\t\t\t\t\t\t\t\tif (panX == \"rotateX\") {\n\t\t\t\t\t\t\t\t\t\tthis.set(\"rotationX\", this._downRotationX! - (downPoint.x - local.x) * this._pLon);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (panY == \"rotateY\") {\n\t\t\t\t\t\t\t\t\t\tthis.set(\"rotationY\", this._downRotationY! + (downPoint.y - local.y) * this._pLat);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _handleWheelRotateY(delta: number, duration: number, easing: (t: Time) => Time) {\n\t\tthis._rya = this.animate({ key: \"rotationY\", to: this.get(\"rotationY\", 0) - delta, duration: duration, easing: easing });\n\t}\n\n\tprotected _handleWheelRotateX(delta: number, duration: number, easing: (t: Time) => Time) {\n\t\tthis._rxa = this.animate({ key: \"rotationX\", to: this.get(\"rotationX\", 0) - delta, duration: duration, easing: easing });\n\t}\n\n\tprotected _handleWheelZoom(delta: number, point: IPoint) {\n\t\tlet step = this.get(\"zoomStep\", 2);\n\t\tlet zoomLevel = this.get(\"zoomLevel\", 1);\n\t\tlet newZoomLevel = zoomLevel;\n\t\tif (delta > 0) {\n\t\t\tnewZoomLevel = zoomLevel / step;\n\t\t}\n\t\telse if (delta < 0) {\n\t\t\tnewZoomLevel = zoomLevel * step;\n\t\t}\n\n\t\tif (newZoomLevel != zoomLevel) {\n\t\t\tthis.zoomToPoint(point, newZoomLevel)\n\t\t}\n\t}\n\n\t/**\n\t * Zoom the map to geographical bounds.\n\t *\n\t * @param geoBounds Bounds\n\t * @param duration Animation duration in milliseconds\n\t */\n\tpublic zoomToGeoBounds(geoBounds: { left: number, right: number, top: number, bottom: number }, duration?: number): Animation | undefined {\n\t\tif (geoBounds.right < geoBounds.left) {\n\t\t\tgeoBounds.right = 180;\n\t\t\tgeoBounds.left = -180;\n\t\t}\n\n\t\tconst geoPath = this.getPrivate(\"geoPath\");\n\t\tconst mapBounds = geoPath.bounds(this._geometryColection);\n\n\t\tlet p0 = this.convert({ longitude: geoBounds.left, latitude: geoBounds.top });\n\t\tlet p1 = this.convert({ longitude: geoBounds.right, latitude: geoBounds.bottom });\n\n\t\tif (p0.y < mapBounds[0][1]) {\n\t\t\tp0.y = mapBounds[0][1];\n\t\t}\n\n\t\tif (p1.y > mapBounds[1][1]) {\n\t\t\tp1.y = mapBounds[1][1];\n\t\t}\n\n\t\tlet zl = this.get(\"zoomLevel\", 1);\n\n\t\tlet bounds = { left: p0.x, right: p1.x, top: p0.y, bottom: p1.y };\n\n\t\tlet seriesContainer = this.seriesContainer;\n\n\t\tlet zoomLevel = .9 * Math.min(seriesContainer.innerWidth() / (bounds.right - bounds.left) * zl, seriesContainer.innerHeight() / (bounds.bottom - bounds.top) * zl);\n\t\tlet x = bounds.left + (bounds.right - bounds.left) / 2;\n\t\tlet y = bounds.top + (bounds.bottom - bounds.top) / 2;\n\n\t\tlet geoPoint = this.invert({ x, y });\n\n\t\treturn this.zoomToGeoPoint(geoPoint, zoomLevel, true, duration);\n\t}\n\n\t/**\n\t * Zooms the map to specific screen point.\n\t *\n\t * @param point Point\n\t * @param level Zoom level\n\t * @param center Center the map\n\t * @param duration Duration of the animation in milliseconds\n\t */\n\tpublic zoomToPoint(point: IPoint, level: number, center?: boolean, duration?: number): Animation | undefined {\n\t\tif (level) {\n\t\t\tlevel = $math.fitToRange(level, this.get(\"minZoomLevel\", 1), this.get(\"maxZoomLevel\", 32));\n\t\t}\n\n\t\tif (!$type.isNumber(duration)) {\n\t\t\tduration = this.get(\"animationDuration\", 0);\n\t\t}\n\t\tconst easing = this.get(\"animationEasing\");\n\t\tconst zoomLevel = this.get(\"zoomLevel\", 1);\n\n\t\tif (this.get(\"centerMapOnZoomOut\") && level == this.get(\"homeZoomLevel\", 1)) {\n\t\t\tpoint = this.convert(this.homeGeoPoint());\n\t\t\tcenter = true;\n\t\t}\n\n\t\tlet x = point.x;\n\t\tlet y = point.y;\n\n\t\tlet tx = this.get(\"translateX\", 0);\n\t\tlet ty = this.get(\"translateY\", 0);\n\n\t\tlet cx = x;\n\t\tlet cy = y;\n\n\t\tif (center) {\n\t\t\tcx = this.width() / 2;\n\t\t\tcy = this.height() / 2;\n\t\t}\n\n\t\tlet xx = cx - ((x - tx) / zoomLevel * level);\n\t\tlet yy = cy - ((y - ty) / zoomLevel * level);\n\n\n\t\tthis._txa = this.animate({ key: \"translateX\", to: xx, duration: duration, easing: easing });\n\t\tthis._tya = this.animate({ key: \"translateY\", to: yy, duration: duration, easing: easing });\n\t\tthis._za = this.animate({ key: \"zoomLevel\", to: level, duration: duration, easing: easing });\n\n\t\tif (zoomLevel != level) {\n\t\t\tthis._root.readerAlert(this._t(\"Zoom level changed to %1\", this._root.locale, $type.numberToString(level)));\n\t\t}\n\n\t\treturn this._za;\n\t}\n\n\t/**\n\t * Zooms the map to specific geographical point.\n\t *\n\t * @param geoPoint Point\n\t * @param level Zoom level\n\t * @param center Center the map\n\t * @param duration Duration of the animation in milliseconds\n\t */\n\tpublic zoomToGeoPoint(geoPoint: IGeoPoint, level: number, center?: boolean, duration?: number): Animation | undefined {\n\t\tlet xy = this.convert(geoPoint);\n\n\t\tif (xy) {\n\t\t\treturn this.zoomToPoint(xy, level, center, duration);\n\t\t}\n\t}\n\n\t/**\n\t * Zooms the map in.\n\t */\n\tpublic zoomIn(): Animation | undefined {\n\t\treturn this.zoomToPoint({ x: this.width() / 2, y: this.height() / 2 }, this.get(\"zoomLevel\", 1) * this.get(\"zoomStep\", 2));\n\t}\n\n\t/**\n\t * Zooms the map out.\n\t */\n\tpublic zoomOut(): Animation | undefined {\n\t\treturn this.zoomToPoint({ x: this.width() / 2, y: this.height() / 2 }, this.get(\"zoomLevel\", 1) / this.get(\"zoomStep\", 2));\n\t}\n\n\tpublic _clearDirty() {\n\t\tsuper._clearDirty();\n\t\tthis._dirtyGeometries = false;\n\t\tthis._mapFitted = false;\n\t}\n}\n","import identity from \"../identity.js\";\nimport stream from \"../stream.js\";\nimport pathArea from \"./area.js\";\nimport pathBounds from \"./bounds.js\";\nimport pathCentroid from \"./centroid.js\";\nimport PathContext from \"./context.js\";\nimport pathMeasure from \"./measure.js\";\nimport PathString from \"./string.js\";\n\nexport default function(projection, context) {\n var pointRadius = 4.5,\n projectionStream,\n contextStream;\n\n function path(object) {\n if (object) {\n if (typeof pointRadius === \"function\") contextStream.pointRadius(+pointRadius.apply(this, arguments));\n stream(object, projectionStream(contextStream));\n }\n return contextStream.result();\n }\n\n path.area = function(object) {\n stream(object, projectionStream(pathArea));\n return pathArea.result();\n };\n\n path.measure = function(object) {\n stream(object, projectionStream(pathMeasure));\n return pathMeasure.result();\n };\n\n path.bounds = function(object) {\n stream(object, projectionStream(pathBounds));\n return pathBounds.result();\n };\n\n path.centroid = function(object) {\n stream(object, projectionStream(pathCentroid));\n return pathCentroid.result();\n };\n\n path.projection = function(_) {\n return arguments.length ? (projectionStream = _ == null ? (projection = null, identity) : (projection = _).stream, path) : projection;\n };\n\n path.context = function(_) {\n if (!arguments.length) return context;\n contextStream = _ == null ? (context = null, new PathString) : new PathContext(context = _);\n if (typeof pointRadius !== \"function\") contextStream.pointRadius(pointRadius);\n return path;\n };\n\n path.pointRadius = function(_) {\n if (!arguments.length) return pointRadius;\n pointRadius = typeof _ === \"function\" ? _ : (contextStream.pointRadius(+_), +_);\n return path;\n };\n\n return path.projection(projection).context(context);\n}\n","import type { IMapLineSeriesDataItem, MapLineSeries } from \"./MapLineSeries\";\nimport type { IMapPolygonSeriesDataItem, MapPolygonSeries } from \"./MapPolygonSeries\";\nimport type { Bullet } from \"../../core/render/Bullet\";\nimport type { DataItem } from \"../../core/render/Component\";\nimport type { MapLine } from \"./MapLine\";\nimport type { MapPolygon } from \"./MapPolygon\";\n\nimport { MapSeries, IMapSeriesSettings, IMapSeriesDataItem, IMapSeriesPrivate } from \"./MapSeries\";\n\nimport * as $array from \"../../core/util/Array\";\nimport * as $type from \"../../core/util/Type\";\nimport * as $math from \"../../core/util/Math\";\nimport type { Animation } from \"../../core/util/Entity\";\n\nexport interface IMapPointSeriesPrivate extends IMapSeriesPrivate {\n}\n\nexport interface IMapPointSeriesDataItem extends IMapSeriesDataItem {\n\n\t/**\n\t * GeoJSON geometry of the point.\n\t */\n\tgeometry?: GeoJSON.Point | GeoJSON.MultiPoint;\n\n\t/**\n\t * Longitude.\n\t */\n\tlongitude?: number;\n\n\t/**\n\t * Latitude.\n\t */\n\tlatitude?: number;\n\n\t/**\n\t * Relative position (0-1) on the [[MapLine]] to place point on.\n\t */\n\tpositionOnLine?: number;\n\n\t/**\n\t * Automatically rotate the point bullet to face the direction of the line\n\t * it is attached to.\n\t */\n\tautoRotate?: boolean;\n\n\t/**\n\t * The angle will be added to the automatically-calculated angle.\n\t *\n\t * Can be used to reverse the direction.\n\t */\n\tautoRotateAngle?: number;\n\n\t/**\n\t * A data item from a [[MapLineSeries]] the point is attached to.\n\t */\n\tlineDataItem?: DataItem;\n\n\t/**\n\t * An ID of a [[MapLine]] the point is attached to.\n\t */\n\tlineId?: string;\n\n\t/**\n\t * A data item from a [[MapPolygonSeries]] to use for positioning of the\n\t * point.\n\t */\n\tpolygonDataItem?: DataItem;\n\n\t/**\n\t * An ID of the [[MapPolygon]] to use for centering the point.\n\t */\n\tpolygonId?: string;\n}\n\nexport interface IMapPointSeriesSettings extends IMapSeriesSettings {\n\n\t/**\n\t * A field in data that holds an ID of the related polygon.\n\t *\n\t * If set, the point will be positioned in the visual center of the target\n\t * polygon.\n\t */\n\tpolygonIdField?: string;\n\n\t/**\n\t * If set to `true` will hide all points that are in the visible range of\n\t * the map.\n\t */\n\tclipFront?: boolean;\n\n\t/**\n\t * If set to `true` will hide all points that are in the invisible range of\n\t * the map.\n\t *\n\t * For example on the side of the globe facing away from the viewer when\n\t * used with Orthographic projection.\n\t *\n\t * NOTE: not all projections have invisible side.\n\t *\n\t * @default true\n\t */\n\tclipBack?: boolean;\n\n\t/**\n\t * A field in data that holds point's longitude.\n\t */\n\tlatitudeField?: string;\n\n\t/**\n\t * A field in data that holds point's longitude.\n\t */\n\tlongitudeField?: string;\n\n\n\t/**\n\t * @todo review\n\t * @default false\n\t */\n\tautoScale?:boolean\n};\n\n/**\n * Creates a map series for displaying markers on the map.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-point-series/} for more info\n * @important\n */\nexport class MapPointSeries extends MapSeries {\n\n\tpublic static className: string = \"MapPointSeries\";\n\tpublic static classNames: Array = MapSeries.classNames.concat([MapPointSeries.className]);\n\n\tdeclare public _settings: IMapPointSeriesSettings;\n\tdeclare public _privateSettings: IMapPointSeriesPrivate;\n\tdeclare public _dataItemSettings: IMapPointSeriesDataItem;\n\n\tprotected _types: Array = [\"Point\", \"MultiPoint\"];\n\n\tprotected _afterNew() {\n\t\tthis.fields.push(\"polygonId\", \"lineId\", \"longitude\", \"latitude\");\n\t\tsuper._afterNew();\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic markDirtyProjection() {\n\t\tthis.markDirty();\n\t}\n\n\t/**\n\t * Forces a repaint of the element which relies on data.\n\t *\n\t * @since 5.0.21\n\t */\n\tpublic markDirtyValues(dataItem: DataItem) {\n\t\tsuper.markDirtyValues();\n\n\t\tif (dataItem) {\n\t\t\tthis._positionBullets(dataItem);\n\t\t}\n\t}\n\n\tprotected processDataItem(dataItem: DataItem) {\n\t\tsuper.processDataItem(dataItem);\n\t\tconst geometry = dataItem.get(\"geometry\");\n\t\tif (!geometry) {\n\t\t\tdataItem.set(\"geometry\", { type: \"Point\", coordinates: [dataItem.get(\"longitude\", 0), dataItem.get(\"latitude\", 0)] });\n\t\t}\n\t\telse {\n\t\t\tif (geometry.type == \"Point\") {\n\t\t\t\tconst coordinates = geometry.coordinates;\n\t\t\t\tif (coordinates) {\n\t\t\t\t\tdataItem.set(\"longitude\", coordinates[0]);\n\t\t\t\t\tdataItem.set(\"latitude\", coordinates[1]);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (geometry.type == \"MultiPoint\") {\n\t\t\t\tconst coordinates = geometry.coordinates;\n\t\t\t\tif (coordinates && coordinates[0]) {\n\t\t\t\t\tdataItem.set(\"longitude\", coordinates[0][0]);\n\t\t\t\t\tdataItem.set(\"latitude\", coordinates[0][1]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _makeBullets(dataItem: DataItem) {\n\t\tdataItem.bullets = [];\n\n\t\tthis.bullets.each((bulletFunction) => {\n\t\t\tconst geometry = dataItem.get(\"geometry\");\n\n\t\t\tif (geometry) {\n\t\t\t\tif (geometry.type == \"Point\") {\n\t\t\t\t\tthis._makeBullet(dataItem, bulletFunction);\n\t\t\t\t}\n\t\t\t\telse if (geometry.type = \"MultiPoint\") {\n\t\t\t\t\tlet i = 0;\n\t\t\t\t\t$array.each(geometry.coordinates, () => {\n\t\t\t\t\t\tthis._makeBullet(dataItem, bulletFunction, i);\n\t\t\t\t\t\ti++;\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\n\tpublic _positionBullet(bullet: Bullet) {\n\t\tconst sprite = bullet.get(\"sprite\");\n\t\tif (sprite) {\n\t\t\tconst dataItem = sprite.dataItem as DataItem;\n\n\t\t\tconst latitude = dataItem.get(\"latitude\");\n\t\t\tconst longitude = dataItem.get(\"longitude\");\n\t\t\tconst lineDataItem = dataItem.get(\"lineDataItem\");\n\t\t\tconst chart = this.chart;\n\t\t\tlet line: MapLine | undefined;\n\t\t\tif (lineDataItem) {\n\t\t\t\tline = lineDataItem.get(\"mapLine\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconst lineId = dataItem.get(\"lineId\");\n\n\t\t\t\tif (lineId && chart) {\n\t\t\t\t\tchart.series.each((series) => {\n\t\t\t\t\t\tif (series.isType(\"MapLineSeries\")) {\n\t\t\t\t\t\t\tlet lineDI = series.getDataItemById(lineId);\n\t\t\t\t\t\t\tif (lineDI) {\n\t\t\t\t\t\t\t\tdataItem.set(\"lineDataItem\", lineDI);\n\t\t\t\t\t\t\t\tline = lineDI.get(\"mapLine\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\tconst polygonDataItem = dataItem.get(\"polygonDataItem\");\n\t\t\tlet polygon: MapPolygon | undefined;\n\t\t\tif (polygonDataItem) {\n\t\t\t\tpolygon = polygonDataItem.get(\"mapPolygon\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconst polygonId = dataItem.get(\"polygonId\");\n\n\t\t\t\tif (polygonId && chart) {\n\t\t\t\t\tchart.series.each((series) => {\n\t\t\t\t\t\tif (series.isType(\"MapPolygonSeries\")) {\n\t\t\t\t\t\t\tlet polygonDI = series.getDataItemById(polygonId);\n\t\t\t\t\t\t\tif (polygonDI) {\n\t\t\t\t\t\t\t\tdataItem.set(\"polygonDataItem\", polygonDI);\n\t\t\t\t\t\t\t\tpolygon = polygonDI.get(\"mapPolygon\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst positionOnLine = dataItem.get(\"positionOnLine\");\n\t\t\tlet coordinates: [number, number] | undefined;\n\n\t\t\tlet angle: number | undefined;\n\n\t\t\tif (polygon) {\n\t\t\t\tlet geoPoint = polygon.visualCentroid();\n\t\t\t\tcoordinates = [geoPoint.longitude, geoPoint.latitude];\n\t\t\t}\n\t\t\telse if (line && $type.isNumber(positionOnLine)) {\n\t\t\t\tlet geoPoint = line.positionToGeoPoint(positionOnLine);\n\t\t\t\tcoordinates = [geoPoint.longitude, geoPoint.latitude];\n\n\t\t\t\tif (dataItem.get(\"autoRotate\", bullet.get(\"autoRotate\")) && chart) {\n\t\t\t\t\tconst geoPoint0 = line.positionToGeoPoint(positionOnLine - 0.002);\n\t\t\t\t\tconst geoPoint1 = line.positionToGeoPoint(positionOnLine + 0.002);\n\n\t\t\t\t\tconst point0 = chart.convert(geoPoint0);\n\t\t\t\t\tconst point1 = chart.convert(geoPoint1);\n\n\t\t\t\t\t//dataItem.set(\"autoRotateAngle\", $math.getAngle(point0, point1));\n\t\t\t\t\tangle = $math.getAngle(point0, point1);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ($type.isNumber(longitude) && $type.isNumber(latitude)) {\n\t\t\t\tcoordinates = [longitude, latitude];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconst geometry = dataItem.get(\"geometry\")!;\n\t\t\t\tif (geometry) {\n\t\t\t\t\tif (geometry.type == \"Point\") {\n\t\t\t\t\t\tthis._positionBulletReal(bullet, geometry, geometry.coordinates as [number, number], angle);\n\t\t\t\t\t}\n\t\t\t\t\telse if (geometry.type == \"MultiPoint\") {\n\t\t\t\t\t\tlet index = bullet._index || 0;\n\t\t\t\t\t\tcoordinates = geometry.coordinates[index] as [number, number];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (coordinates) {\n\t\t\t\tthis._positionBulletReal(bullet, { type: \"Point\", coordinates: coordinates }, coordinates, angle);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _positionBulletReal(bullet: Bullet, geometry: GeoJSON.Geometry, coordinates: [number, number], angle?: number) {\n\t\tconst sprite = bullet.get(\"sprite\");\n\t\tconst chart = this.chart;\n\t\tif (chart) {\n\t\t\tconst projection = chart.get(\"projection\")!;\n\t\t\tconst geoPath = chart.getPrivate(\"geoPath\");\n\t\t\tconst dataItem: DataItem = sprite.dataItem as DataItem;\n\n\t\t\tconst xy = projection(coordinates as any);\n\n\t\t\tif (xy) {\n\t\t\t\tsprite.setAll({ x: xy[0], y: xy[1] });\n\t\t\t}\n\n\t\t\tlet visible = true;\n\t\t\tif (geoPath(geometry)) {\n\t\t\t\tif (this.get(\"clipFront\")) {\n\t\t\t\t\tvisible = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (this.get(\"clipBack\")) {\n\t\t\t\t\tvisible = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tsprite.setPrivate(\"visible\", visible);\n\n\t\t\tif (dataItem && angle != null && dataItem.get(\"autoRotate\", bullet.get(\"autoRotate\"))) {\n\t\t\t\tsprite.set(\"rotation\", angle + dataItem.get(\"autoRotateAngle\", bullet.get(\"autoRotateAngle\", 0)));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Centers the map to specific series' data item and zooms to the level\n\t * specified in the parameters.\n\t *\n\t * @param dataItem Map point\n\t * @param zoomLevel Zoom level\n\t */\n\tpublic zoomToDataItem(dataItem: DataItem, zoomLevel: number): Animation | undefined {\n\t\tconst chart = this.chart;\n\t\tif (chart) {\n\t\t\treturn chart.zoomToGeoPoint({ longitude: dataItem.get(\"longitude\", 0), latitude: dataItem.get(\"latitude\", 0) }, zoomLevel, true);\n\t\t}\n\t}\n\n}\n","import { Graphics, IGraphicsSettings, IGraphicsPrivate } from \"../../core/render/Graphics\";\nimport type { MapPolygonSeries } from \"./MapPolygonSeries\";\nimport type { IGeoPoint } from \"../../core/util/IGeoPoint\";\nimport type { IPoint } from \"../../core/util/IPoint\";\nimport * as $mapUtils from \"./MapUtils\";\nimport $polylabel from \"polylabel\";\nimport { geoArea } from \"d3-geo\";\n\nexport interface IMapPolygonSettings extends IGraphicsSettings {\n\n\t/**\n\t * A GeoJSON representation of the polygons geometry.\n\t */\n\tgeometry?: GeoJSON.MultiPolygon | GeoJSON.Polygon;\n\n\t/**\n\t * @todo needs description\n\t * @default 0.5\n\t */\n\tprecision?: number;\n\n}\n\nexport interface IMapPolygonPrivate extends IGraphicsPrivate {\n}\n\n/**\n * A polygon in a [[MapPolygonSeries]].\n */\nexport class MapPolygon extends Graphics {\n\n\tdeclare public _settings: IMapPolygonSettings;\n\tdeclare public _privateSettings: IMapPolygonPrivate;\n\n\tpublic static className: string = \"MapPolygon\";\n\tpublic static classNames: Array = Graphics.classNames.concat([MapPolygon.className]);\n\tprotected _projectionDirty: boolean = false;\n\n\t/**\n\t * A [[MapPolygonSeries]] polygon belongs to.\n\t */\n\tpublic series: MapPolygonSeries | undefined;\n\n\tpublic _beforeChanged() {\n\t\tsuper._beforeChanged();\n\n\t\tif (this._projectionDirty || this.isDirty(\"geometry\") || this.isDirty(\"precision\")) {\n\t\t\tconst geometry = this.get(\"geometry\")!;\n\n\t\t\tif (geometry) {\n\t\t\t\tconst series = this.series;\n\t\t\t\tif (series) {\n\t\t\t\t\tconst projection = series.projection();\n\t\t\t\t\tif (projection) {\n\t\t\t\t\t\tprojection.precision(this.get(\"precision\", 0.5));\n\t\t\t\t\t}\n\n\t\t\t\t\tconst geoPath = series.geoPath();\n\n\t\t\t\t\tif (geoPath) {\n\t\t\t\t\t\tthis._clear = true;\n\n\t\t\t\t\t\tthis.set(\"draw\", (_display) => {\n\t\t\t\t\t\t\tgeoPath.context(this._display as any);\n\t\t\t\t\t\t\tgeoPath(geometry);\n\t\t\t\t\t\t\tgeoPath.context(null);\n\t\t\t\t\t\t})\n\n\t\t\t\t\t\tif (this.isHover()) {\n\t\t\t\t\t\t\tthis.showTooltip();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic markDirtyProjection() {\n\t\tthis.markDirty();\n\t\tthis._projectionDirty = true;\n\t}\n\n\tpublic _clearDirty() {\n\t\tsuper._clearDirty();\n\t\tthis._projectionDirty = false;\n\t}\n\n\t/**\n\t * Returns latitude/longitude of the geometrical center of the polygon.\n\t *\n\t * @return Center\n\t */\n\tpublic geoCentroid(): IGeoPoint {\n\t\tconst geometry = this.get(\"geometry\")!;\n\t\tif (geometry) {\n\t\t\treturn $mapUtils.getGeoCentroid(geometry);\n\t\t}\n\t\telse {\n\t\t\treturn { latitude: 0, longitude: 0 };\n\t\t}\n\t}\n\n\t/**\n\t * Returns latitude/longitude of the visual center of the polygon.\n\t *\n\t * @return Center\n\t */\n\tpublic visualCentroid(): IGeoPoint {\n\n\t\tlet biggestArea = 0;\n\t\tlet coordinates: number[][][] = [];\n\t\tconst geometry = this.get(\"geometry\")!;\n\n\t\tif (geometry) {\n\t\t\tif (geometry.type == \"Polygon\") {\n\t\t\t\tcoordinates = geometry.coordinates as number[][][];\n\t\t\t}\n\t\t\telse if (geometry.type == \"MultiPolygon\") {\n\t\t\t\tfor (let i = 0; i < geometry.coordinates.length; i++) {\n\t\t\t\t\tlet coords = geometry.coordinates[i] as number[][][];\n\t\t\t\t\tlet area = geoArea({ type: \"Polygon\", coordinates: coords });\n\t\t\t\t\tif (area > biggestArea) {\n\t\t\t\t\t\tcoordinates = coords;\n\t\t\t\t\t\tbiggestArea = area;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet center = $polylabel(coordinates as number[][][]);\n\t\t\treturn { longitude: center[0], latitude: center[1] };\n\n\t\t}\n\t\treturn { longitude: 0, latitude: 0 };\n\t}\n\n\n\tpublic _getTooltipPoint(): IPoint {\n\t\tconst series = this.series;\n\n\t\tif (series) {\n\t\t\tconst projection = series.projection();\n\t\t\tif (projection) {\n\t\t\t\tconst geoPoint = this.visualCentroid();\n\t\t\t\tconst xy = projection([geoPoint.longitude, geoPoint.latitude]);\n\n\t\t\t\tif (xy) {\n\t\t\t\t\treturn { x: xy[0], y: xy[1] }\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn { x: 0, y: 0 };\n\t}\n}\n","import type { DataItem } from \"../../core/render/Component\";\n\nimport { MapSeries, IMapSeriesSettings, IMapSeriesDataItem, IMapSeriesPrivate } from \"./MapSeries\";\nimport { MapPolygon } from \"./MapPolygon\";\nimport { Template } from \"../../core/util/Template\";\nimport { ListTemplate } from \"../../core/util/List\";\n\nimport * as $array from \"../../core/util/Array\";\nimport * as $mapUtils from \"./MapUtils\";\nimport type { Animation } from \"../../core/util/Entity\";\n\nexport interface IMapPolygonSeriesPrivate extends IMapSeriesPrivate {\n}\n\nexport interface IMapPolygonSeriesDataItem extends IMapSeriesDataItem {\n\n\t/**\n\t * Related [[MapPolygon]] object.\n\t */\n\tmapPolygon: MapPolygon;\n\n\t/**\n\t * GeoJSON geometry of the polygon.\n\t */\n\tgeometry?: GeoJSON.Polygon | GeoJSON.MultiPolygon;\n\n}\n\nexport interface IMapPolygonSeriesSettings extends IMapSeriesSettings {\n\n}\n\n/**\n * Creates a map series for displaying polygons.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-polygon-series/} for more info\n * @important\n */\nexport class MapPolygonSeries extends MapSeries {\n\n\t/**\n\t * @ignore\n\t */\n\tpublic makeMapPolygon(dataItem: DataItem): MapPolygon {\n\t\tconst mapPolygon = this.children.push(this.mapPolygons.make());\n\t\tmapPolygon._setDataItem(dataItem);\n\t\tthis.mapPolygons.push(mapPolygon);\n\t\treturn mapPolygon;\n\t}\n\n\t/**\n\t * A [[ListTemplate]] of all polygons in series.\n\t *\n\t * `mapPolygons.template` can also be used to configure polygons.\n\t *\n\t * @default new ListTemplate\n\t */\n\tpublic readonly mapPolygons: ListTemplate = new ListTemplate(\n\t\tTemplate.new({}),\n\t\t() => MapPolygon._new(this._root, {}, [this.mapPolygons.template])\n\t);\n\n\tpublic static className: string = \"MapPolygonSeries\";\n\tpublic static classNames: Array = MapSeries.classNames.concat([MapPolygonSeries.className]);\n\n\tdeclare public _settings: IMapPolygonSeriesSettings;\n\tdeclare public _privateSettings: IMapPolygonSeriesPrivate;\n\tdeclare public _dataItemSettings: IMapPolygonSeriesDataItem;\n\n\tprotected _types: Array = [\"Polygon\", \"MultiPolygon\"];\n\n\t/**\n\t * @ignore\n\t */\n\tpublic markDirtyProjection() {\n\t\t$array.each(this.dataItems, (dataItem) => {\n\t\t\tlet mapPolygon = dataItem.get(\"mapPolygon\");\n\t\t\tif (mapPolygon) {\n\t\t\t\tmapPolygon.markDirtyProjection();\n\t\t\t}\n\t\t})\n\t}\n\n\tpublic _prepareChildren() {\n\t\tsuper._prepareChildren();\n\n\t\tif (this.isDirty(\"fill\")) {\n\t\t\tthis.mapPolygons.template.set(\"fill\", this.get(\"fill\"));\n\t\t}\n\t\tif (this.isDirty(\"stroke\")) {\n\t\t\tthis.mapPolygons.template.set(\"stroke\", this.get(\"stroke\"));\n\t\t}\n\t}\n\n\tprotected processDataItem(dataItem: DataItem) {\n\t\tsuper.processDataItem(dataItem);\n\n\t\tlet mapPolygon = dataItem.get(\"mapPolygon\");\n\t\tif (!mapPolygon) {\n\t\t\tmapPolygon = this.makeMapPolygon(dataItem);\n\t\t}\n\n\t\tdataItem.set(\"mapPolygon\", mapPolygon);\n\t\tconst geometry = dataItem.get(\"geometry\")!;\n\n\t\tif (geometry) {\n\t\t\tmapPolygon.set(\"geometry\", geometry);\n\t\t}\n\n\t\tmapPolygon.series = this;\n\n\t\tthis._addGeometry(dataItem.get(\"geometry\"));\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic disposeDataItem(dataItem: DataItem) {\n\t\tsuper.disposeDataItem(dataItem);\n\t\tconst mapPolygon = dataItem.get(\"mapPolygon\");\n\t\tif (mapPolygon) {\n\t\t\tthis.mapPolygons.removeValue(mapPolygon);\n\t\t\tmapPolygon.dispose();\n\t\t}\n\t\tthis._removeGeometry(dataItem.get(\"geometry\"));\n\t}\n\n\n\t/**\n\t * Forces a repaint of the element which relies on data.\n\t *\n\t * @since 5.0.21\n\t */\n\tpublic markDirtyValues(dataItem: DataItem) {\n\t\tsuper.markDirtyValues();\n\t\tif (dataItem) {\n\t\t\tconst mapPolygon = dataItem.get(\"mapPolygon\");\n\t\t\tif (mapPolygon) {\n\t\t\t\tmapPolygon.set(\"geometry\", dataItem.get(\"geometry\"));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Centers and zooms in on the specific polygon.\n\t *\n\t * @param dataItem Target data item\n\t * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-pan-zoom/#Zooming_to_clicked_object} for more info\n\t */\n\tpublic zoomToDataItem(dataItem: DataItem):Animation | undefined {\n\t\tconst polygon = dataItem.get(\"mapPolygon\");\n\t\tif (polygon) {\n\t\t\tconst geometry = polygon.get(\"geometry\");\n\t\t\tconst chart = this.chart;\n\t\t\tif (geometry && chart) {\n\t\t\t\treturn chart.zoomToGeoBounds($mapUtils.getGeoBounds(geometry));\n\t\t\t}\n\t\t}\n\t}\n}\n","import type { MapChart } from \"./MapChart\";\n\nimport { Container, IContainerPrivate, IContainerSettings } from \"../../core/render/Container\";\nimport { Button } from \"../../core/render/Button\";\nimport { Graphics } from \"../../core/render/Graphics\";\nimport { p100 } from \"../../core/util/Percent\";\nimport { MultiDisposer } from \"../../core/util/Disposer\";\n\nexport interface IZoomControlSettings extends IContainerSettings {\n\n}\n\nexport interface IZoomControlPrivate extends IContainerPrivate {\n\n\t/**\n\t * @ignore\n\t */\n\tchart?: MapChart;\n\n}\n\n/**\n * A control that displays button for zooming [[MapChart]] in and out.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-pan-zoom/#Zoom_control} for more information\n * @important\n */\nexport class ZoomControl extends Container {\n\n\t/**\n\t * A [[Button]] for zoom in.\n\t *\n\t * @default Button.new()\n\t */\n\tpublic readonly plusButton: Button = this.children.push(Button.new(this._root, { width: 36, height: 36, themeTags: [\"plus\"] }));\n\n\t/**\n\t * A [[Button]] for zoom out.\n\t *\n\t * @default Button.new()\n\t */\n\tpublic readonly minusButton: Button = this.children.push(Button.new(this._root, { width: 36, height: 36, themeTags: [\"minus\"] }));\n\n\tdeclare public _settings: IZoomControlSettings;\n\tdeclare public _privateSettings: IZoomControlPrivate;\n\n\tpublic static className: string = \"ZoomControl\";\n\tpublic static classNames: Array = Container.classNames.concat([ZoomControl.className]);\n\n\tprotected _disposer: MultiDisposer | undefined;\n\n\tprotected _afterNew() {\n\t\tsuper._afterNew();\n\n\t\tthis.set(\"position\", \"absolute\");\n\n\t\tthis.set(\"layout\", this._root.verticalLayout);\n\t\tthis.set(\"x\", p100);\n\t\tthis.set(\"centerX\", p100);\n\n\t\tthis.set(\"y\", p100);\n\t\tthis.set(\"centerY\", p100);\n\n\t\tthis.set(\"paddingRight\", 10);\n\t\tthis.set(\"paddingBottom\", 10);\n\n\t\tthis.plusButton.setAll({\n\t\t\ticon: Graphics.new(this._root, { themeTags: [\"icon\"] }),\n\t\t\tlayout: undefined\n\t\t});\n\n\t\tthis.minusButton.setAll({\n\t\t\ticon: Graphics.new(this._root, { themeTags: [\"icon\"] }),\n\t\t\tlayout: undefined\n\t\t});\n\n\t}\n\n\tpublic _prepareChildren() {\n\t\tsuper._prepareChildren();\n\n\t\tif (this.isPrivateDirty(\"chart\")) {\n\t\t\tconst chart = this.getPrivate(\"chart\");\n\t\t\tconst previous = this._prevPrivateSettings.chart;\n\t\t\tif (chart) {\n\t\t\t\tthis._disposer = new MultiDisposer([\n\t\t\t\t\tthis.plusButton.events.on(\"click\", () => {\n\t\t\t\t\t\tchart.zoomIn()\n\t\t\t\t\t}),\n\t\t\t\t\tthis.minusButton.events.on(\"click\", () => {\n\t\t\t\t\t\tchart.zoomOut()\n\t\t\t\t\t})])\n\t\t\t}\n\n\t\t\tif (previous && this._disposer) {\n\t\t\t\tthis._disposer.dispose();\n\t\t\t}\n\t\t}\n\t}\n}\n","import {asin, cos, epsilon, sin} from \"../math.js\";\nimport {azimuthalInvert} from \"./azimuthal.js\";\nimport projection from \"./index.js\";\n\nexport function orthographicRaw(x, y) {\n return [cos(y) * sin(x), sin(y)];\n}\n\northographicRaw.invert = azimuthalInvert(asin);\n\nexport default function() {\n return projection(orthographicRaw)\n .scale(249.5)\n .clipAngle(90 + epsilon);\n}\n","import projection from \"./index.js\";\n\nexport function equirectangularRaw(lambda, phi) {\n return [lambda, phi];\n}\n\nequirectangularRaw.invert = equirectangularRaw;\n\nexport default function() {\n return projection(equirectangularRaw)\n .scale(152.63);\n}\n","import {abs, asin, atan2, cos, epsilon, pi, sign, sin, sqrt} from \"../math.js\";\nimport {conicProjection} from \"./conic.js\";\nimport {cylindricalEqualAreaRaw} from \"./cylindricalEqualArea.js\";\n\nexport function conicEqualAreaRaw(y0, y1) {\n var sy0 = sin(y0), n = (sy0 + sin(y1)) / 2;\n\n // Are the parallels symmetrical around the Equator?\n if (abs(n) < epsilon) return cylindricalEqualAreaRaw(y0);\n\n var c = 1 + sy0 * (2 * n - sy0), r0 = sqrt(c) / n;\n\n function project(x, y) {\n var r = sqrt(c - 2 * n * sin(y)) / n;\n return [r * sin(x *= n), r0 - r * cos(x)];\n }\n\n project.invert = function(x, y) {\n var r0y = r0 - y,\n l = atan2(x, abs(r0y)) * sign(r0y);\n if (r0y * n < 0)\n l -= pi * sign(x) * sign(r0y);\n return [l / n, asin((c - (x * x + r0y * r0y) * n * n) / (2 * n))];\n };\n\n return project;\n}\n\nexport default function() {\n return conicProjection(conicEqualAreaRaw)\n .scale(155.424)\n .center([0, 33.6442]);\n}\n","import {asin, cos, sin} from \"../math.js\";\n\nexport function cylindricalEqualAreaRaw(phi0) {\n var cosPhi0 = cos(phi0);\n\n function forward(lambda, phi) {\n return [lambda * cosPhi0, sin(phi) / cosPhi0];\n }\n\n forward.invert = function(x, y) {\n return [x / cosPhi0, asin(y * cosPhi0)];\n };\n\n return forward;\n}\n","import {degrees, pi, radians} from \"../math.js\";\nimport {projectionMutator} from \"./index.js\";\n\nexport function conicProjection(projectAt) {\n var phi0 = 0,\n phi1 = pi / 3,\n m = projectionMutator(projectAt),\n p = m(phi0, phi1);\n\n p.parallels = function(_) {\n return arguments.length ? m(phi0 = _[0] * radians, phi1 = _[1] * radians) : [phi0 * degrees, phi1 * degrees];\n };\n\n return p;\n}\n","import {epsilon} from \"../math.js\";\nimport albers from \"./albers.js\";\nimport conicEqualArea from \"./conicEqualArea.js\";\nimport {fitExtent, fitSize, fitWidth, fitHeight} from \"./fit.js\";\n\n// The projections must have mutually exclusive clip regions on the sphere,\n// as this will avoid emitting interleaving lines and polygons.\nfunction multiplex(streams) {\n var n = streams.length;\n return {\n point: function(x, y) { var i = -1; while (++i < n) streams[i].point(x, y); },\n sphere: function() { var i = -1; while (++i < n) streams[i].sphere(); },\n lineStart: function() { var i = -1; while (++i < n) streams[i].lineStart(); },\n lineEnd: function() { var i = -1; while (++i < n) streams[i].lineEnd(); },\n polygonStart: function() { var i = -1; while (++i < n) streams[i].polygonStart(); },\n polygonEnd: function() { var i = -1; while (++i < n) streams[i].polygonEnd(); }\n };\n}\n\n// A composite projection for the United States, configured by default for\n// 960×500. The projection also works quite well at 960×600 if you change the\n// scale to 1285 and adjust the translate accordingly. The set of standard\n// parallels for each region comes from USGS, which is published here:\n// http://egsc.usgs.gov/isb/pubs/MapProjections/projections.html#albers\nexport default function() {\n var cache,\n cacheStream,\n lower48 = albers(), lower48Point,\n alaska = conicEqualArea().rotate([154, 0]).center([-2, 58.5]).parallels([55, 65]), alaskaPoint, // EPSG:3338\n hawaii = conicEqualArea().rotate([157, 0]).center([-3, 19.9]).parallels([8, 18]), hawaiiPoint, // ESRI:102007\n point, pointStream = {point: function(x, y) { point = [x, y]; }};\n\n function albersUsa(coordinates) {\n var x = coordinates[0], y = coordinates[1];\n return point = null,\n (lower48Point.point(x, y), point)\n || (alaskaPoint.point(x, y), point)\n || (hawaiiPoint.point(x, y), point);\n }\n\n albersUsa.invert = function(coordinates) {\n var k = lower48.scale(),\n t = lower48.translate(),\n x = (coordinates[0] - t[0]) / k,\n y = (coordinates[1] - t[1]) / k;\n return (y >= 0.120 && y < 0.234 && x >= -0.425 && x < -0.214 ? alaska\n : y >= 0.166 && y < 0.234 && x >= -0.214 && x < -0.115 ? hawaii\n : lower48).invert(coordinates);\n };\n\n albersUsa.stream = function(stream) {\n return cache && cacheStream === stream ? cache : cache = multiplex([lower48.stream(cacheStream = stream), alaska.stream(stream), hawaii.stream(stream)]);\n };\n\n albersUsa.precision = function(_) {\n if (!arguments.length) return lower48.precision();\n lower48.precision(_), alaska.precision(_), hawaii.precision(_);\n return reset();\n };\n\n albersUsa.scale = function(_) {\n if (!arguments.length) return lower48.scale();\n lower48.scale(_), alaska.scale(_ * 0.35), hawaii.scale(_);\n return albersUsa.translate(lower48.translate());\n };\n\n albersUsa.translate = function(_) {\n if (!arguments.length) return lower48.translate();\n var k = lower48.scale(), x = +_[0], y = +_[1];\n\n lower48Point = lower48\n .translate(_)\n .clipExtent([[x - 0.455 * k, y - 0.238 * k], [x + 0.455 * k, y + 0.238 * k]])\n .stream(pointStream);\n\n alaskaPoint = alaska\n .translate([x - 0.307 * k, y + 0.201 * k])\n .clipExtent([[x - 0.425 * k + epsilon, y + 0.120 * k + epsilon], [x - 0.214 * k - epsilon, y + 0.234 * k - epsilon]])\n .stream(pointStream);\n\n hawaiiPoint = hawaii\n .translate([x - 0.205 * k, y + 0.212 * k])\n .clipExtent([[x - 0.214 * k + epsilon, y + 0.166 * k + epsilon], [x - 0.115 * k - epsilon, y + 0.234 * k - epsilon]])\n .stream(pointStream);\n\n return reset();\n };\n\n albersUsa.fitExtent = function(extent, object) {\n return fitExtent(albersUsa, extent, object);\n };\n\n albersUsa.fitSize = function(size, object) {\n return fitSize(albersUsa, size, object);\n };\n\n albersUsa.fitWidth = function(width, object) {\n return fitWidth(albersUsa, width, object);\n };\n\n albersUsa.fitHeight = function(height, object) {\n return fitHeight(albersUsa, height, object);\n };\n\n function reset() {\n cache = cacheStream = null;\n return albersUsa;\n }\n\n return albersUsa.scale(1070);\n}\n","import conicEqualArea from \"./conicEqualArea.js\";\n\nexport default function() {\n return conicEqualArea()\n .parallels([29.5, 45.5])\n .scale(1070)\n .translate([480, 250])\n .rotate([96, 0])\n .center([-0.6, 38.7]);\n}\n","import {asin, atan2, cos, sin, sqrt} from \"../math.js\";\n\nexport function azimuthalRaw(scale) {\n return function(x, y) {\n var cx = cos(x),\n cy = cos(y),\n k = scale(cx * cy);\n if (k === Infinity) return [2, 0];\n return [\n k * cy * sin(x),\n k * sin(y)\n ];\n }\n}\n\nexport function azimuthalInvert(angle) {\n return function(x, y) {\n var z = sqrt(x * x + y * y),\n c = angle(z),\n sc = sin(c),\n cc = cos(c);\n return [\n atan2(x * sc, z * cc),\n asin(z && y * sc / z)\n ];\n }\n}\n","import projection from \"./index.js\";\nimport {abs, asin, cos, epsilon2, sin, sqrt} from \"../math.js\";\n\nvar A1 = 1.340264,\n A2 = -0.081106,\n A3 = 0.000893,\n A4 = 0.003796,\n M = sqrt(3) / 2,\n iterations = 12;\n\nexport function equalEarthRaw(lambda, phi) {\n var l = asin(M * sin(phi)), l2 = l * l, l6 = l2 * l2 * l2;\n return [\n lambda * cos(l) / (M * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2))),\n l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2))\n ];\n}\n\nequalEarthRaw.invert = function(x, y) {\n var l = y, l2 = l * l, l6 = l2 * l2 * l2;\n for (var i = 0, delta, fy, fpy; i < iterations; ++i) {\n fy = l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2)) - y;\n fpy = A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2);\n l -= delta = fy / fpy, l2 = l * l, l6 = l2 * l2 * l2;\n if (abs(delta) < epsilon2) break;\n }\n return [\n M * x * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2)) / cos(l),\n asin(sin(l) / M)\n ];\n};\n\nexport default function() {\n return projection(equalEarthRaw)\n .scale(177.158);\n}\n","import projection from \"./index.js\";\nimport {abs, epsilon} from \"../math.js\";\n\nexport function naturalEarth1Raw(lambda, phi) {\n var phi2 = phi * phi, phi4 = phi2 * phi2;\n return [\n lambda * (0.8707 - 0.131979 * phi2 + phi4 * (-0.013791 + phi4 * (0.003971 * phi2 - 0.001529 * phi4))),\n phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4)))\n ];\n}\n\nnaturalEarth1Raw.invert = function(x, y) {\n var phi = y, i = 25, delta;\n do {\n var phi2 = phi * phi, phi4 = phi2 * phi2;\n phi -= delta = (phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4))) - y) /\n (1.007226 + phi2 * (0.015085 * 3 + phi4 * (-0.044475 * 7 + 0.028874 * 9 * phi2 - 0.005916 * 11 * phi4)));\n } while (abs(delta) > epsilon && --i > 0);\n return [\n x / (0.8707 + (phi2 = phi * phi) * (-0.131979 + phi2 * (-0.013791 + phi2 * phi2 * phi2 * (0.003971 - 0.001529 * phi2)))),\n phi\n ];\n};\n\nexport default function() {\n return projection(naturalEarth1Raw)\n .scale(175.295);\n}\n","'use strict';\n\nvar Queue = require('tinyqueue');\n\nif (Queue.default) Queue = Queue.default; // temporary webpack fix\n\nmodule.exports = polylabel;\nmodule.exports.default = polylabel;\n\nfunction polylabel(polygon, precision, debug) {\n precision = precision || 1.0;\n\n // find the bounding box of the outer ring\n var minX, minY, maxX, maxY;\n for (var i = 0; i < polygon[0].length; i++) {\n var p = polygon[0][i];\n if (!i || p[0] < minX) minX = p[0];\n if (!i || p[1] < minY) minY = p[1];\n if (!i || p[0] > maxX) maxX = p[0];\n if (!i || p[1] > maxY) maxY = p[1];\n }\n\n var width = maxX - minX;\n var height = maxY - minY;\n var cellSize = Math.min(width, height);\n var h = cellSize / 2;\n\n if (cellSize === 0) {\n var degeneratePoleOfInaccessibility = [minX, minY];\n degeneratePoleOfInaccessibility.distance = 0;\n return degeneratePoleOfInaccessibility;\n }\n\n // a priority queue of cells in order of their \"potential\" (max distance to polygon)\n var cellQueue = new Queue(undefined, compareMax);\n\n // cover polygon with initial cells\n for (var x = minX; x < maxX; x += cellSize) {\n for (var y = minY; y < maxY; y += cellSize) {\n cellQueue.push(new Cell(x + h, y + h, h, polygon));\n }\n }\n\n // take centroid as the first best guess\n var bestCell = getCentroidCell(polygon);\n\n // special case for rectangular polygons\n var bboxCell = new Cell(minX + width / 2, minY + height / 2, 0, polygon);\n if (bboxCell.d > bestCell.d) bestCell = bboxCell;\n\n var numProbes = cellQueue.length;\n\n while (cellQueue.length) {\n // pick the most promising cell from the queue\n var cell = cellQueue.pop();\n\n // update the best cell if we found a better one\n if (cell.d > bestCell.d) {\n bestCell = cell;\n if (debug) console.log('found best %d after %d probes', Math.round(1e4 * cell.d) / 1e4, numProbes);\n }\n\n // do not drill down further if there's no chance of a better solution\n if (cell.max - bestCell.d <= precision) continue;\n\n // split the cell into four cells\n h = cell.h / 2;\n cellQueue.push(new Cell(cell.x - h, cell.y - h, h, polygon));\n cellQueue.push(new Cell(cell.x + h, cell.y - h, h, polygon));\n cellQueue.push(new Cell(cell.x - h, cell.y + h, h, polygon));\n cellQueue.push(new Cell(cell.x + h, cell.y + h, h, polygon));\n numProbes += 4;\n }\n\n if (debug) {\n console.log('num probes: ' + numProbes);\n console.log('best distance: ' + bestCell.d);\n }\n\n var poleOfInaccessibility = [bestCell.x, bestCell.y];\n poleOfInaccessibility.distance = bestCell.d;\n return poleOfInaccessibility;\n}\n\nfunction compareMax(a, b) {\n return b.max - a.max;\n}\n\nfunction Cell(x, y, h, polygon) {\n this.x = x; // cell center x\n this.y = y; // cell center y\n this.h = h; // half the cell size\n this.d = pointToPolygonDist(x, y, polygon); // distance from cell center to polygon\n this.max = this.d + this.h * Math.SQRT2; // max distance to polygon within a cell\n}\n\n// signed distance from point to polygon outline (negative if point is outside)\nfunction pointToPolygonDist(x, y, polygon) {\n var inside = false;\n var minDistSq = Infinity;\n\n for (var k = 0; k < polygon.length; k++) {\n var ring = polygon[k];\n\n for (var i = 0, len = ring.length, j = len - 1; i < len; j = i++) {\n var a = ring[i];\n var b = ring[j];\n\n if ((a[1] > y !== b[1] > y) &&\n (x < (b[0] - a[0]) * (y - a[1]) / (b[1] - a[1]) + a[0])) inside = !inside;\n\n minDistSq = Math.min(minDistSq, getSegDistSq(x, y, a, b));\n }\n }\n\n return minDistSq === 0 ? 0 : (inside ? 1 : -1) * Math.sqrt(minDistSq);\n}\n\n// get polygon centroid\nfunction getCentroidCell(polygon) {\n var area = 0;\n var x = 0;\n var y = 0;\n var points = polygon[0];\n\n for (var i = 0, len = points.length, j = len - 1; i < len; j = i++) {\n var a = points[i];\n var b = points[j];\n var f = a[0] * b[1] - b[0] * a[1];\n x += (a[0] + b[0]) * f;\n y += (a[1] + b[1]) * f;\n area += f * 3;\n }\n if (area === 0) return new Cell(points[0][0], points[0][1], 0, polygon);\n return new Cell(x / area, y / area, 0, polygon);\n}\n\n// get squared distance from a point to a segment\nfunction getSegDistSq(px, py, a, b) {\n\n var x = a[0];\n var y = a[1];\n var dx = b[0] - x;\n var dy = b[1] - y;\n\n if (dx !== 0 || dy !== 0) {\n\n var t = ((px - x) * dx + (py - y) * dy) / (dx * dx + dy * dy);\n\n if (t > 1) {\n x = b[0];\n y = b[1];\n\n } else if (t > 0) {\n x += dx * t;\n y += dy * t;\n }\n }\n\n dx = px - x;\n dy = py - y;\n\n return dx * dx + dy * dy;\n}\n","\nexport default class TinyQueue {\n constructor(data = [], compare = defaultCompare) {\n this.data = data;\n this.length = this.data.length;\n this.compare = compare;\n\n if (this.length > 0) {\n for (let i = (this.length >> 1) - 1; i >= 0; i--) this._down(i);\n }\n }\n\n push(item) {\n this.data.push(item);\n this.length++;\n this._up(this.length - 1);\n }\n\n pop() {\n if (this.length === 0) return undefined;\n\n const top = this.data[0];\n const bottom = this.data.pop();\n this.length--;\n\n if (this.length > 0) {\n this.data[0] = bottom;\n this._down(0);\n }\n\n return top;\n }\n\n peek() {\n return this.data[0];\n }\n\n _up(pos) {\n const {data, compare} = this;\n const item = data[pos];\n\n while (pos > 0) {\n const parent = (pos - 1) >> 1;\n const current = data[parent];\n if (compare(item, current) >= 0) break;\n data[pos] = current;\n pos = parent;\n }\n\n data[pos] = item;\n }\n\n _down(pos) {\n const {data, compare} = this;\n const halfLength = this.length >> 1;\n const item = data[pos];\n\n while (pos < halfLength) {\n let left = (pos << 1) + 1;\n let best = data[left];\n const right = left + 1;\n\n if (right < this.length && compare(data[right], best) < 0) {\n left = right;\n best = data[right];\n }\n if (compare(best, item) >= 0) break;\n\n data[pos] = best;\n pos = left;\n }\n\n data[pos] = item;\n }\n}\n\nfunction defaultCompare(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n}\n","import * as m from \"./../../dist/es2015/map.js\";\nexport const am5map = m;"],"names":["this","fields","push","_setRawDefault","on","geoJSON","previous","_prevSettings","data","clear","_afterNew","_prepareChildren","_valuesDirty","isDirty","get","undefined","_geoJSONparsed","_parseGeoJSON","id","includes","excludes","length","indexOf","features","type","geometry","console","log","geodataNames","i","len","feature","properties","name","_types","checkInclude","dataItem","dataItems","value","dataObject","dataContext","geometryType","set","processDataItem","madeFromGeoData","events","isEnabled","dispatch","target","_chart","children","moveValue","bulletsContainer","chart","getPrivate","_geometries","markDirtyGeometries","_dispose","series","removeValue","_onDataClear","Series","MapSeries","className","Adder","constructor","_partials","Float64Array","_n","add","x","p","j","y","hi","lo","Math","abs","valueOf","n","epsilon","epsilon2","pi","PI","halfPi","quarterPi","tau","degrees","radians","atan","atan2","cos","ceil","exp","hypot","floor","pow","sin","sign","sqrt","tan","asin","haversin","noop","streamGeometry","stream","streamGeometryType","hasOwnProperty","lengthSum","lambda0","sinPhi0","cosPhi0","streamObjectType","Feature","object","FeatureCollection","Sphere","sphere","Point","coordinates","point","MultiPoint","LineString","streamLine","MultiLineString","Polygon","streamPolygon","MultiPolygon","GeometryCollection","geometries","closed","coordinate","lineStart","lineEnd","polygonStart","polygonEnd","lengthStream","lengthPointFirst","lengthLineEnd","lambda","phi","lengthPoint","sinPhi","cosPhi","delta","cosDelta","z","a","b","_beforeChanged","_projectionDirty","clipAngle","precision","_clear","_display","context","markDirty","_clearDirty","position","totalDistance","currentDistance","positionA","positionB","pointA","pointB","segments","s","segment","positionAB","x0","y0","x1","y1","cy0","sy0","cy1","sy1","kx0","ky0","kx1","ky1","d","k","interpolate","t","B","A","distance","longitude","latitude","Graphics","MapLine","List","Template","_root","mapLines","template","mapLine","make","_setDataItem","markDirtyProjection","makeMapLine","pointsToConnect","markDirtyValues","setPrivate","coords","setRaw","disposeDataItem","dispose","classNames","concat","MapLineSeries","range","start","stop","step","arguments","max","Array","graticuleX","dy","map","graticuleY","dx","makeDataItem","_dataItem","_generate","_updateChildren","graticule","X1","X0","Y1","Y0","X","Y","DX","DY","lines","filter","outline","slice","reverse","extent","_","extentMajor","extentMinor","stepMajor","stepMinor","GraticuleSeries","compose","invert","rotationIdentity","round","rotateRadians","deltaLambda","deltaPhi","deltaGamma","rotationLambda","rotationPhiGamma","forwardRotationLambda","rotation","cosDeltaPhi","sinDeltaPhi","cosDeltaGamma","sinDeltaGamma","line","m","rejoin","pop","shift","result","Intersection","points","other","entry","o","e","v","compareIntersection","startInside","subject","clip","forEach","p0","p1","pointEqual","sort","current","isSubject","array","spherical","cartesian","cartesianDot","cartesianCross","cartesianAddInPlace","cartesianScale","vector","cartesianNormalizeInPlace","l","merge","arrays","from","flatten","pointVisible","clipLine","sink","polygon","ring","ringBuffer","ringSink","polygonStarted","pointRing","ringStart","ringEnd","normal","angle","winding","sum","point0","phi0","lambda1","sinPhi1","cosPhi1","point1","phi1","absDelta","antimeridian","arc","intersection","phiArc","polygonContains","pointLine","clean","ringSegments","validSegment","NaN","sign0","sign1","sinLambda0Lambda1","clipAntimeridianIntersect","to","direction","circleStream","radius","t0","t1","cosRadius","sinRadius","circleRadius","acos","cr","smallRadius","notHemisphere","visible","intersect","two","n1","n2","n2n2","n1n2","determinant","c1","c2","n1xn2","u","w","uu","t2","q","polar","q1","code","r","c0","v0","v00","point2","c","clipMax","clipMin","clipRectangle","a1","corner","comparePoint","ca","cb","x__","y__","v__","x_","y_","v_","first","activeStream","bufferStream","clipStream","linePoint","a0","b0","b1","polygonInside","cleanInside","min","ax","ay","transformer","methods","TransformStream","key","prototype","Infinity","boundsStream","bounds","fit","projection","fitBounds","clipExtent","scale","translate","fitExtent","h","fitSize","size","fitWidth","width","fitHeight","height","cosMinDistance","project","delta2","resampleLineTo","depth","d2","phi2","lambda2","x2","y2","dx2","dy2","dz","lambda00","x00","y00","a00","b00","c00","resampleStream","ringPoint","resampleNone","transformRadians","scaleTranslateRotate","sx","sy","alpha","transform","scaleTranslate","cosAlpha","sinAlpha","ai","bi","ci","fi","projectionMutator","projectAt","rotate","projectResample","projectTransform","projectRotateTransform","cache","cacheStream","theta","preclip","postclip","identity","recenter","center","apply","resample","reset","transformRotate","reflectX","reflectY","mercatorRaw","reclip","forward","mercatorProjection","setupDefaultRules","rule","ic","interfaceColors","bind","setAll","panX","panY","pinchZoom","zoomStep","zoomLevel","rotationX","rotationY","rotationZ","maxZoomLevel","minZoomLevel","wheelY","wheelX","animationEasing","wheelEasing","wheelDuration","wheelSensitivity","maxPanOut","centerMapOnZoomOut","role","clipFront","clipBack","autoScale","isMeasured","fillOpacity","strokeWidth","strokeOpacity","draw","display","moveTo","lineTo","Theme","areaSum","areaRingSum","areaStream","areaRingStart","areaRingEnd","area","areaPointFirst","areaPoint","Z0","Z1","X2","Y2","Z2","centroidStream","centroidPoint","centroidLineStart","centroidLineEnd","centroidRingStart","centroidRingEnd","centroid","centroidPointFirstLine","centroidPointLine","centroidPointFirstRing","centroidPointRing","PathContext","_context","_radius","pointRadius","_line","_point","closePath","lengthRing","PathString","_string","_circle","join","W0","W1","phi00","z0","centroidPointCartesian","centroidLinePointFirst","centroidLinePoint","centroidRingPointFirst","centroidRingPoint","cx","cy","cz","deltaSum","ranges","areaRing","dLambda","sdLambda","adLambda","boundsLineStart","boundsLineEnd","boundsRingPoint","boundsRingStart","boundsRingEnd","inflection","phii","lambdai","rangeCompare","rangeContains","getGeoCircle","geoPoint","constant","circle","getGeoCentroid","getGeoBounds","merged","deltaMax","left","right","top","bottom","getGeoRectangle","north","east","south","west","multiPolygon","stepLong","stepLat","ln","surface","ll","lt","normalizeGeoPoint","wrapAngleTo180","latitude180","path","projectionStream","contextStream","measure","setPrivateRaw","_geoCentroid","_geoBounds","chartContainer","_wheelDp","event","wheelEvent","originalEvent","preventDefault","toLocal","_handleWheelZoom","deltaY","_handleWheelRotateY","_handleWheelRotateX","deltaX","_disposers","innerWidth","innerHeight","_makeGeoPath","_fitMap","prev","hw","hh","centerLocation","xy","xx","yy","_handleSetWheel","previousGeometries","_geometryColection","_dirtyGeometries","each","_pw","_ph","newScale","_centerLocation","zoomControl","_disposeProperty","isType","bullets","bullet","sprite","_setUpTouch","_centerX","_centerY","_mapBounds","prevGeoBounds","_prevGeoBounds","_dispatchBounds","_mapFitted","homeGeoPoint","duration","zoomToGeoPoint","_afterChanged","cancelTouch","_defaultThemes","MapChartDefaultTheme","_settings","themeTags","seriesContainer","Rectangle","fill","Color","_handleChartDown","_handleChartUp","_handleChartMove","license","match","_showBranding","_downZoomLevel","count","_downPoints","_downTranslateX","_downTranslateY","_downRotationX","_downRotationY","_downRotationZ","downId","_getDownPointId","movePoint","_movePoints","bg","enableType","_za","_txa","_tya","_rxa","_rya","downPoint","l0","l1","_pLon","_pLat","_event","downPoints","movePoints","downPoint0","downPoint1","movePoint0","movePoint1","initialDistance","level","moveCenter","downCenter","tx","ty","_getDownPoint","downPointId","pointerId","_handlePinch","local","disableType","ww","downLocation","location","easing","animate","newZoomLevel","zoomToPoint","geoBounds","mapBounds","convert","zl","readerAlert","_t","locale","SerialChart","MapChart","_positionBullets","bulletFunction","_makeBullet","lineDataItem","lineDI","getDataItemById","polygonDataItem","polygonDI","positionOnLine","visualCentroid","positionToGeoPoint","geoPoint0","geoPoint1","_positionBulletReal","index","_index","geoPath","MapPointSeries","isHover","showTooltip","biggestArea","MapPolygon","mapPolygons","mapPolygon","makeMapPolygon","_addGeometry","_removeGeometry","zoomToGeoBounds","MapPolygonSeries","Button","verticalLayout","plusButton","icon","layout","minusButton","isPrivateDirty","_prevPrivateSettings","_disposer","zoomIn","zoomOut","Container","ZoomControl","orthographicRaw","equirectangularRaw","conicEqualAreaRaw","cylindricalEqualAreaRaw","r0","r0y","parallels","conicProjection","lower48Point","alaskaPoint","hawaiiPoint","lower48","conicEqualArea","alaska","hawaii","pointStream","albersUsa","streams","sc","cc","azimuthalInvert","A1","A2","A3","A4","M","equalEarthRaw","l2","l6","naturalEarth1Raw","phi4","Queue","polylabel","debug","minX","minY","maxX","maxY","cellSize","degeneratePoleOfInaccessibility","cellQueue","compareMax","Cell","bestCell","f","getCentroidCell","bboxCell","numProbes","cell","poleOfInaccessibility","inside","minDistSq","getSegDistSq","pointToPolygonDist","SQRT2","px","py","default","module","exports","TinyQueue","compare","defaultCompare","_down","item","_up","peek","pos","parent","halfLength","best","am5map"],"sourceRoot":""}